All of lore.kernel.org
 help / color / mirror / Atom feed
From: ckeepax@opensource.wolfsonmicro.com (Charles Keepax)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: bcm2835: Add header file for pinctrl constants
Date: Sun, 22 Feb 2015 21:31:31 +0000	[thread overview]
Message-ID: <20150222213131.GA9837@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <5700696.0jJhSRhno5@wuerfel>

On Sun, Feb 22, 2015 at 09:13:23PM +0100, Arnd Bergmann wrote:
> On Sunday 22 February 2015 16:59:56 Charles Keepax wrote:
> > +
> > +/* IRQ Flags */
> > +#define BCM2835_PIN_IRQ_RISING                         1
> > +#define BCM2835_PIN_IRQ_FALLING                                2
> > +#define BCM2835_PIN_IRQ_EDGE   (BCM2835_PIN_IRQ_RISING | \
> > +                                BCM2835_PIN_IRQ_FALLING)
> > +#define BCM2835_PIN_IRQ_LOW                            4
> > +#define BCM2835_PIN_IRQ_HIGH                           8
> 
> Are these different from the standard definitions?
> 
> > +/* Pin Function Settings */
> > +#define BCM2835_PIN_FUNC_GPIO_IN                       0
> > +#define BCM2835_PIN_FUNC_GPIO_OUT                      1
> > +#define BCM2835_PIN_FUNC_ALT5                          2
> > +#define BCM2835_PIN_FUNC_ALT4                          3
> > +#define BCM2835_PIN_FUNC_ALT0                          4
> > +#define BCM2835_PIN_FUNC_ALT1                          5
> > +#define BCM2835_PIN_FUNC_ALT2                          6
> > +#define BCM2835_PIN_FUNC_ALT3                          7
> 
> Why are these required? They don't seem to be used by any driver,
> which leads me to suspect that they are just the hardware numbers.
> 
> In that case, don't add any syntactical sugar like that and just
> use the hardware numbers directly.

Yeah they are just hardware numbers, I wasn't aware there was a
preference to use the numbers directly in which case just ignore
this patch.

> 
> What's with the strange mapping of numbers anyway?

You would need to ask Broadcom that :-)

Thanks,
Charles

WARNING: multiple messages have this Message-ID (diff)
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: swarren@wwwdotorg.org, lee@kernel.org, linux@arm.linux.org.uk,
	robh+dt@kernel.org, pawel.moll@arm.com, galak@codeaurora.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-rpi-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: bcm2835: Add header file for pinctrl constants
Date: Sun, 22 Feb 2015 21:31:31 +0000	[thread overview]
Message-ID: <20150222213131.GA9837@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <5700696.0jJhSRhno5@wuerfel>

On Sun, Feb 22, 2015 at 09:13:23PM +0100, Arnd Bergmann wrote:
> On Sunday 22 February 2015 16:59:56 Charles Keepax wrote:
> > +
> > +/* IRQ Flags */
> > +#define BCM2835_PIN_IRQ_RISING                         1
> > +#define BCM2835_PIN_IRQ_FALLING                                2
> > +#define BCM2835_PIN_IRQ_EDGE   (BCM2835_PIN_IRQ_RISING | \
> > +                                BCM2835_PIN_IRQ_FALLING)
> > +#define BCM2835_PIN_IRQ_LOW                            4
> > +#define BCM2835_PIN_IRQ_HIGH                           8
> 
> Are these different from the standard definitions?
> 
> > +/* Pin Function Settings */
> > +#define BCM2835_PIN_FUNC_GPIO_IN                       0
> > +#define BCM2835_PIN_FUNC_GPIO_OUT                      1
> > +#define BCM2835_PIN_FUNC_ALT5                          2
> > +#define BCM2835_PIN_FUNC_ALT4                          3
> > +#define BCM2835_PIN_FUNC_ALT0                          4
> > +#define BCM2835_PIN_FUNC_ALT1                          5
> > +#define BCM2835_PIN_FUNC_ALT2                          6
> > +#define BCM2835_PIN_FUNC_ALT3                          7
> 
> Why are these required? They don't seem to be used by any driver,
> which leads me to suspect that they are just the hardware numbers.
> 
> In that case, don't add any syntactical sugar like that and just
> use the hardware numbers directly.

Yeah they are just hardware numbers, I wasn't aware there was a
preference to use the numbers directly in which case just ignore
this patch.

> 
> What's with the strange mapping of numbers anyway?

You would need to ask Broadcom that :-)

Thanks,
Charles

  reply	other threads:[~2015-02-22 21:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-22 16:59 [PATCH] ARM: bcm2835: Add header file for pinctrl constants Charles Keepax
2015-02-22 16:59 ` Charles Keepax
2015-02-22 20:13 ` Arnd Bergmann
2015-02-22 20:13   ` Arnd Bergmann
2015-02-22 21:31   ` Charles Keepax [this message]
2015-02-22 21:31     ` Charles Keepax
2015-02-23 19:11   ` Stephen Warren
2015-02-23 19:11     ` Stephen Warren
2015-02-23 19:08 ` Stephen Warren
2015-02-23 19:08   ` Stephen Warren
2015-02-23 19:08   ` Stephen Warren

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=20150222213131.GA9837@opensource.wolfsonmicro.com \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --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.