1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-15 04:42:02 +00:00
openmptcprouter/6.1/target/linux/bcm27xx/patches-6.1/0544-media-dt-bindings-Add-regulator-to-dw9807-vcm.patch

47 lines
1.7 KiB
Diff

From 84d6bc8ae52fad4d2bb2351f1e0b13b40abd3559 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Tue, 3 Jan 2023 16:41:08 +0000
Subject: [PATCH 544/726] media: dt-bindings: Add regulator to dw9807-vcm
The VCM driver will often be controlled via a regulator,
therefore add in the relevant DT hooks.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
.../devicetree/bindings/media/i2c/dongwoon,dw9807-vcm.yaml | 4 ++++
drivers/media/i2c/dw9807-vcm.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807-vcm.yaml b/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807-vcm.yaml
index 1be649611ba2..6de07543e973 100644
--- a/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807-vcm.yaml
+++ b/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807-vcm.yaml
@@ -27,6 +27,10 @@ properties:
reg:
maxItems: 1
+ VDD-supply:
+ description:
+ Definition of the regulator used as VDD power supply to the driver.
+
required:
- compatible
- reg
diff --git a/drivers/media/i2c/dw9807-vcm.c b/drivers/media/i2c/dw9807-vcm.c
index 3fb5d6a7f771..258c53295005 100644
--- a/drivers/media/i2c/dw9807-vcm.c
+++ b/drivers/media/i2c/dw9807-vcm.c
@@ -301,6 +301,10 @@ static void dw9807_remove(struct i2c_client *client)
struct v4l2_subdev *sd = i2c_get_clientdata(client);
struct dw9807_device *dw9807_dev = sd_to_dw9807_vcm(sd);
+ if (dw9807_dev->vdd)
+ regulator_unregister_notifier(dw9807_dev->vdd,
+ &dw9807_dev->notifier);
+
pm_runtime_disable(&client->dev);
dw9807_subdev_cleanup(dw9807_dev);
--
2.33.1