EETI driver i2c

Hi guys,

EETI sent me this non-device tree driver configuration,

Please build the egalax_i2c driver into the kernel.

EETI I2C controller slave address is 0x2A. Please register the I2C device like below code in the hardware setup. Check the actual I2C channel number and INT pin to set the correct GPIO pin number.

Below example channel number is 3 and GPIO is GPIO_PB6.

################################################################### 
static struct i2c_board_info __initdata egalax_i2c_boardinfo[] = { 
    { 
        .type   = "egalax_i2c", 
        .addr   = 0x2A,  
    }, 
}; 

egalax_i2c_boardinfo[0].irq = gpio_to_irq(GPIO_PB6); 
i2c_register_board_info(3, egalax_i2c_boardinfo, ARRAY_SIZE(egalax_i2c_boardinfo)); 
if(gpio_request(GPIO_PB6, "Touch IRQ") < 0) 
    printk(KERN_ERR "Failed to request GPIO%d for Touch IRQ\n", GPIO_PB6);  
else 
    gpio_direction_input(GPIO_PB6);

but im new to this world, and i dont know where to put it, i downloaded the lemaker build environment and i built the egalax_i2c driver. but i dont know where to put " static struct i2c_board_info __initdata egalax_i2c_boardinfo = { …" Thank you for your help

i have got your mail ,and our RD will test it .

1 Like

can you tell me ,what kernel version are you used . what image are you used.???/

we have send all driver code to you.

if you want to use this driver ,you need include this ceode to armbian kernel and rebuild all armbian kernel .

  1. Download the armbian legacy source code and compile it.

  2. Copy egalax_bpi.c to sources/linux/sunxi/sunxi-3.4/drivers/input/touchscreen/ and patch the Kconfig and Makefile in the same directory.

  3. patch bananapipro.fex in lib/config/bananapipro.fex.

  4. Configure the kernel to include the new driver and then compile the source code again.

About source code download and compile, please reference to http://www.armbian.com/using-armbian-tools/

If you want compile the driver in the board running envrionment, please using the original driver package you send before and replace the .c file with the new one, rename it to egalax_i2c.c, then run make command.