diff options
author | Sundar R Iyer <sundar.iyer@stericsson.com> | 2010-07-13 02:21:28 -0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-08-11 06:38:01 -0400 |
commit | 549931f99e030d63a437c23943fd8dc9b7c0e41c (patch) | |
tree | 6367d2b696af0fcdda8e275e18c4c666743a54f2 | |
parent | 1880a2fc59d2afabc142a311497cf7c320d64506 (diff) |
ab8500-mfd: add regulator support to ab8500 mfd device
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-By: Mattias Wallin <mattias.wallin@stericsson.com>
Acked-By: Bengt JONSSON <bengt.g.jonsson@stericsson.com>
Signed-off-by: Sundar R Iyer <sundar.iyer@stericsson.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r-- | drivers/mfd/ab8500-core.c | 4 | ||||
-rw-r--r-- | include/linux/mfd/ab8500.h | 6 | ||||
-rw-r--r-- | include/linux/regulator/ab8500.h | 25 |
3 files changed, 34 insertions, 1 deletions
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index f3d26fa9c34d..defa786dee34 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/mfd/core.h> | 17 | #include <linux/mfd/core.h> |
18 | #include <linux/mfd/ab8500.h> | 18 | #include <linux/mfd/ab8500.h> |
19 | #include <linux/regulator/ab8500.h> | ||
19 | 20 | ||
20 | /* | 21 | /* |
21 | * Interrupt register offsets | 22 | * Interrupt register offsets |
@@ -352,6 +353,7 @@ static struct mfd_cell ab8500_devs[] = { | |||
352 | { .name = "ab8500-audio", }, | 353 | { .name = "ab8500-audio", }, |
353 | { .name = "ab8500-usb", }, | 354 | { .name = "ab8500-usb", }, |
354 | { .name = "ab8500-pwm", }, | 355 | { .name = "ab8500-pwm", }, |
356 | { .name = "ab8500-regulator", }, | ||
355 | }; | 357 | }; |
356 | 358 | ||
357 | int __devinit ab8500_init(struct ab8500 *ab8500) | 359 | int __devinit ab8500_init(struct ab8500 *ab8500) |
@@ -411,7 +413,7 @@ int __devinit ab8500_init(struct ab8500 *ab8500) | |||
411 | goto out_removeirq; | 413 | goto out_removeirq; |
412 | } | 414 | } |
413 | 415 | ||
414 | ret = mfd_add_devices(ab8500->dev, -1, ab8500_devs, | 416 | ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs, |
415 | ARRAY_SIZE(ab8500_devs), NULL, | 417 | ARRAY_SIZE(ab8500_devs), NULL, |
416 | ab8500->irq_base); | 418 | ab8500->irq_base); |
417 | if (ret) | 419 | if (ret) |
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h index b63ff3ba3351..f5cec4500f38 100644 --- a/include/linux/mfd/ab8500.h +++ b/include/linux/mfd/ab8500.h | |||
@@ -76,6 +76,8 @@ | |||
76 | #define AB8500_NR_IRQS 104 | 76 | #define AB8500_NR_IRQS 104 |
77 | #define AB8500_NUM_IRQ_REGS 13 | 77 | #define AB8500_NUM_IRQ_REGS 13 |
78 | 78 | ||
79 | #define AB8500_NUM_REGULATORS 15 | ||
80 | |||
79 | /** | 81 | /** |
80 | * struct ab8500 - ab8500 internal structure | 82 | * struct ab8500 - ab8500 internal structure |
81 | * @dev: parent device | 83 | * @dev: parent device |
@@ -108,14 +110,18 @@ struct ab8500 { | |||
108 | u8 oldmask[AB8500_NUM_IRQ_REGS]; | 110 | u8 oldmask[AB8500_NUM_IRQ_REGS]; |
109 | }; | 111 | }; |
110 | 112 | ||
113 | struct regulator_init_data; | ||
114 | |||
111 | /** | 115 | /** |
112 | * struct ab8500_platform_data - AB8500 platform data | 116 | * struct ab8500_platform_data - AB8500 platform data |
113 | * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used | 117 | * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used |
114 | * @init: board-specific initialization after detection of ab8500 | 118 | * @init: board-specific initialization after detection of ab8500 |
119 | * @regulator: machine-specific constraints for regulators | ||
115 | */ | 120 | */ |
116 | struct ab8500_platform_data { | 121 | struct ab8500_platform_data { |
117 | int irq_base; | 122 | int irq_base; |
118 | void (*init) (struct ab8500 *); | 123 | void (*init) (struct ab8500 *); |
124 | struct regulator_init_data *regulator[AB8500_NUM_REGULATORS]; | ||
119 | }; | 125 | }; |
120 | 126 | ||
121 | extern int ab8500_write(struct ab8500 *a8500, u16 addr, u8 data); | 127 | extern int ab8500_write(struct ab8500 *a8500, u16 addr, u8 data); |
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h new file mode 100644 index 000000000000..f509877c2ed4 --- /dev/null +++ b/include/linux/regulator/ab8500.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License Terms: GNU General Public License v2 | ||
5 | * | ||
6 | * Author: Sundar Iyer <sundar.iyer@stericsson.com> for ST-Ericsson | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | #ifndef __LINUX_MFD_AB8500_REGULATOR_H | ||
11 | #define __LINUX_MFD_AB8500_REGULATOR_H | ||
12 | |||
13 | /* AB8500 regulators */ | ||
14 | #define AB8500_LDO_AUX1 0 | ||
15 | #define AB8500_LDO_AUX2 1 | ||
16 | #define AB8500_LDO_AUX3 2 | ||
17 | #define AB8500_LDO_INTCORE 3 | ||
18 | #define AB8500_LDO_TVOUT 4 | ||
19 | #define AB8500_LDO_AUDIO 5 | ||
20 | #define AB8500_LDO_ANAMIC1 6 | ||
21 | #define AB8500_LDO_ANAMIC2 7 | ||
22 | #define AB8500_LDO_DMIC 8 | ||
23 | #define AB8500_LDO_ANA 9 | ||
24 | |||
25 | #endif | ||