Why doesn't the tsc2007 touchscreen device appear? iMX6 Sabre Solox Eval Board

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why doesn't the tsc2007 touchscreen device appear? iMX6 Sabre Solox Eval Board

Jump to solution
3,743 Views
chriskolegraff
Contributor I


Hello,

We're using the iMX6 Sabre Solox Eval Board and are using a tsc2007 touchscreen. We used the Yocto Project to configure our own image (using fsl-image-gui) to have the tsc2007 kernel module installed. We also disabled the camera module, as they both use the same port.

uname -a:

Linux imx6sxsabresd 3.14.28-1.0.0_ga+g91cf351 #1 SMP PREEMPT Thu Aug 4 14:38:33 PDT 2016 armv7l GNU/Linux

modinfo tsc2007:

filename:       /lib/modules/3.14.28-1.0.0_ga+g91cf351/kernel/drivers/input/touchscreen/tsc2007.ko

license:        GPL

description:    TSC2007 TouchScreen Driver

author:         Kwangwoo Lee <kwlee@mtekvision.com>

srcversion:     FC0CD285A907DAF3E9545AF

alias:          i2c:tsc2007

alias:          of:N*T*Cti,tsc2007*

depends:

intree:         Y

vermagic:       3.14.28-1.0.0_ga+g91cf351 SMP preempt mod_unload modversions ARMv7 p2v8

The Build Process:

MACHINE=imx6sxsabresd source fsl-setup-release.sh -b build -e fb

bitbake -c menuconfig linux-imx (Then we configure the kernel)

cp -f tmp/work/imx6sxsabresd-poky-linux-gnueabi/linux-imx/3.14.28-r0/git/.config tmp/work/imx6sxsabresd-poky-linux-gnueabi/linux-imx/3.14.28-r0/defconfig

bitbake fsl-image-gui

And that builds everything fine.

Once we put the image on an SD Card and boot it on the Eval Board, we run 'modprobe tsc2007', and it loads the module just fine as well. It shows up when you run 'lsmod'

root@imx6sxsabresd:/# lsmod

Module                  Size  Used by

tsc2007                 4637  0

mxc_dcic                5887  0

evbug                   1850  0

The device itself shows up in the i2c interface with i2cdetect

root@imx6sxsabresd:/dev/input# i2cdetect -y 0

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00:          -- -- -- -- -- UU -- -- -- -- -- -- --

10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --

50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

70: -- -- -- -- -- -- -- --

We're using a custom made adaptor board for a 320x240@60fps RGB565 LCD monitor hooked into the LCD Expansion Port (J11)

In our U-Boot we set bootargs

setenv bootargs video=mxcfb0:dev=lcd, 320x240@60,if=RGB565

saveenv

boot

Is there something we're missing? Are there patches we need for the tsc2007 driver? We didn't modify any of the source code for the build. Is there a specific configuration we need to set in the modconfig for the kernel? Is there a specific hardware pin we need to power on/off inorder for the image to recognize the device in the /dev/input directory, or do we need to make our own handler for that?

Labels (2)
0 Kudos
1 Solution
2,089 Views
igorpadykov
NXP Employee
NXP Employee

Hi Chris

one can look at general touch bringup steps on

https://community.nxp.com/thread/313566

tsc2007 example in imx6qdl-tx6.dtsi

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/arch/arm/boot/dts/imx6qdl-tx6.dtsi?...

https://community.nxp.com/message/593750

http://www.imx6rex.com/software/imx6-rex-basic-hw-verification-tests/#touchscreen_tsc

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
2,089 Views
chriskolegraff
Contributor I

Thank you to Igor for pointing me in the right direction!

I've made progress on getting the touchscreen device to load.

I was editing the wrong file, instead of imx6sx-sabreauto.dts you need to edit 'imx6sx-sdb.dts'.

Here was all that I added to the file: under the section '&i2c2'

