Re: [PATCH 1/2] auxdisplay: HD44780 connected to I2C via PCF8574

From: Geert Uytterhoeven
Date: Wed Jan 06 2021 - 03:04:44 EST


Hi Ralf,

On Wed, Jan 6, 2021 at 3:42 AM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
> On Tue, Jan 5, 2021 at 4:04 PM Ralf Schlatterbeck <rsc@xxxxxxxxxx> wrote:
> > Add HD44780 character display connected via I2C I/O expander.
> > Re-uses the high-level interface of the existing HD44780 driver.
> >
> > Signed-off-by: Ralf Schlatterbeck <rsc@xxxxxxxxxx>

Thanks for your patch!

> Also, Cc'ing others related to hd44780/charlcd that may be interested
> (there is another patch in the series, too).

Thanks for CCing me, Miguel!

> > +config HD44780_PCF8574
> > + tristate "HD44780 Character LCD support, I2C-connection"
>
> There is no hyphen in the "parallel connection" one, perhaps remove it?
>
> > +#define DEBUG
>
> Spurious line from development?
>
> > +/*
> > + * The display uses 4-bit mode (the I/O expander has only 8 bits)
> > + * The control signals RS, R/W, E are on three bits and on many displays
> > + * the backlight is on bit 3. The upper 4 bits are data.
> > + */
> > +#define HD44780_RS_SHIFT 0
> > +#define HD44780_RW_SHIFT 1
> > +#define HD44780_E_SHIFT 2
> > +#define HD44780_BACKLIGHT_SHIFT 3

Unless I'm missing some little detail, there should be no need for this
driver: this wiring (and alternative wirings) can just be expressed in DT.
Examples (using 74HC595 SPI GPIO expanders) can be found in my
renesas-overlays branch:

- ARM: dts: koelsch: exio-a: Add overlay for MSIOF1 and 2xHC595
https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git/commit/?h=topic/renesas-overlays&id=98f65d8ac2ae79d63f13d3f9cc562512670297b7

- ARM: dts: hc595s: Add overlay for 20x4 character LCD (4 bit wiring)
https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git/commit/?h=topic/renesas-overlays&id=181f27534a7437e73e0067062dfa5a18dccd9a74

- ARM: dts: hc595s: Add overlay for 20x4 character LCD (8 bit wiring)
https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git/log/?h=topic/renesas-overlays

A separate driver is needed only when using a microcontroller with a
custom protocol to interface with the HD44780.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds