From: "Andreas Bießmann" <andreas.devel@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH 1/3] at91: add new gpio pin macros
Date: Wed, 30 Oct 2013 19:59:08 +0100 [thread overview]
Message-ID: <527156FC.5040305@googlemail.com> (raw)
In-Reply-To: <52713FBD.202@scharsoft.de>
Hi Jens,
On 30.10.13 18:19, Jens Scharsig wrote:
> Am 30.10.2013 11:39, schrieb Andreas Bie?mann:
>> Hi Bo,
>>
>> +Jens, he did the rewrite of the at91 gpio driver.
>>
>
>>
>> I think this is a job for gpio_is_valid() then. How is this case handled
>> in kernel?
>>
>> Here are a few things to discuss. First of all I'd like to get some
>> insights why the at91 gpio API was changed back in 2010. It was a plain
>> number before and was changed to PORT + PIN as two separate parameters.
>> Jens, could you please shed some light on this?
>>
>
> Sorry, but I don't remember me why we do this. I think, it was a
> compromise between number of changes and code size.
found it:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/74579
---8<---
Jens Scharsig wrote:
> +#endif
> +
> +#define AT91_PIN_TO_MASK(x) (1<<x)
> +#define AT91_PORTPIN(PORT, PIN) ((0x0##PORT - 9) * 32 + ((PIN) & 0x1F))
> +#define AT91_PIO_PORTA 0x0
> +#define AT91_PIO_PORTB 0x1
> +#define AT91_PIO_PORTC 0x2
> +#define AT91_PIO_PORTD 0x3
> +#define AT91_PIO_PORTE 0x4
> +
Tom.Rix at windriver.com:
Is this necessary?
You are packing arguments that you are passing to the gpio functions.
It would be better if there were seperate port, pin parameters than
combining and then uncombining.
Please change this.
--->8---
I think we should shift toward the linux kernel at91_pio API which uses
a single number for identifying the GPIO. Any complaints?
I think it would make sense to retain some PORT + MASK functions to
easily switch multiple I/O in one go. What do you think about?
Best regards
Andreas Bie?mann
next prev parent reply other threads:[~2013-10-30 18:59 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-29 12:53 [U-Boot] [RFC PATCH 0/3] at91: remove legacy gpio API Andreas Bießmann
2013-10-29 12:53 ` [U-Boot] [RFC PATCH 1/3] at91: add new gpio pin macros Andreas Bießmann
2013-10-30 9:56 ` Bo Shen
2013-10-30 10:39 ` Andreas Bießmann
2013-10-30 17:19 ` Jens Scharsig
2013-10-30 18:59 ` Andreas Bießmann [this message]
2013-10-31 5:04 ` Heiko Schocher
2013-10-29 12:53 ` [U-Boot] [RFC PATCH 2/3] at91sam9263ek: remove ATMEL_LEGACY Andreas Bießmann
2013-10-29 12:53 ` [U-Boot] [RFC PATCH 3/3] at91: use generic gpio API for AT91_LED Andreas Bießmann
2013-11-29 11:13 ` [U-Boot] [PATCH 0/4] at91: remove legacy GPIO API (part 1) Andreas Bießmann
2013-11-29 11:13 ` [U-Boot] [PATCH 1/4] at91: add new gpio pin definitions Andreas Bießmann
2013-12-02 5:27 ` Bo Shen
2013-12-09 12:35 ` [U-Boot] [U-Boot,1/4] " Andreas Bießmann
2013-11-29 11:13 ` [U-Boot] [PATCH 2/4] at91: redefine legacy GPIO PIN_BASE Andreas Bießmann
2013-12-09 12:36 ` [U-Boot] [U-Boot,2/4] " Andreas Bießmann
2013-11-29 11:13 ` [U-Boot] [PATCH 3/4] at91: nand: switch atmel_nand to generic GPIO API Andreas Bießmann
2013-12-02 7:01 ` esw at bus-elektronik.de
2013-12-06 19:16 ` Scott Wood
2013-12-09 12:38 ` [U-Boot] [U-Boot,3/4] " Andreas Bießmann
2013-11-29 11:13 ` [U-Boot] [PATCH 4/4] at91: switch coloured LED to gpio API Andreas Bießmann
2013-12-09 12:38 ` [U-Boot] [U-Boot,4/4] " Andreas Bießmann
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=527156FC.5040305@googlemail.com \
--to=andreas.devel@googlemail.com \
--cc=u-boot@lists.denx.de \
/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