Lines Matching refs:tsdev

106 	int (*read_prepare)(struct mrstouch_dev *tsdev);
107 int (*read)(struct mrstouch_dev *tsdev, u16 *x, u16 *y, u16 *z);
108 int (*read_finish)(struct mrstouch_dev *tsdev);
114 static int mrstouch_nec_adc_read_prepare(struct mrstouch_dev *tsdev) in mrstouch_nec_adc_read_prepare() argument
122 static int mrstouch_nec_adc_read_finish(struct mrstouch_dev *tsdev) in mrstouch_nec_adc_read_finish() argument
191 static int mrstouch_nec_adc_read(struct mrstouch_dev *tsdev, in mrstouch_nec_adc_read() argument
198 err = mrstouch_ts_bias_set(tsdev->asr, MRST_YBIAS); in mrstouch_nec_adc_read()
205 err = mrstouch_ts_chan_read(tsdev->asr, MRST_TS_CHAN10, x, &xm); in mrstouch_nec_adc_read()
210 err = mrstouch_ts_bias_set(tsdev->asr, MRST_XBIAS); in mrstouch_nec_adc_read()
217 err = mrstouch_ts_chan_read(tsdev->asr, MRST_TS_CHAN12, y, &ym); in mrstouch_nec_adc_read()
222 err = mrstouch_ts_bias_set(tsdev->asr, MRST_ZBIAS); in mrstouch_nec_adc_read()
229 err = mrstouch_ts_chan_read(tsdev->asr, MRST_TS_CHAN10, z, &zm); in mrstouch_nec_adc_read()
236 dev_err(tsdev->dev, "ipc error during adc read\n"); in mrstouch_nec_adc_read()
243 static int mrstouch_fs_adc_read_prepare(struct mrstouch_dev *tsdev) in mrstouch_fs_adc_read_prepare() argument
255 chan = PMICADDR0 + tsdev->asr; in mrstouch_fs_adc_read_prepare()
295 dev_err(tsdev->dev, "ipc error during %s\n", __func__); in mrstouch_fs_adc_read_prepare()
299 static int mrstouch_fs_adc_read(struct mrstouch_dev *tsdev, in mrstouch_fs_adc_read() argument
307 result = PMIC_REG_ADCSNS0H + tsdev->asr; in mrstouch_fs_adc_read()
341 dev_err(tsdev->dev, "ipc error during %s\n", __func__); in mrstouch_fs_adc_read()
345 static int mrstouch_fs_adc_read_finish(struct mrstouch_dev *tsdev) in mrstouch_fs_adc_read_finish() argument
353 chan = PMICADDR0 + tsdev->asr; in mrstouch_fs_adc_read_finish()
382 dev_err(tsdev->dev, "ipc error during %s\n", __func__); in mrstouch_fs_adc_read_finish()
405 struct mrstouch_dev *tsdev = dev_id; in mrstouch_pendet_irq() local
413 if (tsdev->read_prepare(tsdev)) in mrstouch_pendet_irq()
417 if (tsdev->read(tsdev, &x, &y, &z)) in mrstouch_pendet_irq()
420 mrstouch_report_event(tsdev->input, x, y, z); in mrstouch_pendet_irq()
423 tsdev->read_finish(tsdev); in mrstouch_pendet_irq()
449 static int __devinit mrstouch_chan_parse(struct mrstouch_dev *tsdev) in mrstouch_chan_parse() argument
466 if (tsdev->vendor == PMIC_VENDOR_FS) { in mrstouch_chan_parse()
497 static int __devinit mrstouch_adc_init(struct mrstouch_dev *tsdev) in mrstouch_adc_init() argument
502 err = mrstouch_read_pmic_id(&tsdev->vendor, &tsdev->rev); in mrstouch_adc_init()
504 dev_err(tsdev->dev, "Unable to read PMIC id\n"); in mrstouch_adc_init()
508 switch (tsdev->vendor) { in mrstouch_adc_init()
511 tsdev->read_prepare = mrstouch_nec_adc_read_prepare; in mrstouch_adc_init()
512 tsdev->read = mrstouch_nec_adc_read; in mrstouch_adc_init()
513 tsdev->read_finish = mrstouch_nec_adc_read_finish; in mrstouch_adc_init()
517 tsdev->read_prepare = mrstouch_fs_adc_read_prepare; in mrstouch_adc_init()
518 tsdev->read = mrstouch_fs_adc_read; in mrstouch_adc_init()
519 tsdev->read_finish = mrstouch_fs_adc_read_finish; in mrstouch_adc_init()
523 dev_err(tsdev->dev, in mrstouch_adc_init()
524 "Unsupported touchscreen: %d\n", tsdev->vendor); in mrstouch_adc_init()
528 start = mrstouch_chan_parse(tsdev); in mrstouch_adc_init()
530 dev_err(tsdev->dev, "Unable to parse channels\n"); in mrstouch_adc_init()
534 tsdev->asr = start; in mrstouch_adc_init()
544 if (tsdev->vendor == PMIC_VENDOR_FS) { in mrstouch_adc_init()
553 err = mrstouch_ts_chan_set(tsdev->asr); in mrstouch_adc_init()
573 struct mrstouch_dev *tsdev; in mrstouch_probe() local
584 tsdev = kzalloc(sizeof(struct mrstouch_dev), GFP_KERNEL); in mrstouch_probe()
586 if (!tsdev || !input) { in mrstouch_probe()
592 tsdev->dev = &pdev->dev; in mrstouch_probe()
593 tsdev->input = input; in mrstouch_probe()
594 tsdev->irq = irq; in mrstouch_probe()
596 snprintf(tsdev->phys, sizeof(tsdev->phys), in mrstouch_probe()
597 "%s/input0", dev_name(tsdev->dev)); in mrstouch_probe()
599 err = mrstouch_adc_init(tsdev); in mrstouch_probe()
606 input->phys = tsdev->phys; in mrstouch_probe()
607 input->dev.parent = tsdev->dev; in mrstouch_probe()
609 input->id.vendor = tsdev->vendor; in mrstouch_probe()
610 input->id.version = tsdev->rev; in mrstouch_probe()
615 input_set_abs_params(tsdev->input, ABS_X, in mrstouch_probe()
617 input_set_abs_params(tsdev->input, ABS_Y, in mrstouch_probe()
619 input_set_abs_params(tsdev->input, ABS_PRESSURE, in mrstouch_probe()
622 err = request_threaded_irq(tsdev->irq, NULL, mrstouch_pendet_irq, in mrstouch_probe()
623 0, "mrstouch", tsdev); in mrstouch_probe()
625 dev_err(tsdev->dev, "unable to allocate irq\n"); in mrstouch_probe()
629 err = input_register_device(tsdev->input); in mrstouch_probe()
631 dev_err(tsdev->dev, "unable to register input device\n"); in mrstouch_probe()
635 platform_set_drvdata(pdev, tsdev); in mrstouch_probe()
639 free_irq(tsdev->irq, tsdev); in mrstouch_probe()
642 kfree(tsdev); in mrstouch_probe()
648 struct mrstouch_dev *tsdev = platform_get_drvdata(pdev); in mrstouch_remove() local
650 free_irq(tsdev->irq, tsdev); in mrstouch_remove()
651 input_unregister_device(tsdev->input); in mrstouch_remove()
652 kfree(tsdev); in mrstouch_remove()