Skip to content

Commit ab89a34

Browse files
robhancocksedbebarino
authored andcommitted
clk: si5341: Add silabs,xaxb-ext-clk property
Add a property to allow specifying that the device XA/XB pins are used for an external clock input rather than for a clock crystal. Signed-off-by: Robert Hancock <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent b7bbf6e commit ab89a34

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/clk/clk-si5341.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ struct clk_si5341 {
8080
u8 num_outputs;
8181
u8 num_synth;
8282
u16 chip_id;
83+
bool xaxb_ext_clk;
8384
};
8485
#define to_clk_si5341(_hw) container_of(_hw, struct clk_si5341, hw)
8586

@@ -529,9 +530,11 @@ static int si5341_clk_reparent(struct clk_si5341 *data, u8 index)
529530
if (err < 0)
530531
return err;
531532

532-
/* Power up XTAL oscillator and buffer */
533+
/* Power up XTAL oscillator and buffer, select clock mode */
533534
err = regmap_update_bits(data->regmap, SI5341_XAXB_CFG,
534-
SI5341_XAXB_CFG_PDNB, SI5341_XAXB_CFG_PDNB);
535+
SI5341_XAXB_CFG_PDNB | SI5341_XAXB_CFG_EXTCLK_EN,
536+
SI5341_XAXB_CFG_PDNB | (data->xaxb_ext_clk ?
537+
SI5341_XAXB_CFG_EXTCLK_EN : 0));
535538
if (err < 0)
536539
return err;
537540
}
@@ -1539,6 +1542,8 @@ static int si5341_probe(struct i2c_client *client,
15391542

15401543
initialization_required = !err;
15411544
}
1545+
data->xaxb_ext_clk = of_property_read_bool(client->dev.of_node,
1546+
"silabs,xaxb-ext-clk");
15421547

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

0 commit comments

Comments
 (0)