Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp307018rwd; Wed, 31 May 2023 23:59:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ583f7vBCSUUDoTveHCMHIehRj5cgTSJGRSQgsayXWys8Yy1Glf3qBzE/71Sl7oyql+mmcj X-Received: by 2002:a17:903:452:b0:1ad:eb62:f617 with SMTP id iw18-20020a170903045200b001adeb62f617mr7194613plb.45.1685602752015; Wed, 31 May 2023 23:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685602752; cv=none; d=google.com; s=arc-20160816; b=I62GVYcNAzv2ItpsQZ+8xMYrgLW3BWQWF22KSFA3EVa52vwn5Hzb4b3Is6aTm5wDLQ LL/EoZj6h2qmfjfLf+CZClDMmIxMynD+Ydy+DSJfNmCq0pu+jVL0kg1f4HVdMiP251iH ulktHq8eAqEQVGUrx1rZ2PxTB16eLO5tPDscHUWUmTyxEYQ8WHMfPjxADVGmjWm40Edl cLkVSejjqTbazJbmUZZIALXfnjQc5iNtn+hGF9DWHN6BtHJaxRU/vztUYG0rSVECEHf1 RnQwUh8lG57biQ7c0ob+xAds1p6r+scpfvRsoTZFQKSusQX3q0dPgkDaHSgPF9jjfJlM vAJg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h5-20020a170902f7c500b001b04a379cd2si2210300plw.348.2023.05.31.23.58.59; Wed, 31 May 2023 23:59:11 -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 S231439AbjFAGZ3 (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 Content-Type: text/plain 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 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"); -- 2.7.4