Commit 5a009df1 authored by Igor Grinberg's avatar Igor Grinberg Committed by Eric Miao

ARM: pxa/cm-x300: GPIO cleanup

use gpio_request_<one|array>() instead of multiple gpiolib calls
Signed-off-by: default avatarIgor Grinberg <grinberg@compulab.co.il>
Signed-off-by: default avatarEric Miao <eric.y.miao@gmail.com>
parent 6c7b3ea5
...@@ -484,14 +484,14 @@ static int cm_x300_ulpi_phy_reset(void) ...@@ -484,14 +484,14 @@ static int cm_x300_ulpi_phy_reset(void)
int err; int err;
/* reset the PHY */ /* reset the PHY */
err = gpio_request(GPIO_ULPI_PHY_RST, "ulpi reset"); err = gpio_request_one(GPIO_ULPI_PHY_RST, GPIOF_OUT_INIT_LOW,
"ulpi reset");
if (err) { if (err) {
pr_err("%s: failed to request ULPI reset GPIO: %d\n", pr_err("%s: failed to request ULPI reset GPIO: %d\n",
__func__, err); __func__, err);
return err; return err;
} }
gpio_direction_output(GPIO_ULPI_PHY_RST, 0);
msleep(10); msleep(10);
gpio_set_value(GPIO_ULPI_PHY_RST, 1); gpio_set_value(GPIO_ULPI_PHY_RST, 1);
msleep(10); msleep(10);
...@@ -768,39 +768,36 @@ static void __init cm_x300_init_da9030(void) ...@@ -768,39 +768,36 @@ static void __init cm_x300_init_da9030(void)
irq_set_irq_wake(IRQ_WAKEUP0, 1); irq_set_irq_wake(IRQ_WAKEUP0, 1);
} }
/* wi2wi gpio setting for system_rev >= 130 */
static struct gpio cm_x300_wi2wi_gpios[] __initdata = {
{ 71, GPIOF_OUT_INIT_HIGH, "wlan en" },
{ 70, GPIOF_OUT_INIT_HIGH, "bt reset" },
};
static void __init cm_x300_init_wi2wi(void) static void __init cm_x300_init_wi2wi(void)
{ {
int bt_reset, wlan_en; int bt_reset, wlan_en;
int err; int err;
if (system_rev < 130) { if (system_rev < 130) {
wlan_en = 77; cm_x300_wi2wi_gpios[0].gpio = 77; /* wlan en */
bt_reset = 78; cm_x300_wi2wi_gpios[1].gpio = 78; /* bt reset */
} else {
wlan_en = 71;
bt_reset = 70;
} }
/* Libertas and CSR reset */ /* Libertas and CSR reset */
err = gpio_request(wlan_en, "wlan en"); err = gpio_request_array(ARRAY_AND_SIZE(cm_x300_wi2wi_gpios));
if (err) { if (err) {
pr_err("CM-X300: failed to request wlan en gpio: %d\n", err); pr_err("CM-X300: failed to request wifi/bt gpios: %d\n", err);
} else { return;
gpio_direction_output(wlan_en, 1);
gpio_free(wlan_en);
} }
err = gpio_request(bt_reset, "bt reset"); udelay(10);
if (err) { gpio_set_value(bt_reset, 0);
pr_err("CM-X300: failed to request bt reset gpio: %d\n", err); udelay(10);
} else { gpio_set_value(bt_reset, 1);
gpio_direction_output(bt_reset, 1);
udelay(10); gpio_free(wlan_en);
gpio_set_value(bt_reset, 0); gpio_free(bt_reset);
udelay(10);
gpio_set_value(bt_reset, 1);
gpio_free(bt_reset);
}
} }
/* MFP */ /* MFP */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment