From: Linus Walleij <linus.walleij@linaro.org>
To: Alexandre Courbot <gnurou@gmail.com>
Cc: John Crispin <blogic@openwrt.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	Linux MIPS <linux-mips@linux-mips.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH 2/5] GPIO: MIPS: ralink: add gpio driver for ralink rt2880 SoC
Date: Tue, 28 Oct 2014 10:39:46 +0100	[thread overview]
Message-ID: <CACRpkdbHtTcT=1FCtNTu_r2n+zxmpFCT0MK5iyjPRSio7ZRQHg@mail.gmail.com> (raw)
In-Reply-To: <CAAVeFu+qScOxf1My4K9nj7kaAWRqBGewG-ar6ELY03a2LC7aFA@mail.gmail.com>
On Mon, Oct 20, 2014 at 8:19 AM, Alexandre Courbot <gnurou@gmail.com> wrote:
> On Mon, Oct 20, 2014 at 2:27 PM, John Crispin <blogic@openwrt.org> wrote:
>> On 20/10/2014 06:41, Alexandre Courbot wrote:
>> On Sat, Oct 11, 2014 at 5:28 AM, John Crispin <blogic@openwrt.org> wrote:
>>> This (and the device tree bindings) seems the indicate that the
>>> registers offset can vary depending on the chip and bank. The chip
>>> can be specified using the compatible property, as for the bank you
>>> can also require a property giving the bank number. With these two
>>> bits of information, this driver should be able to pick the right
>>> register layout out of an in-driver table. This would be much
>>> cleaner that letting the DT specify whatever layout it wants.
>>
>> i tend to disagree. if we put the register offsets into the driver we
>> will have lots of static arrays (5 or 6) and with each new soc we need
>> to potentially need to patch the driver causing us in openwrt to carry
>> lots of patches and have to worry about upstreaming them. From my
>> understanding, the dts has this exact purpose, describing the hardware
>> and in turn reducing the boiler plate and static code in the drivers.
>> If have sent other drivers that do the same and was told there that
>> this is totally legit.
>
> With each new SoC you would have to patch the driver to add the new
> compatible property anyway. If your devices differ as much as by
> having a different register layout, they need a dedicated compatible
> property. In that case, you may as well add the register layout for
> this new property into the driver.
I agree. +1 on this.
Yours,
Linus Walleij
next prev parent reply	other threads:[~2014-10-28  9:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10 20:28 [PATCH 1/5] DT: Add documentation for gpio-rt2880 John Crispin
2014-10-10 20:28 ` [PATCH 2/5] GPIO: MIPS: ralink: add gpio driver for ralink rt2880 SoC John Crispin
2014-10-20  4:41   ` Alexandre Courbot
2014-10-20  5:27     ` John Crispin
2014-10-20  6:19       ` Alexandre Courbot
2014-10-28  9:39         ` Linus Walleij [this message]
2014-10-10 20:28 ` [PATCH 3/5] DT: Add documentation for gpio-mt7621 John Crispin
2014-10-28  9:37   ` Linus Walleij
2014-10-10 20:28 ` [PATCH 4/5] GPIO: MIPS: ralink: add gpio driver for ralink MT762x SoC John Crispin
2014-10-20  4:57   ` Alexandre Courbot
2014-10-20  5:31     ` John Crispin
2014-10-20  6:27       ` Alexandre Courbot
2014-10-28  9:44         ` Linus Walleij
2014-10-10 20:28 ` [PATCH 5/5] MIPS: ralink: we require gpiolib John Crispin
2014-10-27 16:42   ` Linus Walleij
2014-10-27 16:41 ` [PATCH 1/5] DT: Add documentation for gpio-rt2880 Linus Walleij
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='CACRpkdbHtTcT=1FCtNTu_r2n+zxmpFCT0MK5iyjPRSio7ZRQHg@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=blogic@openwrt.org \
    --cc=gnurou@gmail.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.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).