android 内核添加tourch screen

1,设备

Board-sapphire.c (arch/arm/mach-msm): 

static struct i2c_board_info i2c_devices[] = {
 {
  I2C_BOARD_INFO(SYNAPTICS_I2C_RMI_NAME, 0x20),
  .platform_data = sapphire_ts_data,
  .irq = SAPPHIRE_GPIO_TO_INT(SAPPHIRE_GPIO_TP_ATT_N)
 },
 {
  I2C_BOARD_INFO(ELAN_8232_I2C_NAME, 0x10),
  .platform_data = &elan_i2c_data,
  .irq = SAPPHIRE_GPIO_TO_INT(SAPPHIRE_GPIO_TP_ATT_N),
 },
 {
  I2C_BOARD_INFO("akm8976", 0x1C),
  .platform_data = &compass_platform_data,
  .irq = SAPPHIRE_GPIO_TO_INT(SAPPHIRE_GPIO_COMPASS_IRQ),
 },
 {
  I2C_BOARD_INFO("mt9t013", 0x6C >> 1),
  .platform_data = &msm_camera_device_mt9t013,
 },
};


2,驱动

Synaptics_i2c_rmi.c (drivers/input/touchscreen):

 

static const struct i2c_device_id synaptics_ts_id[] = {
 { SYNAPTICS_I2C_RMI_NAME, 0 },
 { }
};

static struct i2c_driver synaptics_ts_driver = {
 .probe  = synaptics_ts_probe,
 .remove  = synaptics_ts_remove,
#ifndef CONFIG_HAS_EARLYSUSPEND
 .suspend = synaptics_ts_suspend,
 .resume  = synaptics_ts_resume,
#endif
 .id_table = synaptics_ts_id,
 .driver = {
  .name = SYNAPTICS_I2C_RMI_NAME,
 },
};

 

3,Makefile

obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI) += synaptics_i2c_rmi.o

 

4,Kconfig

config TOUCHSCREEN_SYNAPTICS_I2C_RMI
 tristate "Synaptics i2c touchscreen"
 depends on I2C
 help
   This enables support for Synaptics RMI over I2C based touchscreens.

 

 

 

 

 

你可能感兴趣的:(c,android,struct,table)