All of lore.kernel.org
 help / color / mirror / Atom feed
From: Warner Losh <imp-uzTCJ5RojNnQT0dZR+AlfA@public.gmane.org>
To: Jean-Christophe PLAGNIOL-VILLARD
	<plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 05/14] ARM: at91: add pinctrl support
Date: Thu, 16 Aug 2012 09:15:18 -0600	[thread overview]
Message-ID: <2ABEF8B7-7F9C-4A5F-8303-0196970CA300@bsdimp.com> (raw)
In-Reply-To: <20120816121852.GA7439-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>


On Aug 16, 2012, at 6:18 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:

> On 16:38 Wed 15 Aug     , Linus Walleij wrote:
>>> +static void at91_mux_pio3_set_A_periph(void __iomem *pio, unsigned mask)
>>> +{
>>> +
>>> +       __raw_writel(__raw_readl(pio + PIO_ABCDSR1) & ~mask,
>>> +                                               pio + PIO_ABCDSR1);
>>> +       __raw_writel(__raw_readl(pio + PIO_ABCDSR2) & ~mask,
>>> +                                               pio + PIO_ABCDSR2);
>>> +}
>>> +
>>> +static void at91_mux_pio3_set_B_periph(void __iomem *pio, unsigned mask)
>>> +{
>>> +       __raw_writel(__raw_readl(pio + PIO_ABCDSR1) | mask,
>>> +                                               pio + PIO_ABCDSR1);
>>> +       __raw_writel(__raw_readl(pio + PIO_ABCDSR2) & ~mask,
>>> +                                               pio + PIO_ABCDSR2);
>>> +}
>>> +
>>> +static void at91_mux_set_A_periph(void __iomem *pio, unsigned mask)
>>> +{
>>> +       __raw_writel(mask, pio + PIO_ASR);
>>> +}
>>> +
>>> +static void at91_mux_set_B_periph(void __iomem *pio, unsigned mask)
>>> +{
>>> +       __raw_writel(mask, pio + PIO_BSR);
>>> +}
>>> +
>>> +static void at91_mux_set_C_periph(void __iomem *pio, unsigned mask)
>>> +{
>>> +       __raw_writel(__raw_readl(pio + PIO_ABCDSR1) & ~mask, pio + PIO_ABCDSR1);
>>> +       __raw_writel(__raw_readl(pio + PIO_ABCDSR2) | mask, pio + PIO_ABCDSR2);
>>> +}
>>> +
>>> +static void at91_mux_set_D_periph(void __iomem *pio, unsigned mask)
>>> +{
>>> +       __raw_writel(__raw_readl(pio + PIO_ABCDSR1) | mask, pio + PIO_ABCDSR1);
>>> +       __raw_writel(__raw_readl(pio + PIO_ABCDSR2) | mask, pio + PIO_ABCDSR2);
>>> +}
>> 
>> I have no clue whatsoever what is going on here, A? B? C? D?
>> Some small comment or something giving a hint about this grouping
>> system and how it works would be really nice.
> periph (mux)
>> 

You should read it in the context that's there.  'A_periph', 'B_periph', etc.  These functions select what device is connected to a given pin.  These are designated A, B, C, or D in the data sheets.  The overloading of PIO names with letters and Peripheral names with letters is mildly confusion in the Atmel datasheets, but is something one quickly gets used to.  Adding a one line comment wouldn't hurt here.  Maybe '/* Select proper peripheral for pin mux. */'

No comments on the rest of the patch, since I've only seen the replies to the original and can't find it any of the archives.  From what was quoted, however, this looks like a giant leap forward.  DT in 3.5 looked to be very limited, and this is one of the last pieces needed to avoid any board specific files in the general case.  I'm glad to see it coming along.

Warner

WARNING: multiple messages have this Message-ID (diff)
From: imp@bsdimp.com (Warner Losh)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 05/14] ARM: at91: add pinctrl support
Date: Thu, 16 Aug 2012 09:15:18 -0600	[thread overview]
Message-ID: <2ABEF8B7-7F9C-4A5F-8303-0196970CA300@bsdimp.com> (raw)
In-Reply-To: <20120816121852.GA7439@game.jcrosoft.org>


On Aug 16, 2012, at 6:18 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:

