mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Wang <tomato1220@gmail.com>
To: a.zummo@towertech.it, alexandre.belloni@bootlin.com,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org
Cc: andrew@aj.id.au, avi.fishman@gmail.com, tmaimon77@gmail.com,
	tali.perry1@gmail.com, venture@google.com, yuenn@google.com,
	benjaminfair@google.com, ctcchien@nuvoton.com,
	mimi05633@gmail.com, openbmc@lists.ozlabs.org,
	linux-rtc@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, davidwang@quantatw.com,
	David Wang <tomato1220@gmail.com>
Subject: [PATCH 2/2] rtc: nct3018y: add optional control register initialization
Date: Thu,  9 Apr 2026 15:21:05 +0800	[thread overview]
Message-ID: <65d40ded5afd87d0dbdcf98652a97e4ad244505c.1775717959.git.tomato1220@gmail.com> (raw)
In-Reply-To: <cover.1775717959.git.tomato1220@gmail.com>

Support the "nuvoton,ctrl-reg-val" Device Tree property to initialize
the RTC control register (0x0A) during the probe phase.

This provides flexibility for different platforms to override default
hardware settings.

Signed-off-by: David Wang <tomato1220@gmail.com>
---
 drivers/rtc/rtc-nct3018y.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/rtc/rtc-nct3018y.c b/drivers/rtc/rtc-nct3018y.c
index cd4b1db902e9..4bc47b4ac935 100644
--- a/drivers/rtc/rtc-nct3018y.c
+++ b/drivers/rtc/rtc-nct3018y.c
@@ -534,6 +534,15 @@ static int nct3018y_probe(struct i2c_client *client)
 		}
 	}
 
+	if (!of_property_read_u32(client->dev.of_node, "nuvoton,ctrl-reg-val", &flags)) {
+
+		err = i2c_smbus_write_byte_data(client, NCT3018Y_REG_CTRL, (u8)flags);
+		if (err < 0) {
+			dev_dbg(&client->dev, "Unable to write NCT3018Y_REG_CTRL.\n");
+			return err;
+		}
+	}
+
 	flags = 0;
 	err = i2c_smbus_write_byte_data(client, NCT3018Y_REG_ST, flags);
 	if (err < 0) {
-- 
2.34.1


      parent reply	other threads:[~2026-04-09  7:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09  7:21 [PATCH 0/2] rtc: nct3018y: add support for " David Wang
2026-04-09  7:21 ` [PATCH 1/2] dt-bindings: rtc: nct3018y: add nuvoton,ctrl-reg-val property David Wang
2026-04-09  7:23   ` Krzysztof Kozlowski
2026-04-09  7:44     ` David Wang
2026-04-09 13:30       ` Alexandre Belloni
2026-04-09  7:21 ` David Wang [this message]

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=65d40ded5afd87d0dbdcf98652a97e4ad244505c.1775717959.git.tomato1220@gmail.com \
    --to=tomato1220@gmail.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrew@aj.id.au \
    --cc=avi.fishman@gmail.com \
    --cc=benjaminfair@google.com \
    --cc=conor+dt@kernel.org \
    --cc=ctcchien@nuvoton.com \
    --cc=davidwang@quantatw.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=mimi05633@gmail.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=robh@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

all inboxes | Powered by JetHome®