aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/twl4030-gpio.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/gpio/twl4030-gpio.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/gpio/twl4030-gpio.c')
-rw-r--r--drivers/gpio/twl4030-gpio.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/gpio/twl4030-gpio.c b/drivers/gpio/twl4030-gpio.c
index 49384a7c5492..57635ac35a73 100644
--- a/drivers/gpio/twl4030-gpio.c
+++ b/drivers/gpio/twl4030-gpio.c
@@ -32,9 +32,8 @@
32#include <linux/irq.h> 32#include <linux/irq.h>
33#include <linux/gpio.h> 33#include <linux/gpio.h>
34#include <linux/platform_device.h> 34#include <linux/platform_device.h>
35#include <linux/slab.h>
36 35
37#include <linux/i2c/twl4030.h> 36#include <linux/i2c/twl.h>
38 37
39 38
40/* 39/*
@@ -80,7 +79,7 @@ static unsigned int gpio_usage_count;
80 */ 79 */
81static inline int gpio_twl4030_write(u8 address, u8 data) 80static inline int gpio_twl4030_write(u8 address, u8 data)
82{ 81{
83 return twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, data, address); 82 return twl_i2c_write_u8(TWL4030_MODULE_GPIO, data, address);
84} 83}
85 84
86/*----------------------------------------------------------------------*/ 85/*----------------------------------------------------------------------*/
@@ -117,7 +116,7 @@ static inline int gpio_twl4030_read(u8 address)
117 u8 data; 116 u8 data;
118 int ret = 0; 117 int ret = 0;
119 118
120 ret = twl4030_i2c_read_u8(TWL4030_MODULE_GPIO, &data, address); 119 ret = twl_i2c_read_u8(TWL4030_MODULE_GPIO, &data, address);
121 return (ret < 0) ? ret : data; 120 return (ret < 0) ? ret : data;
122} 121}
123 122
@@ -142,7 +141,7 @@ static void twl4030_led_set_value(int led, int value)
142 cached_leden &= ~mask; 141 cached_leden &= ~mask;
143 else 142 else
144 cached_leden |= mask; 143 cached_leden |= mask;
145 status = twl4030_i2c_write_u8(TWL4030_MODULE_LED, cached_leden, 144 status = twl_i2c_write_u8(TWL4030_MODULE_LED, cached_leden,
146 TWL4030_LED_LEDEN); 145 TWL4030_LED_LEDEN);
147 mutex_unlock(&gpio_lock); 146 mutex_unlock(&gpio_lock);
148} 147}
@@ -223,23 +222,23 @@ static int twl_request(struct gpio_chip *chip, unsigned offset)
223 } 222 }
224 223
225 /* initialize PWM to always-drive */ 224 /* initialize PWM to always-drive */
226 status = twl4030_i2c_write_u8(module, 0x7f, 225 status = twl_i2c_write_u8(module, 0x7f,
227 TWL4030_PWMx_PWMxOFF); 226 TWL4030_PWMx_PWMxOFF);
228 if (status < 0) 227 if (status < 0)
229 goto done; 228 goto done;
230 status = twl4030_i2c_write_u8(module, 0x7f, 229 status = twl_i2c_write_u8(module, 0x7f,
231 TWL4030_PWMx_PWMxON); 230 TWL4030_PWMx_PWMxON);
232 if (status < 0) 231 if (status < 0)
233 goto done; 232 goto done;
234 233
235 /* init LED to not-driven (high) */ 234 /* init LED to not-driven (high) */
236 module = TWL4030_MODULE_LED; 235 module = TWL4030_MODULE_LED;
237 status = twl4030_i2c_read_u8(module, &cached_leden, 236 status = twl_i2c_read_u8(module, &cached_leden,
238 TWL4030_LED_LEDEN); 237 TWL4030_LED_LEDEN);
239 if (status < 0) 238 if (status < 0)
240 goto done; 239 goto done;
241 cached_leden &= ~ledclr_mask; 240 cached_leden &= ~ledclr_mask;
242 status = twl4030_i2c_write_u8(module, cached_leden, 241 status = twl_i2c_write_u8(module, cached_leden,
243 TWL4030_LED_LEDEN); 242 TWL4030_LED_LEDEN);
244 if (status < 0) 243 if (status < 0)
245 goto done; 244 goto done;
@@ -370,7 +369,7 @@ static int __devinit gpio_twl4030_pulls(u32 ups, u32 downs)
370 message[i] = bit_mask; 369 message[i] = bit_mask;
371 } 370 }
372 371
373 return twl4030_i2c_write(TWL4030_MODULE_GPIO, message, 372 return twl_i2c_write(TWL4030_MODULE_GPIO, message,
374 REG_GPIOPUPDCTR1, 5); 373 REG_GPIOPUPDCTR1, 5);
375} 374}
376 375
@@ -387,7 +386,7 @@ static int __devinit gpio_twl4030_debounce(u32 debounce, u8 mmc_cd)
387 debounce >>= 8; 386 debounce >>= 8;
388 message[3] = (debounce & 0x03); 387 message[3] = (debounce & 0x03);
389 388
390 return twl4030_i2c_write(TWL4030_MODULE_GPIO, message, 389 return twl_i2c_write(TWL4030_MODULE_GPIO, message,
391 REG_GPIO_DEBEN1, 3); 390 REG_GPIO_DEBEN1, 3);
392} 391}
393 392