Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e918edf7 authored by David Brownell's avatar David Brownell Committed by Tony Lindgren
Browse files

ARM: OMAP: switch to gpio_direction_output



More conversion to the standard GPIO interfaces:  stop using
omap_set_gpio_direction() entirely, and switch over to the
gpio_direction_output() call.

Note that because gpio_direction_output() includes the initial
value, this change isn't quite transparent.

 - For the call sites which defined an initial value either
   before or after setting the direction, that value was used.

   When that value was previously assigned afterwards, this
   could eliminate a brief output glitch ... and possibly
   change behavior.  In a few cases (LCDs) several values
   were assigned together ... those were re-arranged to match
   the explicit sequence provided.

 - Some call sites didn't define such a value; so I chose an
   initial "off/reset" value that seemed to default to "off".

In short, files touched by this patch might notice some small
changes in startup behavior (with trivial fixes).

Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 40e3925b
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -439,7 +439,7 @@ static void __init h2_init(void)
#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
	omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A);
	omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A);
	if (!(omap_request_gpio(H2_IRDA_FIRSEL_GPIO_PIN))) {
	if (!(omap_request_gpio(H2_IRDA_FIRSEL_GPIO_PIN))) {
		omap_set_gpio_direction(H2_IRDA_FIRSEL_GPIO_PIN, 0);
		gpio_direction_output(H2_IRDA_FIRSEL_GPIO_PIN, 0);
		h2_irda_data.transceiver_mode = h2_transceiver_mode;
		h2_irda_data.transceiver_mode = h2_transceiver_mode;
	}
	}
#endif
#endif
+1 −2
Original line number Original line Diff line number Diff line
@@ -323,8 +323,7 @@ palmz71_gpio_setup(int early)
{
{
	if (early) {
	if (early) {
		/* Only set GPIO1 so we have a working serial */
		/* Only set GPIO1 so we have a working serial */
		gpio_set_value(1, 1);
		gpio_direction_output(1, 1);
		omap_set_gpio_direction(1, 0);
	} else {
	} else {
		/* Set MMC/SD host WP pin as input */
		/* Set MMC/SD host WP pin as input */
		if (omap_request_gpio(PALMZ71_MMC_WP_GPIO)) {
		if (omap_request_gpio(PALMZ71_MMC_WP_GPIO)) {
+3 −8
Original line number Original line Diff line number Diff line
@@ -436,14 +436,9 @@ static void __init omap_sx1_init(void)
	omap_request_gpio(1);	/* A_IRDA_OFF */
	omap_request_gpio(1);	/* A_IRDA_OFF */
	omap_request_gpio(11);	/* A_SWITCH */
	omap_request_gpio(11);	/* A_SWITCH */
	omap_request_gpio(15);	/* A_USB_ON */
	omap_request_gpio(15);	/* A_USB_ON */
	omap_set_gpio_direction(1, 0);/* gpio1 -> output */
	gpio_direction_output(1, 1);	/*A_IRDA_OFF = 1 */
	omap_set_gpio_direction(11, 0);/* gpio11 -> output */
	gpio_direction_output(11, 0);	/*A_SWITCH = 0 */
	omap_set_gpio_direction(15, 0);/* gpio15 -> output */
	gpio_direction_output(15, 0);	/*A_USB_ON = 0 */
	/* set GPIO data */
	gpio_set_value(1, 1);/*A_IRDA_OFF = 1 */
	gpio_set_value(11, 0);/*A_SWITCH = 0 */
	gpio_set_value(15, 0);/*A_USB_ON = 0 */

}
}
/*----------------------------------------*/
/*----------------------------------------*/
static void __init omap_sx1_init_irq(void)
static void __init omap_sx1_init_irq(void)
+3 −6
Original line number Original line Diff line number Diff line
@@ -171,8 +171,7 @@ static void __init voiceblue_init(void)
	omap_request_gpio(0);
	omap_request_gpio(0);
	/* smc91x reset */
	/* smc91x reset */
	omap_request_gpio(7);
	omap_request_gpio(7);
	omap_set_gpio_direction(7, 0);
	gpio_direction_output(7, 1);
	gpio_set_value(7, 1);
	udelay(2);	/* wait at least 100ns */
	udelay(2);	/* wait at least 100ns */
	gpio_set_value(7, 0);
	gpio_set_value(7, 0);
	mdelay(50);	/* 50ms until PHY ready */
	mdelay(50);	/* 50ms until PHY ready */
@@ -180,8 +179,7 @@ static void __init voiceblue_init(void)
	omap_request_gpio(8);
	omap_request_gpio(8);
	/* 16C554 reset*/
	/* 16C554 reset*/
	omap_request_gpio(6);
	omap_request_gpio(6);
	omap_set_gpio_direction(6, 0);
	gpio_direction_output(6, 0);
	gpio_set_value(6, 0);
	/* 16C554 interrupt pins */
	/* 16C554 interrupt pins */
	omap_request_gpio(12);
	omap_request_gpio(12);
	omap_request_gpio(13);
	omap_request_gpio(13);
@@ -244,8 +242,7 @@ static int wdt_gpio_state;


void voiceblue_wdt_enable(void)
void voiceblue_wdt_enable(void)
{
{
	omap_set_gpio_direction(0, 0);
	gpio_direction_output(0, 0);
	gpio_set_value(0, 0);
	gpio_set_value(0, 1);
	gpio_set_value(0, 1);
	gpio_set_value(0, 0);
	gpio_set_value(0, 0);
	wdt_gpio_state = 0;
	wdt_gpio_state = 0;
+2 −2
Original line number Original line Diff line number Diff line
@@ -48,13 +48,13 @@ omap_leds_init(void)
		 */
		 */
		omap_cfg_reg(P18_1610_GPIO3);
		omap_cfg_reg(P18_1610_GPIO3);
		if (omap_request_gpio(3) == 0)
		if (omap_request_gpio(3) == 0)
			omap_set_gpio_direction(3, 0);
			gpio_direction_output(3, 1);
		else
		else
			printk(KERN_WARNING "LED: can't get GPIO3/red?\n");
			printk(KERN_WARNING "LED: can't get GPIO3/red?\n");


		omap_cfg_reg(MPUIO4);
		omap_cfg_reg(MPUIO4);
		if (omap_request_gpio(OMAP_MPUIO(4)) == 0)
		if (omap_request_gpio(OMAP_MPUIO(4)) == 0)
			omap_set_gpio_direction(OMAP_MPUIO(4), 0);
			gpio_direction_output(OMAP_MPUIO(4), 1);
		else
		else
			printk(KERN_WARNING "LED: can't get MPUIO4/green?\n");
			printk(KERN_WARNING "LED: can't get MPUIO4/green?\n");
	}
	}
Loading