From 7270f33b7b0139f40fcfbf771dc5ec5a773a71cd Mon Sep 17 00:00:00 2001 From: David Brownell Date: Wed, 29 Oct 2008 20:39:22 -0700 Subject: [PATCH] use standard gpio get/set calls (OMAP tree only) 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 Signed-off-by: Tony Lindgren --- Documentation/arm/OMAP/gpio | 15 +++++++++++++++ arch/arm/mach-omap2/board-2430sdp.c | 4 ++-- arch/arm/mach-omap2/board-3430sdp.c | 2 +- arch/arm/mach-omap2/board-ldp.c | 2 +- arch/arm/mach-omap2/board-n800-camera.c | 6 +++--- arch/arm/mach-omap2/board-n800-mmc.c | 19 ++++++++----------- arch/arm/mach-omap2/board-n800-usb.c | 6 +++--- arch/arm/mach-omap2/board-n800.c | 12 ++++++------ arch/arm/mach-omap2/board-omap2evm.c | 2 +- arch/arm/mach-omap2/board-omap3evm.c | 2 +- arch/arm/plat-omap/gpio-switch.c | 10 +++++----- drivers/bluetooth/brf6150.c | 18 +++++++++--------- drivers/bluetooth/hci_h4p/core.c | 24 ++++++++++++------------ drivers/cbus/cbus.c | 24 ++++++++++++------------ drivers/leds/leds-omap.c | 6 +----- drivers/spi/tsc2301-core.c | 4 ++-- drivers/usb/host/ehci-omap.c | 8 ++++---- drivers/video/omap/lcd_2430sdp.c | 8 ++++---- drivers/video/omap/lcd_omap2evm.c | 14 +++++++------- drivers/video/omap/lcd_omap3beagle.c | 4 ++-- drivers/video/omap/lcd_omap3evm.c | 14 +++++++------- drivers/video/omap/lcd_p2.c | 6 +++--- 22 files changed, 109 insertions(+), 101 deletions(-) diff --git a/Documentation/arm/OMAP/gpio b/Documentation/arm/OMAP/gpio index fd6363cd7f5..8a011ad41c3 100644 --- a/Documentation/arm/OMAP/gpio +++ b/Documentation/arm/OMAP/gpio @@ -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 --------------------- diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index 6aa83ace4c5..0ca8875e8ca 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c @@ -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) diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 7ee85e9b7c8..eb53d56f0b9 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -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); } /* diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index c2bb7262e16..b2574dfeb52 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c @@ -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); } /* diff --git a/arch/arm/mach-omap2/board-n800-camera.c b/arch/arm/mach-omap2/board-n800-camera.c index 6272263e398..2dd1138cb88 100644 --- a/arch/arm/mach-omap2/board-n800-camera.c +++ b/arch/arm/mach-omap2/board-n800-camera.c @@ -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; diff --git a/arch/arm/mach-omap2/board-n800-mmc.c b/arch/arm/mach-omap2/board-n800-mmc.c index 8b78180242d..471d3158fe3 100644 --- a/arch/arm/mach-omap2/board-n800-mmc.c +++ b/arch/arm/mach-omap2/board-n800-mmc.c @@ -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); } diff --git a/arch/arm/mach-omap2/board-n800-usb.c b/arch/arm/mach-omap2/board-n800-usb.c index fc128f245ab..36bb6a88041 100644 --- a/arch/arm/mach-omap2/board-n800-usb.c +++ b/arch/arm/mach-omap2/board-n800-usb.c @@ -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); } diff --git a/arch/arm/mach-omap2/board-n800.c b/arch/arm/mach-omap2/board-n800.c index 2c64d2d47ed..74ffd4e2ed2 100644 --- a/arch/arm/mach-omap2/board-n800.c +++ b/arch/arm/mach-omap2/board-n800.c @@ -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; diff --git a/arch/arm/mach-omap2/board-omap2evm.c b/arch/arm/mach-omap2/board-omap2evm.c index 84aeacf50aa..e705e59c26d 100644 --- a/arch/arm/mach-omap2/board-omap2evm.c +++ b/arch/arm/mach-omap2/board-omap2evm.c @@ -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 = { diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 42ab8264b0b..03d900a7c7a 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -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 = { diff --git a/arch/arm/plat-omap/gpio-switch.c b/arch/arm/plat-omap/gpio-switch.c index f2dd67a6764..f74d0cef8a9 100644 --- a/arch/arm/plat-omap/gpio-switch.c +++ b/arch/arm/plat-omap/gpio-switch.c @@ -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) diff --git a/drivers/bluetooth/brf6150.c b/drivers/bluetooth/brf6150.c index 476cc6554b9..b87955630b7 100644 --- a/drivers/bluetooth/brf6150.c +++ b/drivers/bluetooth/brf6150.c @@ -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; diff --git a/drivers/bluetooth/hci_h4p/core.c b/drivers/bluetooth/hci_h4p/core.c index 005e6528a14..e0681d84d26 100644 --- a/drivers/bluetooth/hci_h4p/core.c +++ b/drivers/bluetooth/hci_h4p/core.c @@ -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); diff --git a/drivers/cbus/cbus.c b/drivers/cbus/cbus.c index d72c49a9654..de3440944a9 100644 --- a/drivers/cbus/cbus.c +++ b/drivers/cbus/cbus.c @@ -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; diff --git a/drivers/leds/leds-omap.c b/drivers/leds/leds-omap.c index 5c14c4b5275..bf5cce8f8d1 100644 --- a/drivers/leds/leds-omap.c +++ b/drivers/leds/leds-omap.c @@ -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) diff --git a/drivers/spi/tsc2301-core.c b/drivers/spi/tsc2301-core.c index 939bc48c2b5..f6351c66f17 100644 --- a/drivers/spi/tsc2301-core.c +++ b/drivers/spi/tsc2301-core.c @@ -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; diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 419e70ab0ba..adbff661b33 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c @@ -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 diff --git a/drivers/video/omap/lcd_2430sdp.c b/drivers/video/omap/lcd_2430sdp.c index a728837e882..12c9ed27600 100644 --- a/drivers/video/omap/lcd_2430sdp.c +++ b/drivers/video/omap/lcd_2430sdp.c @@ -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); diff --git a/drivers/video/omap/lcd_omap2evm.c b/drivers/video/omap/lcd_omap2evm.c index 8a0105e3520..f3b012ca866 100644 --- a/drivers/video/omap/lcd_omap2evm.c +++ b/drivers/video/omap/lcd_omap2evm.c @@ -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) diff --git a/drivers/video/omap/lcd_omap3beagle.c b/drivers/video/omap/lcd_omap3beagle.c index dc59f399aac..0c779e40d5e 100644 --- a/drivers/video/omap/lcd_omap3beagle.c +++ b/drivers/video/omap/lcd_omap3beagle.c @@ -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) diff --git a/drivers/video/omap/lcd_omap3evm.c b/drivers/video/omap/lcd_omap3evm.c index a564ca54b5c..7f10da0f0da 100644 --- a/drivers/video/omap/lcd_omap3evm.c +++ b/drivers/video/omap/lcd_omap3evm.c @@ -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) diff --git a/drivers/video/omap/lcd_p2.c b/drivers/video/omap/lcd_p2.c index 8c66bf635d6..afd5e28468f 100644 --- a/drivers/video/omap/lcd_p2.c +++ b/drivers/video/omap/lcd_p2.c @@ -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; } -- 2.41.0