14 #include <linux/module.h>
17 #include <linux/bitops.h>
19 #include <linux/i2c.h>
22 #include <linux/slab.h>
28 #define WM831X_ISINK_MAX_NAME 7
78 static int wm831x_isink_is_enabled(
struct regulator_dev *rdev)
81 struct wm831x *wm831x = isink->
wm831x;
95 static int wm831x_isink_set_current(
struct regulator_dev *rdev,
96 int min_uA,
int max_uA)
99 struct wm831x *wm831x = isink->
wm831x;
104 if (min_uA <= val && val <= max_uA) {
114 static int wm831x_isink_get_current(
struct regulator_dev *rdev)
117 struct wm831x *wm831x = isink->
wm831x;
132 .is_enabled = wm831x_isink_is_enabled,
133 .enable = wm831x_isink_enable,
134 .disable = wm831x_isink_disable,
135 .set_current_limit = wm831x_isink_set_current,
136 .get_current_limit = wm831x_isink_get_current,
161 dev_dbg(&pdev->
dev,
"Probing ISINK%d\n",
id + 1);
169 dev_err(&pdev->
dev,
"Unable to allocate private data\n");
189 isink->
desc.ops = &wm831x_isink_ops;
193 config.
dev = pdev->
dev.parent;
200 dev_err(wm831x->
dev,
"Failed to register ISINK%d: %d\n",
209 dev_err(&pdev->
dev,
"Failed to request ISINK IRQ %d: %d\n",
214 platform_set_drvdata(pdev, isink);
226 struct wm831x_isink *isink = platform_get_drvdata(pdev);
228 platform_set_drvdata(pdev,
NULL);
238 .probe = wm831x_isink_probe,
241 .name =
"wm831x-isink",
246 static int __init wm831x_isink_init(
void)
251 pr_err(
"Failed to register WM831x ISINK driver: %d\n", ret);
257 static void __exit wm831x_isink_exit(
void)