]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap1/board-palmte.c
ARM: OMAP: Switch to gpio_request/free calls (OMAP and mainline)
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap1 / board-palmte.c
index ee49e2ccf1f99d833cbbb4ab08580a00c8412ead..cc99031d96cfb20228c95ff1b297fd8e4a4078bf 100644 (file)
@@ -247,7 +247,7 @@ static void palmte_get_power_status(struct apm_power_info *info, int *battery)
 {
        int charging, batt, hi, lo, mid;
 
-       charging = !omap_get_gpio_datain(PALMTE_DC_GPIO);
+       charging = !gpio_get_value(PALMTE_DC_GPIO);
        batt = battery[0];
        if (charging)
                batt -= 60;
@@ -326,11 +326,11 @@ static void palmte_headphones_detect(void *data, int state)
 {
        if (state) {
                /* Headphones connected, disable speaker */
-               omap_set_gpio_dataout(PALMTE_SPEAKER_GPIO, 0);
+               gpio_set_value(PALMTE_SPEAKER_GPIO, 0);
                printk(KERN_INFO "PM: speaker off\n");
        } else {
                /* Headphones unplugged, re-enable speaker */
-               omap_set_gpio_dataout(PALMTE_SPEAKER_GPIO, 1);
+               gpio_set_value(PALMTE_SPEAKER_GPIO, 1);
                printk(KERN_INFO "PM: speaker on\n");
        }
 }
@@ -369,18 +369,18 @@ static struct omap_gpio_switch palmte_switches[] __initdata = {
 static void __init palmte_misc_gpio_setup(void)
 {
        /* Set TSC2102 PINTDAV pin as input (used by TSC2102 driver) */
-       if (omap_request_gpio(PALMTE_PINTDAV_GPIO)) {
+       if (gpio_request(PALMTE_PINTDAV_GPIO, "TSC2102 PINTDAV") < 0) {
                printk(KERN_ERR "Could not reserve PINTDAV GPIO!\n");
                return;
        }
-       omap_set_gpio_direction(PALMTE_PINTDAV_GPIO, 1);
+       gpio_direction_input(PALMTE_PINTDAV_GPIO);
 
        /* Set USB-or-DC-IN pin as input (unused) */
-       if (omap_request_gpio(PALMTE_USB_OR_DC_GPIO)) {
+       if (gpio_request(PALMTE_USB_OR_DC_GPIO, "USB/DC-IN") < 0) {
                printk(KERN_ERR "Could not reserve cable signal GPIO!\n");
                return;
        }
-       omap_set_gpio_direction(PALMTE_USB_OR_DC_GPIO, 1);
+       gpio_direction_input(PALMTE_USB_OR_DC_GPIO);
 }
 
 static void __init omap_palmte_init(void)