linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: rmallon@gmail.com (Ryan Mallon)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC/RFT 1/2] gpio/basic_mmio: add support for enable register
Date: Tue, 05 Jul 2011 16:15:44 +1000	[thread overview]
Message-ID: <4E12AC10.9020206@gmail.com> (raw)
In-Reply-To: <83915224c24e43224272b1bf570cddb9545279a6.1309840042.git.nsekhar@ti.com>

On 05/07/11 15:10, Sekhar Nori wrote:
> Some GPIO controllers have an enable register
> which needs to be written to before a GPIO
> can be used.
>
> Add support for enabling the GPIO. At this
> time inverted logic for enabling the GPIO
> is not supported. This can be done by adding
> a disable register as and when a controller
> with this comes along.
>
> Signed-off-by: Sekhar Nori<nsekhar@ti.com>
> ---
>
<snip>

> static int bgpio_setup_io(struct bgpio_chip *bgc,
>   			  void __iomem *dat,
> @@ -369,6 +401,7 @@ int __devinit bgpio_init(struct bgpio_chip *bgc,
>   			 void __iomem *clr,
>   			 void __iomem *dirout,
>   			 void __iomem *dirin,
> +			 void __iomem *en,
>   			 bool big_endian)

The arguments to this function are getting a bit unwieldy :-). Maybe we 
need to introduce something like:

struct bgpio_chip_info {
     struct device *dev;
     unsigned long sz;
     void __iomem *dat;
     void __iomem *set;
     void __iomem *clr;
     void __iomem *dirout;
     void __iomem *dirin;
     void __iomem *en;
     bool big_endian;
};

and pass that to bgpio_init instead. It would have the added benefits of 
making the drivers more readable and that bgpio_chip_info structs in the 
drivers can probably be marked __initdata also.

Since you are already having to touch all of the call sites for 
bgpio_init this could be done as a separate patch along with this series.

~Ryan

  parent reply	other threads:[~2011-07-05  6:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-05  5:10 [RFC/RFT 0/2] gpio: move tnetv107x gpio support to drivers/gpio Sekhar Nori
     [not found] ` <83915224c24e43224272b1bf570cddb9545279a6.1309840042.git.nsekhar@ti.com>
2011-07-05  6:15   ` Ryan Mallon [this message]
2011-07-05  8:32     ` [RFC/RFT 1/2] gpio/basic_mmio: add support for enable register Nori, Sekhar
2011-07-06 21:10     ` Grant Likely
2011-07-07 16:45       ` Nori, Sekhar
2011-07-07 18:37         ` Grant Likely
2011-07-07 21:23           ` Ryan Mallon
     [not found] ` <6639b07562e3e6643dd07d5ed3907cb5158ce16b.1309840042.git.nsekhar@ti.com>
2011-07-06 22:02   ` [RFC/RFT 2/2] davinci: use generic memory mapped gpio for tnetv107x Grant Likely
2011-07-07 12:18     ` Nori, Sekhar
2011-07-13 14:46     ` Anton Vorontsov

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=4E12AC10.9020206@gmail.com \
    --to=rmallon@gmail.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 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).