All of lore.kernel.org
 help / color / mirror / Atom feed
From: mike@compulab.co.il (Mike Rapoport)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 05/16] [ARM] pxa/cm-x270: avoid direct access of GPIO/MFP registers
Date: Mon, 11 Jan 2010 17:19:42 +0200	[thread overview]
Message-ID: <4B4B418E.6050909@compulab.co.il> (raw)
In-Reply-To: <1263218664-11546-6-git-send-email-eric.y.miao@gmail.com>

Eric Miao wrote:
> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
> ---
>  arch/arm/mach-pxa/cm-x270.c |   62 ++++++++++++++++++++++++++++++------------
>  1 files changed, 44 insertions(+), 18 deletions(-)
> 
> diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c
> index 425efbc..ce503f4 100644
> --- a/arch/arm/mach-pxa/cm-x270.c
> +++ b/arch/arm/mach-pxa/cm-x270.c
> @@ -178,31 +178,57 @@ static struct resource cmx270_2700G_resource[] = {
>  
>  static unsigned long save_lcd_regs[10];

This can be dropped as well.

> +static unsigned long cmx270_marathon_on[] = {
> +	GPIO58_GPIO,
> +	GPIO59_GPIO,
> +	GPIO60_GPIO,
> +	GPIO61_GPIO,
> +	GPIO62_GPIO,
> +	GPIO63_GPIO,
> +	GPIO64_GPIO,
> +	GPIO65_GPIO,
> +	GPIO66_GPIO,
> +	GPIO67_GPIO,
> +	GPIO68_GPIO,
> +	GPIO69_GPIO,
> +	GPIO70_GPIO,
> +	GPIO71_GPIO,
> +	GPIO72_GPIO,
> +	GPIO73_GPIO,
> +	GPIO74_GPIO,
> +	GPIO75_GPIO,
> +	GPIO76_GPIO,
> +	GPIO77_GPIO,
> +};
> +
> +static unsigned long cmx270_marathon_off[] = {
> +	GPIOxx_LCD_TFT_16BPP,
> +};
> +
>  static int cmx270_marathon_probe(struct fb_info *fb)
>  {
> -	/* save PXA-270 pin settings before enabling 2700G */
> -	save_lcd_regs[0] = GPDR1;
> -	save_lcd_regs[1] = GPDR2;
> -	save_lcd_regs[2] = GAFR1_U;
> -	save_lcd_regs[3] = GAFR2_L;
> -	save_lcd_regs[4] = GAFR2_U;
> -
> -	/* Disable PXA-270 on-chip controller driving pins */
> -	GPDR1 &= ~(0xfc000000);
> -	GPDR2 &= ~(0x00c03fff);
> -	GAFR1_U &= ~(0xfff00000);
> -	GAFR2_L &= ~(0x0fffffff);
> -	GAFR2_U &= ~(0x0000f000);
> +	int gpio, err;
> +
> +	for (gpio = 58; gpio <= 77; gpio++) {
> +		err = gpio_request(gpio, "LCD");
> +		if (err)
> +			return err;
> +		gpio_direction_input(gpio);
> +	}
> +
> +	pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_marathon_on));
>  	return 0;
>  }
>  
>  static int cmx270_marathon_remove(struct fb_info *fb)
>  {
> -	GPDR1 =   save_lcd_regs[0];
> -	GPDR2 =   save_lcd_regs[1];
> -	GAFR1_U = save_lcd_regs[2];
> -	GAFR2_L = save_lcd_regs[3];
> -	GAFR2_U = save_lcd_regs[4];
> +	int gpio;
> +
> +	pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_marathon_off));
> +
> +	for (gpio = 58; gpio <= 77; gpio++)
> +		gpio_free(gpio);
> +
>  	return 0;
>  }
>  


-- 
Sincerely yours,
Mike.

  reply	other threads:[~2010-01-11 15:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-11 14:04 [RFC PATCH 00/16] pxa gpio API cleanup Eric Miao
2010-01-11 14:04 ` [PATCH 01/16] [ARM] pxa/tosa: make use of the matrix keypad driver Eric Miao
2010-01-11 14:04 ` [PATCH 02/16] [ARM] pxa: use chip->ack() instead of accessing GEDR directly Eric Miao
2010-01-11 14:04 ` [PATCH 03/16] [ARM] pxa: simplify the LCD pin configuration for pxa25x platforms Eric Miao
2010-01-11 14:04 ` [PATCH 04/16] [ARM] pxa: simplify the LCD pin configuration for pxa27x platforms Eric Miao
2010-01-11 14:04 ` [PATCH 05/16] [ARM] pxa/cm-x270: avoid direct access of GPIO/MFP registers Eric Miao
2010-01-11 15:19   ` Mike Rapoport [this message]
2010-01-12  0:19     ` Eric Miao
2010-01-11 14:04 ` [PATCH 06/16] [ARM] pxa: fix the incorrect naming of AC97 reset pin config for pxa26x Eric Miao
2010-01-11 14:04 ` [PATCH 07/16] [ARM] pxa: remove the unnecessary restoring of MFP registers Eric Miao
2010-01-11 14:04 ` [PATCH 08/16] [ARM] pxa: introduce processor specific pxa27x_assert_ac97reset() Eric Miao
2010-01-11 14:04 ` [PATCH 09/16] [ARM] pxa: add the missing AC97 pin configurations Eric Miao
2010-01-11 14:04 ` [PATCH 10/16] [ARM] pxa: remove now unnecessary pxa_gpio_mode() calls in ac97 Eric Miao
2010-01-11 14:04 ` [PATCH 11/16] gpio: introduce gpio_request_one() and friends Eric Miao
2010-01-11 14:04 ` [PATCH 12/16] [ARM] pxa/corgi: use generic GPIO API and remove pxa_gpio_mode() Eric Miao
2010-01-11 14:04 ` [PATCH 13/16] [ARM] pxa/spitz: " Eric Miao
2010-01-11 14:04 ` [PATCH 14/16] [ARM] pxa: fix irq suspend/resume for pxa25x Eric Miao
2010-01-11 14:04 ` [PATCH 15/16] [ARM] pxa: add MFP_LPM_KEEP_OUTPUT flag to pin config Eric Miao
2010-01-11 14:04 ` [PATCH 16/16] [ARM] pxa/corgi: cleanup GPIO configurations and low power mode settings Eric Miao

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=4B4B418E.6050909@compulab.co.il \
    --to=mike@compulab.co.il \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.