25 #include <linux/module.h>
27 #include <linux/slab.h>
72 .enable_time = rc5t583_regulator_enable_time,
80 #define RC5T583_REG(_id, _en_reg, _en_bit, _disc_reg, _disc_bit, \
81 _vout_mask, _min_mv, _max_mv, _step_uV, _enable_mv) \
83 .reg_disc_reg = RC5T583_REG_##_disc_reg, \
84 .disc_bit = _disc_bit, \
85 .deepsleep_reg = RC5T583_REG_##_id##DAC_DS, \
86 .enable_uv_per_us = _enable_mv * 1000, \
87 .deepsleep_id = RC5T583_DS_##_id, \
89 .name = "rc5t583-regulator-"#_id, \
90 .id = RC5T583_REGULATOR_##_id, \
91 .n_voltages = (_max_mv - _min_mv) * 1000 / _step_uV + 1, \
92 .ops = &rc5t583_ops, \
93 .type = REGULATOR_VOLTAGE, \
94 .owner = THIS_MODULE, \
95 .vsel_reg = RC5T583_REG_##_id##DAC, \
96 .vsel_mask = _vout_mask, \
97 .enable_reg = RC5T583_REG_##_en_reg, \
98 .enable_mask = BIT(_en_bit), \
99 .min_uV = _min_mv * 1000, \
100 .uV_step = _step_uV, \
101 .ramp_delay = 40 * 1000, \
106 RC5T583_REG(DC0, DC0CTL, 0, DC0CTL, 1, 0x7F, 700, 1500, 12500, 4),
107 RC5T583_REG(DC1, DC1CTL, 0, DC1CTL, 1, 0x7F, 700, 1500, 12500, 14),
108 RC5T583_REG(
DC2, DC2CTL, 0, DC2CTL, 1, 0x7F, 900, 2400, 12500, 14),
109 RC5T583_REG(DC3, DC3CTL, 0, DC3CTL, 1, 0x7F, 900, 2400, 12500, 14),
110 RC5T583_REG(LDO0, LDOEN2, 0, LDODIS2, 0, 0x7F, 900, 3400, 25000, 160),
111 RC5T583_REG(LDO1, LDOEN2, 1, LDODIS2, 1, 0x7F, 900, 3400, 25000, 160),
112 RC5T583_REG(LDO2, LDOEN2, 2, LDODIS2, 2, 0x7F, 900, 3400, 25000, 160),
113 RC5T583_REG(LDO3, LDOEN2, 3, LDODIS2, 3, 0x7F, 900, 3400, 25000, 160),
114 RC5T583_REG(LDO4, LDOEN2, 4, LDODIS2, 4, 0x3F, 750, 1500, 12500, 133),
115 RC5T583_REG(LDO5, LDOEN2, 5, LDODIS2, 5, 0x7F, 900, 3400, 25000, 267),
116 RC5T583_REG(LDO6, LDOEN2, 6, LDODIS2, 6, 0x7F, 900, 3400, 25000, 133),
117 RC5T583_REG(LDO7, LDOEN2, 7, LDODIS2, 7, 0x7F, 900, 3400, 25000, 233),
118 RC5T583_REG(LDO8, LDOEN1, 0, LDODIS1, 0, 0x7F, 900, 3400, 25000, 233),
119 RC5T583_REG(LDO9, LDOEN1, 1, LDODIS1, 1, 0x7F, 900, 3400, 25000, 133),
136 dev_err(&pdev->
dev,
"No platform data, exiting...\n");
143 dev_err(&pdev->
dev,
"Memory allocation failed exiting..\n");
156 ri = &rc5t583_reg_info[
id];
162 goto skip_ext_pwr_config;
174 "Failed to configure ext control %d\n",
id);
184 dev_err(&pdev->
dev,
"Failed to register regulator %s\n",
191 platform_set_drvdata(pdev, regs);
213 .name =
"rc5t583-regulator",
216 .probe = rc5t583_regulator_probe,
220 static int __init rc5t583_regulator_init(
void)
226 static void __exit rc5t583_regulator_exit(
void)