aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/patches-4.19/0063-4-ip806x-tsense-rework-driver.patch
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-10-19 15:37:54 +0200
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-10-19 15:37:54 +0200
commit29ca10e537ee807283cfd8a58817270d233a021d (patch)
tree4317d722ad781d55732add61a3e7ea7dc79af5a0 /target/linux/ipq806x/patches-4.19/0063-4-ip806x-tsense-rework-driver.patch
parenta7afeb31421bd6810c903468b23734baa6999438 (diff)
downloadupstream-29ca10e537ee807283cfd8a58817270d233a021d.tar.gz
upstream-29ca10e537ee807283cfd8a58817270d233a021d.tar.bz2
upstream-29ca10e537ee807283cfd8a58817270d233a021d.zip
ipq806x: remove support for kernel 4.19
The target uses 5.4 as default kernel since 04/2020. Kernel 4.19 support is not really maintained anymore, and there has been a lot of changes between 4.19 and 5.4 on this target. Despite, new devices are typically added for 5.4 only anyway. Thus, make maintaining of old stuff and reviewing of new stuff easier by removing support for kernel 4.19. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/ipq806x/patches-4.19/0063-4-ip806x-tsense-rework-driver.patch')
-rw-r--r--target/linux/ipq806x/patches-4.19/0063-4-ip806x-tsense-rework-driver.patch107
1 files changed, 0 insertions, 107 deletions
diff --git a/target/linux/ipq806x/patches-4.19/0063-4-ip806x-tsense-rework-driver.patch b/target/linux/ipq806x/patches-4.19/0063-4-ip806x-tsense-rework-driver.patch
deleted file mode 100644
index 951145b3de..0000000000
--- a/target/linux/ipq806x/patches-4.19/0063-4-ip806x-tsense-rework-driver.patch
+++ /dev/null
@@ -1,107 +0,0 @@
---- a/drivers/thermal/qcom/tsens-ipq8064.c
-+++ b/drivers/thermal/qcom/tsens-ipq8064.c
-@@ -13,10 +13,12 @@
- */
-
- #include <linux/platform_device.h>
-+#include <linux/err.h>
- #include <linux/delay.h>
- #include <linux/bitops.h>
- #include <linux/regmap.h>
- #include <linux/thermal.h>
-+#include <linux/slab.h>
- #include <linux/nvmem-consumer.h>
- #include <linux/io.h>
- #include <linux/interrupt.h>
-@@ -210,9 +212,8 @@ static void tsens_scheduler_fn(struct wo
- struct tsens_device *tmdev = container_of(work, struct tsens_device,
- tsens_work);
- unsigned int threshold, threshold_low, code, reg, sensor, mask;
-- unsigned int sensor_addr;
- bool upper_th_x, lower_th_x;
-- int adc_code, ret;
-+ int ret;
-
- ret = regmap_read(tmdev->map, STATUS_CNTL_8064, &reg);
- if (ret)
-@@ -261,9 +262,8 @@ static void tsens_scheduler_fn(struct wo
- if (upper_th_x || lower_th_x) {
- /* Notify user space */
- schedule_work(&tmdev->sensor[0].notify_work);
-- regmap_read(tmdev->map, sensor_addr, &adc_code);
- pr_debug("Trigger (%d degrees) for sensor %d\n",
-- code_to_degC(adc_code, &tmdev->sensor[0]), 0);
-+ code_to_degC(code, &tmdev->sensor[0]), 0);
- }
- }
- regmap_write(tmdev->map, STATUS_CNTL_8064, reg & mask);
-@@ -372,40 +372,55 @@ static int init_ipq8064(struct tsens_dev
- static int calibrate_ipq8064(struct tsens_device *tmdev)
- {
- int i;
-- char *data, *data_backup;
--
-+ int ret = 0;
-+ u8 *data, *data_backup;
-+ struct device *dev = tmdev->dev;
- ssize_t num_read = tmdev->num_sensors;
- struct tsens_sensor *s = tmdev->sensor;
-
-- data = qfprom_read(tmdev->dev, "calib");
-+ data = qfprom_read(dev, "calib");
- if (IS_ERR(data)) {
-- pr_err("Calibration not found.\n");
-- return PTR_ERR(data);
-+ ret = PTR_ERR(data);
-+ if (ret != -EPROBE_DEFER)
-+ dev_err(dev, "Calibration not found.");
-+ goto exit;
- }
-
-- data_backup = qfprom_read(tmdev->dev, "calib_backup");
-+ data_backup = qfprom_read(dev, "calib_backup");
- if (IS_ERR(data_backup)) {
-- pr_err("Backup calibration not found.\n");
-- return PTR_ERR(data_backup);
-+ ret = PTR_ERR(data_backup);
-+ if (ret != -EPROBE_DEFER)
-+ dev_err(dev, "Backup Calibration not found.");
-+ goto free_data;
- }
-
- for (i = 0; i < num_read; i++) {
- s[i].calib_data = readb_relaxed(data + i);
-- s[i].calib_data_backup = readb_relaxed(data_backup + i);
-+
-+ if (!s[i].calib_data) {
-+ s[i].calib_data_backup = readb_relaxed(data_backup + i);
-+
-+ if (!s[i].calib_data_backup) {
-+ dev_err(dev, "QFPROM TSENS calibration data not present");
-+ ret = -ENODEV;
-+ goto free_backup;
-+ }
-
-- if (s[i].calib_data_backup)
- s[i].calib_data = s[i].calib_data_backup;
-- if (!s[i].calib_data) {
-- pr_err("QFPROM TSENS calibration data not present\n");
-- return -ENODEV;
- }
-+
- s[i].slope = tsens_8064_slope[i];
- s[i].offset = CAL_MDEGC - (s[i].calib_data * s[i].slope);
- }
-
- hw_init(tmdev);
-
-- return 0;
-+free_backup:
-+ kfree(data_backup);
-+free_data:
-+ kfree(data);
-+exit:
-+ return ret;
- }
-
- static int get_temp_ipq8064(struct tsens_device *tmdev, int id, int *temp)