touchscreen: tsc2007@48 {

  compatible = "ti,tsc2007";

  reg = <0x48>;

  interrupt-parent = <&gpio3>;

  interrupts = <21 0>;

  gpios = <&gpio3 21 GPIO_ACTIVE_LOW>;

  ti,x-plate-ohms = <500>;

  status = "okay";

  linux,wakeup;

  wakeup-source;

  };

Also the tsc2007 kernel module driver now loads upon boot, and before it didn't do that.

The device does show up in /dev/input on the board, albeit shows up as touchscreen0, mouse0, and event4, but when I try to access any of these (cat touchscreen0 | hexdump) I get this error repeated a bunch of times: "tsc2007 1-0048: i2c io error: -5", followed by "cat: touchscreen0: Input/output error", and then it stops the process. I did change the interrupts pin from 26 to 21, so perhaps I'll rebuild it with that change undone and get back here to update this post.

Edit:

It didn't work. During the boot process I got:

input: TSC2007 Touchscreen as /devices/soc0/soc.0/2100000.aips-bus/21a4000.i2c/i2c-1/1-0048/input/input5

tsc2007 1-0048: i2c io error: -5

input: failed to attach handler evbug to device input5, error: -5

And when I try to cat touchscreen0 | hexdump I get:

tsc2007 1-0048: i2c io error: -5

cat: touchscreen0: Input/output error

Edit2:

I got it to work. Instead of inserting the touchscreen node under the &i2c2 section in the 'imx6sx-sdb.dts' file I inserted it in the &i2c1 section, and I set the interrupt pins back to 21, from 26.

0 Kudos
2,090 Views
igorpadykov
NXP Employee
NXP Employee

Hi Chris

one can look at general touch bringup steps on

https://community.nxp.com/thread/313566

tsc2007 example in imx6qdl-tx6.dtsi

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/arch/arm/boot/dts/imx6qdl-tx6.dtsi?...

https://community.nxp.com/message/593750

http://www.imx6rex.com/software/imx6-rex-basic-hw-verification-tests/#touchscreen_tsc

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
2,089 Views
chriskolegraff
Contributor I

Hello! Thank you for the reply!

On my machine, I've navigated to <build>/tmp/sysroots/imx6sxsabresd/usr/src/kernel/arch/arm/boot/dts...

For the iMX6 Sabre Solo X Eval Board, should I edit the file 'imx6sx-sabreauto.dts'?

Should I just copy and paste (into the i2c2 section) what is found regarding tsc2007 from the imx6qdl-tx6.dtsi  git file you posted?

Afterwards, what would I need to do afterwards? Would I need to run 'bitbake fsl-image-gui -c compile -f', and then do the bitbake build process?

Looking more closely at the git file, there are two parts regarding the tsc2007

touchscreen: tsc2007@48 {

  compatible = "ti,tsc2007";

  reg = <0x48>;

  pinctrl-names = "default";

  pinctrl-0 = <&pinctrl_tsc2007>;

  interrupt-parent = <&gpio3>;

  interrupts = <26 0>;

  gpios = <&gpio3 26 GPIO_ACTIVE_LOW>;

  ti,x-plate-ohms = <660>;

  linux,wakeup;

  };

and

pinctrl_tsc2007: tsc2007grp {
fsl,pins = <
MX6QDL_PAD_EIM_D26__GPIO3_IO26 0x1b0b0 /* Interrupt */
>;
};

So I shouldn't copy and paste the 2nd thing, but is that even necessary for the imx6sx board? Do I need to add anything else other than that first section?

There is also this section where I put the tsc2007 code:

codec: cs42888@048 {

  compatible = "cirrus,cs42888";

  reg = <0x048>;

  clocks = <&codec_osc 0>;

  clock-names = "mclk";

  VA-supply = <&reg_audio>;

  VD-supply = <&reg_audio>;

  VLS-supply = <&reg_audio>;

  VLC-supply = <&reg_audio>;

  };

is <0x048> the same as <0x48> ? Should I delete the cs42888 section to avoid a possible conflict?

Sorry for the barrage of questions, I'm really new when it comes to iMX, but I do really appreciate the help!

Thank you!

0 Kudos