From mboxrd@z Thu Jan 1 00:00:00 1970 From: Subject: [V2, 0/2] media: i2c: add support for DW9768 VCM driver Date: Thu, 5 Sep 2019 15:21:40 +0800 Message-ID: <20190905072142.14606-1-dongchun.zhu@mediatek.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+glpam-linux-mediatek=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: mchehab-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org, sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, drinkcat-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, tfiga-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, bingbu.cao-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, shengnan.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, sj.huang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, dongchun.zhu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, sam.hung-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: devicetree@vger.kernel.org From: Dongchun Zhu Hello, Add a v4l2 sub-device driver for Dongwoon's DW9768 lens voice coil. This is a voice coil module using the i2c bus to control the focus position. The DW9768 can control the position with 10 bits value and consists of two 8 bit registers show as below. register 0x04(DW9768_REG_POSITION): +---+---+---+---+---+---+---+---+ |D07|D06|D05|D04|D03|D02|D01|D00| +---+---+---+---+---+---+---+---+ register 0x03: +---+---+---+---+---+---+---+---+ |---|---|---|---|---|---|D09|D08| +---+---+---+---+---+---+---+---+ 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 Mainly changes of v2 are addressing the comments from Tomasz, Bingbu, Andy, including, - Use i2c_smbus_write_byte_data/i2c_smbus_write_block_data to write I2C register - Adopt the runtime PM suspend/resume callbacks to powering 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 redundant 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.txt | 9 + MAINTAINERS | 8 + drivers/media/i2c/Kconfig | 10 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/dw9768.c | 349 +++++++++++++++++++++ 5 files changed, 377 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/i2c/dongwoon,dw9768.txt create mode 100644 drivers/media/i2c/dw9768.c -- 2.9.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B98B0C3A5A5 for ; Thu, 5 Sep 2019 07:21:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 984482341C for ; Thu, 5 Sep 2019 07:21:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731940AbfIEHV4 (ORCPT ); Thu, 5 Sep 2019 03:21:56 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:57695 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730778AbfIEHV4 (ORCPT ); Thu, 5 Sep 2019 03:21:56 -0400 X-UUID: 36acc9336a7841b1a881216978b3a93a-20190905 X-UUID: 36acc9336a7841b1a881216978b3a93a-20190905 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1222208114; Thu, 05 Sep 2019 15:21:50 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 5 Sep 2019 15:21:47 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 5 Sep 2019 15:21:46 +0800 From: To: , , , , , , , , CC: , , , , , , , , Subject: [V2, 0/2] media: i2c: add support for DW9768 VCM driver Date: Thu, 5 Sep 2019 15:21:40 +0800 Message-ID: <20190905072142.14606-1-dongchun.zhu@mediatek.com> X-Mailer: git-send-email 2.9.2 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dongchun Zhu Hello, Add a v4l2 sub-device driver for Dongwoon's DW9768 lens voice coil. This is a voice coil module using the i2c bus to control the focus position. The DW9768 can control the position with 10 bits value and consists of two 8 bit registers show as below. register 0x04(DW9768_REG_POSITION): +---+---+---+---+---+---+---+---+ |D07|D06|D05|D04|D03|D02|D01|D00| +---+---+---+---+---+---+---+---+ register 0x03: +---+---+---+---+---+---+---+---+ |---|---|---|---|---|---|D09|D08| +---+---+---+---+---+---+---+---+ 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 Mainly changes of v2 are addressing the comments from Tomasz, Bingbu, Andy, including, - Use i2c_smbus_write_byte_data/i2c_smbus_write_block_data to write I2C register - Adopt the runtime PM suspend/resume callbacks to powering 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 redundant 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.txt | 9 + MAINTAINERS | 8 + drivers/media/i2c/Kconfig | 10 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/dw9768.c | 349 +++++++++++++++++++++ 5 files changed, 377 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/i2c/dongwoon,dw9768.txt create mode 100644 drivers/media/i2c/dw9768.c -- 2.9.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88A67C3A5A5 for ; Thu, 5 Sep 2019 07:22:27 +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 5BB492082E for ; Thu, 5 Sep 2019 07:22:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="djMfrHnD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BB492082E 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+infradead-linux-arm-kernel=archiver.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=Y3SligDPC0bofFTDIbvZzYhXrvgVOKuVtn01liCac6Y=; b=djMfrHnDV0MMsp HSnzNqvaBom2GJwmqlf0wPW49GAkMn39VeXg00yj6k/WdOad3rjn//3Q/JBNwo2CLs1qE0E6k1nMu nN5EpB+hR86rYLyzwUXdn2xNbrDE8LJ9/Va2NojGbjAtCtEmNKrUFxUVMpJq1mV1QygYB+VI7iwmx A6Vc8PHDalgR6mqQSTS/ht+lzaO6iiv12084oQeB4fstyAURqKfYPRmEmaVBOaXiMzQxny3V+gMHm /vC89FuPeSfJJdwCc8V/oXoy64lRf4Q9oYS0hzqbEkVNT5b+j7sGDGqoXd71YOwfD+RDbjGUs+D3i 5och89s39VS2rLmZQjSw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i5m62-00026d-97; Thu, 05 Sep 2019 07:22:22 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i5m5i-0001pG-63; Thu, 05 Sep 2019 07:22:03 +0000 X-UUID: fb99889b985e4c598737398ac79eb3d4-20190904 X-UUID: fb99889b985e4c598737398ac79eb3d4-20190904 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1271784923; Wed, 04 Sep 2019 23:21:50 -0800 Received: from mtkmbs05n1.mediatek.inc (172.21.101.15) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 5 Sep 2019 00:21:48 -0700 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 5 Sep 2019 15:21:47 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 5 Sep 2019 15:21:46 +0800 From: To: , , , , , , , , Subject: [V2, 0/2] media: i2c: add support for DW9768 VCM driver Date: Thu, 5 Sep 2019 15:21:40 +0800 Message-ID: <20190905072142.14606-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-20190905_002202_230768_6704779E X-CRM114-Status: UNSURE ( 8.02 ) X-CRM114-Notice: Please train this message. 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, sam.hung@mediatek.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Dongchun Zhu Hello, Add a v4l2 sub-device driver for Dongwoon's DW9768 lens voice coil. This is a voice coil module using the i2c bus to control the focus position. The DW9768 can control the position with 10 bits value and consists of two 8 bit registers show as below. register 0x04(DW9768_REG_POSITION): +---+---+---+---+---+---+---+---+ |D07|D06|D05|D04|D03|D02|D01|D00| +---+---+---+---+---+---+---+---+ register 0x03: +---+---+---+---+---+---+---+---+ |---|---|---|---|---|---|D09|D08| +---+---+---+---+---+---+---+---+ 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 Mainly changes of v2 are addressing the comments from Tomasz, Bingbu, Andy, including, - Use i2c_smbus_write_byte_data/i2c_smbus_write_block_data to write I2C register - Adopt the runtime PM suspend/resume callbacks to powering 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 redundant 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.txt | 9 + MAINTAINERS | 8 + drivers/media/i2c/Kconfig | 10 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/dw9768.c | 349 +++++++++++++++++++++ 5 files changed, 377 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/i2c/dongwoon,dw9768.txt create mode 100644 drivers/media/i2c/dw9768.c -- 2.9.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel