|
@@ -484,31 +484,17 @@ static int goodix_reset(struct goodix_ts_data *ts)
|
|
|
{
|
|
{
|
|
|
int error;
|
|
int error;
|
|
|
|
|
|
|
|
- /* begin select I2C slave addr */
|
|
|
|
|
- error = gpiod_direction_output(ts->gpiod_rst, 0);
|
|
|
|
|
- if (error)
|
|
|
|
|
- return error;
|
|
|
|
|
-
|
|
|
|
|
msleep(20); /* T2: > 10ms */
|
|
msleep(20); /* T2: > 10ms */
|
|
|
|
|
|
|
|
/* HIGH: 0x28/0x29, LOW: 0xBA/0xBB */
|
|
/* HIGH: 0x28/0x29, LOW: 0xBA/0xBB */
|
|
|
- error = gpiod_direction_output(ts->gpiod_int, ts->client->addr == 0x14);
|
|
|
|
|
- if (error)
|
|
|
|
|
- return error;
|
|
|
|
|
|
|
+ gpiod_set_value_cansleep(ts->gpiod_int, ts->client->addr == 0x14);
|
|
|
|
|
|
|
|
usleep_range(100, 2000); /* T3: > 100us */
|
|
usleep_range(100, 2000); /* T3: > 100us */
|
|
|
|
|
|
|
|
- error = gpiod_direction_output(ts->gpiod_rst, 1);
|
|
|
|
|
- if (error)
|
|
|
|
|
- return error;
|
|
|
|
|
|
|
+ gpiod_set_value_cansleep(ts->gpiod_rst, 1);
|
|
|
|
|
|
|
|
usleep_range(6000, 10000); /* T4: > 5ms */
|
|
usleep_range(6000, 10000); /* T4: > 5ms */
|
|
|
|
|
|
|
|
- /* end select I2C slave addr */
|
|
|
|
|
- error = gpiod_direction_input(ts->gpiod_rst);
|
|
|
|
|
- if (error)
|
|
|
|
|
- return error;
|
|
|
|
|
-
|
|
|
|
|
error = goodix_int_sync(ts);
|
|
error = goodix_int_sync(ts);
|
|
|
if (error)
|
|
if (error)
|
|
|
return error;
|
|
return error;
|
|
@@ -532,7 +518,8 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts)
|
|
|
dev = &ts->client->dev;
|
|
dev = &ts->client->dev;
|
|
|
|
|
|
|
|
/* Get the interrupt GPIO pin number */
|
|
/* Get the interrupt GPIO pin number */
|
|
|
- gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_INT_NAME, GPIOD_IN);
|
|
|
|
|
|
|
+ gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_INT_NAME,
|
|
|
|
|
+ GPIOD_OUT_LOW);
|
|
|
if (IS_ERR(gpiod)) {
|
|
if (IS_ERR(gpiod)) {
|
|
|
error = PTR_ERR(gpiod);
|
|
error = PTR_ERR(gpiod);
|
|
|
if (error != -EPROBE_DEFER)
|
|
if (error != -EPROBE_DEFER)
|
|
@@ -544,7 +531,8 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts)
|
|
|
ts->gpiod_int = gpiod;
|
|
ts->gpiod_int = gpiod;
|
|
|
|
|
|
|
|
/* Get the reset line GPIO pin number */
|
|
/* Get the reset line GPIO pin number */
|
|
|
- gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_RST_NAME, GPIOD_IN);
|
|
|
|
|
|
|
+ gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_RST_NAME,
|
|
|
|
|
+ GPIOD_OUT_LOW);
|
|
|
if (IS_ERR(gpiod)) {
|
|
if (IS_ERR(gpiod)) {
|
|
|
error = PTR_ERR(gpiod);
|
|
error = PTR_ERR(gpiod);
|
|
|
if (error != -EPROBE_DEFER)
|
|
if (error != -EPROBE_DEFER)
|