Lines Matching refs:syr82x

37 struct syr82x {  struct
81 struct syr82x *g_syr82x;
126 struct syr82x *syr82x = rdev_get_drvdata(dev); in syr82x_dcdc_is_enabled() local
131 ret = regmap_read(syr82x->regmap, SYR82X_BUCK1_SET_VOL_BASE, &val); in syr82x_dcdc_is_enabled()
143 struct syr82x *syr82x = rdev_get_drvdata(dev); in syr82x_dcdc_enable() local
147 ret = regmap_update_bits(syr82x->regmap, in syr82x_dcdc_enable()
154 struct syr82x *syr82x = rdev_get_drvdata(dev); in syr82x_dcdc_disable() local
158 ret = regmap_update_bits(syr82x->regmap, in syr82x_dcdc_disable()
165 struct syr82x *syr82x = rdev_get_drvdata(dev); in syr82x_dcdc_get_voltage() local
170 ret = regmap_read(syr82x->regmap, SYR82X_BUCK1_SET_VOL_BASE, &reg); in syr82x_dcdc_get_voltage()
182 struct syr82x *syr82x = rdev_get_drvdata(dev); in syr82x_dcdc_set_voltage() local
199 ret = regmap_update_bits(syr82x->regmap, in syr82x_dcdc_set_voltage()
210 struct syr82x *syr82x = rdev_get_drvdata(dev); in syr82x_dcdc_get_mode() local
215 ret = regmap_read(syr82x->regmap, SYR82X_BUCK1_SET_VOL_BASE, &val); in syr82x_dcdc_get_mode()
228 struct syr82x *syr82x = rdev_get_drvdata(dev); in syr82x_dcdc_set_mode() local
234 return regmap_update_bits(syr82x->regmap, in syr82x_dcdc_set_mode()
238 return regmap_update_bits(syr82x->regmap, in syr82x_dcdc_set_mode()
263 struct syr82x *syr82x = rdev_get_drvdata(dev); in syr82x_dcdc_suspend_enable() local
266 return regmap_update_bits(syr82x->regmap, in syr82x_dcdc_suspend_enable()
272 struct syr82x *syr82x = rdev_get_drvdata(dev); in syr82x_dcdc_suspend_disable() local
275 return regmap_update_bits(syr82x->regmap, in syr82x_dcdc_suspend_disable()
282 struct syr82x *syr82x = rdev_get_drvdata(dev); in syr82x_dcdc_set_sleep_voltage() local
299 ret = regmap_update_bits(syr82x->regmap, in syr82x_dcdc_set_sleep_voltage()
308 struct syr82x *syr82x = rdev_get_drvdata(dev); in syr82x_dcdc_set_suspend_mode() local
314 return regmap_update_bits(syr82x->regmap, in syr82x_dcdc_set_suspend_mode()
318 return regmap_update_bits(syr82x->regmap, in syr82x_dcdc_set_suspend_mode()
364 static struct syr82x_board *syr82x_parse_dt(struct syr82x *syr82x) in syr82x_parse_dt() argument
371 syr82x_np = of_node_get(syr82x->dev->of_node); in syr82x_parse_dt()
380 count = of_regulator_match(syr82x->dev, regs, syr82x_reg_matches, in syr82x_parse_dt()
383 pdata = devm_kzalloc(syr82x->dev, sizeof(*pdata), GFP_KERNEL); in syr82x_parse_dt()
394 struct syr82x *syr82x; in syr82x_i2c_probe() local
412 syr82x = devm_kzalloc(&i2c->dev,sizeof(struct syr82x), GFP_KERNEL); in syr82x_i2c_probe()
413 if (syr82x == NULL) { in syr82x_i2c_probe()
418 syr82x->regmap = devm_regmap_init_i2c(i2c, &syr82x_regmap_config); in syr82x_i2c_probe()
419 if (IS_ERR(syr82x->regmap)) { in syr82x_i2c_probe()
421 return PTR_ERR(syr82x->regmap); in syr82x_i2c_probe()
423 syr82x->i2c = i2c; in syr82x_i2c_probe()
424 syr82x->dev = &i2c->dev; in syr82x_i2c_probe()
425 i2c_set_clientdata(i2c, syr82x); in syr82x_i2c_probe()
426 g_syr82x = syr82x; in syr82x_i2c_probe()
428 mutex_init(&syr82x->io_lock); in syr82x_i2c_probe()
429 ret = regmap_read(syr82x->regmap, SYR82X_ID1_REG, &val); in syr82x_i2c_probe()
434 ret = regmap_update_bits(syr82x->regmap, in syr82x_i2c_probe()
438 if (syr82x->dev->of_node) in syr82x_i2c_probe()
439 pdev = syr82x_parse_dt(syr82x); in syr82x_i2c_probe()
442 syr82x->num_regulators = syr82x_NUM_REGULATORS; in syr82x_i2c_probe()
443 syr82x->rdev = kcalloc(syr82x_NUM_REGULATORS,sizeof(struct regulator_dev *), GFP_KERNEL); in syr82x_i2c_probe()
444 if (!syr82x->rdev) { in syr82x_i2c_probe()
449 config.dev = syr82x->dev; in syr82x_i2c_probe()
450 config.driver_data = syr82x; in syr82x_i2c_probe()
451 if (syr82x->dev->of_node) in syr82x_i2c_probe()
465 syr82x->rdev[0] = sy_rdev; in syr82x_i2c_probe()
475 struct syr82x *syr82x = i2c_get_clientdata(i2c); in syr82x_i2c_remove() local
477 if (syr82x->rdev[0]) in syr82x_i2c_remove()
478 regulator_unregister(syr82x->rdev[0]); in syr82x_i2c_remove()