same as "interrupts" node. It will also
contain active low or active high information.
- ite,reset-gpio : reset gpio to control the reset of chip
+ - ite,reset-delay : reset delay for controller (ms), default 20
Optional properties:
- avdd-supply : Analog power supply needed to power device
config defined in pin groups of interrupt and reset gpio.
"pmx_ts_release" : Release configuration of pins, this should specify
release config defined in pin groups of interrupt and reset gpio.
+ - ite,low-reset : boolean, if the controller needs low-state of the reset gpio while
+ initializing, and reset gpio should be made as high-state to reset the
+ controller. It means the controller needs "active-high" reset gpio.
Required properties palm-detect-en feature:
- ite,palm-detect-keycode : The keycode that is required to be sent when
ite,panel-coords = <0 0 320 320>;
ite,display-coords = <0 0 320 320>;
ite,num-fingers = <2>;
+ ite,reset-delay = <20>;
+ ite,low-reset;
};
};
#define PINCTRL_STATE_ACTIVE "pmx_ts_active"
#define PINCTRL_STATE_SUSPEND "pmx_ts_suspend"
#define PINCTRL_STATE_RELEASE "pmx_ts_release"
+#define IT_I2C_WAIT 1000
struct FingerData {
uint8_t xLo;
unsigned int disp_maxx;
unsigned int disp_maxy;
unsigned num_of_fingers;
+ unsigned int reset_delay;
+ bool low_reset;
};
struct IT7260_ts_data {
query = CMD_STATUS_BUSY;
if (slowly)
- mdelay(1000);
+ msleep(IT_I2C_WAIT);
if (!forever)
count--;
snprintf(gl_ts->cfg_name, MAX_BUFFER_SIZE, "%s",
(pdata->cfg_name != NULL) ? pdata->cfg_name : CFG_NAME);
+ rc = of_property_read_u32(np, "ite,reset-delay", &temp_val);
+ if (!rc)
+ pdata->reset_delay = temp_val;
+ else if (rc != -EINVAL) {
+ dev_err(dev, "Unable to read reset delay\n");
+ return rc;
+ }
+
+ pdata->low_reset = of_property_read_bool(np, "ite,low-reset");
+
rc = IT7260_get_dt_coords(dev, "ite,display-coords", pdata);
if (rc && (rc != -EINVAL))
return rc;
if (gpio_request(pdata->reset_gpio, "ite_reset_gpio")) {
dev_err(&client->dev,
"gpio_request failed for reset GPIO\n");
- return -EINVAL;
- }
- if (gpio_direction_output(pdata->reset_gpio, 0)) {
- dev_err(&client->dev,
- "gpio_direction_output for reset GPIO\n");
- return -EINVAL;
+ if (pdata->low_reset) {
+ if (gpio_direction_output(pdata->reset_gpio, 0))
+ dev_err(&gl_ts->client->dev,
+ "gpio_direction_output for reset GPIO\n");
+ } else {
+ if (gpio_direction_output(pdata->reset_gpio, 1))
+ dev_err(&gl_ts->client->dev,
+ "gpio_direction_output for reset GPIO\n");
}
dev_dbg(&gl_ts->client->dev, "Reset GPIO %d\n",
pdata->reset_gpio);
#endif
IT7260_i2cWriteNoReadyCheck(BUF_COMMAND, cmd_start, sizeof(cmd_start));
- mdelay(10);
+ msleep(pdata->reset_delay);
IT7260_i2cReadNoReadyCheck(BUF_RESPONSE, rsp, sizeof(rsp));
- mdelay(10);
+ msleep(pdata->reset_delay);
gl_ts->dir = debugfs_create_dir(DEBUGFS_DIR_NAME, NULL);
if (gl_ts->dir == NULL || IS_ERR(gl_ts->dir)) {