balena-allwinner/layers/meta-balena-allwinner/recipes-kernel/linux/linux-mainline/armbian/0000-0041-iio-ltr501-Add-OF-compatibles.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

68 lines
2 KiB
Diff

From e4548a8a5ad34919a94b282369212b661e1d4382 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Fri, 10 Nov 2017 13:23:01 +0100
Subject: [PATCH 41/82] iio: ltr501: Add OF compatibles
So that driver can be configured from DTS.
Signed-off-by: Ondrej Jirman <megous@megous.com>
---
drivers/iio/light/ltr501.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c
index 830a2d45aa4d..bdb296dcb7c0 100644
--- a/drivers/iio/light/ltr501.c
+++ b/drivers/iio/light/ltr501.c
@@ -18,6 +18,7 @@
#include <linux/delay.h>
#include <linux/regmap.h>
#include <linux/acpi.h>
+#include <linux/of.h>
#include <linux/iio/iio.h>
#include <linux/iio/events.h>
@@ -1558,6 +1559,7 @@ static int ltr501_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(ltr501_pm_ops, ltr501_suspend, ltr501_resume);
+#ifdef CONFIG_ACPI
static const struct acpi_device_id ltr_acpi_match[] = {
{"LTER0501", ltr501},
{"LTER0559", ltr559},
@@ -1565,6 +1567,7 @@ static const struct acpi_device_id ltr_acpi_match[] = {
{ },
};
MODULE_DEVICE_TABLE(acpi, ltr_acpi_match);
+#endif
static const struct i2c_device_id ltr501_id[] = {
{ "ltr501", ltr501},
@@ -1574,11 +1577,22 @@ static const struct i2c_device_id ltr501_id[] = {
};
MODULE_DEVICE_TABLE(i2c, ltr501_id);
+#ifdef CONFIG_OF
+static const struct of_device_id ltr501_of_match[] = {
+ { .compatible = "ltr,ltr501", .data = (void*)ltr501 },
+ { .compatible = "ltr,ltr559", .data = (void*)ltr559 },
+ { .compatible = "ltr,ltr301", .data = (void*)ltr301 },
+ { }
+};
+MODULE_DEVICE_TABLE(of, ltr501_of_match);
+#endif
+
static struct i2c_driver ltr501_driver = {
.driver = {
- .name = LTR501_DRV_NAME,
- .pm = &ltr501_pm_ops,
+ .name = LTR501_DRV_NAME,
+ .pm = &ltr501_pm_ops,
.acpi_match_table = ACPI_PTR(ltr_acpi_match),
+ .of_match_table = of_match_ptr(ltr501_of_match)
},
.probe = ltr501_probe,
.remove = ltr501_remove,
--
2.20.1