#include <linux/platform_data/atmel_mxt_ts.h>
#include <linux/input.h>
#include <linux/interrupt.h>
+#include <linux/ioport.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
struct i2c_peripheral {
struct i2c_board_info board_info;
unsigned short alt_addr;
+
const char *dmi_name;
+ unsigned long irqflags;
+ struct resource irq_resource;
+
enum i2c_adapter_type type;
u32 pci_devid;
},
};
-static struct mxt_platform_data atmel_1664s_platform_data = {
- .irqflags = IRQF_TRIGGER_FALLING,
-};
-
static int chromebook_pixel_tp_keys[] = {
KEY_RESERVED,
KEY_RESERVED,
};
static struct mxt_platform_data chromebook_pixel_tp_platform_data = {
- .irqflags = IRQF_TRIGGER_FALLING,
.t19_num_keys = ARRAY_SIZE(chromebook_pixel_tp_keys),
.t19_keymap = chromebook_pixel_tp_keys,
};
.board_info = {
I2C_BOARD_INFO("atmel_mxt_ts",
ATMEL_TS_I2C_ADDR),
- .platform_data = &atmel_1664s_platform_data,
.flags = I2C_CLIENT_WAKE,
},
.dmi_name = "touchscreen",
+ .irqflags = IRQF_TRIGGER_FALLING,
.type = I2C_ADAPTER_PANEL,
.alt_addr = ATMEL_TS_I2C_BL_ADDR,
},
.flags = I2C_CLIENT_WAKE,
},
.dmi_name = "trackpad",
+ .irqflags = IRQF_TRIGGER_FALLING,
.type = I2C_ADAPTER_VGADDC,
.alt_addr = ATMEL_TP_I2C_BL_ADDR,
},
.board_info = {
I2C_BOARD_INFO("atmel_mxt_ts",
ATMEL_TS_I2C_ADDR),
- .platform_data = &atmel_1664s_platform_data,
.flags = I2C_CLIENT_WAKE,
},
.dmi_name = "touchscreen",
+ .irqflags = IRQF_TRIGGER_FALLING,
.type = I2C_ADAPTER_DESIGNWARE,
.pci_devid = PCI_DEVID(0, PCI_DEVFN(0x15, 0x2)),
.alt_addr = ATMEL_TS_I2C_BL_ADDR,
irq = chromeos_laptop_get_irq_from_dmi(i2c_dev->dmi_name);
if (irq < 0)
return ERR_PTR(irq);
+
+ i2c_dev->irq_resource = (struct resource)
+ DEFINE_RES_NAMED(irq, 1, NULL,
+ IORESOURCE_IRQ | i2c_dev->irqflags);
+ i2c_dev->board_info.resources = &i2c_dev->irq_resource;
+ i2c_dev->board_info.num_resources = 1;
}
return cros_laptop;