diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-07-27 09:45:56 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2009-09-17 03:46:59 -0400 |
commit | 6704e5171ba9053ba173bcd807c7392d2076bdb4 (patch) | |
tree | 84f91270bdf1bfbefe2e059dec395d473cbd72d0 /drivers/mfd/wm831x-core.c | |
parent | 63aed85e3535b4603798184cc941e49de386d354 (diff) |
mfd: Add basic WM831x OTP support
The WM831x series of devices use OTP (One Time Programmable, a type
of PROM) to store system configuration. At run time this data is
visible via registers.
Currently the only explicitly supported feature is that the unique
ID provided by every WM831x device is exported to user space via
sysfs. Other configuration data may be read by system-specific
code in the pre_init() and post_init() platform data operations.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/wm831x-core.c')
-rw-r--r-- | drivers/mfd/wm831x-core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c index bc40ea315cc0..33eaea2f988e 100644 --- a/drivers/mfd/wm831x-core.c +++ b/drivers/mfd/wm831x-core.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/mfd/wm831x/pdata.h> | 23 | #include <linux/mfd/wm831x/pdata.h> |
24 | #include <linux/mfd/wm831x/irq.h> | 24 | #include <linux/mfd/wm831x/irq.h> |
25 | #include <linux/mfd/wm831x/auxadc.h> | 25 | #include <linux/mfd/wm831x/auxadc.h> |
26 | #include <linux/mfd/wm831x/otp.h> | ||
26 | 27 | ||
27 | enum wm831x_parent { | 28 | enum wm831x_parent { |
28 | WM8310 = 0, | 29 | WM8310 = 0, |
@@ -1340,6 +1341,8 @@ static int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq) | |||
1340 | ret); | 1341 | ret); |
1341 | } | 1342 | } |
1342 | 1343 | ||
1344 | wm831x_otp_init(wm831x); | ||
1345 | |||
1343 | if (pdata && pdata->post_init) { | 1346 | if (pdata && pdata->post_init) { |
1344 | ret = pdata->post_init(wm831x); | 1347 | ret = pdata->post_init(wm831x); |
1345 | if (ret != 0) { | 1348 | if (ret != 0) { |
@@ -1360,6 +1363,7 @@ err: | |||
1360 | 1363 | ||
1361 | static void wm831x_device_exit(struct wm831x *wm831x) | 1364 | static void wm831x_device_exit(struct wm831x *wm831x) |
1362 | { | 1365 | { |
1366 | wm831x_otp_exit(wm831x); | ||
1363 | mfd_remove_devices(wm831x->dev); | 1367 | mfd_remove_devices(wm831x->dev); |
1364 | wm831x_irq_exit(wm831x); | 1368 | wm831x_irq_exit(wm831x); |
1365 | kfree(wm831x); | 1369 | kfree(wm831x); |