Re: [PATCHv3] support for AD5820 camera auto-focus coil

2016-05-25 Thread Ivaylo Dimitrov
On 24.05.2016 23:20, Pavel Machek wrote: Hi! devm_regulator_get()? I'd rather avoid devm_ here. Driver is simple enough to allow it. Now thinking about it, what would happen here if regulator_get() returns -EPROBE_DEFER? Wouldn't it be better to move regulator_get to the probe()

Re: [PATCHv3] support for AD5820 camera auto-focus coil

2016-05-24 Thread Pavel Machek
Hi! > >>devm_regulator_get()? > > > >I'd rather avoid devm_ here. Driver is simple enough to allow it. > > > > Now thinking about it, what would happen here if regulator_get() returns > -EPROBE_DEFER? Wouldn't it be better to move regulator_get to the probe() > function, something like: Ok, I

Re: [PATCHv3] support for AD5820 camera auto-focus coil

2016-05-24 Thread Ivaylo Dimitrov
On 24.05.2016 12:04, Pavel Machek wrote: Hi! +static int ad5820_registered(struct v4l2_subdev *subdev) +{ + struct ad5820_device *coil = to_ad5820_device(subdev); + struct i2c_client *client = v4l2_get_subdevdata(subdev); + + coil->vana = regulator_get(>dev, "VANA");

Re: [PATCHv3] support for AD5820 camera auto-focus coil

2016-05-24 Thread Pavel Machek
Hi! > >+static int ad5820_registered(struct v4l2_subdev *subdev) > >+{ > >+struct ad5820_device *coil = to_ad5820_device(subdev); > >+struct i2c_client *client = v4l2_get_subdevdata(subdev); > >+ > >+coil->vana = regulator_get(>dev, "VANA"); > > devm_regulator_get()? I'd rather

Re: [PATCHv3] support for AD5820 camera auto-focus coil

2016-05-23 Thread Pali Rohár
On Saturday 21 May 2016 14:43:43 Ivaylo Dimitrov wrote: > >diff --git a/include/media/ad5820.h b/include/media/ad5820.h > >new file mode 100644 > >index 000..f5a1565 > >--- /dev/null > >+++ b/include/media/ad5820.h > >@@ -0,0 +1,70 @@ > >+/* > >+ * include/media/ad5820.h > >+ * > >+ *

Re: [PATCHv3] support for AD5820 camera auto-focus coil

2016-05-21 Thread Ivaylo Dimitrov
Hi, On 21.05.2016 13:56, Pavel Machek wrote: This adds support for AD5820 autofocus coil, found for example in Nokia N900 smartphone. Signed-off-by: Pavel Machek --- v2: simple cleanups, fix error paths, simplify probe v3: more cleanups, remove printk, add include diff --git

[PATCHv3] support for AD5820 camera auto-focus coil

2016-05-21 Thread Pavel Machek
This adds support for AD5820 autofocus coil, found for example in Nokia N900 smartphone. Signed-off-by: Pavel Machek --- v2: simple cleanups, fix error paths, simplify probe v3: more cleanups, remove printk, add include diff --git a/drivers/media/i2c/Kconfig