Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Brugger <mbrugger@suse.com>2018-10-10 17:59:05 +0200
committerMatthias Brugger <mbrugger@suse.com>2018-10-11 12:44:30 +0200
commiteb5e1c2d88b83e7fc0bc32e99e3b15094fc5fed9 (patch)
tree25f58f56c473a51a33957cfb27d557f627b9031c
parent267a64cfd3f522efa05eafdf547db03f12704f1b (diff)
firmware: raspberrypi: Register hwmon driver (bsc#1108468).
-rw-r--r--patches.drivers/firmware-raspberrypi-Register-hwmon-driver.patch71
-rw-r--r--series.conf1
2 files changed, 72 insertions, 0 deletions
diff --git a/patches.drivers/firmware-raspberrypi-Register-hwmon-driver.patch b/patches.drivers/firmware-raspberrypi-Register-hwmon-driver.patch
new file mode 100644
index 0000000000..e9ebb2a6a0
--- /dev/null
+++ b/patches.drivers/firmware-raspberrypi-Register-hwmon-driver.patch
@@ -0,0 +1,71 @@
+From: Stefan Wahren <stefan.wahren@i2se.com>
+Date: Fri, 25 May 2018 21:24:36 +0200
+Subject: firmware: raspberrypi: Register hwmon driver
+Git-commit: 70eea1bbb5561154e62b322904b685acb0e52d3e
+Patch-mainline: v4.19-rc1
+References: bsc#1108468
+
+Since the raspberrypi-hwmon driver is tied to the VC4 firmware instead of
+particular hardware its registration should be in the firmware driver.
+
+Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
+Signed-off-by: Eric Anholt <eric@anholt.net>
+Signed-off-by: Matthias Brugger <mbrugger@suse.com>
+---
+ drivers/firmware/raspberrypi.c | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c
+index 6692888f04cf..0602626bf72d 100644
+--- a/drivers/firmware/raspberrypi.c
++++ b/drivers/firmware/raspberrypi.c
+@@ -21,6 +21,8 @@
+ #define MBOX_DATA28(msg) ((msg) & ~0xf)
+ #define MBOX_CHAN_PROPERTY 8
+
++static struct platform_device *rpi_hwmon;
++
+ struct rpi_firmware {
+ struct mbox_client cl;
+ struct mbox_chan *chan; /* The property channel. */
+@@ -183,6 +185,20 @@ rpi_firmware_print_firmware_revision(struct rpi_firmware *fw)
+ }
+ }
+
++static void
++rpi_register_hwmon_driver(struct device *dev, struct rpi_firmware *fw)
++{
++ u32 packet;
++ int ret = rpi_firmware_property(fw, RPI_FIRMWARE_GET_THROTTLED,
++ &packet, sizeof(packet));
++
++ if (ret)
++ return;
++
++ rpi_hwmon = platform_device_register_data(dev, "raspberrypi-hwmon",
++ -1, NULL, 0);
++}
++
+ static int rpi_firmware_probe(struct platform_device *pdev)
+ {
+ struct device *dev = &pdev->dev;
+@@ -209,6 +225,7 @@ static int rpi_firmware_probe(struct platform_device *pdev)
+ platform_set_drvdata(pdev, fw);
+
+ rpi_firmware_print_firmware_revision(fw);
++ rpi_register_hwmon_driver(dev, fw);
+
+ return 0;
+ }
+@@ -217,6 +234,8 @@ static int rpi_firmware_remove(struct platform_device *pdev)
+ {
+ struct rpi_firmware *fw = platform_get_drvdata(pdev);
+
++ platform_device_unregister(rpi_hwmon);
++ rpi_hwmon = NULL;
+ mbox_free_channel(fw->chan);
+
+ return 0;
+--
+2.19.0
+
diff --git a/series.conf b/series.conf
index 9223966c49..8db2b1eeca 100644
--- a/series.conf
+++ b/series.conf
@@ -17559,6 +17559,7 @@
patches.arch/ARM-exynos-Clear-global-variable-on-init-error-path.patch
patches.drivers/ARM-bcm2835-Add-GET_THROTTLED-firmware-property.patch
patches.drivers/hwmon-Add-support-for-RPi-voltage-sensor.patch
+ patches.drivers/firmware-raspberrypi-Register-hwmon-driver.patch
patches.drivers/soc-mediatek-pwrap-fix-cipher-init-setting-error.patch
patches.drivers/IB-hfi1-Invalid-NUMA-node-information-can-cause-a-di.patch
patches.drivers/fbdev-Distinguish-between-interlaced-and-progressive.patch