Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304362
b: refs/heads/master
c: 5ccb3ad
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Apr 18, 2012
1 parent 7c9686c commit 7d6d17e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 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: 35a36e650558855cd76981b73e282874a9c77335
refs/heads/master: 5ccb3adbd7593b69d1355454b0c6d2dffdad51d9
9 changes: 7 additions & 2 deletions trunk/drivers/staging/iio/iio.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ enum iio_data_type {

/* Could add the raw attributes as well - allowing buffer only devices */
enum iio_chan_info_enum {
/* 0 is reserved for raw attributes */
IIO_CHAN_INFO_SCALE = 1,
IIO_CHAN_INFO_RAW = 0,
IIO_CHAN_INFO_PROCESSED,
IIO_CHAN_INFO_SCALE,
IIO_CHAN_INFO_OFFSET,
IIO_CHAN_INFO_CALIBSCALE,
IIO_CHAN_INFO_CALIBBIAS,
Expand All @@ -42,6 +43,10 @@ enum iio_chan_info_enum {
#define IIO_CHAN_INFO_SHARED_BIT(type) BIT(type*2)
#define IIO_CHAN_INFO_SEPARATE_BIT(type) BIT(type*2 + 1)

#define IIO_CHAN_INFO_RAW_SEPARATE_BIT \
IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_RAW)
#define IIO_CHAN_INFO_PROCESSED_SEPARATE_BIT \
IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_PROCESSED)
#define IIO_CHAN_INFO_SCALE_SEPARATE_BIT \
IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_SCALE)
#define IIO_CHAN_INFO_SCALE_SHARED_BIT \
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/staging/iio/industrialio-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,8 @@ int __iio_add_chan_devattr(const char *postfix,
static int iio_device_add_channel_sysfs(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan)
{
int ret, i, attrcount = 0;
int ret, attrcount = 0;
int i = 4;
const struct iio_chan_spec_ext_info *ext_info;

if (chan->channel < 0)
Expand All @@ -595,7 +596,7 @@ static int iio_device_add_channel_sysfs(struct iio_dev *indio_dev,
goto error_ret;
attrcount++;

for_each_set_bit(i, &chan->info_mask, sizeof(long)*8) {
for_each_set_bit_from(i, &chan->info_mask, sizeof(long)*8) {
ret = __iio_add_chan_devattr(iio_chan_info_postfix[i/2],
chan,
&iio_read_channel_info,
Expand Down

0 comments on commit 7d6d17e

Please sign in to comment.