Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281243
b: refs/heads/master
c: 5fb21c8
h: refs/heads/master
i:
  281241: d8df19f
  281239: d39d017
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Dec 8, 2011
1 parent b99b05b commit ddc3140
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 94386ab0b4c5a4e15afae8542cb01caa2ff37594
refs/heads/master: 5fb21c824e8ff22ae9361a789e8b845d72ae0557
8 changes: 8 additions & 0 deletions trunk/drivers/staging/iio/iio.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,14 @@ struct iio_dev {
int groupcounter;
};

/**
* iio_find_channel_from_si() - get channel from its scan index
* @indio_dev: device
* @si: scan index to match
*/
const struct iio_chan_spec
*iio_find_channel_from_si(struct iio_dev *indio_dev, int si);

/**
* iio_device_register() - register a device with the IIO subsystem
* @indio_dev: Device structure filled by the device driver
Expand Down
11 changes: 11 additions & 0 deletions trunk/drivers/staging/iio/industrialio-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ static const char * const iio_chan_info_postfix[] = {
= "filter_low_pass_3db_frequency",
};

const struct iio_chan_spec
*iio_find_channel_from_si(struct iio_dev *indio_dev, int si)
{
int i;

for (i = 0; i < indio_dev->num_channels; i++)
if (indio_dev->channels[i].scan_index == si)
return &indio_dev->channels[i];
return NULL;
}

/**
* struct iio_detected_event_list - list element for events that have occurred
* @list: linked list header
Expand Down

0 comments on commit ddc3140

Please sign in to comment.