Difference between revisions of "LCD"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
===LCD背光控制===
+
[[LCD/zh|查看中文]]
注:需要使用root用户登录
+
==S5P4418/S5P6818 1wire backlight adjustment==
 +
===LCD backlight adjustment====
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
# echo "10" > /dev/backlight-1wire
+
sudo sh -c "echo '10' >/dev/backlight-1wire"
 
</syntaxhighlight>
 
</syntaxhighlight>
背光范围:0~127
+
value range:0~127
  
===LCD背光完全关闭===
+
===Turn off the LCD backlight===
注:需要使用root用户登录
+
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
# echo "0" > /dev/backlight-1wire
+
sudo sh -c "echo '0' >/dev/backlight-1wire"
 
</syntaxhighlight>
 
</syntaxhighlight>
  
===S5P6818开发板增加自已的屏支持的注意事项===
+
==RK3399 platform: adjust the LCD backlight==
对于Android 来说,要增加自己的屏的支持,需要修改u-boot-2014.07 linux-3.4.y ,用户可根据wiki 下载和编译这2部分。<br/>
+
The backlight can be controlled manually through the node in this path:  /sys/class/backlight/backlight
 +
 
 +
==S5P6818 platform: Add your own screen support==
 +
===Kernel 4.4===
 +
====Display driver====
 +
It is recommended to debug uboot v2016.01, the relevant files are located in board/s5p6818/nanopi3/ , focusing on lcds.c<br/>
 +
Debugging the kernel 4.4 again, the driver is drivers/gpu/drm/panel/panel-friendlyelec.c
 +
====Touch Screen Driver====
 +
You may refre to HD900 touch screen driver:<br/>
 +
    drivers/input/touchscreen/friendlyelec/st1572.c<br/>
 +
Or the following driver:
 +
    drivers/input/touchscreen/st1232.c<br/>
 +
 
 +
===Kernel 3.4===
 +
For Android, to add your own screen support, you need to modify u-boot-2014.07 and linux-3.4.y. you can download and compile these 2 parts according to the wiki.<br/>
 
<br/>
 
<br/>
 
u-boot-2014.07<br/>
 
u-boot-2014.07<br/>
  board/s5p6818/nanopi3/lcds.c  - 包含了我们所支持的屏的时序信息<br/>
+
board/s5p6818/nanopi3/lcds.c  - 包含了我们所支持的屏的时序信息<br/>
  board/s5p6818/nanopi3/onewire.c - 这是一线的实现,主要是用来识别屏<br/>
+
board/s5p6818/nanopi3/onewire.c - 这是一线的实现,主要是用来识别屏<br/>
  board/s5p6818/nanopi3/board.c - bd_lcd_init() 是屏的初始化处理<br/>
+
board/s5p6818/nanopi3/board.c - bd_lcd_init() 是屏的初始化处理<br/>
  对于用户自己的屏,可以先修改 lcds.c ,增加自己的屏的参数,然后强制使用自己的参数<br/>
+
对于用户自己的屏,可以先修改 lcds.c ,增加自己的屏的参数,然后强制使用自己的参数<br/>
  另外,部分屏因硬件特性的差异,初始化时需要配置不同的IO驱动能力,这需要根据自己实际的情况来测试,具体可查看命令类似 _gpio_init 的函数<br/>
+
另外,部分屏因硬件特性的差异,初始化时需要配置不同的IO驱动能力,这需要根据自己实际的情况来测试,具体可查看命令类似 _gpio_init 的函数<br/>
  如果用户的屏的LVDS 接口的,则nanopi2_lcd_config 中是通过 LCD_VESA<br/>
+
如果用户的屏的LVDS 接口的,则nanopi2_lcd_config 中是通过 LCD_VESA<br/>
 
<br/>
 
<br/>
  uboot中屏显示正常后,便可移植linux-3.4.y<br/>
+
uboot中屏显示正常后,便可移植linux-3.4.y<br/>
 
<br/>
 
<br/>
 
linux-3.4.y<br/>
 
linux-3.4.y<br/>
  arch/arm/plat-s5p6818/nanopi3/lcds.c - 和 uboot中的类似,包含了屏的时序参数<br/>
+
arch/arm/plat-s5p6818/nanopi3/lcds.c - 和 uboot中的类似,包含了屏的时序参数<br/>
  可将uboot已调试好的参数增加到这里,这时候需要留意一下内核命令参数 lcd=XXX ,uboot会传递此参数给内核。<br/>
+
可将uboot已调试好的参数增加到这里,这时候需要留意一下内核命令参数 lcd=XXX ,uboot会传递此参数给内核。<br/>
 +
 
 +
==T4,M4安卓7修改屏幕方向的问题==
 +
第一步: 使用Type-C连接PC与板子,在PC上使用adb 拉取板子上的文件到PC上<br/>
 +
adb pull /system/build.prop<br/>
 +
第二步: 在PC上修改 build.prop <br/>
 +
a)  修改 ro.sf.hwrotation=90<br/>
 +
b) 增加 sys.hwc.device.primary=HDMI-A<br/>
 +
第三步: 在PC上使用以下命令将修改过的 build.prop 推送到板子<br/>
 +
