Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp267858rwl; Thu, 23 Mar 2023 16:04:57 -0700 (PDT) X-Google-Smtp-Source: AKy350Z1BA4sxExoYh3iqJ6HKotYYU/weYNx0pHTey1zXPgTN3CFO4abZ+kOwMVWCs1i8F82VrHl X-Received: by 2002:a17:906:4ed4:b0:878:61d8:d7c2 with SMTP id i20-20020a1709064ed400b0087861d8d7c2mr664161ejv.39.1679612697164; Thu, 23 Mar 2023 16:04:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679612697; cv=none; d=google.com; s=arc-20160816; b=CwkMf1DHXdDdaTLD/GyeVjzVepUv9HfC/saEnpg6KjSnexjTmPhsRJUyuxu4iKKffF lwbyFPQhr/86X5eeo9HawTwK5v0HSNGgNZqibCQZTkqek7g5uu6Cb0Tr30Y+qFpkJRzV zTjepvjLx/LMtq/9do8XmLKi5j9v6/qomaZpM25HdChqSx0ZcW2pUVCHmv8NMbNQusWe 7bDCJf+9OvFtLesYY7X6Mvk/EX5mnjVo1ITqTF53ZEDnsy6NJCzxqs84OfIenMeCGHqb FWydfrwGjg8si6pgbqySz09BgrsEHuzVj0mqJp3thiAx5ZG9pAyid5IvIQZ8zPTe10U3 XlkQ== 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=xoCYglyZRXBAsXij28ODxM/pUlkw5MAovi/FF2CLHQ8=; b=sBmT6zWMc/8gM5ixG/X4+xoX4qCDsJAK0mfEZrfCVc8IHTQw57sFpxL/3Svlhb6Ffv ubHzWdWmv9SOad7wq7Ni8faTr30tDtHf04DKjsf339MFsvw6A0C5yrrIRef0cuMAydnQ pBghxYMwnoJ3JnG67hXu9vZv5Df3T4hxipruaRGaRWI2vZjMVqHNkgWtGDR7jXkhBarc 2oTjvvWy7hdAo/3pNWU1q77woFxYIicP9GKQTuMrYu6eB75yKeb/u1d0O7brEaFQO7LG vxYIIqZUBR8xuneOr0186JPpyBXs5K55fW+YuS0GN6+Oj9vJxbxZ2FncVht5YSWOAWRf LGLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EuLUTSOX; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g18-20020a50ee12000000b004fd2a8b4962si19181518eds.132.2023.03.23.16.04.28; Thu, 23 Mar 2023 16:04:57 -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=EuLUTSOX; 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 S230366AbjCWXBh (ORCPT + 99 others); Thu, 23 Mar 2023 19:01:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbjCWXBd (ORCPT ); Thu, 23 Mar 2023 19:01:33 -0400 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27CF4B464; Thu, 23 Mar 2023 16:01:32 -0700 (PDT) Received: by mail-il1-x131.google.com with SMTP id i19so99035ila.10; Thu, 23 Mar 2023 16:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679612491; 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=xoCYglyZRXBAsXij28ODxM/pUlkw5MAovi/FF2CLHQ8=; b=EuLUTSOXPcNUYVeKnTB4g9KwdaJWobchhRiVJyyhfD91KWS+b0MlS4OMpooyKBAgdV xzItG1xrsWtlkihU9MEE62fZDbxXLWsB1oyAZ9l81RR09vJtVXDgKzfNUfItxVgzgEER KkH1kc77ClORzJv+QgH0phBb8q1NHPyuTQPTdjiUg8DiHZdDgl4uuudjhHPPxK1tUqT7 Bto8XS+HZJogUJF/gclufOTDTb8E3lCnvPY40uH/UjHICTRruzl6NXH9LGXfEQz8iDvy DDDfQhNRw83hx23TMXfD9o9aWYobLjqDkO6EYD3g32v5cuEfY8Nw+hiyMC3N0sYaBkq4 npiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679612491; 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=xoCYglyZRXBAsXij28ODxM/pUlkw5MAovi/FF2CLHQ8=; b=YXpYZL5xUmokQ/npIKG8eIRVySs90/eNWSdDlLKV+lKt8+yq/N250sKoFiPH258UMl /Fn9Sg0bPEIaz7s4KzTozMOZqwC7vGREMN0PqJF7nCJ0rMztzcHEgsMWpPchfNgiH8sn ZxvsRyLBwirR13V725m2c1Ru1ujg3fB/5LscOnSlrTYaiZ3VNCIQmC7xG8kmuuT+WtY5 0AVPb6w1xPbsd2W5F99o7HPDhmF0pPPsMjlZEk4AwEhU31KBRQCs5bJDeWMco5qzSBlV UrTedQuY/xzIJ/UDjaPQBr387dcYq4CZ2By7jeqzrh15ne8Ux5kK1l+HAJqF+b6q+fcP vyXw== X-Gm-Message-State: AAQBX9cyK09JuLDbgaILw69tvoQduH2/tMBPgvuYB2DaLDGF2TF9qZ5b oBv9xUsZRyas2Yt0p8ZBDRxOhihwU4E= X-Received: by 2002:a92:cb47:0:b0:325:da54:ae8b with SMTP id f7-20020a92cb47000000b00325da54ae8bmr703358ilq.9.1679612491131; Thu, 23 Mar 2023 16:01:31 -0700 (PDT) Received: from aford-IdeaCentre-A730.lan ([2601:447:d001:897f:f38d:f05d:4666:1249]) by smtp.gmail.com with ESMTPSA id w20-20020a056e0213f400b00314201bcbdfsm5405492ilj.3.2023.03.23.16.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Mar 2023 16:01:30 -0700 (PDT) From: Adam Ford To: linux-clk@vger.kernel.org Cc: aford@beaconembedded.com, Adam Ford , Peng Fan , Fabio Estevam , Abel Vesa , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V4 1/4] clk: imx: composite-8m: Add support to determine_rate Date: Thu, 23 Mar 2023 18:01:24 -0500 Message-Id: <20230323230127.120883-2-aford173@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230323230127.120883-1-aford173@gmail.com> References: <20230323230127.120883-1-aford173@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.1 required=5.0 tests=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=unavailable 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 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 Reviewed-by: Peng Fan Reviewed-by: Fabio Estevam --- V4: Sorry for the noise. I forgot to 'git ammend' What V3 was supposed to be. V3: Change name clk_divider_determine_rate to imx8m_clk_divider_determine_rate to match naming convention V2: No Change diff --git a/drivers/clk/imx/clk-composite-8m.c b/drivers/clk/imx/clk-composite-8m.c index cbf0d7955a00..6883a8199b6c 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 imx8m_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 = imx8m_clk_divider_determine_rate, }; static u8 imx8m_clk_composite_mux_get_parent(struct clk_hw *hw) -- 2.34.1