Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268177
b: refs/heads/master
c: 4e687dd
h: refs/heads/master
i:
  268175: 9a92cb2
v: v3
  • Loading branch information
Michael Hennerich authored and Greg Kroah-Hartman committed Sep 6, 2011
1 parent d64c531 commit 926f0e8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cd400fc94dc94d89876b38c0267ebe4e8ffb8675
refs/heads/master: 4e687ddba3349c410f82412b85e9151aeadcd2d2
38 changes: 25 additions & 13 deletions trunk/drivers/staging/iio/adc/ad7150.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* AD7150 capacitive sensor driver supporting AD7150/1/6
*
* Copyright 2010 Analog Devices Inc.
* Copyright 2010-2011 Analog Devices Inc.
*
* Licensed under the GPL-2 or later.
*/
Expand Down Expand Up @@ -46,14 +46,6 @@
#define AD7150_SN0 22
#define AD7150_ID 23

#define AD7150_MAX_CONV_MODE 4

/**
* Todo list:
* - Review whether old_state usage makes sense.
* - get rid of explicit control of conversion mode
*/

/**
* struct ad7150_chip_info - instance specific chip data
* @client: i2c client for this device
Expand Down Expand Up @@ -592,24 +584,40 @@ static int __devinit ad7150_probe(struct i2c_client *client,
&ad7150_event_handler,
IRQF_TRIGGER_RISING |
IRQF_TRIGGER_FALLING,
"ad7150",
"ad7150_irq1",
indio_dev);
if (ret)
goto error_free_dev;
}

if (client->dev.platform_data) {
ret = request_threaded_irq(*(unsigned int *)
client->dev.platform_data,
NULL,
&ad7150_event_handler,
IRQF_TRIGGER_RISING |
IRQF_TRIGGER_FALLING,
"ad7150_irq2",
indio_dev);
if (ret)
goto error_free_irq;
}

ret = iio_device_register(indio_dev);
if (ret)
goto error_free_irq;
goto error_free_irq2;

dev_info(&client->dev, "%s capacitive sensor registered,irq: %d\n",
id->name, client->irq);

return 0;
error_free_irq2:
if (client->dev.platform_data)
free_irq(*(unsigned int *)client->dev.platform_data,
indio_dev);
error_free_irq:
if (client->irq)
free_irq(client->irq, indio_dev);

error_free_dev:
iio_free_device(indio_dev);
error_ret:
Expand All @@ -622,6 +630,10 @@ static int __devexit ad7150_remove(struct i2c_client *client)

if (client->irq)
free_irq(client->irq, indio_dev);

if (client->dev.platform_data)
free_irq(*(unsigned int *)client->dev.platform_data, indio_dev);

iio_device_unregister(indio_dev);

return 0;
Expand Down Expand Up @@ -656,7 +668,7 @@ static __exit void ad7150_exit(void)
}

MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
MODULE_DESCRIPTION("Analog Devices ad7150/1/6 capacitive sensor driver");
MODULE_DESCRIPTION("Analog Devices AD7150/1/6 capacitive sensor driver");
MODULE_LICENSE("GPL v2");

module_init(ad7150_init);
Expand Down

0 comments on commit 926f0e8

Please sign in to comment.