Skip to content

Add support for 3.5" display by tinylcd.com #880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions arch/arm/boot/dts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ dtb-$(RPI_DT_OVERLAYS) += piscreen-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += pitft28-resistive-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += rpi-display-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += tinylcd35-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += w1-gpio-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += w1-gpio-pullup-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += spi-bcm2835-overlay.dtb
Expand Down
216 changes: 216 additions & 0 deletions arch/arm/boot/dts/tinylcd35-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
/*
* tinylcd35-overlay.dts
*
* -------------------------------------------------
* www.tinlylcd.com
* -------------------------------------------------
* Device---Driver-----BUS GPIO's
* display tinylcd35 spi0.0 25 24 18
* touch ads7846 spi0.1 5
* rtc ds1307 i2c1-0068
* rtc pcf8563 i2c1-0051
* keypad gpio-keys --------- 17 22 27 23 28
*
*
* TinyLCD.com 3.5 inch TFT
*
* Version 001
* 5/3/2015 -- Noralf Trønnes Initial Device tree framework
* 10/3/2015 -- tinylcd@gmail.com added ds1307 support.
*
*/

/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";

fragment@0 {
target = <&spi0>;
__overlay__ {
status = "okay";

spidev@0{
status = "disabled";
};

spidev@1{
status = "disabled";
};
};
};

fragment@1 {
target = <&gpio>;
__overlay__ {
tinylcd35_pins: tinylcd35_pins {
brcm,pins = <25 24 18>;
brcm,function = <1>; /* out */
};
tinylcd35_ts_pins: tinylcd35_ts_pins {
brcm,pins = <5>;
brcm,function = <0>; /* in */
};
keypad_pins: keypad_pins {
brcm,pins = <4 17 22 23 27>;
brcm,function = <0>; /* in */
brcm,pull = <1>; /* down */
};
};
};

fragment@2 {
target = <&spi0>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;

tinylcd35: tinylcd35@0{
compatible = "neosec,tinylcd";
reg = <0>;
pinctrl-names = "default";
pinctrl-0 = <&tinylcd35_pins>,
<&tinylcd35_ts_pins>;

spi-max-frequency = <48000000>;
rotate = <270>;
fps = <20>;
bgr;
buswidth = <8>;
reset-gpios = <&gpio 25 0>;
dc-gpios = <&gpio 24 0>;
led-gpios = <&gpio 18 1>;
debug = <0>;

init = <0x10000B0 0x80
0x10000C0 0x0A 0x0A
0x10000C1 0x01 0x01
0x10000C2 0x33
0x10000C5 0x00 0x42 0x80
0x10000B1 0xD0 0x11
0x10000B4 0x02
0x10000B6 0x00 0x22 0x3B
0x10000B7 0x07
0x1000036 0x58
0x10000F0 0x36 0xA5 0xD3
0x10000E5 0x80
0x10000E5 0x01
0x10000B3 0x00
0x10000E5 0x00
0x10000F0 0x36 0xA5 0x53
0x10000E0 0x00 0x35 0x33 0x00 0x00 0x00 0x00 0x35 0x33 0x00 0x00 0x00
0x100003A 0x55
0x1000011
0x2000001
0x1000029>;
};

tinylcd35_ts: tinylcd35_ts@1 {
compatible = "ti,ads7846";
reg = <1>;
status = "disabled";

spi-max-frequency = <2000000>;
interrupts = <5 2>; /* high-to-low edge triggered */
interrupt-parent = <&gpio>;
pendown-gpio = <&gpio 5 0>;
ti,x-plate-ohms = /bits/ 16 <100>;
ti,pressure-max = /bits/ 16 <255>;
};
};
};

/* RTC */

fragment@3 {
target = <&i2c1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;

pcf8563: pcf8563@51 {
compatible = "nxp,pcf8563";
reg = <0x51>;
status = "disabled";
};
};
};

fragment@4 {
target = <&i2c1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;

ds1307: ds1307@68 {
compatible = "maxim,ds1307";
reg = <0x68>;
status = "disabled";
};
};
};

/*
* Values for input event code is found under the
* 'Keys and buttons' heading in include/uapi/linux/input.h
*/
fragment@5 {
target-path = "/soc";
__overlay__ {
keypad: keypad {
compatible = "gpio-keys";
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&keypad_pins>;
status = "disabled";
autorepeat;

button@17 {
label = "GPIO KEY_UP";
linux,code = <103>;
gpios = <&gpio 17 0>;
};
button@22 {
label = "GPIO KEY_DOWN";
linux,code = <108>;
gpios = <&gpio 22 0>;
};
button@27 {
label = "GPIO KEY_LEFT";
linux,code = <105>;
gpios = <&gpio 27 0>;
};
button@23 {
label = "GPIO KEY_RIGHT";
linux,code = <106>;
gpios = <&gpio 23 0>;
};
button@4 {
label = "GPIO KEY_ENTER";
linux,code = <28>;
gpios = <&gpio 4 0>;
};
};
};
};

__overrides__ {
speed = <&tinylcd35>,"spi-max-frequency:0";
rotate = <&tinylcd35>,"rotate:0";
fps = <&tinylcd35>,"fps:0";
debug = <&tinylcd35>,"debug:0";
touch = <&tinylcd35_ts>,"status";
touchgpio = <&tinylcd35_ts_pins>,"brcm,pins:0",
<&tinylcd35_ts>,"interrupts:0",
<&tinylcd35_ts>,"pendown-gpio:4";
xohms = <&tinylcd35_ts>,"ti,x-plate-ohms;0";
rtc-pcf = <&i2c1>,"status",
<&pcf8563>,"status";
rtc-ds = <&i2c1>,"status",
<&ds1307>,"status";
keypad = <&keypad>,"status";
};
};
3 changes: 2 additions & 1 deletion arch/arm/configs/bcm2709_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ CONFIG_INPUT_POLLDEV=m
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
CONFIG_INPUT_JOYDEV=m
CONFIG_INPUT_EVDEV=m
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_KEYBOARD_ATKBD is not set
CONFIG_KEYBOARD_GPIO=m
# CONFIG_INPUT_MOUSE is not set
CONFIG_INPUT_JOYSTICK=y
CONFIG_JOYSTICK_IFORCE=m
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/configs/bcmrpi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,8 @@ CONFIG_INPUT_POLLDEV=m
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
CONFIG_INPUT_JOYDEV=m
CONFIG_INPUT_EVDEV=m
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_KEYBOARD_ATKBD is not set
CONFIG_KEYBOARD_GPIO=m
# CONFIG_INPUT_MOUSE is not set
CONFIG_INPUT_JOYSTICK=y
CONFIG_JOYSTICK_IFORCE=m
Expand Down