All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH v9 0/2] DW9807 DT binding and driver patches
@ 2018-05-02 15:53 Andy Yeh
  2018-05-02 15:53 ` [RESEND PATCH v9 1/2] media: dt-bindings: Add bindings for Dongwoon DW9807 voice coil Andy Yeh
  2018-05-02 15:53 ` [RESEND PATCH v9 2/2] media: dw9807: Add dw9807 vcm driver Andy Yeh
  0 siblings, 2 replies; 9+ messages in thread
From: Andy Yeh @ 2018-05-02 15:53 UTC (permalink / raw)
  To: linux-media; +Cc: sakari.ailus, andy.yeh, devicetree, tfiga, jacopo

Hi Sakari and Tomasz,

The two patches are the DT binding and driver for DW9807 VCM controller.

Alan Chiang (2):
  media: dw9807: Add dw9807 vcm driver
  media: dt-bindings: Add bindings for Dongwoon DW9807 voice coil

 .../bindings/media/i2c/dongwoon,dw9807.txt         |   9 +
 MAINTAINERS                                        |   7 +
 drivers/media/i2c/Kconfig                          |  10 +
 drivers/media/i2c/Makefile                         |   1 +
 drivers/media/i2c/dw9807.c                         | 320 +++++++++++++++++++++
 5 files changed, 347 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt
 create mode 100644 drivers/media/i2c/dw9807.c

-- 
2.7.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [RESEND PATCH v9 1/2] media: dt-bindings: Add bindings for Dongwoon DW9807 voice coil
  2018-05-02 15:53 [RESEND PATCH v9 0/2] DW9807 DT binding and driver patches Andy Yeh
@ 2018-05-02 15:53 ` Andy Yeh
  2018-05-02 21:36   ` Sakari Ailus
  2018-05-02 15:53 ` [RESEND PATCH v9 2/2] media: dw9807: Add dw9807 vcm driver Andy Yeh
  1 sibling, 1 reply; 9+ messages in thread
From: Andy Yeh @ 2018-05-02 15:53 UTC (permalink / raw)
  To: linux-media
  Cc: sakari.ailus, andy.yeh, devicetree, tfiga, jacopo, Alan Chiang

From: Alan Chiang <alanx.chiang@intel.com>

Dongwoon DW9807 is a voice coil lens driver.

Signed-off-by: Andy Yeh <andy.yeh@intel.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Acked-by: Rob Herring <robh@kernel.org>

---
 Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt

diff --git a/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt b/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt
new file mode 100644
index 0000000..0a1a860
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt
@@ -0,0 +1,9 @@
+Dongwoon Anatech DW9807 voice coil lens driver
+
+DW9807 is a 10-bit DAC with current sink capability. It is intended for
+controlling voice coil lenses.
+
+Mandatory properties:
+
+- compatible: "dongwoon,dw9807"
+- reg: I2C slave address
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [RESEND PATCH v9 2/2] media: dw9807: Add dw9807 vcm driver
  2018-05-02 15:53 [RESEND PATCH v9 0/2] DW9807 DT binding and driver patches Andy Yeh
  2018-05-02 15:53 ` [RESEND PATCH v9 1/2] media: dt-bindings: Add bindings for Dongwoon DW9807 voice coil Andy Yeh
@ 2018-05-02 15:53 ` Andy Yeh
  2018-05-09 19:03   ` Mauro Carvalho Chehab
  1 sibling, 1 reply; 9+ messages in thread
From: Andy Yeh @ 2018-05-02 15:53 UTC (permalink / raw)
  To: linux-media
  Cc: sakari.ailus, andy.yeh, devicetree, tfiga, jacopo, Alan Chiang

From: Alan Chiang <alanx.chiang@intel.com>

DW9807 is a 10 bit DAC from Dongwoon, designed for linear
control of voice coil motor.

This driver creates a V4L2 subdevice and
provides control to set the desired focus.

Signed-off-by: Andy Yeh <andy.yeh@intel.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Acked-by: Rob Herring <robh@kernel.org>

