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=-9.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 90A72C433E0 for ; Thu, 24 Dec 2020 14:02:13 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 410A122287 for ; Thu, 24 Dec 2020 14:02:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 410A122287 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.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=QcxwkgpkbMMwWhOh81/5K5lY2Ia6eMaVL4ocvDLootw=; b=iUWP10qAbyHsXMU1JuZLDD76Q T+Voc2rpXFuA3zS3XBF+QHtOdJHQBj/GuAD0pxGXhncGccVAc5GRL64me2B6pQym9jmEn/b7ncdgJ Ghzi+1m+u5iF8/hPO9mWX2WHjVpCaHwFtpJ9MUDD1g8GrV2UKIe116gSR7o6QpPXi9NEF+JL2Nuwk 0wzQQrx9yWqOVizzcBKcpA9ILT0rgMo6h20E2qPunhaQ3VWsuTENmXUBpPAtufXpt1O2ovECiFPBK orVIyLMuePYuiw4irLkvVFtgRJzSTHBDxhMn9lRaioZbHfW+3c1a+U3YbD/1yB0anCs1f5BSFidR7 cZEc3BkRQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ksRAa-0002cD-Ji; Thu, 24 Dec 2020 14:00:44 +0000 Received: from mail-wr1-f43.google.com ([209.85.221.43]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ksRAY-0002bK-9K for linux-arm-kernel@lists.infradead.org; Thu, 24 Dec 2020 14:00:43 +0000 Received: by mail-wr1-f43.google.com with SMTP id d13so2219384wrc.13 for ; Thu, 24 Dec 2020 06:00:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=JXPJKdw80z+OB5yk21y07mm+iviqQpsWpPbSM4Th92c=; b=qdlOq2XH0vLh6JQipUaHPov0F+BgZwyeTMPTt0Z7OZOnMd6YthIF89WCrWlwQQSn71 +vA8h8HFzq6LkEkpRqL6AQ8wkpONisD4kf/k/prT2NJ8UBykYHza1nKSGgLrQyADHqoq E6ZmXUAro5MT8jrEAvc60E3/A+cktOEMnp6Vcm0dD6qqUBYh3r8GyGZ5tom0P27Du9Z5 Oas/wEQZtOb7PS9iBJqHqLy01TUDNR4EYmZ/wenLF0hSVV84WMHQiXovrfKcZvKvfpxm VRWdkG0+8RYafFZ+B1Hjz6ak2LLCft3KGkY1hAyH1RTkCnNTm9q0voPzyFezsRHeq8Co +XOg== X-Gm-Message-State: AOAM533ckzKjy9hoanWUjs5NImwJDpUDmXKd8fe1fKM+QYA9X6FIIELe w26zmeTOoEw0I01es9srek0= X-Google-Smtp-Source: ABdhPJznCRPR6sm397ISThve5dgEO81eDZPCPfAysBrZ8OHDU8wWmjjYYLQ5mpdB4e0gR8EizOqiLw== X-Received: by 2002:a5d:4e89:: with SMTP id e9mr34110095wru.201.1608818440801; Thu, 24 Dec 2020 06:00:40 -0800 (PST) Received: from kozik-lap (adsl-84-226-167-205.adslplus.ch. [84.226.167.205]) by smtp.googlemail.com with ESMTPSA id h9sm38246689wre.24.2020.12.24.06.00.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Dec 2020 06:00:39 -0800 (PST) Date: Thu, 24 Dec 2020 15:00:38 +0100 From: Krzysztof Kozlowski To: Timon Baetz Subject: Re: [PATCH v4 4/7] power: supply: max8997_charger: Set CHARGER current limit Message-ID: <20201224140038.GA48009@kozik-lap> References: <20201223134221.804943-1-timon.baetz@protonmail.com> <20201223134221.804943-4-timon.baetz@protonmail.com> <20201224095559.GB10937@kozik-lap> <20201224141246.7ad0ffc4.timon.baetz@protonmail.com> <20201224133706.GA22856@kozik-lap> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201224133706.GA22856@kozik-lap> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201224_090042_352211_D69A607E X-CRM114-Status: GOOD ( 26.21 ) 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: devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown , Liam Girdwood , Rob Herring , Sebastian Reichel , Chanwoo Choi , MyungJoo Ham , ~postmarketos/upstreaming@lists.sr.ht, Lee Jones , linux-arm-kernel@lists.infradead.org, Marek Szyprowski Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Dec 24, 2020 at 02:37:06PM +0100, Krzysztof Kozlowski wrote: > On Thu, Dec 24, 2020 at 01:13:02PM +0000, Timon Baetz wrote: > > On Thu, 24 Dec 2020 10:55:59 +0100, Krzysztof Kozlowski wrote: > > > > @@ -170,6 +237,28 @@ static int max8997_battery_probe(struct platform_device *pdev) > > > > return PTR_ERR(charger->battery); > > > > } > > > > > > > > + charger->reg = devm_regulator_get(&pdev->dev, "charger"); > > > > > > Since you do not use get_optional, you will always get a dummy > > > regulator. In case of error, you should either print it or entirely fail > > > the probe. Silently continuing makes it difficult to spot errors. > > > > > > Since the driver could operate in case of extcon/regulator error, just > > > dev_err() so failure will be spotted with dmesg. > > > > I will switch to devm_regulator_get_optional() and print an error on > > failure, thanks. > > > > > It will complain on older DTBs because you are introducing incompatible > > > change, but that's expected. Just correct all other in-tree DTS. > > > > The other 2 in-tree DTS don't have CHARGER regulators. Not sure > > how to correct those. Should I add muic and charger nodes without a > > charger-supply? It will still complain in that case. > > +Cc Marek, > > This is why leaving the code as is - devm_regulator_get(), not optional > - makes sense. Core would provide dummy regulator, so you only have to > provide MUIC node. > > If you change the code to devm_regulator_get_optional(), you need to add > everything: the charger regulator, the charger node and MUIC node. > > For Trats, the configuration should be similar as i9100, although I > don't know the exact values of chargign voltage. > > For Origen, there is no battery, so the power supply should not bind. > Maybe this could be achieved with "status disabled" for charger node? It > depends whether MFD will respect such field... If it disables the > charger, you're done. I just looked at the MFD code and tested it - it nicely skips disabled devices. Therefore, for Origen I propose to add disabled nodes for charger and MUIC because these pins are not connected. No need to add regulators in such case. Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel