From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Subject: Re: [V2, 2/2] media: i2c: Add DW9768 VCM driver Date: Thu, 5 Sep 2019 14:36:38 +0300 Message-ID: <20190905113638.GE2680@smile.fi.intel.com> References: <20190905072142.14606-1-dongchun.zhu@mediatek.com> <20190905072142.14606-3-dongchun.zhu@mediatek.com> <20190905082134.GY5475@paasikivi.fi.intel.com> <20190905101908.GB2680@smile.fi.intel.com> <20190905104001.GZ5475@paasikivi.fi.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Javier Martinez Canillas Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, drinkcat@chromium.org, srv_heupstream@mediatek.com, sam.hung@mediatek.com, shengnan.wang@mediatek.com, tfiga@chromium.org, sj.huang@mediatek.com, robh+dt@kernel.org, linux-mediatek@lists.infradead.org, dongchun.zhu@mediatek.com, Sakari Ailus , matthias.bgg@gmail.com, bingbu.cao@intel.com, mchehab@kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org List-Id: devicetree@vger.kernel.org On Thu, Sep 05, 2019 at 12:57:34PM +0200, Javier Martinez Canillas wrote: > On 9/5/19 12:40 PM, Sakari Ailus wrote: > > On Thu, Sep 05, 2019 at 01:19:08PM +0300, Andy Shevchenko wrote: > >> On Thu, Sep 05, 2019 at 11:21:34AM +0300, Sakari Ailus wrote: > >>> On Thu, Sep 05, 2019 at 03:21:42PM +0800, dongchun.zhu@mediatek.com w= rote: > >>>> From: Dongchun Zhu > >> > >>>> +static const struct i2c_device_id dw9768_id_table[] =3D { > >>>> + { DW9768_NAME, 0 }, > >>>> + { }, > >>> > >>> Could you drop the I=B2C ID table? > >> > >> But why? > >> It will allow you to instanciate the device from user space. > = > Yes, the I2C device table is still needed if the device can be instantiat= ed > from user-space using the sysfs interface, or otherwise the module won't = be > automatically loaded. > = > Kieran posted a "[PATCH RFC] modpost: Support I2C Aliases from OF tables" > patch that adds a MODULE_DEVICE_TABLE(i2c_of, ..) macro so modpost could > add legacy I2C modalias using the information in the OF device ID tables: > = > https://patchwork.kernel.org/patch/11038861/ > = > If that lands, then we could get rid of the I2C device tables altogether > for non-legacy I2C drivers. > = > > = > > The device is supposed to be present in DT (or ACPI tables) already. > > > = > Agreed. Also by looking at the driver's probe function I see that the > device lookups a 'vin' and 'vdd' regulators supplies and it fails if > aren't defined, so it can't be instantiated from user-space anyways. Thank you for clarifications! So, it can use ->probe_new() in that case. > = > BTW, these two regulators supplies should be listed as 'vin-supply' > and 'vdd-supply' as required properties in the DT binding document. -- = With Best Regards, Andy Shevchenko 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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 9C127C3A5A5 for ; Thu, 5 Sep 2019 11:36:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7C77522CF5 for ; Thu, 5 Sep 2019 11:36:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388593AbfIELgr (ORCPT ); Thu, 5 Sep 2019 07:36:47 -0400 Received: from mga18.intel.com ([134.134.136.126]:54537 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732712AbfIELgr (ORCPT ); Thu, 5 Sep 2019 07:36:47 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2019 04:36:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,470,1559545200"; d="scan'208";a="207841709" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga004.fm.intel.com with ESMTP; 05 Sep 2019 04:36:40 -0700 Received: from andy by smile with local (Exim 4.92.1) (envelope-from ) id 1i5q46-0007Dt-Tq; Thu, 05 Sep 2019 14:36:38 +0300 Date: Thu, 5 Sep 2019 14:36:38 +0300 From: Andy Shevchenko To: Javier Martinez Canillas Cc: Sakari Ailus , dongchun.zhu@mediatek.com, mchehab@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, drinkcat@chromium.org, tfiga@chromium.org, matthias.bgg@gmail.com, bingbu.cao@intel.com, srv_heupstream@mediatek.com, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, sj.huang@mediatek.com, linux-media@vger.kernel.org, devicetree@vger.kernel.org, sam.hung@mediatek.com, shengnan.wang@mediatek.com Subject: Re: [V2, 2/2] media: i2c: Add DW9768 VCM driver Message-ID: <20190905113638.GE2680@smile.fi.intel.com> References: <20190905072142.14606-1-dongchun.zhu@mediatek.com> <20190905072142.14606-3-dongchun.zhu@mediatek.com> <20190905082134.GY5475@paasikivi.fi.intel.com> <20190905101908.GB2680@smile.fi.intel.com> <20190905104001.GZ5475@paasikivi.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Thu, Sep 05, 2019 at 12:57:34PM +0200, Javier Martinez Canillas wrote: > On 9/5/19 12:40 PM, Sakari Ailus wrote: > > On Thu, Sep 05, 2019 at 01:19:08PM +0300, Andy Shevchenko wrote: > >> On Thu, Sep 05, 2019 at 11:21:34AM +0300, Sakari Ailus wrote: > >>> On Thu, Sep 05, 2019 at 03:21:42PM +0800, dongchun.zhu@mediatek.com wrote: > >>>> From: Dongchun Zhu > >> > >>>> +static const struct i2c_device_id dw9768_id_table[] = { > >>>> + { DW9768_NAME, 0 }, > >>>> + { }, > >>> > >>> Could you drop the I²C ID table? > >> > >> But why? > >> It will allow you to instanciate the device from user space. > > Yes, the I2C device table is still needed if the device can be instantiated > from user-space using the sysfs interface, or otherwise the module won't be > automatically loaded. > > Kieran posted a "[PATCH RFC] modpost: Support I2C Aliases from OF tables" > patch that adds a MODULE_DEVICE_TABLE(i2c_of, ..) macro so modpost could > add legacy I2C modalias using the information in the OF device ID tables: > > https://patchwork.kernel.org/patch/11038861/ > > If that lands, then we could get rid of the I2C device tables altogether > for non-legacy I2C drivers. > > > > > The device is supposed to be present in DT (or ACPI tables) already. > > > > Agreed. Also by looking at the driver's probe function I see that the > device lookups a 'vin' and 'vdd' regulators supplies and it fails if > aren't defined, so it can't be instantiated from user-space anyways. Thank you for clarifications! So, it can use ->probe_new() in that case. > > BTW, these two regulators supplies should be listed as 'vin-supply' > and 'vdd-supply' as required properties in the DT binding document. -- With Best Regards, Andy Shevchenko 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=-2.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 A2A17C3A5A5 for ; Thu, 5 Sep 2019 11:36:55 +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 75DC220825 for ; Thu, 5 Sep 2019 11:36:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MZLNwex8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75DC220825 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.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:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=P5vcnmXaUi51B0WoBdjJGOJY4cakk+7P9KoNLi6lXHM=; b=MZLNwex8BdgMsX 6ZvLSLH6VMkVjbJDwLaIOeeeQ//+NkGEcj9JJLXw7GsM8RFAlqrSRSL40pM2x9fNwEkmnFFIfQ8JD khNgFlCuQNbVa97UnVvVJMYgvNi/KpwaNuFiJGg68evxazWavyOSbjRCJ3KOSAO9g43AdSPPS75sA eqhEMXm2Urq4vTN+U2UVMAcjIuiTyL7dGvEMTxmwt4fDapNqSv8g0B3sI9vxAe/H1je8IQGUPtVF9 dVZ8stHpV2KbyO0n+sJpfwllWpsmWZUaeGIMl96O37LIJOcfKV9fFTBz4HKJuljXgOZW+lkMQeay3 ZNnRJ9nOXe1QTmKAMkcQ==; 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 1i5q4H-0002DF-Kf; Thu, 05 Sep 2019 11:36:49 +0000 Received: from mga05.intel.com ([192.55.52.43]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i5q4F-0002Ci-9X; Thu, 05 Sep 2019 11:36:48 +0000 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2019 04:36:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,470,1559545200"; d="scan'208";a="207841709" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga004.fm.intel.com with ESMTP; 05 Sep 2019 04:36:40 -0700 Received: from andy by smile with local (Exim 4.92.1) (envelope-from ) id 1i5q46-0007Dt-Tq; Thu, 05 Sep 2019 14:36:38 +0300 Date: Thu, 5 Sep 2019 14:36:38 +0300 From: Andy Shevchenko To: Javier Martinez Canillas Subject: Re: [V2, 2/2] media: i2c: Add DW9768 VCM driver Message-ID: <20190905113638.GE2680@smile.fi.intel.com> References: <20190905072142.14606-1-dongchun.zhu@mediatek.com> <20190905072142.14606-3-dongchun.zhu@mediatek.com> <20190905082134.GY5475@paasikivi.fi.intel.com> <20190905101908.GB2680@smile.fi.intel.com> <20190905104001.GZ5475@paasikivi.fi.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190905_043647_345891_C231EEE2 X-CRM114-Status: GOOD ( 16.28 ) 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@arm.com, devicetree@vger.kernel.org, drinkcat@chromium.org, srv_heupstream@mediatek.com, sam.hung@mediatek.com, shengnan.wang@mediatek.com, tfiga@chromium.org, sj.huang@mediatek.com, robh+dt@kernel.org, linux-mediatek@lists.infradead.org, dongchun.zhu@mediatek.com, Sakari Ailus , matthias.bgg@gmail.com, bingbu.cao@intel.com, mchehab@kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Sep 05, 2019 at 12:57:34PM +0200, Javier Martinez Canillas wrote: > On 9/5/19 12:40 PM, Sakari Ailus wrote: > > On Thu, Sep 05, 2019 at 01:19:08PM +0300, Andy Shevchenko wrote: > >> On Thu, Sep 05, 2019 at 11:21:34AM +0300, Sakari Ailus wrote: > >>> On Thu, Sep 05, 2019 at 03:21:42PM +0800, dongchun.zhu@mediatek.com w= rote: > >>>> From: Dongchun Zhu > >> > >>>> +static const struct i2c_device_id dw9768_id_table[] =3D { > >>>> + { DW9768_NAME, 0 }, > >>>> + { }, > >>> > >>> Could you drop the I=B2C ID table? > >> > >> But why? > >> It will allow you to instanciate the device from user space. > = > Yes, the I2C device table is still needed if the device can be instantiat= ed > from user-space using the sysfs interface, or otherwise the module won't = be > automatically loaded. > = > Kieran posted a "[PATCH RFC] modpost: Support I2C Aliases from OF tables" > patch that adds a MODULE_DEVICE_TABLE(i2c_of, ..) macro so modpost could > add legacy I2C modalias using the information in the OF device ID tables: > = > https://patchwork.kernel.org/patch/11038861/ > = > If that lands, then we could get rid of the I2C device tables altogether > for non-legacy I2C drivers. > = > > = > > The device is supposed to be present in DT (or ACPI tables) already. > > > = > Agreed. Also by looking at the driver's probe function I see that the > device lookups a 'vin' and 'vdd' regulators supplies and it fails if > aren't defined, so it can't be instantiated from user-space anyways. Thank you for clarifications! So, it can use ->probe_new() in that case. > = > BTW, these two regulators supplies should be listed as 'vin-supply' > and 'vdd-supply' as required properties in the DT binding document. -- = With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel