linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: kmpark@infradead.org (Kyungmin Park)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/4] Pinmux subsystem
Date: Tue, 17 May 2011 10:57:11 +0900	[thread overview]
Message-ID: <BANLkTi=TDiAziQU0fYBiK_Npk0x50av7tA@mail.gmail.com> (raw)
In-Reply-To: <BANLkTi=O_mZEqMhOS_Fz0vAYCQ-XpyG4UA@mail.gmail.com>

Hi,

In real scenario, we can set the full pins at once, but sometimes it
needs to set the function only one,

e.g.,

static void __init goni_radio_init(void)
{
        int gpio;

        gpio = S5PV210_GPJ2(4);                 /* XMSMDATA_4 */
        gpio_request(gpio, "FM_INT");
        s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
        i2c1_devs[0].irq = gpio_to_irq(gpio);

        gpio = S5PV210_GPJ2(5);                 /* XMSMDATA_5 */
        gpio_request(gpio, "FM_RST");
        gpio_direction_output(gpio, 1);
}

In this case we only need to set the function at interrupt by like
s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
So pinmux function provides this feature also.

How do you think?

Thank you,
Kyungmin Park


On Mon, May 16, 2011 at 2:50 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
> 2011/5/15 Andrew Lunn <andrew@lunn.ch>:
>
>> With a bit of scripting, came to the following results. Each line is
>> on pinmux function description what would be needed in the driver. The
>> number at the front says how many boards would use it. In total there
>> are 33 descriptions needed. Of these, 18 are used only once. This to
>> me suggests the board needs to be able to specify a pin description
>> when there is no reuse with other boards.
>
> As indicated elsewhere in this thread, a pinmux driver can pass in
> platform/package/board/system data just like any other platform
> driver in the kernel tree can.
>
> You will have to specify it somehow in a custom header file, just
> like with any other platform driver.
>
> Example from:
> arch/arm/mach-orion5x/ls-chl-setup.c:
>
> static struct gpio_led lschl_led_pins[] = {
> ? ? ? ?{
> ? ? ? ? ? ? ? ?.name = "alarm:red",
> ? ? ? ? ? ? ? ?.gpio = LSCHL_GPIO_LED_ALARM,
> ? ? ? ? ? ? ? ?.active_low = 1,
> ? ? ? ?}, {
> ? ? ? ? ? ? ? ?.name = "info:amber",
> ? ? ? ? ? ? ? ?.gpio = LSCHL_GPIO_LED_INFO,
> ? ? ? ? ? ? ? ?.active_low = 1,
> ? ? ? ?}, {
> ? ? ? ? ? ? ? ?.name = "func:blue:top",
> ? ? ? ? ? ? ? ?.gpio = LSCHL_GPIO_LED_FUNC,
> ? ? ? ? ? ? ? ?.active_low = 1,
> ? ? ? ?}, {
> ? ? ? ? ? ? ? ?.name = "power:blue:bottom",
> ? ? ? ? ? ? ? ?.gpio = LSCHL_GPIO_LED_PWR,
> ? ? ? ?},
> };
>
> static struct gpio_led_platform_data lschl_led_data = {
> ? ? ? ?.leds = lschl_led_pins,
> ? ? ? ?.num_leds = ARRAY_SIZE(lschl_led_pins),
> };
>
> static struct platform_device lschl_leds = {
> ? ? ? ?.name = "leds-gpio",
> ? ? ? ?.id = -1,
> ? ? ? ?.dev = {
> ? ? ? ? ? ? ? ?.platform_data = &lschl_led_data,
> ? ? ? ?},
> };
>
> Still, the driver for these LEDs is in
> drivers/leds/leds-gpio.c and the above structure is
> described in include/linux/leds.h
>
> There is no difference between this and letting
> drivers/pinmux/pinmux-orion.c have a header file in
> include/linux/pinmux/orion.h and pass in necessary board
> data that way.
>
> Are we now in agreement that this will work just fine?
>
> Yours,
> Linus Walleij
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at ?http://www.tux.org/lkml/
>

  reply	other threads:[~2011-05-17  1:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-02 19:16 [PATCH 0/4] Pinmux subsystem Linus Walleij
2011-05-02 22:57 ` Russell King - ARM Linux
2011-05-10 21:25   ` Linus Walleij
2011-05-10 21:45     ` Russell King - ARM Linux
2011-05-10 23:15       ` Linus Walleij
2011-05-03 17:27 ` Andrew Lunn
2011-05-03 19:29   ` Valdis.Kletnieks at vt.edu
2011-05-10 21:42   ` Linus Walleij
2011-05-11  9:50     ` Andrew Lunn
2011-05-12  0:41       ` Linus Walleij
2011-05-12  7:00         ` Andrew Lunn
2011-05-15 13:33     ` Andrew Lunn
2011-05-15 17:50       ` Linus Walleij
2011-05-17  1:57         ` Kyungmin Park [this message]
2011-05-18 20:02           ` Linus Walleij
2011-05-18 21:21             ` Mark Brown
2011-05-12  7:44 ` Sascha Hauer
2011-05-12  9:40   ` Tony Lindgren
2011-05-12 14:02   ` Linus Walleij
2011-05-12 21:17     ` Matthieu Castet
2011-05-13  7:05       ` Linus Walleij
2011-05-13 16:03         ` Matthieu CASTET
2011-05-14  7:57           ` Linus Walleij
2011-05-13  9:59     ` Sascha Hauer

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='BANLkTi=TDiAziQU0fYBiK_Npk0x50av7tA@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).