Imx6q board i2c transfer failed

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

Imx6q board i2c transfer failed

4,112 Views
jigarchokshi
Contributor II

Hello,

I am new to ubuntu and imx6 also.

i build kernel using linux 3.0.35. and i also installed for input atmel_mxt_ts driver for my input.

 

"board-mx6q_sabreauto.c" is build board file which i used to build my kernel.

"atmel_mxt_ts" is a driver file for my touchscreen which i am using.

 

but when i tried to installed kernel module using "insmod atmel_mxt_ts.ko" i am getting error as shown below.

 

atmel_mxt_ts 2-004c: __mxt_read_reg: i2c transfer failed                       

atmel_mxt_ts: probe of 2-004c failed with error -5

 

Thank you,

Jigar Chokshi

Original Attachment has been moved to: atmel_mxt_ts.c.zip

Original Attachment has been moved to: board-mx6q_sabreauto.c.zip

Labels (3)
4 Replies

1,855 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello,Jigar,

     I checked your BSP file and touchscreen driver. Your porting method is correct. Because I don't have device to test it, I can only give you some advice or remind you.

(1)Conifirmming if I2C address is correct

In our linux BSP, I2C device is using 7-bit address, So check it comparing datasheet of touchscreen.

(2)Compiling atmel_mxt_ts driver into linux kernel

Let us adjust compiling method, compile ts driver into linux kernel directly.

(3)Confirmming if issue was from I2C controller

In order to confirm if the issue was generated by I2C controller, we can use GPIO to simulate these 2 lines of I2C3(from yourto BSP, i2c3 is being used). The following is an example for you, you can refter to this usage.

--------a) Adding some code in BSP file.

...

#include <linux/i2c-gpio.h>

...

#define GPIO_I2C4_SDA  IMX_GPIO_NR(3, 18) /*EIM_D18 pin*/

#define GPIO_I2C4_SCL  IMX_GPIO_NR(1, 3)  /*GPIO_3 pin*/

...

/* GPIO I2C data -- I2C4 */

struct i2c_gpio_platform_data mx6q_gpio_i2c4_data = {

.sda_pin = GPIO_I2C4_SDA,

.scl_pin = GPIO_I2C4_SCL,

.sda_is_open_drain = 0,

.scl_is_open_drain = 0,

};

/* GPIO I2C platform device -- I2C4*/

static struct platform_device gpio_i2c_device[] = {

{

  .name = "i2c-gpio",

  .id = 3,

  .dev = {

   .platform_data = &mx6q_gpio_i2c4_data,

  },

},

};

...

static struct i2c_board_info gpio_i2c3_board_info[] __initdata = {

{

       I2C_BOARD_INFO("atmel_mxt_ts", 0x4c),

      .platform_data = &mxt_platform_data,

     .irq  = gpio_to_irq(MXT_CHG_PIN),

},

};

...

platform_device_register(&gpio_i2c_device[0]); /*gpio simulate I2C - here is I2C4*/

....

i2c_register_board_info(3, gpio_i2c3_board_info,ARRAY_SIZE(gpio_i2c3_board_info)); /*gpio i2c board*/

....

--------b) Adjusting baord-mx6q_sabreauto.h file ( Multiplex these 2 pins as GPIOs)

...

static iomux_v3_cfg_t mx6q_i2c3_pads_rev_b[] __initdata = {

MX6Q_PAD_GPIO_3__GPIO_1_3,

MX6Q_PAD_EIM_D18__GPIO_3_18,

};

...

-------c) Adding gpio i2c drivers when compiling linux kernel

The driver is in path "liunx/drivers/i2c/busses/i2c-gpio.c"

   At first , please test (1) & (2) steps ! If there is no improvement, you can use 3rd way to debug your i2c device.

Regards,

Weidong

1,855 Views
jigarchokshi
Contributor II

Hello Weidong,

Thank you for your help and support.

But i was wrong.

I have a touchscreen from boundary devices . so that i must use tsc2004 touchscreen driver and later i installed that driver.

and it's working.

Thanks,

jigar

0 Kudos

1,855 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Ok, Jigar,

    Good job !

Regards,

Weidong

0 Kudos

1,855 Views
YixingKong
Senior Contributor IV

Jigar

I asummed yor issue had been resolved and close the discussion. If you still have further question, please reopen the discussion or create another one.

Thanks,

Yixing

0 Kudos