Skip to content

Commit c7c3f09

Browse files
geertugregkh
authored andcommitted
auxdisplay: hd44780: Fix DT properties to include units of measurement
DT properties specifying physical properties should contain appropriate suffices indicating the units of measurement. Hence amend the HD44780 DT bindings to add "chars" suffixes to the "display-height" and "display-width" properties, and update the driver to parse them. Fixes: dd9502a ("dt-bindings: auxdisplay: Add bindings for Hitachi HD44780") Fixes: d47d883 ("auxdisplay: Add HD44780 Character LCD support") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent deb0b9b commit c7c3f09

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Documentation/devicetree/bindings/auxdisplay/hit,hd44780.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Required properties:
1515
- rs-gpios: Must contain a GPIO specifier, referring to the GPIO pin
1616
connected to the "RS" (Register Select) signal line of the LCD Controller's
1717
bus interface,
18-
- display-height: Height of the display, in character cells,
19-
- display-width: Width of the display, in character cells.
18+
- display-height-chars: Height of the display, in character cells,
19+
- display-width-chars: Width of the display, in character cells.
2020

2121
Optional properties:
2222
- rw-gpios: Must contain a GPIO specifier, referring to the GPIO pin
@@ -25,7 +25,8 @@ Optional properties:
2525
- backlight-gpios: Must contain a GPIO specifier, referring to the GPIO pin
2626
used for enabling the LCD's backlight,
2727
- internal-buffer-width: Internal buffer width (default is 40 for displays
28-
with 1 or 2 lines, and display-width for displays with more than 2 lines).
28+
with 1 or 2 lines, and display-width-chars for displays with more than 2
29+
lines).
2930

3031
Example:
3132

@@ -39,6 +40,6 @@ Example:
3940
enable-gpios = <&hc595 4 GPIO_ACTIVE_HIGH>;
4041
rs-gpios = <&hc595 5 GPIO_ACTIVE_HIGH>;
4142

42-
display-height = <2>;
43-
display-width = <16>;
43+
display-height-chars = <2>;
44+
display-width-chars = <16>;
4445
};

drivers/auxdisplay/hd44780.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,11 @@ static int hd44780_probe(struct platform_device *pdev)
264264
}
265265

266266
/* Required properties */
267-
ret = device_property_read_u32(dev, "display-height", &lcd->height);
267+
ret = device_property_read_u32(dev, "display-height-chars",
268+
&lcd->height);
268269
if (ret)
269270
goto fail;
270-
ret = device_property_read_u32(dev, "display-width", &lcd->width);
271+
ret = device_property_read_u32(dev, "display-width-chars", &lcd->width);
271272
if (ret)
272273
goto fail;
273274

0 commit comments

Comments
 (0)