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=-10.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 7FF49C38A2A for ; Wed, 6 May 2020 12:26:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 673F5206DB for ; Wed, 6 May 2020 12:26:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728106AbgEFM0g (ORCPT ); Wed, 6 May 2020 08:26:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725985AbgEFM0f (ORCPT ); Wed, 6 May 2020 08:26:35 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86413C061A0F for ; Wed, 6 May 2020 05:26:35 -0700 (PDT) Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.lab.pengutronix.de) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jWJ84-0004dl-4N; Wed, 06 May 2020 14:26:24 +0200 Received: from mfe by dude02.lab.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1jWJ80-0008SB-9H; Wed, 06 May 2020 14:26:20 +0200 Date: Wed, 6 May 2020 14:26:20 +0200 From: Marco Felsch To: Robert Foss Cc: Dongchun Zhu , Tomasz Figa , Andy Shevchenko , Sakari Ailus , Maxime Ripard , linux-media , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-kernel , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , Fabio Estevam , Ben Kao , Maxime Ripard Subject: Re: [PATCH v10 1/3] media: dt-bindings: ov8856: Document YAML bindings Message-ID: <20200506122620.GN18755@pengutronix.de> References: <20200505100129.104673-1-robert.foss@linaro.org> <20200505100129.104673-2-robert.foss@linaro.org> <1588679279.8804.133.camel@mhfsdcap03> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 14:15:18 up 74 days, 23:32, 107 users, load average: 0.43, 0.98, 4.24 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20-05-06 13:29, Robert Foss wrote: > Hey Dongchun, > > Thanks for having a look at this series. > > > > +examples: > > > + - | > > > + #include > > > + > > > + i2c { > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + > > > + ov8856: camera@10 { > > > + compatible = "ovti,ov8856"; > > > + reg = <0x10>; > > > + > > > + reset-gpios = <&pio 111 GPIO_ACTIVE_LOW>; > > > > Apologies for missing to follow the earlier discussion related to this. > > I noticed the GPIO flag para and __ov8856_power_on() are aligned using > > ACTIVE_LOW. > > > > But from the datasheet, XSHUTDN pin is active-high for OV8856. > > It means devm_gpiod_get API (in probe func) should use GPIOD_OUT_LOW to > > initialize the GPIO as output with a value of 0. > > Otherwise it should use GPIOD_OUT_HIGH. > > > > There is one case for GPIO_ACTIVE_LOW setting: > > https://patchwork.linuxtv.org/patch/63460/ > > https://patchwork.linuxtv.org/patch/63461/ > > We went back and forth about this a few times, and I switched to this > gpio setting after having worked through the device probing reset gpio > toggling. Semantically it seemed easier to understand in the driver, > since the gpio is called reset and not !shutdown. IMHO you can keep your version. DTs are part of the system integration. What if one system has a invert logic infront of the gpio input.. The system integrator needs to read and to understand the schematic correctly to pick the correct value. > Looking into devm_gpiod_get_optional(), the flag argument > GPIOD_OUT_LOW or HIGH for that matter is actually not used initialize The good think about gpiod is that it care about logic values not physical/electrical values. If you set GPIOD_OUT_HIGH then the reset is asserted, whatever asserted means electrical. Regards, Marco > the output, but only used for an exclusivity check. > https://elixir.bootlin.com/linux/latest/source/drivers/gpio/gpiolib-devres.c#L109 > > If you prefer, I can invert the logic again. To me making the reset > gpio active resulting in the device being actually reset seems like > the most intuitive and easy to understand option. > The different OmniVision drivers seem to have different approaches to > this. The ov9640 driver for example is doing what this series > currently is doing. > > > > > Sakari, Tomasz, am I right? > > > > > + pinctrl-names = "default"; > > > + pinctrl-0 = <&clk_24m_cam>; > > > + > > > + clocks = <&cam_osc>; > > > + clock-names = "xvclk"; > > > + clock-frequency = <19200000>; > > > + > > > + avdd-supply = <&mt6358_vcama2_reg>; > > > + dvdd-supply = <&mt6358_vcamd_reg>; > > > + dovdd-supply = <&mt6358_vcamio_reg>; > > > + > > > + port { > > > + wcam_out: endpoint { > > > + remote-endpoint = <&mipi_in_wcam>; > > > + data-lanes = <1 2 3 4>; > > > + link-frequencies = /bits/ 64 <360000000>; > > > + }; > > > + }; > > > + }; > > > + }; > > > +... > > > \ No newline at end of file > > > diff --git a/MAINTAINERS b/MAINTAINERS > > > index 26f281d9f32a..84b262afd13d 100644 > > > --- a/MAINTAINERS > > > +++ b/MAINTAINERS > > > @@ -12489,6 +12489,7 @@ L: linux-media@vger.kernel.org > > > S: Maintained > > > T: git git://linuxtv.org/media_tree.git > > > F: drivers/media/i2c/ov8856.c > > > +F: Documentation/devicetree/bindings/media/i2c/ov8856.yaml > > > > > > > Had you run parse-maintainers.pl? > > The new item is supposed to be arranged in alphabetical order. > > No, I have not. But upon running it now, it doesn't make suggest any > changes. But let me order the files manually in the next revision. > > However, I noticed I removed the wrong person from the maintainers > file in this revision. > So, I'll correct that and add you Dongchun as the maintainer if that's ok. > > > > > > OMNIVISION OV9640 SENSOR DRIVER > > > M: Petr Cvek > > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | 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=-10.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 B458AC28CBC for ; Wed, 6 May 2020 12:26:43 +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 908AD20736 for ; Wed, 6 May 2020 12:26:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jUT4W/sZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 908AD20736 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de 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=ECWI3yiYRl2xEKh/Bd16tPfCT2p+6HclQLk87dT20KM=; b=jUT4W/sZ4VRGB2 bekNfeDCHVPQvxzFkAVJXkCTQjkMUAu3jZ6dht7rXpA4tmWChtCEsHRQEjpjxL4NvdF+MDg1gxNNa XobteyikjgrTuIvcacj6YMwDj4USxZRh+QnZd0vVk+M7Lq2WhtdBtrJlVYf1+dOHap4sZu3md3Vmk OeKWknlxfW4Pf3lC0YMnN8Dm8tuFOmmzJmn2yZBmxjSj5kMc/6KGlZgXW3Tn50m9ttgWeOnb9O3Jf KPxkcJhuuvIRO5U4MiDjym+9EqpeIzHm6qKYh39X6PWnBhp5UnBYIENXVFuQpn5h3JSJNk1XjyGm4 5Wc+lR7UyLmpxckwndCw==; 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 1jWJ8M-0005PF-0q; Wed, 06 May 2020 12:26:42 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWJ8I-0005OE-G8 for linux-arm-kernel@lists.infradead.org; Wed, 06 May 2020 12:26:40 +0000 Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.lab.pengutronix.de) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jWJ84-0004dl-4N; Wed, 06 May 2020 14:26:24 +0200 Received: from mfe by dude02.lab.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1jWJ80-0008SB-9H; Wed, 06 May 2020 14:26:20 +0200 Date: Wed, 6 May 2020 14:26:20 +0200 From: Marco Felsch To: Robert Foss Subject: Re: [PATCH v10 1/3] media: dt-bindings: ov8856: Document YAML bindings Message-ID: <20200506122620.GN18755@pengutronix.de> References: <20200505100129.104673-1-robert.foss@linaro.org> <20200505100129.104673-2-robert.foss@linaro.org> <1588679279.8804.133.camel@mhfsdcap03> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 14:15:18 up 74 days, 23:32, 107 users, load average: 0.43, 0.98, 4.24 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200506_052638_536238_BFF70892 X-CRM114-Status: GOOD ( 25.93 ) 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: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Maxime Ripard , linux-kernel , Maxime Ripard , Tomasz Figa , Ben Kao , Sakari Ailus , Dongchun Zhu , Andy Shevchenko , Fabio Estevam , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-media 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 On 20-05-06 13:29, Robert Foss wrote: > Hey Dongchun, > > Thanks for having a look at this series. > > > > +examples: > > > + - | > > > + #include > > > + > > > + i2c { > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + > > > + ov8856: camera@10 { > > > + compatible = "ovti,ov8856"; > > > + reg = <0x10>; > > > + > > > + reset-gpios = <&pio 111 GPIO_ACTIVE_LOW>; > > > > Apologies for missing to follow the earlier discussion related to this. > > I noticed the GPIO flag para and __ov8856_power_on() are aligned using > > ACTIVE_LOW. > > > > But from the datasheet, XSHUTDN pin is active-high for OV8856. > > It means devm_gpiod_get API (in probe func) should use GPIOD_OUT_LOW to > > initialize the GPIO as output with a value of 0. > > Otherwise it should use GPIOD_OUT_HIGH. > > > > There is one case for GPIO_ACTIVE_LOW setting: > > https://patchwork.linuxtv.org/patch/63460/ > > https://patchwork.linuxtv.org/patch/63461/ > > We went back and forth about this a few times, and I switched to this > gpio setting after having worked through the device probing reset gpio > toggling. Semantically it seemed easier to understand in the driver, > since the gpio is called reset and not !shutdown. IMHO you can keep your version. DTs are part of the system integration. What if one system has a invert logic infront of the gpio input.. The system integrator needs to read and to understand the schematic correctly to pick the correct value. > Looking into devm_gpiod_get_optional(), the flag argument > GPIOD_OUT_LOW or HIGH for that matter is actually not used initialize The good think about gpiod is that it care about logic values not physical/electrical values. If you set GPIOD_OUT_HIGH then the reset is asserted, whatever asserted means electrical. Regards, Marco > the output, but only used for an exclusivity check. > https://elixir.bootlin.com/linux/latest/source/drivers/gpio/gpiolib-devres.c#L109 > > If you prefer, I can invert the logic again. To me making the reset > gpio active resulting in the device being actually reset seems like > the most intuitive and easy to understand option. > The different OmniVision drivers seem to have different approaches to > this. The ov9640 driver for example is doing what this series > currently is doing. > > > > > Sakari, Tomasz, am I right? > > > > > + pinctrl-names = "default"; > > > + pinctrl-0 = <&clk_24m_cam>; > > > + > > > + clocks = <&cam_osc>; > > > + clock-names = "xvclk"; > > > + clock-frequency = <19200000>; > > > + > > > + avdd-supply = <&mt6358_vcama2_reg>; > > > + dvdd-supply = <&mt6358_vcamd_reg>; > > > + dovdd-supply = <&mt6358_vcamio_reg>; > > > + > > > + port { > > > + wcam_out: endpoint { > > > + remote-endpoint = <&mipi_in_wcam>; > > > + data-lanes = <1 2 3 4>; > > > + link-frequencies = /bits/ 64 <360000000>; > > > + }; > > > + }; > > > + }; > > > + }; > > > +... > > > \ No newline at end of file > > > diff --git a/MAINTAINERS b/MAINTAINERS > > > index 26f281d9f32a..84b262afd13d 100644 > > > --- a/MAINTAINERS > > > +++ b/MAINTAINERS > > > @@ -12489,6 +12489,7 @@ L: linux-media@vger.kernel.org > > > S: Maintained > > > T: git git://linuxtv.org/media_tree.git > > > F: drivers/media/i2c/ov8856.c > > > +F: Documentation/devicetree/bindings/media/i2c/ov8856.yaml > > > > > > > Had you run parse-maintainers.pl? > > The new item is supposed to be arranged in alphabetical order. > > No, I have not. But upon running it now, it doesn't make suggest any > changes. But let me order the files manually in the next revision. > > However, I noticed I removed the wrong person from the maintainers > file in this revision. > So, I'll correct that and add you Dongchun as the maintainer if that's ok. > > > > > > OMNIVISION OV9640 SENSOR DRIVER > > > M: Petr Cvek > > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel