[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110408144628.GC25237@oksana.dev.rtsoft.ru>
Date: Fri, 8 Apr 2011 18:46:28 +0400
From: Anton Vorontsov <cbouatmailru@...il.com>
To: Jamie Iles <jamie@...ieiles.com>
Cc: linux-kernel@...r.kernel.org, linux@....linux.org.uk,
tglx@...utronix.de, grant.likely@...retlab.ca, arnd@...db.de,
nico@...xnic.net
Subject: Re: [PATCHv2 6/7] basic_mmio_gpio: support different input/output
registers
On Fri, Apr 08, 2011 at 03:16:50PM +0100, Jamie Iles wrote:
> Some controllers have separate input and output registers. For these
> controllers, allow a register named "in" to be used for reading the
> value of a GPIO pin.
>
> Signed-off-by: Jamie Iles <jamie@...ieiles.com>
> Acked-by: Anton Vorontsov <cbouatmailru@...il.com>
> Cc: Grant Likely <grant.likely@...retlab.ca>
> ---
> drivers/gpio/basic_mmio_gpio.c | 31 +++++++++++++++++++++++++++++--
> 1 files changed, 29 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/basic_mmio_gpio.c b/drivers/gpio/basic_mmio_gpio.c
> index 9be1867..ed4b0c6 100644
> --- a/drivers/gpio/basic_mmio_gpio.c
> +++ b/drivers/gpio/basic_mmio_gpio.c
> @@ -70,6 +70,7 @@ struct bgpio_chip {
> void __iomem *reg_dat;
> void __iomem *reg_set;
> void __iomem *reg_clr;
> + void __iomem *reg_in;
Btw, I wonder if it makes sense (and more logical) for separate output/
input registers case to use "reg_dat" for 'input' and 'reg_set' for
output?
I.e. no need for 'reg_in', but instead modify some logic in
bgpio_setup_io(), and implement bgpio_set_set:
if (res_dat && res_set && !res_clr) {
bgc->gc.get = bgpio_get_dat;
bgc->gc.set = bgpio_set_set;
} else {
bgc->gc.get = bgpio_get_dat;
bgc->gc.set = bgpio_set_dat;
}
Thanks,
--
Anton Vorontsov
Email: cbouatmailru@...il.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists