This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Ili 210x capacitive touchscreen am335x custom board

HI all,

I have board loosely based on the am335x EVM. My U-boot version is 2013.01.01-psp06.00.00.00 and my Linux version is 3.2.0-psp04.06.00.11 .

I am trying to get an Ilitek ILI210X based Capacitive touchscreen to work but haven't gotten much out of it.

I found the drivers here:

http://lxr.free-electrons.com/source/drivers/input/touchscreen/ili210x.c?v=3.6

http://lxr.free-electrons.com/source/include/linux/input/ili210x.h

http://lxr.free-electrons.com/source/drivers/input/touchscreen/Kconfig?v=3.6

I think they are the same as is shipped with the 07.00.00.00 Linux TI SDK.

I added the following code to the i2c_board_info struct in the board-am335xevm.c file, 0x83 is the I2c read adress of my touchscreen, I don't know if this is the right one to enter here but I thought I'd give it a try:

static struct i2c_board_info am335x_i2c1_boardinfo[] = {
	{
	I2C_BOARD_INFO("ili210x", 0x83),
	},

And in the i2c1 init function:

static void i2c1_init(void)
{ 
	setup_pin_mux(i2c1_pin_mux);
	omap_register_i2c_bus(1, 100, am335x_i2c1_boardinfo,ARRAY_SIZE(am335x_i2c1_boardinfo));
	return;
}

I altered the omap register i2c bus call to have bus ID 1. Am I right to assume this will register the first in the am335x_i2c_boardinfo struct then?

I also altered the pin mux to my board:

static struct pinmux_config i2c1_pin_mux[] = {
	{"mii1_crs.i2c1_sda",    OMAP_MUX_MODE3 | AM33XX_SLEWCTRL_SLOW |
					AM33XX_PULL_ENBL | AM33XX_INPUT_EN},
	{"mii1_rxerr.i2c1_scl",   OMAP_MUX_MODE3 | AM33XX_SLEWCTRL_SLOW |
					AM33XX_PULL_ENBL | AM33XX_INPUT_EN},
	{"mcasp0_axr1.gpio3_20", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
	{"xdma_event_intr0.gpio0_19", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
	{NULL, 0},
};

I call the init functions in the am335xevm_init function:

am335x_evm_i2c_init();
i2c1_init();

I also altered the am335x_evm_i2c_init function because I think it was trying to find the EEPROM but my board doesn't have an EEPROM so I commented the omap_register_i2c_bus function call:

static void __init am335x_evm_i2c_init(void)
{
	/* Initially assume General Purpose EVM Config */
	am335x_evm_id = GEN_PURP_EVM;

	evm_init_cpld();
    //EDIT : hieronder wordt eeprom gezocht via i2c
//omap_register_i2c_bus(1, 100, am335x_i2c0_boardinfo,ARRAY_SIZE(am335x_i2c0_boardinfo));
}

Or do I have to delete the EEPROM entries in the am335x_i2c0_boardinfo struct completely? I haven't done this because I thought commenting the omap_register line described above was enough. Or do I have to add my touchscreen to this struct as wel?

static struct i2c_board_info __initdata am335x_i2c0_boardinfo[] = {
	{
		/* Daughter Board EEPROM */
		I2C_BOARD_INFO("24c256", DAUG_BOARD_I2C_ADDR),
		.platform_data  = &am335x_daughter_board_eeprom_info,
	},
	{
		/* Baseboard board EEPROM */
		I2C_BOARD_INFO("24c256", BASEBOARD_I2C_ADDR),
		.platform_data  = &am335x_baseboard_eeprom_info,
	},

When I compile the kernel with the ili210x driver, it gets loaded in but it doesn't print anything so I guess it's not really loaded in.

I'm probably forgetting something basic here but I'm puzzled as to what it could be.

Is there any TI board that already implements a capacitive touchscreen because I found that the AM335x SK had the option to implement a capacitive touchscreen so I thought I could get some inspiration out of this but I can't really find any info on it except this post:

http://e2e.ti.com/support/arm/sitara_arm/f/791/p/255787/1078320.aspx#1078320

Any help would be appreciated,

Laurens

  • To which I2C is your touchscreen connected? Have you pinmuxed it correctly? The following:

    Laurens Miers said:
    0x83 is the I2c read adress of my touchscreen, I don't know if this is the right one to enter here but I thought I'd give it a try:

    If you don't know the slave I2C address how do you expect to achieve communication?

  • I checked the hardware and it's definitely this I2C adress. My touchscreen is connected to I2C bus 1. But as you suggested, my pinmux appears wrong. When the kernel boots, this comes up:

    [    0.088958] _omap_mux_get_by_name: Could not find signal mii1_crs.i2c1_sda
    [    0.088989] _omap_mux_get_by_name: Could not find signal mii1_rxerr.i2c1_scl

    I don't know why the signal can't be found. In mux33xx.c I defined the signals:

    _AM33XX_MUXENTRY(MII1_CRS, 0,
    		"gmii1_crs", "rmii1_crs_dv", "spi1_d0", "i2c1_sda",
    		"mcasp1_aclkx", "uart5_ctsn", "uart2_rxd", "gpio3_1"),
    	_AM33XX_MUXENTRY(MII1_RXERR, 0,
    		"gmii1_rxerr", "rmii1_rxerr", "spi1_d1", "i2c1_scl",
    		"mcasp1_fsx", "uart5_rtsn", "uart2_txd", "gpio3_2"),

    And in board-am335xevm.c I have the pinmux declared for my touchscreen:

    static struct pinmux_config i2c1_pin_mux[] = {
    	{"mii1_crs.i2c1_sda",    OMAP_MUX_MODE3 | AM33XX_SLEWCTRL_SLOW |
    					AM33XX_PULL_ENBL | AM33XX_INPUT_EN},
    	{"mii1_rxerr.i2c1_scl",   OMAP_MUX_MODE3 | AM33XX_SLEWCTRL_SLOW |
    					AM33XX_PULL_ENBL | AM33XX_INPUT_EN},
    	{"mcasp0_axr1.gpio3_20", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},//toegevoegd voor tp_reset
    	{"xdma_event_intr0.gpio0_19", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
    	{NULL, 0},
    };

    and I set it up:

    static void i2c1_init(void)
    {   
        setup_pin_mux(i2c1_pin_mux);
    	omap_register_i2c_bus(2, 100, am335x_i2c1_boardinfo,ARRAY_SIZE(am335x_i2c1_boardinfo));
    	return;
    }