Searched refs:w90p910_ts (Results 1 - 2 of 2) sorted by relevance
/linux-4.4.14/drivers/input/touchscreen/ |
H A D | w90p910_ts.c | 49 struct w90p910_ts { struct 59 static void w90p910_report_event(struct w90p910_ts *w90p910_ts, bool down) w90p910_report_event() argument 61 struct input_dev *dev = w90p910_ts->input; w90p910_report_event() 65 __raw_readl(w90p910_ts->ts_reg + 0x0c)); w90p910_report_event() 67 __raw_readl(w90p910_ts->ts_reg + 0x10)); w90p910_report_event() 74 static void w90p910_prepare_x_reading(struct w90p910_ts *w90p910_ts) w90p910_prepare_x_reading() argument 78 __raw_writel(ADC_TSC_X, w90p910_ts->ts_reg + 0x04); w90p910_prepare_x_reading() 79 ctlreg = __raw_readl(w90p910_ts->ts_reg); w90p910_prepare_x_reading() 82 __raw_writel(ctlreg, w90p910_ts->ts_reg); w90p910_prepare_x_reading() 84 w90p910_ts->state = TS_WAIT_X_COORD; w90p910_prepare_x_reading() 87 static void w90p910_prepare_y_reading(struct w90p910_ts *w90p910_ts) w90p910_prepare_y_reading() argument 91 __raw_writel(ADC_TSC_Y, w90p910_ts->ts_reg + 0x04); w90p910_prepare_y_reading() 92 ctlreg = __raw_readl(w90p910_ts->ts_reg); w90p910_prepare_y_reading() 95 __raw_writel(ctlreg, w90p910_ts->ts_reg); w90p910_prepare_y_reading() 97 w90p910_ts->state = TS_WAIT_Y_COORD; w90p910_prepare_y_reading() 100 static void w90p910_prepare_next_packet(struct w90p910_ts *w90p910_ts) w90p910_prepare_next_packet() argument 104 ctlreg = __raw_readl(w90p910_ts->ts_reg); w90p910_prepare_next_packet() 107 __raw_writel(ctlreg, w90p910_ts->ts_reg); w90p910_prepare_next_packet() 109 w90p910_ts->state = TS_WAIT_NEW_PACKET; w90p910_prepare_next_packet() 114 struct w90p910_ts *w90p910_ts = dev_id; w90p910_ts_interrupt() local 117 spin_lock_irqsave(&w90p910_ts->lock, flags); w90p910_ts_interrupt() 119 switch (w90p910_ts->state) { w90p910_ts_interrupt() 125 del_timer(&w90p910_ts->timer); w90p910_ts_interrupt() 126 w90p910_prepare_x_reading(w90p910_ts); w90p910_ts_interrupt() 131 w90p910_prepare_y_reading(w90p910_ts); w90p910_ts_interrupt() 135 w90p910_report_event(w90p910_ts, true); w90p910_ts_interrupt() 136 w90p910_prepare_next_packet(w90p910_ts); w90p910_ts_interrupt() 137 mod_timer(&w90p910_ts->timer, jiffies + msecs_to_jiffies(100)); w90p910_ts_interrupt() 144 spin_unlock_irqrestore(&w90p910_ts->lock, flags); w90p910_ts_interrupt() 151 struct w90p910_ts *w90p910_ts = (struct w90p910_ts *) data; w90p910_check_pen_up() local 154 spin_lock_irqsave(&w90p910_ts->lock, flags); w90p910_check_pen_up() 156 if (w90p910_ts->state == TS_WAIT_NEW_PACKET && w90p910_check_pen_up() 157 !(__raw_readl(w90p910_ts->ts_reg + 0x04) & ADC_DOWN)) { w90p910_check_pen_up() 159 w90p910_report_event(w90p910_ts, false); w90p910_check_pen_up() 162 spin_unlock_irqrestore(&w90p910_ts->lock, flags); w90p910_check_pen_up() 167 struct w90p910_ts *w90p910_ts = input_get_drvdata(dev); w90p910_open() local 171 clk_enable(w90p910_ts->clk); w90p910_open() 173 __raw_writel(ADC_RST1, w90p910_ts->ts_reg); w90p910_open() 175 __raw_writel(ADC_RST0, w90p910_ts->ts_reg); w90p910_open() 179 val = __raw_readl(w90p910_ts->ts_reg + 0x04); w90p910_open() 180 __raw_writel(val & TSC_FOURWIRE, w90p910_ts->ts_reg + 0x04); w90p910_open() 181 __raw_writel(ADC_DELAY, w90p910_ts->ts_reg + 0x08); w90p910_open() 183 w90p910_ts->state = TS_WAIT_NEW_PACKET; w90p910_open() 187 val = __raw_readl(w90p910_ts->ts_reg); w90p910_open() 189 __raw_writel(val, w90p910_ts->ts_reg); w90p910_open() 196 struct w90p910_ts *w90p910_ts = input_get_drvdata(dev); w90p910_close() local 201 spin_lock_irq(&w90p910_ts->lock); w90p910_close() 203 w90p910_ts->state = TS_IDLE; w90p910_close() 205 val = __raw_readl(w90p910_ts->ts_reg); w90p910_close() 207 __raw_writel(val, w90p910_ts->ts_reg); w90p910_close() 209 spin_unlock_irq(&w90p910_ts->lock); w90p910_close() 212 del_timer_sync(&w90p910_ts->timer); w90p910_close() 215 clk_disable(w90p910_ts->clk); w90p910_close() 220 struct w90p910_ts *w90p910_ts; w90x900ts_probe() local 225 w90p910_ts = kzalloc(sizeof(struct w90p910_ts), GFP_KERNEL); w90x900ts_probe() 227 if (!w90p910_ts || !input_dev) { w90x900ts_probe() 232 w90p910_ts->input = input_dev; w90x900ts_probe() 233 w90p910_ts->state = TS_IDLE; w90x900ts_probe() 234 spin_lock_init(&w90p910_ts->lock); w90x900ts_probe() 235 setup_timer(&w90p910_ts->timer, w90p910_check_pen_up, w90x900ts_probe() 236 (unsigned long)w90p910_ts); w90x900ts_probe() 250 w90p910_ts->ts_reg = ioremap(res->start, resource_size(res)); w90x900ts_probe() 251 if (!w90p910_ts->ts_reg) { w90x900ts_probe() 256 w90p910_ts->clk = clk_get(&pdev->dev, NULL); w90x900ts_probe() 257 if (IS_ERR(w90p910_ts->clk)) { w90x900ts_probe() 258 err = PTR_ERR(w90p910_ts->clk); w90x900ts_probe() 278 input_set_drvdata(input_dev, w90p910_ts); w90x900ts_probe() 280 w90p910_ts->irq_num = platform_get_irq(pdev, 0); w90x900ts_probe() 281 if (request_irq(w90p910_ts->irq_num, w90p910_ts_interrupt, w90x900ts_probe() 282 0, "w90p910ts", w90p910_ts)) { w90x900ts_probe() 287 err = input_register_device(w90p910_ts->input); w90x900ts_probe() 291 platform_set_drvdata(pdev, w90p910_ts); w90x900ts_probe() 295 fail5: free_irq(w90p910_ts->irq_num, w90p910_ts); w90x900ts_probe() 296 fail4: clk_put(w90p910_ts->clk); w90x900ts_probe() 297 fail3: iounmap(w90p910_ts->ts_reg); w90x900ts_probe() 300 kfree(w90p910_ts); w90x900ts_probe() 306 struct w90p910_ts *w90p910_ts = platform_get_drvdata(pdev); w90x900ts_remove() local 309 free_irq(w90p910_ts->irq_num, w90p910_ts); w90x900ts_remove() 310 del_timer_sync(&w90p910_ts->timer); w90x900ts_remove() 311 iounmap(w90p910_ts->ts_reg); w90x900ts_remove() 313 clk_put(w90p910_ts->clk); w90x900ts_remove() 318 input_unregister_device(w90p910_ts->input); w90x900ts_remove() 319 kfree(w90p910_ts); w90x900ts_remove()
|
H A D | Makefile | 88 obj-$(CONFIG_TOUCHSCREEN_W90X900) += w90p910_ts.o
|
Completed in 83 milliseconds