Skip to content

Commit f830af5

Browse files
Zhou weixinrkhuangtao
authored andcommitted
input/touchscreen/rockchip_gslX680: add reset power control and revert_y setting
Change-Id: I4e836fdf59e4541c067bf35bec86bf4b6a5c0347 Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
1 parent c5c8a93 commit f830af5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/input/touchscreen/gslx680_d708/rockchip_gslX680.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <linux/version.h>
2828
#include <linux/slab.h>
2929
#include <linux/of_gpio.h>
30+
#include <linux/regulator/consumer.h>
3031
#include "../tp_suspend.h"
3132
#include "rockchip_gslX680_88v.h"
3233
#include "rockchip_gsl3670.h"
@@ -156,6 +157,7 @@ struct gsl_ts {
156157
#if defined(CONFIG_HAS_EARLYSUSPEND)
157158
struct early_suspend early_suspend;
158159
#endif
160+
struct regulator *rst;
159161
};
160162

161163
#ifdef GSL_DEBUG
@@ -1120,6 +1122,8 @@ static int gsl_ts_resume(struct device *dev)
11201122
}
11211123
#endif
11221124

1125+
if ((!IS_ERR(ts->rst)) && regulator_is_enabled(ts->rst) > 0)
1126+
regulator_disable(ts->rst);
11231127
gslX680_shutdown_high();
11241128
msleep(20);
11251129
reset_chip(ts->client);
@@ -1230,6 +1234,7 @@ static int gsl_ts_probe(struct i2c_client *client,
12301234

12311235
of_property_read_u32(np, "screen_max_x", &(ts->screen_max_x));
12321236
of_property_read_u32(np, "screen_max_y", &(ts->screen_max_y));
1237+
of_property_read_u32(np, "revert_y", &revert_y);
12331238

12341239
ts->irq_pin = of_get_named_gpio_flags(np, "touch-gpio", 0, NULL);
12351240
ts->wake_pin = of_get_named_gpio_flags(np, "wake-gpio", 0, &wake_flags);
@@ -1248,6 +1253,12 @@ static int gsl_ts_probe(struct i2c_client *client,
12481253
goto error_mutex_destroy;
12491254
}
12501255

1256+
ts->rst = devm_regulator_get(&client->dev, "rst");
1257+
if (IS_ERR(ts->rst)) {
1258+
dev_err(&client->dev, "failed to get regulator, %ld\n",
1259+
PTR_ERR(ts->rst));
1260+
}
1261+
12511262
rc = gsl_ts_init_ts(client, ts);
12521263
if (rc < 0) {
12531264
dev_err(&client->dev, "GSLX680 init failed\n");

0 commit comments

Comments
 (0)