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
6 The VCM driver will often be controlled via a regulator,
7 therefore add in the relevant DT hooks.
9 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
11 .../devicetree/bindings/media/i2c/dongwoon,dw9807-vcm.yaml | 4 ++++
12 drivers/media/i2c/dw9807-vcm.c | 4 ++++
13 2 files changed, 8 insertions(+)
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:
23 + Definition of the regulator used as VDD power supply to the driver.
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);
34 + if (dw9807_dev->vdd)
35 + regulator_unregister_notifier(dw9807_dev->vdd,
36 + &dw9807_dev->notifier);
38 pm_runtime_disable(&client->dev);
40 dw9807_subdev_cleanup(dw9807_dev);