aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/potentiometer/mcp4018.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-08-20iio: potentiometer: mcp4018: use the correct MODULE_LICENSEPeter Rosin1-1/+1
The file is GPL v2 only. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-08-19iio: potentiometer: merge calls to of_match_device and of_device_get_match_dataJulia Lawall1-5/+2
Drop call to of_match_device, which is subsumed by the subsequent call to of_device_get_match_data. The code becomes simpler, and a temporary variable can be dropped. The semantic match that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ local idexpression match; identifier i; expression x, dev, e, e1; @@ - match@i = of_match_device(x, dev); - if (match) e = of_device_get_match_data(dev); - else e = e1; + e = of_device_get_match_data(dev); + if (!e) e = e1; @@ identifier r.i; @@ - const struct of_device_id *i; ... when != i // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Reviewed-by: Peter Rosin <peda@axentia.se> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-04-15iio: potentiometer: mcp4018: switch to using .probe_newPeter Rosin1-21/+20
Use the new probe style for i2c drivers. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-10iio: potentiometer: mcp4018: driver for Microchip digital potentiometersPeter Rosin1-0/+194
Add support for Microchip digital potentiometers and rheostats MCP4017, MCP4018, MCP4019 They all have one wiper with 128 steps and come in 5, 10, 50 and 100 kOhm variations. Datasheet: http://www.microchip.com/downloads/en/DeviceDoc/22147a.pdf Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>