Skip to content

Commit

Permalink
mfd: Use genirq in 88pm860x
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Haojian Zhuang authored and Samuel Ortiz committed Mar 7, 2010
1 parent 7731074 commit 2afa62e
Show file tree
Hide file tree
Showing 3 changed files with 311 additions and 142 deletions.
15 changes: 5 additions & 10 deletions drivers/input/touchscreen/88pm860x-ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ static irqreturn_t pm860x_touch_handler(int irq, void *data)
int z1, z2, rt = 0;
int ret;

pm860x_mask_irq(chip, irq);
ret = pm860x_bulk_read(touch->i2c, MEAS_TSIX_1, MEAS_LEN, buf);
if (ret < 0)
goto out;
Expand Down Expand Up @@ -83,7 +82,6 @@ static irqreturn_t pm860x_touch_handler(int irq, void *data)
dev_dbg(chip->dev, "pen release\n");
}
input_sync(touch->idev);
pm860x_unmask_irq(chip, irq);

out:
return IRQ_HANDLED;
Expand All @@ -92,15 +90,13 @@ static irqreturn_t pm860x_touch_handler(int irq, void *data)
static int pm860x_touch_open(struct input_dev *dev)
{
struct pm860x_touch *touch = input_get_drvdata(dev);
struct pm860x_chip *chip = touch->chip;
int data, ret;

data = MEAS_PD_EN | MEAS_TSIX_EN | MEAS_TSIY_EN
| MEAS_TSIZ1_EN | MEAS_TSIZ2_EN;
ret = pm860x_set_bits(touch->i2c, MEAS_EN3, data, data);
if (ret < 0)
goto out;
pm860x_unmask_irq(chip, touch->irq);
return 0;
out:
return ret;
Expand All @@ -109,13 +105,11 @@ static int pm860x_touch_open(struct input_dev *dev)
static void pm860x_touch_close(struct input_dev *dev)
{
struct pm860x_touch *touch = input_get_drvdata(dev);
struct pm860x_chip *chip = touch->chip;
int data;

data = MEAS_PD_EN | MEAS_TSIX_EN | MEAS_TSIY_EN
| MEAS_TSIZ1_EN | MEAS_TSIZ2_EN;
pm860x_set_bits(touch->i2c, MEAS_EN3, data, 0);
pm860x_mask_irq(chip, touch->irq);
}

static int __devinit pm860x_touch_probe(struct platform_device *pdev)
Expand Down Expand Up @@ -164,11 +158,12 @@ static int __devinit pm860x_touch_probe(struct platform_device *pdev)
touch->idev->close = pm860x_touch_close;
touch->chip = chip;
touch->i2c = (chip->id == CHIP_PM8607) ? chip->client : chip->companion;
touch->irq = irq;
touch->irq = irq + chip->irq_base;
touch->res_x = pdata->res_x;
input_set_drvdata(touch->idev, touch);

ret = pm860x_request_irq(chip, irq, pm860x_touch_handler, touch);
ret = request_threaded_irq(touch->irq, NULL, pm860x_touch_handler,
IRQF_ONESHOT, "touch", touch);
if (ret < 0)
goto out_irq;

Expand All @@ -194,7 +189,7 @@ static int __devinit pm860x_touch_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, touch);
return 0;
out_rg:
pm860x_free_irq(chip, irq);
free_irq(touch->irq, touch);
out_irq:
input_free_device(touch->idev);
out:
Expand All @@ -207,7 +202,7 @@ static int __devexit pm860x_touch_remove(struct platform_device *pdev)
struct pm860x_touch *touch = platform_get_drvdata(pdev);

input_unregister_device(touch->idev);
pm860x_free_irq(touch->chip, touch->irq);
free_irq(touch->irq, touch);
platform_set_drvdata(pdev, NULL);
kfree(touch);
return 0;
Expand Down
Loading

0 comments on commit 2afa62e

Please sign in to comment.