Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp899127rwd; Sun, 14 May 2023 08:28:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6wKeop3bRLMoj/QCyG5a+toEliA9A45nOOgkzy4I+3TUPWxxqbCdv5/DEjyAKh0rCkhiTj X-Received: by 2002:a17:90b:506:b0:24d:df69:5c67 with SMTP id r6-20020a17090b050600b0024ddf695c67mr32292426pjz.12.1684078131663; Sun, 14 May 2023 08:28:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684078131; cv=none; d=google.com; s=arc-20160816; b=kU00C/AyEq1DUW+kwVt1WgkJVtnKht5n7q99Zz/r3/HxBMqdwxpHhov7h7f4QHHjoE JxFDQymrJapoYP1itG8ckc+/1QRvP742cxGkn5KJmS/Ha6v6yCYy7CWTyidy7CJvBDH9 LwSI0W2xG4B23rejt10Bx6vbUrCz5RvTv9Q64wiGzuQZ/LF2UanYc5YuqdWUoDkLHg8i woBSj8AYvKG9dz1vr8bDSZB9QCorXap+JEw7X3b1e6IQoGUR9IZmrx0+u2JCkJ3hXBSG dfNhhfJJ11lauR7jnjbeowTXFB/kcnq5RS9vWi66oMVXGOTRBSgWb+2+bDL6+L1kEHV9 sWUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=6dTqDvAKG79B/2e2RDgHQKyZvLzcOF4scBFg7nUwea4=; b=KFSwuYFK25dV5EqAMvGsQBoBDmHelMkVIuNtY9rHxJO1wQDYAOJq3mL1H5Qsn+6i46 bdJH65mmj4vgQa86aoVW9Gbgeq8f+QSyFdbC4I5Zi22apKXfvTP8V0jFp+FqQdSvZUe5 D9zL+ETri5YQR1ZlgEo0xCuAfpjYsQdH2Br5aypu9dGSi6DTVXERF7JatCloUU62FlJX bxvwYEzGnUVmS0btPjYjZ2dBLrYbhkERYVeisGq6ch0vKvOzm6TrdGF4kvf/3M2GB2Fg M0sIWdPP+pT5kTB2rT3DmnURhHqYaBdCoh6GlBTW3MJfTOhfXhcXIEj50oDAjyNvP8EV /eyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=MI9OJ8Sv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l7-20020a17090a72c700b00246d164fd7asi25865125pjk.159.2023.05.14.08.28.30; Sun, 14 May 2023 08:28:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=MI9OJ8Sv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233442AbjENOcB (ORCPT + 99 others); Sun, 14 May 2023 10:32:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230190AbjENOb7 (ORCPT ); Sun, 14 May 2023 10:31:59 -0400 Received: from smtp.smtpout.orange.fr (smtp-29.smtpout.orange.fr [80.12.242.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2376C30CF for ; Sun, 14 May 2023 07:31:56 -0700 (PDT) Received: from [192.168.1.18] ([86.243.2.178]) by smtp.orange.fr with ESMTPA id yClJps2VJKyEByClJpiTwJ; Sun, 14 May 2023 16:31:54 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1684074714; bh=6dTqDvAKG79B/2e2RDgHQKyZvLzcOF4scBFg7nUwea4=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=MI9OJ8Svm31cyT9bP/+QGf/dgGfmyuld8CPIVqfZ3UW+0jNrNwQ9udVp7Z1kq1cQ+ veoATUUZ8OEcBQQsbXZcoir1Vvp8o9gMr3MPk1eZhyLjKFE8JGlgsfSGakdUuPlBBi /xwvBBC9O4XI/Si7mmb27L0mfwY6RLcgx4NlwMKlW14I/usuXDA1Q1SyOmsc0NaStG HpiklhZFJwamsYnbr/KkdlgsqGGTDjXSFEN6epIFkC2+cjSfvf5h/nRjWYktpiiOMT WLhCrsTFDGGGCoHIinYCRt1pL+XGWc0fYvEF1kjwmlnV5dX3VtPkBOgqX4d7Ne5cX/ AaY8xf3yq8zwQ== X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 14 May 2023 16:31:54 +0200 X-ME-IP: 86.243.2.178 Message-ID: <2e0f37ef-b80c-1a4d-2159-29598ac11156@wanadoo.fr> Date: Sun, 14 May 2023 16:31:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v5 05/10] power: supply: rt5033_charger: Add RT5033 charger device driver Content-Language: fr To: jahau@rocketmail.com Cc: axel.lin@ingics.com, beomho.seo@samsung.com, broonie@kernel.org, cw00.choi@samsung.com, cy_huang@richtek.com, devicetree@vger.kernel.org, henrik@grimler.se, krzysztof.kozlowski+dt@linaro.org, lee@kernel.org, lgirdwood@gmail.com, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, pavel@ucw.cz, phone-devel@vger.kernel.org, raymondhackley@protonmail.com, robh+dt@kernel.org, sre@kernel.org, stephan@gerhold.net, ~postmarketos/upstreaming@lists.sr.ht References: <20230514123130.41172-1-jahau@rocketmail.com> <20230514123130.41172-6-jahau@rocketmail.com> From: Christophe JAILLET In-Reply-To: <20230514123130.41172-6-jahau@rocketmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 14/05/2023 à 14:31, Jakob Hauser a écrit : > This patch adds device driver of Richtek RT5033 PMIC. The driver supports > switching charger. rt5033 charger provides three charging modes. The charging > modes are pre-charge mode, fast charge mode and constant voltage mode. They > vary in charge rate, the charge parameters can be controlled by i2c interface. > > Cc: Beomho Seo > Cc: Chanwoo Choi > Tested-by: Raymond Hackley > Signed-off-by: Jakob Hauser > Reviewed-by: Linus Walleij > --- > drivers/power/supply/Kconfig | 8 + > drivers/power/supply/Makefile | 1 + > drivers/power/supply/rt5033_charger.c | 472 ++++++++++++++++++++++++++ > include/linux/mfd/rt5033.h | 16 - > 4 files changed, 481 insertions(+), 16 deletions(-) > create mode 100644 drivers/power/supply/rt5033_charger.c > [...] > +static int rt5033_charger_probe(struct platform_device *pdev) > +{ > + struct rt5033_charger *charger; > + struct power_supply_config psy_cfg = {}; > + int ret; > + > + charger = devm_kzalloc(&pdev->dev, sizeof(*charger), GFP_KERNEL); > + if (!charger) > + return -ENOMEM; > + > + platform_set_drvdata(pdev, charger); > + charger->dev = &pdev->dev; > + charger->regmap = dev_get_regmap(pdev->dev.parent, NULL); > + > + psy_cfg.of_node = pdev->dev.of_node; > + psy_cfg.drv_data = charger; > + > + charger->psy = devm_power_supply_register(&pdev->dev, > + &rt5033_charger_desc, > + &psy_cfg); > + if (IS_ERR(charger->psy)) > + return dev_err_probe(&pdev->dev, PTR_ERR(charger->psy), > + "Failed to register power supply\n"); > + > + charger->chg = rt5033_charger_dt_init(charger); > + if (IS_ERR_OR_NULL(charger->chg)) Hi, Nit: charger->chg can't be NULL. > + return -ENODEV; Why bother returning specific error code in rt5033_charger_dt_init() if they are eaten here. return PTR_ERR(charger->chg)? CJ > + > + ret = rt5033_charger_reg_init(charger); > + if (ret) > + return ret; > + > + return 0; > +} [...]