aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@marvell.com>2010-02-08 05:02:00 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2010-03-07 16:17:20 -0500
commit2afa62ea76027b00e472ddb672191e6e15425b43 (patch)
tree3c70f220af28c859fea638e5eae4aed726f5dcdd /drivers/input
parent7731074ab21745cde00578148ce760df107eaf27 (diff)
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>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/88pm860x-ts.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/input/touchscreen/88pm860x-ts.c b/drivers/input/touchscreen/88pm860x-ts.c
index 56254d2a1f6..286bb490a9f 100644
--- a/drivers/input/touchscreen/88pm860x-ts.c
+++ b/drivers/input/touchscreen/88pm860x-ts.c
@@ -54,7 +54,6 @@ static irqreturn_t pm860x_touch_handler(int irq, void *data)
54 int z1, z2, rt = 0; 54 int z1, z2, rt = 0;
55 int ret; 55 int ret;
56 56
57 pm860x_mask_irq(chip, irq);
58 ret = pm860x_bulk_read(touch->i2c, MEAS_TSIX_1, MEAS_LEN, buf); 57 ret = pm860x_bulk_read(touch->i2c, MEAS_TSIX_1, MEAS_LEN, buf);
59 if (ret < 0) 58 if (ret < 0)
60 goto out; 59 goto out;
@@ -83,7 +82,6 @@ static irqreturn_t pm860x_touch_handler(int irq, void *data)
83 dev_dbg(chip->dev, "pen release\n"); 82 dev_dbg(chip->dev, "pen release\n");
84 } 83 }
85 input_sync(touch->idev); 84 input_sync(touch->idev);
86 pm860x_unmask_irq(chip, irq);
87 85
88out: 86out:
89 return IRQ_HANDLED; 87 return IRQ_HANDLED;
@@ -92,7 +90,6 @@ out:
92static int pm860x_touch_open(struct input_dev *dev) 90static int pm860x_touch_open(struct input_dev *dev)
93{ 91{
94 struct pm860x_touch *touch = input_get_drvdata(dev); 92 struct pm860x_touch *touch = input_get_drvdata(dev);
95 struct pm860x_chip *chip = touch->chip;
96 int data, ret; 93 int data, ret;
97 94
98 data = MEAS_PD_EN | MEAS_TSIX_EN | MEAS_TSIY_EN 95 data = MEAS_PD_EN | MEAS_TSIX_EN | MEAS_TSIY_EN
@@ -100,7 +97,6 @@ static int pm860x_touch_open(struct input_dev *dev)
100 ret = pm860x_set_bits(touch->i2c, MEAS_EN3, data, data); 97 ret = pm860x_set_bits(touch->i2c, MEAS_EN3, data, data);
101 if (ret < 0) 98 if (ret < 0)
102 goto out; 99 goto out;
103 pm860x_unmask_irq(chip, touch->irq);
104 return 0; 100 return 0;
105out: 101out:
106 return ret; 102 return ret;
@@ -109,13 +105,11 @@ out:
109static void pm860x_touch_close(struct input_dev *dev) 105static void pm860x_touch_close(struct input_dev *dev)
110{ 106{
111 struct pm860x_touch *touch = input_get_drvdata(dev); 107 struct pm860x_touch *touch = input_get_drvdata(dev);
112 struct pm860x_chip *chip = touch->chip;
113 int data; 108 int data;
114 109
115 data = MEAS_PD_EN | MEAS_TSIX_EN | MEAS_TSIY_EN 110 data = MEAS_PD_EN | MEAS_TSIX_EN | MEAS_TSIY_EN
116 | MEAS_TSIZ1_EN | MEAS_TSIZ2_EN; 111 | MEAS_TSIZ1_EN | MEAS_TSIZ2_EN;
117 pm860x_set_bits(touch->i2c, MEAS_EN3, data, 0); 112 pm860x_set_bits(touch->i2c, MEAS_EN3, data, 0);
118 pm860x_mask_irq(chip, touch->irq);
119} 113}
120 114
121static int __devinit pm860x_touch_probe(struct platform_device *pdev) 115static int __devinit pm860x_touch_probe(struct platform_device *pdev)
@@ -164,11 +158,12 @@ static int __devinit pm860x_touch_probe(struct platform_device *pdev)
164 touch->idev->close = pm860x_touch_close; 158 touch->idev->close = pm860x_touch_close;
165 touch->chip = chip; 159 touch->chip = chip;
166 touch->i2c = (chip->id == CHIP_PM8607) ? chip->client : chip->companion; 160 touch->i2c = (chip->id == CHIP_PM8607) ? chip->client : chip->companion;
167 touch->irq = irq; 161 touch->irq = irq + chip->irq_base;
168 touch->res_x = pdata->res_x; 162 touch->res_x = pdata->res_x;
169 input_set_drvdata(touch->idev, touch); 163 input_set_drvdata(touch->idev, touch);
170 164
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);
172 if (ret < 0) 167 if (ret < 0)
173 goto out_irq; 168 goto out_irq;
174 169
@@ -194,7 +189,7 @@ static int __devinit pm860x_touch_probe(struct platform_device *pdev)
194 platform_set_drvdata(pdev, touch); 189 platform_set_drvdata(pdev, touch);
195 return 0; 190 return 0;
196out_rg: 191out_rg:
197 pm860x_free_irq(chip, irq); 192 free_irq(touch->irq, touch);
198out_irq: 193out_irq:
199 input_free_device(touch->idev); 194 input_free_device(touch->idev);
200out: 195out:
@@ -207,7 +202,7 @@ static int __devexit pm860x_touch_remove(struct platform_device *pdev)
207 struct pm860x_touch *touch = platform_get_drvdata(pdev); 202 struct pm860x_touch *touch = platform_get_drvdata(pdev);
208 203
209 input_unregister_device(touch->idev); 204 input_unregister_device(touch->idev);
210 pm860x_free_irq(touch->chip, touch->irq); 205 free_irq(touch->irq, touch);
211 platform_set_drvdata(pdev, NULL); 206 platform_set_drvdata(pdev, NULL);
212 kfree(touch); 207 kfree(touch);
213 return 0; 208 return 0;