mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 06:25:52 +02:00
ARM64: dts: rockchip: support gt9xx for Rockchip platform
Add support gt9xx driver for Rockchip platform goodix touchscreen. There is a goodix driver on upstream but it not work well, so use the old driver until someone debug the upstream driver. Change-Id: Id8711a63150da4bdcd8e78f3b2a82157e1b3de4f Signed-off-by: Xu Jianqun <jay.xu@rock-chips.com>
This commit is contained in:
parent
795623a4c5
commit
cc754b8c11
|
|
@ -48,7 +48,7 @@ / {
|
|||
compatible = "rockchip,sheep", "rockchip,rk3368";
|
||||
};
|
||||
|
||||
>911 {
|
||||
>9xx {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -324,6 +324,17 @@ gt911: gt911@14 {
|
|||
interrupts = <12 0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gt9xx: gt9xx@14 {
|
||||
compatible = "goodix,gt9xx";
|
||||
reg = <0x14>;
|
||||
touch-gpio = <&gpio0 12 IRQ_TYPE_LEVEL_LOW>;
|
||||
reset-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
|
||||
max-x = <1200>;
|
||||
max-y = <1900>;
|
||||
tp-size = <911>;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
&pwm0 {
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ CONFIG_TABLET_USB_GTCO=y
|
|||
CONFIG_TABLET_USB_HANWANG=y
|
||||
CONFIG_TABLET_USB_KBTAB=y
|
||||
CONFIG_INPUT_TOUCHSCREEN=y
|
||||
CONFIG_TOUCHSCREEN_GOODIX=y
|
||||
CONFIG_TOUCHSCREEN_GT9XX=y
|
||||
CONFIG_INPUT_MISC=y
|
||||
CONFIG_INPUT_UINPUT=y
|
||||
# CONFIG_SERIO is not set
|
||||
|
|
|
|||
|
|
@ -335,6 +335,15 @@ config TOUCHSCREEN_GOODIX
|
|||
To compile this driver as a module, choose M here: the
|
||||
module will be called goodix.
|
||||
|
||||
config TOUCHSCREEN_GT9XX
|
||||
tristate "Goodix gt9xx support for rockchip platform"
|
||||
depends on I2C && ARCH_ROCKCHIP
|
||||
help
|
||||
Say Y here if you have a touchscreen interface using the gt9xx
|
||||
on Rockchip platform, and your board-specific initialization
|
||||
code includes that in its table of IIC devices.
|
||||
If unsure, say N.
|
||||
|
||||
config TOUCHSCREEN_ILI210X
|
||||
tristate "Ilitek ILI210X based touchscreen"
|
||||
depends on I2C
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ obj-$(CONFIG_TOUCHSCREEN_EGALAX) += egalax_ts.o
|
|||
obj-$(CONFIG_TOUCHSCREEN_FT6236) += ft6236.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_FUJITSU) += fujitsu_ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_GOODIX) += goodix.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_GT9XX) += gt9xx/
|
||||
obj-$(CONFIG_TOUCHSCREEN_ILI210X) += ili210x.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_IMX6UL_TSC) += imx6ul_tsc.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_INEXIO) += inexio.o
|
||||
|
|
|
|||
|
|
@ -158,15 +158,18 @@ s32 gtp_i2c_read(struct i2c_client *client, u8 *buf, s32 len)
|
|||
msgs[0].addr = client->addr;
|
||||
msgs[0].len = GTP_ADDR_LENGTH;
|
||||
msgs[0].buf = &buf[0];
|
||||
#ifdef CONFIG_I2C_ROCKCHIP_COMPAT
|
||||
msgs[0].scl_rate=200 * 1000;
|
||||
//msgs[0].scl_rate = 300 * 1000; // for Rockchip, etc.
|
||||
|
||||
#endif
|
||||
msgs[1].flags = I2C_M_RD;
|
||||
msgs[1].addr = client->addr;
|
||||
msgs[1].len = len - GTP_ADDR_LENGTH;
|
||||
msgs[1].buf = &buf[GTP_ADDR_LENGTH];
|
||||
#ifdef CONFIG_I2C_ROCKCHIP_COMPAT
|
||||
msgs[1].scl_rate=200 * 1000;
|
||||
//msgs[1].scl_rate = 300 * 1000;
|
||||
//msgs[1].scl_rate = 300 * 1000; // for Rockchip, etc.
|
||||
#endif
|
||||
|
||||
while(retries < 5)
|
||||
{
|
||||
|
|
@ -228,9 +231,10 @@ s32 gtp_i2c_write(struct i2c_client *client,u8 *buf,s32 len)
|
|||
msg.addr = client->addr;
|
||||
msg.len = len;
|
||||
msg.buf = buf;
|
||||
#ifdef CONFIG_I2C_ROCKCHIP_COMPAT
|
||||
msg.scl_rate=200 * 1000;
|
||||
//msg.scl_rate = 300 * 1000; // for Rockchip, etc
|
||||
|
||||
#endif
|
||||
while(retries < 5)
|
||||
{
|
||||
ret = i2c_transfer(client->adapter, &msg, 1);
|
||||
|
|
@ -1676,8 +1680,6 @@ static ssize_t gt91xx_config_write_proc(struct file *filp, const char __user *bu
|
|||
{
|
||||
s32 ret = 0;
|
||||
|
||||
GTP_DEBUG("write count %d\n", count);
|
||||
|
||||
if (count > GTP_CONFIG_MAX_LENGTH)
|
||||
{
|
||||
GTP_ERROR("size not match [%d:%zu]\n", GTP_CONFIG_MAX_LENGTH, count);
|
||||
|
|
@ -1943,7 +1945,7 @@ static int goodix_ts_early_suspend(struct tp_device *tp_d)
|
|||
// delay 48 + 10ms to ensure reliability
|
||||
msleep(58);
|
||||
regulator_tp = regulator_get(NULL,"vcc_tp");
|
||||
if(regulator_tp ==NULL)
|
||||
if(IS_ERR(regulator_tp))
|
||||
{
|
||||
printk("!!!!%s:%d:get regulator_tp failed\n",__func__,__LINE__);
|
||||
return 0;
|
||||
|
|
@ -1978,7 +1980,7 @@ static int goodix_ts_early_resume(struct tp_device *tp_d)
|
|||
GTP_INFO("System resume.");
|
||||
|
||||
regulator_tp = regulator_get(NULL, "vcc_tp");
|
||||
if(regulator_tp ==NULL)
|
||||
if(IS_ERR(regulator_tp))
|
||||
{
|
||||
printk("!!!!%s:%d:get regulator_tp failed\n",__func__,__LINE__);
|
||||
return 0;
|
||||
|
|
@ -2567,14 +2569,13 @@ static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id
|
|||
struct device_node *np = client->dev.of_node;
|
||||
enum of_gpio_flags rst_flags, pwr_flags;
|
||||
u32 val;
|
||||
printk("___%s() start____ \n", __func__);
|
||||
printk("%s() start\n", __func__);
|
||||
|
||||
|
||||
GTP_DEBUG_FUNC();
|
||||
|
||||
//do NOT remove these logs
|
||||
GTP_INFO("GTP Driver Version: %s", GTP_DRIVER_VERSION);
|
||||
GTP_INFO("GTP Driver Built@%s, %s", __TIME__, __DATE__);
|
||||
GTP_INFO("GTP I2C Address: 0x%02x", client->addr);
|
||||
|
||||
i2c_connect_client = client;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user