imx6 sabre-sdb and LCD touchscreen MAX11801

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

imx6 sabre-sdb and LCD touchscreen MAX11801

跳至解决方案
7,824 次查看
SteveRathjen
Contributor III

Has anyone successfully connected a MCIMX28LCD to a iMX6 Sabre-SDB board?  and touchscreen works?

I can get video with:

video=mxcfb0:dev=lcd,800x600,if=RGB24

I also try this to get ts working:

video=mxcfb0:dev=lcd,800x600,if=RGB24 tsdev=max11801 calibration

I can see a driver loading at boot and dmesg output:

root@imx6qsabresd:~# dmesg |grep input

input: gpio-keys as /devices/platform/gpio-keys/input/input0

input: max11801_ts as /devices/platform/imx-i2c.1/i2c-1/1-0048/input/input1

input: mag3110 as /devices/virtual/input/input2

input: mma845x as /devices/virtual/input/input3

input: WM8962 Beep Generator as /devices/platform/imx-i2c.0/i2c-0/0-001a/input/input4

input: wm8962-audio DMIC as /devices/platform/soc-audio.5/sound/card0/input5

input: wm8962-audio Ext Spk as /devices/platform/soc-audio.5/sound/card0/input6

input: Logitech Trackball as /devices/platform/fsl-ehci.1/usb2/2-1/2-1:1.0/input/input7

generic-usb 0003:046D:C404.0001: input,hidraw0: USB HID v1.10 Mouse [Logitech Trackball] on usb-fsl-ehci.1-1/input0

root@imx6qsabresd:~# cat /dev/input/event1

(Nothing here either)

^C

root@imx6qsabresd:~# cat /dev/input/event7   <--- usb trackball

�R�C� �c ����� �R c   � �R#c� �R��   � �R��� �R �   � �R#�� �RS�   � �Rc�� �R3�    � �R7�    � �Rn�� �RY�   ����� GR

G    � �R G    � �R#G � �R �   � �R �    � �R+� � �R    � �R�� � �R "    � �R!" � �RNA   � �RXA   

^^^^^^^^^^^^^^^ This garbage is DATA coming in from trackball - this is prefect!

On the board, TS_INT line goes low and TS_SDA goes crazy when screen is touched, so I think the MAX11801 IC is working and something is requesting data on I2C bus.  I see something on the i2c bus lines when the screen is touched, but the OS shows no sign of touch data.

xorg.conf.log shows max_11801_ts loading:

From xorg.conf.0.log:

[669885.688] (II) config/udev: Adding input device max11801_ts (/dev/input/event1)

[669885.688] (**) max11801_ts: Applying InputClass "evdev touchscreen catchall"

[669885.688] (II) Using input driver 'evdev' for 'max11801_ts'

[669885.689] (**) max11801_ts: always reports core events

[669885.689] (**) evdev: max11801_ts: Device: "/dev/input/event1"

[669885.689] (--) evdev: max11801_ts: Vendor 0 Product 0

[669885.689] (--) evdev: max11801_ts: Found absolute axes

[669885.689] (--) evdev: max11801_ts: Found x and y absolute axes

[669885.689] (--) evdev: max11801_ts: Found absolute touchscreen

[669885.689] (II) evdev: max11801_ts: Configuring as touchscreen

[669885.689] (**) evdev: max11801_ts: YAxisMapping: buttons 4 and 5

[669885.689] (**) evdev: max11801_ts: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200

[669885.689] (**) Option "config_info" "udev:/sys/devices/platform/imx-i2c.1/i2c-1/1-0048/input/input1/event1"

[669885.689] (II) XINPUT: Adding extended input device "max11801_ts" (type: TOUCHSCREEN, id 7)

[669885.689] (II) evdev: max11801_ts: initialized for absolute axes.

[669885.690] (**) max11801_ts: (accel) keeping acceleration scheme 1

[669885.690] (**) max11801_ts: (accel) acceleration profile 0

[669885.690] (**) max11801_ts: (accel) acceleration factor: 2.000

[669885.690] (**) max11801_ts: (accel) acceleration threshold: 4

[669885.691] (II) config/udev: Adding input device max11801_ts (/dev/input/mouse0)

[669885.691] (II) No input driver specified, ignoring this device.

[669885.691] (II) This device may have been added with another device file.

tslib doesn't seem to do be installed, nor evtest..  using xinput:

root@imx6qsabresd:~# xinput list

Unable to connect to X server

root@imx6qsabresd:~# export DISPLAY=:0

