Re: [PATCH 00/13] Add HD44780 Character LCD support

From: Geert Uytterhoeven
Date: Fri Mar 17 2017 - 03:40:50 EST


Hi Linus,

On Thu, Mar 16, 2017 at 9:50 PM, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
> On Mon, Feb 6, 2017 at 3:38 PM, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
>
>> Note that Linux has other support for HD44780 Character LCDs, but none of
>> it is generic:
>> - drivers/misc/arm-charlcd.c involves a custom IP block for interfacing
>> to the LCD controller,
>
> I can move this over to the generic framework if I get some example
> of what needs to be done. At the very least the file should be moved
> over to auxdisplay.

Should be as simple as setting up the ops:

static const struct charlcd_ops arm_charlcd_ops = {
.write_cmd = charlcd_4bit_command,
.write_cmd_raw4 = wrapper around writel(x,
lcd->virtbase + CHAR_COM),
.write_data = charlcd_4bit_char,
};

and replacing the custom initialization with:

lcd = charlcd_alloc(sizeof(size(struct arm_charlcd));
...
lcd->ifwidth = 4;
lcd->width = FIXME;
lcd->height = 2;
cd->ops = &arm_charlcd_ops;
charlcd_register(lcd);

There's no suspend/resume support in the charlcd core yet, though.

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