From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 24 May 2022 11:14:59 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ntQd1-007NOj-KD for lore@lore.pengutronix.de; Tue, 24 May 2022 11:14:59 +0200 Received: from bombadil.infradead.org ([2607:7c80:54:3::133]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntQd0-0001g3-6g for lore@pengutronix.de; Tue, 24 May 2022 11:14:59 +0200 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:References:In-Reply-To:Date:Subject:Cc: To:From:Message-ID:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=v0YbGnknVrtdcnw5u7VMtf/7sWNBYiPlzjYxPh9Xda4=; b=NrxM0yRXLCPXeE yOjKXdPJiydK7B+mtsq3C6BEWOsP2oDs/3bFk4jA+MvLQtpUoGNQhtEgYlsl0pM/FzZAgwg7MIRUp L1q5sVudaShDaoCxO+XciaETPu6LDigUI+9u3STUn4LQHgCUOscs9FZ03CXhQYHKgJZUilkLeAYVW VwOrj4piCvxSGlsrK6PXSeKswJ9GNNOw4yG9E4LDMINEzP66wdqFgbqla7PHNqMXLVk+rff7gxFNE Sy+ynOO/IelP06FPUP1QkHHggjbRZexNXaXWA5oDq1dbYj98D234FE8usC9Iq/MW071XQVyge1sVJ 1JpPnQqRRUsLvQnGHPqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntQbZ-007Ndp-OQ; Tue, 24 May 2022 09:13:29 +0000 Received: from mout.gmx.net ([212.227.17.20]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntQbT-007Nc1-VI for barebox@lists.infradead.org; Tue, 24 May 2022 09:13:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1653383588; bh=zjfMeVqRxfWZxkjW3s8m4nWJ/cM16UZrrxAboHIa/os=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=IVeGN0kiXmi2TwOMnbHE9L1nhx1wslPRn428h530vNsIxMjFwHUgmEDjBqF0Fc5Qu ZFXdiLTcyq5C0aQr2ueqoufLwHnNNt0sDDby+uzldZMg6JWxhTVdyZpxUHpJQRbUtY m+BjO/A7tAX/s/i8q1z0X/tCh0FqXeHQOl/qNonM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [80.245.78.120] ([80.245.78.120]) by web-mail.gmx.net (3c-app-gmx-bs50.server.lan [172.19.170.103]) (via HTTP); Tue, 24 May 2022 11:13:08 +0200 MIME-Version: 1.0 Message-ID: From: Frank Wunderlich To: Ahmad Fatoum Cc: Sascha Hauer , barebox@lists.infradead.org Date: Tue, 24 May 2022 11:13:08 +0200 Importance: normal Sensitivity: Normal In-Reply-To: References: <1694C0B0-A962-420E-BA70-8061E8E9CA7F@public-files.de> <20220519115450.GV25578@pengutronix.de> <20220519131019.GZ25578@pengutronix.de> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:3FGezPS5eEirKYlLchVCYoAgz99oHFB8EZ7VFqsA38dfBll4O4w6AP83UfCFcWbhRSaqz n7Ov0Y0v2vcJkQA0zzFsM1BZiOPk4SH7qUwMbIFQM4e738qM8aziir/AaJHUdu2bClPP5YJkj3FD 3jrgZdHbt3eL3sH0+H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heID: sfid-20220524_021324_573892_7FD448A5 X-CRM114-Status: GOOD ( 30.12 ) X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" X-SA-Exim-Connect-IP: 2607:7c80:54:3::133 X-SA-Exim-Mail-From: barebox-bounces+lore=pengutronix.de@lists.infradead.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-4.0 required=4.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Subject: Aw: Re: Re: Re: Driver load order X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on metis.ext.pengutronix.de) Hi, as far as i looked into the linux driver and the binding-conversion [1] i think adding those fields is not enough as the supply needs to be set from the upper values (vccX-supply) of the rk808 pmic. in core it seems that this recursion is not implemented yet (like the check for rdev->supply) from binding i mean this part: vcc1-supply: The input supply for DCDC_REG1 vcc2-supply: The input supply for DCDC_REG2 vcc3-supply: The input supply for DCDC_REG3 vcc4-supply: The input supply for DCDC_REG4 vcc6-supply: The input supply for LDO_REG1 and LDO_REG2 vcc7-supply: The input supply for LDO_REG3 and LDO_REG7 vcc8-supply: The input supply for SWITCH_REG1 vcc9-supply: The input supply for LDO_REG4 and LDO_REG5 vcc10-supply: The input supply for LDO_REG6 vcc11-supply: The input supply for LDO_REG8 regards Frank [1] https://patchwork.kernel.org/project/linux-rockchip/patch/20220519161731.1168-1-macroalpha82@gmail.com/ > Gesendet: Dienstag, 24. Mai 2022 um 10:53 Uhr > Von: "Ahmad Fatoum" > An: "Frank Wunderlich" , "Sascha Hauer" > Cc: barebox@lists.infradead.org > Betreff: Re: Aw: Re: Re: Driver load order > > Hello Frank, > > On 21.05.22 12:31, Frank Wunderlich wrote: > > Hi, > > > > current state is that pmu/ldo regulators work, but not the SWITCH ones. > > > > these are read by linux using the supply of the regulator itself > > > > } else if (rdev->supply) { > > ret = regulator_get_voltage_rdev(rdev->supply->rdev); > > > > tried to port this to barebox, but regulator-struct there does not have the supply member > > > > } else if (rdev->supply) { > > ret = regulator_get_voltage(rdev->supply); > > > > so i added it here: > > > > +++ b/include/regulator.h > > @@ -86,6 +86,7 @@ struct regulator_dev { > > struct regmap *regmap; > > bool boot_on; > > bool always_on; > > + struct regulator *supply; > > I think this should go into struct regulator_internal instead? > (You'll need to rename the current const char *supply there). > > > /* the device this regulator device belongs to */ > > struct device_d *dev; > > > > but now this needs to be set somwhere...linux set this in > > > > set_supply(struct regulator_dev *rdev, > > struct regulator_dev *supply_rdev) > > which is called in regulator_resolve_supply (called by _regulator_get). > > Ah, I missed b8074eba2a6b ("regulator: RK808: Add proper input supplies > for rk808"). I recall now that I had ported an older version of the Linux > driver to make porting work easier. > > You should probably add a supply_name member into struct regulator_desc > and then propagate this to core, so core can request it. > > Cheers, > Ahmad > > > > > regards Frank > > > > > >> Gesendet: Donnerstag, 19. Mai 2022 um 15:10 Uhr > >> Von: "Sascha Hauer" > >> I gave it a test with your rk808 driver. It just works \o/ > >> > >> regulator_get() triggers probing of the rk808 regulator driver and > >> returns a valid regulator. > >> > >> Sascha > > > > > > > -- > 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 | > _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox