aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/palmtc.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2013-08-30 06:15:24 -0400
committerThierry Reding <thierry.reding@gmail.com>2013-10-16 03:05:57 -0400
commitdb01120c5f6cb1d8c6533a49b009f08a73852498 (patch)
tree9fb21c5b78ade4d7698d2ebe52e5e6ae44510d14 /arch/arm/mach-pxa/palmtc.c
parentd46055af1cc4ba413ae0c3b6f1e6066501f943a0 (diff)
ARM: pxa: Initialize PWM backlight enable_gpio field
The GPIO API defines 0 as being a valid GPIO number, so this field needs to be initialized explicitly. A special case is the Palm Tungsten|C board. Since it doesn't use any quirks that would require the existing .init() or .exit() hooks it can simply use the new enable_gpio field. Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'arch/arm/mach-pxa/palmtc.c')
-rw-r--r--arch/arm/mach-pxa/palmtc.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index 100b176f7e88..7691c974ca4b 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -166,45 +166,12 @@ static inline void palmtc_keys_init(void) {}
166 * Backlight 166 * Backlight
167 ******************************************************************************/ 167 ******************************************************************************/
168#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE) 168#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
169static int palmtc_backlight_init(struct device *dev)
170{
171 int ret;
172
173 ret = gpio_request(GPIO_NR_PALMTC_BL_POWER, "BL POWER");
174 if (ret)
175 goto err;
176 ret = gpio_direction_output(GPIO_NR_PALMTC_BL_POWER, 1);
177 if (ret)
178 goto err2;
179
180 return 0;
181
182err2:
183 gpio_free(GPIO_NR_PALMTC_BL_POWER);
184err:
185 return ret;
186}
187
188static int palmtc_backlight_notify(struct device *dev, int brightness)
189{
190 /* backlight is on when GPIO16 AF0 is high */
191 gpio_set_value(GPIO_NR_PALMTC_BL_POWER, brightness);
192 return brightness;
193}
194
195static void palmtc_backlight_exit(struct device *dev)
196{
197 gpio_free(GPIO_NR_PALMTC_BL_POWER);
198}
199
200static struct platform_pwm_backlight_data palmtc_backlight_data = { 169static struct platform_pwm_backlight_data palmtc_backlight_data = {
201 .pwm_id = 1, 170 .pwm_id = 1,
202 .max_brightness = PALMTC_MAX_INTENSITY, 171 .max_brightness = PALMTC_MAX_INTENSITY,
203 .dft_brightness = PALMTC_MAX_INTENSITY, 172 .dft_brightness = PALMTC_MAX_INTENSITY,
204 .pwm_period_ns = PALMTC_PERIOD_NS, 173 .pwm_period_ns = PALMTC_PERIOD_NS,
205 .init = palmtc_backlight_init, 174 .enable_gpio = GPIO_NR_PALMTC_BL_POWER,
206 .notify = palmtc_backlight_notify,
207 .exit = palmtc_backlight_exit,
208}; 175};
209 176
210static struct platform_device palmtc_backlight = { 177static struct platform_device palmtc_backlight = {