mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 0/1] rtc: nuvoton: Modify part number value
@ 2024-03-11  1:34 Mia Lin
  2024-03-11  1:34 ` [PATCH v1 1/1] " Mia Lin
  2024-03-29 14:59 ` [PATCH v1 0/1] " Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Mia Lin @ 2024-03-11  1:34 UTC (permalink / raw)
  To: avifishman70, tmaimon77, tali.perry1, venture, yuenn,
	benjaminfair, alexandre.belloni, mimi05633, KWLIU, mylin1
  Cc: openbmc, linux-rtc, linux-kernel

Changes since version 1:
  rtc: nuvoton: Modify part number value to match datasheet definition.

Mia Lin (1):
  rtc: nuvoton: Modify part number value

 drivers/rtc/rtc-nct3018y.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v1 1/1] rtc: nuvoton: Modify part number value
  2024-03-11  1:34 [PATCH v1 0/1] rtc: nuvoton: Modify part number value Mia Lin
@ 2024-03-11  1:34 ` Mia Lin
  2024-03-29 14:59 ` [PATCH v1 0/1] " Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Mia Lin @ 2024-03-11  1:34 UTC (permalink / raw)
  To: avifishman70, tmaimon77, tali.perry1, venture, yuenn,
	benjaminfair, alexandre.belloni, mimi05633, KWLIU, mylin1
  Cc: openbmc, linux-rtc, linux-kernel

Base on datasheet,
    the part number is corresponding to bit 0 and 1 of the part info reg.

Signed-off-by: Mia Lin <mimi05633@gmail.com>
---
 drivers/rtc/rtc-nct3018y.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/rtc/rtc-nct3018y.c b/drivers/rtc/rtc-nct3018y.c
index f488a189a465..9dce003126a5 100644
--- a/drivers/rtc/rtc-nct3018y.c
+++ b/drivers/rtc/rtc-nct3018y.c
@@ -517,12 +517,15 @@ static int nct3018y_probe(struct i2c_client *client)
 	if (nct3018y->part_num < 0) {
 		dev_dbg(&client->dev, "Failed to read NCT3018Y_REG_PART.\n");
 		return nct3018y->part_num;
-	} else if (nct3018y->part_num == NCT3018Y_REG_PART_NCT3018Y) {
-		flags = NCT3018Y_BIT_HF;
-		err = i2c_smbus_write_byte_data(client, NCT3018Y_REG_CTRL, flags);
-		if (err < 0) {
-			dev_dbg(&client->dev, "Unable to write NCT3018Y_REG_CTRL.\n");
-			return err;
+	} else {
+		nct3018y->part_num &= 0x03; /* Part number is corresponding to bit 0 and 1 */
+		if (nct3018y->part_num == NCT3018Y_REG_PART_NCT3018Y) {
+			flags = NCT3018Y_BIT_HF;
+			err = i2c_smbus_write_byte_data(client, NCT3018Y_REG_CTRL, flags);
+			if (err < 0) {
+				dev_dbg(&client->dev, "Unable to write NCT3018Y_REG_CTRL.\n");
+				return err;
+			}
 		}
 	}
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 0/1] rtc: nuvoton: Modify part number value
  2024-03-11  1:34 [PATCH v1 0/1] rtc: nuvoton: Modify part number value Mia Lin
  2024-03-11  1:34 ` [PATCH v1 1/1] " Mia Lin
@ 2024-03-29 14:59 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2024-03-29 14:59 UTC (permalink / raw)
  To: avifishman70, tmaimon77, tali.perry1, venture, yuenn,
	benjaminfair, KWLIU, mylin1, Mia Lin
  Cc: openbmc, linux-rtc, linux-kernel

On Mon, 11 Mar 2024 09:34:04 +0800, Mia Lin wrote:
> Changes since version 1:
>   rtc: nuvoton: Modify part number value to match datasheet definition.
> 
> Mia Lin (1):
>   rtc: nuvoton: Modify part number value
> 
> drivers/rtc/rtc-nct3018y.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> [...]

Applied, thanks!

[1/1] rtc: nuvoton: Modify part number value
      https://git.kernel.org/abelloni/c/8b59a11fb8e6

Best regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-29 15:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-11  1:34 [PATCH v1 0/1] rtc: nuvoton: Modify part number value Mia Lin
2024-03-11  1:34 ` [PATCH v1 1/1] " Mia Lin
2024-03-29 14:59 ` [PATCH v1 0/1] " Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®