Skip to content

Commit 2f02c5e

Browse files
robhancocksedbebarino
authored andcommitted
clk: si5341: Add silabs,iovdd-33 property
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent ab89a34 commit 2f02c5e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/clk/clk-si5341.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ struct clk_si5341 {
8181
u8 num_synth;
8282
u16 chip_id;
8383
bool xaxb_ext_clk;
84+
bool iovdd_33;
8485
};
8586
#define to_clk_si5341(_hw) container_of(_hw, struct clk_si5341, hw)
8687

@@ -103,6 +104,7 @@ struct clk_si5341_output_config {
103104
#define SI5341_IN_SEL 0x0021
104105
#define SI5341_DEVICE_READY 0x00FE
105106
#define SI5341_XAXB_CFG 0x090E
107+
#define SI5341_IO_VDD_SEL 0x0943
106108
#define SI5341_IN_EN 0x0949
107109
#define SI5341_INX_TO_PFD_EN 0x094A
108110

@@ -351,7 +353,6 @@ static const struct si5341_reg_default si5341_reg_defaults[] = {
351353
{ 0x0804, 0x00 }, /* Not in datasheet */
352354
{ 0x090E, 0x02 }, /* XAXB_EXTCLK_EN=0 XAXB_PDNB=1 (use XTAL) */
353355
{ 0x091C, 0x04 }, /* ZDM_EN=4 (Normal mode) */
354-
{ 0x0943, 0x00 }, /* IO_VDD_SEL=0 (0=1v8, use 1=3v3) */
355356
{ 0x0949, 0x00 }, /* IN_EN (disable input clocks) */
356357
{ 0x094A, 0x00 }, /* INx_TO_PFD_EN (disabled) */
357358
{ 0x0A02, 0x00 }, /* Not in datasheet */
@@ -1160,6 +1161,11 @@ static int si5341_finalize_defaults(struct clk_si5341 *data)
11601161
int res;
11611162
u32 revision;
11621163

1164+
res = regmap_write(data->regmap, SI5341_IO_VDD_SEL,
1165+
data->iovdd_33 ? 1 : 0);
1166+
if (res < 0)
1167+
return res;
1168+
11631169
res = regmap_read(data->regmap, SI5341_DEVICE_REV, &revision);
11641170
if (res < 0)
11651171
return res;
@@ -1544,6 +1550,8 @@ static int si5341_probe(struct i2c_client *client,
15441550
}
15451551
data->xaxb_ext_clk = of_property_read_bool(client->dev.of_node,
15461552
"silabs,xaxb-ext-clk");
1553+
data->iovdd_33 = of_property_read_bool(client->dev.of_node,
1554+
"silabs,iovdd-33");
15471555

15481556
if (initialization_required) {
15491557
/* Populate the regmap cache in preparation for "cache only" */

0 commit comments

Comments
 (0)