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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <PH0PR03MB6351EBB5118D642D00F853F0F1CC2@PH0PR03MB6351.namprd03.prod.outlook.com>
Date: Fri, 28 Feb 2025 04:01:37 +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 2/2] regulator: adp5055: Add driver for adp5055



> -----Original Message-----
> From: Mark Brown <broonie@...nel.org>
> Sent: Wednesday, February 26, 2025 7:35 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 2/2] regulator: adp5055: Add driver for adp5055
> 
> [External]
> 
> On Wed, Feb 26, 2025 at 02:24:58AM +0000, Torreno, Alexis Czezar wrote:
> 
> > > > +// SPDX-License-Identifier: GPL-2.0
> > > > +/*
> > > > + * Regulator driver for Analog Devices ADP5055
> > > > + *
> > > > + * Copyright (C) 2025 Analog Devices, Inc.
> > > > + */
> 
> > > Please make the entire comment block a C++ one so things look more
> > > intentional.
> 
> > Am not familiar with this, is this where each line use // rather than /**/?
> 
> Yes.
> 
> > > > +static int adp5055_en_func(struct regulator_dev *dev, int en_val) {
> > > > +	struct adp5055 *adp5055 = rdev_get_drvdata(dev);
> 
> > > Just use the standard GPIO and regmap helpers for this.
> 
> > Confused on this, I thought these were standard 'regmap_update_bits'
> > and 'gpiod_set_value_cansleep'
> 
> You've open coded the operations instead of using the framework helpers, you
> shouldn't need to anything other than supply data here.

I did code this similar to the helper functions like regulator_enable_regmap.

I can reduce the code a bit if I use 'regulator_enable_regmap' inside my 
custom 'adp5055_en_func'.
ADP5055 can be enabled by SW or HW and I didn't see a helper function that 
can do both depending on another property/register hence I coded a custom.

if having both gpio and register enable isn't that common, I guess it's an option 
to remove the gpios and stay purely software

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