Lines Matching refs:ri
103 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_reg_is_enabled() local
108 if (ri->ext_ctrl_flag & TPS80031_EXT_PWR_REQ) in tps80031_reg_is_enabled()
111 ret = tps80031_read(parent, TPS80031_SLAVE_ID1, ri->rinfo->state_reg, in tps80031_reg_is_enabled()
115 ri->rinfo->state_reg, ret); in tps80031_reg_is_enabled()
123 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_reg_enable() local
127 if (ri->ext_ctrl_flag & TPS80031_EXT_PWR_REQ) in tps80031_reg_enable()
130 ret = tps80031_update(parent, TPS80031_SLAVE_ID1, ri->rinfo->state_reg, in tps80031_reg_enable()
134 ri->rinfo->state_reg, ret); in tps80031_reg_enable()
142 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_reg_disable() local
146 if (ri->ext_ctrl_flag & TPS80031_EXT_PWR_REQ) in tps80031_reg_disable()
149 ret = tps80031_update(parent, TPS80031_SLAVE_ID1, ri->rinfo->state_reg, in tps80031_reg_disable()
153 ri->rinfo->state_reg, ret); in tps80031_reg_disable()
167 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_dcdc_list_voltage() local
168 int volt_index = ri->device_flags & 0x3; in tps80031_dcdc_list_voltage()
181 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_dcdc_set_voltage_sel() local
186 if (ri->rinfo->force_reg) { in tps80031_dcdc_set_voltage_sel()
187 ret = tps80031_read(parent, ri->rinfo->volt_id, in tps80031_dcdc_set_voltage_sel()
188 ri->rinfo->force_reg, ®_val); in tps80031_dcdc_set_voltage_sel()
190 dev_err(ri->dev, "reg 0x%02x read failed, e = %d\n", in tps80031_dcdc_set_voltage_sel()
191 ri->rinfo->force_reg, ret); in tps80031_dcdc_set_voltage_sel()
195 ret = tps80031_update(parent, ri->rinfo->volt_id, in tps80031_dcdc_set_voltage_sel()
196 ri->rinfo->force_reg, vsel, SMPS_VSEL_MASK); in tps80031_dcdc_set_voltage_sel()
198 dev_err(ri->dev, in tps80031_dcdc_set_voltage_sel()
200 ri->rinfo->force_reg, ret); in tps80031_dcdc_set_voltage_sel()
204 ret = tps80031_update(parent, ri->rinfo->volt_id, in tps80031_dcdc_set_voltage_sel()
205 ri->rinfo->volt_reg, vsel, SMPS_VSEL_MASK); in tps80031_dcdc_set_voltage_sel()
207 dev_err(ri->dev, "reg 0x%02x update failed, e = %d\n", in tps80031_dcdc_set_voltage_sel()
208 ri->rinfo->volt_reg, ret); in tps80031_dcdc_set_voltage_sel()
214 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_dcdc_get_voltage_sel() local
219 if (ri->rinfo->force_reg) { in tps80031_dcdc_get_voltage_sel()
220 ret = tps80031_read(parent, ri->rinfo->volt_id, in tps80031_dcdc_get_voltage_sel()
221 ri->rinfo->force_reg, &vsel); in tps80031_dcdc_get_voltage_sel()
223 dev_err(ri->dev, "reg 0x%02x read failed, e = %d\n", in tps80031_dcdc_get_voltage_sel()
224 ri->rinfo->force_reg, ret); in tps80031_dcdc_get_voltage_sel()
231 ret = tps80031_read(parent, ri->rinfo->volt_id, in tps80031_dcdc_get_voltage_sel()
232 ri->rinfo->volt_reg, &vsel); in tps80031_dcdc_get_voltage_sel()
234 dev_err(ri->dev, "reg 0x%02x read failed, e = %d\n", in tps80031_dcdc_get_voltage_sel()
235 ri->rinfo->volt_reg, ret); in tps80031_dcdc_get_voltage_sel()
244 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_ldo_list_voltage() local
248 if ((ri->rinfo->desc.id == TPS80031_REGULATOR_LDO2) && in tps80031_ldo_list_voltage()
249 (ri->device_flags & TRACK_MODE_ENABLE)) { in tps80031_ldo_list_voltage()
255 dev_err(ri->dev, in tps80031_ldo_list_voltage()
268 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_ldo_map_voltage() local
272 if ((ri->rinfo->desc.id == TPS80031_REGULATOR_LDO2) && in tps80031_ldo_map_voltage()
273 (ri->device_flags & TRACK_MODE_ENABLE)) { in tps80031_ldo_map_voltage()
287 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_vbus_is_enabled() local
296 dev_err(ri->dev, "reg 0x%02x read failed, e = %d\n", in tps80031_vbus_is_enabled()
303 dev_err(ri->dev, "reg 0x%02x read failed, e = %d\n", in tps80031_vbus_is_enabled()
314 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_vbus_enable() local
321 dev_err(ri->dev, "reg 0x%02x read failed, e = %d\n", in tps80031_vbus_enable()
329 dev_err(ri->dev, "reg 0x%02x read failed, e = %d\n", in tps80031_vbus_enable()
338 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_vbus_disable() local
342 if (ri->config_flags & TPS80031_VBUS_DISCHRG_EN_PDN) { in tps80031_vbus_disable()
346 dev_err(ri->dev, "reg 0x%02x write failed, e = %d\n", in tps80031_vbus_disable()
355 dev_err(ri->dev, "reg 0x%02x clearbit failed, e = %d\n", in tps80031_vbus_disable()
363 dev_err(ri->dev, "reg 0x%02x clearbit failed, e = %d\n", in tps80031_vbus_disable()
368 mdelay(DIV_ROUND_UP(ri->rinfo->desc.enable_time, 1000)); in tps80031_vbus_disable()
369 if (ri->config_flags & TPS80031_VBUS_DISCHRG_EN_PDN) { in tps80031_vbus_disable()
373 dev_err(ri->dev, "reg 0x%02x write failed, e = %d\n", in tps80031_vbus_disable()
508 struct tps80031_regulator *ri, in tps80031_power_req_config() argument
513 if (ri->rinfo->preq_bit < 0) in tps80031_power_req_config()
516 ret = tps80031_ext_power_req_config(parent, ri->ext_ctrl_flag, in tps80031_power_req_config()
517 ri->rinfo->preq_bit, ri->rinfo->state_reg, in tps80031_power_req_config()
518 ri->rinfo->trans_reg); in tps80031_power_req_config()
520 dev_err(ri->dev, "ext powerreq config failed, err = %d\n", ret); in tps80031_power_req_config()
527 ri->rinfo->trans_reg, TPS80031_TRANS_SLEEP_ON, in tps80031_power_req_config()
530 dev_err(ri->dev, "Reg 0x%02x update failed, e %d\n", in tps80031_power_req_config()
531 ri->rinfo->trans_reg, ret); in tps80031_power_req_config()
539 struct tps80031_regulator *ri, in tps80031_regulator_config() argument
544 switch (ri->rinfo->desc.id) { in tps80031_regulator_config()
546 if (ri->config_flags & (TPS80031_USBLDO_INPUT_VSYS | in tps80031_regulator_config()
549 if (ri->config_flags & TPS80031_USBLDO_INPUT_VSYS) in tps80031_regulator_config()
558 dev_err(ri->dev, in tps80031_regulator_config()
566 if (ri->config_flags & TPS80031_LDO3_OUTPUT_VIB) { in tps80031_regulator_config()
571 dev_err(ri->dev, in tps80031_regulator_config()
580 if (!(ri->config_flags & TPS80031_VBUS_SW_ONLY)) in tps80031_regulator_config()
581 ri->rinfo->desc.ops = &tps80031_vbus_sw_ops; in tps80031_regulator_config()
588 ret = tps80031_update(parent, TPS80031_SLAVE_ID1, ri->rinfo->trans_reg, in tps80031_regulator_config()
593 dev_err(ri->dev, "trans reg update failed, e %d\n", ret); in tps80031_regulator_config()
601 struct tps80031_regulator *ri) in check_smps_mode_mult() argument
622 switch (ri->rinfo->desc.id) { in check_smps_mode_mult()
639 ri->device_flags = smps_mult & BIT(5) ? TRACK_MODE_ENABLE : 0; in check_smps_mode_mult()
641 if (ri->device_flags & TRACK_MODE_ENABLE) { in check_smps_mode_mult()
642 ri->rinfo->desc.min_uV = 600000; in check_smps_mode_mult()
643 ri->rinfo->desc.uV_step = 12500; in check_smps_mode_mult()
644 ri->rinfo->desc.n_voltages = 57; in check_smps_mode_mult()
645 ri->rinfo->desc.vsel_mask = LDO_TRACK_VSEL_MASK; in check_smps_mode_mult()
652 ri->device_flags = (smps_offset & mult_offset) ? DCDC_OFFSET_EN : 0; in check_smps_mode_mult()
653 ri->device_flags |= (smps_mult & mult_offset) ? DCDC_EXTENDED_EN : 0; in check_smps_mode_mult()
654 switch (ri->device_flags) { in check_smps_mode_mult()
656 ri->rinfo->desc.min_uV = 607700; in check_smps_mode_mult()
657 ri->rinfo->desc.uV_step = 12660; in check_smps_mode_mult()
660 ri->rinfo->desc.min_uV = 700000; in check_smps_mode_mult()
661 ri->rinfo->desc.uV_step = 12500; in check_smps_mode_mult()
664 ri->rinfo->desc.min_uV = 1852000; in check_smps_mode_mult()
665 ri->rinfo->desc.uV_step = 38600; in check_smps_mode_mult()
668 ri->rinfo->desc.min_uV = 2161000; in check_smps_mode_mult()
669 ri->rinfo->desc.uV_step = 38600; in check_smps_mode_mult()
679 struct tps80031_regulator *ri; in tps80031_regulator_probe() local
701 ri = &pmic[num]; in tps80031_regulator_probe()
702 ri->rinfo = &tps80031_rinfo[num]; in tps80031_regulator_probe()
703 ri->dev = &pdev->dev; in tps80031_regulator_probe()
705 check_smps_mode_mult(pdev->dev.parent, ri); in tps80031_regulator_probe()
708 config.driver_data = ri; in tps80031_regulator_probe()
709 config.regmap = tps80031_mfd->regmap[ri->rinfo->volt_id]; in tps80031_regulator_probe()
713 ri->config_flags = tps_pdata->config_flags; in tps80031_regulator_probe()
714 ri->ext_ctrl_flag = tps_pdata->ext_ctrl_flag; in tps80031_regulator_probe()
716 ri, tps_pdata); in tps80031_regulator_probe()
724 ri, tps_pdata); in tps80031_regulator_probe()
731 rdev = devm_regulator_register(&pdev->dev, &ri->rinfo->desc, in tps80031_regulator_probe()
736 ri->rinfo->desc.name); in tps80031_regulator_probe()
739 ri->rdev = rdev; in tps80031_regulator_probe()