Linux-Media Archive on lore.kernel.org
 help / color / Atom feed
From: Dongchun Zhu <dongchun.zhu@mediatek.com>
To: <mchehab@kernel.org>, <andriy.shevchenko@linux.intel.com>,
	<robh+dt@kernel.org>, <mark.rutland@arm.com>,
	<sakari.ailus@linux.intel.com>, <drinkcat@chromium.org>,
	<tfiga@chromium.org>, <matthias.bgg@gmail.com>,
	<bingbu.cao@intel.com>
Cc: <srv_heupstream@mediatek.com>,
	<linux-mediatek@lists.infradead.org>,
	<linux-arm-kernel@lists.infradead.org>, <sj.huang@mediatek.com>,
	<linux-media@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<louis.kuo@mediatek.com>, <shengnan.wang@mediatek.com>,
	<dongchun.zhu@mediatek.com>
Subject: [V3, 0/2] media: i2c: add support for DW9768 VCM driver
Date: Fri, 28 Feb 2020 23:59:56 +0800
Message-ID: <20200228155958.20657-1-dongchun.zhu@mediatek.com> (raw)

Hello,

Add DT bindings in YAML and v4l2 driver for DW9768 lens voice coil actuator.
This is a 10-bit DAC with 100mA output current sink capability from Dongwoon,
designed for linear control of voice coil motor, and controlled via I2C serial
interface to set the desired focus position.

The DW9768 controls the position with 10-bit DAC data D[9:0] and seperates
two 8-bit registers to control the VCM position as belows.
DAC_MSB: D[9:8] (ADD: 0x03)
     +---+---+---+---+---+---+---+---+
     |---|---|---|---|---|---|D09|D08|
     +---+---+---+---+---+---+---+---+
DAC_LSB: D[7:0] (ADD: 0x04)
     +---+---+---+---+---+---+---+---+
     |D07|D06|D05|D04|D03|D02|D01|D00|
     +---+---+---+---+---+---+---+---+

This driver supports:
 - set DW9768 to standby mode once suspend and turn it back to active if resume
 - set the position via V4L2_CID_FOCUS_ABSOLUTE ctrl

Changes of v3 are mainly addressing comments from Andy, Rob, Sakari, Tomasz,
compared to v2:
 - Rebase onto 5.6-rc1
 - Convert text documentation to YAML schema
 - Add documents for the register addresses and bits in the registers
 - Merge _power_off/on with runtime PM suspend/resume function
 - Drop the I2C ID table
 - Refine DW9768 power sequencing timing
 - Use the regulator bulk API to enable/disable regulators
 - Change i2c_smbus_write_block_data() to i2c_smbus_write_word_data()
 - Fixup coding style and improve code quality
 - Fix other reviewed issues in V2

Mainly changes of v2 are addressing the comments from Tomasz, Bingbu, Andy,
including,
 - Use i2c_smbus_write_byte_data to replace of the custom dw9768_i2c_write
 - Use i2c_smbus_write_block_data to set vcm postion
 - Use the runtime PM suspend/resume callbacks to power off/on
 - Check the PM runtime status before powering off in dw9768_remove function
 - Add one more regulator vin for the I2C interface
 - Remove or refine log print
 - Fix other reviewed issues in v1

Dongchun Zhu (2):
  media: i2c: dw9768: Add DT support and MAINTAINERS entry
  media: i2c: Add DW9768 VCM driver

 .../bindings/media/i2c/dongwoon,dw9768.yaml        |  55 +++
 MAINTAINERS                                        |   8 +
 drivers/media/i2c/Kconfig                          |  10 +
 drivers/media/i2c/Makefile                         |   1 +
 drivers/media/i2c/dw9768.c                         | 437 +++++++++++++++++++++
 5 files changed, 511 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/dongwoon,dw9768.yaml
 create mode 100644 drivers/media/i2c/dw9768.c

-- 
2.9.2

             reply index

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28 15:59 Dongchun Zhu [this message]
2020-02-28 15:59 ` [V3, 1/2] media: i2c: dw9768: Add DT support and MAINTAINERS entry Dongchun Zhu
2020-03-02 18:54   ` Rob Herring
2020-02-28 15:59 ` [V3, 2/2] media: i2c: Add DW9768 VCM driver Dongchun Zhu
2020-03-02 11:07   ` Andy Shevchenko
2020-03-05 12:05   ` Sakari Ailus
2020-03-10 10:10     ` Andy Shevchenko
2020-03-19 10:03       ` Dongchun Zhu
2020-03-19 11:36         ` Andy Shevchenko
2020-03-19 11:54           ` Dongchun Zhu
2020-03-18 10:20     ` Dongchun Zhu
2020-03-18 10:29       ` Sakari Ailus
2020-03-23 19:09         ` Tomasz Figa
2020-03-23 20:35           ` Sakari Ailus
2020-03-25 15:11             ` Tomasz Figa
2020-03-10 10:00   ` Dongchun Zhu
2020-03-10 10:05     ` Sakari Ailus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200228155958.20657-1-dongchun.zhu@mediatek.com \
    --to=dongchun.zhu@mediatek.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bingbu.cao@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=drinkcat@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=louis.kuo@mediatek.com \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=shengnan.wang@mediatek.com \
    --cc=sj.huang@mediatek.com \
    --cc=srv_heupstream@mediatek.com \
    --cc=tfiga@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Media Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-media/0 linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ https://lore.kernel.org/linux-media \
		linux-media@vger.kernel.org
	public-inbox-index linux-media

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-media


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git