From patchwork Thu Jun 1 06:24:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiYuan Huang X-Patchwork-Id: 101781 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp100416vqr; Thu, 1 Jun 2023 00:01:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4WDJz1GzEbWGiqskvbxkedwA8HXIJHMCXzNgrCB2aRwbK47eAHXBs9XaK4obbVU5q/dRgl X-Received: by 2002:a17:903:5c7:b0:1b0:637e:e25a with SMTP id kf7-20020a17090305c700b001b0637ee25amr6768253plb.67.1685602903746; Thu, 01 Jun 2023 00:01:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685602903; cv=none; d=google.com; s=arc-20160816; b=mxrulI9dCcg4QuWN3DAH+xH5Ps+a6nfQiwUf38N1pZVZNXr6YwESnFm5AjFsbDhbL0 zvBFYokisWnt/xuKfz9X0KTdWm1xnByYwuts/UCDs4f8/PCkjmlOrNEfNoIhrLKMCEgM 7mlnzenLT/pfHv128MlrVlSVNSX8nYO9RZw1LhNZN+Uie6jKSKlNqsAibz8XZrv+Z4Qi HlO2Acfqcd+kDB9M21ER0lpukIdoW8D9utf3VBKeTscjkaHGovQPkHK0d+bPa1h+AmMt 9Gnde/a3U7mIHVNMxEqDuTspD32PC7GaRRoWi3Z3+G/EXQjUgmIs88CNWImqbymG7joC IEzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=tgDv+zVEXY+1H0zDonF6lnDiyOgHpmrFxmorvUtfdhc=; b=0OQH7/ZlOk80js0EipA04dF6+cox5yzgV2BeBGhBkCpNJ5GVGvaf3pdLErcnbmXO9S nfmnaKrm5QZE75IsPSuomL1m8GVN/W0CR4qQtQBGYfvq27rCyeZlDKY5dx2O9TkfoMCM 4qL2DqzFRMCDcxKN91NKAmRwVh7W7x2Vc609fij9u9xmU+v7M3Ae7lTAdHC6uEsfWXqF /SCmhw9jX6LlJUxc3UVOk+nsmjHWebF3qEBSb0VLAQcEocOSzABIAwcqeK1N8uHrATSI 98A9CFcjFQKX5AAN7EUipiHVbRNU2bMmda05NkvxM3uW4BfJQ0XGg4b/0NcpkOamjB76 9swg== ARC-Authentication-Results: i=1; mx.google.com; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n5-20020a170902e54500b001ac6a9353ffsi1771287plf.116.2023.06.01.00.01.27; Thu, 01 Jun 2023 00:01:43 -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; 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 S231508AbjFAGZ3 (ORCPT + 99 others); Thu, 1 Jun 2023 02:25:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbjFAGZ1 (ORCPT ); Thu, 1 Jun 2023 02:25:27 -0400 Received: from mg.richtek.com (mg.richtek.com [220.130.44.152]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 68EDD188; Wed, 31 May 2023 23:24:54 -0700 (PDT) X-MailGates: (flag:4,DYNAMIC,BADHELO,RELAY,NOHOST:PASS)(compute_score:DE LIVER,40,3) Received: from 192.168.10.46 by mg.richtek.com with MailGates ESMTP Server V5.0(767:0:AUTH_RELAY) (envelope-from ); Thu, 01 Jun 2023 14:24:38 +0800 (CST) Received: from ex4.rt.l (192.168.10.47) by ex3.rt.l (192.168.10.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Thu, 1 Jun 2023 14:24:37 +0800 Received: from linuxcarl2.richtek.com (192.168.10.154) by ex4.rt.l (192.168.10.45) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Thu, 1 Jun 2023 14:24:37 +0800 From: To: CC: , , , , Subject: [PATCH] power: supply: rt9467: Make charger-enable control as logic level Date: Thu, 1 Jun 2023 14:24:36 +0800 Message-ID: <1685600676-25124-1-git-send-email-cy_huang@richtek.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767482484769737472?= X-GMAIL-MSGID: =?utf-8?q?1767482750383193723?= From: ChiYuan Huang The current coding make 'charger-enable-gpio' control as real hardware level. This conflicts with the default binding example. For driver behavior, no need to use real hardware level, just logic level is enough. This change can make this flexibility keep in dts gpio active level about this pin. Fixes: 6f7f70e3a8dd ("power: supply: rt9467: Add Richtek RT9467 charger driver") Signed-off-by: ChiYuan Huang --- Hi, This change is from our customer. They use the default binding example as the dts config. By default, this configurethe charger-enable-gpio to real harware level high and disable battery charging with external hardware pin. The last patch I sent is to fix the binding example. But refer to the discussion, the correct way is to change the gpio control coding as logic level, not real hardware level. https://lore.kernel.org/lkml/1685522813-14481-1-git-send-email-cy_huang@richtek.com/ --- drivers/power/supply/rt9467-charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/supply/rt9467-charger.c b/drivers/power/supply/rt9467-charger.c index ea33693..b0b9ff8 100644 --- a/drivers/power/supply/rt9467-charger.c +++ b/drivers/power/supply/rt9467-charger.c @@ -1192,7 +1192,7 @@ static int rt9467_charger_probe(struct i2c_client *i2c) i2c_set_clientdata(i2c, data); /* Default pull charge enable gpio to make 'CHG_EN' by SW control only */ - ceb_gpio = devm_gpiod_get_optional(dev, "charge-enable", GPIOD_OUT_LOW); + ceb_gpio = devm_gpiod_get_optional(dev, "charge-enable", GPIOD_OUT_HIGH); if (IS_ERR(ceb_gpio)) return dev_err_probe(dev, PTR_ERR(ceb_gpio), "Failed to config charge enable gpio\n");