---
since v1:
- changed author.
since v2:
- addressed outstanding comments.
- enabled sequential write to update 2 registers in a single transaction.
since v3:
- addressed comments for v3.
- Remove redundant codes and declare some variables as constant variable.
- separate DT binding to another patch
since v4:
- sent patchset included DT binding with cover page
since v6:
- change the return code of i2c_check
- fix long cols exceed 80 chars
- remove #define DW9807_NAME since only used once
since v7:
- Remove some redundant type cast
- Modify to meet the coding style
- Replace a while loop by readx_poll_timeout function
- Return the i2c error directly.
since v8:
- Added Reviewed-by and Acked-by

 MAINTAINERS                |   7 +
 drivers/media/i2c/Kconfig  |  10 ++
 drivers/media/i2c/Makefile |   1 +
 drivers/media/i2c/dw9807.c | 329 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 347 insertions(+)
 create mode 100644 drivers/media/i2c/dw9807.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 845fc25..a339bb5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4385,6 +4385,13 @@ T:	git git://linuxtv.org/media_tree.git
 S:	Maintained
 F:	drivers/media/i2c/dw9714.c
 
+DONGWOON DW9807 LENS VOICE COIL DRIVER
+M:	Sakari Ailus <sakari.ailus@linux.intel.com>
+L:	linux-media@vger.kernel.org
+T:	git git://linuxtv.org/media_tree.git
+S:	Maintained
+F:	drivers/media/i2c/dw9807.c
+
 DOUBLETALK DRIVER
 M:	"James R. Van Zandt" <jrv@vanzandt.mv.com>
 L:	blinux-list@redhat.com
diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index cb5d7ff..fd01842 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -325,6 +325,16 @@ config VIDEO_DW9714
 	  capability. This is designed for linear control of
 	  voice coil motors, controlled via I2C serial interface.
 
+config VIDEO_DW9807
+	tristate "DW9807 lens voice coil support"
+	depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
+	depends on VIDEO_V4L2_SUBDEV_API
+	---help---
+	  This is a driver for the DW9807 camera lens voice coil.
+	  DW9807 is a 10 bit DAC with 100mA output current sink
+	  capability. This is designed for linear control of
+	  voice coil motors, controlled via I2C serial interface.
+
 config VIDEO_SAA7110
 	tristate "Philips SAA7110 video decoder"
 	depends on VIDEO_V4L2 && I2C
diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile
index 548a9ef..1b62639 100644
--- a/drivers/media/i2c/Makefile
+++ b/drivers/media/i2c/Makefile
@@ -23,6 +23,7 @@ obj-$(CONFIG_VIDEO_SAA7185) += saa7185.o
 obj-$(CONFIG_VIDEO_SAA6752HS) += saa6752hs.o
 obj-$(CONFIG_VIDEO_AD5820)  += ad5820.o
 obj-$(CONFIG_VIDEO_DW9714)  += dw9714.o
+obj-$(CONFIG_VIDEO_DW9807)  += dw9807.o
 obj-$(CONFIG_VIDEO_ADV7170) += adv7170.o
 obj-$(CONFIG_VIDEO_ADV7175) += adv7175.o
 obj-$(CONFIG_VIDEO_ADV7180) += adv7180.o
