Skip to content
Snippets Groups Projects
Commit 2d41e1dd authored by Nicola Sparnacci's avatar Nicola Sparnacci Committed by Michele Cirinei
Browse files

[SANTINO][OVERLAY] Add 800x480 LCD and touch screen

LCD:
Add reg-userspace-consumer to let the user handle the LCD panel.

Test procedure:
i) switch off the panel:
```
echo "disabled" > /sys/class/regulator/regulator.7/reg_rgb_panel_on_consumer-rgb_panel_on/state
echo 0 > /sys/class/backlight/backlight/brightness
```
ii) switch on the panel:
```
echo 255 > /sys/class/backlight/backlight/brightness
echo "enabled" > /sys/class/regulator/regulator.7/reg_rgb_panel_on_consumer-rgb_panel_on/state
```

TOUCH:
Calibration needed at OS level. For weston:
```
weston-touch-calibrator /dev/fb0
```

JIRA Reference: [SANTINO-19]
parent f5ed2bc2
No related branches found
No related tags found
1 merge request!180[SANTINO] Add support to Santino board
......@@ -37,7 +37,8 @@ dtbo-$(CONFIG_SOC_IMX6Q) += \
seco-imx6qdl-a75-video-lvds-hdmi.dtbo \
seco-imx6qdl-a75-video-lvds.dtbo \
seco-imx6qdl-a75-video-lvdsx2-clone.dtbo \
seco-imx6qdl-a75-video-lvdsx2-dual.dtbo
seco-imx6qdl-a75-video-lvdsx2-dual.dtbo \
seco-imx6dl-santino-video-rgb-touch-ad7879.dtbo
dtbo-$(CONFIG_SOC_IMX6SX) += \
......
/dts-v1/;
/plugin/;
#include <dt-bindings/display/media-bus-format.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
/ {
fragment@0 {
target = <&mxcfb1>;
__overlay__ {
status = "okay";
};
};
fragment@1 {
target-path = "/";
__overlay__ {
// FANNAL, FN0700D083A
lcd@0 {
compatible = "fsl,lcd";
ipu_id = <0>;
disp_id = <0>;
default_ifmt = "RGB666";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ipu1_lcdif18bpp>;
status = "okay";
};
// Do not add a label to the backlight node. Due to the driver,
// the label causes functional failures
backlight {
compatible = "pwm-backlight";
power-supply = <&reg_5P0>;
pwms = <&pwm1 0 50000 0>;
brightness-levels = <0x0000 0x0281 0x06E1 0x0E56 0x1B0D 0x30B8 0x55A9 0x94A0 0xFFFF>;
num-interpolated-steps = <32>;
default-brightness-level = <0x94A0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_bl_on1>;
enable-gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>;
status = "okay";
};
reg_rgb_panel_on: reg_rgb_panel_on {
compatible = "regulator-fixed";
regulator-name = "rgb_panel_on";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
gpio = <&gpio5 21 GPIO_ACTIVE_HIGH>;
enable-active-high;
regulator-boot-on;
};
// The properties:
// power-supply = <&reg_rgb_panel_on>
// vcc-supply = <&reg_rgb_panel_on>
// have been tested in the lcd@0 node but no consumer is detected
// and the regulator is switched-off after a while.
// This consumer has been added to let the user enable/disable the
// display from the userspace, overcoming the described issue.
reg_rgb_panel_on_consumer {
compatible = "reg-userspace-consumer";
regulator-name = "LCD_ENA";
regulator-boot-on;
regulator-supplies = "rgb_panel_on";
rgb_panel_on-supply = <&reg_rgb_panel_on>;
};
};
};
fragment@2 {
target = <&i2c3>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
ad7879@2c {
adi,conversion-interval = /bits/ 8 <255>;
adi,averaging = /bits/ 8 <1>;
adi,median-filter-size = /bits/ 8 <2>;
adi,acquisition-time = /bits/ 8 <1>;
adi,first-conversion-delay = /bits/ 8 <3>;
adi,resistance-plate-x = <120>;
touchscreen-max-pressure = <4096>;
status = "okay";
interrupt-parent = <&gpio4>;
interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
pinctrl-0 = <&pinctrl_rtouch_int2>;
pinctrl-names = "default";
compatible = "adi,ad7879-1";
reg = <0x2c>;
};
};
};
fragment@3 {
target-path = "/";
__overlay__ {
serial-number = "03879390";
};
};
fragment@4 {
target = <&fec>;
__overlay__ {
local-mac-address = [00 07 8e 3b 31 de];
};
};
fragment@5 {
target = <&spreadspectrum>;
__overlay__ {
enabled = <1>;
denom = <400>;
stop = <241>;
step = <1>;
};
};
};
......@@ -18,47 +18,19 @@
reg = <0x10000000 0x20000000>;
};
lcd_display: disp0 {
compatible = "fsl,imx-parallel-display";
#address-cells = <1>;
#size-cells = <0>;
interface-pix-fmt = "rgb666";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ipu1_lcdif18bpp>;
status = "okay";
port@0 {
reg = <0>;
lcd_display_in: endpoint {
remote-endpoint = <&ipu1_di0_disp0>;
};
};
port@1 {
reg = <1>;
lcd_display_out: endpoint {
remote-endpoint = <&lcd_panel_in>;
};
};
aliases {
mxcfb0 = &mxcfb1;
};
panel: panel {
compatible = "guf,panel-dt";
backlight = <&backlight>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_lcd_enable1>;
power-supply = <&reg_SW4_3V3>;
enable-gpios = <&gpio5 21 GPIO_ACTIVE_HIGH>;
status = "okay";
port {
lcd_panel_in: endpoint {
remote-endpoint = <&lcd_display_out>;
};
};
mxcfb1: fb@0 {
compatible = "fsl,mxc_sdc_fb";
disp_dev = "lcd";
interface_pix_fmt = "RGB666";
mode_str ="CLAA-WVGA";
default_bpp = <16>;
int_clk = <0>;
late_init = <0>;
status = "disabled";
};
reg_5P0_CAN_RS485: regulator_5P0_CAN_RS485 {
......@@ -82,13 +54,6 @@
};
};
&backlight {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_bl_on1>;
enable-gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>;
status = "okay";
};
&can1 {
xceiver-supply = <&reg_5P0_CAN_RS485>;
};
......@@ -183,10 +148,6 @@
status = "disabled";
};
&ipu1_di0_disp0 {
remote-endpoint = <&lcd_display_in>;
};
&lm75 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_lm75_1>;
......
......@@ -110,16 +110,6 @@
assigned-clock-rates = <12000000>, <12000000>, <12000000>;
};
backlight: backlight {
compatible = "pwm-backlight";
power-supply = <&reg_5P0>;
pwms = <&pwm1 0 50000 0>;
brightness-levels = <0x0000 0x0281 0x06E1 0x0E56 0x1B0D 0x30B8 0x55A9 0x94A0 0xFFFF>;
num-interpolated-steps = <32>;
default-brightness-level = <0x94A0>;
status = "okay";
};
gfplatdetect: gfplatdetect {
compatible = "guf,imx6q-platdetect";
pinctrl-names = "default";
......
......@@ -287,6 +287,7 @@ CONFIG_MFD_SI476X_CORE=y
CONFIG_MFD_STMPE=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_USERSPACE_CONSUMER=y
CONFIG_REGULATOR_ANATOP=y
CONFIG_REGULATOR_DA9052=y
CONFIG_REGULATOR_DA9062=y
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment