balena-allwinner/layers/meta-balena-allwinner/recipes-kernel/linux/linux-mainline/armbian/0036-sun4i-gpadc-iio-ignore-zero-samples-to-avoid-force-p.patch
Vicentiu Galanopulo 7d5f1dbda1 recipes-kernel/linux: Remove unused patches and householding
Some patches were part of other linux-mainline
kernel versions but are not anymore part of the
current 4.19.76.

Move 0001-Enable-uart3-for-NanoPi-Neo-Air-used-by-BT.patch
in linux-mainline_4.19.76.bbappend to avoid error
patching file arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dts
Hunk #2 FAILED at 162.
1 out of 2 hunks FAILED -- rejects in file arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dts

Place all patches from Armbian in a separate directory and do all the Balena specific
operations in linux-mainline_%.bbappend only.

Changelog-entry: Remove unused patches and cleanup
Signed-off-by: Vicentiu Galanopulo <vicentiu@balena.io>
2019-10-14 09:43:01 +02:00

31 lines
1 KiB
Diff

From a6b5eb09bddbd0c331f41fefa2fd2f71a2cf9455 Mon Sep 17 00:00:00 2001
From: Vasily Khoruzhick <anarsoul@gmail.com>
Date: Tue, 24 Apr 2018 22:21:10 -0700
Subject: [PATCH 036/146] sun4i-gpadc-iio: ignore zero samples to avoid force
poweroff when reading first sample
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
drivers/iio/adc/sun4i-gpadc-iio.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c
index fdfa01bad325..68256e73a4d2 100644
--- a/drivers/iio/adc/sun4i-gpadc-iio.c
+++ b/drivers/iio/adc/sun4i-gpadc-iio.c
@@ -751,6 +751,12 @@ static int sun4i_gpadc_get_temp(void *data, int *temp)
if (sun4i_gpadc_temp_read(info->indio_dev, &val, info->sensor_id))
return -ETIMEDOUT;
+ /* Ignore first sample which is always zero. 0 is either too
+ * cold or too hot, so we can safely ignore it
+ */
+ if (val == 0)
+ return -ETIMEDOUT;
+
sun4i_gpadc_temp_scale(info->indio_dev, &scale);
sun4i_gpadc_temp_offset(info->indio_dev, &offset);
--
2.17.1