From patchwork Tue Mar 21 02:31:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 72642 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1566394wrt; Mon, 20 Mar 2023 20:28:38 -0700 (PDT) X-Google-Smtp-Source: AK7set8o4QUCfoDYiPs9kaxDSCE1iss8fwEmbVuM7Bg28eHDmSloFAyHi6mKU5yLyS1iF1/D1S5I X-Received: by 2002:a17:902:f102:b0:1a1:e33e:2606 with SMTP id e2-20020a170902f10200b001a1e33e2606mr675271plb.25.1679369318526; Mon, 20 Mar 2023 20:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679369318; cv=none; d=google.com; s=arc-20160816; b=YC+E4tOL2JIkl/HlPB4eW1EDi83kZ+jFXxklyW8ZycDfMO52bVVtq9tSVJHNsZbxcG JCxQPn4oZsdgKsh0wZHxvd/Ynu1kEL82GMJKhzKvsrycBo9W89+h21r3KWx58Exi+63X YI6Uwjx0+C6VcJEs6gIWXOeST108x6QLev3OcOOIZlqLdFqC/qNWrELR+jn4XMvB23xm ezaA+wsONyxLhAA4K4sLUOQzqIWWFwXgdBixNNc163AosVqVWMEFVLV304XHU9KCcmb2 ZHEhlQw2gYExPw78YapRtCCqp8L8FK+D0OoR8LLtKlt/+gaZylQJFzcweYNuzm0DfIOM +54Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sTo3F/m/SxPHAqEXuebTGyXW2LKYPQRkLUm8e3SciVw=; b=Td73zFYlUkQFG4Ftq0rHeBCHS3n4IDOSuwA9rqBf+OkFPsfW3qwERm1FNzfnv7MZ9X 4AQMQ+blz3nCJDY1A0Y6MfM1we+wwH4WmftVpdvOpKw+uCHpLHtRMMwW3JtJ3fKo+XAL L2dmfk1orjvfqPEKtvSvoOM2G6WNW9Sjxe0F7SRxEYcohrtEbrx1k1yfNUWSK/GDELD4 d0hdjfZeja26hkXCZgHnlKSkPNRn9UI37CVHhAR/XpCorBmFGmzdmnKpsjOj9Qv/j8rN t+QZQpw7UR5Q+cfVToSFaFlCq6xgW6YLb0Wn++wP9YHrUkGjvg9NU7QXvsPZH/h0BcJa 98eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jtWm45Hr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u7-20020a17090341c700b0019ac7319ecdsi3268963ple.409.2023.03.20.20.28.26; Mon, 20 Mar 2023 20:28:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jtWm45Hr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229494AbjCUCcP (ORCPT + 99 others); Mon, 20 Mar 2023 22:32:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbjCUCcL (ORCPT ); Mon, 20 Mar 2023 22:32:11 -0400 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB92A36FE2; Mon, 20 Mar 2023 19:31:49 -0700 (PDT) Received: by mail-io1-xd2e.google.com with SMTP id f14so6361614iow.5; Mon, 20 Mar 2023 19:31:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679365909; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sTo3F/m/SxPHAqEXuebTGyXW2LKYPQRkLUm8e3SciVw=; b=jtWm45HrEd24L4clToDHgC5saIGxP00MYJ3iEBnl+HmrGuNeaWFNY0Y2ArHLweqAAy Xuspfga6nrYvqO1IUmUGeUeolYCixybPy7ejgqDex647tY9G6Ys1q41Uvbjcr4c37yGv WxiZld+rhzzulzvvPFOQwqyiOmQzEt1TCQSo26UTMk7G4SwpU1Ds2iH9FKJU4L9FUFu2 EsHlNqd++9PdTtCKOp0Jw9WI5hdVvQ26NKHKRmCwnEugnoZ/KdzdQXQqxKH813DH2vgI VE4qUcT4HUVoS/ifDGZ5ZLoss+RCVWrONgBPipOJOT6PQwGoeb7y2cIYoTYBTIhiczSM WFQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679365909; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sTo3F/m/SxPHAqEXuebTGyXW2LKYPQRkLUm8e3SciVw=; b=Nf4X6MFCD8ZkiWotau4qrop44lNkN1vvfA3t20zVI9lkz/NRKG56aLfSW2Nh7yg/f3 O8WQR/zps0+tY+DVugiOXfEIpelCJ74Un/kmjxmYNDZDYVKPIrwND5o6H+AuK/kprIqQ 3XNpYeFI6nSGkD6VkPMrxQQMc8RAl4P/5YeXGUVHa2yi++dr2uyV9a3eQLKUYazDkFnw EhaXij6HDHjjtlD3Z2n6fiYxqHYKNmK89wGD3HASBG5iwH66hiJzhuUicUcFcyczqZ8h nSCw0dUThapssUdGNGjp1+4C8KN3sSVCJjFLHmk/vJIUbRha+UlKoHTjoLbQc8d36FJp 0dEg== X-Gm-Message-State: AO0yUKVehGuSlKVtKPzgGGvBBKQ6ZNDA8Svmrc35WoKgV/VvwekOIBgt s00KVBYqM+7UvDC4FRhJlGWoOOw/sh0= X-Received: by 2002:a5d:895a:0:b0:74c:e456:629d with SMTP id b26-20020a5d895a000000b0074ce456629dmr699641iot.7.1679365908946; Mon, 20 Mar 2023 19:31:48 -0700 (PDT) Received: from aford-IdeaCentre-A730.lan ([2601:447:d001:897f:1387:3268:b209:f4ec]) by smtp.gmail.com with ESMTPSA id a28-20020a027a1c000000b004065ad317fdsm2241200jac.151.2023.03.20.19.31.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Mar 2023 19:31:48 -0700 (PDT) From: Adam Ford To: linux-clk@vger.kernel.org Cc: aford@beaconembedded.com, Adam Ford , Abel Vesa , Peng Fan , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 1/4] clk: imx: composite-8m: Add support to determine_rate Date: Mon, 20 Mar 2023 21:31:33 -0500 Message-Id: <20230321023136.57986-2-aford173@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230321023136.57986-1-aford173@gmail.com> References: <20230321023136.57986-1-aford173@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760946362810138992?= X-GMAIL-MSGID: =?utf-8?q?1760946362810138992?= Similar to imx/clk-composite-93 and imx/clk-divider-gate, the imx8m_clk_composite_divider_ops can support determine_rate. Without this the parent clocks are set to a fixed value, and if a consumer needs a slower reate, the clock is divided, but the division is only as good as the parent clock rate. With this added, the system can attempt to adjust the parent rate if the proper flags are set which can lead to a more precise clock value. Signed-off-by: Adam Ford --- V2: No Change diff --git a/drivers/clk/imx/clk-composite-8m.c b/drivers/clk/imx/clk-composite-8m.c index cbf0d7955a00..3b63e47f088f 100644 --- a/drivers/clk/imx/clk-composite-8m.c +++ b/drivers/clk/imx/clk-composite-8m.c @@ -119,10 +119,17 @@ static int imx8m_clk_composite_divider_set_rate(struct clk_hw *hw, return ret; } +static int clk_divider_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) +{ + return clk_divider_ops.determine_rate(hw, req); +} + static const struct clk_ops imx8m_clk_composite_divider_ops = { .recalc_rate = imx8m_clk_composite_divider_recalc_rate, .round_rate = imx8m_clk_composite_divider_round_rate, .set_rate = imx8m_clk_composite_divider_set_rate, + .determine_rate = clk_divider_determine_rate, }; static u8 imx8m_clk_composite_mux_get_parent(struct clk_hw *hw) From patchwork Tue Mar 21 02:31:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 72640 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1558736wrt; Mon, 20 Mar 2023 20:02:49 -0700 (PDT) X-Google-Smtp-Source: AK7set8au0bXRKDg/teVyGvAc5UAgzzyAo/Im3q2vkhKa/ZalTvRS4v2GccF1skgSQ3P0b1m9O0w X-Received: by 2002:a17:903:645:b0:19c:d309:4612 with SMTP id kh5-20020a170903064500b0019cd3094612mr719092plb.6.1679367769445; Mon, 20 Mar 2023 20:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679367769; cv=none; d=google.com; s=arc-20160816; b=wFryJHvYRPeG08Ne/0JajD/XutTbfB98OcoT3X/eonmJYf+sOvmWEmpOQehR8OXKH0 oDQloXfzDtJ+mtv8GEWM4C6MEEZ8NdE4rZvo9+U0vhOzcy8khfZWU3LK6YZOP9ZuLLPt Y47V+L5eKl6Qi2apX6qCMAOJEbUeUkcEeEjGjTGOOmpwdTJTCtEu7hwBAyzJTYxF2wt3 0GIs5+3n9dYfumM6P9bgZHlU7C1wIf3CIfgig52gWz012ce1tKuSZKexzA1fGsUQFhui S+9l8QXMYNiMoKS37uNMAJR+XCl30MHLdz8jYqfjmHMvSU/T+E0x7kll6fLUYvoCERXR UFMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YBy7Uhw8n9XJJSSN0OA/4i8xS/Flp3zKZhGIeWwusVM=; b=Y7UDiG5ig9Rwa/jWWi/ZCswSj3QX2VpLp4r9HXp4YLPRIPZGnMoksH+MfjQSmw28Sh meyOUDUxnnx5S36oaaEjXIpfdg2NDkjJueH4BN6AkX5KCdXD2jP2+ecC3g2h4smwTXv9 6GGs+9z6tgzXWdDZobXBmINV6GhxZ770fmuApTmRuAM8AR1iu8azlcq7Mk0BwHNFjNr9 i9OzsjzXtlRf11RqFnMrHfs/Zp4aShZXPBaALTztRphFcT639Idcrimyb1JVB93Y4OgI dtanuUU3wdup8X/UAsVVWw5qrHzymykcfmCpztQaCKzWHw9ES5i2vysHYW4ayRUf5omb RW9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iQatrVrS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kf15-20020a17090305cf00b0019ceb4b753fsi11755313plb.26.2023.03.20.20.02.34; Mon, 20 Mar 2023 20:02:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iQatrVrS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229958AbjCUCcU (ORCPT + 99 others); Mon, 20 Mar 2023 22:32:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229898AbjCUCcL (ORCPT ); Mon, 20 Mar 2023 22:32:11 -0400 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80B4539296; Mon, 20 Mar 2023 19:31:51 -0700 (PDT) Received: by mail-il1-x133.google.com with SMTP id h11so7481081ild.11; Mon, 20 Mar 2023 19:31:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679365910; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YBy7Uhw8n9XJJSSN0OA/4i8xS/Flp3zKZhGIeWwusVM=; b=iQatrVrSpMzWM30D/QDBzwK1QzX3H9/6UAnHFb1yBrZ6JUUw82BPT4EPusvdKi6pjl VuNXhHXYsPY0VGRKIy+IFLw9Rd2Zrad/wTtin7ziRywR5F3PfHy6TzJbdW0QD9TtFRPs FUSrOocS0aBhsv4wedUXG3LohtmMEzWfFfwLAHBDAA8Fi4ZmCz4sbxjcNlqrT49HgIkv mKIOPPmNS/VYSkKTIRvR+9qZ/cTa3lKow3n2Uh04LLP31Yt+y+r+Y6pYvshtyyGcWEQ7 xAzRfovnLhDkFlLpPMaXkyG0Te9DdSXthpmauHL38b82JH0BbNKSBYf33V+sLcDaPwiT lPCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679365910; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YBy7Uhw8n9XJJSSN0OA/4i8xS/Flp3zKZhGIeWwusVM=; b=yA3snMwm6qpI1yZXWRNF8V1q7xk+5Tp+hmEswu+C03a2Yo5PRx+j7R8vCCTBzGM6Fp TyNZFYE8nGzHzxU/NNUeZtTVVYde6WacxegIQDcetdB75HWQlaSdDeYUhpE/H03U/gwY YVaEddzDulOYpyLx59G0yy4jdHEDjpZ9ZjNknj2T2rOj1MCHWmTwLqqzghYiie4qGxh8 Nt+6T0++VXrdYMQmFZyRD37L5T2TxdiLvOw6FsQHi8yntFNPxh1H7AY9aZ3USRCBnx1P voUb8o+4s1y9+fsBL6q9keKJoKoQztHiHvL0reWyUB5YDlsjfGMzqSK9q5TuwLQR1ILp LncA== X-Gm-Message-State: AO0yUKULXSZ0XSbLUsOx+7PcNcmWwY+/f5Hh7h/O049Qs7PVHSf2umCc uhxMA8BPimPoxtMbroQEHRac/1uiNqI= X-Received: by 2002:a92:d312:0:b0:318:aac7:d7aa with SMTP id x18-20020a92d312000000b00318aac7d7aamr517200ila.29.1679365910474; Mon, 20 Mar 2023 19:31:50 -0700 (PDT) Received: from aford-IdeaCentre-A730.lan ([2601:447:d001:897f:1387:3268:b209:f4ec]) by smtp.gmail.com with ESMTPSA id a28-20020a027a1c000000b004065ad317fdsm2241200jac.151.2023.03.20.19.31.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Mar 2023 19:31:50 -0700 (PDT) From: Adam Ford To: linux-clk@vger.kernel.org Cc: aford@beaconembedded.com, Adam Ford , Abel Vesa , Peng Fan , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 2/4] clk: imx: Add imx8m_clk_hw_composite_flags macro Date: Mon, 20 Mar 2023 21:31:34 -0500 Message-Id: <20230321023136.57986-3-aford173@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230321023136.57986-1-aford173@gmail.com> References: <20230321023136.57986-1-aford173@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760944737915728709?= X-GMAIL-MSGID: =?utf-8?q?1760944737915728709?= In order to set custom flags to imx8m_clk_hw_composite, split it off into a separate macro which can accept additional flags. Signed-off-by: Adam Ford --- V2: Split into its own patch and re-order to fix build error diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 3d94722bbf99..621b0e84ef27 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -417,6 +417,10 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name, _imx8m_clk_hw_composite(name, parent_names, reg, \ 0, IMX_COMPOSITE_CLK_FLAGS_DEFAULT) +#define imx8m_clk_hw_composite_flags(name, parent_names, reg, flags) \ + _imx8m_clk_hw_composite(name, parent_names, reg, \ + 0, IMX_COMPOSITE_CLK_FLAGS_DEFAULT | flags) + #define imx8m_clk_hw_composite_critical(name, parent_names, reg) \ _imx8m_clk_hw_composite(name, parent_names, reg, \ 0, IMX_COMPOSITE_CLK_FLAGS_CRITICAL) From patchwork Tue Mar 21 02:31:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 72638 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1555569wrt; Mon, 20 Mar 2023 19:52:50 -0700 (PDT) X-Google-Smtp-Source: AK7set8JP1y/qfwWyJAcRaMUo680+P1uaEkFeHxvvMuD62uaYSiJDMbPezK0vNlOVzB2fGuF5e6I X-Received: by 2002:a17:90b:38c7:b0:23c:61f:2be5 with SMTP id nn7-20020a17090b38c700b0023c061f2be5mr929032pjb.18.1679367170188; Mon, 20 Mar 2023 19:52:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679367170; cv=none; d=google.com; s=arc-20160816; b=pkydilNoBytCpHLfVxuVY2+K67PuFi/0FwQVggWLSf7Fm/a/THZXr5lyPmOZZOgsat OdSyOsyhxbgpc3aon/L5m/lm3JrbY+7lkTs8uAhG5MgY2vSjsDzgKtj9kzckV79gjGr6 HFxM8QlBjqWYgO0ffotq9Cu0vaqR6IQkICFmkUowOO3oPM2M4jm5/GdILKmanpG4VqzM SztHRSpTGlj1EyonflZwu1xgIyZDVe394TF8/wRhGzPva6cXL2L+dLfyz0Vxx9/GMmSe 5F2HioS7NV+m9KG182vlu/SX1LW/PcVfStIec+B1PhP44pcdZSoDHCsw4rsomgo323gu kyEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=n/mm5G0PkOndQQapwu4nkn1W5qAmcqtIfUJayOecLk0=; b=BXNVynEE7W/7lZq/IncTey71TYRWrxgtvM2mLC8Tz3TL26xirD73xJuoZCx5mCn92G 6uG4h0J59pviia/DxtOhUzRulkshFFfJbNHkUXqGSIN4hd8fGXK0G61anQnBjMySBrg0 EwJZQzsn1avb1Calec4wd3vJNKbKwP1JuR2/LaXTi9/1s7mKDpO/+/Oh2MOhhRwsVyf0 PQJJS3MOVhc642TSJe1U/hHzwnTgKPRCr3AjA42cqMLYzR+Dha9USxxlwZ7Lbs1rYy/f 9lkhOxALj/Jt07I4h2RduUK46xrLpthHexlja5l1pH/s9to+ayfiCfienYm/8kyw4YN8 81mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=njQQ2EZ6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h14-20020a17090adb8e00b0023def94be5esi11826932pjv.20.2023.03.20.19.52.37; Mon, 20 Mar 2023 19:52:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=njQQ2EZ6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229975AbjCUCcW (ORCPT + 99 others); Mon, 20 Mar 2023 22:32:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229901AbjCUCcM (ORCPT ); Mon, 20 Mar 2023 22:32:12 -0400 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65FB3399D3; Mon, 20 Mar 2023 19:31:53 -0700 (PDT) Received: by mail-il1-x12f.google.com with SMTP id r4so7490550ilt.8; Mon, 20 Mar 2023 19:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679365912; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=n/mm5G0PkOndQQapwu4nkn1W5qAmcqtIfUJayOecLk0=; b=njQQ2EZ6+w4LBgLXRCDOA1u/7yBrAiap9M56rD9qLhp8bs3ohxOy5MjiVFuMarc+PJ 5ifchgcAVvsBA0HIYA90NPsQau9ZJgJ/qGCV6HN5EINCiiIlTxhXUR3XOyvEPQVdHsPA wVAhNWso3D8bz+51lpszZqRXycM+P/1iiJN2DrYsP8qcv5XW0HVew+5IfCT3Kc65xenM Sa7cu0z4L5h9CLJPUM/ndxB7u421CfqPkUBXh8oGkkCx425O22GJEiuA1BuxDMmEsjsy 0rSGTSgWh6uqZEow46y6hGw+FxlxAJ9MeeL6dtSnLlkkrivn0u6RSGmO1YipG8O5f2BE 5z1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679365912; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n/mm5G0PkOndQQapwu4nkn1W5qAmcqtIfUJayOecLk0=; b=frNiWb9f0pHIbIAbnTJafmXBvEKtoob6DZ/vAxBUYPpI9PYlXEf+MtPKOnC3qpYw0D 5ObWXEjxMtNE+YEWkvQt6Kkc5IJanBrRszhnMTpWbC3aHBRiyZcNLwxfZofxXSzv3eNz fC3Ib5E74bUIRnGQU/azWZAHbpDMR7Md6KuC+YICW6qOvC/I4x3YOsrMd9Dt9L/2S0KX y1sBsXUnj+wBopc7Ky0AcEMMlZ/bZED8nQ8aai9NB1jPKqavOgAIrPn3IPVTYtU6dyRN 08+RE64Bs0WSsl+tjR0A4DYLIhySXZqzkk9ZWnr1w2GadUQF7vHG1w15MMpHsgz1BZsg M81g== X-Gm-Message-State: AO0yUKXDjEXXhirBybsSpgYAKpz7NkJ2SujF2J5GOSEIDtQuZrCiYNxJ C5HSlKxXrilGsrIMmC0J54/uWzFl/84= X-Received: by 2002:a92:4b0a:0:b0:317:93dc:10f5 with SMTP id m10-20020a924b0a000000b0031793dc10f5mr524195ilg.19.1679365912239; Mon, 20 Mar 2023 19:31:52 -0700 (PDT) Received: from aford-IdeaCentre-A730.lan ([2601:447:d001:897f:1387:3268:b209:f4ec]) by smtp.gmail.com with ESMTPSA id a28-20020a027a1c000000b004065ad317fdsm2241200jac.151.2023.03.20.19.31.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Mar 2023 19:31:51 -0700 (PDT) From: Adam Ford To: linux-clk@vger.kernel.org Cc: aford@beaconembedded.com, Adam Ford , Abel Vesa , Peng Fan , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 3/4] clk: imx8mm: Let IMX8MM_CLK_LCDIF_PIXEL set parent rate Date: Mon, 20 Mar 2023 21:31:35 -0500 Message-Id: <20230321023136.57986-4-aford173@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230321023136.57986-1-aford173@gmail.com> References: <20230321023136.57986-1-aford173@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760944109741967265?= X-GMAIL-MSGID: =?utf-8?q?1760944109741967265?= By default the display pixel clock needs to be evenly divide down from 594MHz which rules out a significant number of resolution and refresh rates. The current clock tree looks something like: video_pll1 594000000 video_pll1_bypass 594000000 video_pll1_out 594000000 lcdif_pixel 148500000 Now that composite-8m supports determine_rate, we can allow lcdif_pixel to set the parent rate which then switches every clock in the chain to a new frequency when lcdif_pixel cannot evenly divide from video_pll1_out. Signed-off-by: Adam Ford --- V2: No Change diff --git a/drivers/clk/imx/clk-imx8mm.c b/drivers/clk/imx/clk-imx8mm.c index b618892170f2..075f643e3f35 100644 --- a/drivers/clk/imx/clk-imx8mm.c +++ b/drivers/clk/imx/clk-imx8mm.c @@ -468,7 +468,7 @@ static int imx8mm_clocks_probe(struct platform_device *pdev) hws[IMX8MM_CLK_PCIE1_PHY] = imx8m_clk_hw_composite("pcie1_phy", imx8mm_pcie1_phy_sels, base + 0xa380); hws[IMX8MM_CLK_PCIE1_AUX] = imx8m_clk_hw_composite("pcie1_aux", imx8mm_pcie1_aux_sels, base + 0xa400); hws[IMX8MM_CLK_DC_PIXEL] = imx8m_clk_hw_composite("dc_pixel", imx8mm_dc_pixel_sels, base + 0xa480); - hws[IMX8MM_CLK_LCDIF_PIXEL] = imx8m_clk_hw_composite("lcdif_pixel", imx8mm_lcdif_pixel_sels, base + 0xa500); + hws[IMX8MM_CLK_LCDIF_PIXEL] = imx8m_clk_hw_composite_flags("lcdif_pixel", imx8mm_lcdif_pixel_sels, base + 0xa500, CLK_SET_RATE_PARENT); hws[IMX8MM_CLK_SAI1] = imx8m_clk_hw_composite("sai1", imx8mm_sai1_sels, base + 0xa580); hws[IMX8MM_CLK_SAI2] = imx8m_clk_hw_composite("sai2", imx8mm_sai2_sels, base + 0xa600); hws[IMX8MM_CLK_SAI3] = imx8m_clk_hw_composite("sai3", imx8mm_sai3_sels, base + 0xa680); From patchwork Tue Mar 21 02:31:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 72637 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1554128wrt; Mon, 20 Mar 2023 19:47:30 -0700 (PDT) X-Google-Smtp-Source: AK7set+dC88NeXhTW7IIxsIELG4BcXAM3dPDwa8OkhpyLzjHaHulvNgZLgOLx3FvltAPc1Ujwdr7 X-Received: by 2002:a17:902:c944:b0:1a0:53f3:3761 with SMTP id i4-20020a170902c94400b001a053f33761mr1776318pla.15.1679366850607; Mon, 20 Mar 2023 19:47:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679366850; cv=none; d=google.com; s=arc-20160816; b=aKEoxWLOIeab+TJDfkCu8TE1ft74i6Tr3xOgLu9XEURP8dKKduEvgekQe3QrxwS2ld rnkzhkZv+6RYn/I6SXKzgUc8vEsbwkfkqC78j4fhePJe5XSkM4qB168DCrPELBRKsZkG u6EXXvTCyXTOFGKcR77O0N/3wBmvvfwjU32KDzOf8NLrdScdM6kWLWH+onJ9G3IA8sTh 3udE2iKG1oqUmn4CO9btXWpHTYLAV3DbkklaW/GLAPW7D+y/Rrw3j8L1GaEcZRI8IO0o hT5hIbzrZzwYec1rPfqI4CVP7SI278vw/XO+xMCx4ObOPA6WCcCViggSqA1myEHIfbzf qZ1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dqpGcS63yc5cSPHmxqdpFofUmCewSZ11m39gJLQd6jk=; b=RprOWkHLRb003aqg+GpTfwEyxSWRZV9rf2QIzVCaPp080XJrxaV9oszkkyaFlj4GDR 2CVRhxjoqq5pMaotoAt02/H97sZ0sYo0YpAWiZ91KwlNU2jSEhkzCDhTtDXIcZM8Wh86 8z8icu/gJiE/9h2YwzFBeFqkJBQ1+YjIlJ5mA0+iBKLcRd7nW1y4lRZvV5ZDkbCzgAD/ efYbTzWuqCdcJ2Sbwx8amBgSUCl+pE+JkZzLVJ+oSjKbHiDCT46LJkTZNkuN/a1A1s5a UAt5mIELMXQpiPGomq5BJEkh9dM3l5Pw8vWpTisJ09iumnrGWwJsdJIGopSy0SiCCWl9 Wa1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XJK8bYuA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x8-20020a1709027c0800b0019e6763b110si11248513pll.232.2023.03.20.19.47.15; Mon, 20 Mar 2023 19:47:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XJK8bYuA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229980AbjCUCc0 (ORCPT + 99 others); Mon, 20 Mar 2023 22:32:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229916AbjCUCcO (ORCPT ); Mon, 20 Mar 2023 22:32:14 -0400 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B977A39283; Mon, 20 Mar 2023 19:31:54 -0700 (PDT) Received: by mail-il1-x129.google.com with SMTP id h11so7481127ild.11; Mon, 20 Mar 2023 19:31:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679365914; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dqpGcS63yc5cSPHmxqdpFofUmCewSZ11m39gJLQd6jk=; b=XJK8bYuAYWV4i+jlGHDK0/eQ6IRVok7DNw6IJTnUYWwb4ig0zAAX0SIU3PHXgfpnJt 2HQF2Umxf9xDQihRG/fSD65jlmjzeBcSQUgPywH4RijcHEjUSbGWDZc3WgourQC8J4Ic dzn+iNwn5DrCUANEZUqD28UUJtZUpM8a5pOsNwo6uG2rE8ZKmrDjJD/biWzU+f5dPpli W0R7BtzGCR9ZCu8ITtypWIWuM74mjNg/ZBV8eh+yGx8Vcs8iq4Z283Ktyx22dxd4dSNM AvPqHZNsn7l+K+zxiQr0551r7gtRKAEZWwPy0Bth2GJaTKOlGRMbuQ6g0ozw28kRm4a8 oe8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679365914; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dqpGcS63yc5cSPHmxqdpFofUmCewSZ11m39gJLQd6jk=; b=NMzgIDHeFlHWexDRavOMmmkyW26QYvyIqQys0FNicj0yE4cZ1H3nLUHIYH5HcsUSgQ //jV9J+qtBSLB4OFLfRLZ/7qKkV/LajxU9tMO/UhNLDIAZxtlV7me1CaJQMMh7HpDLE/ aQq+oKU4seGzvAMQLyPfdJeIMxc56x9nQtcPNVC/BHMNy3tk5gR6/3G+HsOnidKn3wfS Z99mIH0+mkuw4oj+sgNb1ItUvFHkAhCB88ea12lZuvsg0pwdrfECmupxcyrdbiHzqQSu /D/qLcw1SyvgG6fibr9dreFPu3j9X/oM934T4b8FPrz/jI3ng8wTWUVHMC6otsKv/m1E vR4Q== X-Gm-Message-State: AO0yUKUp+j9uJhlickS0jufyHg+I4eNuajLm+Pu/Ujnjqw/tVtxAw1Fw 3kCOmHYm35N5uwQ60g9EXxmoV/JyMY8= X-Received: by 2002:a05:6e02:2162:b0:315:6f9d:e75 with SMTP id s2-20020a056e02216200b003156f9d0e75mr395505ilv.7.1679365913785; Mon, 20 Mar 2023 19:31:53 -0700 (PDT) Received: from aford-IdeaCentre-A730.lan ([2601:447:d001:897f:1387:3268:b209:f4ec]) by smtp.gmail.com with ESMTPSA id a28-20020a027a1c000000b004065ad317fdsm2241200jac.151.2023.03.20.19.31.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Mar 2023 19:31:53 -0700 (PDT) From: Adam Ford To: linux-clk@vger.kernel.org Cc: aford@beaconembedded.com, Adam Ford , Abel Vesa , Peng Fan , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 4/4] clk: imx: Let IMX8MN_CLK_DISP_PIXEL set parent rate Date: Mon, 20 Mar 2023 21:31:36 -0500 Message-Id: <20230321023136.57986-5-aford173@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230321023136.57986-1-aford173@gmail.com> References: <20230321023136.57986-1-aford173@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760943774731424823?= X-GMAIL-MSGID: =?utf-8?q?1760943774731424823?= By default the display pixel clock needs to be evenly divide down from the video_pll_out clock which rules out a significant number of resolution and refresh rates. The current clock tree looks something like: video_pll 594000000 video_pll_bypass 594000000 video_pll_out 594000000 disp_pixel 148500000 disp_pixel_clk 148500000 Now that composite-8m supports determine_rate, we can allow disp_pixel to set the parent rate which then switches every clock in the chain to a new frequency when disp_pixel cannot evenly divide from video_pll_out. Signed-off-by: Adam Ford --- V2: Move imx8m_clk_hw_composite_flags macro into its own patch diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c index a042ed3a9d6c..4b23a4648600 100644 --- a/drivers/clk/imx/clk-imx8mn.c +++ b/drivers/clk/imx/clk-imx8mn.c @@ -470,7 +470,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) hws[IMX8MN_CLK_DRAM_ALT] = imx8m_clk_hw_fw_managed_composite("dram_alt", imx8mn_dram_alt_sels, base + 0xa000); hws[IMX8MN_CLK_DRAM_APB] = imx8m_clk_hw_fw_managed_composite_critical("dram_apb", imx8mn_dram_apb_sels, base + 0xa080); - hws[IMX8MN_CLK_DISP_PIXEL] = imx8m_clk_hw_composite("disp_pixel", imx8mn_disp_pixel_sels, base + 0xa500); + hws[IMX8MN_CLK_DISP_PIXEL] = imx8m_clk_hw_composite_flags("disp_pixel", imx8mn_disp_pixel_sels, base + 0xa500, CLK_SET_RATE_PARENT); hws[IMX8MN_CLK_SAI2] = imx8m_clk_hw_composite("sai2", imx8mn_sai2_sels, base + 0xa600); hws[IMX8MN_CLK_SAI3] = imx8m_clk_hw_composite("sai3", imx8mn_sai3_sels, base + 0xa680); hws[IMX8MN_CLK_SAI5] = imx8m_clk_hw_composite("sai5", imx8mn_sai5_sels, base + 0xa780);