From patchwork Fri Oct 15 08:35:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kepplinger X-Patchwork-Id: 12560825 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E416C433F5 for ; Fri, 15 Oct 2021 09:04:24 +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 653F56109E for ; Fri, 15 Oct 2021 09:04:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 653F56109E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=puri.sm Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eixhHUWEZO/SKqqFgjaxJf6l4ana5liHXQws85TKTpY=; b=tJBXCbSG0sgb1B d4AV38BGvL/PUO7saXleyIMmjOU6n/lQT8ZiYnzTJ9kXmKTITgN2WCtU9cdamPs2yXeiIOsrOulcb o3vEq0/e1azf2E/PeoLAQlAFcFHZh4odatH0c/QCBgL+5fTxoOk91gUZMPd6BJx5OqfdJlJitSxGI dZiHK0AHejxlkM14F0srPosfyG9MmkABnQZaZIxWMTozV+d2/6pKDy4gNwudKlCerbrc9Jr+gv8ht LoTCBXxQmiNZJebUzdVT7kFoXNr0PtoN7YOmFKAenWGYhNC7shBNl74d3N8Vv7bF/zgVbH6Zl3+aS pqKv/jjO64/orxbPaXAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbJ6u-0068zz-6C; Fri, 15 Oct 2021 09:02:40 +0000 Received: from comms.puri.sm ([159.203.221.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbIhI-0061pJ-04 for linux-arm-kernel@lists.infradead.org; Fri, 15 Oct 2021 08:36:13 +0000 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id 8698EDFE40; Fri, 15 Oct 2021 01:36:11 -0700 (PDT) Received: from comms.puri.sm ([127.0.0.1]) by localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KTQfCWuuvvJJ; Fri, 15 Oct 2021 01:36:10 -0700 (PDT) From: Martin Kepplinger To: robh@kernel.org, shawnguo@kernel.org, festevam@gmail.com, krzk@kernel.org Cc: kernel@pengutronix.de, linux-imx@nxp.com, kernel@puri.sm, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, Martin Kepplinger Subject: [RFC PATCH v1 2/4] arm64: dts: imx8mq-librem5: describe power supply for cameras Date: Fri, 15 Oct 2021 10:35:04 +0200 Message-Id: <20211015083506.4182875-3-martin.kepplinger@puri.sm> In-Reply-To: <20211015083506.4182875-1-martin.kepplinger@puri.sm> References: <20211015083506.4182875-1-martin.kepplinger@puri.sm> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211015_013612_130336_D18A2234 X-CRM114-Status: GOOD ( 17.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org CAMERA_PWR_EN controls two different power supplies that cameras will use. The hardware killswitch controls a third one. Describe that appropriately. The pinctrl that describes the gpio that is used in 2 places here is added to the pmic. The pmic is powered early enough to make sure this will work. this patch is not ideal and hence an RFC I'm not yet signing-off on: When putting the same pinctrl property into the 2 regulator nodes (instead of the pmic), we get: imx8mq-pinctrl 30330000.pinctrl: pin MX8MQ_IOMUXC_GPIO1_IO00 already requested by regulator-csi-1v8; cannot claim for regulator-vcam-2v8 imx8mq-pinctrl 30330000.pinctrl: pin-10 (regulator-vcam-2v8) status -22 imx8mq-pinctrl 30330000.pinctrl: could not request pin 10 (MX8MQ_IOMUXC_GPIO1_IO00) from group camerapwrgrp on device 30330000.pinctrl so that's a limitation to use the pinctrl only in one place. Is that intended or am I missing something? The one other possibility I see is to add *another* regulator that looks something like so - that would be the only one controlling the gpio and having the pinctrl property: reg_camera_pwr_en: regulator-camera-pwr-en { compatible = "regulator-fixed"; regulator-name = "CAMERA_PWR_EN"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_camera_pwr>; gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>; enable-active-high; }; and the regulators I actually *want* to describe would all include vin-supply = <®_camera_pwr_en>; My problem with that alternative is that I basically describe a regulator that doesn't really exist in hardware. Do you know what's the prefererred way to describe our hardware here? thank you very much! martin --- .../boot/dts/freescale/imx8mq-librem5.dtsi | 50 ++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi b/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi index 3f7524400a63..c385f9e0d5f7 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi @@ -60,6 +60,40 @@ reg_aud_1v8: regulator-audio-1v8 { enable-active-high; }; + /* + * the pinctrl for reg_csi_1v8 and reg_vcam_1v8 is added to the PMIC + * since we can't have it twice in the 2 different regulator nodes. + */ + reg_csi_1v8: regulator-csi-1v8 { + compatible = "regulator-fixed"; + regulator-name = "CAMERA_VDDIO_1V8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <®_vdd_3v3>; + gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + + /* controlled by the CAMERA_POWER_KEY HKS */ + reg_vcam_1v2: regulator-vcam-1v2 { + compatible = "regulator-fixed"; + regulator-name = "CAMERA_VDDD_1V2"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + vin-supply = <®_vdd_1v8>; + enable-active-high; + }; + + reg_vcam_2v8: regulator-vcam-2v8 { + compatible = "regulator-fixed"; + regulator-name = "CAMERA_VDDA_2V8"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + vin-supply = <®_vdd_3v3>; + gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + reg_gnss: regulator-gnss { compatible = "regulator-fixed"; pinctrl-names = "default"; @@ -307,6 +341,20 @@ MX8MQ_IOMUXC_NAND_DQS_GPIO3_IO14 0x83 >; }; + pinctrl_camera_pwr: camerapwrgrp { + fsl,pins = < + /* CAMERA_PWR_EN_3V3 */ + MX8MQ_IOMUXC_GPIO1_IO00_GPIO1_IO0 0x83 + >; + }; + + pinctrl_csi1: csi1grp { + fsl,pins = < + /* CSI1_NRST */ + MX8MQ_IOMUXC_ENET_RXC_GPIO1_IO25 0x83 + >; + }; + pinctrl_charger_in: chargeringrp { fsl,pins = < /* CHRG_INT */ @@ -689,7 +737,7 @@ pmic: pmic@4b { compatible = "rohm,bd71837"; reg = <0x4b>; pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_pmic>; + pinctrl-0 = <&pinctrl_pmic>, <&pinctrl_camera_pwr>; clocks = <&pmic_osc>; clock-names = "osc"; clock-output-names = "pmic_clk";