bcm27xx: 6.1: add kernel patches
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-6.1 / 950-0525-media-dt-bindings-Add-regulator-to-dw9807-vcm.patch
1 From d2b7bb49d170cecb5c4f3e8df19b7b2a2891e4ce Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 3 Jan 2023 16:41:08 +0000
4 Subject: [PATCH] media: dt-bindings: Add regulator to dw9807-vcm
5
6 The VCM driver will often be controlled via a regulator,
7 therefore add in the relevant DT hooks.
8
9 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
10 ---
11 .../devicetree/bindings/media/i2c/dongwoon,dw9807-vcm.yaml | 4 ++++
12 drivers/media/i2c/dw9807-vcm.c | 4 ++++
13 2 files changed, 8 insertions(+)
14
15 --- a/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807-vcm.yaml
16 +++ b/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807-vcm.yaml
17 @@ -27,6 +27,10 @@ properties:
18 reg:
19 maxItems: 1
20
21 + VDD-supply:
22 + description:
23 + Definition of the regulator used as VDD power supply to the driver.
24 +
25 required:
26 - compatible
27 - reg
28 --- a/drivers/media/i2c/dw9807-vcm.c
29 +++ b/drivers/media/i2c/dw9807-vcm.c
30 @@ -301,6 +301,10 @@ static void dw9807_remove(struct i2c_cli
31 struct v4l2_subdev *sd = i2c_get_clientdata(client);
32 struct dw9807_device *dw9807_dev = sd_to_dw9807_vcm(sd);
33
34 + if (dw9807_dev->vdd)
35 + regulator_unregister_notifier(dw9807_dev->vdd,
36 + &dw9807_dev->notifier);
37 +
38 pm_runtime_disable(&client->dev);
39
40 dw9807_subdev_cleanup(dw9807_dev);