Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220291
b: refs/heads/master
c: 668413e
h: refs/heads/master
i:
  220289: 0a57a21
  220287: 57703bb
v: v3
  • Loading branch information
Michael Hennerich authored and Greg Kroah-Hartman committed Oct 12, 2010
1 parent 3b8d027 commit be47bbc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 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: 349282d82e929e7982ca53510437c0850ab5294a
refs/heads/master: 668413e9e7ad0bc53eeba2465dafd66dbc817996
5 changes: 3 additions & 2 deletions trunk/drivers/staging/iio/adc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ config AD7476
tristate "Analog Devices AD7475/6/7/8 AD7466/7/8 and AD7495 ADC driver"
depends on SPI
help
Say yes here to build support for Analog Devices AD7475/6/7/8,
AD7466/7/8 and AD7495 ADC driver.
Say yes here to build support for Analog Devices
AD7475, AD7476, AD7477, AD7478, AD7466, AD7467, AD7468, AD7495
SPI analog to digital convertors (ADC).
If unsure, say N (but it's safe to say "Y").

To compile this driver as a module, choose M here: the
Expand Down
11 changes: 3 additions & 8 deletions trunk/drivers/staging/iio/adc/ad7476_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@

static int ad7476_scan_direct(struct ad7476_state *st)
{
struct spi_device *spi = st->spi;
int ret;

ret = spi_sync(spi, &st->msg);
ret = spi_sync(st->spi, &st->msg);
if (ret)
return ret;

Expand Down Expand Up @@ -67,13 +66,9 @@ static ssize_t ad7476_show_scale(struct device *dev,
struct iio_dev *dev_info = dev_get_drvdata(dev);
struct ad7476_state *st = iio_dev_get_devdata(dev_info);
/* Corresponds to Vref / 2^(bits) */
unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits;

if ((1 << (st->chip_info->bits + 1)) > st->int_vref_mv)
return sprintf(buf, "%d/2^%d\n",
st->int_vref_mv, st->chip_info->bits);
else
return sprintf(buf, "%d\n",
st->int_vref_mv >> st->chip_info->bits);
return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000);
}
static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7476_show_scale, NULL, 0);

Expand Down

0 comments on commit be47bbc

Please sign in to comment.