Lines Matching refs:ri

35 	struct aat2870_regulator *ri = rdev_get_drvdata(rdev);  in aat2870_ldo_set_voltage_sel()  local
36 struct aat2870_data *aat2870 = ri->aat2870; in aat2870_ldo_set_voltage_sel()
38 return aat2870->update(aat2870, ri->voltage_addr, ri->voltage_mask, in aat2870_ldo_set_voltage_sel()
39 selector << ri->voltage_shift); in aat2870_ldo_set_voltage_sel()
44 struct aat2870_regulator *ri = rdev_get_drvdata(rdev); in aat2870_ldo_get_voltage_sel() local
45 struct aat2870_data *aat2870 = ri->aat2870; in aat2870_ldo_get_voltage_sel()
49 ret = aat2870->read(aat2870, ri->voltage_addr, &val); in aat2870_ldo_get_voltage_sel()
53 return (val & ri->voltage_mask) >> ri->voltage_shift; in aat2870_ldo_get_voltage_sel()
58 struct aat2870_regulator *ri = rdev_get_drvdata(rdev); in aat2870_ldo_enable() local
59 struct aat2870_data *aat2870 = ri->aat2870; in aat2870_ldo_enable()
61 return aat2870->update(aat2870, ri->enable_addr, ri->enable_mask, in aat2870_ldo_enable()
62 ri->enable_mask); in aat2870_ldo_enable()
67 struct aat2870_regulator *ri = rdev_get_drvdata(rdev); in aat2870_ldo_disable() local
68 struct aat2870_data *aat2870 = ri->aat2870; in aat2870_ldo_disable()
70 return aat2870->update(aat2870, ri->enable_addr, ri->enable_mask, 0); in aat2870_ldo_disable()
75 struct aat2870_regulator *ri = rdev_get_drvdata(rdev); in aat2870_ldo_is_enabled() local
76 struct aat2870_data *aat2870 = ri->aat2870; in aat2870_ldo_is_enabled()
80 ret = aat2870->read(aat2870, ri->enable_addr, &val); in aat2870_ldo_is_enabled()
84 return val & ri->enable_mask ? 1 : 0; in aat2870_ldo_is_enabled()
126 struct aat2870_regulator *ri = NULL; in aat2870_get_regulator() local
130 ri = &aat2870_regulators[i]; in aat2870_get_regulator()
131 if (ri->desc.id == id) in aat2870_get_regulator()
138 ri->enable_addr = AAT2870_LDO_EN; in aat2870_get_regulator()
139 ri->enable_shift = id - AAT2870_ID_LDOA; in aat2870_get_regulator()
140 ri->enable_mask = 0x1 << ri->enable_shift; in aat2870_get_regulator()
142 ri->voltage_addr = (id - AAT2870_ID_LDOA) / 2 ? in aat2870_get_regulator()
144 ri->voltage_shift = (id - AAT2870_ID_LDOA) % 2 ? 0 : 4; in aat2870_get_regulator()
145 ri->voltage_mask = 0xF << ri->voltage_shift; in aat2870_get_regulator()
147 return ri; in aat2870_get_regulator()
152 struct aat2870_regulator *ri; in aat2870_regulator_probe() local
156 ri = aat2870_get_regulator(pdev->id); in aat2870_regulator_probe()
157 if (!ri) { in aat2870_regulator_probe()
161 ri->aat2870 = dev_get_drvdata(pdev->dev.parent); in aat2870_regulator_probe()
164 config.driver_data = ri; in aat2870_regulator_probe()
167 rdev = devm_regulator_register(&pdev->dev, &ri->desc, &config); in aat2870_regulator_probe()
170 ri->desc.name); in aat2870_regulator_probe()