All of lore.kernel.org
 help / color / mirror / Atom feed
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [patch v3 07/10] efikamx: add support for power key
Date: Wed, 27 Oct 2010 12:04:46 +0200	[thread overview]
Message-ID: <20101027100446.GC8554@pengutronix.de> (raw)
In-Reply-To: <87lj5k7ylx.fsf@lechat.rtp-net.org>

On Wed, Oct 27, 2010 at 11:51:06AM +0200, Arnaud Patard wrote:
> Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> writes:
> 
> > On Tue, Oct 26, 2010 at 10:07:30PM +0200, Arnaud Patard wrote:
> >> This patch adds support for power key button of the efika mx. It's connected
> >> on  GPIO 2 31.
> >> 
> >> Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
> >> 
> >> Index: linux-2.6-submit/arch/arm/mach-mx5/board-mx51_efikamx.c
> >> ===================================================================
> >> --- linux-2.6-submit.orig/arch/arm/mach-mx5/board-mx51_efikamx.c	2010-10-26 19:57:16.000000000 +0200
> >> +++ linux-2.6-submit/arch/arm/mach-mx5/board-mx51_efikamx.c	2010-10-26 19:59:16.000000000 +0200
> >> @@ -19,6 +19,8 @@
> >>  #include <linux/i2c.h>
> >>  #include <linux/gpio.h>
> >>  #include <linux/leds.h>
> >> +#include <linux/input.h>
> > Do you really need linux/input.h?
> >
> 
> You need it if you want to have KEY_POWER and EV_POWER definitions
ah, I see.
 
> >> +#include <linux/gpio_keys.h>
> > this is included by devices-common.h (which is included by
> > devices-imx51.h).  So you can drop this.
> >
> >>  #include <linux/delay.h>
> >>  #include <linux/io.h>
> >>  #include <linux/fsl_devices.h>
> >> @@ -48,10 +50,13 @@
> >>  #define EFIKAMX_GREEN_LED	(2*32 + 14)
> >>  #define EFIKAMX_RED_LED		(2*32 + 15)
> >>  
> >> +#define EFIKAMX_POWER_KEY	(1*32 + 31)
> >> +
> >>  /* the pci ids pin have pull up. they're driven low according to board id */
> >>  #define MX51_PAD_PCBID0	IOMUX_PAD(0x518, 0x130, 3, 0x0,   0, PAD_CTL_PUS_100K_UP)
> >>  #define MX51_PAD_PCBID1	IOMUX_PAD(0x51C, 0x134, 3, 0x0,   0, PAD_CTL_PUS_100K_UP)
> >>  #define MX51_PAD_PCBID2	IOMUX_PAD(0x504, 0x128, 3, 0x0,   0, PAD_CTL_PUS_100K_UP)
> >> +#define MX51_PAD_PWRKEY	IOMUX_PAD(0x48c, 0x0f8, 1, 0x0,   0, PAD_CTL_PUS_100K_UP | PAD_CTL_PKE)
> >>  
> >>  static struct pad_desc mx51efikamx_pads[] = {
> >>  	/* UART1 */
> >> @@ -91,6 +96,9 @@
> >>  	MX51_PAD_CSI1_D9__GPIO_3_13,
> >>  	MX51_PAD_CSI1_VSYNC__GPIO_3_14,
> >>  	MX51_PAD_CSI1_HSYNC__GPIO_3_15,
> >> +
> >> +	/* power key */
> >> +	MX51_PAD_PWRKEY,
> >>  };
> >>  
> >>  /* Serial ports */
> >> @@ -220,6 +228,22 @@
> >>  	},
> >>  };
> >>  
> >> +static struct gpio_keys_button mx51_efikamx_powerkey[] = {
> > this should be const and __initconst
> 
> I guess you meant this for the gpio_keys_platform_data struct instead of
> this one ?
oh, you're right.  Conceptually mx51_efikamx_powerkey should be const,
but probably marking it accordingly generates a compiler warning.

I assume there are no other keys on your machine?  If there are, you
might want to rename mx51_efikamx_powerkey_data and
mx51_efikamx_powerkey to something that doesn't include "power".
 
Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  reply	other threads:[~2010-10-27 10:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-26 20:07 [patch v3 00/10] efikamx support improvements - take 3 Arnaud Patard (Rtp)
2010-10-26 20:07 ` [patch v3 01/10] efikamx: read board id Arnaud Patard (Rtp)
2010-11-01 15:24   ` Nguyen Dinh-R00091
2010-11-01 20:05     ` Matt Sealey
2010-11-02  9:35     ` Arnaud Patard (Rtp)
2010-11-02 10:47       ` Uwe Kleine-König
2010-11-02 17:29         ` Sascha Hauer
2010-10-26 20:07 ` [patch v3 02/10] imx51: fix iomux configuration Arnaud Patard (Rtp)
2010-10-26 20:07 ` [patch v3 03/10] imx51: enhance iomux configuration for esdhc support Arnaud Patard (Rtp)
2010-10-26 20:07 ` [patch v3 04/10] efikamx: add mmc support Arnaud Patard (Rtp)
2010-10-27  7:37   ` Uwe Kleine-König
2010-10-26 20:07 ` [patch v3 05/10] imx51: add gpio mode for csi1 {h,v}sync Arnaud Patard (Rtp)
2010-10-26 20:07 ` [patch v3 06/10] efikamx: add leds support Arnaud Patard (Rtp)
2010-10-26 20:07 ` [patch v3 07/10] efikamx: add support for power key Arnaud Patard (Rtp)
2010-10-27  7:30   ` Uwe Kleine-König
2010-10-27  9:51     ` Arnaud Patard (Rtp)
2010-10-27 10:04       ` Uwe Kleine-König [this message]
2010-10-26 20:07 ` [patch v3 08/10] imx51: fix gpio_4_24 and gpio_4_25 pad configuration Arnaud Patard (Rtp)
2010-10-26 20:07 ` [patch v3 09/10] efikamx: add spi nor support Arnaud Patard (Rtp)
2010-10-26 20:07 ` [patch v3 10/10] efikamx: add reset Arnaud Patard (Rtp)
2010-10-27  7:36   ` Uwe Kleine-König
2010-10-27  9:59     ` Arnaud Patard (Rtp)

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=20101027100446.GC8554@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --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.