Skip to content

Commit eec7d56

Browse files
Alan Tulldinguyen702
authored andcommitted
FogBugz #84276: lcd driver on i2c
Supports the Newhaven NHD‐0216K3Z‐NSW‐BBW 2x16 LCD module as i2c slave. Device will show up as a ttyLCD* * Backspace is supported to the beginning of the current line. * i.e. printf '\b' > /dev/ttyLCD0 * ESC [ 2 J * erase whole display and reset cursor to home. * i.e. printf '\e[2J' > /dev/ttyLCD0 * ESC [ 2 K * erase current line and set cursor to beginning of line. * i.e. printf '\e[2K' > /dev/ttyLCD0 * CR and LF are supported. * Vertical scroll when cursor is on bottom line and receive end of line. Set the I2C0 I2C adapter to standard speed as LCD supports 100KHz I2C. Signed-off-by: Alan Tull <[email protected]>
1 parent afe38ce commit eec7d56

File tree

4 files changed

+677
-0
lines changed

4 files changed

+677
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
* TTY on a Newhaven NHD‐0216K3Z‐NSW‐BBW LCD connected to I2C
2+
3+
Required properties:
4+
- compatible: Should be "newhaven,nhd‐0216k3z‐nsw‐bbw";
5+
- reg: i2c address
6+
- height: should be 2 lines
7+
- width: should be 16 characters
8+
- brightness: backlight brightness. Range is 1 to 8, where
9+
1=OFF and 8=maximum brightness.
10+
11+
Example:
12+
13+
&i2c0 {
14+
lcd: lcd@28 {
15+
compatible = "newhaven,nhd‐0216k3z‐nsw‐bbw";
16+
reg = <0x28>;
17+
height = <2>;
18+
width = <16>;
19+
brightness = <8>;
20+
};
21+

drivers/tty/Kconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,25 @@ config LEGACY_PTY_COUNT
151151
When not in use, each legacy PTY occupies 12 bytes on 32-bit
152152
architectures and 24 bytes on 64-bit architectures.
153153

154+
config BFIN_JTAG_COMM
155+
tristate "Blackfin JTAG Communication"
156+
depends on BLACKFIN
157+
help
158+
Add support for emulating a TTY device over the Blackfin JTAG.
159+
160+
To compile this driver as a module, choose M here: the
161+
module will be called bfin_jtag_comm.
162+
163+
config BFIN_JTAG_COMM_CONSOLE
164+
bool "Console on Blackfin JTAG"
165+
depends on BFIN_JTAG_COMM=y
166+
167+
config NEWHAVEN_LCD
168+
tristate "NEWHAVEN LCD"
169+
depends on I2C
170+
help
171+
Add support for a TTY device on a Newhaven I2C LCD device.
172+
154173
config SERIAL_NONSTANDARD
155174
bool "Non-standard serial port support"
156175
depends on HAS_IOMEM

drivers/tty/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ obj-$(CONFIG_PPC_EPAPR_HV_BYTECHAN) += ehv_bytechan.o
3434
obj-$(CONFIG_GOLDFISH_TTY) += goldfish.o
3535
obj-$(CONFIG_MIPS_EJTAG_FDC_TTY) += mips_ejtag_fdc.o
3636
obj-$(CONFIG_VCC) += vcc.o
37+
obj-$(CONFIG_NEWHAVEN_LCD) += newhaven_lcd.o
3738

3839
obj-y += ipwireless/

0 commit comments

Comments
 (0)