Lines Matching refs:icn8505

146 static int icn8505_read_data(struct icn8505_data *icn8505, int reg,  in icn8505_read_data()  argument
149 return icn8505_read_xfer(icn8505->client, icn8505->client->addr, reg, in icn8505_read_data()
153 static int icn8505_read_reg_silent(struct icn8505_data *icn8505, int reg) in icn8505_read_reg_silent() argument
158 error = icn8505_read_xfer(icn8505->client, icn8505->client->addr, reg, in icn8505_read_reg_silent()
166 static int icn8505_write_reg(struct icn8505_data *icn8505, int reg, u8 val) in icn8505_write_reg() argument
168 return icn8505_write_xfer(icn8505->client, icn8505->client->addr, reg, in icn8505_write_reg()
172 static int icn8505_read_prog_data(struct icn8505_data *icn8505, int reg, in icn8505_read_prog_data() argument
175 return icn8505_read_xfer(icn8505->client, ICN8505_PROG_I2C_ADDR, reg, in icn8505_read_prog_data()
179 static int icn8505_write_prog_data(struct icn8505_data *icn8505, int reg, in icn8505_write_prog_data() argument
182 return icn8505_write_xfer(icn8505->client, ICN8505_PROG_I2C_ADDR, reg, in icn8505_write_prog_data()
186 static int icn8505_write_prog_reg(struct icn8505_data *icn8505, int reg, u8 val) in icn8505_write_prog_reg() argument
188 return icn8505_write_xfer(icn8505->client, ICN8505_PROG_I2C_ADDR, reg, in icn8505_write_prog_reg()
198 static int icn8505_try_fw_upload(struct icn8505_data *icn8505, in icn8505_try_fw_upload() argument
201 struct device *dev = &icn8505->client->dev; in icn8505_try_fw_upload()
208 error = icn8505_write_prog_reg(icn8505, 0xcc3355, 0x5a); in icn8505_try_fw_upload()
214 error = icn8505_write_prog_reg(icn8505, 0x040400, 0x01); in icn8505_try_fw_upload()
220 error = icn8505_read_prog_data(icn8505, 0x040002, buf, 1); in icn8505_try_fw_upload()
232 error = icn8505_write_prog_reg(icn8505, 0x40028, 1); in icn8505_try_fw_upload()
239 error = icn8505_write_prog_data(icn8505, offset, in icn8505_try_fw_upload()
246 error = icn8505_write_prog_reg(icn8505, 0x40028, 0); in icn8505_try_fw_upload()
251 error = icn8505_read_prog_data(icn8505, 0x40034, buf, 2); in icn8505_try_fw_upload()
260 error = icn8505_read_prog_data(icn8505, 0x4002c, buf, 4); in icn8505_try_fw_upload()
271 error = icn8505_write_prog_reg(icn8505, 0x40400, 0x03); in icn8505_try_fw_upload()
279 static int icn8505_upload_fw(struct icn8505_data *icn8505) in icn8505_upload_fw() argument
281 struct device *dev = &icn8505->client->dev; in icn8505_upload_fw()
290 error = firmware_request_platform(&fw, icn8505->firmware_name, dev); in icn8505_upload_fw()
297 if (icn8505_read_reg_silent(icn8505, 0x000a) == 0x85) in icn8505_upload_fw()
301 error = icn8505_try_fw_upload(icn8505, fw); in icn8505_upload_fw()
323 struct icn8505_data *icn8505 = dev_id; in icn8505_irq() local
324 struct device *dev = &icn8505->client->dev; in icn8505_irq()
328 error = icn8505_read_data(icn8505, ICN8505_REG_TOUCHDATA, in icn8505_irq()
345 input_mt_slot(icn8505->input, touch->slot); in icn8505_irq()
346 input_mt_report_slot_state(icn8505->input, MT_TOOL_FINGER, act); in icn8505_irq()
350 touchscreen_report_pos(icn8505->input, &icn8505->prop, in icn8505_irq()
356 input_mt_sync_frame(icn8505->input); in icn8505_irq()
357 input_report_key(icn8505->input, KEY_LEFTMETA, in icn8505_irq()
359 input_sync(icn8505->input); in icn8505_irq()
364 static int icn8505_probe_acpi(struct icn8505_data *icn8505, struct device *dev) in icn8505_probe_acpi() argument
376 snprintf(icn8505->firmware_name, sizeof(icn8505->firmware_name), in icn8505_probe_acpi()
386 struct icn8505_data *icn8505; in icn8505_probe() local
396 icn8505 = devm_kzalloc(dev, sizeof(*icn8505), GFP_KERNEL); in icn8505_probe()
397 if (!icn8505) in icn8505_probe()
411 icn8505->client = client; in icn8505_probe()
412 icn8505->input = input; in icn8505_probe()
413 input_set_drvdata(input, icn8505); in icn8505_probe()
415 error = icn8505_probe_acpi(icn8505, dev); in icn8505_probe()
419 error = icn8505_upload_fw(icn8505); in icn8505_probe()
423 error = icn8505_read_data(icn8505, ICN8505_REG_CONFIGDATA, in icn8505_probe()
435 touchscreen_parse_properties(input, true, &icn8505->prop); in icn8505_probe()
448 IRQF_ONESHOT, client->name, icn8505); in icn8505_probe()
458 i2c_set_clientdata(client, icn8505); in icn8505_probe()
464 struct icn8505_data *icn8505 = i2c_get_clientdata(to_i2c_client(dev)); in icn8505_suspend() local
466 disable_irq(icn8505->client->irq); in icn8505_suspend()
468 icn8505_write_reg(icn8505, ICN8505_REG_POWER, ICN8505_POWER_HIBERNATE); in icn8505_suspend()
475 struct icn8505_data *icn8505 = i2c_get_clientdata(to_i2c_client(dev)); in icn8505_resume() local
478 error = icn8505_upload_fw(icn8505); in icn8505_resume()
482 enable_irq(icn8505->client->irq); in icn8505_resume()