All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Hancock <robert.hancock@calian.com>
To: mturquette@baylibre.com, sboyd@kernel.org
Cc: mike.looijmans@topic.nl, devicetree@vger.kernel.org,
	linux-clk@vger.kernel.org,
	Robert Hancock <robert.hancock@calian.com>
Subject: [PATCH v2 8/9] clk: si5341: Add silabs,iovdd-33 property
Date: Fri, 12 Mar 2021 12:17:09 -0600	[thread overview]
Message-ID: <20210312181710.3998978-9-robert.hancock@calian.com> (raw)
In-Reply-To: <20210312181710.3998978-1-robert.hancock@calian.com>

Add a property to allow specifying that the external I2C IO pins are using
3.3V voltage thresholds rather than 1.8V.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
---
 drivers/clk/clk-si5341.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk-si5341.c b/drivers/clk/clk-si5341.c
index 689f8c2b0b57..966b034a318f 100644
--- a/drivers/clk/clk-si5341.c
+++ b/drivers/clk/clk-si5341.c
@@ -81,6 +81,7 @@ struct clk_si5341 {
 	u8 num_synth;
 	u16 chip_id;
 	bool xaxb_ext_clk;
+	bool iovdd_33;
 };
 #define to_clk_si5341(_hw)	container_of(_hw, struct clk_si5341, hw)
 
@@ -103,6 +104,7 @@ struct clk_si5341_output_config {
 #define SI5341_IN_SEL		0x0021
 #define SI5341_DEVICE_READY	0x00FE
 #define SI5341_XAXB_CFG		0x090E
+#define SI5341_IO_VDD_SEL	0x0943
 #define SI5341_IN_EN		0x0949
 #define SI5341_INX_TO_PFD_EN	0x094A
 
@@ -351,7 +353,6 @@ static const struct si5341_reg_default si5341_reg_defaults[] = {
 	{ 0x0804, 0x00 }, /* Not in datasheet */
 	{ 0x090E, 0x02 }, /* XAXB_EXTCLK_EN=0 XAXB_PDNB=1 (use XTAL) */
 	{ 0x091C, 0x04 }, /* ZDM_EN=4 (Normal mode) */
-	{ 0x0943, 0x00 }, /* IO_VDD_SEL=0 (0=1v8, use 1=3v3) */
 	{ 0x0949, 0x00 }, /* IN_EN (disable input clocks) */
 	{ 0x094A, 0x00 }, /* INx_TO_PFD_EN (disabled) */
 	{ 0x0A02, 0x00 }, /* Not in datasheet */
@@ -1160,6 +1161,11 @@ static int si5341_finalize_defaults(struct clk_si5341 *data)
 	int res;
 	u32 revision;
 
+	res = regmap_write(data->regmap, SI5341_IO_VDD_SEL,
+			   data->iovdd_33 ? 1 : 0);
+	if (res < 0)
+		return res;
+
 	res = regmap_read(data->regmap, SI5341_DEVICE_REV, &revision);
 	if (res < 0)
 		return res;
@@ -1544,6 +1550,8 @@ static int si5341_probe(struct i2c_client *client,
 	}
 	data->xaxb_ext_clk = of_property_read_bool(client->dev.of_node,
 						   "silabs,xaxb-ext-clk");
+	data->iovdd_33 = of_property_read_bool(client->dev.of_node,
+					       "silabs,iovdd-33");
 
 	if (initialization_required) {
 		/* Populate the regmap cache in preparation for "cache only" */
-- 
2.27.0


  parent reply	other threads:[~2021-03-12 18:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 18:17 [PATCH v2 0/9] Si5341 driver updates Robert Hancock
2021-03-12 18:17 ` [PATCH v2 1/9] dt-bindings: clock: clk-si5341: Add new attributes Robert Hancock
2021-03-24 17:04   ` Rob Herring
2021-03-24 17:16     ` Robert Hancock
2021-03-12 18:17 ` [PATCH v2 2/9] clk: si5341: Wait for DEVICE_READY on startup Robert Hancock
2021-03-12 18:17 ` [PATCH v2 3/9] clk: si5341: Avoid divide errors due to bogus register contents Robert Hancock
2021-03-12 18:17 ` [PATCH v2 4/9] clk: si5341: Check for input clock presence and PLL lock on startup Robert Hancock
2021-03-12 18:17 ` [PATCH v2 5/9] clk: si5341: Update initialization magic Robert Hancock
2021-03-12 18:17 ` [PATCH v2 6/9] clk: si5341: Allow different output VDD_SEL values Robert Hancock
2021-03-12 18:17 ` [PATCH v2 7/9] clk: si5341: Add silabs,xaxb-ext-clk property Robert Hancock
2021-03-12 18:17 ` Robert Hancock [this message]
2021-03-12 18:17 ` [PATCH v2 9/9] clk: si5341: Add sysfs properties to allow checking/resetting device faults Robert Hancock

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=20210312181710.3998978-9-robert.hancock@calian.com \
    --to=robert.hancock@calian.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=mike.looijmans@topic.nl \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.