adb root; adb remount; adb push build.prop /system/<br/>
 +
第四步: 重启板子,可使用以下命令重启板子<br/>
 +
adb reboot<br/>
 +
<br/>
 +
 
 +
==T4 H702E LCD driver==
 +
drivers/gpu/drm/panel/panel-friendlyelec.c<br/>
 +
drivers/gpu/drm/panel/panel-friendlyelec.h<br/>
 +
<br/>
 +
And DTS file:<br/>
 +
arch/arm64/boot/dts/rockchip/rk3399-nanopi4-common.dtsi<br/>
 +
<br/>
 +
Related configuration:<br/>
 +
<pre>
 +
    panel: edp-panel {
 +
        compatible = "lcds", "simple-panel";
 +
        status = "okay";
 +
 
 +
        backlight = <&pwm_bl>;
 +
        power-supply = <&vcc_lcd>;
 +
        prepare-delay-ms = <20>;
 +
        enable-delay-ms = <20>;
 +
 
 +
        ports {
 +
            edp_panel: endpoint {
 +
                remote-endpoint = <&edp_out>;
 +
            };
 +
        };
 +
    };
 +
</pre>
 +
 
 +
==HD702 touch screen driver==
 +
touch screen: gt9xx <br/>
 +
linux 3.4: drivers/input/touchscreen/gt9xx.c<br/>
 +
linux 4.4: drivers/input/touchscreen/friendlyelec/gt9xx.c<br/>
 +
<br/>

Latest revision as of 10:40, 9 September 2021

查看中文

1 S5P4418/S5P6818 1wire backlight adjustment

1.1 LCD backlight adjustment=

sudo sh -c "echo '10' >/dev/backlight-1wire"

value range:0~127

1.2 Turn off the LCD backlight

sudo sh -c "echo '0' >/dev/backlight-1wire"

2 RK3399 platform: adjust the LCD backlight

The backlight can be controlled manually through the node in this path: /sys/class/backlight/backlight

3 S5P6818 platform: Add your own screen support

3.1 Kernel 4.4

3.1.1 Display driver

It is recommended to debug uboot v2016.01, the relevant files are located in board/s5p6818/nanopi3/ , focusing on lcds.c
Debugging the kernel 4.4 again, the driver is drivers/gpu/drm/panel/panel-friendlyelec.c

3.1.2 Touch Screen Driver

You may refre to HD900 touch screen driver:

   drivers/input/touchscreen/friendlyelec/st1572.c

Or the following driver:

   drivers/input/touchscreen/st1232.c

3.2 Kernel 3.4

For Android, to add your own screen support, you need to modify u-boot-2014.07 and linux-3.4.y. you can download and compile these 2 parts according to the wiki.

u-boot-2014.07
board/s5p6818/nanopi3/lcds.c - 包含了我们所支持的屏的时序信息
board/s5p6818/nanopi3/onewire.c - 这是一线的实现,主要是用来识别屏
board/s5p6818/nanopi3/board.c - bd_lcd_init() 是屏的初始化处理
对于用户自己的屏,可以先修改 lcds.c ,增加自己的屏的参数,然后强制使用自己的参数
另外,部分屏因硬件特性的差异,初始化时需要配置不同的IO驱动能力,这需要根据自己实际的情况来测试,具体可查看命令类似 _gpio_init 的函数
如果用户的屏的LVDS 接口的,则nanopi2_lcd_config 中是通过 LCD_VESA

uboot中屏显示正常后,便可移植linux-3.4.y

linux-3.4.y
arch/arm/plat-s5p6818/nanopi3/lcds.c - 和 uboot中的类似,包含了屏的时序参数
可将uboot已调试好的参数增加到这里,这时候需要留意一下内核命令参数 lcd=XXX ,uboot会传递此参数给内核。

4 T4,M4安卓7修改屏幕方向的问题

第一步: 使用Type-C连接PC与板子,在PC上使用adb 拉取板子上的文件到PC上
adb pull /system/build.prop
第二步: 在PC上修改 build.prop
a) 修改 ro.sf.hwrotation=90
b) 增加 sys.hwc.device.primary=HDMI-A
第三步: 在PC上使用以下命令将修改过的 build.prop 推送到板子
adb root; adb remount; adb push build.prop /system/
第四步: 重启板子,可使用以下命令重启板子
adb reboot

5 T4 H702E LCD driver

drivers/gpu/drm/panel/panel-friendlyelec.c
drivers/gpu/drm/panel/panel-friendlyelec.h

And DTS file:
arch/arm64/boot/dts/rockchip/rk3399-nanopi4-common.dtsi

Related configuration:

    panel: edp-panel {
        compatible = "lcds", "simple-panel";
        status = "okay";

        backlight = <&pwm_bl>;
        power-supply = <&vcc_lcd>;
        prepare-delay-ms = <20>;
        enable-delay-ms = <20>;

        ports {
            edp_panel: endpoint {
                remote-endpoint = <&edp_out>;
            };
        };
    };

6 HD702 touch screen driver

touch screen: gt9xx
linux 3.4: drivers/input/touchscreen/gt9xx.c
linux 4.4: drivers/input/touchscreen/friendlyelec/gt9xx.c