From patchwork Fri Jun 5 10:54:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongchun Zhu X-Patchwork-Id: 1304062 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=mediatek.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=mediatek.com header.i=@mediatek.com header.a=rsa-sha256 header.s=dk header.b=bydpq7m6; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49dfhn3FLvz9sT8 for ; Fri, 5 Jun 2020 20:56:25 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726791AbgFEK4Y (ORCPT ); Fri, 5 Jun 2020 06:56:24 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:6959 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726507AbgFEK4Y (ORCPT ); Fri, 5 Jun 2020 06:56:24 -0400 X-UUID: 6b189767abc54e5e8cd9283870a18f2d-20200605 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=RDATlCMt7JAqD+s3CrHj64evnMGc2HkPNIFyTmwdTd4=; b=bydpq7m6/IV+fpJlBB24jPrmNyLK5ps2k5juGN/wZpfUOpHqAX9+kohzL3Q2JTkVociC55b5aFU9vA8wrFpTvXo6pZiX//9SUF3F6X0qPk2eGEhkDOwwkHdmsI30O2xSCq7NPnm4cQoz9OU+rKYgcVixYfT0RXB6ols+lM+K9Es=; X-UUID: 6b189767abc54e5e8cd9283870a18f2d-20200605 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1896889789; Fri, 05 Jun 2020 18:56:21 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 5 Jun 2020 18:56:18 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 5 Jun 2020 18:56:15 +0800 From: Dongchun Zhu To: , , , , , , , , , , CC: , , , , , , , , Subject: [V7, 0/2] media: i2c: Add support for DW9768 VCM driver Date: Fri, 5 Jun 2020 18:54:10 +0800 Message-ID: <20200605105412.18813-1-dongchun.zhu@mediatek.com> X-Mailer: git-send-email 2.9.2 MIME-Version: 1.0 X-MTK: N Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hello, This series adds DT bindings and V4L2 sub-device driver for Dongwoon's DW9768, which is a 10-bit DAC with 100mA output current sink capability. The driver 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: v6: https://lore.kernel.org/linux-media/20200518132731.20855-1-dongchun.zhu@mediatek.com/ 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 v7 are addressing comments from Rob, Sakari, Tomasz. Compared to v6: - Refine DT bindings - Use i2c_smbus_read_byte_data() directly to replace of dw9768_read_smbus() - Calculate operation time based on the configured board-specific DT settings - Abstract async register error handling case - Fix other review comments in v6 Please 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 | 100 ++++ MAINTAINERS | 8 + drivers/media/i2c/Kconfig | 13 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/dw9768.c | 566 +++++++++++++++++++++ 5 files changed, 688 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/i2c/dongwoon,dw9768.yaml create mode 100644 drivers/media/i2c/dw9768.c