From patchwork Mon Mar 30 12:36:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongchun Zhu X-Patchwork-Id: 11465457 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 CAD6A13A4 for ; Mon, 30 Mar 2020 12:36:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A6AD620716 for ; Mon, 30 Mar 2020 12:36:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IwUhzkRD"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="S36tuLp5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6AD620716 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=kRTY/kocaXy+DJsn4zIhmKulLFGCrWB9k6fCh4CicuU=; b=IwUhzkRD+Ebjjf aOe0tqBBg/xQcISsOzsV5OoXh3M5vsJVFNncOGNZMhPtfXIMI4VDG5SraW0UIRJqZ+36CQ+WdKqu1 sXmpyPbvYsLMvs3nMkEA7BZR0Zl7P/VWRLFG/GKhvRmYqt4HxmHheQG3fEr8eJZ0jK3Xc4yRv2HOm BiGiPOmdvskp7VBBWFyQl19KHoVZSK8lSgkfLPog/5+3sC+3Hz1jlNrvslK/Gxm/goXHTkGdfsqtJ GStrpzIpEEXa6oqA15ECQ202DJlEIDJ8q8Dr51QgeQ0qO6eBaRQV6CXSVh5BWnefXF1WFsBS6i6f4 TErfiHsb8PkcPqO9JIZA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jItej-0004M7-EH; Mon, 30 Mar 2020 12:36:41 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jIteg-0004Kb-DE; Mon, 30 Mar 2020 12:36:39 +0000 X-UUID: b319726c80a3426298678c524a7a1956-20200330 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=5fynngkcfVP3y4nuFrJ+FfItuj0F2ovwQT443e47vAM=; b=S36tuLp5A9vckFlGPARidf9un053JVOXrFCQQFK2npj2KBo+afhhf8Kb3ajMyXf2MvThc9uV9YX6o38N77ucL7YKEAI7zzgr9DxdlUYHMmjhA3P+TBSgvdnRIyuhBFwnYOOFnOb9hGY3MeVgACzohMhcnSuCM89vOzo77uW7TkI=; X-UUID: b319726c80a3426298678c524a7a1956-20200330 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 2114219133; Mon, 30 Mar 2020 04:36:37 -0800 Received: from MTKMBS07N2.mediatek.inc (172.21.101.141) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 30 Mar 2020 05:36:31 -0700 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 30 Mar 2020 20:36:27 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 30 Mar 2020 20:36:26 +0800 From: Dongchun Zhu To: , , , , , , , , Subject: [V4, 0/2] media: i2c: add support for DW9768 VCM driver Date: Mon, 30 Mar 2020 20:36:32 +0800 Message-ID: <20200330123634.363-1-dongchun.zhu@mediatek.com> X-Mailer: git-send-email 2.9.2 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200330_053638_458328_6D9E7B2C X-CRM114-Status: UNSURE ( 9.48 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [216.200.240.184 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 MIME_BASE64_TEXT RAW: Message text disguised using base64 encoding 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, srv_heupstream@mediatek.com, shengnan.wang@mediatek.com, sj.huang@mediatek.com, linux-mediatek@lists.infradead.org, dongchun.zhu@mediatek.com, louis.kuo@mediatek.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hello, Here is the updated version of the changes to add DT bindings in YAML and V4L2 driver for the DW9768 lens voicee coil motor. 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. 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](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: v3: https://patchwork.kernel.org/cover/11412719/ v2: https://patchwork.kernel.org/cover/11132299/ v1: https://patchwork.kernel.org/cover/11034797/ Mainly changes of v4 are addressing comments from Rob, Andy, Sakari, Tomasz. Compared to v3: - Fix DT bindings and MAINTAINERS checking errors - Use i2c_smbus_write_word_swapped() to replace of i2c_smbus_write_word_data() - Refine driver more simply and clear - Add a dependency to CONFIG_PM Please review. Thanks. Dongchun Zhu (2): media: i2c: dw9768: Add DT support and MAINTAINERS entry media: i2c: Add DW9768 VCM driver .../bindings/media/i2c/dongwoon,dw9768.yaml | 62 +++ MAINTAINERS | 8 + drivers/media/i2c/Kconfig | 11 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/dw9768.c | 432 +++++++++++++++++++++ 5 files changed, 514 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/i2c/dongwoon,dw9768.yaml create mode 100644 drivers/media/i2c/dw9768.c