Lines Matching refs:bt541

193 static int zinitix_init_touch(struct bt541_ts_data *bt541)  in zinitix_init_touch()  argument
195 struct i2c_client *client = bt541->client; in zinitix_init_touch()
214 bt541->prop.max_x); in zinitix_init_touch()
219 bt541->prop.max_y); in zinitix_init_touch()
229 bt541->zinitix_mode); in zinitix_init_touch()
234 bt541->zinitix_mode); in zinitix_init_touch()
253 static int zinitix_init_regulators(struct bt541_ts_data *bt541) in zinitix_init_regulators() argument
255 struct device *dev = &bt541->client->dev; in zinitix_init_regulators()
264 bt541->supplies[0].supply = "vdd"; in zinitix_init_regulators()
265 bt541->supplies[1].supply = "vddo"; in zinitix_init_regulators()
268 bt541->supplies[0].supply = "vcca"; in zinitix_init_regulators()
269 bt541->supplies[1].supply = "vdd"; in zinitix_init_regulators()
272 ARRAY_SIZE(bt541->supplies), in zinitix_init_regulators()
273 bt541->supplies); in zinitix_init_regulators()
282 static int zinitix_send_power_on_sequence(struct bt541_ts_data *bt541) in zinitix_send_power_on_sequence() argument
285 struct i2c_client *client = bt541->client; in zinitix_send_power_on_sequence()
322 static void zinitix_report_finger(struct bt541_ts_data *bt541, int slot, in zinitix_report_finger() argument
329 dev_dbg(&bt541->client->dev, "unknown finger event %#02x\n", in zinitix_report_finger()
337 input_mt_slot(bt541->input_dev, slot); in zinitix_report_finger()
338 if (input_mt_report_slot_state(bt541->input_dev, MT_TOOL_FINGER, in zinitix_report_finger()
340 touchscreen_report_pos(bt541->input_dev, in zinitix_report_finger()
341 &bt541->prop, x, y, true); in zinitix_report_finger()
342 input_report_abs(bt541->input_dev, in zinitix_report_finger()
344 dev_dbg(&bt541->client->dev, "finger %d %s (%u, %u)\n", in zinitix_report_finger()
348 dev_dbg(&bt541->client->dev, "finger %d up (%u, %u)\n", in zinitix_report_finger()
355 struct bt541_ts_data *bt541 = bt541_handler; in zinitix_ts_irq_handler() local
356 struct i2c_client *client = bt541->client; in zinitix_ts_irq_handler()
364 error = zinitix_read_data(bt541->client, ZINITIX_POINT_STATUS_REG, in zinitix_ts_irq_handler()
377 zinitix_report_finger(bt541, i, p); in zinitix_ts_irq_handler()
380 input_mt_sync_frame(bt541->input_dev); in zinitix_ts_irq_handler()
381 input_sync(bt541->input_dev); in zinitix_ts_irq_handler()
384 zinitix_write_cmd(bt541->client, ZINITIX_CLEAR_INT_STATUS_CMD); in zinitix_ts_irq_handler()
388 static int zinitix_start(struct bt541_ts_data *bt541) in zinitix_start() argument
392 error = regulator_bulk_enable(ARRAY_SIZE(bt541->supplies), in zinitix_start()
393 bt541->supplies); in zinitix_start()
395 dev_err(&bt541->client->dev, in zinitix_start()
402 error = zinitix_send_power_on_sequence(bt541); in zinitix_start()
404 dev_err(&bt541->client->dev, in zinitix_start()
409 error = zinitix_init_touch(bt541); in zinitix_start()
411 dev_err(&bt541->client->dev, in zinitix_start()
416 enable_irq(bt541->client->irq); in zinitix_start()
421 static int zinitix_stop(struct bt541_ts_data *bt541) in zinitix_stop() argument
425 disable_irq(bt541->client->irq); in zinitix_stop()
427 error = regulator_bulk_disable(ARRAY_SIZE(bt541->supplies), in zinitix_stop()
428 bt541->supplies); in zinitix_stop()
430 dev_err(&bt541->client->dev, in zinitix_stop()
440 struct bt541_ts_data *bt541 = input_get_drvdata(dev); in zinitix_input_open() local
442 return zinitix_start(bt541); in zinitix_input_open()
447 struct bt541_ts_data *bt541 = input_get_drvdata(dev); in zinitix_input_close() local
449 zinitix_stop(bt541); in zinitix_input_close()
452 static int zinitix_init_input_dev(struct bt541_ts_data *bt541) in zinitix_init_input_dev() argument
457 input_dev = devm_input_allocate_device(&bt541->client->dev); in zinitix_init_input_dev()
459 dev_err(&bt541->client->dev, in zinitix_init_input_dev()
464 input_set_drvdata(input_dev, bt541); in zinitix_init_input_dev()
465 bt541->input_dev = input_dev; in zinitix_init_input_dev()
478 touchscreen_parse_properties(input_dev, true, &bt541->prop); in zinitix_init_input_dev()
479 if (!bt541->prop.max_x || !bt541->prop.max_y) { in zinitix_init_input_dev()
480 dev_err(&bt541->client->dev, in zinitix_init_input_dev()
488 dev_err(&bt541->client->dev, in zinitix_init_input_dev()
495 dev_err(&bt541->client->dev, in zinitix_init_input_dev()
505 struct bt541_ts_data *bt541; in zinitix_ts_probe() local
514 bt541 = devm_kzalloc(&client->dev, sizeof(*bt541), GFP_KERNEL); in zinitix_ts_probe()
515 if (!bt541) in zinitix_ts_probe()
518 bt541->client = client; in zinitix_ts_probe()
519 i2c_set_clientdata(client, bt541); in zinitix_ts_probe()
521 error = zinitix_init_regulators(bt541); in zinitix_ts_probe()
531 client->name, bt541); in zinitix_ts_probe()
537 error = zinitix_init_input_dev(bt541); in zinitix_ts_probe()
545 &bt541->zinitix_mode); in zinitix_ts_probe()
548 bt541->zinitix_mode = DEFAULT_TOUCH_POINT_MODE; in zinitix_ts_probe()
551 if (bt541->zinitix_mode != 2) { in zinitix_ts_probe()
558 bt541->zinitix_mode); in zinitix_ts_probe()
568 struct bt541_ts_data *bt541 = i2c_get_clientdata(client); in zinitix_suspend() local
570 mutex_lock(&bt541->input_dev->mutex); in zinitix_suspend()
572 if (input_device_enabled(bt541->input_dev)) in zinitix_suspend()
573 zinitix_stop(bt541); in zinitix_suspend()
575 mutex_unlock(&bt541->input_dev->mutex); in zinitix_suspend()
583 struct bt541_ts_data *bt541 = i2c_get_clientdata(client); in zinitix_resume() local
586 mutex_lock(&bt541->input_dev->mutex); in zinitix_resume()
588 if (input_device_enabled(bt541->input_dev)) in zinitix_resume()
589 ret = zinitix_start(bt541); in zinitix_resume()
591 mutex_unlock(&bt541->input_dev->mutex); in zinitix_resume()