root@imx6qsabresd:~# xinput list

⎡ Virtual core pointer                          id=2    [master pointer  (3)]

⎜   ↳ Virtual core XTEST pointer                        id=4    [slave  pointer  (2)]

⎜   ↳ max11801_ts                                       id=7    [slave  pointer  (2)]

⎜   ↳ Logitech Trackball                                id=8    [slave  pointer  (2)]

⎣ Virtual core keyboard                         id=3    [master keyboard (2)]

    ↳ Virtual core XTEST keyboard                       id=5    [slave  keyboard (3)]

    ↳ gpio-keys                                         id=6    [slave  keyboard (3)]

root@imx6qsabresd:~# xinput test 7

(NOTHING!!!!)

^C

root@imx6qsabresd:~# xinput test 8  <-- USB trackball

motion a[0]=178 a[1]=479

motion a[1]=479

motion a[1]=479

motion a[1]=479

...

motion a[0]=427

motion a[0]=428 a[1]=434

motion a[1]=435

motion a[1]=434

motion a[1]=435

^C

trackball works - pointer on screen moves too btw.

Looking at:

/home/scuba/fsl-community-bsp/build/tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.0.35-r38.14/git/arch/arm/mach-mx6/board-mx6q_sabresd.c

        I2C_BOARD_INFO("max11801", 0x48),

        .platform_data = (void *)&max11801_mode,

        .irq = gpio_to_irq(SABRESD_TS_INT),

what is 0x48?

I2C_BOARD_INFO (dev_type,dev_addr);

Arguments

    dev_type: identifies the device type

    dev_addr: the device's address on the bus.

0x48.. shouldn't that be 0x68?

changed board-mx6q_sabresd.c:

        //I2C_BOARD_INFO("max11801", 0x48),

        //SJR - Max11801 datasheet says responds on 0x68,0x69,0x6a, or 0x6b

        //sabre board default (no pop R101 & R102) = 0x68

        I2C_BOARD_INFO("max11801", 0x68),

        .platform_data = (void *)&max11801_mode,

        .irq = gpio_to_irq(SABRESD_TS_INT),

with This change the TS_INT and TS_SDA lines went quiet.  THis must not be the problem.

there was a patch applied for max11801:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=3573

> On the sources/meta-fsl-arm/recipes-kernel/linux/linux-imx_3.0.35.bb, REMOVE

> the line where this patch is indicated

>

> file://0005-ENGR00271359-Add-Multi-touch-support.patch

>

>

> Bake and test please

THis patch creates a mode 1, maybe try mode 0? in:

/home/scuba/fsl-community-bsp/build/tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.0.35-r38.14/git/arch/arm/mach-mx6/board-mx6q_sabresd.c

static int max11801_mode = 1;    //try 0? there is a patch to max11801, 0 should disable it.

Is this the same as removing the patch?

ok, I think that's everything I've tried... the easy stuff.  I'm using Yocto and mostly core-image-sato, but have tried others. Linux 3.0.35_4.1 and imx6qsabresd.  I also tried Android on demo SD card and a linux (fsl-gnome?) image from freescale, but I can't run LTIB. 

I'm stumped - any ideas are welcome!  I need to test the functionality of the max11801 and its connection to the imx6 ASAP so I can begin my custom PCB layout - this is the last part to test!

Thanks,

Steve Rathjen

标签 (4)
标记 (4)
0 项奖励
回复
1 解答
2,134 次查看
shanchong234
Contributor III


method 1:


do some change in the file of "linux/arch/arm/mach-mx6/board-mx6q_sabresd.c"

              - max11801_mode = 1;

              + max11801_mode = 0;

after that you cant use the function of "max11801_read_adc()"

method 2:

do not change max11801_mode;

fix the max11801 driver file: linux/drivers/input/touchscreen/max11801_ts.c

          -  max11801_write_reg(client, GENERNAL_CONF_REG, 0xf3);

          + max11801_write_reg(client, GENERNAL_CONF_REG, 0xf4);

method 2 is recommend.

在原帖中查看解决方案

6 回复数
2,135 次查看
shanchong234
Contributor III


method 1:


do some change in the file of "linux/arch/arm/mach-mx6/board-mx6q_sabresd.c"

              - max11801_mode = 1;

              + max11801_mode = 0;

after that you cant use the function of "max11801_read_adc()"

method 2:

do not change max11801_mode;

