iio: dac: ti-dac082s085: Read chip spec from device table
authorLukas Wunner <lukas@wunner.de>
Tue, 17 Oct 2017 10:42:00 +0000 (12:42 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 21 Oct 2017 19:36:45 +0000 (20:36 +0100)
commitf98677cf315e61403aefef72b056c643dd152c54
tree628e8ff9ccccba7d410471b6d2b54187323fbda8
parent61011264c1afd8c075fb9028ccc78e7f2e63ce48
iio: dac: ti-dac082s085: Read chip spec from device table

The two properties unique to each supported chip, resolution and number
of channels, are currently gleaned from the chip's name.
E.g. dac102s085 is a dual channel 10-bit DAC.
        ^^^
This was deemed unmaintainable by the subsystem maintainer once the
driver is extended to support further chips, hence it was requested
to add an explicit table for chip-specific information and use an
enum to reference into it.

This adds 17 LoC without any immediate gain, so make the change in a
separate commit which can be reverted if we determine in 10 years that
it was unnecessary.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/ti-dac082s085.c