Commit ab89a343 authored by Robert Hancock's avatar Robert Hancock Committed by Stephen Boyd

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: default avatarRobert Hancock <robert.hancock@calian.com>
Link: https://lore.kernel.org/r/20210325192643.2190069-8-robert.hancock@calian.comSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent b7bbf6ec
......@@ -80,6 +80,7 @@ struct clk_si5341 {
u8 num_outputs;
u8 num_synth;
u16 chip_id;
bool xaxb_ext_clk;
};
#define to_clk_si5341(_hw) container_of(_hw, struct clk_si5341, hw)
......@@ -529,9 +530,11 @@ static int si5341_clk_reparent(struct clk_si5341 *data, u8 index)
if (err < 0)
return err;
/* Power up XTAL oscillator and buffer */
/* Power up XTAL oscillator and buffer, select clock mode */
err = regmap_update_bits(data->regmap, SI5341_XAXB_CFG,
SI5341_XAXB_CFG_PDNB, SI5341_XAXB_CFG_PDNB);
SI5341_XAXB_CFG_PDNB | SI5341_XAXB_CFG_EXTCLK_EN,
SI5341_XAXB_CFG_PDNB | (data->xaxb_ext_clk ?
SI5341_XAXB_CFG_EXTCLK_EN : 0));
if (err < 0)
return err;
}
......@@ -1539,6 +1542,8 @@ static int si5341_probe(struct i2c_client *client,
initialization_required = !err;
}
data->xaxb_ext_clk = of_property_read_bool(client->dev.of_node,
"silabs,xaxb-ext-clk");
if (initialization_required) {
/* Populate the regmap cache in preparation for "cache only" */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment