linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mad_soft@inbox.ru (Dmitry Artamonow)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/9] collie: prepare for gpiolib use
Date: Wed, 7 Oct 2009 16:42:52 +0400	[thread overview]
Message-ID: <20091007124251.GB7656@rainbow> (raw)
In-Reply-To: <20091007112552.GC6246@n2100.arm.linux.org.uk>

On 12:25 Wed 07 Oct     , Russell King - ARM Linux wrote:
> On Wed, Oct 07, 2009 at 03:08:05PM +0400, Dmitry Artamonow wrote:
> > On 23:35 Mon 05 Oct     , Thomas Kunze wrote:
> > > prefix gpio definitions for direct register access with '_' so we
> > > can use the other names for gpio_request & co
> > 
> > Familiar problem - numeric vs bit-shifted gpio defines.
> > I'm facing it here too while converting h3[16]00 to gpiolib,
> > and I'm thinking about dropping bit-shifted defines completely
> > and using GPIO_GPIO(SOME_NUMERIC_GPIO) instead.
> 
> What we did with PXA was to decide not to use definitions for the built-in
> GPIOs - what's the point of:
> 
> #define GPIO0	0
> #define GPIO1	1
> #define GPIO2	2
> ...
> 
> It's a bit like:
> 
> #define NUMBER0	0
> #define NUMBER1	1
> etc.
> 
> Yes, there's a reason to if the number spaces are different, but for
> the built-in GPIOs, they aren't.

Perhaps I wasn't exactly clear in explaining my thoughts. Sorry.
I meant following - currently in mach/h3600_gpio.h we have gpios declared
like that:
#define GPIO_H3100_IR_ON                GPIO_GPIO (8)
which effectively means:
#define GPIO_H3100_IR_ON                (1 << 8)
i.e. bit-shifted value. 

But gpiolibs needs numeric gpio definitions, something like that:
#define NGPIO_H3100_IR_ON		8

That's all well, but not all direct operations with GPIO registers on
SA1100 can be converted to gpiolib. Operations with GAFR (GPIO alternate
function register), for example (PXA have MFD API for that, but
StrongArm doesn't)

So for constructions like these:
	GAFR &= ~GPIO_H3100_IR_ON;
we either need to keep both variants of GPIO definitions in header, or
keep only "numeric" and change code to:
	GAFR &= ~GPIO_GPIO(NGPIO_H3100_IR_ON);


-- 
Best regards,
Dmitry "MAD" Artamonow

  parent reply	other threads:[~2009-10-07 12:42 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-05 21:35 collie and SA1100 patches Thomas Kunze
2009-10-05 21:35 ` [PATCH 1/9] collie: fix scoop convesion to new api Thomas Kunze
2009-10-05 21:35   ` [PATCH 2/9] collie: prepare for gpiolib use Thomas Kunze
2009-10-05 21:35     ` [PATCH 3/9] move drivers/mfd/*.h to include/linux/mfd Thomas Kunze
2009-10-05 21:35       ` [PATCH 4/9] collie: locomo-led change default trigger Thomas Kunze
2009-10-05 21:35         ` [PATCH 5/9] SA1100: make gpio_to_irq and reverse a macro Thomas Kunze
2009-10-05 21:35           ` [PATCH 6/9] add gpiolib support to ucb1x00 Thomas Kunze
2009-10-05 21:35             ` [PATCH 7/9] collie: convert to gpiolib for ucb1x00 Thomas Kunze
2009-10-05 21:35               ` [PATCH 8/9] collie: add battery driver Thomas Kunze
2009-10-05 21:35                 ` [PATCH 9/9] collie: support pda_power driver Thomas Kunze
2009-11-28 12:47             ` [PATCH 6/9] add gpiolib support to ucb1x00 Russell King - ARM Linux
2009-11-29 11:44               ` Thomas Kunze
2009-10-11 12:15           ` [PATCH 5/9] SA1100: make gpio_to_irq and reverse a macro Pavel Machek
2009-10-12 17:31             ` Thomas Kunze
2009-10-07 11:08     ` [PATCH 2/9] collie: prepare for gpiolib use Dmitry Artamonow
2009-10-07 11:25       ` Russell King - ARM Linux
2009-10-07 11:48         ` Lothar Waßmann
2009-10-07 12:10           ` Sergei Shtylyov
2009-10-07 12:42         ` Dmitry Artamonow [this message]
2009-10-07 13:10           ` Russell King - ARM Linux
2009-10-07 14:33             ` RMK's sa1100 branch (was Re: [PATCH 2/9] collie: prepare for gpiolib use) Dmitry Artamonow
2009-10-07 16:41               ` Russell King - ARM Linux
2009-10-07 20:23       ` [PATCH 2/9] collie: prepare for gpiolib use Thomas Kunze
2009-10-06 10:33 ` collie and SA1100 patches Mark Brown
2009-10-06 10:57 ` Kristoffer Ericson
2009-10-06 16:36   ` Thomas Kunze
2009-10-11 12:16 ` Pavel Machek
2009-10-20 18:00 ` Thomas Kunze
2009-10-20 19:43   ` Eric Miao
2009-11-03 19:41     ` Thomas Kunze
2009-11-07  8:28       ` Pavel Machek
2009-11-07  8:53         ` Russell King - ARM Linux
2009-11-07 16:54         ` Kristoffer Ericson

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=20091007124251.GB7656@rainbow \
    --to=mad_soft@inbox.ru \
    --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).