All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: linux-arm-kernel@lists.arm.linux.org.uk
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	alsa-devel@alsa-project.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Eric Miao <eric.miao@marvell.com>
Subject: [PATCH 2/2] pxa2xx: make pxa2xx_ac97_reset use MFP
Date: Mon, 25 May 2009 13:20:19 +0400	[thread overview]
Message-ID: <1243243219-23786-2-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1243243219-23786-1-git-send-email-dbaryshkov@gmail.com>

Stop using obsolete pxa_gpio_mode, use MFP and GPIO API for setting pin
parameters.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Eric Miao <eric.miao@marvell.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 arch/arm/mach-pxa/pxa27x.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index a0e787e..8674581 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -355,30 +355,30 @@ void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
  * computes the correct gpio_mode for further use by reset functions, and
  * applied the change through pxa_gpio_mode.
  */
-/* temporary include */
-#include <mach/pxa2xx-gpio.h>
 void pxa27x_ac97_reset(int reset_gpio, int resetgpio_action)
 {
-	int mode = 0;
+	unsigned long mfp[1] = {0};
 
 	if (reset_gpio)
 		switch (resetgpio_action) {
 		case RESETGPIO_NORMAL_ALTFUNC:
 			if (reset_gpio == 113)
-				mode = 113 | GPIO_ALT_FN_2_OUT;
+				mfp[0] = GPIO113_AC97_nRESET;
 			if (reset_gpio == 95)
-				mode = 95 | GPIO_ALT_FN_1_OUT;
+				mfp[0] = GPIO95_AC97_nRESET;
+			pxa2xx_mfp_config(mfp, 1);
 			break;
 		case RESETGPIO_FORCE_LOW:
-			mode = reset_gpio | GPIO_OUT | GPIO_DFLT_LOW;
+			mfp[0] = MFP_CFG_OUT(GPIO0, AF0, DRIVE_LOW) | MFP_PIN(reset_gpio);
+			pxa2xx_mfp_config(mfp, 1);
+			gpio_direction_output(reset_gpio, 0);
 			break;
 		case RESETGPIO_FORCE_HIGH:
-			mode = reset_gpio | GPIO_OUT | GPIO_DFLT_HIGH;
+			mfp[0] = MFP_CFG_OUT(GPIO0, AF0, DRIVE_HIGH) | MFP_PIN(reset_gpio);
+			pxa2xx_mfp_config(mfp, 1);
+			gpio_direction_output(reset_gpio, 1);
 			break;
 		};
-
-	if (mode)
-		pxa_gpio_mode(mode);
 }
 EXPORT_SYMBOL(pxa27x_ac97_reset);
 
-- 
1.6.2.4

  reply	other threads:[~2009-05-25  9:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-25  9:20 [PATCH 1/2] pxa2xx-ac97-lib: move set_resetgpio to pxa27x.c Dmitry Eremin-Solenikov
2009-05-25  9:20 ` Dmitry Eremin-Solenikov [this message]
2009-05-25 10:21 ` Eric Miao
2009-05-25 10:47   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1243243219-23786-2-git-send-email-dbaryshkov@gmail.com \
    --to=dbaryshkov@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=eric.miao@marvell.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.