diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-07 15:07:58 +0900 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-07 15:07:58 +0900 |
commit | 0b1e73ed225d8f7aeef96b74147215ca8b990dce (patch) | |
tree | c362e187e34b8c1302fc1e6e6767b8790d44ed03 /drivers/iio/dac/ad5446.c | |
parent | 56edff7529d0baa6d7b38b58f46631c7b9f4136e (diff) | |
parent | ed5d6ca0038f274aada1244358ad89b7941bdcbf (diff) |
Merge tag 'staging-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver update from Greg KH:
"Here's the big drivers/staging/ update for 3.13-rc1.
Nothing major here, just a _ton_ of fixes and cleanups, mostly driven
by the new round of OPW applicants, but also there are lots of other
people doing staging tree cleanups these days in order to help get the
drivers into mergable shape.
We also merge, and then revert, the ktap code, as Ingo and the other
perf/ftrace developers feel it should go into the "real" part of the
kernel with only a bit more work, so no need to put it in staging for
now.
All of this has been in linux-next for a while with no reported
issues"
* tag 'staging-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1045 commits)
staging: drm/imx: fix return value check in ipu_add_subdevice_pdata()
Staging: zram: Fix access of NULL pointer
Staging: zram: Fix variable dereferenced before check
Staging: rtl8187se: space prohibited before semicolon in r8185b_init.c
Staging: rtl8187se: fix space prohibited after that open parenthesis '(' in r8185b_init.c
Staging: rtl8187se: fix braces {} are not necessary for single statement blocks in r8185b_init.c
Staging: rtl8187se: fix trailing whitespace in r8185b_init.c
Staging: rtl8187se: fix please, no space before tabs in r8185b_init.c
drivers/staging/nvec/Kconfig: remove trailing whitespace
Staging: dwc2: Fix variable dereferenced before check
Staging: xgifb: fix braces {} are not necessary for any arm of this statement
staging: rtl8192e: remove unneeded semicolons
staging: rtl8192e: use true and false for bool variables
staging: ft1000: return values corrected in scram_start_dwnld
staging: ft1000: change values of status return variable in write_dpram32_and_check
staging: bcm: Remove unnecessary pointer casting
imx-drm: ipuv3-crtc: Invert IPU DI0 clock polarity
staging: r8188eu: Fix sparse warnings in rtl_p2p.c
staging: r8188eu: Fix sparse warnings in rtw_mlme_ext.c
staging: r8188eu: Fix sparse warnings in rtl8188e.cmd.c
...
Diffstat (limited to 'drivers/iio/dac/ad5446.c')
-rw-r--r-- | drivers/iio/dac/ad5446.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/iio/dac/ad5446.c b/drivers/iio/dac/ad5446.c index 96e9ed4c2d0..1263b0e5ad8 100644 --- a/drivers/iio/dac/ad5446.c +++ b/drivers/iio/dac/ad5446.c @@ -132,8 +132,9 @@ static const struct iio_chan_spec_ext_info ad5446_ext_info_powerdown[] = { .name = "powerdown", .read = ad5446_read_dac_powerdown, .write = ad5446_write_dac_powerdown, + .shared = IIO_SEPARATE, }, - IIO_ENUM("powerdown_mode", false, &ad5446_powerdown_mode_enum), + IIO_ENUM("powerdown_mode", IIO_SEPARATE, &ad5446_powerdown_mode_enum), IIO_ENUM_AVAILABLE("powerdown_mode", &ad5446_powerdown_mode_enum), { }, }; @@ -162,18 +163,15 @@ static int ad5446_read_raw(struct iio_dev *indio_dev, long m) { struct ad5446_state *st = iio_priv(indio_dev); - unsigned long scale_uv; switch (m) { case IIO_CHAN_INFO_RAW: *val = st->cached_val; return IIO_VAL_INT; case IIO_CHAN_INFO_SCALE: - scale_uv = (st->vref_mv * 1000) >> chan->scan_type.realbits; - *val = scale_uv / 1000; - *val2 = (scale_uv % 1000) * 1000; - return IIO_VAL_INT_PLUS_MICRO; - + *val = st->vref_mv; + *val2 = chan->scan_type.realbits; + return IIO_VAL_FRACTIONAL_LOG2; } return -EINVAL; } @@ -329,6 +327,7 @@ enum ad5446_supported_spi_device_ids { ID_AD5601, ID_AD5611, ID_AD5621, + ID_AD5641, ID_AD5620_2500, ID_AD5620_1250, ID_AD5640_2500, @@ -391,6 +390,10 @@ static const struct ad5446_chip_info ad5446_spi_chip_info[] = { .channel = AD5446_CHANNEL_POWERDOWN(12, 16, 2), .write = ad5446_write, }, + [ID_AD5641] = { + .channel = AD5446_CHANNEL_POWERDOWN(14, 16, 0), + .write = ad5446_write, + }, [ID_AD5620_2500] = { .channel = AD5446_CHANNEL_POWERDOWN(12, 16, 2), .int_vref_mv = 2500, @@ -445,6 +448,7 @@ static const struct spi_device_id ad5446_spi_ids[] = { {"ad5601", ID_AD5601}, {"ad5611", ID_AD5611}, {"ad5621", ID_AD5621}, + {"ad5641", ID_AD5641}, {"ad5620-2500", ID_AD5620_2500}, /* AD5620/40/60: */ {"ad5620-1250", ID_AD5620_1250}, /* part numbers may look differently */ {"ad5640-2500", ID_AD5640_2500}, |