Kernel->driver:tp compatible with mt70817v2

This commit is contained in:
linjz
2016-05-05 10:13:46 +08:00
parent 54b7c620b6
commit ce82e07ea8
9 changed files with 15999 additions and 15 deletions

View File

@ -515,6 +515,19 @@
rockchip,prop = <PRMRY>;//<EXTEND>
status = "okay";
};
mt@40 {
status = "disabled";
compatible = "firefly,gsl3680";
reg = <0x40>;
touch-gpio = <&gpio7 GPIO_B5 IRQ_TYPE_EDGE_RISING>;
//reset-gpio = <&gpio7 GPIO_B1 GPIO_ACTIVE_LOW>;
max-y = <2048>;
max-x = <1536>;
flip-x = <1>;
flip-y = <1>;
swap-xy = <0>;
};
};
&i2c5 {

View File

@ -211,7 +211,7 @@
//used for init some gpio
init-gpios = <&gpio8 GPIO_A0 GPIO_ACTIVE_HIGH
&gpio7 GPIO_B1 GPIO_ACTIVE_HIGH
// &gpio7 GPIO_B1 GPIO_ACTIVE_HIGH
&gpio4 GPIO_B0 GPIO_ACTIVE_HIGH>;
gpio0_gpio {
gpio0_c2: gpio0-c2 {
@ -497,15 +497,33 @@
flip-x = <0>;
flip-y = <0>;
};
mt@40 {
status = "disabled";
compatible = "firefly,gsl3680";
reg = <0x40>;
touch-gpio = <&gpio5 GPIO_B0 IRQ_TYPE_EDGE_RISING>;
reset-gpio = <&gpio7 GPIO_B1 GPIO_ACTIVE_LOW>;
max-y = <2048>;
max-x = <1536>;
flip-x = <1>;
flip-y = <1>;
swap-xy = <0>;
};
ts@41 {
status = "disabled";
compatible = "tchip,gsl3680";
compatible = "firefly,gsl3680";
reg = <0x41>;
touch-gpio = <&gpio8 GPIO_A7 IRQ_TYPE_EDGE_RISING>;
//reset-gpio = <&gpio8 GPIO_A6 GPIO_ACTIVE_LOW>;
max-x = <1280>;
max-y = <800>;
flip-x = <0>;
flip-y = <0>;
swap-xy = <1>;
};
};
&i2c2 {

View File

@ -21,6 +21,10 @@ config TOUCHSCREEN_ZET62XX
help
zet62xx touchscreen driver
config TOUCHSCREEN_GSLX680_MT70817V2
tristate "GSLX680_MT70817V2 touchscreen driver"
help
GSLX680_MT70817V2 touchscreen driver
config TOUCHSCREEN_GSLX680
tristate "gslX680 touchscreen driver"

File diff suppressed because it is too large Load Diff

View File

@ -83,3 +83,8 @@ obj-$(CONFIG_TOUCHSCREEN_GSLX680) += rockchip_gslX680_firefly.o
obj-$(CONFIG_TOUCHSCREEN_GSLX680) += gsl_point_id.o
$(obj)/gsl_point_id.o: $(srctree)/$(obj)/gsl_point_id
cp $(srctree)/$(obj)/gsl_point_id $(obj)/gsl_point_id.o
obj-$(CONFIG_TOUCHSCREEN_GSLX680_MT70817V2) += rockchip_gslX680_firefly.o
obj-$(CONFIG_TOUCHSCREEN_GSLX680_MT70817V2) += gsl_point_id_mt70817v2.o
$(obj)/gsl_point_id_mt70817v2.o: $(srctree)/$(obj)/gsl_point_id_mt70817v2
cp $(srctree)/$(obj)/gsl_point_id_mt70817v2 $(obj)/gsl_point_id_mt70817v2.o

View File

@ -30,11 +30,18 @@
#include <linux/of_gpio.h>
#include "tp_suspend.h"
#ifdef CONFIG_TOUCHSCREEN_GSLX680_MT70817V2
#include "rockchip_mt70817v2_firefly.h"
#include "MT70817V2.h"
#endif
#ifdef CONFIG_TOUCHSCREEN_GSLX680
#include "rockchip_gslX680_firefly.h"
#define GSL_MONITOR
#endif
//#define GSL_DEBUG
#define GSL_MONITOR
#define REPORT_DATA_ANDROID_4_0
//#define HAVE_TOUCH_KEY
#define SLEEP_CLEAR_POINT
@ -154,6 +161,9 @@ struct gsl_ts {
int irq_pin;
int rst_pin;
int rst_val;
int flip_x;
int flip_y;
int swap_xy;
struct tp_device tp;
#if defined(CONFIG_HAS_EARLYSUSPEND)
struct early_suspend early_suspend;
@ -344,15 +354,16 @@ static void gsl_load_fw(struct i2c_client *client)
ptr_fw = GSL3680B_FW;
source_len = ARRAY_SIZE(GSL3680B_FW);
}
else
#endif
#ifdef CONFIG_TOUCHSCREEN_GSLX680
else
{
printk("--------------3680A-----------------------\n");
ptr_fw = GSL3680A_FW;
source_len = ARRAY_SIZE(GSL3680A_FW);
}
#endif
for (source_line = 0; source_line < source_len; source_line++)
{
/* init page trans, set the page val */
@ -424,12 +435,14 @@ static void startup_chip(struct i2c_client *client)
printk("----------3680B---------\n");
gsl_DataInit(gsl_config_data_id_3680B);
}
#ifdef TOUCHSCREEN_GSLX680
else
{
printk("----------3680A---------\n");
gsl_DataInit(gsl_config_data_id_3680A);
}
#endif
#endif
gsl_ts_write(client, 0xe0, &tmp, 1);
msleep(10);
@ -762,7 +775,12 @@ static void report_key(struct gsl_ts *ts, u16 x, u16 y)
static void report_data(struct gsl_ts *ts, u16 x, u16 y, u8 pressure, u8 id)
{
swap(x, y);
if(ts->flip_x == 1)
x = SCREEN_MAX_X - x;
if(ts->flip_y == 1)
y = SCREEN_MAX_Y - y;
if(ts->swap_xy ==1)
swap(x, y);
print_info("#####id=%d,x=%d,y=%d######\n",id,x,y);
@ -773,10 +791,11 @@ static void report_data(struct gsl_ts *ts, u16 x, u16 y, u8 pressure, u8 id)
#endif
return;
}
#ifdef CONFIG_TCHIP_MACH_BACK_MUSIC
y = SCREEN_MAX_Y - y;
#endif
#ifdef REPORT_DATA_ANDROID_4_0
input_mt_slot(ts->input, id);
input_report_abs(ts->input, ABS_MT_TRACKING_ID, id);
@ -1118,6 +1137,7 @@ static int gslX680_ts_init(struct i2c_client *client, struct gsl_ts *ts)
input_set_abs_params(input_device,ABS_MT_POSITION_X, 0, SCREEN_MAX_X, 0, 0);
input_set_abs_params(input_device,ABS_MT_POSITION_Y, 0, SCREEN_MAX_Y, 0, 0);
input_set_abs_params(input_device,ABS_MT_TOUCH_MAJOR, 0, PRESS_MAX, 0, 0);
input_set_abs_params(input_device,ABS_MT_WIDTH_MAJOR, 0, 200, 0, 0);
@ -1276,7 +1296,7 @@ static int gsl_ts_probe(struct i2c_client *client,
dev_err(&client->dev, "I2C functionality not supported\n");
return -ENODEV;
}
ts = devm_kzalloc(&client->dev,sizeof(*ts), GFP_KERNEL);
if (!ts)
return -ENOMEM;
@ -1293,6 +1313,15 @@ static int gsl_ts_probe(struct i2c_client *client,
printk("%s-%d\n", __FUNCTION__, __LINE__);
ts->irq_pin = of_get_named_gpio_flags(np, "touch-gpio", 0, (enum of_gpio_flags *)&irq_flags);
ts->rst_pin = of_get_named_gpio_flags(np, "reset-gpio", 0, &rst_flags);
if(of_property_read_u32(np, "flip-x", &ts->flip_x) < 0){
ts->flip_x = 0;
}
if(of_property_read_u32(np, "flip-y", &ts->flip_y) < 0){
ts->flip_y = 0;
}
if(of_property_read_u32(np, "swap-xy", &ts->swap_xy) < 0){
ts->swap_xy = 0;
}
if (gpio_is_valid(ts->rst_pin)) {
ts->rst_val = (rst_flags & OF_GPIO_ACTIVE_LOW) ? 0 : 1;
ret = devm_gpio_request_one(&client->dev, ts->rst_pin, (rst_flags & OF_GPIO_ACTIVE_LOW) ? GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW, "goodix reset pin");
@ -1424,7 +1453,7 @@ static const struct i2c_device_id gsl_ts_id[] = {
MODULE_DEVICE_TABLE(i2c, gsl_ts_id);
static struct of_device_id goodix_ts_dt_ids[] = {
{ .compatible = "tchip,gsl3680" },
{ .compatible = "firefly,gsl3680" },
{ }
};
static struct i2c_driver gsl_ts_driver = {

File diff suppressed because it is too large Load Diff

View File

@ -2549,7 +2549,7 @@ static void rockchip_irq_demux(unsigned int irq, struct irq_desc *desc)
generic_handle_irq(virq);
pin = irq;
DBG_PINCTRL("%s:irq=%d,%s\n",__func__, irq, bank->name);
// DBG_PINCTRL("%s:irq=%d,%s\n",__func__, irq, bank->name);
}
if (bank->toggle_edge_mode && edge_changed) {
@ -2720,7 +2720,7 @@ static void rockchip_gpio_irq_unmask(struct irq_data *d)
GPIOEnableIntr(bank->reg_base, bit);
spin_unlock_irqrestore(&bank->slock, flags);
DBG_PINCTRL("%s:irq=%d,hwirq=%d,bank->reg_base=0x%x,bit=%d\n",__func__,d->irq, (int)d->hwirq, (int)bank->reg_base,bit);
// DBG_PINCTRL("%s:irq=%d,hwirq=%d,bank->reg_base=0x%x,bit=%d\n",__func__,d->irq, (int)d->hwirq, (int)bank->reg_base,bit);
}
static void rockchip_gpio_irq_mask(struct irq_data *d)
@ -2736,7 +2736,7 @@ static void rockchip_gpio_irq_mask(struct irq_data *d)
GPIODisableIntr(bank->reg_base, bit);
spin_unlock_irqrestore(&bank->slock, flags);
DBG_PINCTRL("%s:irq=%d,hwirq=%d,bank->reg_base=0x%x,bit=%d\n",__func__,d->irq, (int)d->hwirq, (int)bank->reg_base,bit);
// DBG_PINCTRL("%s:irq=%d,hwirq=%d,bank->reg_base=0x%x,bit=%d\n",__func__,d->irq, (int)d->hwirq, (int)bank->reg_base,bit);
}
static void rockchip_gpio_irq_ack(struct irq_data *d)
@ -2749,7 +2749,7 @@ static void rockchip_gpio_irq_ack(struct irq_data *d)
GPIOAckIntr(bank->reg_base, bit);
DBG_PINCTRL("%s:irq=%d,hwirq=%d,bank->reg_base=0x%x,bit=%d\n",__func__,d->irq, (int)d->hwirq, (int)bank->reg_base,bit);
// DBG_PINCTRL("%s:irq=%d,hwirq=%d,bank->reg_base=0x%x,bit=%d\n",__func__,d->irq, (int)d->hwirq, (int)bank->reg_base,bit);
}