21 #include <linux/module.h>
25 #include <linux/slab.h>
51 return sprintf(buf,
"enabled\n");
53 return sprintf(buf,
"disabled\n");
57 const char *buf,
size_t count)
72 dev_err(dev,
"Configuring invalid mode\n");
88 dev_err(dev,
"Failed to configure state: %d\n", ret);
100 &dev_attr_state.attr,
108 static int regulator_userspace_consumer_probe(
struct platform_device *pdev)
114 pdata = pdev->
dev.platform_data;
133 dev_err(&pdev->
dev,
"Failed to get supplies: %d\n", ret);
146 "Failed to set initial state: %d\n", ret);
152 platform_set_drvdata(pdev, drvdata);
162 static int regulator_userspace_consumer_remove(
struct platform_device *pdev)
175 .probe = regulator_userspace_consumer_probe,
176 .remove = regulator_userspace_consumer_remove,
178 .name =
"reg-userspace-consumer",