Hi,
I am using a IMX6qdl-sabrelite board with a customized ft5x06 touch lvd screen as below:
* the touch screen is connected to I2C0 rather than I2C2
* the interrupt is GPIO_19 rather than GPIO_9
* the backlight control is on pwm1 through DSIP0_DAT8 rather than pwm4 through MX6QDL_PAD_SD1_CMD_PWM4_OUT
so firstly, I added a structure into file "imx6qdl-sabrelite.dtsi" as below
ft5x06_ts@38 {
compatible = "ft5x06-ts,ft5x06-ts";
reg = <0x38>
interrupt-parent = <&gpio4>
interrupts = <19 2>
wakeup-gpios = <&gpio4 5 2>
};
under '&i2c1'
Although it is unnecessary, but I also removed the line of "MX6QDL_PAD_GPIO_9_GPIO1_IO09 0x80000000 /*I2C3 touch screen interrupt */" from
imx6q-sabrelite{
pinctrl_hog_1: hoggrp-1{
fsl,pins = <
...
/*MX6QDL_PAD_GPIO_9_GPIO1_IO09 0x80000000 I2C3 touch screen interrupt */
...
>;
}
...
};
then I test it, and everything works fine, i.e. the machine displays and responses to every touch fine. so I move on to change the backlight.
1) I changed backlight_lvds to
backlight_lvds{
...
pwms = <&pwm1 0 5000000> /* from pwms = <&pwm4 0 5000000> */
...
};
2) I changed pwm1 in file imx6qdl.dtsi to
pwm1 {
...
MX6QDL_PAD_DISP0_DAT8_PWM1_OUT 0x1b0b1 /* from MX6QDL_PAD_SD1_DAT3_PWM1_OUT 0x1b0b1*/
...
};
3) I removed "backlight_lcd" from file imx6qdl-sabrelite.dtsi
After I run the new dts, the backlight control seems working fine, I can change it with command 'echo 7 > /sys/class/backlight/backlight_lvds.0/brightness'. But the problem is my already worked touch screen seems not working any more. things are still display correctly, but machine is not response to any touch.
I then removed structure 'lcd0: lcd@0' from file imx6qdl-sabrelite.dtsi, element 'pwm1grp-1: ipu1grp-1' and 'ipu1grp-4: ipu1grp-4' from structure ipu1 to eliminate all reference to MX6QDL_PAD_DISP0_DAT8_xxx, but problem did not get fix. What did it do wrong? how can I get the problem fix?
Would be much appreciated if you can give me a hand.
below are some 'fdt' print out on the runtime device tree
fdt print /soc/aips-bus@02100000/i2c@021a0000/ft5x06_ts@38
ft5x06_ts@38 {
compatible = "ft5x06-ts,ft5x06-ts";
reg = <0x00000038>;
interrupt-parent = <0x0000002e>;
interrupts = <0x00000013 0x00000002>;
wakeup-gpios = <0x0000002e 0x00000013 0x00000000>;
};
fdt print /soc/aips-bus@0210000/i2c@021a8000
i2c@021a8000 {
#address-cells = <0x00000001>;
#size-cells = <0x00000000>;
compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
reg = <0x021a8000 0x00004000>;
interrupts = <0x00000000 0x00000026 0x00000004>;
clocks = <0x00000002 0x0000007f>;
status = "okay";
clock-frequency = <0x000186a0>;
pinctrl-names = "default";
pinctrl-0 = <0x00000029>;
egalax_ts@04 {
compatible = "eeti,egalax_ts";
reg = <0x00000004>;
interrupt-parent = <0x00000010>;
interrupts = <0x00000009 0x00000002>;
wakeup-gpios = <0x00000010 0x00000009 0x00000000>;
};
ili210x@41 {
compatible = "ili210x";
reg = <0x00000041>;
interrupt-parent = <0x00000010>;
interrupts = <0x00000009 0x00000002>;
wakeup-gpios = <0x00000010 0x00000009 0x00000000>;
};
ov5640@3c {
compatible = "ovti,ov5640";
reg = <0x0000003c>;
pinctrl-names = "default";
pinctrl-0 = <0x0000002a 0x0000002b>;
clocks = <0x0000002c 0x00000000>;
clock-names = "csi_mclk";
DOVDD-supply = <0x00000026>;
AVDD-supply = <0x00000023>;
DVDD-supply = <0x00000026>;
pwn-gpios = <0x00000005 0x0000000d 0x00000001>;
rst-gpios = <0x00000005 0x0000000e 0x00000000>;
csi_id = <0x00000001>;
mclk = <0x016e3600>;
mclk_source = <0x00000000>;
ipu_id = <0x00000001>;
};
tsc2004@48 {
compatible = "tsc2004,tsc2004";
reg = <0x00000048>;
pinctrl-names = "default";
pinctrl-0 = <0x0000002d>;
interrupt-parent = <0x0000002e>;
interrupts = <0x00000014 0x00000002>;
wakeup-gpios = <0x0000002e 0x00000014 0x00000000>;
};
};
fdt print /soc/aips-bus@02000000/iomuxc@020e0000/pwm1
pwm1 {
pwm1grp-1 {
fsl,pins = <0x00000190 0x000004a4 0x00000000 0x00000002 0x00000000 0x0001b0b1>;
linux,phandle = <0x0000000b>;
phandle = <0x0000000b>;
};
};
fdt print /soc/aips-bus202000000/pwm@02080000
pwm@02080000 {
#pwm-cells = <0x00000002>;
compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm";
reg = <0x02080000 0x00004000>;
interrupts = <0x00000000 0x00000053 0x00000000>;
clocks = <0x00000002 0x0000003e 0x00000002 0x00000091>;
clock-names = "ipg", "per";
pinctrl-names = "default";
pinctrl-0 = <0x0000000b>;
status = "okay";
linux,phandle = <0x00000038>;
phandle = <0x00000038>;
};
fdt print /backlight_lvds
backlight_lvds {
compatible = "pwm-backlight";
pwms = <0x00000038 0x00000000 0x004c4b40>;
brightness-levels = <0x00000000 0x00000004 0x00000008 0x00000010 0x00000020 0x00000040 0x00000080 0x000000ff>;
default-brightness-level = <0x00000007>;
};
fdt print /soc/aips-bus@02000000/iomuxc@020e000/ipu1
ipu1 {
ipu1grp-2 {
fsl,pins = * 0x12005334 [0x00000120];
linux,phandle = <0x00000025>;
phandle = <0x00000025>;
};
ipu1grp-3 {
fsl,pins = * 0x12005494 [0x000001c8];
};
};
Solved! Go to Solution.
Hi Gary,
Thanks for you help, I think I fix it.
I changed the 'ft5x06_ts@38' block under &i2c1 from the above attached "imx6qdl-sabrelite.dtsi" file from
ft5x06_ts@38 {
compatible = "ft5x06-ts,ft5x06-ts";
reg = <0x38>;
interrupt-parent = <&gpio4>;
interrupts = <19 2>;
wakeup-gpios = <&gpio4 5 0>;
};
to
ft5x06_ts@38 {
compatible = "ft5x06-ts,ft5x06-ts";
reg = <0x38>;
interrupt-parent = <&gpio4>;
interrupts-extended = <&gpio4 5 IRQ_TYPE_LEVEL_HIGH>;
wakeup-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>;
};
and it works fine now.
Cheers,
Damien
Hi,
Please share the full dtsi file or copy it to pastebin to it is easily readable.
Regards,
Gary
Thanks Gary for your message.
At the moment, I don't have my physical copy of dtsi file because I don't know how to generate dtb file from dtsi & dts file yet. So I use the uboot fdt command to modify the dtb data on the fly based on a standard imx6q-sabrelite.dtb file that generated by other with source from boundarydevices.
The fdt commands that I used within my bootscript were given below:
fdt resize
#
# To remove all references that using PAD_DISP0_DAT8, because I need it for backlight control
fdt rm /soc/aips-bus@02000000/iomuxc@020e0000/ipu1/ipu1grp-1
fdt rm /soc/aips-bus@02000000/iomuxc@020e0000/ipu1/ipu1grp-4
fdt rm /lcd@0
#
#change pwm1 to use PAD_DISP0_DAT8 from PAD_SD1_DAT3
fdt set /soc/aips-bus@02000000/iomuxc@020e0000/pwm1/pwm1grp-1 fsl,pins <0x190 0x4a4 0 2 0 0x1b0b1>
#
# change for 24 bit lvds display
fdt set lvds_display default_bpp <0x18>
fdt set lvds_display interface_pix_fmt "RGB24"
fdt set /soc/aips-bus@02000000/ldb@020e0008/lvds-channel@0 fsl,data-width <0x18>
#
# -- start changes for touch screen at i2c0 with interrupt at GPIO19 (ie. at GPIO port 4, IO5)
fdt mknode /soc/aips-bus@02100000/i2c@021a0000 ft5x06_ts@38
fdt set /soc/aips-bus@02100000/i2c@021a0000/ft5x06_ts@38 wakeup-gpios <0x2e 0x5 0x0>
fdt set /soc/aips-bus@02100000/i2c@021a0000/ft5x06_ts@38 interrupts <0x13 0x2>
fdt set /soc/aips-bus@02100000/i2c@021a0000/ft5x06_ts@38 interrupt-parent <0x2e>
fdt set /soc/aips-bus@02100000/i2c@021a0000/ft5x06_ts@38 reg <0x38>
fdt set /soc/aips-bus@02100000/i2c@021a0000/ft5x06_ts@38 compatible "ft5x06-ts,ft5x06-ts"
#
# to remove the original ft5x06_ts that was connected on i2c2
fdt rm /soc/aips-bus@02100000/i2c@021a8000/ft5x06_ts@38
#
# to remove volume-down button as it was using GPIO19
fdt rm /gpio-keys/volume-down
#
# remove original GPIO9 interrupt by replacing it with 'MX6QDL_PAD_GPIO_19_GPIO4_IO05 0x1b0b0'
fdt get addr intr /soc/aips-bus@02000000/iomuxc@020e0000/imx6q-sabrelite/hoggrp-1 fsl,pins
setexp intr $intr + 0x198
mw.l $intr 0x54020000
setexp intr $intr + 4
mw.l $intr 0x24060000
setexp intr $intr + 4
mw.l $intr 0x0
setexp intr $intr + 4
mw.l $intr 0x05000000
setexp intr $intr + 4
mw.l $intr 0x0
setexp intr $intr + 4
#
#should the below value be 0x80000000? why the old GPIO9 interrupt is using 0x80000000 not 0x1b0b0?
mw.l $intr 0xb0b01000
PS:
1) I want to attached the imx6q-sabrelite.dtb file that I was using to this post, but don't know how to do so.
2) I am running 'make clean', followed with 'make' on the boundarydevicce lollipop 5.0 source to generate an updated dtb file (hope this will work), but it may take hours before I can find out if it works. Is there a faster way to only compile device tree files without involving full make?
Cheers,
Damien
Hi Damien,
Sorry but it is going to be hard helping you with this approach. I suggest you start modifying the dtsi file directly and learn to build it.
You can look at this post:
https://boundarydevices.com/cross-compiling-kernels-2014-edition-2/
This will tell you how to build the kernel but especially how to build the device tree. It is a Linux procedure but if you just need to build the dtb it is going to be exactly the same for Android. Please do not attach the dtb since it's a binary that isn't human readable.
Regards,
Gary
Hi Gary,
I compiled my btsi files last night and installed it into the machine, but the result was the same (i.e. the touch screen was not working as soon as I changed pwm1 to source from PAD_DISP0_DAT8).
Attached were my dtsi files where areas changed were marked with DHD, and the console output at boot time. Would be much appreciated if you could help on this.
Cheers,
Damien
Hi Gary,
Thanks for you help, I think I fix it.
I changed the 'ft5x06_ts@38' block under &i2c1 from the above attached "imx6qdl-sabrelite.dtsi" file from
ft5x06_ts@38 {
compatible = "ft5x06-ts,ft5x06-ts";
reg = <0x38>;
interrupt-parent = <&gpio4>;
interrupts = <19 2>;
wakeup-gpios = <&gpio4 5 0>;
};
to
ft5x06_ts@38 {
compatible = "ft5x06-ts,ft5x06-ts";
reg = <0x38>;
interrupt-parent = <&gpio4>;
interrupts-extended = <&gpio4 5 IRQ_TYPE_LEVEL_HIGH>;
wakeup-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>;
};
and it works fine now.
Cheers,
Damien
is the touch device appear under /dev/input?
Thanks Jimmy.
There are three files under /dev/input - mice, mouse0, and event0.
Before I add the backlight support, using the cat command on these files, I can see something from these three files for every touch. However after I added the backlight support, nothing would be output from these three files with the same cat command. It seems that the software was not response to the interrupt triggered by the touch hardware.
Cheers,