fix the max11801 driver file: linux/drivers/input/touchscreen/max11801_ts.c

          -  max11801_write_reg(client, GENERNAL_CONF_REG, 0xf3);

          + max11801_write_reg(client, GENERNAL_CONF_REG, 0xf4);

method 2 is recommend.

2,134 次查看
SteveRathjen
Contributor III

Thanks for the response wj chen.

Would the change "method 2" affect mode 0 and mode 1?  I'm not sure what mode 1 provides.

It seems to me "method 1" would be safer because the framework provides a mechanism to select a "mode" and the change is at a higher level.  Changing a low level driver .c file seems more like a bug fix better left to someone else ;-).

Why do i need max11801_read_adc()?  Is it used to monitor the battery?  Could it be a general use A/D convertor?

Steve

0 项奖励
回复
2,134 次查看
shanchong234
Contributor III

Hi Steven,

Recently method 2 is not work for me now, i dont know why, and i have to do a little change as follows. i hope it will be hellpfull.

method 3:


     keep:  

                    max11801_mode = 1;

                    max11801_write_reg(client, GENERNAL_CONF_REG, 0xf3);


    change:

                    -  if (status & (MAX11801_EDGE_INT))                              // line 240  in max11801_ts_interrupt()

                    + if (status & 1)



0 项奖励
回复
2,134 次查看
SteveRathjen
Contributor III

Thanks!  I'm going to use mode 0, for now.  It has been working perfectly!

Steve

0 项奖励
回复
2,134 次查看
shanchong234
Contributor III

Hi Steve,

Method 2 is used to fix the bug in mode 1. In my project, I need to use max11801 to moniter my battery and drive the touch screen both .

If you only want to drive your touch screen, the mode 0 (method 1) will be fine.

max11801_read_adc() is used to get the voltage of the battery; And it is a general adc.

wj.chen

在 2014-01-17 02:46:02,"steve rathjen" <admin@community.freescale.com> 写道:

|

|

|

|

imx6 sabre-sdb and LCD touchscreen MAX11801

reply from steve rathjen in i.MX Community - View the full discussion

Thanks for the response wj chen.

Would the change "method 2" affect mode 0 and mode 1? I'm not sure what mode 1 provides.

It seems to me "method 1" would be safer because the framework provides a mechanism to select a "mode" and the change is at a higher level. Changing a low level driver .c file seems more like a bug fix better left to someone else ;-).

Why do i need max11801_read_adc()? Is it used to monitor the battery? Could it be a general use A/D convertor?

Steve

Reply to this message by replying to this email, or go to the message on Freescale Community

Start a new discussion in i.MX Community by email or at Freescale Community

Following imx6 sabre-sdb and LCD touchscreen MAX11801 in these streams: Inbox

|

|

0 项奖励
回复
2,134 次查看
SteveRathjen
Contributor III

Well, it works.  I'm not sure about the fix but here it is:
---
drivers/input/touchscreen/max11801_ts.c |    3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/max11801_ts.c b/drivers/input/touchscreen/max11801_ts.c
index a1ac2d2..681fff2 100755
--- a/drivers/input/touchscreen/max11801_ts.c
+++ b/drivers/input/touchscreen/max11801_ts.c
@@ -356,7 +356,8 @@ static int __devinit max11801_ts_probe(struct i2c_client *client,
         error = -ENOMEM;
         goto err_free_mem;
     }
-    max11801_workmode = *(int *)(client->dev).platform_data;
+    max11801_workmode = 0;    //force it SJR
+    //max11801_workmode = *(int *)(client->dev).platform_data;
     data->client = client;
     data->input_dev = input_dev;

The value for max11801_workmode comes from (I assume) .platform_data in:

~/fsl-community-bsp/build/tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.0.35-r38.14/git/arch/arm/mach-mx6/board-mx6q_sabresd.c

        I2C_BOARD_INFO("max11801", 0x48),

        .platform_data = (void *)&max11801_mode,

        .irq = gpio_to_irq(SABRESD_TS_INT),

but where is (void *)&max11801_mode?  I referenced the wrong patch before, see:

https://www.osadl.org/monitoring/patches/r8s7/1409-ENGR00178630-2-MX6DL-SabreSD-Add-enable_lcd_ldb-c...

So max11801_mode is ultimately set in board-mx6q_sabresd.c.  Wouldn't the correct thing to do be to remove/disable that patch?  But I can't find it in the recipe. How would I find it?  I could create a new patch for board-mx6q_sabresd.c instead of max11801_ts.c but what's the difference?  Which is better place to do it?  I don't plan on using the LVDS so does it really matter?

Steve