lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1685600676-25124-1-git-send-email-cy_huang@richtek.com>
Date:   Thu, 1 Jun 2023 14:24:36 +0800
From:   <cy_huang@...htek.com>
To:     <sre@...nel.org>
CC:     <krzysztof.kozlowski+dt@...aro.org>, <cy_huang@...htek.com>,
        <chiaen_wu@...htek.com>, <linux-pm@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: [PATCH] power: supply: rt9467: Make charger-enable control as logic level

From: ChiYuan Huang <cy_huang@...htek.com>

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 <cy_huang@...htek.com>
---
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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