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: <D7QHGB7D0VSG.X255SDU7DFOF@bootlin.com>
Date: Wed, 12 Feb 2025 13:57:34 +0100
From: "Mathieu Dubois-Briand" <mathieu.dubois-briand@...tlin.com>
To: "Andy Shevchenko" <andriy.shevchenko@...el.com>
Cc: "Lee Jones" <lee@...nel.org>, "Rob Herring" <robh@...nel.org>,
 "Krzysztof Kozlowski" <krzk+dt@...nel.org>, "Conor Dooley"
 <conor+dt@...nel.org>, "Kamel Bouhara" <kamel.bouhara@...tlin.com>, "Linus
 Walleij" <linus.walleij@...aro.org>, "Bartosz Golaszewski" <brgl@...ev.pl>,
 "Dmitry Torokhov" <dmitry.torokhov@...il.com>,
 Uwe Kleine-König <ukleinek@...nel.org>,
 <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
 <linux-gpio@...r.kernel.org>, <linux-input@...r.kernel.org>,
 <linux-pwm@...r.kernel.org>, Grégory Clement
 <gregory.clement@...tlin.com>, "Thomas Petazzoni"
 <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v3 4/7] gpio: max7360: Add MAX7360 gpio support

Hi Andy,

Thanks for your review. I've been addressing most of your comments in
this mail and the ones related to regmap-irq. I should be able to send a
new version in a few days.

However I have a few questions regarding some of the points.

On Mon Jan 27, 2025 at 2:07 PM CET, Andy Shevchenko wrote:
> On Mon, Jan 13, 2025 at 01:42:28PM +0100, Mathieu Dubois-Briand wrote:
> > +	parent = to_platform_device(pdev->dev.parent);
>
> Why do you need this? Can't the fwnode be propagated to the children and then
> the respective APIs to be used?
>

I'm not sure to understand this correctly, what do you mean by
propagating the fwnode to the children?

Just a quick summary of the situation and what I try to do. The device
tree looks like this, only keeping the interesting properties:

io-expander@38 {
  ...
  interrupts = <23 IRQ_TYPE_LEVEL_LOW>,
               <24 IRQ_TYPE_LEVEL_LOW>;
  interrupt-names = "inti", "intk";

  max7360_gpio: gpio {
    ...
  };

  max7360_gpo: gpo {
    ...
  };
};

Our pdev fwnode points either to the "gpio" or "gpo" nodes, the one from
our parent device points to "io-expander@38". Here we need to get the
"inti" interrupt from the parent node. What would be the correct way to
do it?

> > +	if (!max7360_gpio)
> > +		return -ENOMEM;
>
> > +	if (of_property_read_u32(pdev->dev.of_node, "ngpios", &ngpios)) {
> > +		dev_err(&pdev->dev, "Missing ngpios OF property\n");
> > +		return -ENODEV;
> > +	}
>
> This is not needed, it is already done in GPIOLIB core.
>

I believe this is still needed:
- For gpos, we need the gpio count to correctly set the partition
  between gpo and keypad columns in max7360_set_gpos_count().
- For gpios, we need the gpio count to setup the IRQs.

Best regards,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