Lines Matching full:ri

88 	struct tps80031_regulator *ri = rdev_get_drvdata(rdev);  in tps80031_reg_is_enabled()  local
93 if (ri->ext_ctrl_flag & TPS80031_EXT_PWR_REQ) in tps80031_reg_is_enabled()
96 ret = tps80031_read(parent, TPS80031_SLAVE_ID1, ri->rinfo->state_reg, in tps80031_reg_is_enabled()
100 ri->rinfo->state_reg, ret); in tps80031_reg_is_enabled()
108 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_reg_enable() local
112 if (ri->ext_ctrl_flag & TPS80031_EXT_PWR_REQ) in tps80031_reg_enable()
115 ret = tps80031_update(parent, TPS80031_SLAVE_ID1, ri->rinfo->state_reg, in tps80031_reg_enable()
119 ri->rinfo->state_reg, ret); in tps80031_reg_enable()
127 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_reg_disable() local
131 if (ri->ext_ctrl_flag & TPS80031_EXT_PWR_REQ) in tps80031_reg_disable()
134 ret = tps80031_update(parent, TPS80031_SLAVE_ID1, ri->rinfo->state_reg, in tps80031_reg_disable()
138 ri->rinfo->state_reg, ret); in tps80031_reg_disable()
152 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_dcdc_list_voltage() local
153 int volt_index = ri->device_flags & 0x3; in tps80031_dcdc_list_voltage()
166 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_dcdc_set_voltage_sel() local
171 if (ri->rinfo->force_reg) { in tps80031_dcdc_set_voltage_sel()
172 ret = tps80031_read(parent, ri->rinfo->volt_id, in tps80031_dcdc_set_voltage_sel()
173 ri->rinfo->force_reg, &reg_val); in tps80031_dcdc_set_voltage_sel()
175 dev_err(ri->dev, "reg 0x%02x read failed, e = %d\n", in tps80031_dcdc_set_voltage_sel()
176 ri->rinfo->force_reg, ret); in tps80031_dcdc_set_voltage_sel()
180 ret = tps80031_update(parent, ri->rinfo->volt_id, in tps80031_dcdc_set_voltage_sel()
181 ri->rinfo->force_reg, vsel, SMPS_VSEL_MASK); in tps80031_dcdc_set_voltage_sel()
183 dev_err(ri->dev, in tps80031_dcdc_set_voltage_sel()
185 ri->rinfo->force_reg, ret); in tps80031_dcdc_set_voltage_sel()
189 ret = tps80031_update(parent, ri->rinfo->volt_id, in tps80031_dcdc_set_voltage_sel()
190 ri->rinfo->volt_reg, vsel, SMPS_VSEL_MASK); in tps80031_dcdc_set_voltage_sel()
192 dev_err(ri->dev, "reg 0x%02x update failed, e = %d\n", in tps80031_dcdc_set_voltage_sel()
193 ri->rinfo->volt_reg, ret); in tps80031_dcdc_set_voltage_sel()
199 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_dcdc_get_voltage_sel() local
204 if (ri->rinfo->force_reg) { in tps80031_dcdc_get_voltage_sel()
205 ret = tps80031_read(parent, ri->rinfo->volt_id, in tps80031_dcdc_get_voltage_sel()
206 ri->rinfo->force_reg, &vsel); in tps80031_dcdc_get_voltage_sel()
208 dev_err(ri->dev, "reg 0x%02x read failed, e = %d\n", in tps80031_dcdc_get_voltage_sel()
209 ri->rinfo->force_reg, ret); in tps80031_dcdc_get_voltage_sel()
216 ret = tps80031_read(parent, ri->rinfo->volt_id, in tps80031_dcdc_get_voltage_sel()
217 ri->rinfo->volt_reg, &vsel); in tps80031_dcdc_get_voltage_sel()
219 dev_err(ri->dev, "reg 0x%02x read failed, e = %d\n", in tps80031_dcdc_get_voltage_sel()
220 ri->rinfo->volt_reg, ret); in tps80031_dcdc_get_voltage_sel()
229 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_ldo_list_voltage() local
233 if ((ri->rinfo->desc.id == TPS80031_REGULATOR_LDO2) && in tps80031_ldo_list_voltage()
234 (ri->device_flags & TRACK_MODE_ENABLE)) { in tps80031_ldo_list_voltage()
240 dev_err(ri->dev, in tps80031_ldo_list_voltage()
253 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_ldo_map_voltage() local
257 if ((ri->rinfo->desc.id == TPS80031_REGULATOR_LDO2) && in tps80031_ldo_map_voltage()
258 (ri->device_flags & TRACK_MODE_ENABLE)) { in tps80031_ldo_map_voltage()
272 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_vbus_is_enabled() local
281 dev_err(ri->dev, "reg 0x%02x read failed, e = %d\n", in tps80031_vbus_is_enabled()
288 dev_err(ri->dev, "reg 0x%02x read failed, e = %d\n", in tps80031_vbus_is_enabled()
299 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_vbus_enable() local
306 dev_err(ri->dev, "reg 0x%02x read failed, e = %d\n", in tps80031_vbus_enable()
314 dev_err(ri->dev, "reg 0x%02x read failed, e = %d\n", in tps80031_vbus_enable()
323 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); in tps80031_vbus_disable() local
327 if (ri->config_flags & TPS80031_VBUS_DISCHRG_EN_PDN) { in tps80031_vbus_disable()
331 dev_err(ri->dev, "reg 0x%02x write failed, e = %d\n", in tps80031_vbus_disable()
340 dev_err(ri->dev, "reg 0x%02x clearbit failed, e = %d\n", in tps80031_vbus_disable()
348 dev_err(ri->dev, "reg 0x%02x clearbit failed, e = %d\n", in tps80031_vbus_disable()
353 mdelay(DIV_ROUND_UP(ri->rinfo->desc.enable_time, 1000)); in tps80031_vbus_disable()
354 if (ri->config_flags & TPS80031_VBUS_DISCHRG_EN_PDN) { in tps80031_vbus_disable()
358 dev_err(ri->dev, "reg 0x%02x write failed, e = %d\n", in tps80031_vbus_disable()
493 struct tps80031_regulator *ri, in tps80031_power_req_config() argument
498 if (ri->rinfo->preq_bit < 0) in tps80031_power_req_config()
501 ret = tps80031_ext_power_req_config(parent, ri->ext_ctrl_flag, in tps80031_power_req_config()
502 ri->rinfo->preq_bit, ri->rinfo->state_reg, in tps80031_power_req_config()
503 ri->rinfo->trans_reg); in tps80031_power_req_config()
505 dev_err(ri->dev, "ext powerreq config failed, err = %d\n", ret); in tps80031_power_req_config()
512 ri->rinfo->trans_reg, TPS80031_TRANS_SLEEP_ON, in tps80031_power_req_config()
515 dev_err(ri->dev, "Reg 0x%02x update failed, e %d\n", in tps80031_power_req_config()
516 ri->rinfo->trans_reg, ret); in tps80031_power_req_config()
524 struct tps80031_regulator *ri, in tps80031_regulator_config() argument
529 switch (ri->rinfo->desc.id) { in tps80031_regulator_config()
531 if (ri->config_flags & (TPS80031_USBLDO_INPUT_VSYS | in tps80031_regulator_config()
535 if (ri->config_flags & TPS80031_USBLDO_INPUT_VSYS) in tps80031_regulator_config()
544 dev_err(ri->dev, in tps80031_regulator_config()
552 if (ri->config_flags & TPS80031_LDO3_OUTPUT_VIB) { in tps80031_regulator_config()
557 dev_err(ri->dev, in tps80031_regulator_config()
566 if (!(ri->config_flags & TPS80031_VBUS_SW_ONLY)) in tps80031_regulator_config()
567 ri->rinfo->desc.ops = &tps80031_vbus_sw_ops; in tps80031_regulator_config()
574 ret = tps80031_update(parent, TPS80031_SLAVE_ID1, ri->rinfo->trans_reg, in tps80031_regulator_config()
579 dev_err(ri->dev, "trans reg update failed, e %d\n", ret); in tps80031_regulator_config()
587 struct tps80031_regulator *ri) in check_smps_mode_mult() argument
608 switch (ri->rinfo->desc.id) { in check_smps_mode_mult()
625 ri->device_flags = smps_mult & BIT(5) ? TRACK_MODE_ENABLE : 0; in check_smps_mode_mult()
627 if (ri->device_flags & TRACK_MODE_ENABLE) { in check_smps_mode_mult()
628 ri->rinfo->desc.min_uV = 600000; in check_smps_mode_mult()
629 ri->rinfo->desc.uV_step = 12500; in check_smps_mode_mult()
630 ri->rinfo->desc.n_voltages = 57; in check_smps_mode_mult()
631 ri->rinfo->desc.vsel_mask = LDO_TRACK_VSEL_MASK; in check_smps_mode_mult()
638 ri->device_flags = (smps_offset & mult_offset) ? DCDC_OFFSET_EN : 0; in check_smps_mode_mult()
639 ri->device_flags |= (smps_mult & mult_offset) ? DCDC_EXTENDED_EN : 0; in check_smps_mode_mult()
640 switch (ri->device_flags) { in check_smps_mode_mult()
642 ri->rinfo->desc.min_uV = 607700; in check_smps_mode_mult()
643 ri->rinfo->desc.uV_step = 12660; in check_smps_mode_mult()
646 ri->rinfo->desc.min_uV = 700000; in check_smps_mode_mult()
647 ri->rinfo->desc.uV_step = 12500; in check_smps_mode_mult()
650 ri->rinfo->desc.min_uV = 1852000; in check_smps_mode_mult()
651 ri->rinfo->desc.uV_step = 38600; in check_smps_mode_mult()
654 ri->rinfo->desc.min_uV = 2161000; in check_smps_mode_mult()
655 ri->rinfo->desc.uV_step = 38600; in check_smps_mode_mult()
665 struct tps80031_regulator *ri; in tps80031_regulator_probe() local
687 ri = &pmic[num]; in tps80031_regulator_probe()
688 ri->rinfo = &tps80031_rinfo[num]; in tps80031_regulator_probe()
689 ri->dev = &pdev->dev; in tps80031_regulator_probe()
691 check_smps_mode_mult(pdev->dev.parent, ri); in tps80031_regulator_probe()
694 config.driver_data = ri; in tps80031_regulator_probe()
695 config.regmap = tps80031_mfd->regmap[ri->rinfo->volt_id]; in tps80031_regulator_probe()
699 ri->config_flags = tps_pdata->config_flags; in tps80031_regulator_probe()
700 ri->ext_ctrl_flag = tps_pdata->ext_ctrl_flag; in tps80031_regulator_probe()
702 ri, tps_pdata); in tps80031_regulator_probe()
710 ri, tps_pdata); in tps80031_regulator_probe()
717 rdev = devm_regulator_register(&pdev->dev, &ri->rinfo->desc, in tps80031_regulator_probe()
722 ri->rinfo->desc.name); in tps80031_regulator_probe()