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

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

ARM: OMAP: switch to standard gpio get/set calls



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's in mainline, including the implementations
of those calls.

Except for the declarations and definitions of those calls, all of
these changes were performed by a simple SED script.  Plus, a few
"if() set() else set()" branches were merged by hand.

Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent a007b709
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -205,7 +205,7 @@ static struct platform_device *devices[] __initdata = {


static int nand_dev_ready(struct omap_nand_platform_data *data)
static int nand_dev_ready(struct omap_nand_platform_data *data)
{
{
	return omap_get_gpio_datain(P2_NAND_RB_GPIO_PIN);
	return gpio_get_value(P2_NAND_RB_GPIO_PIN);
}
}


static struct omap_uart_config fsample_uart_config __initdata = {
static struct omap_uart_config fsample_uart_config __initdata = {
+3 −6
Original line number Original line Diff line number Diff line
@@ -250,11 +250,8 @@ static struct platform_device h2_kp_device = {
#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
static int h2_transceiver_mode(struct device *dev, int state)
static int h2_transceiver_mode(struct device *dev, int state)
{
{
	if (state & IR_SIRMODE)
	/* SIR when low, else MIR/FIR when HIGH */
		omap_set_gpio_dataout(H2_IRDA_FIRSEL_GPIO_PIN, 0);
	gpio_set_value(H2_IRDA_FIRSEL_GPIO_PIN, !(state & IR_SIRMODE));
	else    /* MIR/FIR */
		omap_set_gpio_dataout(H2_IRDA_FIRSEL_GPIO_PIN, 1);

	return 0;
	return 0;
}
}
#endif
#endif
@@ -409,7 +406,7 @@ static struct omap_board_config_kernel h2_config[] __initdata = {


static int h2_nand_dev_ready(struct omap_nand_platform_data *data)
static int h2_nand_dev_ready(struct omap_nand_platform_data *data)
{
{
	return omap_get_gpio_datain(H2_NAND_RB_GPIO_PIN);
	return gpio_get_value(H2_NAND_RB_GPIO_PIN);
}
}


static void __init h2_init(void)
static void __init h2_init(void)
+1 −1
Original line number Original line Diff line number Diff line
@@ -498,7 +498,7 @@ static struct omap_gpio_switch h3_gpio_switches[] __initdata = {


static int nand_dev_ready(struct omap_nand_platform_data *data)
static int nand_dev_ready(struct omap_nand_platform_data *data)
{
{
	return omap_get_gpio_datain(H3_NAND_RB_GPIO_PIN);
	return gpio_get_value(H3_NAND_RB_GPIO_PIN);
}
}


static void __init h3_init(void)
static void __init h3_init(void)
+5 −5
Original line number Original line Diff line number Diff line
@@ -102,7 +102,7 @@ static void mipid_shutdown(struct mipid_platform_data *pdata)
{
{
	if (pdata->nreset_gpio != -1) {
	if (pdata->nreset_gpio != -1) {
		printk(KERN_INFO "shutdown LCD\n");
		printk(KERN_INFO "shutdown LCD\n");
		omap_set_gpio_dataout(pdata->nreset_gpio, 0);
		gpio_set_value(pdata->nreset_gpio, 0);
		msleep(120);
		msleep(120);
	}
	}
}
}
@@ -130,7 +130,7 @@ static void ads7846_dev_init(void)


static int ads7846_get_pendown_state(void)
static int ads7846_get_pendown_state(void)
{
{
	return !omap_get_gpio_datain(ADS7846_PENDOWN_GPIO);
	return !gpio_get_value(ADS7846_PENDOWN_GPIO);
}
}


static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = {
static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = {
@@ -228,9 +228,9 @@ static void nokia770_audio_pwr_up(void)
	/* Turn on codec */
	/* Turn on codec */
	aic23_power_up();
	aic23_power_up();


	if (omap_get_gpio_datain(HEADPHONE_GPIO))
	if (gpio_get_value(HEADPHONE_GPIO))
		/* HP not connected, turn on amplifier */
		/* HP not connected, turn on amplifier */
		omap_set_gpio_dataout(AMPLIFIER_CTRL_GPIO, 1);
		gpio_set_value(AMPLIFIER_CTRL_GPIO, 1);
	else
	else
		/* HP connected, do not turn on amplifier */
		/* HP connected, do not turn on amplifier */
		printk("HP connected\n");
		printk("HP connected\n");
@@ -250,7 +250,7 @@ static DECLARE_DELAYED_WORK(codec_power_down_work, codec_delayed_power_down);
static void nokia770_audio_pwr_down(void)
static void nokia770_audio_pwr_down(void)
{
{
	/* Turn off amplifier */
	/* Turn off amplifier */
	omap_set_gpio_dataout(AMPLIFIER_CTRL_GPIO, 0);
	gpio_set_value(AMPLIFIER_CTRL_GPIO, 0);


	/* Turn off codec: schedule delayed work */
	/* Turn off codec: schedule delayed work */
	schedule_delayed_work(&codec_power_down_work, HZ / 20);	/* 50ms */
	schedule_delayed_work(&codec_power_down_work, HZ / 20);	/* 50ms */
+3 −3
Original line number Original line Diff line number Diff line
@@ -255,7 +255,7 @@ static void palmte_get_power_status(struct apm_power_info *info, int *battery)
{
{
	int charging, batt, hi, lo, mid;
	int charging, batt, hi, lo, mid;


	charging = !omap_get_gpio_datain(PALMTE_DC_GPIO);
	charging = !gpio_get_value(PALMTE_DC_GPIO);
	batt = battery[0];
	batt = battery[0];
	if (charging)
	if (charging)
		batt -= 60;
		batt -= 60;
@@ -335,11 +335,11 @@ static void palmte_headphones_detect(void *data, int state)
{
{
	if (state) {
	if (state) {
		/* Headphones connected, disable speaker */
		/* Headphones connected, disable speaker */
		omap_set_gpio_dataout(PALMTE_SPEAKER_GPIO, 0);
		gpio_set_value(PALMTE_SPEAKER_GPIO, 0);
		printk(KERN_INFO "PM: speaker off\n");
		printk(KERN_INFO "PM: speaker off\n");
	} else {
	} else {
		/* Headphones unplugged, re-enable speaker */
		/* Headphones unplugged, re-enable speaker */
		omap_set_gpio_dataout(PALMTE_SPEAKER_GPIO, 1);
		gpio_set_value(PALMTE_SPEAKER_GPIO, 1);
		printk(KERN_INFO "PM: speaker on\n");
		printk(KERN_INFO "PM: speaker on\n");
	}
	}
}
}
Loading