Lines Matching full:dev
14 int regulator_mode(struct udevice *dev, struct dm_regulator_mode **modep) in regulator_mode() argument
20 uc_pdata = dev_get_uclass_platdata(dev); in regulator_mode()
28 int regulator_get_value(struct udevice *dev) in regulator_get_value() argument
30 const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); in regulator_get_value()
35 return ops->get_value(dev); in regulator_get_value()
38 int regulator_set_value(struct udevice *dev, int uV) in regulator_set_value() argument
40 const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); in regulator_set_value()
43 uc_pdata = dev_get_uclass_platdata(dev); in regulator_set_value()
52 return ops->set_value(dev, uV); in regulator_set_value()
59 int regulator_set_value_force(struct udevice *dev, int uV) in regulator_set_value_force() argument
61 const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); in regulator_set_value_force()
66 return ops->set_value(dev, uV); in regulator_set_value_force()
69 int regulator_get_current(struct udevice *dev) in regulator_get_current() argument
71 const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); in regulator_get_current()
76 return ops->get_current(dev); in regulator_get_current()
79 int regulator_set_current(struct udevice *dev, int uA) in regulator_set_current() argument
81 const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); in regulator_set_current()
84 uc_pdata = dev_get_uclass_platdata(dev); in regulator_set_current()
93 return ops->set_current(dev, uA); in regulator_set_current()
96 int regulator_get_enable(struct udevice *dev) in regulator_get_enable() argument
98 const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); in regulator_get_enable()
103 return ops->get_enable(dev); in regulator_get_enable()
106 int regulator_set_enable(struct udevice *dev, bool enable) in regulator_set_enable() argument
108 const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); in regulator_set_enable()
113 return ops->set_enable(dev, enable); in regulator_set_enable()
116 int regulator_get_mode(struct udevice *dev) in regulator_get_mode() argument
118 const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); in regulator_get_mode()
123 return ops->get_mode(dev); in regulator_get_mode()
126 int regulator_set_mode(struct udevice *dev, int mode) in regulator_set_mode() argument
128 const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); in regulator_set_mode()
133 return ops->set_mode(dev, mode); in regulator_set_mode()
139 struct udevice *dev; in regulator_get_by_platname() local
144 for (ret = uclass_find_first_device(UCLASS_REGULATOR, &dev); dev; in regulator_get_by_platname()
145 ret = uclass_find_next_device(&dev)) { in regulator_get_by_platname()
147 debug("regulator %s, ret=%d\n", dev->name, ret); in regulator_get_by_platname()
151 uc_pdata = dev_get_uclass_platdata(dev); in regulator_get_by_platname()
155 return uclass_get_device_tail(dev, 0, devp); in regulator_get_by_platname()
168 int device_get_supply_regulator(struct udevice *dev, const char *supply_name, in device_get_supply_regulator() argument
171 return uclass_get_device_by_phandle(UCLASS_REGULATOR, dev, in device_get_supply_regulator()
175 int regulator_autoset(struct udevice *dev) in regulator_autoset() argument
180 uc_pdata = dev_get_uclass_platdata(dev); in regulator_autoset()
185 ret = regulator_set_value(dev, uc_pdata->min_uV); in regulator_autoset()
187 ret = regulator_set_current(dev, uc_pdata->min_uA); in regulator_autoset()
190 ret = regulator_set_enable(dev, true); in regulator_autoset()
195 static void regulator_show(struct udevice *dev, int ret) in regulator_show() argument
199 uc_pdata = dev_get_uclass_platdata(dev); in regulator_show()
201 printf("%s@%s: ", dev->name, uc_pdata->name); in regulator_show()
214 struct udevice *dev; in regulator_autoset_by_name() local
217 ret = regulator_get_by_platname(platname, &dev); in regulator_autoset_by_name()
219 *devp = dev; in regulator_autoset_by_name()
225 return regulator_autoset(dev); in regulator_autoset_by_name()
232 struct udevice *dev; in regulator_list_autoset() local
236 ret = regulator_autoset_by_name(list_platname[i], &dev); in regulator_list_autoset()
238 regulator_show(dev, ret); in regulator_list_autoset()
243 list_devp[i] = dev; in regulator_list_autoset()
255 struct udevice *dev; in regulator_name_is_unique() local
260 for (ret = uclass_find_first_device(UCLASS_REGULATOR, &dev); dev; in regulator_name_is_unique()
261 ret = uclass_find_next_device(&dev)) { in regulator_name_is_unique()
262 if (ret || dev == check_dev) in regulator_name_is_unique()
265 uc_pdata = dev_get_uclass_platdata(dev); in regulator_name_is_unique()
277 static int regulator_post_bind(struct udevice *dev) in regulator_post_bind() argument
282 uc_pdata = dev_get_uclass_platdata(dev); in regulator_post_bind()
285 uc_pdata->name = dev_read_string(dev, property); in regulator_post_bind()
287 debug("%s: dev '%s' has no property '%s'\n", in regulator_post_bind()
288 __func__, dev->name, property); in regulator_post_bind()
289 uc_pdata->name = dev_read_name(dev); in regulator_post_bind()
294 if (regulator_name_is_unique(dev, uc_pdata->name)) in regulator_post_bind()
297 debug("'%s' of dev: '%s', has nonunique value: '%s\n", in regulator_post_bind()
298 property, dev->name, uc_pdata->name); in regulator_post_bind()
303 static int regulator_pre_probe(struct udevice *dev) in regulator_pre_probe() argument
307 uc_pdata = dev_get_uclass_platdata(dev); in regulator_pre_probe()
312 uc_pdata->min_uV = dev_read_u32_default(dev, "regulator-min-microvolt", in regulator_pre_probe()
314 uc_pdata->max_uV = dev_read_u32_default(dev, "regulator-max-microvolt", in regulator_pre_probe()
316 uc_pdata->min_uA = dev_read_u32_default(dev, "regulator-min-microamp", in regulator_pre_probe()
318 uc_pdata->max_uA = dev_read_u32_default(dev, "regulator-max-microamp", in regulator_pre_probe()
320 uc_pdata->always_on = dev_read_bool(dev, "regulator-always-on"); in regulator_pre_probe()
321 uc_pdata->boot_on = dev_read_bool(dev, "regulator-boot-on"); in regulator_pre_probe()
340 struct udevice *dev; in regulators_enable_boot_on() local
347 for (uclass_first_device(UCLASS_REGULATOR, &dev); in regulators_enable_boot_on()
348 dev; in regulators_enable_boot_on()
349 uclass_next_device(&dev)) { in regulators_enable_boot_on()
350 ret = regulator_autoset(dev); in regulators_enable_boot_on()
356 regulator_show(dev, ret); in regulators_enable_boot_on()