OSDN Git Service

iio: amplifiers: ad8366: rework driver to allow other chips
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Thu, 30 May 2019 13:18:10 +0000 (16:18 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 17 Jun 2019 20:06:47 +0000 (21:06 +0100)
commit11ab555a6d3b0ecbb51076af79e625303bfa61de
treee205f620544e96e667b4f5fc7d5a86944b4ef661
parentdbcf6b5d2625b904f13810b168773b05d891204b
iio: amplifiers: ad8366: rework driver to allow other chips

The SPI gain amplifiers are simple devices, with 1 or 2 channels, to which
are read-from/written-to.

The gain computation in ad8366_write_raw() has been updated to compute gain
in dB for negative values.

This driver will be extended to support other chips as well.
To do that, this rework handles the AD8366 device as a special-case (via
switch-statements). This will make things easier when adding new chips.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/amplifiers/ad8366.c