From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Hoan Tran <hotran@apm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
lho@apm.com, Duc Dang <dhdang@apm.com>
Subject: Re: [PATCH] gpio: dwapb: Add support for next generation of X-Gene SoC
Date: Thu, 2 Feb 2017 21:47:18 +0200 [thread overview]
Message-ID: <CAHp75VfA6rzobgyBWkuzzh0YVB29R=oid6AVMgt8h1seO_dLAQ@mail.gmail.com> (raw)
In-Reply-To: <1485891838-27093-1-git-send-email-hotran@apm.com>
On Tue, Jan 31, 2017 at 9:43 PM, Hoan Tran <hotran@apm.com> wrote:
> Next generation of X-Gene SoC's GPIO hardware register map is very
> similar to DW GPIO. It only differs by a few register addresses.
> This patch modifies DW GPIO driver to accommodate the difference
> in a few register addresses.
> +#define GPIO_REG_OFFSET_V2 1
> +#define GPIO_INTMASK_V2 0x44
> +#define GPIO_INTTYPE_LEVEL_V2 0x34
> +#define GPIO_INT_POLARITY_V2 0x38
> +#define GPIO_INTSTATUS_V2 0x3c
> +#define GPIO_PORTA_EOI_V2 0x40
> +
> static inline u32 dwapb_read(struct dwapb_gpio *gpio, unsigned int offset)
> {
> struct gpio_chip *gc = &gpio->ports[0].gc;
> void __iomem *reg_base = gpio->regs;
>
> - return gc->read_reg(reg_base + offset);
> + return gc->read_reg(reg_base + gpio_reg_convert(gpio, offset));
And what prevents us to introduce special read_reg for that registers?
Also what about to convert to regmap API?
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2017-02-02 19:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-31 19:43 [PATCH] gpio: dwapb: Add support for next generation of X-Gene SoC Hoan Tran
2017-02-02 19:47 ` Andy Shevchenko [this message]
2017-02-03 1:18 ` Hoan Tran
2017-02-06 10:21 ` Linus Walleij
2017-02-06 23:49 ` Hoan Tran
2017-02-07 9:18 ` Andy Shevchenko
2017-02-13 9:38 ` Jamie Iles
2017-02-15 1:22 ` Hoan Tran
2017-02-15 11:20 ` Jamie Iles
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='CAHp75VfA6rzobgyBWkuzzh0YVB29R=oid6AVMgt8h1seO_dLAQ@mail.gmail.com' \
--to=andy.shevchenko@gmail.com \
--cc=dhdang@apm.com \
--cc=gnurou@gmail.com \
--cc=hotran@apm.com \
--cc=lho@apm.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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).