linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv5 2/3] ARM: imx: Add gpio-keys to plat-mxc
Date: Fri, 22 Oct 2010 20:28:12 +0200	[thread overview]
Message-ID: <20101022182812.GA8554@pengutronix.de> (raw)
In-Reply-To: <1287766575-4092-2-git-send-email-Dinh.Nguyen@freescale.com>

On Fri, Oct 22, 2010 at 11:56:14AM -0500, Dinh.Nguyen at freescale.com wrote:
> From: Dinh Nguyen <Dinh.Nguyen@freescale.com>
> 
> Add imx_add_gpio_keys function to add gpio-keys in plat-mxc
> 
> This patch is based on Sascha Hauer's imx/linux-2.6 for-rmk tree.
(This information isn't interesting once the patch is in git, so it can
better go after the tripple-dash below.)

> Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com>
Patch 1 depends on this one, so you should swap their order.

> ---
>  arch/arm/plat-mxc/devices/Kconfig               |    4 +++
>  arch/arm/plat-mxc/devices/Makefile              |    1 +
>  arch/arm/plat-mxc/devices/platform-gpio_keys.c  |   27 +++++++++++++++++++++++
>  arch/arm/plat-mxc/include/mach/devices-common.h |    4 +++
>  arch/arm/plat-mxc/include/mach/iomux-mx51.h     |    2 +-
>  5 files changed, 37 insertions(+), 1 deletions(-)
>  create mode 100644 arch/arm/plat-mxc/devices/platform-gpio_keys.c
> 
> diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig
> index 4047994..f4772e7 100644
> --- a/arch/arm/plat-mxc/devices/Kconfig
> +++ b/arch/arm/plat-mxc/devices/Kconfig
> @@ -9,6 +9,10 @@ config IMX_HAVE_PLATFORM_FLEXCAN
>  	select HAVE_CAN_FLEXCAN
>  	bool
>  
> +config IMX_HAVE_PLATFORM_GPIO_KEYS
> +	bool
> +	default y if ARCH_MX51
> +	
>  config IMX_HAVE_PLATFORM_IMX_I2C
>  	bool
>  
> diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile
> index 0a3c1f0..45aefeb 100644
> --- a/arch/arm/plat-mxc/devices/Makefile
> +++ b/arch/arm/plat-mxc/devices/Makefile
> @@ -1,6 +1,7 @@
>  obj-$(CONFIG_IMX_HAVE_PLATFORM_ESDHC) += platform-esdhc.o
>  obj-$(CONFIG_IMX_HAVE_PLATFORM_FEC) += platform-fec.o
>  obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o
> +obj-$(CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS) += platform-gpio_keys.o
>  obj-y += platform-imx-dma.o
>  obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o
>  obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o
> diff --git a/arch/arm/plat-mxc/devices/platform-gpio_keys.c b/arch/arm/plat-mxc/devices/platform-gpio_keys.c
> new file mode 100644
> index 0000000..1c53a53
> --- /dev/null
> +++ b/arch/arm/plat-mxc/devices/platform-gpio_keys.c
> @@ -0,0 +1,27 @@
> +/*
> + * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version 2
> + * of the License, or (at your option) any later version.
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor,
> + * Boston, MA  02110-1301, USA.
> + */
> +#include <asm/sizes.h>
> +#include <mach/hardware.h>
> +#include <mach/devices-common.h>
> +
> +struct platform_device *__init imx_add_gpio_keys(
> +		const struct gpio_keys_platform_data *pdata)
> +{
> +	return imx_add_platform_device("gpio-keys", -1, NULL,
> +		 0, pdata, sizeof(*pdata));
> +}
> diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
> index 86d7575..8c6896f 100644
> --- a/arch/arm/plat-mxc/include/mach/devices-common.h
> +++ b/arch/arm/plat-mxc/include/mach/devices-common.h
> @@ -29,6 +29,10 @@ struct platform_device *__init imx_add_flexcan(int id,
>  		resource_size_t irq,
>  		const struct flexcan_platform_data *pdata);
>  
> +#include <linux/gpio_keys.h>
> +struct platform_device *__init imx_add_gpio_keys(
> +		const struct gpio_keys_platform_data *pdata);
> +
>  #include <mach/i2c.h>
>  struct imx_imx_i2c_data {
>  	int id;
> diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx51.h b/arch/arm/plat-mxc/include/mach/iomux-mx51.h
> index e46b1c2..7ae27e8 100644
> --- a/arch/arm/plat-mxc/include/mach/iomux-mx51.h
> +++ b/arch/arm/plat-mxc/include/mach/iomux-mx51.h
> @@ -114,7 +114,7 @@ typedef enum iomux_config {
>  #define MX51_PAD_EIM_A24__GPIO_2_18             IOMUX_PAD(0x450, 0x0bc, 1, 0x0,   0, NO_PAD_CTRL)
>  #define MX51_PAD_EIM_A25__GPIO_2_19             IOMUX_PAD(0x454, 0x0c0, 1, 0x0,   0, NO_PAD_CTRL)
>  #define MX51_PAD_EIM_A26__GPIO_2_20             IOMUX_PAD(0x458, 0x0c4, 1, 0x0,   0, NO_PAD_CTRL)
> -#define MX51_PAD_EIM_A27__GPIO_2_21             IOMUX_PAD(0x45c, 0x0c8, 1, 0x0,   0, NO_PAD_CTRL)
> +#define MX51_PAD_EIM_A27__GPIO_2_21             IOMUX_PAD(0x45c, 0x0c8, 1, 0x0,   0, MX51_GPIO_PAD_CTRL | PAD_CTL_PUS_100K_UP)
I share the concerns of Arnaud.  MX51_GPIO_PAD_CTRL looks OK,
PAD_CTL_PUS_100K_UP does not.

>  #define MX51_PAD_EIM_EB0__EIM_EB0               IOMUX_PAD(0x460, 0x0cc, 0, 0x0,   0, NO_PAD_CTRL)
>  #define MX51_PAD_EIM_EB1__EIM_EB1               IOMUX_PAD(0x464, 0x0d0, 0, 0x0,   0, NO_PAD_CTRL)
>  #define MX51_PAD_EIM_EB2__GPIO_2_22             IOMUX_PAD(0x468, 0x0d4, 1, 0x0,   0, NO_PAD_CTRL)

Best regards
Uwe

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

  parent reply	other threads:[~2010-10-22 18:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-22 16:56 [PATCHv5 1/3] ARM: mx5: Add gpio-keys to mx51 babbage board Dinh.Nguyen at freescale.com
2010-10-22 16:56 ` [PATCHv5 2/3] ARM: imx: Add gpio-keys to plat-mxc Dinh.Nguyen at freescale.com
2010-10-22 16:56   ` [PATCHv5 3/3] ARM: imx: Add wake functionality to GPIO Dinh.Nguyen at freescale.com
2010-10-22 18:28   ` Uwe Kleine-König [this message]
2010-10-22 18:58     ` [PATCHv5 2/3] ARM: imx: Add gpio-keys to plat-mxc Nguyen Dinh-R00091
2010-10-22 19:42       ` Uwe Kleine-König
2010-10-23  2:43         ` Nguyen Dinh-R00091
2010-10-24  8:37           ` Lothar Waßmann
2010-10-24 19:20             ` Uwe Kleine-König
2010-10-25  7:02               ` Lothar Waßmann
2010-10-25  7:21                 ` Uwe Kleine-König
2010-10-26  9:07                   ` [PATCH RFC] MXC IOMUX-V3 replace struct pad_desc with bitmapped cookie Lothar Wa�mann
2010-10-26  9:07                     ` Lothar Wa�mann
2010-10-26  9:23                     ` Uwe Kleine-König
2010-10-26 12:28                       ` Lothar Waßmann
2010-10-26 14:16                     ` Sascha Hauer
2010-11-22  8:39                     ` [PATCH] MXC IOMUX-V3 replace struct pad_desc with bitmapped cookie (step 2) Lothar Waßmann
2010-11-22  9:16                       ` Uwe Kleine-König
2010-11-24 10:59                       ` Sascha Hauer
2010-10-22 17:51 ` [PATCHv5 1/3] ARM: mx5: Add gpio-keys to mx51 babbage board Amit Kucheria

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=20101022182812.GA8554@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 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).