diff --git a/drivers/media/i2c/dw9807.c b/drivers/media/i2c/dw9807.c
new file mode 100644
index 0000000..28ede2b
--- /dev/null
+++ b/drivers/media/i2c/dw9807.c
@@ -0,0 +1,329 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright (C) 2018 Intel Corporation
+
+#include <linux/acpi.h>
+#include <linux/delay.h>
+#include <linux/i2c.h>
+#include <linux/iopoll.h>
+#include <linux/module.h>
+#include <linux/pm_runtime.h>
+#include <media/v4l2-ctrls.h>
+#include <media/v4l2-device.h>
+
+#define DW9807_MAX_FOCUS_POS	1023
+/*
+ * This sets the minimum granularity for the focus positions.
+ * A value of 1 gives maximum accuracy for a desired focus position.
+ */
+#define DW9807_FOCUS_STEPS	1
+/*
+ * This acts as the minimum granularity of lens movement.
+ * Keep this value power of 2, so the control steps can be
+ * uniformly adjusted for gradual lens movement, with desired
+ * number of control steps.
+ */
+#define DW9807_CTRL_STEPS	16
+#define DW9807_CTRL_DELAY_US	1000
+
+#define DW9807_CTL_ADDR		0x02
+/*
+ * DW9807 separates two registers to control the VCM position.
+ * One for MSB value, another is LSB value.
+ */
+#define DW9807_MSB_ADDR		0x03
+#define DW9807_LSB_ADDR		0x04
+#define DW9807_STATUS_ADDR	0x05
+#define DW9807_MODE_ADDR	0x06
+#define DW9807_RESONANCE_ADDR	0x07
+
+#define MAX_RETRY		10
+
+struct dw9807_device {
+	struct v4l2_ctrl_handler ctrls_vcm;
+	struct v4l2_subdev sd;
+	u16 current_val;
+};
+
+static inline struct dw9807_device *sd_to_dw9807_vcm(
+					struct v4l2_subdev *subdev)
+{
+	return container_of(subdev, struct dw9807_device, sd);
+}
+
+static int dw9807_i2c_check(struct i2c_client *client)
+{
+	const char status_addr = DW9807_STATUS_ADDR;
+	char status_result;
+	int ret;
+
+	ret = i2c_master_send(client, &status_addr, sizeof(status_addr));
+	if (ret < 0) {
+		dev_err(&client->dev, "I2C write STATUS address fail ret = %d\n",
+			ret);
+		return ret;
+	}
+
+	ret = i2c_master_recv(client, &status_result, sizeof(status_result));
+	if (ret < 0) {
+		dev_err(&client->dev, "I2C read STATUS value fail ret = %d\n",
+			ret);
+		return ret;
+	}
+
+	return status_result;
+}
+
+static int dw9807_set_dac(struct i2c_client *client, u16 data)
+{
+	const char tx_data[3] = {
+		DW9807_MSB_ADDR, ((data >> 8) & 0x03), (data & 0xff)
+	};
+	int val, ret, retry = 0;
+
+	/*
+	 * According to the datasheet, need to check the bus status before we
+	 * write VCM position. This ensure that we really write the value
+	 * into the register
+	 */
+	ret = readx_poll_timeout(dw9807_i2c_check, client, val, val <= 0,
+			DW9807_CTRL_DELAY_US, MAX_RETRY * DW9807_CTRL_DELAY_US);
+
+	if (ret || val < 0) {
+		if (ret) {
+			dev_warn(&client->dev,
+				"Cannot do the write operation because VCM is busy\n");
+		}
+
+		return ret ? -EBUSY : val;
+	}
+
+	/* Write VCM position to registers */
+	ret = i2c_master_send(client, tx_data, sizeof(tx_data));
+	if (ret < 0) {
+		dev_err(&client->dev,
+			"I2C write MSB fail ret=%d\n", ret);
+
+		return ret;
+	}
+
+	return 0;
+}
+
+static int dw9807_set_ctrl(struct v4l2_ctrl *ctrl)
+{
+	struct dw9807_device *dev_vcm = container_of(ctrl->handler,
+		struct dw9807_device, ctrls_vcm);
+
+	if (ctrl->id == V4L2_CID_FOCUS_ABSOLUTE) {
+		struct i2c_client *client = v4l2_get_subdevdata(&dev_vcm->sd);
+
+		dev_vcm->current_val = ctrl->val;
+		return dw9807_set_dac(client, ctrl->val);
+	}
+
+	return -EINVAL;
+}
+
+static const struct v4l2_ctrl_ops dw9807_vcm_ctrl_ops = {
+	.s_ctrl = dw9807_set_ctrl,
+};
+
+static int dw9807_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
+{
+	int rval;
+
+	rval = pm_runtime_get_sync(sd->dev);
+	if (rval < 0) {
+		pm_runtime_put_noidle(sd->dev);
+		return rval;
+	}
+
+	return 0;
+}
+
+static int dw9807_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
+{
+	pm_runtime_put(sd->dev);
+
+	return 0;
+}
+
+static const struct v4l2_subdev_internal_ops dw9807_int_ops = {
+	.open = dw9807_open,
+	.close = dw9807_close,
+};
+
+static const struct v4l2_subdev_ops dw9807_ops = { };
+
+static void dw9807_subdev_cleanup(struct dw9807_device *dw9807_dev)
+{
+	v4l2_async_unregister_subdev(&dw9807_dev->sd);
+	v4l2_ctrl_handler_free(&dw9807_dev->ctrls_vcm);
+	media_entity_cleanup(&dw9807_dev->sd.entity);
+}
+
+static int dw9807_init_controls(struct dw9807_device *dev_vcm)
+{
+	struct v4l2_ctrl_handler *hdl = &dev_vcm->ctrls_vcm;
+	const struct v4l2_ctrl_ops *ops = &dw9807_vcm_ctrl_ops;
+	struct i2c_client *client = v4l2_get_subdevdata(&dev_vcm->sd);
+
+	v4l2_ctrl_handler_init(hdl, 1);
+
+	v4l2_ctrl_new_std(hdl, ops, V4L2_CID_FOCUS_ABSOLUTE,
+			  0, DW9807_MAX_FOCUS_POS, DW9807_FOCUS_STEPS, 0);
+
+	dev_vcm->sd.ctrl_handler = hdl;
+	if (hdl->error) {
+		dev_err(&client->dev, "%s fail error: 0x%x\n",
+			__func__, hdl->error);
+		return hdl->error;
+	}
+
+	return 0;
+}
+
+static int dw9807_probe(struct i2c_client *client)
+{
+	struct dw9807_device *dw9807_dev;
+	int rval;
+
+	dw9807_dev = devm_kzalloc(&client->dev, sizeof(*dw9807_dev),
+				  GFP_KERNEL);
+	if (dw9807_dev == NULL)
+		return -ENOMEM;
+
+	v4l2_i2c_subdev_init(&dw9807_dev->sd, client, &dw9807_ops);
+	dw9807_dev->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+	dw9807_dev->sd.internal_ops = &dw9807_int_ops;
+
+	rval = dw9807_init_controls(dw9807_dev);
+	if (rval)
+		goto err_cleanup;
+
+	rval = media_entity_pads_init(&dw9807_dev->sd.entity, 0, NULL);
+	if (rval < 0)
+		goto err_cleanup;
+
+	dw9807_dev->sd.entity.function = MEDIA_ENT_F_LENS;
+
+	rval = v4l2_async_register_subdev(&dw9807_dev->sd);
+	if (rval < 0)
+		goto err_cleanup;
+
+	pm_runtime_set_active(&client->dev);
+	pm_runtime_enable(&client->dev);
+	pm_runtime_idle(&client->dev);
+
+	return 0;
+
+err_cleanup:
+	dw9807_subdev_cleanup(dw9807_dev);
+
+	return rval;
+}
+
+static int dw9807_remove(struct i2c_client *client)
+{
+	struct v4l2_subdev *sd = i2c_get_clientdata(client);
+	struct dw9807_device *dw9807_dev = sd_to_dw9807_vcm(sd);
+
+	pm_runtime_disable(&client->dev);
+	pm_runtime_set_suspended(&client->dev);
+
+	dw9807_subdev_cleanup(dw9807_dev);
+
+	return 0;
+}
+
+/*
+ * This function sets the vcm position, so it consumes least current
+ * The lens position is gradually moved in units of DW9807_CTRL_STEPS,
+ * to make the movements smoothly.
+ */
+static int __maybe_unused dw9807_vcm_suspend(struct device *dev)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct v4l2_subdev *sd = i2c_get_clientdata(client);
+	struct dw9807_device *dw9807_dev = sd_to_dw9807_vcm(sd);
+	const char tx_data[2] = { DW9807_CTL_ADDR, 0x01 };
+	int ret, val;
+
+	for (val = dw9807_dev->current_val & ~(DW9807_CTRL_STEPS - 1);
+	     val >= 0; val -= DW9807_CTRL_STEPS) {
+		ret = dw9807_set_dac(client, val);
+		if (ret)
+			dev_err_once(dev, "%s I2C failure: %d", __func__, ret);
+		usleep_range(DW9807_CTRL_DELAY_US, DW9807_CTRL_DELAY_US + 10);
+	}
+
+	/* Power down */
+	ret = i2c_master_send(client, tx_data, sizeof(tx_data));
+	if (ret < 0) {
+		dev_err(&client->dev, "I2C write CTL fail ret = %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+
+/*
+ * This function sets the vcm position to the value set by the user
+ * through v4l2_ctrl_ops s_ctrl handler
+ * The lens position is gradually moved in units of DW9807_CTRL_STEPS,
+ * to make the movements smoothly.
+ */
+static int  __maybe_unused dw9807_vcm_resume(struct device *dev)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct v4l2_subdev *sd = i2c_get_clientdata(client);
+	struct dw9807_device *dw9807_dev = sd_to_dw9807_vcm(sd);
+	const char tx_data[2] = { DW9807_CTL_ADDR, 0x00 };
+	int ret, val;
+
+	/* Power on */
+	ret = i2c_master_send(client, tx_data, sizeof(tx_data));
+	if (ret < 0) {
+		dev_err(&client->dev, "I2C write CTL fail ret = %d\n", ret);
+		return ret;
+	}
+
+	for (val = dw9807_dev->current_val % DW9807_CTRL_STEPS;
+	     val < dw9807_dev->current_val + DW9807_CTRL_STEPS - 1;
+	     val += DW9807_CTRL_STEPS) {
+		ret = dw9807_set_dac(client, val);
+		if (ret)
+			dev_err_ratelimited(dev, "%s I2C failure: %d",
+						__func__, ret);
+		usleep_range(DW9807_CTRL_DELAY_US, DW9807_CTRL_DELAY_US + 10);
+	}
+
+	return 0;
+}
+
+static const struct of_device_id dw9807_of_table[] = {
+	{ .compatible = "dongwoon,dw9807" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, dw9807_of_table);
+
+static const struct dev_pm_ops dw9807_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(dw9807_vcm_suspend, dw9807_vcm_resume)
+	SET_RUNTIME_PM_OPS(dw9807_vcm_suspend, dw9807_vcm_resume, NULL)
+};
+
+static struct i2c_driver dw9807_i2c_driver = {
+	.driver = {
+		.name = "dw9807",
+		.pm = &dw9807_pm_ops,
+		.of_match_table = dw9807_of_table,
+	},
+	.probe_new = dw9807_probe,
+	.remove = dw9807_remove,
+};
+
+module_i2c_driver(dw9807_i2c_driver);
+
+MODULE_AUTHOR("Chiang, Alan <alanx.chiang@intel.com>");
+MODULE_DESCRIPTION("DW9807 VCM driver");
+MODULE_LICENSE("GPL v2");
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [RESEND PATCH v9 1/2] media: dt-bindings: Add bindings for Dongwoon DW9807 voice coil
  2018-05-02 15:53 ` [RESEND PATCH v9 1/2] media: dt-bindings: Add bindings for Dongwoon DW9807 voice coil Andy Yeh
@ 2018-05-02 21:36   ` Sakari Ailus
  2018-05-03  7:31     ` Yeh, Andy
  2018-05-08  5:36     ` Yeh, Andy
  0 siblings, 2 replies; 9+ messages in thread
From: Sakari Ailus @ 2018-05-02 21:36 UTC (permalink / raw)
  To: Andy Yeh; +Cc: linux-media, devicetree, tfiga, jacopo, Alan Chiang

On Wed, May 02, 2018 at 11:53:47PM +0800, Andy Yeh wrote:
> From: Alan Chiang <alanx.chiang@intel.com>
> 
> Dongwoon DW9807 is a voice coil lens driver.
> 
> Signed-off-by: Andy Yeh <andy.yeh@intel.com>
> Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

I don't remember seeing these two on the first patch nor giving mine. For
what it's worth, I've applied v8 to my tree here:

<URL:https://git.linuxtv.org/sailus/media_tree.git/log/?h=for-4.18-3>

I.e. there's no need to resend the same patch to just add the regular
acked-by or reviewed-by tags. "RESEND" in the subject suggests you're
sending exactly the same patch, and in that case the version would be
unchanged as well.

> Acked-by: Rob Herring <robh@kernel.org>
> 
> ---
>  Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt | 9 +++++++++
>  1 file changed, 9 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt
> 
> diff --git a/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt b/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt
> new file mode 100644
> index 0000000..0a1a860
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt
> @@ -0,0 +1,9 @@
> +Dongwoon Anatech DW9807 voice coil lens driver
> +
> +DW9807 is a 10-bit DAC with current sink capability. It is intended for
> +controlling voice coil lenses.
> +
> +Mandatory properties:
> +
> +- compatible: "dongwoon,dw9807"
> +- reg: I2C slave address

-- 
Sakari Ailus
sakari.ailus@linux.intel.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [RESEND PATCH v9 1/2] media: dt-bindings: Add bindings for Dongwoon DW9807 voice coil
  2018-05-02 21:36   ` Sakari Ailus
@ 2018-05-03  7:31     ` Yeh, Andy
  2018-05-08  5:36     ` Yeh, Andy
  1 sibling, 0 replies; 9+ messages in thread
From: Yeh, Andy @ 2018-05-03  7:31 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-media, devicetree, tfiga, jacopo, Chiang, AlanX

Hi Sakari,

Thanks to add to your tree. And I am not familiar with the process. So I wonder how the patchset will be applied to the Linux media tree eventually?

Regards, Andy

-----Original Message-----
From: Sakari Ailus [mailto:sakari.ailus@linux.intel.com] 
Sent: Thursday, May 3, 2018 5:37 AM
To: Yeh, Andy <andy.yeh@intel.com>
Cc: linux-media@vger.kernel.org; devicetree@vger.kernel.org; tfiga@chromium.org; jacopo@jmondi.org; Chiang, AlanX <alanx.chiang@intel.com>
Subject: Re: [RESEND PATCH v9 1/2] media: dt-bindings: Add bindings for Dongwoon DW9807 voice coil

On Wed, May 02, 2018 at 11:53:47PM +0800, Andy Yeh wrote:
> From: Alan Chiang <alanx.chiang@intel.com>
> 
> Dongwoon DW9807 is a voice coil lens driver.
> 
> Signed-off-by: Andy Yeh <andy.yeh@intel.com>
> Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

I don't remember seeing these two on the first patch nor giving mine. For what it's worth, I've applied v8 to my tree here:

<URL:https://git.linuxtv.org/sailus/media_tree.git/log/?h=for-4.18-3>

I.e. there's no need to resend the same patch to just add the regular acked-by or reviewed-by tags. "RESEND" in the subject suggests you're sending exactly the same patch, and in that case the version would be unchanged as well.

> Acked-by: Rob Herring <robh@kernel.org>
> 
> ---
>  Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt | 9 
> +++++++++
>  1 file changed, 9 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt
> 
> diff --git 
> a/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt 
> b/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt
> new file mode 100644
> index 0000000..0a1a860
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt
> @@ -0,0 +1,9 @@
> +Dongwoon Anatech DW9807 voice coil lens driver
> +
> +DW9807 is a 10-bit DAC with current sink capability. It is intended 
> +for controlling voice coil lenses.
> +
> +Mandatory properties:
> +
> +- compatible: "dongwoon,dw9807"
> +- reg: I2C slave address

--
Sakari Ailus
sakari.ailus@linux.intel.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [RESEND PATCH v9 1/2] media: dt-bindings: Add bindings for Dongwoon DW9807 voice coil
  2018-05-02 21:36   ` Sakari Ailus
  2018-05-03  7:31     ` Yeh, Andy
@ 2018-05-08  5:36     ` Yeh, Andy
  2018-05-08  9:02       ` Sakari Ailus
  1 sibling, 1 reply; 9+ messages in thread
From: Yeh, Andy @ 2018-05-08  5:36 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-media, devicetree, tfiga, jacopo, Chiang, AlanX

[-- Attachment #1: Type: text/plain, Size: 2398 bytes --]

Dear reviewers,

As the dt-binding patch has been accepted, would any help set the driver patch be accepted too? Any missing action from my side blocked the process. Thanks in advance. 

media: dw9807: Add dw9807 vcm driver
https://patchwork.linuxtv.org/patch/49159/

Regards, Andy

-----Original Message-----
From: Sakari Ailus [mailto:sakari.ailus@linux.intel.com] 
Sent: Thursday, May 3, 2018 5:37 AM
To: Yeh, Andy <andy.yeh@intel.com>
Cc: linux-media@vger.kernel.org; devicetree@vger.kernel.org; tfiga@chromium.org; jacopo@jmondi.org; Chiang, AlanX <alanx.chiang@intel.com>
Subject: Re: [RESEND PATCH v9 1/2] media: dt-bindings: Add bindings for Dongwoon DW9807 voice coil

On Wed, May 02, 2018 at 11:53:47PM +0800, Andy Yeh wrote:
> From: Alan Chiang <alanx.chiang@intel.com>
> 
> Dongwoon DW9807 is a voice coil lens driver.
> 
> Signed-off-by: Andy Yeh <andy.yeh@intel.com>
> Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

I don't remember seeing these two on the first patch nor giving mine. For what it's worth, I've applied v8 to my tree here:

<URL:https://git.linuxtv.org/sailus/media_tree.git/log/?h=for-4.18-3>

I.e. there's no need to resend the same patch to just add the regular acked-by or reviewed-by tags. "RESEND" in the subject suggests you're sending exactly the same patch, and in that case the version would be unchanged as well.

> Acked-by: Rob Herring <robh@kernel.org>
> 
> ---
>  Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt | 9 
> +++++++++
>  1 file changed, 9 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt
> 
> diff --git 
> a/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt 
> b/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt
> new file mode 100644
> index 0000000..0a1a860
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807.txt
> @@ -0,0 +1,9 @@
> +Dongwoon Anatech DW9807 voice coil lens driver
> +
> +DW9807 is a 10-bit DAC with current sink capability. It is intended 
> +for controlling voice coil lenses.
> +
> +Mandatory properties:
> +
> +- compatible: "dongwoon,dw9807"
> +- reg: I2C slave address

--
Sakari Ailus
sakari.ailus@linux.intel.com

[-- Attachment #2: Type: message/rfc822, Size: 6260 bytes --]

From: Patchwork <patchwork@linuxtv.org>
To: "Yeh, Andy" <andy.yeh@intel.com>
Subject: [linux-media] Patch notification: 3 patches updated
Date: Sat, 5 May 2018 15:51:02 +0000
Message-ID: <20180505155102.18397.29471@www.linuxtv.org>

Hello,

The following patches (submitted by you) have been updated in patchwork:

 * linux-media: [RESEND,v8,1/2] media: dt-bindings: Add bindings for Dongwoon DW9807 voice coil
     - http://patchwork.linuxtv.org/patch/49028/
     - for: Linux Media kernel patches
    was: New
    now: Accepted

 * linux-media: [RESEND,v9,1/2] media: dt-bindings: Add bindings for Dongwoon DW9807 voice coil
     - http://patchwork.linuxtv.org/patch/49158/
     - for: Linux Media kernel patches
    was: New
    now: Accepted

 * linux-media: RESEND[PATCH v6 1/2] media: dt-bindings: Add bindings for Dongwoon DW9807 voice coil
     - http://patchwork.linuxtv.org/patch/47979/
     - for: Linux Media kernel patches
    was: New
    now: Accepted

This email is a notification only - you do not need to respond.

-

Patches submitted to linux-media@vger.kernel.org have the following
possible states:

New: Patches not yet reviewed (typically new patches);

Under review: When it is expected that someone is reviewing it (typically,
              the driver's author or maintainer). Unfortunately, patchwork
              doesn't have a field to indicate who is the driver maintainer.
              If in doubt about who is the driver maintainer please check the
              MAINTAINERS file or ask at the ML;

Superseded: when the same patch is sent twice, or a new version of the
            same patch is sent, and the maintainer identified it, the first
            version is marked as such. It is also used when a patch was
            superseeded by a git pull request.

Obsoleted: patch doesn't apply anymore, because the modified code doesn't
           exist anymore.

Changes requested: when someone requests changes of the patch;

Rejected: When the patch is wrong or doesn't apply. Most of the
          time, 'rejected' and 'changes requested' means the same thing
          for the developer: he'll need to re-work on the patch.

RFC: patches marked as such and other patches that are also RFC, but the
     patch author was not nice enough to mark them as such. That includes:
        - patches sent by a driver's maintainer who send patches
          via git pull requests;
        - patches with a very active community (typically from developers
          working with embedded devices), where lots of versions are
          needed for the driver maintainer and/or the community to be
          happy with.

TODO: A variant of RFC. It keeps the patch visible at patchwork main
        screen, allowing to better track it.

Not Applicable: for patches that aren't meant to be applied via
                the media-tree.git.

Accepted: when some driver maintainer says that the patch will be applied
          via his tree, or when everything is ok and it got applied
          either at the main tree or via some other tree (fixes tree;
          some other maintainer's tree - when it belongs to other subsystems,
          etc);

If you think any status change is a mistake, please send an email to the ML.

-

This is an automated mail sent by the patchwork system at
patchwork.linuxtv.org. To stop receiving these notifications, edit
your mail settings at:
  http://patchwork.linuxtv.org/mail/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RESEND PATCH v9 1/2] media: dt-bindings: Add bindings for Dongwoon DW9807 voice coil
  2018-05-08  5:36     ` Yeh, Andy
@ 2018-05-08  9:02       ` Sakari Ailus
  0 siblings, 0 replies; 9+ messages in thread
From: Sakari Ailus @ 2018-05-08  9:02 UTC (permalink / raw)
  To: Yeh, Andy; +Cc: linux-media, devicetree, tfiga, jacopo, Chiang, AlanX

On Tue, May 08, 2018 at 05:36:48AM +0000, Yeh, Andy wrote:
> Dear reviewers,
> 
> As the dt-binding patch has been accepted, would any help set the driver patch be accepted too? Any missing action from my side blocked the process. Thanks in advance. 
> 
> media: dw9807: Add dw9807 vcm driver
> https://patchwork.linuxtv.org/patch/49159/

The patchwork status was wrong and I've fixed it now; the patches
themselves are contained in a pull request to Mauro here:

<URL:https://www.spinics.net/lists/linux-media/msg133734.html>

-- 
Sakari Ailus
sakari.ailus@linux.intel.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RESEND PATCH v9 2/2] media: dw9807: Add dw9807 vcm driver
  2018-05-02 15:53 ` [RESEND PATCH v9 2/2] media: dw9807: Add dw9807 vcm driver Andy Yeh
@ 2018-05-09 19:03   ` Mauro Carvalho Chehab
  2018-05-16 15:28     ` Yeh, Andy
  0 siblings, 1 reply; 9+ messages in thread
From: Mauro Carvalho Chehab @ 2018-05-09 19:03 UTC (permalink / raw)
  To: Andy Yeh
  Cc: linux-media, sakari.ailus, devicetree, tfiga, jacopo, Alan Chiang

Em Wed,  2 May 2018 23:53:48 +0800
Andy Yeh <andy.yeh@intel.com> escreveu:

> From: Alan Chiang <alanx.chiang@intel.com>
> 
> DW9807 is a 10 bit DAC from Dongwoon, designed for linear
> control of voice coil motor.
> 
> This driver creates a V4L2 subdevice and
> provides control to set the desired focus.
> 
> Signed-off-by: Andy Yeh <andy.yeh@intel.com>
> Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
> Acked-by: Rob Herring <robh@kernel.org>

This adds a new warning.

Thanks,
Mauro
 
    drivers/media/i2c/dw9807.c: In function 'dw9807_set_dac':
    drivers/media/i2c/dw9807.c:81:16: warning: unused variable 'retry' [-Wunused-variable]
      int val, ret, retry = 0;
                    ^
    
Please either fix or fold the following patch.

diff --git a/drivers/media/i2c/dw9807.c b/drivers/media/i2c/dw9807.c
index 28ede2b47acf..6ebb98717fb1 100644
--- a/drivers/media/i2c/dw9807.c
+++ b/drivers/media/i2c/dw9807.c
@@ -78,7 +78,7 @@ static int dw9807_set_dac(struct i2c_client *client, u16 data)
        const char tx_data[3] = {
                DW9807_MSB_ADDR, ((data >> 8) & 0x03), (data & 0xff)
        };
-       int val, ret, retry = 0;
+       int val, ret;
 
        /*
         * According to the datasheet, need to check the bus status before we


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* RE: [RESEND PATCH v9 2/2] media: dw9807: Add dw9807 vcm driver
  2018-05-09 19:03   ` Mauro Carvalho Chehab
@ 2018-05-16 15:28     ` Yeh, Andy
  0 siblings, 0 replies; 9+ messages in thread
From: Yeh, Andy @ 2018-05-16 15:28 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: linux-media, sakari.ailus, devicetree, tfiga, jacopo, Chiang, AlanX

Hi Mauro,


>-----Original Message-----
>From: Mauro Carvalho Chehab [mailto:mchehab+samsung@kernel.org] 
>Sent: Thursday, May 10, 2018 3:04 AM
>To: Yeh, Andy <andy.yeh@intel.com>
>Cc: linux-media@vger.kernel.org; sakari.ailus@linux.intel.com; devicetree@vger.kernel.org; tfiga@chromium.org; jacopo@jmondi.org; Chiang, AlanX <alanx.chiang@intel.com>
>Subject: Re: [RESEND PATCH v9 2/2] media: dw9807: Add dw9807 vcm driver
>
>This adds a new warning.
>
>Thanks,
>Mauro
> 
>    drivers/media/i2c/dw9807.c: In function 'dw9807_set_dac':
>    drivers/media/i2c/dw9807.c:81:16: warning: unused variable 'retry' [-Wunused-variable]
>      int val, ret, retry = 0;
>                    ^
>    
>Please either fix or fold the following patch.
>

I noticed you just submitted a patch to the list to address the warning. Thanks.
https://patchwork.linuxtv.org/patch/49575/

Just in the meantime, I uploaded the same one before noticing your patch.  I would like to obsolete mine, so let me know if you agree too. Thanks.
https://patchwork.linuxtv.org/patch/49574/


Regards, Andy

>diff --git a/drivers/media/i2c/dw9807.c b/drivers/media/i2c/dw9807.c index 28ede2b47acf..6ebb98717fb1 100644
>--- a/drivers/media/i2c/dw9807.c
>+++ b/drivers/media/i2c/dw9807.c
>@@ -78,7 +78,7 @@ static int dw9807_set_dac(struct i2c_client *client, u16 data)
>        const char tx_data[3] = {
>                DW9807_MSB_ADDR, ((data >> 8) & 0x03), (data & 0xff)
>        };
>-       int val, ret, retry = 0;
>+       int val, ret;
> 
>        /*
>         * According to the datasheet, need to check the bus status before we

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-05-16 15:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-02 15:53 [RESEND PATCH v9 0/2] DW9807 DT binding and driver patches Andy Yeh
2018-05-02 15:53 ` [RESEND PATCH v9 1/2] media: dt-bindings: Add bindings for Dongwoon DW9807 voice coil Andy Yeh
2018-05-02 21:36   ` Sakari Ailus
2018-05-03  7:31     ` Yeh, Andy
2018-05-08  5:36     ` Yeh, Andy
2018-05-08  9:02       ` Sakari Ailus
2018-05-02 15:53 ` [RESEND PATCH v9 2/2] media: dw9807: Add dw9807 vcm driver Andy Yeh
2018-05-09 19:03   ` Mauro Carvalho Chehab
2018-05-16 15:28     ` Yeh, Andy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.