[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkda+2tnuO=AcN=HAD+YoaM4eEgnyjju7ioJL1op7+jFtqA@mail.gmail.com>
Date: Tue, 31 Jan 2017 13:59:37 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Paul Cercueil <paul@...pouillou.net>
Cc: Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Ralf Baechle <ralf@...ux-mips.org>,
Ulf Hansson <ulf.hansson@...aro.org>,
Boris Brezillon <boris.brezillon@...e-electrons.com>,
Thierry Reding <thierry.reding@...il.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Maarten ter Huurne <maarten@...ewalker.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Paul Burton <paul.burton@...tec.com>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Linux MIPS <linux-mips@...ux-mips.org>,
"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
"linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
"linux-pwm@...r.kernel.org" <linux-pwm@...r.kernel.org>,
"linux-fbdev@...r.kernel.org" <linux-fbdev@...r.kernel.org>,
James Hogan <james.hogan@...tec.com>
Subject: Re: [PATCH v2 01/14] Documentation: dt/bindings: Document pinctrl-ingenic
On Fri, Jan 27, 2017 at 4:27 PM, Paul Cercueil <paul@...pouillou.net> wrote:
> [Me]:
>> In the former case, if this pertains to the *inside* of the SoC:
>> is it just different between jz4740 and jz4780?
>> In that case, just code this into the driver as .data to the .compatible
>> in the DT match. No special DT properties needed.
>
> Well, I've been taught that devicetree is for describing the hardware, and
> the driver code is for functionality. So that's why I put it in devicetree.
This is a gray area.
But as GPIO maintainer I'm not happy about encoding information
about the hardware, that can be deducted from the compatible-string,
into the devicetree.
I prefer to encode per-compatible hardware information tables into
the driver, as structs, and pick the right table based on the compatible
string as .data in the of match entry.
It's simple to retrieve into the driver using of_device_get_match_data()
these days.
> That's also the reason why I put the list of functions and groups in
> devicetree and not in the driver code.
I'm not super-happy about that either, and it's not the way I would
have done it but the argument has been made
that it is a lot of opaque data and people prefer to maintain it
in the device tree.
I accept it for functions and groups, but I don't like it.
I will not fold to any consistency arguments of the type "now
you allowed this one thing, so you must allow this other thing
so you are consistent", just no. I didn't like it the first time, so I'm
not liking it anymore the second time.
I guess if the DT people tell me it has to be done this way I would
accept it. After a lot of discussion. But noone has.
Please make it a table and put it in the driver instead.
Yours,
Linus Walleij
Powered by blists - more mailing lists