aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc/qcom-spmi-vadc.c
AgeCommit message (Collapse)Author
2015-11-21iio: adc: spmi-vadc: add missing of_node_putJulia Lawall
for_each_available_child_of_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // <smpl> @@ expression root,e; local idexpression child; @@ for_each_available_child_of_node(root, child) { ... when != of_node_put(child) when != e = child ( return child; | + of_node_put(child); ? return ...; ) ... } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-04-18iio: adc: spmi-vadc: Fix overflow in output value normalizationIvan T. Ivanov
With 'dx' equal to 0.625V and 15 bit ADC, calculations overflow when difference against GND is ~20% of the ADC range. Fix this. Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org> Cc: <stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-01-28iio: vadc: Qualcomm SPMI PMIC voltage ADC driverStanimir Varbanov
The voltage ADC is peripheral of Qualcomm SPMI PMIC chips. It has 15bits resolution and register space inside PMIC accessible across SPMI bus. The vadc driver registers itself through IIO interface. Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com> Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>