summaryrefslogtreecommitdiffstats
path: root/drivers/iio/temperature/maxim_thermocouple.c
Commit message (Collapse)AuthorAgeFilesLines
* iio:temperature: drop assignment of iio_info.driver_moduleJonathan Cameron2017-08-221-1/+0
| | | | | | | | | The equivalent of this is now done via macro magic when the relevant register call is made. The actual structure elements will shortly go away. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
* iio: temperature: maxim_thermocouple: add MAX31856 partMatt Ranostay2017-05-071-0/+1
| | | | | | | | | | | MAX31856 is register equivalent to the MAX31855 but suppports J, N, R, S, T, E and B type thermocouples in addition to K-type. Data conversion for the various types happens transparently to the driver via probe type detection, and a LUT on the sensor. Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: maxim_thermocouple: Set parent deviceLars-Peter Clausen2017-02-191-0/+1
| | | | | | | | | Initialize the parent of the IIO device to the device that registered it. This makes sure that the IIO device appears the right level in the device hierarchy. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: maxim_thermocouple: detect invalid storage size in read()Arnd Bergmann2016-11-131-0/+2
| | | | | | | | | | | | | | | | | As found by gcc -Wmaybe-uninitialized, having a storage_bytes value other than 2 or 4 will result in undefined behavior: drivers/iio/temperature/maxim_thermocouple.c: In function 'maxim_thermocouple_read': drivers/iio/temperature/maxim_thermocouple.c:141:5: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] This probably cannot happen, but returning -EINVAL here is appropriate and makes gcc happy and the code more robust. Fixes: 231147ee77f3 ("iio: maxim_thermocouple: Align 16 bit big endian value of raw reads") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org> (cherry picked from commit 32cb7d27e65df9daa7cee8f1fdf7b259f214bee2) Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: maxim_thermocouple: Align 16 bit big endian value of raw readssayli karnik2016-10-011-7/+9
| | | | | | | | | | | | | | | | | | | | | Driver was reporting invalid raw read values for MAX6675 on big endian architectures. MAX6675 buffered mode is not affected, nor is the MAX31855. The driver was losing a 2 byte read value when it used a 32 bit integer buffer to store a 16 bit big endian value. Use big endian types to properly align buffers on big endian architectures. Fixes following sparse endianness warnings: warning: cast to restricted __be16 warning: cast to restricted __be32 Fixes checkpatch issue: CHECK: No space is necessary after a cast Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Fixes: 1f25ca11d84a ("iio: temperature: add support for Maxim thermocouple chips") Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: temperature: fix non static symbol warningsWei Yongjun2016-08-291-3/+3
| | | | | | | | | | | | | | | Fixes the following sparse warnings: drivers/iio/temperature/maxim_thermocouple.c:35:28: warning: symbol 'max6675_channels' was not declared. Should it be static? drivers/iio/temperature/maxim_thermocouple.c:52:28: warning: symbol 'max31855_channels' was not declared. Should it be static? drivers/iio/temperature/maxim_thermocouple.c:98:38: warning: symbol 'maxim_thermocouple_chips' was not declared. Should it be static? Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-By: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: temperature: add support for Maxim thermocouple chipsMatt Ranostay2016-07-101-0/+281
Add initial driver support for MAX6675, and MAX31855 thermocouple chips. Cc: Marek Vasut <marex@denx.de> Cc: Matt Porter <mporter@konsulko.com> Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
OpenPOWER on IntegriCloud