static int TestPreparation(struct synaptics_ts_data *ts) { u8 data = 0; ReadChCount(ts); /*Turn off CBC.*/ touch_i2c_read(ts->client, ANALOG_CONTROL_REG, 1, &data); data = data & 0xDF; touch_i2c_write(ts->client, ANALOG_CONTROL_REG, 1, &data); /*Apply ForceUpdate.*/ touch_i2c_read(ts->client, ANALOG_COMMAND_REG, 1, &data); data = data | 0x04; touch_i2c_write(ts->client, ANALOG_COMMAND_REG, 1, &data); msleep(WAIT_TIME); /*Apply ForceCal.*/ touch_i2c_read(ts->client, ANALOG_COMMAND_REG, 1, &data); data = data | 0x02; touch_i2c_write(ts->client, ANALOG_COMMAND_REG, 1, &data); msleep(WAIT_TIME); return NO_ERROR; }
static int TestPreparation(struct synaptics_ts_data *ts) { int ret = 0; u8 data = 0; ReadChCount(ts); /*Turn off CBC.*/ ret = Touch_I2C_Read(ts->client, ANALOG_CONTROL_REG, &data, 1); data = data & 0xDF; ret = Touch_I2C_Write(ts->client, ANALOG_CONTROL_REG, &data, 1); /*Apply ForceUpdate.*/ ret = Touch_I2C_Read(ts->client, ANALOG_COMMAND_REG, &data, 1); data = data | 0x04; ret = Touch_I2C_Write(ts->client, ANALOG_COMMAND_REG, &data, 1); msleep(WAIT_TIME); /*Apply ForceCal.*/ ret = Touch_I2C_Read(ts->client, ANALOG_COMMAND_REG, &data, 1); data = data | 0x02; ret = Touch_I2C_Write(ts->client, ANALOG_COMMAND_REG, &data, 1); msleep(WAIT_TIME); return TOUCH_SUCCESS; }