All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nuno Sá" <noname.nuno@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>, Andy Shevchenko <andy@kernel.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	nuno.sa@analog.com,  linux-hwmon@vger.kernel.org,
	devicetree@vger.kernel.org,  linux-doc@vger.kernel.org,
	Jean Delvare <jdelvare@suse.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Bartosz Golaszewski <brgl@bgdev.pl>
Subject: Re: [PATCH v2 2/2] hwmon: ltc4282: add support for the LTC4282 chip
Date: Fri, 01 Dec 2023 17:29:59 +0100	[thread overview]
Message-ID: <986fb7dc2a34602fa9c2d57a7a3e06a71cfdc0a0.camel@gmail.com> (raw)
In-Reply-To: <7dc3f137-6073-4262-afb5-439d024bbbd2@roeck-us.net>

On Fri, 2023-12-01 at 08:04 -0800, Guenter Roeck wrote:
> On 12/1/23 07:47, Andy Shevchenko wrote:
> > On Fri, Dec 01, 2023 at 04:24:35PM +0100, Nuno Sá wrote:
> > > On Fri, 2023-12-01 at 14:40 +0100, Linus Walleij wrote:
> > 
> > ...
> > 
> > > Yes, that is the only thing we have. Meaning that there is no hw setting to set
> > > the
> > > pins to open drain. Open drain is what they are. That is why I'm not seeing the
> > > point
> > > in having PIN_CONFIG_DRIVE_OPEN_DRAIN implemented.
> > 
> > At least you have to implement error for PUSH_PULL mode and other modes,
> > so from the (core) software point of view the user should be able to ask for
> > anything and get an answer from the certain driver that "hey, i do support OD",
> > or "hey, push-pull can't be supported with this hw".
> > 
> 
> It seems to me that this is heading towards a mfd driver. I don't feel comfortable
> with all that gpio specific code in the hwmon subsystem.
> 
> Maybe I should request that all hwmon chips with gpio support must be implemented
> as mfd drivers. I'll have to think about that.
> 
> Guenter
> 

Hopefully you don't ask that already for this driver...

I mean, I guess It could be done but having this is as mfd will make it more
difficult to handle the pins. Because if we look at the bindings we can see that
these pins might only be relevant to the hwmon driver and not even be used as gpios.
But being an mfd, I don't think there's any requirement like one of the drivers can
only exist if the other is also there. So making the gpio driver depend on the hwmon
would be weird. I might be overcomplicating but things can get messy if we want to
make it right in the gpio driver:

* If the hwmon is not reachable then we could just assume we can use the 4 pins as
gpios freely.
* If the hwmon is reachable then we need some kind of syncup to make sure we dont use
a pin as gpio if the hwmon driver wants to use it. Things can get even more shady if
we think one driver being a module and the other being built-in.

Or maybe we can also just have an array property in the gpio driver to explicitly set
the pins we want as gpios. Then if the user messes up and we have a config overlaps
one of the driver fails probing...

Or maybe Andy's auxiliary bus suggestion might be more suitable (not really familiar
with it).

- Nuno Sá

  parent reply	other threads:[~2023-12-01 16:30 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-24 14:18 [PATCH v2 0/2] Add support for LTC4282 Nuno Sa via B4 Relay
2023-11-24 14:18 ` Nuno Sa
2023-11-24 14:18 ` [PATCH v2 1/2] dt-bindings: hwmon: Add LTC4282 bindings Nuno Sa via B4 Relay
2023-11-24 14:18   ` Nuno Sa
2023-11-25 11:56   ` Conor Dooley
2023-11-27  7:56     ` Nuno Sá
2023-11-27 17:33       ` Conor Dooley
2023-11-28 15:37   ` Rob Herring
2023-11-28 15:49     ` Nuno Sá
2023-11-24 14:18 ` [PATCH v2 2/2] hwmon: ltc4282: add support for the LTC4282 chip Nuno Sa via B4 Relay
2023-11-24 14:18   ` Nuno Sa
2023-11-24 21:54   ` kernel test robot
2023-11-24 23:39   ` kernel test robot
2023-11-27  7:53     ` Nuno Sá
2023-11-27  8:10       ` Krzysztof Kozlowski
2023-11-27  8:12         ` Krzysztof Kozlowski
2023-11-27  8:44           ` Nuno Sá
2023-11-27 16:03           ` Andy Shevchenko
2023-11-28 16:50             ` Krzysztof Kozlowski
2023-11-28 17:01               ` Andy Shevchenko
2023-11-28 18:03               ` Guenter Roeck
2023-11-29  8:35                 ` Nuno Sá
2023-11-29  8:45                   ` Krzysztof Kozlowski
2023-11-29  8:56                     ` Nuno Sá
2023-11-29 14:10                     ` Linus Walleij
2023-11-29 14:13                       ` Krzysztof Kozlowski
2023-11-29 14:29                       ` Nuno Sá
2023-11-29 14:47                   ` Guenter Roeck
2023-11-29 16:09                     ` Nuno Sá
2023-11-27 10:20   ` kernel test robot
2023-11-29 14:49   ` Linus Walleij
2023-11-29 16:08     ` Nuno Sá
2023-11-29 16:18       ` Andy Shevchenko
2023-11-29 16:21         ` Nuno Sá
2023-11-29 17:07           ` Andy Shevchenko
2023-11-29 20:55       ` Linus Walleij
2023-11-30 10:20         ` Nuno Sá
2023-11-30 13:36           ` Andy Shevchenko
2023-11-30 14:39             ` Guenter Roeck
2023-11-30 15:20             ` Nuno Sá
2023-11-30 16:28               ` Guenter Roeck
2023-11-30 20:15               ` Linus Walleij
2023-12-01 12:34                 ` Nuno Sá
2023-12-01 13:40                   ` Linus Walleij
2023-12-01 15:24                     ` Nuno Sá
2023-12-01 15:47                       ` Andy Shevchenko
2023-12-01 16:04                         ` Guenter Roeck
2023-12-01 16:24                           ` Andy Shevchenko
2023-12-01 16:36                             ` Guenter Roeck
2023-12-01 16:29                           ` Nuno Sá [this message]
2023-12-01 16:46                             ` Guenter Roeck
2023-12-02  9:42                               ` Nuno Sá
2023-12-03 23:08                                 ` Linus Walleij
2023-12-04  8:20                                   ` Bartosz Golaszewski
2023-12-01 16:19                         ` Nuno Sá
2023-12-01 16:23                           ` Andy Shevchenko
2023-12-03 23:03                       ` Linus Walleij
2023-12-04  8:53                         ` Nuno Sá
2023-12-14 16:40   ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=986fb7dc2a34602fa9c2d57a7a3e06a71cfdc0a0.camel@gmail.com \
    --to=noname.nuno@gmail.com \
    --cc=andy@kernel.org \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=nuno.sa@analog.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.