]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
use standard gpio get/set calls (OMAP tree only)
authorDavid Brownell <dbrownell@users.sourceforge.net>
Thu, 30 Oct 2008 03:39:22 +0000 (20:39 -0700)
committerTony Lindgren <tony@atomide.com>
Thu, 13 Nov 2008 21:12:26 +0000 (13:12 -0800)
This patch replaces some legacy OMAP GPIO calls with the "new" (not
really, any more!) calls that work on most platforms.

The calls addressed by this patch are the simple ones to get and set
values ... for code that has NOT merged to mainline.

Except for the Documentation file, all of these changes were performed
by a simple SED script.  A few "if() set() else set()" branches were
merged by hand.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
22 files changed:
Documentation/arm/OMAP/gpio
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-3430sdp.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-n800-camera.c
arch/arm/mach-omap2/board-n800-mmc.c
arch/arm/mach-omap2/board-n800-usb.c
arch/arm/mach-omap2/board-n800.c
arch/arm/mach-omap2/board-omap2evm.c
arch/arm/mach-omap2/board-omap3evm.c
arch/arm/plat-omap/gpio-switch.c
drivers/bluetooth/brf6150.c
drivers/bluetooth/hci_h4p/core.c
drivers/cbus/cbus.c
drivers/leds/leds-omap.c
drivers/spi/tsc2301-core.c
drivers/usb/host/ehci-omap.c
drivers/video/omap/lcd_2430sdp.c
drivers/video/omap/lcd_omap2evm.c
drivers/video/omap/lcd_omap3beagle.c
drivers/video/omap/lcd_omap3evm.c
drivers/video/omap/lcd_p2.c

index fd6363cd7f54d292d51428f3d12f2e5d2fce00b1..8a011ad41c331ec37182ffcf43e370c2b0ad61b9 100644 (file)
@@ -9,6 +9,21 @@ or less GPIOs) to other OMAP processors as well.
 If anything is missing, is wrong, needs extension or update, please send
 update to Linux-omap-open-source@linux.omap.com.
 
+       *************************************************************
+
+       NOTICE:  these OMAP-specific interfaces are deprecated/obsolete.
+
+       See Documentation/gpio.txt for information on the standard
+       cross-platform GPIO interface.  All new code should use those
+       calls instead of the ones described here.
+
+       The only exception to that policy is the omap_cfg_reg() call,
+       which isn't a GPIO-specific interface; it configures how chip
+       functions are multiplexed to pins, with GPIO being only one
+       of those functions.
+
+       *************************************************************
+
 I. GPIO Modules/Banks
 ---------------------
 
index 6aa83ace4c523eb00e3d9ac77fca4045343a7289..0ca8875e8caebb676888553432cce8ed66454a50 100644 (file)
@@ -227,7 +227,7 @@ static void ads7846_dev_init(void)
 
 static int ads7846_get_pendown_state(void)
 {
-       return !omap_get_gpio_datain(TS_GPIO);
+       return !gpio_get_value(TS_GPIO);
 }
 
 static struct ads7846_platform_data tsc2046_config __initdata = {
@@ -421,7 +421,7 @@ static void __init omap_2430sdp_init(void)
 
        /* turn off secondary LCD backlight */
        omap_set_gpio_direction(SECONDARY_LCD_GPIO, 0);
-       omap_set_gpio_dataout(SECONDARY_LCD_GPIO, 0);
+       gpio_set_value(SECONDARY_LCD_GPIO, 0);
 }
 
 static void __init omap_2430sdp_map_io(void)
index 7ee85e9b7c8b078025eb0a5008d5d0e2ae94491a..eb53d56f0b96956a943ae346e53976189f9c7892 100644 (file)
@@ -179,7 +179,7 @@ static void ads7846_dev_init(void)
 
 static int ads7846_get_pendown_state(void)
 {
-       return !omap_get_gpio_datain(ts_gpio);
+       return !gpio_get_value(ts_gpio);
 }
 
 /*
index c2bb7262e1631f3a6ee7a962aadc0671ca2e3129..b2574dfeb5226d54ac36b9df1b89a2219801aec4 100644 (file)
@@ -110,7 +110,7 @@ static void ads7846_dev_init(void)
 
 static int ads7846_get_pendown_state(void)
 {
-       return !omap_get_gpio_datain(ts_gpio);
+       return !gpio_get_value(ts_gpio);
 }
 
 /*
index 6272263e39867dac0a8aaf4cf986a52e60a72961..2dd1138cb882bfcc83b72efc96e5a0b33946e760 100644 (file)
@@ -172,7 +172,7 @@ static int tcm825x_power_on(void)
        retu_write_reg(RETU_REG_CTRL_SET, 0x0080);
        msleep(1);
 
-       omap_set_gpio_dataout(N800_CAM_SENSOR_RESET_GPIO, 1);
+       gpio_set_value(N800_CAM_SENSOR_RESET_GPIO, 1);
        msleep(1);
 
        saturated_count = 0;
@@ -185,7 +185,7 @@ static int tcm825x_power_off(void)
 {
        int ret;
 
-       omap_set_gpio_dataout(N800_CAM_SENSOR_RESET_GPIO, 0);
+       gpio_set_value(N800_CAM_SENSOR_RESET_GPIO, 0);
        msleep(1);
 
        /* Set VSim1 off */