> On 16:38 Wed 15 Aug     , Linus Walleij wrote:
>>> +static void at91_mux_pio3_set_A_periph(void __iomem *pio, unsigned mask)
>>> +{
>>> +
>>> +       __raw_writel(__raw_readl(pio + PIO_ABCDSR1) & ~mask,
>>> +                                               pio + PIO_ABCDSR1);
>>> +       __raw_writel(__raw_readl(pio + PIO_ABCDSR2) & ~mask,
>>> +                                               pio + PIO_ABCDSR2);
>>> +}
>>> +
>>> +static void at91_mux_pio3_set_B_periph(void __iomem *pio, unsigned mask)
>>> +{
>>> +       __raw_writel(__raw_readl(pio + PIO_ABCDSR1) | mask,
>>> +                                               pio + PIO_ABCDSR1);
>>> +       __raw_writel(__raw_readl(pio + PIO_ABCDSR2) & ~mask,
>>> +                                               pio + PIO_ABCDSR2);
>>> +}
>>> +
>>> +static void at91_mux_set_A_periph(void __iomem *pio, unsigned mask)
>>> +{
>>> +       __raw_writel(mask, pio + PIO_ASR);
>>> +}
>>> +
>>> +static void at91_mux_set_B_periph(void __iomem *pio, unsigned mask)
>>> +{
>>> +       __raw_writel(mask, pio + PIO_BSR);
>>> +}
>>> +
>>> +static void at91_mux_set_C_periph(void __iomem *pio, unsigned mask)
>>> +{
>>> +       __raw_writel(__raw_readl(pio + PIO_ABCDSR1) & ~mask, pio + PIO_ABCDSR1);
>>> +       __raw_writel(__raw_readl(pio + PIO_ABCDSR2) | mask, pio + PIO_ABCDSR2);
>>> +}
>>> +
>>> +static void at91_mux_set_D_periph(void __iomem *pio, unsigned mask)
>>> +{
>>> +       __raw_writel(__raw_readl(pio + PIO_ABCDSR1) | mask, pio + PIO_ABCDSR1);
>>> +       __raw_writel(__raw_readl(pio + PIO_ABCDSR2) | mask, pio + PIO_ABCDSR2);
>>> +}
>> 
>> I have no clue whatsoever what is going on here, A? B? C? D?
>> Some small comment or something giving a hint about this grouping
>> system and how it works would be really nice.
> periph (mux)
>> 

You should read it in the context that's there.  'A_periph', 'B_periph', etc.  These functions select what device is connected to a given pin.  These are designated A, B, C, or D in the data sheets.  The overloading of PIO names with letters and Peripheral names with letters is mildly confusion in the Atmel datasheets, but is something one quickly gets used to.  Adding a one line comment wouldn't hurt here.  Maybe '/* Select proper peripheral for pin mux. */'

No comments on the rest of the patch, since I've only seen the replies to the original and can't find it any of the archives.  From what was quoted, however, this looks like a giant leap forward.  DT in 3.5 looked to be very limited, and this is one of the last pieces needed to avoid any board specific files in the general case.  I'm glad to see it coming along.

