Skip to content

Commit

Permalink
staging: iio: remove specific chrdev for event reading. Get fd from i…
Browse files Browse the repository at this point in the history
…octl on buffer.

Change suggested by Arnd Bergmann.

No real reason to have two chrdevs per device. This step merges them into one.
Currently this means that events will only work on devices with buffers. THat will
be remedied shortly.

V2: set name for event attribute groups.  Otherwise they all sorts of fun occurs on
dynamic channel event attribute creation.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Sep 6, 2011
1 parent 7ae8cf6 commit 8e7d967
Show file tree
Hide file tree
Showing 15 changed files with 98 additions and 117 deletions.
1 change: 1 addition & 0 deletions drivers/staging/iio/accel/sca3000_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,7 @@ static struct attribute *sca3000_event_attributes[] = {

static struct attribute_group sca3000_event_attribute_group = {
.attrs = sca3000_event_attributes,
.name = "events",
};

/**
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/iio/adc/ad7150.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ static struct attribute *ad7150_event_attributes[] = {

static struct attribute_group ad7150_event_attribute_group = {
.attrs = ad7150_event_attributes,
.name = "events",
};

static const struct iio_info ad7150_info = {
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/iio/adc/ad7745.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ static struct attribute *ad774x_event_attributes[] = {

static struct attribute_group ad774x_event_attribute_group = {
.attrs = ad774x_event_attributes,
.name = "events",
};

static const struct iio_info ad774x_info = {
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/iio/adc/ad7816.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ static struct attribute *ad7816_event_attributes[] = {

static struct attribute_group ad7816_event_attribute_group = {
.attrs = ad7816_event_attributes,
.name = "events",
};

static const struct iio_info ad7816_info = {
Expand Down
2 changes: 2 additions & 0 deletions drivers/staging/iio/adc/ad799x_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ static struct attribute *ad7993_4_7_8_event_attributes[] = {

static struct attribute_group ad7993_4_7_8_event_attrs_group = {
.attrs = ad7993_4_7_8_event_attributes,
.name = "events",
};

static struct attribute *ad7992_event_attributes[] = {
Expand All @@ -463,6 +464,7 @@ static struct attribute *ad7992_event_attributes[] = {

static struct attribute_group ad7992_event_attrs_group = {
.attrs = ad7992_event_attributes,
.name = "events",
};

static const struct iio_info ad7991_info = {
Expand Down
2 changes: 2 additions & 0 deletions drivers/staging/iio/adc/adt7310.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,10 @@ static struct attribute *adt7310_event_ct_attributes[] = {
static struct attribute_group adt7310_event_attribute_group[ADT7310_IRQS] = {
{
.attrs = adt7310_event_int_attributes,
.name = "events",
}, {
.attrs = adt7310_event_ct_attributes,
.name = "events",
}
};

Expand Down
2 changes: 2 additions & 0 deletions drivers/staging/iio/adc/adt7410.c
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,10 @@ static struct attribute *adt7410_event_ct_attributes[] = {
static struct attribute_group adt7410_event_attribute_group[ADT7410_IRQS] = {
{
.attrs = adt7410_event_int_attributes,
.name = "events",
}, {
.attrs = adt7410_event_ct_attributes,
.name = "events",
}
};

Expand Down
1 change: 1 addition & 0 deletions drivers/staging/iio/adc/adt75.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ static struct attribute *adt75_event_attributes[] = {

static struct attribute_group adt75_event_attribute_group = {
.attrs = adt75_event_attributes,
.name = "events",
};

static const struct iio_info adt75_info = {
Expand Down
4 changes: 3 additions & 1 deletion drivers/staging/iio/adc/max1363_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@ static struct attribute *max1363_event_attributes[] = {

static struct attribute_group max1363_event_attribute_group = {
.attrs = max1363_event_attributes,
.name = "events",
};

#define MAX1363_EVENT_FUNCS \
Expand Down Expand Up @@ -1296,7 +1297,8 @@ static int __devinit max1363_probe(struct i2c_client *client,
/* Estabilish that the iio_dev is a child of the i2c device */
indio_dev->dev.parent = &client->dev;
indio_dev->name = id->name;

indio_dev->channels = st->chip_info->channels;
indio_dev->num_channels = st->chip_info->num_channels;
indio_dev->info = st->chip_info->info;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = st->chip_info->channels;
Expand Down
2 changes: 2 additions & 0 deletions drivers/staging/iio/addac/adt7316.c
Original file line number Diff line number Diff line change
Expand Up @@ -2064,6 +2064,7 @@ static struct attribute *adt7316_event_attributes[] = {

static struct attribute_group adt7316_event_attribute_group = {
.attrs = adt7316_event_attributes,
.name = "events",
};

static struct attribute *adt7516_event_attributes[] = {
Expand All @@ -2084,6 +2085,7 @@ static struct attribute *adt7516_event_attributes[] = {

static struct attribute_group adt7516_event_attribute_group = {
.attrs = adt7516_event_attributes,
.name = "events",
};

#ifdef CONFIG_PM
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/iio/chrdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ struct iio_event_data {
s64 timestamp;
};

#define IIO_GET_EVENT_FD_IOCTL _IOR('i', 0x90, int)
#endif
1 change: 1 addition & 0 deletions drivers/staging/iio/dac/ad5504.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ static struct attribute *ad5504_ev_attributes[] = {

static struct attribute_group ad5504_ev_attribute_group = {
.attrs = ad5504_ev_attributes,
.name = "events",
};

static irqreturn_t ad5504_event_handler(int irq, void *private)
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/iio/iio.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ struct iio_info {

};

int iio_event_getfd(struct iio_dev *indio_dev);
/**
* struct iio_dev - industrial I/O device
* @id: [INTERN] used to identify device internally
Expand Down
Loading

0 comments on commit 8e7d967

Please sign in to comment.