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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <PH0PR03MB63517B73D2E5F9B46FAA6D41F1A92@PH0PR03MB6351.namprd03.prod.outlook.com>
Date: Fri, 4 Apr 2025 02:33:27 +0000
From: "Torreno, Alexis Czezar" <AlexisCzezar.Torreno@...log.com>
To: Mark Brown <broonie@...nel.org>
CC: Liam Girdwood <lgirdwood@...il.com>, Rob Herring <robh@...nel.org>,
        Krzysztof Kozlowski <krzk+dt@...nel.org>,
        Conor Dooley <conor+dt@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: RE: [PATCH v3 2/2] regulator: adp5055: Add driver for adp5055



> -----Original Message-----
> From: Mark Brown <broonie@...nel.org>
> Sent: Thursday, April 3, 2025 7:09 PM
> To: Torreno, Alexis Czezar <AlexisCzezar.Torreno@...log.com>
> Cc: Liam Girdwood <lgirdwood@...il.com>; Rob Herring <robh@...nel.org>;
> Krzysztof Kozlowski <krzk+dt@...nel.org>; Conor Dooley
> <conor+dt@...nel.org>; linux-kernel@...r.kernel.org;
> devicetree@...r.kernel.org
> Subject: Re: [PATCH v3 2/2] regulator: adp5055: Add driver for adp5055
> 
> [External]
> 
> On Thu, Apr 03, 2025 at 10:43:11AM +0800, Alexis Czezar Torreno wrote:
> 
> > +static int adp5055_is_enabled(struct regulator_dev *rdev) {
> > +	struct adp5055 *adp5055 = rdev_get_drvdata(rdev);
> > +	int id = rdev_get_id(rdev);
> > +	int val;
> > +
> > +	if (adp5055->en_mode_software)
> > +		return regulator_is_enabled_regmap(rdev);
> > +
> > +	val = gpiod_get_value_cansleep(adp5055->en_gpiod[id]);
> > +
> > +	return val;
> > +};
> 
> This is absolutely standard enable GPIO support, just let the core handle
> everything.  Otherwise this looks fine.

May I ask which core function is the suggested to use here?

I assume I need to change the line in ops:
-> .is_enabled = adp5055_is_enabled,

Not sure which function handles both GPIO and registers since as far as I
understand 'regulator_is_enabled_regmap()' only handles software/registers and
'regulator_is_enabled()' only checks the gpio?


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