Skip to content

Commit 2afa62e

Browse files
Haojian ZhuangSamuel Ortiz
authored andcommitted
mfd: Use genirq in 88pm860x
Use genirq to simplify IRQ handling in 88pm860x. Remove the interface of mask/free IRQs on 88pm860x. All these work is taken by genirq. Update the touchscreen driver of 88pm860x since IRQ handling is changed. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
1 parent 7731074 commit 2afa62e

File tree

3 files changed

+311
-142
lines changed

3 files changed

+311
-142
lines changed

drivers/input/touchscreen/88pm860x-ts.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ static irqreturn_t pm860x_touch_handler(int irq, void *data)
5454
int z1, z2, rt = 0;
5555
int ret;
5656

57-
pm860x_mask_irq(chip, irq);
5857
ret = pm860x_bulk_read(touch->i2c, MEAS_TSIX_1, MEAS_LEN, buf);
5958
if (ret < 0)
6059
goto out;
@@ -83,7 +82,6 @@ static irqreturn_t pm860x_touch_handler(int irq, void *data)
8382
dev_dbg(chip->dev, "pen release\n");
8483
}
8584
input_sync(touch->idev);
86-
pm860x_unmask_irq(chip, irq);
8785

8886
out:
8987
return IRQ_HANDLED;
@@ -92,15 +90,13 @@ static irqreturn_t pm860x_touch_handler(int irq, void *data)
9290
static int pm860x_touch_open(struct input_dev *dev)
9391
{
9492
struct pm860x_touch *touch = input_get_drvdata(dev);
95-
struct pm860x_chip *chip = touch->chip;
9693
int data, ret;
9794

9895
data = MEAS_PD_EN | MEAS_TSIX_EN | MEAS_TSIY_EN
9996
| MEAS_TSIZ1_EN | MEAS_TSIZ2_EN;
10097
ret = pm860x_set_bits(touch->i2c, MEAS_EN3, data, data);
10198
if (ret < 0)
10299
goto out;
103-
pm860x_unmask_irq(chip, touch->irq);
104100
return 0;
105101
out:
106102
return ret;
@@ -109,13 +105,11 @@ static int pm860x_touch_open(struct input_dev *dev)
109105
static void pm860x_touch_close(struct input_dev *dev)
110106
{
111107
struct pm860x_touch *touch = input_get_drvdata(dev);
112-
struct pm860x_chip *chip = touch->chip;
113108
int data;
114109

115110
data = MEAS_PD_EN | MEAS_TSIX_EN | MEAS_TSIY_EN
116111
| MEAS_TSIZ1_EN | MEAS_TSIZ2_EN;
117112
pm860x_set_bits(touch->i2c, MEAS_EN3, data, 0);
118-
pm860x_mask_irq(chip, touch->irq);
119113
}
120114

121115
static int __devinit pm860x_touch_probe(struct platform_device *pdev)
@@ -164,11 +158,12 @@ static int __devinit pm860x_touch_probe(struct platform_device *pdev)
164158
touch->idev->close = pm860x_touch_close;
165159
touch->chip = chip;
166160
touch->i2c = (chip->id == CHIP_PM8607) ? chip->client : chip->companion;
167-
touch->irq = irq;
161+
touch->irq = irq + chip->irq_base;
168162
touch->res_x = pdata->res_x;
169163
input_set_drvdata(touch->idev, touch);
170164

171-
ret = pm860x_request_irq(chip, irq, pm860x_touch_handler, touch);
165+
ret = request_threaded_irq(touch->irq, NULL, pm860x_touch_handler,
166+
IRQF_ONESHOT, "touch", touch);
172167
if (ret < 0)
173168
goto out_irq;
174169

@@ -194,7 +189,7 @@ static int __devinit pm860x_touch_probe(struct platform_device *pdev)
194189
platform_set_drvdata(pdev, touch);
195190
return 0;
196191
out_rg:
197-
pm860x_free_irq(chip, irq);
192+
free_irq(touch->irq, touch);
198193
out_irq:
199194
input_free_device(touch->idev);
200195
out:
@@ -207,7 +202,7 @@ static int __devexit pm860x_touch_remove(struct platform_device *pdev)
207202
struct pm860x_touch *touch = platform_get_drvdata(pdev);
208203

209204
input_unregister_device(touch->idev);
210-
pm860x_free_irq(touch->chip, touch->irq);
205+
free_irq(touch->irq, touch);
211206
platform_set_drvdata(pdev, NULL);
212207
kfree(touch);
213208
return 0;

0 commit comments

Comments
 (0)