Lines Matching +full:buck +full:- +full:c
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Based on lp3971.c
147 LP3972_LDO1 -> 0, LP3972_LDO2 -> 4
148 LP3972_LDO3 -> 0, LP3972_LDO4 -> 4
149 LP3972_LDO5 -> 0
169 return -EIO; in lp3972_i2c_read()
182 return -EIO; in lp3972_i2c_write()
190 mutex_lock(&lp3972->io_lock); in lp3972_reg_read()
192 lp3972_i2c_read(lp3972->i2c, reg, 1, &val); in lp3972_reg_read()
194 dev_dbg(lp3972->dev, "reg read 0x%02x -> 0x%02x\n", (int)reg, in lp3972_reg_read()
197 mutex_unlock(&lp3972->io_lock); in lp3972_reg_read()
207 mutex_lock(&lp3972->io_lock); in lp3972_set_bits()
209 ret = lp3972_i2c_read(lp3972->i2c, reg, 1, &tmp); in lp3972_set_bits()
212 ret = lp3972_i2c_write(lp3972->i2c, reg, 1, &tmp); in lp3972_set_bits()
213 dev_dbg(lp3972->dev, "reg write 0x%02x -> 0x%02x\n", (int)reg, in lp3972_set_bits()
216 mutex_unlock(&lp3972->io_lock); in lp3972_set_bits()
224 int ldo = rdev_get_id(dev) - LP3972_LDO1; in lp3972_ldo_is_enabled()
235 int ldo = rdev_get_id(dev) - LP3972_LDO1; in lp3972_ldo_enable()
245 int ldo = rdev_get_id(dev) - LP3972_LDO1; in lp3972_ldo_disable()
255 int ldo = rdev_get_id(dev) - LP3972_LDO1; in lp3972_ldo_get_voltage_sel()
269 int ldo = rdev_get_id(dev) - LP3972_LDO1; in lp3972_ldo_set_voltage_sel()
317 int buck = rdev_get_id(dev) - LP3972_DCDC1; in lp3972_dcdc_is_enabled() local
318 u16 mask = 1 << (buck * 2); in lp3972_dcdc_is_enabled()
321 val = lp3972_reg_read(lp3972, LP3972_BUCK_VOL_ENABLE_REG(buck)); in lp3972_dcdc_is_enabled()
328 int buck = rdev_get_id(dev) - LP3972_DCDC1; in lp3972_dcdc_enable() local
329 u16 mask = 1 << (buck * 2); in lp3972_dcdc_enable()
332 val = lp3972_set_bits(lp3972, LP3972_BUCK_VOL_ENABLE_REG(buck), in lp3972_dcdc_enable()
340 int buck = rdev_get_id(dev) - LP3972_DCDC1; in lp3972_dcdc_disable() local
341 u16 mask = 1 << (buck * 2); in lp3972_dcdc_disable()
344 val = lp3972_set_bits(lp3972, LP3972_BUCK_VOL_ENABLE_REG(buck), in lp3972_dcdc_disable()
352 int buck = rdev_get_id(dev) - LP3972_DCDC1; in lp3972_dcdc_get_voltage_sel() local
355 reg = lp3972_reg_read(lp3972, LP3972_BUCK_VOL1_REG(buck)); in lp3972_dcdc_get_voltage_sel()
365 int buck = rdev_get_id(dev) - LP3972_DCDC1; in lp3972_dcdc_set_voltage_sel() local
368 ret = lp3972_set_bits(lp3972, LP3972_BUCK_VOL1_REG(buck), in lp3972_dcdc_set_voltage_sel()
373 if (buck != 0) in lp3972_dcdc_set_voltage_sel()
476 for (i = 0; i < pdata->num_regulators; i++) { in setup_regulators()
477 struct lp3972_regulator_subdev *reg = &pdata->regulators[i]; in setup_regulators()
481 config.dev = lp3972->dev; in setup_regulators()
482 config.init_data = reg->initdata; in setup_regulators()
485 rdev = devm_regulator_register(lp3972->dev, in setup_regulators()
486 ®ulators[reg->id], &config); in setup_regulators()
489 dev_err(lp3972->dev, "regulator init failed: %d\n", in setup_regulators()
501 struct lp3972_platform_data *pdata = dev_get_platdata(&i2c->dev); in lp3972_i2c_probe()
506 dev_dbg(&i2c->dev, "No platform init data supplied\n"); in lp3972_i2c_probe()
507 return -ENODEV; in lp3972_i2c_probe()
510 lp3972 = devm_kzalloc(&i2c->dev, sizeof(struct lp3972), GFP_KERNEL); in lp3972_i2c_probe()
512 return -ENOMEM; in lp3972_i2c_probe()
514 lp3972->i2c = i2c; in lp3972_i2c_probe()
515 lp3972->dev = &i2c->dev; in lp3972_i2c_probe()
517 mutex_init(&lp3972->io_lock); in lp3972_i2c_probe()
523 ret = -ENODEV; in lp3972_i2c_probe()
524 dev_err(&i2c->dev, "chip reported: val = 0x%x\n", val); in lp3972_i2c_probe()
527 dev_err(&i2c->dev, "failed to detect device. ret = %d\n", ret); in lp3972_i2c_probe()