From: kmpark@infradead.org (Kyungmin Park)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 12/12] [ARM][S3C6410] Add support gpio function for keypad device
Date: Mon, 7 Sep 2009 08:51:59 +0900 [thread overview]
Message-ID: <9c9fda240909061651y68dd8579r6cea25638ea120f1@mail.gmail.com> (raw)
In-Reply-To: <00ab01ca2e2d$1b52fcf0$51f8f6d0$%yang@samsung.com>
2009/9/5 ??? <jsgood.yang@samsung.com>:
> This patch includes machine specific gpio function for keypad device
> which can be changed by platform hardware. The gpio function is
> related with keypad platform info such as rows and columns of
> those matrix.
>
> Signed-off-by: Jinsung Yang <jsgood.yang@samsung.com>
> Signed-off-by: Kyeongil Kim <ki0351.kim@samsung.com>
> ---
> ?arch/arm/mach-s3c6410/mach-smdk6410.c | ? 23 +++++++++++++++++++++++
> ?1 files changed, 23 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c
> index 95e130d..f297c26 100644
> --- a/arch/arm/mach-s3c6410/mach-smdk6410.c
> +++ b/arch/arm/mach-s3c6410/mach-smdk6410.c
> @@ -347,6 +347,28 @@ static struct s3c_platform_keypad keypad_data __initdata = {
> ? ? ? ?.delay = 50,
> ?};
I thinks it's not a good idea to place s3c6410 generic function to
board file. please move it platform or mach-s3c6410.
>
> +static void s3c_keypad_cfg_gpio(int rows, int columns)
> +{
> + ? ? ? unsigned int gpio;
> + ? ? ? unsigned int end;
> +
> + ? ? ? end = S3C64XX_GPK(8 + rows);
> +
> + ? ? ? /* Set all the necessary GPK pins to special-function 0 */
special-function 3?
> + ? ? ? for (gpio = S3C64XX_GPK(8); gpio < end; gpio++) {
> + ? ? ? ? ? ? ? s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
> + ? ? ? ? ? ? ? s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
> + ? ? ? }
> +
> + ? ? ? end = S3C64XX_GPL(0 + columns);
> +
> + ? ? ? /* Set all the necessary GPK pins to special-function 0 */
ditto
> + ? ? ? for (gpio = S3C64XX_GPL(0); gpio < end; gpio++) {
> + ? ? ? ? ? ? ? s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
> + ? ? ? ? ? ? ? s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
> + ? ? ? }
> +}
> +
> ?static void __init smdk6410_map_io(void)
> ?{
> ? ? ? ?u32 tmp;
> @@ -382,6 +404,7 @@ static void __init smdk6410_machine_init(void)
> ? ? ? ?i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
>
> ? ? ? ?s3c_keypad_set_platdata(&keypad_data);
> + ? ? ? s3c_keypad_cfg_gpio(keypad_data.nr_rows, keypad_data.nr_cols);
>
> ? ? ? ?platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices));
> ?}
> --
> 1.6.2.5
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
next prev parent reply other threads:[~2009-09-06 23:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-05 13:30 [PATCH 12/12] [ARM][S3C6410] Add support gpio function for keypad device 양진성
2009-09-05 14:13 ` Jinsung Yang
2009-09-05 14:49 ` Ben Dooks
2009-09-06 23:51 ` Kyungmin Park [this message]
2009-09-07 10:04 ` Jinsung Yang
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=9c9fda240909061651y68dd8579r6cea25638ea120f1@mail.gmail.com \
--to=kmpark@infradead.org \
--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).