linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: dmitry.torokhov@gmail.com (Dmitry Torokhov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] ARM: eukrea_mbimx27-baseboard - use stock get_pendown_state() in ads7846
Date: Tue, 4 Dec 2012 13:09:22 -0800	[thread overview]
Message-ID: <20121204210922.GA8620@core.coreip.homeip.net> (raw)
In-Reply-To: <20121127090356.GA25658@core.coreip.homeip.net>

On Tue, Nov 27, 2012 at 01:03:56AM -0800, Dmitry Torokhov wrote:
> The default implementation matches exactly our custom one so we can switch
> to using the default one. As a bonus the driver will take care of setting
> GPIO line for us.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Eric, Sascha, could I get a formal ack on this one please ?

> ---
> 
> Adjusted to use IMX_GPIO_NR() macro.
> 
>  arch/arm/mach-imx/eukrea_mbimx27-baseboard.c |   19 +------------------
>  1 file changed, 1 insertion(+), 18 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
> index 98aef57..f361143 100644
> --- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
> +++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
> @@ -238,24 +238,8 @@ static const struct imxuart_platform_data uart_pdata __initconst = {
>  	.flags = IMXUART_HAVE_RTSCTS,
>  };
>  
> -#define ADS7846_PENDOWN (GPIO_PORTD | 25)
> -
> -static void __maybe_unused ads7846_dev_init(void)
> -{
> -	if (gpio_request(ADS7846_PENDOWN, "ADS7846 pendown") < 0) {
> -		printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
> -		return;
> -	}
> -	gpio_direction_input(ADS7846_PENDOWN);
> -}
> -
> -static int ads7846_get_pendown_state(void)
> -{
> -	return !gpio_get_value(ADS7846_PENDOWN);
> -}
> -
>  static struct ads7846_platform_data ads7846_config __initdata = {
> -	.get_pendown_state	= ads7846_get_pendown_state,
> +	.gpio_pendown		= IMX_GPIO_NR(4, 25),
>  	.keep_vref_on		= 1,
>  };
>  
> @@ -323,7 +307,6 @@ void __init eukrea_mbimx27_baseboard_init(void)
>  	|| defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
>  	/* ADS7846 Touchscreen controller init */
>  	mxc_gpio_mode(GPIO_PORTD | 25 | GPIO_GPIO | GPIO_IN);
> -	ads7846_dev_init();
>  #endif
>  
>  	/* SPI_CS0 init */

-- 
Dmitry

  reply	other threads:[~2012-12-04 21:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-24  8:25 [PATCH] ARM: eukrea_mbimx27-baseboard - use stock get_pendown_state() in ads7846 Dmitry Torokhov
2012-11-27  7:42 ` Sascha Hauer
2012-11-27  8:00   ` Eric Bénard
2012-11-27  9:03   ` [PATCH v2] " Dmitry Torokhov
2012-12-04 21:09     ` Dmitry Torokhov [this message]
2012-12-04 21:32       ` Eric Bénard
2012-12-08 11:16     ` Sascha Hauer
2012-12-08 19:45       ` Fabio Estevam

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=20121204210922.GA8620@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).