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