From: David Brownell <david-b@pacbell.net>
To: Bryan Wu <bryan.wu@analog.com>
Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org,
Michael Hennerich <michael.hennerich@analog.com>
Subject: Re: [PATCH 01/12] Blackfin arch: add peripheral resource allocation support
Date: Fri, 17 Aug 2007 11:12:04 -0700 [thread overview]
Message-ID: <200708171112.04697.david-b@pacbell.net> (raw)
In-Reply-To: <11865441391829-git-send-email-bryan.wu@analog.com>
On Tuesday 07 August 2007, Bryan Wu wrote:
> From: Michael Hennerich <michael.hennerich@analog.com>
The patch description here is IMO misleading, and is clearly
weak-to-nonexistent ... what this patch does is
* Start tracking the label strings provided by gpio_request()
* Provide a new portmux mechanisms
* Start using those in the serial support code
When I read "resource allocation" I think of "struct resource"
from <linux/ioport.h>, allocate_resource(), and so on. So while
it's true there are other kinds of driver resource, it's rather
unnatural for me to think about pin mux and gpio issues in any
terms other than chip and board setup.
> +static int cmp_label(unsigned short ident, const char *label)
> +{
> + if (label && str_ident)
> + return strncmp(str_ident + ident * RESOURCE_LABEL_SIZE,
> + label, strlen(label));
> + else
> + return -EINVAL;
> +}
GRPIO labels are purely for diagnostics. There's no reason to
compare one to another. You seem to be using these for purposes
in addition to GPIOs though ... probably worth commenting on that
unusual scheme.
> +int peripheral_request(unsigned short per, const char *label)
> +{
> + ...
> +
> + if (unlikely(reserved_peri_map[gpio_bank(ident)] & gpio_bit(ident))) {
> +
> + /*
> + * Pin functions like AMC address strobes my
> + * be requested and used by several drivers
> + */
> +
> + if (!(per & P_MAYSHARE)) {
Goofy indentation. And as a rule, drivers have been kept out of
the business of configuring pin usage. It's simpler that way;
they don't need to try coping with configuration errors like two
drivers wanting conflicting usage ... or as you say above, needing
some explicit sharing mechanism ...
> +
> + /*
> + * Allow that the identical pin function can
> + * be requested from the same driver twice
> + */
... or as you say here, needing to structure themselves so they
don't configure the same usage more than once ...
That said, how you handle pinmux on Blackfin is your business.
But you should know that this approach seems idiosyncratic and
more complex than needed: when pin config is done early and as
part of board setup, drivers don't need to care about it or to
handle any pinmux errors. And heck, products can sometimes be
shipped with the bootloader having done all pinmux setup, so
Linux won't need to worry about it at all. That can help ship
multiple board revisions using the same kernel.
- Dave
next prev parent reply other threads:[~2007-08-17 18:28 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-08 3:35 [PATCH 00/12] Blackfin arch GPIO updating Bryan Wu
2007-08-08 3:35 ` [PATCH 01/12] Blackfin arch: add peripheral resource allocation support Bryan Wu
2007-08-17 18:12 ` David Brownell [this message]
2007-08-08 3:35 ` [PATCH 02/12] Blackfin arch: Add label to call new GPIO API Bryan Wu
2007-08-17 18:24 ` David Brownell
2007-08-17 19:45 ` Mike Frysinger
2007-08-17 20:09 ` David Brownell
2007-08-17 20:19 ` Mike Frysinger
2007-08-17 20:21 ` Mike Frysinger
2007-08-17 21:15 ` David Brownell
2007-08-17 21:53 ` Robin Getz
2007-08-17 22:34 ` David Brownell
2007-08-18 19:07 ` Robin Getz
2007-08-19 21:54 ` David Brownell
2007-08-20 1:55 ` Robin Getz
2007-08-20 3:41 ` David Brownell
2007-08-08 3:35 ` [PATCH 03/12] Blackfin arch: fix PORT_J BUG for BF537/6 EMAC driver Bryan Wu
2007-08-08 3:35 ` [PATCH 04/12] Blackfin arch: Finalize the generic gpio support - add gpio_to_irq and irq_to_gpio Bryan Wu
2007-08-08 3:35 ` [PATCH 05/12] Blackfin arch: Advertise GENERIC_GPIO and remove duplicated GENERIC_CALIBRATE_DELAY Bryan Wu
2007-08-08 3:35 ` [PATCH 06/12] Blackfin arch: Add PORT_J.High (needed for BF548-EZkit Touchscreen interrupts) - remove PORT_C.H Bryan Wu
2007-08-08 3:35 ` [PATCH 07/12] Blackfin arch: bug fixing, add missing BF533_FAMILY GPIO_PFx definition Bryan Wu
2007-08-08 3:35 ` [PATCH 08/12] Blackfin arch: add missing gpio error handling to make sure we roll back requests in case one fails Bryan Wu
2007-08-08 3:35 ` [PATCH 09/12] Blackfin arch: scrub remaining ASSEMBLY usage since the switch to __ASSEMBLY__ Bryan Wu
2007-08-08 3:35 ` [PATCH 10/12] Blackfin arch: update platform driver resource information to the ezkitBF548 board file Bryan Wu
2007-08-08 3:35 ` [PATCH 11/12] Blackfin arch: after removing fs.h from mm.h, fix the broken on Blackfin arch Bryan Wu
2007-08-08 3:35 ` [PATCH 12/12] Blackfin serial driver: use new GPIO API Bryan Wu
2007-08-17 17:29 ` David Brownell
2007-08-08 7:18 [PATCH 01/12] Blackfin arch: add peripheral resource allocation support Hennerich, Michael
2007-08-08 7:49 ` Bryan Wu
2007-08-17 20:02 Hennerich, Michael
2007-08-17 21:10 ` David Brownell
2007-08-17 22:15 ` Robin Getz
2007-08-17 22:46 ` David Brownell
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=200708171112.04697.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=akpm@linux-foundation.org \
--cc=bryan.wu@analog.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.hennerich@analog.com \
--cc=torvalds@linux-foundation.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
Powered by JetHome