atmel mxt1066T2 capacitive touch
Posted: Tue Jul 04, 2017 2:50 pm
hi
I can not drive atmel mxt1066T2 with NanoPC-T3 borad.
I add following code to device.c file in address arch/arm/plat-s5p6818 but no get responses from touch screen.
first added code:
/* TSP */
static struct mxt_platform_data mxt_platform_data = {
.x_line = 18,
.y_line = 11,
.x_size = 1024,
.y_size = 600,
.blen = 0x1,
.threshold = 0x28,
.voltage = 2800000, /* 2.8V */
.orient = MXT_DIAGONAL_COUNTER,
.irqflags = IRQF_TRIGGER_FALLING,
};
static struct i2c_board_info mxt_devs[] __initdata = {
{
I2C_BOARD_INFO("atmel_mxt_ts", 0x4a),
.platform_data = &mxt_platform_data,
.irq = PB_PIO_IRQ(CFG_IO_TOUCH_IRQ),
//.irq = IRQ_EINT(4),
//.irq = PB_PIO_IRQ(CFG_IO_TOUCH_IRQ),
},
};
#if defined(CONFIG_TOUCHSCREEN_ATMEL_MXT) //add in __init nxp_board_devs_register() function
printk("plat: add touch(MXT) device. by shokri...\n");
//mxt_platform_data.screen_max_x = lcd->width;
//mxt_platform_data.screen_max_y = lcd->height;
i2c_register_board_info(/*GOODIX_I2C_BUS*/2, &mxt_devs[0], 1);
platform_add_devices(MXT_devices, ARRAY_SIZE(MXT_devices));
printk("plat: mxt: irq=%d (%d)\n", PB_PIO_IRQ(CFG_IO_TOUCH_IRQ), CFG_IO_TOUCH_IRQ);
#endif
Second added code:
#if defined(CONFIG_TOUCHSCREEN_ATMEL_MXT)
//#include <linux/platform_data/goodix_touch.h>
#include <linux/i2c/atmel_mxt_ts.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/of_regulator.h>
#include <linux/regulator/machine.h>
//#define GOODIX_I2C_BUS (2)////////////////////
/* TSP */
static struct regulator_consumer_supply tsp_fixed_consumer =
REGULATOR_SUPPLY("vdd", "3-004a");
static struct regulator_init_data tsp_fixed_voltage_init_data = {
.constraints = {
.name = "TSP_2.8V",
},
.num_consumer_supplies = 1,
.consumer_supplies = &tsp_fixed_consumer,
};
static struct fixed_voltage_config tsp_fixed_voltage_config = {
.supply_name = "TSP_VDD",
.microvolts = 2800000,
.gpio = -EINVAL,
.init_data = &tsp_fixed_voltage_init_data,
};
static struct platform_device tsp_fixed_voltage = {
.name = "reg-fixed-voltage",
.id = 3,//FIXED_REG_ID_TSP_2_8V,
.dev = {
.platform_data = &tsp_fixed_voltage_config,
},
};
/* TSP */
static struct mxt_platform_data mxt_platform_data = {
.x_line = 18,
.y_line = 11,
.x_size = 1024,
.y_size = 600,
.blen = 0x1,
.threshold = 0x28,
.voltage = 2800000, /* 2.8V */
.orient = MXT_DIAGONAL_COUNTER,
.irqflags = IRQF_TRIGGER_FALLING,
};
/*static struct s3c2410_platform_i2c i2c3_data __initdata = {
.flags = 0,
.bus_num = 3,
.slave_addr = 0x10,
.frequency = 400 * 1000,
.sda_delay = 100,
};*/
static struct i2c_board_info mxt_devs[] __initdata = {
{
I2C_BOARD_INFO("atmel_mxt_ts", 0x4a),
.platform_data = &mxt_platform_data,
.irq = PB_PIO_IRQ(CFG_IO_TOUCH_IRQ),
//.irq = IRQ_EINT(4),
//.irq = PB_PIO_IRQ(CFG_IO_TOUCH_IRQ),
},
};
static struct platform_device *MXT_devices[] = {
&tsp_fixed_voltage,
};
#endif
#if defined(CONFIG_TOUCHSCREEN_ATMEL_MXT) //add in __init nxp_board_devs_register() function
printk("plat: add touch(MXT) device. by shokri...\n");
//mxt_platform_data.screen_max_x = lcd->width;
//mxt_platform_data.screen_max_y = lcd->height;
i2c_register_board_info(/*GOODIX_I2C_BUS*/2, &mxt_devs[0], 1);
platform_add_devices(MXT_devices, ARRAY_SIZE(MXT_devices));
printk("plat: mxt: irq=%d (%d)\n", PB_PIO_IRQ(CFG_IO_TOUCH_IRQ), CFG_IO_TOUCH_IRQ);
#endif
/*********************************************************/
error massage when connect touch screen to board is "atmel_mxt_ts 2-004a: Failed to get supply 'vdd': -517".
even when not connect touch screen to board, above massage show in terminal.
please help me for drive this touch screen.
thanks.
I can not drive atmel mxt1066T2 with NanoPC-T3 borad.
I add following code to device.c file in address arch/arm/plat-s5p6818 but no get responses from touch screen.
first added code:
/* TSP */
static struct mxt_platform_data mxt_platform_data = {
.x_line = 18,
.y_line = 11,
.x_size = 1024,
.y_size = 600,
.blen = 0x1,
.threshold = 0x28,
.voltage = 2800000, /* 2.8V */
.orient = MXT_DIAGONAL_COUNTER,
.irqflags = IRQF_TRIGGER_FALLING,
};
static struct i2c_board_info mxt_devs[] __initdata = {
{
I2C_BOARD_INFO("atmel_mxt_ts", 0x4a),
.platform_data = &mxt_platform_data,
.irq = PB_PIO_IRQ(CFG_IO_TOUCH_IRQ),
//.irq = IRQ_EINT(4),
//.irq = PB_PIO_IRQ(CFG_IO_TOUCH_IRQ),
},
};
#if defined(CONFIG_TOUCHSCREEN_ATMEL_MXT) //add in __init nxp_board_devs_register() function
printk("plat: add touch(MXT) device. by shokri...\n");
//mxt_platform_data.screen_max_x = lcd->width;
//mxt_platform_data.screen_max_y = lcd->height;
i2c_register_board_info(/*GOODIX_I2C_BUS*/2, &mxt_devs[0], 1);
platform_add_devices(MXT_devices, ARRAY_SIZE(MXT_devices));
printk("plat: mxt: irq=%d (%d)\n", PB_PIO_IRQ(CFG_IO_TOUCH_IRQ), CFG_IO_TOUCH_IRQ);
#endif
Second added code:
#if defined(CONFIG_TOUCHSCREEN_ATMEL_MXT)
//#include <linux/platform_data/goodix_touch.h>
#include <linux/i2c/atmel_mxt_ts.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/of_regulator.h>
#include <linux/regulator/machine.h>
//#define GOODIX_I2C_BUS (2)////////////////////
/* TSP */
static struct regulator_consumer_supply tsp_fixed_consumer =
REGULATOR_SUPPLY("vdd", "3-004a");
static struct regulator_init_data tsp_fixed_voltage_init_data = {
.constraints = {
.name = "TSP_2.8V",
},
.num_consumer_supplies = 1,
.consumer_supplies = &tsp_fixed_consumer,
};
static struct fixed_voltage_config tsp_fixed_voltage_config = {
.supply_name = "TSP_VDD",
.microvolts = 2800000,
.gpio = -EINVAL,
.init_data = &tsp_fixed_voltage_init_data,
};
static struct platform_device tsp_fixed_voltage = {
.name = "reg-fixed-voltage",
.id = 3,//FIXED_REG_ID_TSP_2_8V,
.dev = {
.platform_data = &tsp_fixed_voltage_config,
},
};
/* TSP */
static struct mxt_platform_data mxt_platform_data = {
.x_line = 18,
.y_line = 11,
.x_size = 1024,
.y_size = 600,
.blen = 0x1,
.threshold = 0x28,
.voltage = 2800000, /* 2.8V */
.orient = MXT_DIAGONAL_COUNTER,
.irqflags = IRQF_TRIGGER_FALLING,
};
/*static struct s3c2410_platform_i2c i2c3_data __initdata = {
.flags = 0,
.bus_num = 3,
.slave_addr = 0x10,
.frequency = 400 * 1000,
.sda_delay = 100,
};*/
static struct i2c_board_info mxt_devs[] __initdata = {
{
I2C_BOARD_INFO("atmel_mxt_ts", 0x4a),
.platform_data = &mxt_platform_data,
.irq = PB_PIO_IRQ(CFG_IO_TOUCH_IRQ),
//.irq = IRQ_EINT(4),
//.irq = PB_PIO_IRQ(CFG_IO_TOUCH_IRQ),
},
};
static struct platform_device *MXT_devices[] = {
&tsp_fixed_voltage,
};
#endif
#if defined(CONFIG_TOUCHSCREEN_ATMEL_MXT) //add in __init nxp_board_devs_register() function
printk("plat: add touch(MXT) device. by shokri...\n");
//mxt_platform_data.screen_max_x = lcd->width;
//mxt_platform_data.screen_max_y = lcd->height;
i2c_register_board_info(/*GOODIX_I2C_BUS*/2, &mxt_devs[0], 1);
platform_add_devices(MXT_devices, ARRAY_SIZE(MXT_devices));
printk("plat: mxt: irq=%d (%d)\n", PB_PIO_IRQ(CFG_IO_TOUCH_IRQ), CFG_IO_TOUCH_IRQ);
#endif
/*********************************************************/
error massage when connect touch screen to board is "atmel_mxt_ts 2-004a: Failed to get supply 'vdd': -517".
even when not connect touch screen to board, above massage show in terminal.
please help me for drive this touch screen.
thanks.