From patchwork Mon May 18 13:27:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongchun Zhu X-Patchwork-Id: 11555425 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BB40F618 for ; Mon, 18 May 2020 13:29:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2C4B207ED for ; Mon, 18 May 2020 13:29:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="l7XVTTa5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726958AbgERN3I (ORCPT ); Mon, 18 May 2020 09:29:08 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:39161 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726775AbgERN3I (ORCPT ); Mon, 18 May 2020 09:29:08 -0400 X-UUID: 7fa473ba96a9451c88b54261dcbf2e0c-20200518 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=0oPHPt5pIb7KHZdlyVqoLRWJ+ikzXZ8b5EsBL/Pps+M=; b=l7XVTTa5BNIRmYHaMG7Yv9ZpVnRhAg0ziJbNDCqBuRC9jjisumcugGycJmwGC9eLatM0aosoONyuzC8zJX58twVjqoebz6yR9uilzpsdiAuM1Ru2WeO0Xz69+Bw1SH6fIfBkVCscZMRsB7BnvsjdG8fC51CXM6EnVktPpWo27RE=; X-UUID: 7fa473ba96a9451c88b54261dcbf2e0c-20200518 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 728150184; Mon, 18 May 2020 21:29:02 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 18 May 2020 21:29:01 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 18 May 2020 21:28:59 +0800 From: Dongchun Zhu To: , , , , , , , , , , CC: , , , , , , , , Subject: [V6, 0/2] media: i2c: Add support for DW9768 VCM driver Date: Mon, 18 May 2020 21:27:29 +0800 Message-ID: <20200518132731.20855-1-dongchun.zhu@mediatek.com> X-Mailer: git-send-email 2.9.2 MIME-Version: 1.0 X-MTK: N Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hello, This series adds DT bindings in YAML and V4L2 sub-device driver for DW9768 lens voice coil motor(VCM), which is a 10-bit DAC with 100mA output current sink capability from Dongwoon. The driver is designed for linear control of voice coil motor, and controlled via IIC serial interface to set the desired focus. It controls the position with 10-bit DAC data D[9:0] and seperates two 8-bit regs to control the VCM position as belows. DAC_MSB: D[9:8](ADDR: 0x03): +---+---+---+---+---+---+---+---+ |---|---|---|---|---|---|D09|D08| +---+---+---+---+---+---+---+---+ DAC_LSB: D[7:0](ADDR: 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 desired focus via V4L2_CID_FOCUS_ABSOLUTE ctrl Previous versions of this patch-set can be found here: v5: https://lore.kernel.org/linux-media/20200502161727.30463-1-dongchun.zhu@mediatek.com/ v4: https://lore.kernel.org/linux-media/20200330123634.363-1-dongchun.zhu@mediatek.com/ v3: https://lore.kernel.org/linux-media/20200228155958.20657-1-dongchun.zhu@mediatek.com/ v2: https://lore.kernel.org/linux-media/20190905072142.14606-1-dongchun.zhu@mediatek.com/ v1: https://lore.kernel.org/linux-media/20190708100641.2702-1-dongchun.zhu@mediatek.com/ Mainly changes of v6 are addressing comments from Rob, Sakari, Tomasz. Compared to v5: - Add a second compatible string for the Giantec device - Document optional properties: "dongwoon,aac-mode", "dongwoon,aac-timing" and "dongwoon,clock-dividing-rate" for lens specific reg settings - Adjust Kconfig to match the current media tree master branch - Use container_of() directly to replace of defining macro function Please help review. Thanks. Dongchun Zhu (2): media: dt-bindings: media: i2c: Document DW9768 bindings media: i2c: dw9768: Add DW9768 VCM driver .../bindings/media/i2c/dongwoon,dw9768.yaml | 105 +++++ MAINTAINERS | 8 + drivers/media/i2c/Kconfig | 13 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/dw9768.c | 515 +++++++++++++++++++++ 5 files changed, 642 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/i2c/dongwoon,dw9768.yaml create mode 100644 drivers/media/i2c/dw9768.c