Lines Matching +full:out +full:- +full:amplitude +full:- +full:microvolt
1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * - Si52144 - 4x DIFF
7 * - Si52146 - 6x DIFF
8 * - Si52147 - 9x DIFF
10 * - Si52144
17 #include <linux/clk-provider.h>
39 ((UV) - SI521XX_REG_DA_AMP_MIN) / SI521XX_REG_DA_AMP_STEP)
44 #define SI521XX_OE_MAP_GET_OE(oe, map) (((map) >> (((oe) - 1) * 8)) & 0xff)
109 return -EIO; in si521xx_regmap_i2c_write()
121 xfer[0].addr = i2c->addr; in si521xx_regmap_i2c_read()
126 xfer[1].addr = i2c->addr; in si521xx_regmap_i2c_read()
131 ret = i2c_transfer(i2c->adapter, xfer, 2); in si521xx_regmap_i2c_read()
135 return -EIO; in si521xx_regmap_i2c_read()
195 struct si521xx *si = si_clk->si; in si521xx_diff_prepare()
197 regmap_set_bits(si->regmap, SI521XX_REG_OE(si_clk->reg), si_clk->bit); in si521xx_diff_prepare()
205 struct si521xx *si = si_clk->si; in si521xx_diff_unprepare()
207 regmap_clear_bits(si->regmap, SI521XX_REG_OE(si_clk->reg), si_clk->bit); in si521xx_diff_unprepare()
220 struct i2c_client *client = si->client; in si521xx_get_common_config()
221 struct device_node *np = client->dev.of_node; in si521xx_get_common_config()
226 si->pll_amplitude = SI521XX_REG_DA_AMP(SI521XX_REG_DA_AMP_DEFAULT); in si521xx_get_common_config()
228 /* Output clock amplitude */ in si521xx_get_common_config()
229 ret = of_property_read_u32(np, "skyworks,out-amplitude-microvolt", in si521xx_get_common_config()
234 return dev_err_probe(&client->dev, -EINVAL, in si521xx_get_common_config()
235 "Invalid skyworks,out-amplitude-microvolt value\n"); in si521xx_get_common_config()
237 si->pll_amplitude = SI521XX_REG_DA_AMP(amp); in si521xx_get_common_config()
245 /* If amplitude is non-default, update it. */ in si521xx_update_config()
246 if (si->pll_amplitude == SI521XX_REG_DA_AMP(SI521XX_REG_DA_AMP_DEFAULT)) in si521xx_update_config()
249 regmap_update_bits(si->regmap, SI521XX_REG_DA, in si521xx_update_config()
250 SI521XX_REG_DA_AMP_MASK, si->pll_amplitude); in si521xx_update_config()
264 clk->reg = SI521XX_REG_OE(oe); in si521xx_diff_idx_to_reg_bit()
265 clk->bit = 7 - b; in si521xx_diff_idx_to_reg_bit()
275 unsigned int idx = clkspec->args[0]; in si521xx_of_clk_get()
277 return &si->clk_dif[idx].hw; in si521xx_of_clk_get()
291 return -EINVAL; in si521xx_probe()
293 si = devm_kzalloc(&client->dev, sizeof(*si), GFP_KERNEL); in si521xx_probe()
295 return -ENOMEM; in si521xx_probe()
298 si->client = client; in si521xx_probe()
305 si->regmap = devm_regmap_init(&client->dev, NULL, client, in si521xx_probe()
307 if (IS_ERR(si->regmap)) in si521xx_probe()
308 return dev_err_probe(&client->dev, PTR_ERR(si->regmap), in si521xx_probe()
326 si->clk_dif[i].hw.init = &init; in si521xx_probe()
327 si->clk_dif[i].si = si; in si521xx_probe()
329 si521xx_diff_idx_to_reg_bit(chip_info, i, &si->clk_dif[i]); in si521xx_probe()
331 ret = devm_clk_hw_register(&client->dev, &si->clk_dif[i].hw); in si521xx_probe()
336 ret = devm_of_clk_add_hw_provider(&client->dev, si521xx_of_clk_get, si); in si521xx_probe()
347 regcache_cache_only(si->regmap, true); in si521xx_suspend()
348 regcache_mark_dirty(si->regmap); in si521xx_suspend()
358 regcache_cache_only(si->regmap, false); in si521xx_resume()
359 ret = regcache_sync(si->regmap); in si521xx_resume()
385 .name = "clk-si521xx",