Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 251849
b: refs/heads/master
c: bc593f5
h: refs/heads/master
i:
  251847: 8479539
v: v3
  • Loading branch information
Igor Grinberg authored and Tony Lindgren committed May 12, 2011
1 parent 937faa7 commit 746d042
Show file tree
Hide file tree
Showing 28 changed files with 399 additions and 702 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9e18630b689d658d65bf59508bfec084f61ff5c6
refs/heads/master: bc593f5d787d0a015539e21868302fb44a47c3e3
7 changes: 2 additions & 5 deletions trunk/arch/arm/mach-omap2/board-2430sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down
47 changes: 15 additions & 32 deletions trunk/arch/arm/mach-omap2/board-3430sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,38 +126,23 @@ 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;

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)
Expand All @@ -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;

Expand All @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down
98 changes: 23 additions & 75 deletions trunk/arch/arm/mach-omap2/board-4430sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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)
Expand All @@ -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;
}
Expand Down
10 changes: 2 additions & 8 deletions trunk/arch/arm/mach-omap2/board-am3517crane.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
54 changes: 16 additions & 38 deletions trunk/arch/arm/mach-omap2/board-am3517evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -242,48 +237,31 @@ 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;

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) {}
Expand Down
Loading

0 comments on commit 746d042

Please sign in to comment.