Warner

  parent reply	other threads:[~2012-08-16 15:15 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-10 12:48 [PATCH 00/14] ARM: at91: add pinctrl support Jean-Christophe PLAGNIOL-VILLARD
2012-08-10 13:01 ` [PATCH 01/14] ARM: at91: gpio: implement request and free Jean-Christophe PLAGNIOL-VILLARD
2012-08-10 13:01   ` [PATCH 02/14] at91: regroup gpio and pinctrl under a simple-bus Jean-Christophe PLAGNIOL-VILLARD
2012-08-15  8:52     ` Linus Walleij
2012-08-18 21:14     ` Arnd Bergmann
2012-08-10 13:02   ` [PATCH 03/14] arm: at91: at91sam9x5: fix gpio number per bank Jean-Christophe PLAGNIOL-VILLARD
2012-08-15  8:54     ` Linus Walleij
2012-09-11 10:21       ` Nicolas Ferre
2012-08-18 21:18     ` Arnd Bergmann
2012-08-20  8:02       ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-10 13:02   ` [PATCH 04/14] ARM: at91: add dummies pinctrl for non dt platform Jean-Christophe PLAGNIOL-VILLARD
2012-08-15  8:55     ` Linus Walleij
2012-09-11 10:22       ` Nicolas Ferre
2012-08-10 13:02   ` [PATCH 05/14] ARM: at91: add pinctrl support Jean-Christophe PLAGNIOL-VILLARD
2012-08-13 14:53     ` Richard Genoud
2012-08-14  2:37       ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-14  7:24         ` Richard Genoud
     [not found]     ` <1344603731-32667-5-git-send-email-plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>
2012-08-15 14:38       ` Linus Walleij
2012-08-15 14:38         ` Linus Walleij
2012-08-16 12:18         ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-16 12:18           ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]           ` <20120816121852.GA7439-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
2012-08-16 15:15             ` Warner Losh [this message]
2012-08-16 15:15               ` Warner Losh
     [not found]         ` <CACRpkdZ2__V06Eo8JH451Sup5Nw2jJXVOH2FOfZBp5nNYpCtbg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-08-22 15:34           ` Stephen Warren
2012-08-22 15:34             ` Stephen Warren
     [not found]             ` <5034FC18.2090400-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-08-23  7:06               ` Richard Genoud
2012-08-23  7:06                 ` Richard Genoud
     [not found]                 ` <CACQ1gAieByr5vMmyyCuGtS8AgnnRZPPhLZY8sKvwvcQYe5ieUA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-08-23 17:49                   ` Stephen Warren
2012-08-23 17:49                     ` Stephen Warren
2012-08-25  8:38                     ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-25  8:38                       ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]                       ` <20120825083811.GB7629-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
2012-08-27 23:46                         ` Linus Walleij
2012-08-27 23:46                           ` Linus Walleij
     [not found]                           ` <CACRpkdYWXZLNdgMhqoMZsaaszZ5Uz9pZ1EO=mrnuY5Der4O+Mw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-08-28  6:51                             ` Richard Genoud
2012-08-28  6:51                               ` Richard Genoud
2012-09-11 10:27     ` Nicolas Ferre
2012-08-10 13:02   ` [PATCH 06/14] arm: at91: dt: at91sam9 " Jean-Christophe PLAGNIOL-VILLARD
2012-08-15  8:57     ` Linus Walleij
2012-08-17 15:39       ` Richard Genoud
2012-08-20 14:09     ` Richard Genoud
2012-08-20 15:11       ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-20 15:43         ` Richard Genoud
2012-09-11 10:29     ` Nicolas Ferre
2012-08-10 13:02   ` [PATCH 07/14] arm: at91: dt: at91sam9 add serial " Jean-Christophe PLAGNIOL-VILLARD
2012-08-15  9:00     ` Linus Walleij
2012-09-11 10:30     ` Nicolas Ferre
2012-08-10 13:02   ` [PATCH 08/14] tty: atmel_serial: add " Jean-Christophe PLAGNIOL-VILLARD
2012-08-10 13:02     ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-10 16:10     ` Greg KH
2012-08-10 16:10       ` Greg KH
2012-08-15  9:01     ` Linus Walleij
2012-08-15  9:01       ` Linus Walleij
2012-09-11 10:33     ` Nicolas Ferre
2012-09-11 10:33       ` Nicolas Ferre
2012-08-10 13:02   ` [PATCH 09/14] arm: at91: dt: sam9m10g45ek: use rts/cts pinctrl group for uart1 Jean-Christophe PLAGNIOL-VILLARD
2012-08-15  9:02     ` Linus Walleij
2012-09-11 10:34     ` Nicolas Ferre
2012-08-10 13:02   ` [PATCH 10/14] arm: at91: dt: sam9263ek: use rts/cts pinctrl group for uart0 Jean-Christophe PLAGNIOL-VILLARD
2012-08-15  9:02     ` Linus Walleij
2012-09-11 10:34     ` Nicolas Ferre
2012-08-10 13:02   ` [PATCH 11/14] arm: at91: dt: sam9g20ek: use rts/cts/dtr/dsr/dcd/ri " Jean-Christophe PLAGNIOL-VILLARD
2012-08-15  9:03     ` Linus Walleij
2012-09-11 10:36     ` Nicolas Ferre
2012-08-10 13:02   ` [PATCH 12/14] MTD: atmel nand: fix gpio missing request Jean-Christophe PLAGNIOL-VILLARD
2012-08-15  9:05     ` Linus Walleij
2012-08-10 13:02   ` [PATCH 13/14] arm: at91: dt: at91sam9 add nand pinctrl support Jean-Christophe PLAGNIOL-VILLARD
2012-08-15  9:06     ` Linus Walleij
2012-08-16 15:19       ` Richard Genoud
2012-08-16 17:38         ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-17  6:53           ` Richard Genoud
2012-08-20  7:58             ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-10 13:02   ` [PATCH 14/14] MTD: atmel_nand: add pinctrl consumer support Jean-Christophe PLAGNIOL-VILLARD
2012-08-10 13:02     ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-15  9:07     ` Linus Walleij
2012-08-15  9:07       ` Linus Walleij
2012-08-24 11:51     ` Artem Bityutskiy
2012-08-24 11:51       ` Artem Bityutskiy
2012-08-15  8:51   ` [PATCH 01/14] ARM: at91: gpio: implement request and free Linus Walleij

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=2ABEF8B7-7F9C-4A5F-8303-0196970CA300@bsdimp.com \
    --to=imp-uztcj5rojnnqt0dzr+alfa@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.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.