From: Brian Masney <bmasney@redhat.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>,
Akinobu Mita <akinobu.mita@gmail.com>,
Michael Turquette <mturquette@baylibre.com>,
Heiko Stuebner <heiko@sntech.de>,
Andrew Morton <akpm@linux-foundation.org>,
Avi Fishman <avifishman70@gmail.com>,
Tomer Maimon <tmaimon77@gmail.com>,
Tali Perry <tali.perry1@gmail.com>,
Patrick Venture <venture@google.com>,
Nancy Yuen <yuenn@google.com>,
Benjamin Fair <benjaminfair@google.com>,
Mia Lin <mimi05633@gmail.com>,
Michael McCormick <michael.mccormick@enatel.net>,
Heiko Schocher <hs@denx.de>, Parthiban Nallathambi <pn@denx.de>,
Antoniu Miclaus <antoniu.miclaus@analog.com>,
Maxime Ripard <mripard@kernel.org>,
Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org, linux-rtc@vger.kernel.org,
linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org,
Brian Masney <bmasney@redhat.com>
Subject: [PATCH 02/15] rtc: hym8563: fix incorrect maximum clock rate handling
Date: Thu, 10 Jul 2025 11:20:22 -0400 [thread overview]
Message-ID: <20250710-rtc-clk-round-rate-v1-2-33140bb2278e@redhat.com> (raw)
In-Reply-To: <20250710-rtc-clk-round-rate-v1-0-33140bb2278e@redhat.com>
When hym8563_clkout_round_rate() is called with a requested rate higher
than the highest supported rate, it currently returns 0, which disables
the clock. According to the clk API, round_rate() should instead return
the highest supported rate. Update the function to return the maximum
supported rate in this case.
Fixes: dcaf038493525 ("rtc: add hym8563 rtc-driver")
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
drivers/rtc/rtc-hym8563.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c
index 63f11ea3589d6439ac0ee7f6ee4ab70e2a52bff4..759dc2ad6e3b2ad57072b35a2642ec5bb78cd98c 100644
--- a/drivers/rtc/rtc-hym8563.c
+++ b/drivers/rtc/rtc-hym8563.c
@@ -294,7 +294,7 @@ static long hym8563_clkout_round_rate(struct clk_hw *hw, unsigned long rate,
if (clkout_rates[i] <= rate)
return clkout_rates[i];
- return 0;
+ return clkout_rates[0];
}
static int hym8563_clkout_set_rate(struct clk_hw *hw, unsigned long rate,
--
2.50.0
next prev parent reply other threads:[~2025-07-10 15:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-10 15:20 [PATCH 00/15] rtc: convert from clk round_rate() to determine_rate() and fix a few bugs Brian Masney
2025-07-10 15:20 ` [PATCH 01/15] rtc: ds1307: fix incorrect maximum clock rate handling Brian Masney
2025-07-10 15:20 ` Brian Masney [this message]
2025-07-10 15:20 ` [PATCH 03/15] rtc: nct3018y: " Brian Masney
2025-07-10 15:20 ` [PATCH 04/15] rtc: pcf85063: " Brian Masney
2025-07-10 15:20 ` [PATCH 05/15] rtc: pcf8563: " Brian Masney
2025-07-10 15:20 ` [PATCH 06/15] rtc: rv3028: " Brian Masney
2025-07-10 15:20 ` [PATCH 07/15] rtc: ds1307: convert from round_rate() to determine_rate() Brian Masney
2025-07-10 15:20 ` [PATCH 08/15] rtc: hym8563: " Brian Masney
2025-07-10 15:20 ` [PATCH 09/15] rtc: m41t80: " Brian Masney
2025-07-10 15:20 ` [PATCH 10/15] rtc: max31335: " Brian Masney
2025-07-10 15:20 ` [PATCH 11/15] rtc: nct3018y: " Brian Masney
2025-07-10 15:20 ` [PATCH 12/15] rtc: pcf85063: " Brian Masney
2025-07-10 15:20 ` [PATCH 13/15] rtc: pcf8563: " Brian Masney
2025-07-10 15:20 ` [PATCH 14/15] rtc: rv3028: " Brian Masney
2025-07-10 15:20 ` [PATCH 15/15] rtc: rv3032: " Brian Masney
2025-08-03 1:01 ` [PATCH 00/15] rtc: convert from clk round_rate() to determine_rate() and fix a few bugs Alexandre Belloni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250710-rtc-clk-round-rate-v1-2-33140bb2278e@redhat.com \
--to=bmasney@redhat.com \
--cc=akinobu.mita@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alexandre.belloni@bootlin.com \
--cc=antoniu.miclaus@analog.com \
--cc=avifishman70@gmail.com \
--cc=benjaminfair@google.com \
--cc=heiko@sntech.de \
--cc=hs@denx.de \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=michael.mccormick@enatel.net \
--cc=mimi05633@gmail.com \
--cc=mripard@kernel.org \
--cc=mturquette@baylibre.com \
--cc=openbmc@lists.ozlabs.org \
--cc=pn@denx.de \
--cc=sboyd@kernel.org \
--cc=tali.perry1@gmail.com \
--cc=tmaimon77@gmail.com \
--cc=venture@google.com \
--cc=yuenn@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).