@@ -363,7 +363,7 @@ void __init n800_cam_init(void)
                return;
        }
 
-       omap_set_gpio_dataout(N800_CAM_SENSOR_RESET_GPIO, 0);
+       gpio_set_value(N800_CAM_SENSOR_RESET_GPIO, 0);
        omap_set_gpio_direction(N800_CAM_SENSOR_RESET_GPIO, 0);
 
        sensor_okay = 1;
index 8b78180242d70421e5bd7d91c96cbf42e87f7ad0..471d3158fe31e2560734583b48829063626e43a0 100644 (file)
@@ -42,10 +42,7 @@ static int n800_mmc_switch_slot(struct device *dev, int slot)
 #ifdef CONFIG_MMC_DEBUG
        dev_dbg(dev, "Choose slot %d\n", slot + 1);
 #endif
-       if (slot == 0)
-               omap_set_gpio_dataout(slot_switch_gpio, 0);
-       else
-               omap_set_gpio_dataout(slot_switch_gpio, 1);
+       gpio_set_value(slot_switch_gpio, slot);
        return 0;
 }
 
@@ -125,14 +122,14 @@ static void nokia_mmc_set_power_internal(struct device *dev,
                power_on ? "on" : "off");
 
        if (power_on) {
-               omap_set_gpio_dataout(n810_slot2_pw_vddf, 1);
+               gpio_set_value(n810_slot2_pw_vddf, 1);
                udelay(30);
-               omap_set_gpio_dataout(n810_slot2_pw_vdd, 1);
+               gpio_set_value(n810_slot2_pw_vdd, 1);
                udelay(100);
        } else {
-               omap_set_gpio_dataout(n810_slot2_pw_vdd, 0);
+               gpio_set_value(n810_slot2_pw_vdd, 0);
                msleep(50);
-               omap_set_gpio_dataout(n810_slot2_pw_vddf, 0);
+               gpio_set_value(n810_slot2_pw_vddf, 0);
                msleep(50);
        }
 }
@@ -349,18 +346,18 @@ void __init n800_mmc_init(void)
 
        if (omap_request_gpio(slot_switch_gpio) < 0)
                BUG();
-       omap_set_gpio_dataout(slot_switch_gpio, 0);
+       gpio_set_value(slot_switch_gpio, 0);
        omap_set_gpio_direction(slot_switch_gpio, 0);
 
        if (machine_is_nokia_n810()) {
                if (omap_request_gpio(n810_slot2_pw_vddf) < 0)
                        BUG();
-               omap_set_gpio_dataout(n810_slot2_pw_vddf, 0);
+               gpio_set_value(n810_slot2_pw_vddf, 0);
                omap_set_gpio_direction(n810_slot2_pw_vddf, 0);
 
                if (omap_request_gpio(n810_slot2_pw_vdd) < 0)
                        BUG();
-               omap_set_gpio_dataout(n810_slot2_pw_vdd, 0);
+               gpio_set_value(n810_slot2_pw_vdd, 0);
                omap_set_gpio_direction(n810_slot2_pw_vdd, 0);
        }
 
index fc128f245ab8eb2da3dd30d256f8cab9187227d1..36bb6a8804168f355d9525b72df010e5b42add66 100644 (file)
@@ -99,12 +99,12 @@ static int tusb_set_power(int state)
        int i, retval = 0;
 
        if (state) {
-               omap_set_gpio_dataout(GPIO_TUSB_ENABLE, 1);
+               gpio_set_value(GPIO_TUSB_ENABLE, 1);
                msleep(1);
 
                /* Wait until TUSB6010 pulls INT pin down */
                i = 100;
-               while (i && omap_get_gpio_datain(GPIO_TUSB_INT)) {
+               while (i && gpio_get_value(GPIO_TUSB_INT)) {
                        msleep(1);
                        i--;
                }
@@ -114,7 +114,7 @@ static int tusb_set_power(int state)
                        retval = -ENODEV;
                }
        } else {
-               omap_set_gpio_dataout(GPIO_TUSB_ENABLE, 0);
+               gpio_set_value(GPIO_TUSB_ENABLE, 0);
                msleep(10);
        }
 
