aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/board-palmz71.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1/board-palmz71.c')
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index e719294250b1..801fb5f62ed7 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -239,7 +239,7 @@ static struct platform_device *devices[] __initdata = {
239static int 239static int
240palmz71_get_pendown_state(void) 240palmz71_get_pendown_state(void)
241{ 241{
242 return !omap_get_gpio_datain(PALMZ71_PENIRQ_GPIO); 242 return !gpio_get_value(PALMZ71_PENIRQ_GPIO);
243} 243}
244 244
245static const struct ads7846_platform_data palmz71_ts_info = { 245static const struct ads7846_platform_data palmz71_ts_info = {
@@ -295,13 +295,13 @@ static struct omap_board_config_kernel palmz71_config[] __initdata = {
295static irqreturn_t 295static irqreturn_t
296palmz71_powercable(int irq, void *dev_id) 296palmz71_powercable(int irq, void *dev_id)
297{ 297{
298 if (omap_get_gpio_datain(PALMZ71_USBDETECT_GPIO)) { 298 if (gpio_get_value(PALMZ71_USBDETECT_GPIO)) {
299 printk(KERN_INFO "PM: Power cable connected\n"); 299 printk(KERN_INFO "PM: Power cable connected\n");
300 set_irq_type(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), 300 set_irq_type(gpio_to_irq(PALMZ71_USBDETECT_GPIO),
301 IRQ_TYPE_EDGE_FALLING); 301 IRQ_TYPE_EDGE_FALLING);
302 } else { 302 } else {
303 printk(KERN_INFO "PM: Power cable disconnected\n"); 303 printk(KERN_INFO "PM: Power cable disconnected\n");
304 set_irq_type(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), 304 set_irq_type(gpio_to_irq(PALMZ71_USBDETECT_GPIO),
305 IRQ_TYPE_EDGE_RISING); 305 IRQ_TYPE_EDGE_RISING);
306 } 306 }
307 return IRQ_HANDLED; 307 return IRQ_HANDLED;
@@ -323,29 +323,28 @@ palmz71_gpio_setup(int early)
323{ 323{
324 if (early) { 324 if (early) {
325 /* Only set GPIO1 so we have a working serial */ 325 /* Only set GPIO1 so we have a working serial */
326 omap_set_gpio_dataout(1, 1); 326 gpio_direction_output(1, 1);
327 omap_set_gpio_direction(1, 0);
328 } else { 327 } else {
329 /* Set MMC/SD host WP pin as input */ 328 /* Set MMC/SD host WP pin as input */
330 if (omap_request_gpio(PALMZ71_MMC_WP_GPIO)) { 329 if (gpio_request(PALMZ71_MMC_WP_GPIO, "MMC WP") < 0) {
331 printk(KERN_ERR "Could not reserve WP GPIO!\n"); 330 printk(KERN_ERR "Could not reserve WP GPIO!\n");
332 return; 331 return;
333 } 332 }
334 omap_set_gpio_direction(PALMZ71_MMC_WP_GPIO, 1); 333 gpio_direction_input(PALMZ71_MMC_WP_GPIO);
335 334
336 /* Monitor the Power-cable-connected signal */ 335 /* Monitor the Power-cable-connected signal */
337 if (omap_request_gpio(PALMZ71_USBDETECT_GPIO)) { 336 if (gpio_request(PALMZ71_USBDETECT_GPIO, "USB detect") < 0) {
338 printk(KERN_ERR 337 printk(KERN_ERR
339 "Could not reserve cable signal GPIO!\n"); 338 "Could not reserve cable signal GPIO!\n");
340 return; 339 return;
341 } 340 }
342 omap_set_gpio_direction(PALMZ71_USBDETECT_GPIO, 1); 341 gpio_direction_input(PALMZ71_USBDETECT_GPIO);
343 if (request_irq(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), 342 if (request_irq(gpio_to_irq(PALMZ71_USBDETECT_GPIO),
344 palmz71_powercable, IRQF_SAMPLE_RANDOM, 343 palmz71_powercable, IRQF_SAMPLE_RANDOM,
345 "palmz71-cable", 0)) 344 "palmz71-cable", 0))
346 printk(KERN_ERR 345 printk(KERN_ERR
347 "IRQ request for power cable failed!\n"); 346 "IRQ request for power cable failed!\n");
348 palmz71_powercable(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), 0); 347 palmz71_powercable(gpio_to_irq(PALMZ71_USBDETECT_GPIO), 0);
349 } 348 }
350} 349}
351 350