Skip to content

Commit

Permalink
auxdisplay: hd44780: Fix DT properties to include units of measurement
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geert Uytterhoeven authored and Greg Kroah-Hartman committed Apr 8, 2017
1 parent deb0b9b commit c7c3f09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 6 additions & 5 deletions Documentation/devicetree/bindings/auxdisplay/hit,hd44780.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Required properties:
- rs-gpios: Must contain a GPIO specifier, referring to the GPIO pin
connected to the "RS" (Register Select) signal line of the LCD Controller's
bus interface,
- display-height: Height of the display, in character cells,
- display-width: Width of the display, in character cells.
- display-height-chars: Height of the display, in character cells,
- display-width-chars: Width of the display, in character cells.

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

Example:

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

display-height = <2>;
display-width = <16>;
display-height-chars = <2>;
display-width-chars = <16>;
};
5 changes: 3 additions & 2 deletions drivers/auxdisplay/hd44780.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,11 @@ static int hd44780_probe(struct platform_device *pdev)
}

/* Required properties */
ret = device_property_read_u32(dev, "display-height", &lcd->height);
ret = device_property_read_u32(dev, "display-height-chars",
&lcd->height);
if (ret)
goto fail;
ret = device_property_read_u32(dev, "display-width", &lcd->width);
ret = device_property_read_u32(dev, "display-width-chars", &lcd->width);
if (ret)
goto fail;

Expand Down

0 comments on commit c7c3f09

Please sign in to comment.