index 2c64d2d47ed9fd70d159d6780eddc6ca79528641..74ffd4e2ed269620f8116a56da1b7e7dfaa2f7d7 100644 (file)
@@ -134,7 +134,7 @@ void __init nokia_n800_init_irq(void)
        }
 
        omap_set_gpio_direction(N800_STI_GPIO, 0);
-       omap_set_gpio_dataout(N800_STI_GPIO, 0);
+       gpio_set_value(N800_STI_GPIO, 0);
 #endif
 }
 
@@ -178,7 +178,7 @@ static void mipid_shutdown(struct mipid_platform_data *pdata)
 {
        if (pdata->nreset_gpio != -1) {
                pr_info("shutdown LCD\n");
-               omap_set_gpio_dataout(pdata->nreset_gpio, 0);
+               gpio_set_value(pdata->nreset_gpio, 0);
                msleep(120);
        }
 }
@@ -232,12 +232,12 @@ static void blizzard_power_up(struct device *dev)
        msleep(10);
 
        blizzard_enable_clocks(1);
-       omap_set_gpio_dataout(N800_BLIZZARD_POWERDOWN_GPIO, 1);
+       gpio_set_value(N800_BLIZZARD_POWERDOWN_GPIO, 1);
 }
 
 static void blizzard_power_down(struct device *dev)
 {
-       omap_set_gpio_dataout(N800_BLIZZARD_POWERDOWN_GPIO, 0);
+       gpio_set_value(N800_BLIZZARD_POWERDOWN_GPIO, 0);
        blizzard_enable_clocks(0);
 
        /* Vcore to 1.005V */
@@ -259,7 +259,7 @@ static void __init blizzard_dev_init(void)
        if (r < 0)
                return;
        omap_set_gpio_direction(N800_BLIZZARD_POWERDOWN_GPIO, 0);
-       omap_set_gpio_dataout(N800_BLIZZARD_POWERDOWN_GPIO, 1);
+       gpio_set_value(N800_BLIZZARD_POWERDOWN_GPIO, 1);
 
        blizzard_get_clocks();
        omapfb_set_ctrl_platform_data(&n800_blizzard_data);
@@ -341,7 +341,7 @@ static int __init tea5761_dev_init(void)
 
                omap_set_gpio_direction(enable_gpio, 0);
                udelay(50);
-               omap_set_gpio_dataout(enable_gpio, 1);
+               gpio_set_value(enable_gpio, 1);
        }
 
        return 0;
