diff options
author | Steve Sakoman <steve@sakoman.com> | 2011-03-05 11:12:26 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-03-11 08:46:31 -0500 |
commit | ca0a6a6473f69f1773c97755840587262d841883 (patch) | |
tree | 9bc2076278724f5b1632ad7b3e9b4130538fe781 /arch/arm/mach-omap2/board-overo.c | |
parent | ea75159ee6f00bd809f57a58e5505dc362382cc8 (diff) |
omap: overo: Add regulator for ads7846
The ads7846 driver now requires a regulator. This patch adds the
necessary regulator to the overo board file. Without it, the
following error occurs (and the touchscreen will not function):
ads7846 spi1.0: unable to get regulator: -19
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-overo.c')
-rw-r--r-- | arch/arm/mach-omap2/board-overo.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index d621ee8fec0c..4278ecb799a2 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
29 | #include <linux/i2c/twl.h> | 29 | #include <linux/i2c/twl.h> |
30 | #include <linux/regulator/machine.h> | 30 | #include <linux/regulator/machine.h> |
31 | #include <linux/regulator/fixed.h> | ||
31 | #include <linux/spi/spi.h> | 32 | #include <linux/spi/spi.h> |
32 | 33 | ||
33 | #include <linux/mtd/mtd.h> | 34 | #include <linux/mtd/mtd.h> |
@@ -97,6 +98,34 @@ static struct ads7846_platform_data ads7846_config = { | |||
97 | .keep_vref_on = 1, | 98 | .keep_vref_on = 1, |
98 | }; | 99 | }; |
99 | 100 | ||
101 | /* fixed regulator for ads7846 */ | ||
102 | static struct regulator_consumer_supply ads7846_supply = | ||
103 | REGULATOR_SUPPLY("vcc", "spi1.0"); | ||
104 | |||
105 | static struct regulator_init_data vads7846_regulator = { | ||
106 | .constraints = { | ||
107 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
108 | }, | ||
109 | .num_consumer_supplies = 1, | ||
110 | .consumer_supplies = &ads7846_supply, | ||
111 | }; | ||
112 | |||
113 | static struct fixed_voltage_config vads7846 = { | ||
114 | .supply_name = "vads7846", | ||
115 | .microvolts = 3300000, /* 3.3V */ | ||
116 | .gpio = -EINVAL, | ||
117 | .startup_delay = 0, | ||
118 | .init_data = &vads7846_regulator, | ||
119 | }; | ||
120 | |||
121 | static struct platform_device vads7846_device = { | ||
122 | .name = "reg-fixed-voltage", | ||
123 | .id = 1, | ||
124 | .dev = { | ||
125 | .platform_data = &vads7846, | ||
126 | }, | ||
127 | }; | ||
128 | |||
100 | static void __init overo_ads7846_init(void) | 129 | static void __init overo_ads7846_init(void) |
101 | { | 130 | { |
102 | if ((gpio_request(OVERO_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) && | 131 | if ((gpio_request(OVERO_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) && |
@@ -106,6 +135,8 @@ static void __init overo_ads7846_init(void) | |||
106 | printk(KERN_ERR "could not obtain gpio for ADS7846_PENDOWN\n"); | 135 | printk(KERN_ERR "could not obtain gpio for ADS7846_PENDOWN\n"); |
107 | return; | 136 | return; |
108 | } | 137 | } |
138 | |||
139 | platform_device_register(&vads7846_device); | ||
109 | } | 140 | } |
110 | 141 | ||
111 | #else | 142 | #else |