Diff
Modified: trunk/drivers/staging/iio/adc/ad7150.c (9298 => 9299)
--- trunk/drivers/staging/iio/adc/ad7150.c 2010-10-23 19:38:02 UTC (rev 9298)
+++ trunk/drivers/staging/iio/adc/ad7150.c 2010-10-23 19:39:18 UTC (rev 9299)
@@ -66,9 +66,9 @@
const char *name;
struct i2c_client *client;
struct iio_dev *indio_dev;
- struct iio_work_cont work_cont_thresh;
- bool inter;
- s64 last_timestamp;
+ struct work_struct thresh_work;
+ bool inter;
+ s64 last_timestamp;
u16 ch1_threshold; /* Ch1 Threshold (in fixed threshold mode) */
u8 ch1_sensitivity; /* Ch1 Sensitivity (in adaptive threshold mode) */
u8 ch1_timeout; /* Ch1 Timeout (in adaptive threshold mode) */
@@ -680,9 +680,8 @@
static void ad7150_interrupt_handler_bh(struct work_struct *work_s)
{
- struct iio_work_cont *wc
- = container_of(work_s, struct iio_work_cont, ws_nocheck);
- struct ad7150_chip_info *chip = wc->st;
+ struct ad7150_chip_info *chip =
+ container_of(work_s, struct ad7150_chip_info, thresh_work);
u8 int_status;
enable_irq(chip->client->irq);
@@ -716,7 +715,7 @@
struct ad7150_chip_info *chip = dev_info->dev_data;
chip->last_timestamp = timestamp;
- schedule_work(&chip->work_cont_thresh.ws);
+ schedule_work(&chip->thresh_work);
return 0;
}
@@ -800,12 +799,6 @@
regdone = 1;
if (client->irq && gpio_is_valid(irq_to_gpio(client->irq)) > 0) {
- iio_init_work_cont(&chip->work_cont_thresh,
- ad7150_interrupt_handler_bh,
- ad7150_interrupt_handler_bh,
- AD7150_STATUS,
- 0,
- chip);
ret = iio_register_interrupt_line(client->irq,
chip->indio_dev,
0,
@@ -817,6 +810,7 @@
iio_add_event_to_list(iio_event_attr_ch2_low.listel,
&chip->indio_dev->interrupts[0]->ev_list);
+ INIT_WORK(&chip->thresh_work, ad7150_interrupt_handler_bh);
}
dev_err(&client->dev, "%s capacitive sensor registered, irq: %d\n", id->name, client->irq);
Modified: trunk/drivers/staging/iio/adc/ad7291.c (9298 => 9299)
--- trunk/drivers/staging/iio/adc/ad7291.c 2010-10-23 19:38:02 UTC (rev 9298)
+++ trunk/drivers/staging/iio/adc/ad7291.c 2010-10-23 19:39:18 UTC (rev 9299)
@@ -62,13 +62,13 @@
*/
struct ad7291_chip_info {
- const char *name;
- struct i2c_client *client;
- struct iio_dev *indio_dev;
- struct iio_work_cont work_cont_thresh;
- s64 last_timestamp;
- u16 command;
- u8 channels; /* Active voltage channels */
+ const char *name;
+ struct i2c_client *client;
+ struct iio_dev *indio_dev;
+ struct work_struct thresh_work;
+ s64 last_timestamp;
+ u16 command;
+ u8 channels; /* Active voltage channels */
};
/*
@@ -479,8 +479,8 @@
static void ad7291_interrupt_bh(struct work_struct *work_s)
{
- struct iio_work_cont *wc = to_iio_work_cont_no_check(work_s);
- struct ad7291_chip_info *chip = wc->st;
+ struct ad7291_chip_info *chip =
+ container_of(work_s, struct ad7291_chip_info, thresh_work);
u16 t_status, v_status;
u16 command;
int i;
@@ -525,7 +525,7 @@
struct ad7291_chip_info *chip = dev_info->dev_data;
chip->last_timestamp = timestamp;
- schedule_work(&chip->work_cont_thresh.ws_nocheck);
+ schedule_work(&chip->thresh_work);
return 0;
}
@@ -945,13 +945,6 @@
goto error_free_dev;
if (client->irq > 0) {
- iio_init_work_cont(&chip->work_cont_thresh,
- ad7291_interrupt_bh,
- ad7291_interrupt_bh,
- 0,
- 0,
- chip);
-
ret = iio_register_interrupt_line(client->irq,
chip->indio_dev,
0,
@@ -968,6 +961,8 @@
iio_add_event_to_list(&iio_event_ad7291,
&chip->indio_dev->interrupts[0]->ev_list);
+ INIT_WORK(&chip->thresh_work, ad7291_interrupt_bh);
+
if (client->irq_flags & IRQF_TRIGGER_LOW)
chip->command |= AD7291_ALART_POLARITY;
}
Modified: trunk/drivers/staging/iio/adc/ad7298.c (9298 => 9299)
--- trunk/drivers/staging/iio/adc/ad7298.c 2010-10-23 19:38:02 UTC (rev 9298)
+++ trunk/drivers/staging/iio/adc/ad7298.c 2010-10-23 19:39:18 UTC (rev 9299)
@@ -47,12 +47,12 @@
*/
struct ad7298_chip_info {
- const char *name;
- struct spi_device *spi_dev;
- struct iio_dev *indio_dev;
- u16 command;
- u16 busy_pin;
- u8 channels; /* Active voltage channels */
+ const char *name;
+ struct spi_device *spi_dev;
+ struct iio_dev *indio_dev;
+ u16 command;
+ u16 busy_pin;
+ u8 channels; /* Active voltage channels */
};
/*
Modified: trunk/drivers/staging/iio/adc/ad7314.c (9298 => 9299)
--- trunk/drivers/staging/iio/adc/ad7314.c 2010-10-23 19:38:02 UTC (rev 9298)
+++ trunk/drivers/staging/iio/adc/ad7314.c 2010-10-23 19:39:18 UTC (rev 9299)
@@ -47,12 +47,11 @@
*/
struct ad7314_chip_info {
- const char *name;
- struct spi_device *spi_dev;
- struct iio_dev *indio_dev;
- struct iio_work_cont work_cont_thresh;
- s64 last_timestamp;
- u8 mode;
+ const char *name;
+ struct spi_device *spi_dev;
+ struct iio_dev *indio_dev;
+ s64 last_timestamp;
+ u8 mode;
};
/*
Modified: trunk/drivers/staging/iio/adc/ad7414.c (9298 => 9299)
--- trunk/drivers/staging/iio/adc/ad7414.c 2010-10-23 19:38:02 UTC (rev 9298)
+++ trunk/drivers/staging/iio/adc/ad7414.c 2010-10-23 19:39:18 UTC (rev 9299)
@@ -57,12 +57,12 @@
*/
struct ad7414_chip_info {
- const char *name;
- struct i2c_client *client;
- struct iio_dev *indio_dev;
- struct iio_work_cont work_cont_thresh;
- s64 last_timestamp;
- u8 mode;
+ const char *name;
+ struct i2c_client *client;
+ struct iio_dev *indio_dev;
+ struct work_struct thresh_work;
+ s64 last_timestamp;
+ u8 mode;
};
/*
@@ -230,8 +230,8 @@
static void ad7414_interrupt_bh(struct work_struct *work_s)
{
- struct iio_work_cont *wc = to_iio_work_cont_no_check(work_s);
- struct ad7414_chip_info *chip = wc->st;
+ struct ad7414_chip_info *chip =
+ container_of(work_s, struct ad7414_chip_info, thresh_work);
u16 status;
u8 config;
int ret;
@@ -271,7 +271,7 @@
struct ad7414_chip_info *chip = dev_info->dev_data;
chip->last_timestamp = timestamp;
- schedule_work(&chip->work_cont_thresh.ws_nocheck);
+ schedule_work(&chip->thresh_work);
return 0;
}
@@ -471,13 +471,6 @@
goto error_free_dev;
if (client->irq) {
- iio_init_work_cont(&chip->work_cont_thresh,
- ad7414_interrupt_bh,
- ad7414_interrupt_bh,
- 0,
- 0,
- chip);
-
ret = iio_register_interrupt_line(client->irq,
chip->indio_dev,
0,
@@ -494,6 +487,8 @@
iio_add_event_to_list(&iio_event_ad7414,
&chip->indio_dev->interrupts[0]->ev_list);
+ INIT_WORK(&chip->thresh_work, ad7414_interrupt_bh);
+
ret = ad7414_i2c_read(chip, AD7414_CONFIG, &config);
if (ret) {
ret = -EIO;
Modified: trunk/drivers/staging/iio/adc/ad7416.c (9298 => 9299)
--- trunk/drivers/staging/iio/adc/ad7416.c 2010-10-23 19:38:02 UTC (rev 9298)
+++ trunk/drivers/staging/iio/adc/ad7416.c 2010-10-23 19:39:18 UTC (rev 9299)
@@ -73,15 +73,15 @@
*/
struct ad7416_chip_info {
- const char *name;
- struct i2c_client *client;
- struct iio_dev *indio_dev;
- struct iio_work_cont work_cont_thresh;
- s64 last_timestamp;
- u16 convert_pin;
- u8 mode;
- u8 channel_id; /* 0 always be temperature */
- u8 channel_mask;
+ const char *name;
+ struct i2c_client *client;
+ struct iio_dev *indio_dev;
+ struct work_struct thresh_work;
+ s64 last_timestamp;
+ u16 convert_pin;
+ u8 mode;
+ u8 channel_id; /* 0 always be temperature */
+ u8 channel_mask;
};
/*
@@ -356,8 +356,8 @@
static void ad7416_interrupt_bh(struct work_struct *work_s)
{
- struct iio_work_cont *wc = to_iio_work_cont_no_check(work_s);
- struct ad7416_chip_info *chip = wc->st;
+ struct ad7416_chip_info *chip =
+ container_of(work_s, struct ad7416_chip_info, thresh_work);
enable_irq(chip->client->irq);
@@ -374,7 +374,7 @@
struct ad7416_chip_info *chip = dev_info->dev_data;
chip->last_timestamp = timestamp;
- schedule_work(&chip->work_cont_thresh.ws_nocheck);
+ schedule_work(&chip->thresh_work);
return 0;
}
@@ -671,13 +671,6 @@
goto error_free_dev;
if (client->irq) {
- iio_init_work_cont(&chip->work_cont_thresh,
- ad7416_interrupt_bh,
- ad7416_interrupt_bh,
- 0,
- 0,
- chip);
-
ret = iio_register_interrupt_line(client->irq,
chip->indio_dev,
0,
@@ -694,6 +687,8 @@
iio_add_event_to_list(&iio_event_ad7416,
&chip->indio_dev->interrupts[0]->ev_list);
+ INIT_WORK(&chip->thresh_work, ad7416_interrupt_bh);
+
ret = ad7416_i2c_read(chip, AD7416_CONFIG, &config);
if (ret) {
ret = -EIO;
Modified: trunk/drivers/staging/iio/adc/ad774x.c (9298 => 9299)
--- trunk/drivers/staging/iio/adc/ad774x.c 2010-10-23 19:38:02 UTC (rev 9298)
+++ trunk/drivers/staging/iio/adc/ad774x.c 2010-10-23 19:39:18 UTC (rev 9299)
@@ -57,9 +57,9 @@
const char *name;
struct i2c_client *client;
struct iio_dev *indio_dev;
- struct iio_work_cont work_cont_thresh;
- bool inter;
- s64 last_timestamp;
+ struct work_struct thresh_work;
+ bool inter;
+ s64 last_timestamp;
u16 cap_offs; /* Capacitive offset */
u16 cap_gain; /* Capacitive gain calibration */
u16 volt_gain; /* Voltage gain calibration */
@@ -534,9 +534,8 @@
static void ad774x_interrupt_handler_bh(struct work_struct *work_s)
{
- struct iio_work_cont *wc
- = container_of(work_s, struct iio_work_cont, ws_nocheck);
- struct ad774x_chip_info *chip = wc->st;
+ struct ad774x_chip_info *chip =
+ container_of(work_s, struct ad774x_chip_info, thresh_work);
u8 int_status;
enable_irq(chip->client->irq);
@@ -562,7 +561,7 @@
struct ad774x_chip_info *chip = dev_info->dev_data;
chip->last_timestamp = timestamp;
- schedule_work(&chip->work_cont_thresh.ws);
+ schedule_work(&chip->thresh_work);
return 0;
}
@@ -642,12 +641,6 @@
regdone = 1;
if (client->irq && gpio_is_valid(irq_to_gpio(client->irq)) > 0) {
- iio_init_work_cont(&chip->work_cont_thresh,
- ad774x_interrupt_handler_bh,
- ad774x_interrupt_handler_bh,
- AD774X_STATUS,
- 0,
- chip);
ret = iio_register_interrupt_line(client->irq,
chip->indio_dev,
0,
@@ -659,6 +652,7 @@
iio_add_event_to_list(iio_event_attr_cap_rdy.listel,
&chip->indio_dev->interrupts[0]->ev_list);
+ INIT_WORK(&chip->thresh_work, ad774x_interrupt_handler_bh);
}
dev_err(&client->dev, "%s capacitive sensor registered, irq: %d\n", id->name, client->irq);
Modified: trunk/drivers/staging/iio/adc/ad7816.c (9298 => 9299)
--- trunk/drivers/staging/iio/adc/ad7816.c 2010-10-23 19:38:02 UTC (rev 9298)
+++ trunk/drivers/staging/iio/adc/ad7816.c 2010-10-23 19:39:18 UTC (rev 9299)
@@ -44,17 +44,17 @@
*/
struct ad7816_chip_info {
- const char *name;
- struct spi_device *spi_dev;
- struct iio_dev *indio_dev;
- struct iio_work_cont work_cont_thresh;
- s64 last_timestamp;
- u16 rdwr_pin;
- u16 convert_pin;
- u16 busy_pin;
- u8 oti_data[AD7816_CS_MAX+1];
- u8 channel_id; /* 0 always be temperature */
- u8 mode;
+ const char *name;
+ struct spi_device *spi_dev;
+ struct iio_dev *indio_dev;
+ struct work_struct thresh_work;
+ s64 last_timestamp;
+ u16 rdwr_pin;
+ u16 convert_pin;
+ u16 busy_pin;
+ u8 oti_data[AD7816_CS_MAX+1];
+ u8 channel_id; /* 0 always be temperature */
+ u8 mode;
};
/*
@@ -268,8 +268,8 @@
static void ad7816_interrupt_bh(struct work_struct *work_s)
{
- struct iio_work_cont *wc = to_iio_work_cont_no_check(work_s);
- struct ad7816_chip_info *chip = wc->st;
+ struct ad7816_chip_info *chip =
+ container_of(work_s, struct ad7816_chip_info, thresh_work);
enable_irq(chip->spi_dev->irq);
@@ -286,7 +286,7 @@
struct ad7816_chip_info *chip = dev_info->dev_data;
chip->last_timestamp = timestamp;
- schedule_work(&chip->work_cont_thresh.ws_nocheck);
+ schedule_work(&chip->thresh_work);
return 0;
}
@@ -441,13 +441,6 @@
spi_dev->irq_flags &= ~IRQF_TRIGGER_MASK;
spi_dev->irq_flags |= IRQF_TRIGGER_LOW;
- iio_init_work_cont(&chip->work_cont_thresh,
- ad7816_interrupt_bh,
- ad7816_interrupt_bh,
- 0,
- 0,
- chip);
-
ret = iio_register_interrupt_line(spi_dev->irq,
chip->indio_dev,
0,
@@ -463,6 +456,8 @@
*/
iio_add_event_to_list(&iio_event_ad7816,
&chip->indio_dev->interrupts[0]->ev_list);
+
+ INIT_WORK(&chip->thresh_work, ad7816_interrupt_bh);
}
dev_info(&spi_dev->dev, "%s temperature sensor and ADC registered.\n",
Modified: trunk/drivers/staging/iio/adc/adt7310.c (9298 => 9299)
--- trunk/drivers/staging/iio/adc/adt7310.c 2010-10-23 19:38:02 UTC (rev 9298)
+++ trunk/drivers/staging/iio/adc/adt7310.c 2010-10-23 19:39:18 UTC (rev 9299)
@@ -82,12 +82,12 @@
*/
struct adt7310_chip_info {
- const char *name;
- struct spi_device *spi_dev;
- struct iio_dev *indio_dev;
- struct iio_work_cont work_cont_thresh;
- s64 last_timestamp;
- u8 config;
+ const char *name;
+ struct spi_device *spi_dev;
+ struct iio_dev *indio_dev;
+ struct work_struct thresh_work;
+ s64 last_timestamp;
+ u8 config;
};
/*
@@ -415,8 +415,8 @@
static void adt7310_interrupt_bh(struct work_struct *work_s)
{
- struct iio_work_cont *wc = to_iio_work_cont_check(work_s);
- struct adt7310_chip_info *chip = wc->st;
+ struct adt7310_chip_info *chip =
+ container_of(work_s, struct adt7310_chip_info, thresh_work);
u8 status;
if (adt7310_spi_read_byte(chip, ADT7310_STATUS, &status))
@@ -444,7 +444,7 @@
struct adt7310_chip_info *chip = dev_info->dev_data;
chip->last_timestamp = timestamp;
- schedule_work(&chip->work_cont_thresh.ws);
+ schedule_work(&chip->thresh_work);
return 0;
}
@@ -852,12 +852,7 @@
}
if (spi_dev->irq && adt7310_platform_data[0]) {
- iio_init_work_cont(&chip->work_cont_thresh,
- adt7310_interrupt_bh,
- adt7310_interrupt_bh,
- 0,
- 0,
- chip);
+ INIT_WORK(&chip->thresh_work, adt7310_interrupt_bh);
ret = adt7310_spi_read_byte(chip, ADT7310_CONFIG, &chip->config);
if (ret) {
Modified: trunk/drivers/staging/iio/adc/adt7408.c (9298 => 9299)
--- trunk/drivers/staging/iio/adc/adt7408.c 2010-10-23 19:38:02 UTC (rev 9298)
+++ trunk/drivers/staging/iio/adc/adt7408.c 2010-10-23 19:39:18 UTC (rev 9299)
@@ -84,12 +84,12 @@
*/
struct adt7408_chip_info {
- const char *name;
- struct i2c_client *client;
- struct iio_dev *indio_dev;
- struct iio_work_cont work_cont_thresh;
- s64 last_timestamp;
- u16 config;
+ const char *name;
+ struct i2c_client *client;
+ struct iio_dev *indio_dev;
+ struct work_struct thresh_work;
+ s64 last_timestamp;
+ u16 config;
};
/*
@@ -319,8 +319,8 @@
static void adt7408_interrupt_bh(struct work_struct *work_s)
{
- struct iio_work_cont *wc = to_iio_work_cont_no_check(work_s);
- struct adt7408_chip_info *chip = wc->st;
+ struct adt7408_chip_info *chip =
+ container_of(work_s, struct adt7408_chip_info, thresh_work);
u16 config;
u16 data;
@@ -363,7 +363,7 @@
struct adt7408_chip_info *chip = dev_info->dev_data;
chip->last_timestamp = timestamp;
- schedule_work(&chip->work_cont_thresh.ws_nocheck);
+ schedule_work(&chip->thresh_work);
return 0;
}
@@ -904,13 +904,6 @@
goto error_free_dev;
if (client->irq) {
- iio_init_work_cont(&chip->work_cont_thresh,
- adt7408_interrupt_bh,
- adt7408_interrupt_bh,
- 0,
- 0,
- chip);
-
ret = iio_register_interrupt_line(client->irq,
chip->indio_dev,
0,
@@ -927,6 +920,8 @@
iio_add_event_to_list(&iio_event_adt7408,
&chip->indio_dev->interrupts[0]->ev_list);
+ INIT_WORK(&chip->thresh_work, adt7408_interrupt_bh);
+
ret = adt7408_i2c_read(chip, ADT7408_CONFIG, &chip->config);
if (ret) {
ret = -EIO;
Modified: trunk/drivers/staging/iio/adc/adt7410.c (9298 => 9299)
--- trunk/drivers/staging/iio/adc/adt7410.c 2010-10-23 19:38:02 UTC (rev 9298)
+++ trunk/drivers/staging/iio/adc/adt7410.c 2010-10-23 19:39:18 UTC (rev 9299)
@@ -77,12 +77,12 @@
*/
struct adt7410_chip_info {
- const char *name;
- struct i2c_client *client;
- struct iio_dev *indio_dev;
- struct iio_work_cont work_cont_thresh;
- s64 last_timestamp;
- u8 config;
+ const char *name;
+ struct i2c_client *client;
+ struct iio_dev *indio_dev;
+ struct work_struct thresh_work;
+ s64 last_timestamp;
+ u8 config;
};
/*
@@ -383,8 +383,8 @@
static void adt7410_interrupt_bh(struct work_struct *work_s)
{
- struct iio_work_cont *wc = to_iio_work_cont_check(work_s);
- struct adt7410_chip_info *chip = wc->st;
+ struct adt7410_chip_info *chip =
+ container_of(work_s, struct adt7410_chip_info, thresh_work);
u8 status;
if (adt7410_i2c_read_byte(chip, ADT7410_STATUS, &status))
@@ -414,7 +414,7 @@
struct adt7410_chip_info *chip = dev_info->dev_data;
chip->last_timestamp = timestamp;
- schedule_work(&chip->work_cont_thresh.ws);
+ schedule_work(&chip->thresh_work);
return 0;
}
@@ -821,12 +821,7 @@
}
if (client->irq && adt7410_platform_data[0]) {
- iio_init_work_cont(&chip->work_cont_thresh,
- adt7410_interrupt_bh,
- adt7410_interrupt_bh,
- 0,
- 0,
- chip);
+ INIT_WORK(&chip->thresh_work, adt7410_interrupt_bh);
ret = adt7410_i2c_read_byte(chip, ADT7410_CONFIG, &chip->config);
if (ret) {
Modified: trunk/drivers/staging/iio/adc/adt75.c (9298 => 9299)
--- trunk/drivers/staging/iio/adc/adt75.c 2010-10-23 19:38:02 UTC (rev 9298)
+++ trunk/drivers/staging/iio/adc/adt75.c 2010-10-23 19:39:18 UTC (rev 9299)
@@ -54,12 +54,12 @@
*/
struct adt75_chip_info {
- const char *name;
- struct i2c_client *client;
- struct iio_dev *indio_dev;
- struct iio_work_cont work_cont_thresh;
- s64 last_timestamp;
- u8 config;
+ const char *name;
+ struct i2c_client *client;
+ struct iio_dev *indio_dev;
+ struct work_struct thresh_work;
+ s64 last_timestamp;
+ u8 config;
};
/*
@@ -281,9 +281,8 @@
static void adt75_interrupt_bh(struct work_struct *work_s)
{
- struct iio_work_cont *wc
- = container_of(work_s, struct iio_work_cont, ws_nocheck);
- struct adt75_chip_info *chip = wc->st;
+ struct adt75_chip_info *chip =
+ container_of(work_s, struct adt75_chip_info, thresh_work);
enable_irq(chip->client->irq);
@@ -300,7 +299,7 @@
struct adt75_chip_info *chip = dev_info->dev_data;
chip->last_timestamp = timestamp;
- schedule_work(&chip->work_cont_thresh.ws_nocheck);
+ schedule_work(&chip->thresh_work);
return 0;
}
@@ -634,13 +633,6 @@
goto error_free_dev;
if (client->irq > 0) {
- iio_init_work_cont(&chip->work_cont_thresh,
- adt75_interrupt_bh,
- adt75_interrupt_bh,
- 0,
- 0,
- chip);
-
ret = iio_register_interrupt_line(client->irq,
chip->indio_dev,
0,
@@ -657,6 +649,8 @@
iio_add_event_to_list(&iio_event_adt75,
&chip->indio_dev->interrupts[0]->ev_list);
+ INIT_WORK(&chip->thresh_work, adt75_interrupt_bh);
+
ret = adt75_i2c_read(chip, ADT75_CONFIG, &chip->config);
if (ret) {
ret = -EIO;