index 84aeacf50aa9e8a1de22b38d18380ca3c09d5ea3..e705e59c26d43c6ce9d483ef48276b0631774cc9 100644 (file)
@@ -214,7 +214,7 @@ static void ads7846_dev_init(void)
 
 static int ads7846_get_pendown_state(void)
 {
-       return !omap_get_gpio_datain(OMAP2_EVM_TS_GPIO);
+       return !gpio_get_value(OMAP2_EVM_TS_GPIO);
 }
 
 struct ads7846_platform_data ads7846_config = {
index 42ab8264b0bed3b968c941f419dbe41bfec5ecdd..03d900a7c7a918ec8927daa7eeae932afbb31164 100644 (file)
@@ -184,7 +184,7 @@ static void ads7846_dev_init(void)
 
 static int ads7846_get_pendown_state(void)
 {
-       return !omap_get_gpio_datain(OMAP3_EVM_TS_GPIO);
+       return !gpio_get_value(OMAP3_EVM_TS_GPIO);
 }
 
 struct ads7846_platform_data ads7846_config = {
index f2dd67a676452abf09694dee3c295ffcb9da2f2c..f74d0cef8a9cd8f411754af4aaff1fddb3738ab8 100644 (file)
@@ -106,7 +106,7 @@ static int gpio_sw_get_state(struct gpio_switch *sw)
 {
        int state;
 
-       state = omap_get_gpio_datain(sw->gpio);
+       state = gpio_get_value(sw->gpio);
        if (sw->flags & OMAP_GPIO_SWITCH_FLAG_INVERTED)
                state = !state;
 
@@ -139,7 +139,7 @@ static ssize_t gpio_sw_state_store(struct device *dev,
 
        if (sw->flags & OMAP_GPIO_SWITCH_FLAG_INVERTED)
                enable = !enable;
-       omap_set_gpio_dataout(sw->gpio, enable);
+       gpio_set_value(sw->gpio, enable);
 
        return count;
 }
@@ -190,7 +190,7 @@ static irqreturn_t gpio_sw_irq_handler(int irq, void *arg)
        int state;
 
        if (!sw->both_edges) {
-               if (omap_get_gpio_datain(sw->gpio))
+               if (gpio_get_value(sw->gpio))
                        set_irq_type(OMAP_GPIO_IRQ(sw->gpio), IRQ_TYPE_EDGE_FALLING);
                else
                        set_irq_type(OMAP_GPIO_IRQ(sw->gpio), IRQ_TYPE_EDGE_RISING);
@@ -305,7 +305,7 @@ static int __init new_switch(struct gpio_switch *sw)
                trigger = IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING;
                sw->both_edges = 1;
        } else {
-               if (omap_get_gpio_datain(sw->gpio))
+               if (gpio_get_value(sw->gpio))
                        trigger = IRQF_TRIGGER_FALLING;
                else
                        trigger = IRQF_TRIGGER_RISING;
@@ -465,7 +465,7 @@ static void __init report_initial_state(void)
        list_for_each_entry(sw, &gpio_switches, node) {
                int state;
 
-               state = omap_get_gpio_datain(sw->gpio);
+               state = gpio_get_value(sw->gpio);
                if (sw->flags & OMAP_GPIO_SWITCH_FLAG_INVERTED)
                        state = !state;
                if (sw->notify != NULL)
index 476cc6554b9e80c5d2085730f7f9993e5ea7b150..b87955630b7ff4d3a97a154335ebaf4a2602f51d 100644 (file)
@@ -181,9 +181,9 @@ static void brf6150_disable_pm_tx(struct brf6150_info *info)
 {
        if (info->pm_enabled) {
                info->tx_pm_enabled = 0;
-               omap_set_gpio_dataout(info->btinfo->bt_wakeup_gpio, 1);
+               gpio_set_value(info->btinfo->bt_wakeup_gpio, 1);
        }
-       if (omap_get_gpio_datain(info->btinfo->host_wakeup_gpio))
+       if (gpio_get_value(info->btinfo->host_wakeup_gpio))
                tasklet_schedule(&info->tx_task);
 }
 
@@ -193,7 +193,7 @@ static void brf6150_pm_timer(unsigned long data)
 
        info = (struct brf6150_info *)data;
        if (info->tx_pm_enabled && info->rx_pm_enabled && !test_bit(HCI_INQUIRY, &info->hdev->flags))
-               omap_set_gpio_dataout(info->btinfo->bt_wakeup_gpio, 0);
+               gpio_set_value(info->btinfo->bt_wakeup_gpio, 0);
        else
                mod_timer(&info->pm_timer, jiffies + msecs_to_jiffies(PM_TIMEOUT));
 }
@@ -624,7 +624,7 @@ static irqreturn_t brf6150_wakeup_interrupt(int irq, void *dev_inst)
        unsigned long flags;
 
        spin_lock_irqsave(&info->lock, flags);
-       should_wakeup = omap_get_gpio_datain(info->btinfo->host_wakeup_gpio);
+       should_wakeup = gpio_get_value(info->btinfo->host_wakeup_gpio);
        NBT_DBG_POWER("gpio interrupt %d\n", should_wakeup);
        if (should_wakeup) {
                clk_enable(info->uart_ck);
@@ -671,14 +671,14 @@ static int brf6150_init_uart(struct brf6150_info *info)
 
 static int brf6150_reset(struct brf6150_info *info)
 {
-       omap_set_gpio_dataout(info->btinfo->bt_wakeup_gpio, 0);
-       omap_set_gpio_dataout(info->btinfo->reset_gpio, 0);
+       gpio_set_value(info->btinfo->bt_wakeup_gpio, 0);
+       gpio_set_value(info->btinfo->reset_gpio, 0);
        current->state = TASK_UNINTERRUPTIBLE;
        schedule_timeout(msecs_to_jiffies(10));
-       omap_set_gpio_dataout(info->btinfo->bt_wakeup_gpio, 1);
+       gpio_set_value(info->btinfo->bt_wakeup_gpio, 1);
        current->state = TASK_UNINTERRUPTIBLE;
        schedule_timeout(msecs_to_jiffies(100));
-       omap_set_gpio_dataout(info->btinfo->reset_gpio, 1);
+       gpio_set_value(info->btinfo->reset_gpio, 1);
        current->state = TASK_UNINTERRUPTIBLE;
        schedule_timeout(msecs_to_jiffies(100));
 
@@ -786,7 +786,7 @@ static int brf6150_hci_close(struct hci_dev *hdev)
        brf6150_hci_flush(hdev);
        clk_disable(info->uart_ck);
        del_timer_sync(&info->pm_timer);
-       omap_set_gpio_dataout(info->btinfo->bt_wakeup_gpio, 0);
+       gpio_set_value(info->btinfo->bt_wakeup_gpio, 0);
        set_irq_type(OMAP_GPIO_IRQ(info->btinfo->host_wakeup_gpio), IRQ_TYPE_NONE);
 
        return 0;
index 005e6528a142f8256895960369b77dfd6ceb3321..e0681d84d26aa92c9dc7ea7124a4965a6d10e8e7 100644 (file)
@@ -102,7 +102,7 @@ static void hci_h4p_enable_tx(struct hci_h4p_info *info)
        if (info->tx_pm_enabled) {
                info->tx_pm_enabled = 0;
                hci_h4p_set_clk(info, &info->tx_clocks_en, 1);
-               omap_set_gpio_dataout(info->bt_wakeup_gpio, 1);
+               gpio_set_value(info->bt_wakeup_gpio, 1);
        }
 }
 
@@ -115,7 +115,7 @@ static void hci_h4p_tx_pm_timer(unsigned long data)
        info = (struct hci_h4p_info *)data;
 
        if (hci_h4p_inb(info, UART_LSR) & UART_LSR_TEMT) {
-               omap_set_gpio_dataout(info->bt_wakeup_gpio, 0);
+               gpio_set_value(info->bt_wakeup_gpio, 0);
                hci_h4p_set_clk(info, &info->tx_clocks_en, 0);
                info->tx_pm_enabled = 1;
        }
@@ -527,7 +527,7 @@ static irqreturn_t hci_h4p_wakeup_interrupt(int irq, void *dev_inst)
        if (!test_bit(HCI_RUNNING, &hdev->flags))
                return IRQ_HANDLED;
 
-       should_wakeup = omap_get_gpio_datain(info->host_wakeup_gpio);
+       should_wakeup = gpio_get_value(info->host_wakeup_gpio);
        NBT_DBG_POWER("gpio interrupt %d\n", should_wakeup);
        if (should_wakeup) {
                hci_h4p_enable_rx(info);
@@ -545,10 +545,10 @@ static int hci_h4p_reset(struct hci_h4p_info *info)
        hci_h4p_init_uart(info);
        hci_h4p_set_rts(info, 0);
 
-       omap_set_gpio_dataout(info->reset_gpio, 0);
+       gpio_set_value(info->reset_gpio, 0);
        msleep(100);
-       omap_set_gpio_dataout(info->bt_wakeup_gpio, 1);
-       omap_set_gpio_dataout(info->reset_gpio, 1);
+       gpio_set_value(info->bt_wakeup_gpio, 1);
+       gpio_set_value(info->reset_gpio, 1);
        msleep(100);
 
        err = hci_h4p_wait_for_cts(info, 1, 10);
@@ -646,8 +646,8 @@ err_clean:
        hci_h4p_reset_uart(info);
        hci_h4p_set_clk(info, &info->tx_clocks_en, 0);
        hci_h4p_set_clk(info, &info->rx_clocks_en, 0);
-       omap_set_gpio_dataout(info->reset_gpio, 0);
-       omap_set_gpio_dataout(info->bt_wakeup_gpio, 0);
+       gpio_set_value(info->reset_gpio, 0);
+       gpio_set_value(info->bt_wakeup_gpio, 0);
        skb_queue_purge(&fw_queue);
        kfree_skb(neg_cmd_skb);
        neg_cmd_skb = NULL;
@@ -675,8 +675,8 @@ static int hci_h4p_hci_close(struct hci_dev *hdev)
        hci_h4p_reset_uart(info);
        hci_h4p_set_clk(info, &info->tx_clocks_en, 0);
        hci_h4p_set_clk(info, &info->rx_clocks_en, 0);
-       omap_set_gpio_dataout(info->reset_gpio, 0);
-       omap_set_gpio_dataout(info->bt_wakeup_gpio, 0);
+       gpio_set_value(info->reset_gpio, 0);
+       gpio_set_value(info->bt_wakeup_gpio, 0);
        kfree_skb(info->rx_skb);
 
        return 0;
@@ -944,7 +944,7 @@ static int hci_h4p_probe(struct platform_device *pdev)
                dev_err(info->dev, "failed to register hci_h4p hci device\n");
                goto cleanup_irq;
        }
-       omap_set_gpio_dataout(info->reset_gpio, 0);
+       gpio_set_value(info->reset_gpio, 0);
 
        return 0;
 
@@ -952,7 +952,7 @@ cleanup_irq:
        free_irq(irq, (void *)info);
        free_irq(OMAP_GPIO_IRQ(info->host_wakeup_gpio), (void *)info);
 cleanup:
-       omap_set_gpio_dataout(info->reset_gpio, 0);
+       gpio_set_value(info->reset_gpio, 0);
        omap_free_gpio(info->reset_gpio);
        omap_free_gpio(info->bt_wakeup_gpio);
        omap_free_gpio(info->host_wakeup_gpio);
index d72c49a96547a5dcdc39b9a68fa9f3d6c96645d9..de3440944a942fb59504a01726ee9e38ed6ba324 100644 (file)
@@ -102,28 +102,28 @@ static u8 cbus_receive_bit(struct cbus_host *host, u32 base)
 #else
 
 #define cbus_set_gpio_direction(base, gpio, is_input) omap_set_gpio_direction(gpio, is_input)
-#define cbus_set_gpio_dataout(base, gpio, enable) omap_set_gpio_dataout(gpio, enable)
-#define cbus_get_gpio_datain(base, int, gpio) omap_get_gpio_datain(gpio)
+#define cbus_set_gpio_dataout(base, gpio, enable) gpio_set_value(gpio, enable)
+#define cbus_get_gpio_datain(base, int, gpio) gpio_get_value(gpio)
 
 static void _cbus_send_bit(struct cbus_host *host, int bit, int set_to_input)
 {
-       omap_set_gpio_dataout(host->dat_gpio, bit ? 1 : 0);
-       omap_set_gpio_dataout(host->clk_gpio, 1);
+       gpio_set_value(host->dat_gpio, bit ? 1 : 0);
+       gpio_set_value(host->clk_gpio, 1);
 
        /* The data bit is read on the rising edge of CLK */
        if (set_to_input)
                omap_set_gpio_direction(host->dat_gpio, 1);
 
-       omap_set_gpio_dataout(host->clk_gpio, 0);
+       gpio_set_value(host->clk_gpio, 0);
 }
 
 static u8 _cbus_receive_bit(struct cbus_host *host)
 {
        u8 ret;
 
-       omap_set_gpio_dataout(host->clk_gpio, 1);
-       ret = omap_get_gpio_datain(host->dat_gpio);
-       omap_set_gpio_dataout(host->clk_gpio, 0);
+       gpio_set_value(host->clk_gpio, 1);
+       ret = gpio_get_value(host->dat_gpio);
+       gpio_set_value(host->clk_gpio, 0);
 
        return ret;
 }
@@ -260,15 +260,15 @@ int __init cbus_bus_init(void)
        if ((ret = omap_request_gpio(chost->sel_gpio)) < 0)
                goto exit3;
 
-       omap_set_gpio_dataout(chost->clk_gpio, 0);
-       omap_set_gpio_dataout(chost->sel_gpio, 1);
+       gpio_set_value(chost->clk_gpio, 0);
+       gpio_set_value(chost->sel_gpio, 1);
 
        omap_set_gpio_direction(chost->clk_gpio, 0);
        omap_set_gpio_direction(chost->dat_gpio, 1);
        omap_set_gpio_direction(chost->sel_gpio, 0);
 
-       omap_set_gpio_dataout(chost->clk_gpio, 1);
-       omap_set_gpio_dataout(chost->clk_gpio, 0);
+       gpio_set_value(chost->clk_gpio, 1);
+       gpio_set_value(chost->clk_gpio, 0);
 
        cbus_host = chost;
 
index 5c14c4b5275250bab543fea2d1d6f000b0038fa5..bf5cce8f8d1b4f8d1e805073330a81c87d936e9c 100644 (file)
@@ -27,11 +27,7 @@ static void omap_set_led_gpio(struct led_classdev *led_cdev,
        struct omap_led_config *led_dev;
 
        led_dev = container_of(led_cdev, struct omap_led_config, cdev);
-
-       if (value)
-               omap_set_gpio_dataout(led_dev->gpio, 1);
-       else
-               omap_set_gpio_dataout(led_dev->gpio, 0);
+       gpio_set_value(led_dev->gpio, value);
 }
 
 static void omap_configure_led_gpio(int gpio)
index 939bc48c2b5e8d38468fdfa9682837e851dae5f0..f6351c66f179e0c48caf60e80221583c4df18144 100644 (file)
@@ -161,10 +161,10 @@ static int __devinit tsc2301_probe(struct spi_device *spi)
                r = omap_request_gpio(tsc->reset_gpio);
                if (r < 0)
                        goto err1;
-               omap_set_gpio_dataout(tsc->reset_gpio, 1);
+               gpio_set_value(tsc->reset_gpio, 1);
                omap_set_gpio_direction(tsc->reset_gpio, 0);
                mdelay(1);
-               omap_set_gpio_dataout(tsc->reset_gpio, 0);
+               gpio_set_value(tsc->reset_gpio, 0);
 #endif
        } else
                tsc->reset_gpio = -1;
index 419e70ab0ba9b1b4ecee37f06a88f262b6f16bb5..adbff661b33c5c41914075bc233c572263dfabe7 100644 (file)
@@ -229,8 +229,8 @@ static int omap_start_ehc(struct platform_device *dev, struct usb_hcd *hcd)
        omap_set_gpio_direction(EXT_PHY_RESET_GPIO_PORT1, 0);
        omap_request_gpio(EXT_PHY_RESET_GPIO_PORT2);
        omap_set_gpio_direction(EXT_PHY_RESET_GPIO_PORT2, 0);
-       omap_set_gpio_dataout(EXT_PHY_RESET_GPIO_PORT1, 0);
-       omap_set_gpio_dataout(EXT_PHY_RESET_GPIO_PORT2, 0);
+       gpio_set_value(EXT_PHY_RESET_GPIO_PORT1, 0);
+       gpio_set_value(EXT_PHY_RESET_GPIO_PORT2, 0);
        /* Hold the PHY in RESET for enough time till DIR is high */
        udelay(EXT_PHY_RESET_DELAY);
 #endif
@@ -309,8 +309,8 @@ static int omap_start_ehc(struct platform_device *dev, struct usb_hcd *hcd)
         * Hold the PHY in RESET for enough time till PHY is settled and ready
         */
        udelay(EXT_PHY_RESET_DELAY);
-       omap_set_gpio_dataout(EXT_PHY_RESET_GPIO_PORT1, 1);
-       omap_set_gpio_dataout(EXT_PHY_RESET_GPIO_PORT2, 1);
+       gpio_set_value(EXT_PHY_RESET_GPIO_PORT1, 1);
+       gpio_set_value(EXT_PHY_RESET_GPIO_PORT2, 1);
 #endif
 
 #ifdef VBUS_INTERNAL_CHARGEPUMP_HACK
index a728837e88222d423790bb2a8554ed30781846cc..12c9ed27600f6e1d060674378d294a6fe1278bcd 100644 (file)
@@ -101,8 +101,8 @@ static int sdp2430_panel_enable(struct lcd_panel *panel)
                grp_val = ENABLE_VAUX2_DEV_GRP;
        }
                
-       omap_set_gpio_dataout(enable_gpio, 1);
-       omap_set_gpio_dataout(backlight_gpio, 1);
+       gpio_set_value(enable_gpio, 1);
+       gpio_set_value(backlight_gpio, 1);
 
        if (0 != t2_out(PM_RECEIVER, ded_val, ded_reg))
                return -EIO;
@@ -114,8 +114,8 @@ static int sdp2430_panel_enable(struct lcd_panel *panel)
 
 static void sdp2430_panel_disable(struct lcd_panel *panel)
 {
-       omap_set_gpio_dataout(enable_gpio, 0);
-       omap_set_gpio_dataout(backlight_gpio, 0);
+       gpio_set_value(enable_gpio, 0);
+       gpio_set_value(backlight_gpio, 0);
        if (omap_rev() > OMAP3430_REV_ES1_0) {
                t2_out(PM_RECEIVER, 0x0, TWL4030_VPLL2_DEDICATED);
                t2_out(PM_RECEIVER, 0x0, TWL4030_VPLL2_DEV_GRP);
index 8a0105e3520d5bfbfc21f5f81f675fbbf5608a26..f3b012ca8662b5d55433a284f1d664a0cf88ee12 100644 (file)
@@ -64,11 +64,11 @@ static int omap2evm_panel_init(struct lcd_panel *panel,
        omap_set_gpio_direction(LCD_PANEL_QVGA, 0);
        omap_set_gpio_direction(LCD_PANEL_RESB, 0);
 
-       omap_set_gpio_dataout(LCD_PANEL_RESB, 1);
-       omap_set_gpio_dataout(LCD_PANEL_INI, 1);
-       omap_set_gpio_dataout(LCD_PANEL_QVGA, 0);
-       omap_set_gpio_dataout(LCD_PANEL_LR, 1);
-       omap_set_gpio_dataout(LCD_PANEL_UD, 1);
+       gpio_set_value(LCD_PANEL_RESB, 1);
+       gpio_set_value(LCD_PANEL_INI, 1);
+       gpio_set_value(LCD_PANEL_QVGA, 0);
+       gpio_set_value(LCD_PANEL_LR, 1);
+       gpio_set_value(LCD_PANEL_UD, 1);
 
        twl4030_i2c_write_u8(TWL4030_MODULE_LED, 0x11, TWL_LED_LEDEN);
        twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, 0x01, TWL_PWMA_PWMAON);
@@ -84,13 +84,13 @@ static void omap2evm_panel_cleanup(struct lcd_panel *panel)
 
 static int omap2evm_panel_enable(struct lcd_panel *panel)
 {
-       omap_set_gpio_dataout(LCD_PANEL_ENABLE_GPIO, 0);
+       gpio_set_value(LCD_PANEL_ENABLE_GPIO, 0);
        return 0;
 }
 
 static void omap2evm_panel_disable(struct lcd_panel *panel)
 {
-       omap_set_gpio_dataout(LCD_PANEL_ENABLE_GPIO, 1);
+       gpio_set_value(LCD_PANEL_ENABLE_GPIO, 1);
 }
 
 static unsigned long omap2evm_panel_get_caps(struct lcd_panel *panel)
index dc59f399aacf30d90ac488b7c1a26747e8115140..0c779e40d5edd218129a8f959c000ce6d7fb2476 100644 (file)
@@ -48,13 +48,13 @@ static void omap3beagle_panel_cleanup(struct lcd_panel *panel)
 
 static int omap3beagle_panel_enable(struct lcd_panel *panel)
 {
-       omap_set_gpio_dataout(LCD_PANEL_ENABLE_GPIO, 1);
+       gpio_set_value(LCD_PANEL_ENABLE_GPIO, 1);
        return 0;
 }
 
 static void omap3beagle_panel_disable(struct lcd_panel *panel)
 {
-       omap_set_gpio_dataout(LCD_PANEL_ENABLE_GPIO, 0);
+       gpio_set_value(LCD_PANEL_ENABLE_GPIO, 0);
 }
 
 static unsigned long omap3beagle_panel_get_caps(struct lcd_panel *panel)
index a564ca54b5c83506a9f0504e0a7e22426cc3150a..7f10da0f0da223069a9ded2736858f2ac40a0d31 100644 (file)
@@ -71,11 +71,11 @@ static int omap3evm_panel_init(struct lcd_panel *panel,
        twl4030_i2c_write_u8(TWL4030_MODULE_PWMA, 0x02, TWL_PWMA_PWMAOFF);
        bklight_level = 100;
 
-       omap_set_gpio_dataout(LCD_PANEL_RESB, 1);
-       omap_set_gpio_dataout(LCD_PANEL_INI, 1);
-       omap_set_gpio_dataout(LCD_PANEL_QVGA, 0);
-       omap_set_gpio_dataout(LCD_PANEL_LR, 1);
-       omap_set_gpio_dataout(LCD_PANEL_UD, 1);
+       gpio_set_value(LCD_PANEL_RESB, 1);
+       gpio_set_value(LCD_PANEL_INI, 1);
+       gpio_set_value(LCD_PANEL_QVGA, 0);
+       gpio_set_value(LCD_PANEL_LR, 1);
+       gpio_set_value(LCD_PANEL_UD, 1);
 
        return 0;
 }
@@ -86,13 +86,13 @@ static void omap3evm_panel_cleanup(struct lcd_panel *panel)
 
 static int omap3evm_panel_enable(struct lcd_panel *panel)
 {
-       omap_set_gpio_dataout(LCD_PANEL_ENABLE_GPIO, 0);
+       gpio_set_value(LCD_PANEL_ENABLE_GPIO, 0);
        return 0;
 }
 
 static void omap3evm_panel_disable(struct lcd_panel *panel)
 {
-       omap_set_gpio_dataout(LCD_PANEL_ENABLE_GPIO, 1);
+       gpio_set_value(LCD_PANEL_ENABLE_GPIO, 1);
 }
 
 static unsigned long omap3evm_panel_get_caps(struct lcd_panel *panel)
index 8c66bf635d680371639faa0fb98e1af2295a5fad..afd5e28468f461dbd2e21477b98deb44b377c05d 100644 (file)
@@ -166,9 +166,9 @@ static int p2_panel_enable(struct lcd_panel *panel)
 
                /* thwack the reset line */
        omap_set_gpio_direction(19, 0);
-       omap_set_gpio_dataout(19, 0);
+       gpio_set_value(19, 0);
        mdelay(2);
-       omap_set_gpio_dataout(19, 1);
+       gpio_set_value(19, 1);
 
                /* bits 31:28 -> 0  LCD_PXL_15 .. 12 */
        value = omap_readl(OMAP730_IO_CONF_3) & 0x0FFFFFFF;
@@ -258,7 +258,7 @@ static int p2_panel_enable(struct lcd_panel *panel)
 
        /* enable backlight */
        omap_set_gpio_direction(134, 0);
-       omap_set_gpio_dataout(134, 1);
+       gpio_set_value(134, 1);
 
        return 0;
 }