Commit bc593f5d authored by Igor Grinberg's avatar Igor Grinberg Committed by Tony Lindgren
Browse files

arm: omap2plus: GPIO cleanup



use gpio_request_<one|array>() instead of multiple gpiolib calls,
remove unneeded variables, etc.
Signed-off-by: default avatarIgor Grinberg <grinberg@compulab.co.il>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 9e18630b
......@@ -226,8 +226,6 @@ static struct omap_board_mux board_mux[] __initdata = {
static void __init omap_2430sdp_init(void)
{
int ret;
omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC);
omap_board_config = sdp2430_config;
......@@ -246,9 +244,8 @@ static void __init omap_2430sdp_init(void)
board_smc91x_init();
/* Turn off secondary LCD backlight */
ret = gpio_request(SECONDARY_LCD_GPIO, "Secondary LCD backlight");
if (ret == 0)
gpio_direction_output(SECONDARY_LCD_GPIO, 0);
gpio_request_one(SECONDARY_LCD_GPIO, GPIOF_OUT_INIT_LOW,
"Secondary LCD backlight");
}
static void __init omap_2430sdp_map_io(void)
......
......@@ -126,8 +126,11 @@ static struct twl4030_keypad_data sdp3430_kp_data = {
#define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 8
#define SDP3430_LCD_PANEL_ENABLE_GPIO 5
static unsigned backlight_gpio;
static unsigned enable_gpio;
static struct gpio sdp3430_dss_gpios[] __initdata = {
{SDP3430_LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "LCD reset" },
{SDP3430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD Backlight"},
};
static int lcd_enabled;
static int dvi_enabled;
......@@ -135,29 +138,11 @@ static void __init sdp3430_display_init(void)
{
int r;
enable_gpio = SDP3430_LCD_PANEL_ENABLE_GPIO;
backlight_gpio = SDP3430_LCD_PANEL_BACKLIGHT_GPIO;
r = gpio_request(enable_gpio, "LCD reset");
if (r) {
printk(KERN_ERR "failed to get LCD reset GPIO\n");
goto err0;
}
r = gpio_request(backlight_gpio, "LCD Backlight");
if (r) {
printk(KERN_ERR "failed to get LCD backlight GPIO\n");
goto err1;
}
gpio_direction_output(enable_gpio, 0);
gpio_direction_output(backlight_gpio, 0);
r = gpio_request_array(sdp3430_dss_gpios,
ARRAY_SIZE(sdp3430_dss_gpios));
if (r)
printk(KERN_ERR "failed to get LCD control GPIOs\n");
return;
err1:
gpio_free(enable_gpio);
err0:
return;
}
static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev)
......@@ -167,8 +152,8 @@ static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev)
return -EINVAL;
}
gpio_direction_output(enable_gpio, 1);
gpio_direction_output(backlight_gpio, 1);
gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 1);
gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 1);
lcd_enabled = 1;
......@@ -179,8 +164,8 @@ static void sdp3430_panel_disable_lcd(struct omap_dss_device *dssdev)
{
lcd_enabled = 0;
gpio_direction_output(enable_gpio, 0);
gpio_direction_output(backlight_gpio, 0);
gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 0);
gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 0);
}
static int sdp3430_panel_enable_dvi(struct omap_dss_device *dssdev)
......@@ -308,12 +293,10 @@ static int sdp3430_twl_gpio_setup(struct device *dev,
omap2_hsmmc_init(mmc);
/* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */
gpio_request(gpio + 7, "sub_lcd_en_bkl");
gpio_direction_output(gpio + 7, 0);
gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "sub_lcd_en_bkl");
/* gpio + 15 is "sub_lcd_nRST" (output) */
gpio_request(gpio + 15, "sub_lcd_nRST");
gpio_direction_output(gpio + 15, 0);
gpio_request_one(gpio + 15, GPIOF_OUT_INIT_LOW, "sub_lcd_nRST");
return 0;
}
......
......@@ -252,58 +252,22 @@ static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
},
};
static struct gpio sdp4430_eth_gpios[] __initdata = {
{ ETH_KS8851_POWER_ON, GPIOF_OUT_INIT_HIGH, "eth_power" },
{ ETH_KS8851_QUART, GPIOF_OUT_INIT_HIGH, "quart" },
{ ETH_KS8851_IRQ, GPIOF_IN, "eth_irq" },
};
static int omap_ethernet_init(void)
{
int status;
/* Request of GPIO lines */
status = gpio_request_array(sdp4430_eth_gpios,
ARRAY_SIZE(sdp4430_eth_gpios));
if (status)
pr_err("Cannot request ETH GPIOs\n");
status = gpio_request(ETH_KS8851_POWER_ON, "eth_power");
if (status) {
pr_err("Cannot request GPIO %d\n", ETH_KS8851_POWER_ON);
return status;
}
status = gpio_request(ETH_KS8851_QUART, "quart");
if (status) {
pr_err("Cannot request GPIO %d\n", ETH_KS8851_QUART);
goto error1;
}
status = gpio_request(ETH_KS8851_IRQ, "eth_irq");
if (status) {
pr_err("Cannot request GPIO %d\n", ETH_KS8851_IRQ);
goto error2;
}
/* Configuration of requested GPIO lines */
status = gpio_direction_output(ETH_KS8851_POWER_ON, 1);
if (status) {
pr_err("Cannot set output GPIO %d\n", ETH_KS8851_IRQ);
goto error3;
}
status = gpio_direction_output(ETH_KS8851_QUART, 1);
if (status) {
pr_err("Cannot set output GPIO %d\n", ETH_KS8851_QUART);
goto error3;
}
status = gpio_direction_input(ETH_KS8851_IRQ);
if (status) {
pr_err("Cannot set input GPIO %d\n", ETH_KS8851_IRQ);
goto error3;
}
return 0;
error3:
gpio_free(ETH_KS8851_IRQ);
error2:
gpio_free(ETH_KS8851_QUART);
error1:
gpio_free(ETH_KS8851_POWER_ON);
return status;
}
......@@ -602,21 +566,13 @@ static int __init omap4_i2c_init(void)
static void __init omap_sfh7741prox_init(void)
{
int error;
int error;
error = gpio_request(OMAP4_SFH7741_ENABLE_GPIO, "sfh7741");
if (error < 0) {
error = gpio_request_one(OMAP4_SFH7741_ENABLE_GPIO,
GPIOF_OUT_INIT_LOW, "sfh7741");
if (error < 0)
pr_err("%s:failed to request GPIO %d, error %d\n",
__func__, OMAP4_SFH7741_ENABLE_GPIO, error);
return;
}
error = gpio_direction_output(OMAP4_SFH7741_ENABLE_GPIO , 0);
if (error < 0) {
pr_err("%s: GPIO configuration failed: GPIO %d,error %d\n",
__func__, OMAP4_SFH7741_ENABLE_GPIO, error);
gpio_free(OMAP4_SFH7741_ENABLE_GPIO);
}
}
static void sdp4430_hdmi_mux_init(void)
......@@ -633,27 +589,19 @@ static void sdp4430_hdmi_mux_init(void)
OMAP_PIN_INPUT_PULLUP);
}
static struct gpio sdp4430_hdmi_gpios[] = {
{ HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_hpd" },
{ HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" },
};
static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev)
{
int status;
status = gpio_request_one(HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH,
"hdmi_gpio_hpd");
if (status) {
pr_err("Cannot request GPIO %d\n", HDMI_GPIO_HPD);
return status;
}
status = gpio_request_one(HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH,
"hdmi_gpio_ls_oe");
if (status) {
pr_err("Cannot request GPIO %d\n", HDMI_GPIO_LS_OE);
goto error1;
}
return 0;
error1:
gpio_free(HDMI_GPIO_HPD);
status = gpio_request_array(sdp4430_hdmi_gpios,
ARRAY_SIZE(sdp4430_hdmi_gpios));
if (status)
pr_err("%s: Cannot request HDMI GPIOs\n", __func__);
return status;
}
......
......@@ -89,19 +89,13 @@ static void __init am3517_crane_init(void)
return;
}
ret = gpio_request(GPIO_USB_POWER, "usb_ehci_enable");
ret = gpio_request_one(GPIO_USB_POWER, GPIOF_OUT_INIT_HIGH,
"usb_ehci_enable");
if (ret < 0) {
pr_err("Can not request GPIO %d\n", GPIO_USB_POWER);
return;
}
ret = gpio_direction_output(GPIO_USB_POWER, 1);
if (ret < 0) {
gpio_free(GPIO_USB_POWER);
pr_err("Unable to initialize EHCI power\n");
return;
}
usbhs_init(&usbhs_bdata);
}
......
......@@ -174,19 +174,14 @@ static void __init am3517_evm_rtc_init(void)
int r;
omap_mux_init_gpio(GPIO_RTCS35390A_IRQ, OMAP_PIN_INPUT_PULLUP);
r = gpio_request(GPIO_RTCS35390A_IRQ, "rtcs35390a-irq");
r = gpio_request_one(GPIO_RTCS35390A_IRQ, GPIOF_IN, "rtcs35390a-irq");
if (r < 0) {
printk(KERN_WARNING "failed to request GPIO#%d\n",
GPIO_RTCS35390A_IRQ);
return;
}
r = gpio_direction_input(GPIO_RTCS35390A_IRQ);
if (r < 0) {
printk(KERN_WARNING "GPIO#%d cannot be configured as input\n",
GPIO_RTCS35390A_IRQ);
gpio_free(GPIO_RTCS35390A_IRQ);
return;
}
am3517evm_i2c1_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
}
......@@ -242,6 +237,15 @@ static int dvi_enabled;
#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
static struct gpio am3517_evm_dss_gpios[] __initdata = {
/* GPIO 182 = LCD Backlight Power */
{ LCD_PANEL_BKLIGHT_PWR, GPIOF_OUT_INIT_HIGH, "lcd_backlight_pwr" },
/* GPIO 181 = LCD Panel PWM */
{ LCD_PANEL_PWM, GPIOF_OUT_INIT_HIGH, "lcd bl enable" },
/* GPIO 176 = LCD Panel Power enable pin */
{ LCD_PANEL_PWR, GPIOF_OUT_INIT_HIGH, "dvi enable" },
};
static void __init am3517_evm_display_init(void)
{
int r;
......@@ -249,41 +253,15 @@ static void __init am3517_evm_display_init(void)
omap_mux_init_gpio(LCD_PANEL_PWR, OMAP_PIN_INPUT_PULLUP);
omap_mux_init_gpio(LCD_PANEL_BKLIGHT_PWR, OMAP_PIN_INPUT_PULLDOWN);
omap_mux_init_gpio(LCD_PANEL_PWM, OMAP_PIN_INPUT_PULLDOWN);
/*
* Enable GPIO 182 = LCD Backlight Power
*/
r = gpio_request(LCD_PANEL_BKLIGHT_PWR, "lcd_backlight_pwr");
r = gpio_request_array(am3517_evm_dss_gpios,
ARRAY_SIZE(am3517_evm_dss_gpios));
if (r) {
printk(KERN_ERR "failed to get lcd_backlight_pwr\n");
printk(KERN_ERR "failed to get DSS panel control GPIOs\n");
return;
}
gpio_direction_output(LCD_PANEL_BKLIGHT_PWR, 1);
/*
* Enable GPIO 181 = LCD Panel PWM
*/
r = gpio_request(LCD_PANEL_PWM, "lcd_pwm");
if (r) {
printk(KERN_ERR "failed to get lcd_pwm\n");
goto err_1;
}
gpio_direction_output(LCD_PANEL_PWM, 1);
/*
* Enable GPIO 176 = LCD Panel Power enable pin
*/
r = gpio_request(LCD_PANEL_PWR, "lcd_panel_pwr");
if (r) {
printk(KERN_ERR "failed to get lcd_panel_pwr\n");
goto err_2;
}
gpio_direction_output(LCD_PANEL_PWR, 1);
printk(KERN_INFO "Display initialized successfully\n");
return;
err_2:
gpio_free(LCD_PANEL_PWM);
err_1:
gpio_free(LCD_PANEL_BKLIGHT_PWR);
}
#else
static void __init am3517_evm_display_init(void) {}
......
......@@ -202,6 +202,7 @@ static inline void __init apollon_init_smc91x(void)
unsigned int rate;
struct clk *gpmc_fck;
int eth_cs;
int err;
gpmc_fck = clk_get(NULL, "gpmc_fck"); /* Always on ENABLE_ON_INIT */
if (IS_ERR(gpmc_fck)) {
......@@ -245,15 +246,13 @@ static inline void __init apollon_init_smc91x(void)
apollon_smc91x_resources[0].end = base + 0x30f;
udelay(100);
omap_mux_init_gpio(74, 0);
if (gpio_request(APOLLON_ETHR_GPIO_IRQ, "SMC91x irq") < 0) {
omap_mux_init_gpio(APOLLON_ETHR_GPIO_IRQ, 0);
err = gpio_request_one(APOLLON_ETHR_GPIO_IRQ, GPIOF_IN, "SMC91x irq");
if (err) {
printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
APOLLON_ETHR_GPIO_IRQ);
gpmc_cs_free(APOLLON_ETH_CS);
goto out;
}
gpio_direction_input(APOLLON_ETHR_GPIO_IRQ);
out:
clk_disable(gpmc_fck);
clk_put(gpmc_fck);
......@@ -280,20 +279,19 @@ static void __init omap_apollon_init_early(void)
omap2_init_common_devices(NULL, NULL);
}
static struct gpio apollon_gpio_leds[] __initdata = {
{ LED0_GPIO13, GPIOF_OUT_INIT_LOW, "LED0" }, /* LED0 - AA10 */
{ LED1_GPIO14, GPIOF_OUT_INIT_LOW, "LED1" }, /* LED1 - AA6 */
{ LED2_GPIO15, GPIOF_OUT_INIT_LOW, "LED2" }, /* LED2 - AA4 */
};
static void __init apollon_led_init(void)
{
/* LED0 - AA10 */
omap_mux_init_signal("vlynq_clk.gpio_13", 0);
gpio_request(LED0_GPIO13, "LED0");
gpio_direction_output(LED0_GPIO13, 0);
/* LED1 - AA6 */
omap_mux_init_signal("vlynq_rx1.gpio_14", 0);
gpio_request(LED1_GPIO14, "LED1");
gpio_direction_output(LED1_GPIO14, 0);
/* LED2 - AA4 */
omap_mux_init_signal("vlynq_rx0.gpio_15", 0);
gpio_request(LED2_GPIO15, "LED2");
gpio_direction_output(LED2_GPIO15, 0);
gpio_request_array(apollon_gpio_leds, ARRAY_SIZE(apollon_gpio_leds));
}
static void __init apollon_usb_init(void)
......@@ -301,8 +299,7 @@ static void __init apollon_usb_init(void)
/* USB device */
/* DEVICE_SUSPEND */
omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0);
gpio_request(12, "USB suspend");
gpio_direction_output(12, 0);
gpio_request_one(12, GPIOF_OUT_INIT_LOW, "USB suspend");
omap2_usbfs_init(&apollon_usb_config);
}
......
......@@ -182,10 +182,6 @@ static inline void cm_t35_init_nand(void) {}
#define CM_T35_LCD_BL_GPIO 58
#define CM_T35_DVI_EN_GPIO 54
static int lcd_bl_gpio;
static int lcd_en_gpio;
static int dvi_en_gpio;
static int lcd_enabled;
static int dvi_enabled;
......@@ -196,8 +192,8 @@ static int cm_t35_panel_enable_lcd(struct omap_dss_device *dssdev)
return -EINVAL;
}
gpio_set_value(lcd_en_gpio, 1);
gpio_set_value(lcd_bl_gpio, 1);
gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
gpio_set_value(CM_T35_LCD_BL_GPIO, 1);
lcd_enabled = 1;
......@@ -208,8 +204,8 @@ static void cm_t35_panel_disable_lcd(struct omap_dss_device *dssdev)
{
lcd_enabled = 0;
gpio_set_value(lcd_bl_gpio, 0);
gpio_set_value(lcd_en_gpio, 0);
gpio_set_value(CM_T35_LCD_BL_GPIO, 0);
gpio_set_value(CM_T35_LCD_EN_GPIO, 0);
}
static int cm_t35_panel_enable_dvi(struct omap_dss_device *dssdev)
......@@ -219,7 +215,7 @@ static int cm_t35_panel_enable_dvi(struct omap_dss_device *dssdev)
return -EINVAL;
}
gpio_set_value(dvi_en_gpio, 0);
gpio_set_value(CM_T35_DVI_EN_GPIO, 0);
dvi_enabled = 1;
return 0;
......@@ -227,7 +223,7 @@ static int cm_t35_panel_enable_dvi(struct omap_dss_device *dssdev)
static void cm_t35_panel_disable_dvi(struct omap_dss_device *dssdev)
{
gpio_set_value(dvi_en_gpio, 1);
gpio_set_value(CM_T35_DVI_EN_GPIO, 1);
dvi_enabled = 0;
}
......@@ -309,62 +305,38 @@ static struct spi_board_info cm_t35_lcd_spi_board_info[] __initdata = {
},
};
static struct gpio cm_t35_dss_gpios[] __initdata = {
{ CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW, "lcd enable" },
{ CM_T35_LCD_BL_GPIO, GPIOF_OUT_INIT_LOW, "lcd bl enable" },
{ CM_T35_DVI_EN_GPIO, GPIOF_OUT_INIT_HIGH, "dvi enable" },
};
static void __init cm_t35_init_display(void)
{
int err;
lcd_en_gpio = CM_T35_LCD_EN_GPIO;
lcd_bl_gpio = CM_T35_LCD_BL_GPIO;
dvi_en_gpio = CM_T35_DVI_EN_GPIO;
spi_register_board_info(cm_t35_lcd_spi_board_info,
ARRAY_SIZE(cm_t35_lcd_spi_board_info));
err = gpio_request(lcd_en_gpio, "LCD RST");
if (err) {
pr_err("CM-T35: failed to get LCD reset GPIO\n");
goto out;
}
err = gpio_request(lcd_bl_gpio, "LCD BL");
err = gpio_request_array(cm_t35_dss_gpios,
ARRAY_SIZE(cm_t35_dss_gpios));
if (err) {
pr_err("CM-T35: failed to get LCD backlight control GPIO\n");
goto err_lcd_bl;
pr_err("CM-T35: failed to request DSS control GPIOs\n");
return;
}
err = gpio_request(dvi_en_gpio, "DVI EN");
if (err) {
pr_err("CM-T35: failed to get DVI reset GPIO\n");
goto err_dvi_en;
}
gpio_export(lcd_en_gpio, 0);
gpio_export(lcd_bl_gpio, 0);
gpio_export(dvi_en_gpio, 0);
gpio_direction_output(lcd_en_gpio, 0);
gpio_direction_output(lcd_bl_gpio, 0);
gpio_direction_output(dvi_en_gpio, 1);
gpio_export(CM_T35_LCD_EN_GPIO, 0);
gpio_export(CM_T35_LCD_BL_GPIO, 0);
gpio_export(CM_T35_DVI_EN_GPIO, 0);
msleep(50);
gpio_set_value(lcd_en_gpio, 1);
gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
err = omap_display_init(&cm_t35_dss_data);
if (err) {
pr_err("CM-T35: failed to register DSS device\n");
goto err_dev_reg;
gpio_free_array(cm_t35_dss_gpios, ARRAY_SIZE(cm_t35_dss_gpios));
}
return;
err_dev_reg:
gpio_free(dvi_en_gpio);
err_dvi_en:
gpio_free(lcd_bl_gpio);
err_lcd_bl:
gpio_free(lcd_en_gpio);
out:
return;
}
static struct regulator_consumer_supply cm_t35_vmmc1_supply = {
......@@ -497,10 +469,8 @@ static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio,
{
int wlan_rst = gpio + 2;
if ((gpio_request(wlan_rst, "WLAN RST") == 0) &&
(gpio_direction_output(wlan_rst, 1) == 0)) {
if (gpio_request_one(wlan_rst, GPIOF_OUT_INIT_HIGH, "WLAN RST") == 0) {
gpio_export(wlan_rst, 0);
udelay(10);
gpio_set_value(wlan_rst, 0);
udelay(10);
......
......@@ -148,14 +148,13 @@ static void __init cm_t3517_init_rtc(void)
{
int err;
err = gpio_request(RTC_CS_EN_GPIO, "rtc cs en");
err = gpio_request_one(RTC_CS_EN_GPIO, GPIOF_OUT_INIT_HIGH,
"rtc cs en");
if (err) {
pr_err("CM-T3517: rtc cs en gpio request failed: %d\n", err);
return;
}
gpio_direction_output(RTC_CS_EN_GPIO, 1);
platform_device_register(&cm_t3517_rtc_device);
}
#else
......@@ -182,11 +181,11 @@ static int cm_t3517_init_usbh(void)
{
int err;
err = gpio_request(USB_HUB_RESET_GPIO, "usb hub rst");
err = gpio_request_one(USB_HUB_RESET_GPIO, GPIOF_OUT_INIT_LOW,
"usb hub rst");
if (err) {
pr_err("CM-T3517: usb hub rst gpio request failed: %d\n", err);
} else {
gpio_direction_output(USB_HUB_RESET_GPIO, 0);
udelay(10);
gpio_set_value(USB_HUB_RESET_GPIO, 1);
msleep(1);
......
......@@ -242,7 +242,7 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
/* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */
devkit8000_lcd_device.reset_gpio = gpio + TWL4030_GPIO_MAX + 0;
ret = gpio_request_one(devkit8000_lcd_device.reset_gpio,
GPIOF_DIR_OUT | GPIOF_INIT_LOW, "LCD_PWREN");
GPIOF_OUT_INIT_LOW, "LCD_PWREN");
if (ret < 0) {
devkit8000_lcd_device.reset_gpio = -EINVAL;
printk(KERN_ERR "Failed to request GPIO for LCD_PWRN\n");
......@@ -251,7 +251,7 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
/* gpio + 7 is "DVI_PD" (out, active low) */
devkit8000_dvi_device.reset_gpio = gpio + 7;
ret = gpio_request_one(devkit8000_dvi_device.reset_gpio,
GPIOF_DIR_OUT | GPIOF_INIT_LOW, "DVI PowerDown");
GPIOF_OUT_INIT_LOW, "DVI PowerDown");
if (ret < 0) {
devkit8000_dvi_device.reset_gpio = -EINVAL;
printk(KERN_ERR "Failed to request GPIO for DVI PowerDown\n");
......@@ -483,14 +483,14 @@ static void __init omap_dm9000_init(void)
{
unsigned char *eth_addr = omap_dm9000_platdata.dev_addr;
struct omap_die_id odi;
int ret;
if (gpio_request(OMAP_DM9000_GPIO_IRQ, "dm9000 irq") < 0) {
ret = gpio_request_one(OMAP_DM9000_GPIO_IRQ, GPIOF_IN, "dm9000 irq");
if (ret < 0) {
printk(KERN_ERR "Failed to request GPIO%d for dm9000 IRQ\n",
OMAP_DM9000_GPIO_IRQ);
return;
}
gpio_direction_input(OMAP_DM9000_GPIO_IRQ);
}