diff options
Diffstat (limited to 'drivers/staging/iio/resolver/ad2s1210.c')
-rw-r--r-- | drivers/staging/iio/resolver/ad2s1210.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c index 7fbaba4..b4c14ba 100644 --- a/drivers/staging/iio/resolver/ad2s1210.c +++ b/drivers/staging/iio/resolver/ad2s1210.c @@ -197,6 +197,7 @@ static ssize_t ad2s1210_show_fclkin(struct device *dev, char *buf) { struct ad2s1210_state *st = iio_priv(dev_to_iio_dev(dev)); + return sprintf(buf, "%d\n", st->fclkin); } @@ -235,6 +236,7 @@ static ssize_t ad2s1210_show_fexcit(struct device *dev, char *buf) { struct ad2s1210_state *st = iio_priv(dev_to_iio_dev(dev)); + return sprintf(buf, "%d\n", st->fexcit); } @@ -271,6 +273,7 @@ static ssize_t ad2s1210_show_control(struct device *dev, { struct ad2s1210_state *st = iio_priv(dev_to_iio_dev(dev)); int ret; + mutex_lock(&st->lock); ret = ad2s1210_config_read(st, AD2S1210_REG_CONTROL); mutex_unlock(&st->lock); @@ -328,6 +331,7 @@ static ssize_t ad2s1210_show_resolution(struct device *dev, struct device_attribute *attr, char *buf) { struct ad2s1210_state *st = iio_priv(dev_to_iio_dev(dev)); + return sprintf(buf, "%d\n", st->resolution); } @@ -491,7 +495,7 @@ static int ad2s1210_read_raw(struct iio_dev *indio_dev, switch (chan->type) { case IIO_ANGL: - pos = be16_to_cpup((u16 *)st->rx); + pos = be16_to_cpup((__be16 *) st->rx); if (st->hysteresis) pos >>= 16 - st->resolution; *val = pos; @@ -499,7 +503,7 @@ static int ad2s1210_read_raw(struct iio_dev *indio_dev, break; case IIO_ANGL_VEL: negative = st->rx[0] & 0x80; - vel = be16_to_cpup((s16 *)st->rx); + vel = be16_to_cpup((__be16 *) st->rx); vel >>= 16 - st->resolution; if (vel & 0x8000) { negative = (0xffff >> st->resolution) << st->resolution; |