iio: adc: ti-ads1015: fix comparator polarity setting
authorAkinobu Mita <akinobu.mita@gmail.com>
Thu, 24 Aug 2017 00:22:57 +0000 (09:22 +0900)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 3 Sep 2017 16:09:32 +0000 (17:09 +0100)
commit3af75db12e3d3537bc01c06bbdc876cb17e82b35
tree28b06426c8c968f2cdda1861e48a0825b2fd0559
parenta575de2da5e20c31f4ffcb1df555c199ad77fc20
iio: adc: ti-ads1015: fix comparator polarity setting

The comparator polarity field in config register is not correctly
initialized as per the interrupt trigger setting.  Because the bitfield
definision is wrong and bit shifting is missed.

Fixes: d9f39babd8ba ("iio: adc: ti-ads1015: add threshold event support")
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ti-ads1015.c