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=-11.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 96039C47255 for ; Mon, 11 May 2020 18:29:19 +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 6AF3720720 for ; Mon, 11 May 2020 18:29:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LGYbmD/z"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="hIfm5XW0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6AF3720720 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org 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:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ezHM7OqqTUEjgcNeeEqU298fj4xmXx7HwReFnJfFywA=; b=LGYbmD/zBBQWZ3 aMulQNGm1TOKMv3uIKQEeUqZLuN8tB02JxyPVHOFsJiSoR2tGwHJ4nyU4ULJsvOBXaJG2vgKgVyT6 RSzSHooRRYPLplOfGv0uBy3LzStmtXv7gYC8zpoSda0AHP4OHuiIdbYWRWUdZwgi1B5g/81PfaSAB BKDy8Ay0LxvqIqq4lXI2a8nDc4IfMnCrBJ55EAbH/vzTpauRcnkIcymMoFmXu+92sPSHiZL2CcoTa EXTvYg/KsDNraAa6nGV8MbyyXaQzfdh9kpvEPqJqpnv+AC19Yeb1aE+1gCJekxAAmJV/QvS7Yz56t PvIx9uJBlizlfJoCMFhA==; 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 1jYDB0-0000Ff-6H; Mon, 11 May 2020 18:29:18 +0000 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYDAu-0000Ec-Vu for linux-arm-kernel@lists.infradead.org; Mon, 11 May 2020 18:29:16 +0000 Received: by mail-ej1-x643.google.com with SMTP id nv1so8793010ejb.0 for ; Mon, 11 May 2020 11:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OlqMdCMv0t/jRFbvfx2oiVLxVGugmb8g6QsmrVI+x40=; b=hIfm5XW0NJEV60vNfF8m9alVsS2fZRz6bIMQxJc9+l0ft7pd3yuzq7Ggag4EvcoDjF uivi1BEPMuakJuVa1qTd6SM7jnMbr/A1mNEALhgep3z68K+eiXFsIbgL+g1SubhgV8LU jm7+kTa2GUdeE/H112fn0XfelirZ8uoNHW36A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OlqMdCMv0t/jRFbvfx2oiVLxVGugmb8g6QsmrVI+x40=; b=e/5Qfrmfs3Db0LHGiQjMY3UAvojDvXto8/bO3IBNlSEQAq+CwROdh5HPAp5+f75CTF XAWYxV+zSkLdCTrXriboNRgoJ6G2PWXrzbCbjdaD3e9Gn5+rS6T0GNbVqLNlkjSb49AZ aWCD4UKINlDhALXYwuj6KkEr925ELKKL6pFcFMA/3axewKoMIJifh4aJfY5udEX/q8W7 E1belEezU0gLdLdJk7bjT4gIIwruwkqim99ZUo8RhXGNU3OORVi+ohhM4OlYCNwpMA9h g8/8wzTZHiF04tXJZp2W4fvvqOQrYbDX3Tu7GVHTddnY2Hiz21zaxqJiplOcjF75OgW5 kAFg== X-Gm-Message-State: AGi0PuaE2Zi77k/Oj1/bRA2WC8CF61qweK4x/eMB9Yogy+0N8JERdnpx X1qb/ejNmgVYnKeRVQ7BelWZ5WNPS0EW2g== X-Google-Smtp-Source: APiQypIHCr7Cdj7BuoKF2GEEej6NXWK45p8RPKPeDWLB+oR58ze/4DxDIsFfFVaB5DYuqt0kux+YHQ== X-Received: by 2002:a17:907:214f:: with SMTP id rk15mr14817955ejb.301.1589221751046; Mon, 11 May 2020 11:29:11 -0700 (PDT) Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com. [209.85.218.48]) by smtp.gmail.com with ESMTPSA id c15sm642399ejx.62.2020.05.11.11.29.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 May 2020 11:29:10 -0700 (PDT) Received: by mail-ej1-f48.google.com with SMTP id s21so662809ejd.2 for ; Mon, 11 May 2020 11:29:10 -0700 (PDT) X-Received: by 2002:adf:e543:: with SMTP id z3mr18352165wrm.385.1589221272587; Mon, 11 May 2020 11:21:12 -0700 (PDT) MIME-Version: 1.0 References: <20200502161727.30463-1-dongchun.zhu@mediatek.com> <20200502161727.30463-3-dongchun.zhu@mediatek.com> <20200506151352.GZ9190@paasikivi.fi.intel.com> <1588855524.8804.168.camel@mhfsdcap03> <20200507131220.GC9190@paasikivi.fi.intel.com> <1588907288.8804.188.camel@mhfsdcap03> <20200508211319.GJ9190@paasikivi.fi.intel.com> <1588991026.8804.235.camel@mhfsdcap03> In-Reply-To: <1588991026.8804.235.camel@mhfsdcap03> From: Tomasz Figa Date: Mon, 11 May 2020 20:20:59 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [V5, 2/2] media: i2c: dw9768: Add DW9768 VCM driver To: Dongchun Zhu X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200511_112913_055901_3C6BE2D8 X-CRM114-Status: GOOD ( 35.75 ) 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: Mark Rutland , Nicolas Boichat , Andy Shevchenko , srv_heupstream , linux-devicetree , Linus Walleij , =?UTF-8?B?U2hlbmduYW4gV2FuZyAo546L5Zyj55S3KQ==?= , Louis Kuo , Bartosz Golaszewski , Sj Huang , Rob Herring , "moderated list:ARM/Mediatek SoC support" , Sakari Ailus , Matthias Brugger , Cao Bing Bu , Mauro Carvalho Chehab , "list@263.net:IOMMU DRIVERS , Joerg Roedel , " , Linux Media Mailing List 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 Hi Dongchun, On Sat, May 9, 2020 at 4:25 AM Dongchun Zhu wrote: > > Hi Sakari, > > On Sat, 2020-05-09 at 00:13 +0300, Sakari Ailus wrote: > > Hi Dongchun, > > > > On Fri, May 08, 2020 at 11:08:08AM +0800, Dongchun Zhu wrote: > > > Hi Sakari, Tomasz, > > > > > > Thanks for the review. > > > > > > On Thu, 2020-05-07 at 15:46 +0200, Tomasz Figa wrote: > > > > Hi Sakari, Dongchun, > > > > > > > > On Thu, May 7, 2020 at 3:12 PM Sakari Ailus > > > > wrote: > > > > > > > > > > HI Dongchun, > > > > > > > > > > On Thu, May 07, 2020 at 08:45:24PM +0800, Dongchun Zhu wrote: > > > > > > Hi Sakari, > > > > > > > > > > > > Thanks for the review. > > > > > > > > > > > > On Wed, 2020-05-06 at 18:13 +0300, Sakari Ailus wrote: > > > > > > > Hi Dongchun, > > > > > > > > > > > > > > On Sun, May 03, 2020 at 12:17:27AM +0800, Dongchun Zhu wrote: > > > > > > > > Add a V4L2 sub-device driver for DW9768 voice coil motor, providing > > > > > > > > control to set the desired focus via IIC serial interface. > > > > > > > > > > > > > > > > Signed-off-by: Dongchun Zhu > > > > > > > > --- > > > > > > > > MAINTAINERS | 1 + > > > > > > > > drivers/media/i2c/Kconfig | 11 ++ > > > > > > > > drivers/media/i2c/Makefile | 1 + > > > > > > > > drivers/media/i2c/dw9768.c | 440 +++++++++++++++++++++++++++++++++++++++++++++ > > > > > > > > 4 files changed, 453 insertions(+) > > > > > > > > create mode 100644 drivers/media/i2c/dw9768.c > > > > > > > > > > > > > > > > diff --git a/MAINTAINERS b/MAINTAINERS > > > > > > > > index 8d72c41..c92dc99 100644 > > > > > > > > --- a/MAINTAINERS > > > > > > > > +++ b/MAINTAINERS > > > > > > > > @@ -5157,6 +5157,7 @@ L: linux-media@vger.kernel.org > > > > > > > > S: Maintained > > > > > > > > T: git git://linuxtv.org/media_tree.git > > > > > > > > F: Documentation/devicetree/bindings/media/i2c/dongwoon,dw9768.yaml > > > > > > > > +F: drivers/media/i2c/dw9768.c > > > > > > > > > > > > > > > > DONGWOON DW9807 LENS VOICE COIL DRIVER > > > > > > > > M: Sakari Ailus > > > > > > > > diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig > > > > > > > > index 125d596..6a3f9da 100644 > > > > > > > > --- a/drivers/media/i2c/Kconfig > > > > > > > > +++ b/drivers/media/i2c/Kconfig > > > > > > > > @@ -1040,6 +1040,17 @@ config VIDEO_DW9714 > > > > > > > > capability. This is designed for linear control of > > > > > > > > voice coil motors, controlled via I2C serial interface. > > > > > > > > > > > > > > > > +config VIDEO_DW9768 > > > > > > > > + tristate "DW9768 lens voice coil support" > > > > > > > > + depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER > > > > > > > > + depends on VIDEO_V4L2_SUBDEV_API > > > > > > > > > > > > > > Please check how this works in the media tree master branch now --- it's > > > > > > > largely select based. > > > > > > > > > > > > > > > > > > > The actuator driver uses some structures that require the > > > > > > VIDEO_V4L2_SUBDEV_API code, so here we add VIDEO_V4L2_SUBDEV_API > > > > > > dependency to avoid possible build error when it's not enabled. > > > > > > > > > > Please make sure this works with current media tree master. Right now it > > > > > does not. > > > > > > > > > > > > > Dongchun, as Sakari said, please make sure to base the patches on the > > > > master branch of the media tree. > > > > (https://git.linuxtv.org/media_tree.git/). The approach for Kconfig > > > > dependency selection there seems to have changed recently. > > > > > > > > > > I searched the patches on the media tree master branch. > > > It seems that we need to remove the VIDEO_V4L2_SUBDEV_API dependency in > > > Kconfig, and add #ifdef CONFIG_VIDEO_V4L2_SUBDEV_API to include > > > v4l2-subdev code. > > > The change mainly is to make build pass, and don't return ENOTTY if > > > SUBDEV_API is not set. > > > Am I right? > > > > Please see Kconfig entries for other similar drivers from Dongwoon. > > > > Sorry for the mistake :-) > Just found the current media tree master branch code... > I would update Kconfig entries in next release by referring to: > https://git.linuxtv.org/media_tree.git/tree/drivers/media/i2c/Kconfig Sorry for last minute comments again. We had a short discussion offline with Sakari and we think there are some changes needed to this driver, namely: 1) The hardware being driven in our case is a gt9769, which could be compatible with dw9768, but it's still a different implementation and could have slightly different characteristics. Thus we think the driver name and compatible strings should be renamed from dongwoon,dw9768 to giantec,gt9769. In the future, if there is a device with exactly a dw9768 chip, the same driver could be reused by adding a dongwoon,dw9768 compatible string. 2) The chip has some default configuration, which is lost because the driver overrides it with its own values. For use cases where one would want to keep the default values, we should make it possible to prevent the driver from overriding them. We could achieve this by adding optional DT properties for the custom parameters and if they are not present, defaults would be used. Do you think that is doable? Thanks! Best regards, Tomasz _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel