* Re: [PATCH linux v1 4/4] arm: dts: Add dt-binding to support seven segment display on zaius
[not found] ` <3917905.e4iOqADnVQ@wuerfel>
@ 2016-12-14 9:00 ` Arnd Bergmann
2016-12-14 11:06 ` Russell King - ARM Linux
0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2016-12-14 9:00 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Jaghathiswari Rankappagounder Natarajan, openbmc, robh+dt,
mark.rutland, linux, gregkh, joel, linux-kernel, devicetree,
linux-gpio@vger.kernel.org, linus.walleij
On Wednesday, December 14, 2016 9:55:47 AM CET Arnd Bergmann wrote:
> According to your introductory mail, the interface is assumed to be
> a 74HC164. Should we use that ID in the compatible string?
>
> We can always add other strings later if we want to support multiple
> wire formats.
Actually, looking up 74hc164, that seems to be a gpio expander,
so maybe a more flexible way to do the same is to put a driver
for the expander into drivers/gpio/ and have the main driver
access the outputs of that using the gpiolib interface.
Arnd
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH linux v1 4/4] arm: dts: Add dt-binding to support seven segment display on zaius
2016-12-14 9:00 ` [PATCH linux v1 4/4] arm: dts: Add dt-binding to support seven segment display on zaius Arnd Bergmann
@ 2016-12-14 11:06 ` Russell King - ARM Linux
2016-12-14 11:40 ` Russell King - ARM Linux
0 siblings, 1 reply; 4+ messages in thread
From: Russell King - ARM Linux @ 2016-12-14 11:06 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
Jaghathiswari Rankappagounder Natarajan,
openbmc-uLR06cmDAlY/bJ5BZ2RsiQ, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
mark.rutland-5wv7dgnIgG8, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
joel-U3u1mxZcP9KHXe+LvDLADg, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linus.walleij-QSEj5FYQhm4dnm+yROfE0A
On Wed, Dec 14, 2016 at 10:00:46AM +0100, Arnd Bergmann wrote:
> On Wednesday, December 14, 2016 9:55:47 AM CET Arnd Bergmann wrote:
> > According to your introductory mail, the interface is assumed to be
> > a 74HC164. Should we use that ID in the compatible string?
> >
> > We can always add other strings later if we want to support multiple
> > wire formats.
>
> Actually, looking up 74hc164, that seems to be a gpio expander,
> so maybe a more flexible way to do the same is to put a driver
> for the expander into drivers/gpio/ and have the main driver
> access the outputs of that using the gpiolib interface.
There already is - drivers/gpio/gpio-74x164.c
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH linux v1 4/4] arm: dts: Add dt-binding to support seven segment display on zaius
2016-12-14 11:06 ` Russell King - ARM Linux
@ 2016-12-14 11:40 ` Russell King - ARM Linux
2016-12-15 23:07 ` Linus Walleij
0 siblings, 1 reply; 4+ messages in thread
From: Russell King - ARM Linux @ 2016-12-14 11:40 UTC (permalink / raw)
To: Arnd Bergmann
Cc: mark.rutland, Jaghathiswari Rankappagounder Natarajan, devicetree,
gregkh, openbmc, linux-kernel, linux-gpio@vger.kernel.org,
robh+dt, joel, linus.walleij, linux-arm-kernel
On Wed, Dec 14, 2016 at 11:06:35AM +0000, Russell King - ARM Linux wrote:
> On Wed, Dec 14, 2016 at 10:00:46AM +0100, Arnd Bergmann wrote:
> > On Wednesday, December 14, 2016 9:55:47 AM CET Arnd Bergmann wrote:
> > > According to your introductory mail, the interface is assumed to be
> > > a 74HC164. Should we use that ID in the compatible string?
> > >
> > > We can always add other strings later if we want to support multiple
> > > wire formats.
> >
> > Actually, looking up 74hc164, that seems to be a gpio expander,
> > so maybe a more flexible way to do the same is to put a driver
> > for the expander into drivers/gpio/ and have the main driver
> > access the outputs of that using the gpiolib interface.
>
> There already is - drivers/gpio/gpio-74x164.c
Looking at this more, it's a SPI driver, presumably because the first
case where it appeared was on a SPI bus.
However, it's not a SPI device as such, it's a piece of standard,
general purpose logic that's been around for many years, pre-dating
the SPI bus.
Now, as for DT, we have this "DT represents the hardware, not the
implementation" edict, which now brings up an interesting problem.
If we want to use this driver in its existing form, we need to:
- declare in DT a spi-gpio driver to provide a SPI bus on the GPIO
pins connected to the 74HC164.
- attach the 74HC164 to the SPI bus.
The problem with that is it's not representative of the hardware -
what we're saying is that we want to reuse our existing implementation
and make DT conform to the implementation. At that point, we might as
well scrap our "DT is implementation independent" edict above.
What if, tomorrow, we end up with 74HC164 connected to via a different
method?
I think a much more sensible approach would be to turn the GPIO side
of the 74x164 driver into a library, which can be re-used by multiple
bus-specific drivers - one for SPI which allows it to be used in its
current form, one for our platform bus which takes the GPIO lines for
the data, clock and clear signals.
I also don't see why they shouldn't use the same compatible - they're
the same _device_ at the end of the day, just wired up differently.
It makes the binding documentation a little fun wrt what are required
and optional properties, but nothing that shouldn't be too difficult.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH linux v1 4/4] arm: dts: Add dt-binding to support seven segment display on zaius
2016-12-14 11:40 ` Russell King - ARM Linux
@ 2016-12-15 23:07 ` Linus Walleij
0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2016-12-15 23:07 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Arnd Bergmann, Mark Rutland,
Jaghathiswari Rankappagounder Natarajan,
devicetree@vger.kernel.org, Greg KH, OpenBMC Maillist,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
Rob Herring, Joel Stanley, linux-arm-kernel@lists.infradead.org
On Wed, Dec 14, 2016 at 12:40 PM, Russell King - ARM Linux
<linux@armlinux.org.uk> wrote:
> Looking at this more, it's a SPI driver, presumably because the first
> case where it appeared was on a SPI bus.
>
> However, it's not a SPI device as such, it's a piece of standard,
> general purpose logic that's been around for many years, pre-dating
> the SPI bus.
Indeed.
> I think a much more sensible approach would be to turn the GPIO side
> of the 74x164 driver into a library, which can be re-used by multiple
> bus-specific drivers - one for SPI which allows it to be used in its
> current form, one for our platform bus which takes the GPIO lines for
> the data, clock and clear signals.
>
> I also don't see why they shouldn't use the same compatible - they're
> the same _device_ at the end of the day, just wired up differently.
> It makes the binding documentation a little fun wrt what are required
> and optional properties, but nothing that shouldn't be too difficult.
I agree on both accounts.
Sorry for not seeing this in the first place, I was well aware that this
is a standard component and may be connected in a myriad of ways,
so I should have known better :(
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-12-15 23:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1481702104-8617-1-git-send-email-jaghu@google.com>
[not found] ` <1481702104-8617-5-git-send-email-jaghu@google.com>
[not found] ` <3917905.e4iOqADnVQ@wuerfel>
2016-12-14 9:00 ` [PATCH linux v1 4/4] arm: dts: Add dt-binding to support seven segment display on zaius Arnd Bergmann
2016-12-14 11:06 ` Russell King - ARM Linux
2016-12-14 11:40 ` Russell King - ARM Linux
2016-12-15 23:07 ` Linus Walleij
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).