Re: [PATCH 3/3] pwm: airoha: add support for AN7589

From: John Crispin

Date: Fri Dec 04 2026 - 14:07:45 EST


Hi Uwe,

On Thu, Dec 03, 2026 at 11:47:36AM +0100, Uwe Kleine-König wrote:
> > The AN7589 PWM controller has no device tree node of its own. The GPIO
> > system controller MFD driver registers it as a cell. Match the cell by
> > name and use the device tree node of the parent, which is the PWM
> > provider.
>
> Why do we have this difference? And why is the PWM's parent device the
> PWM provider?

This comes from the DT side. Conor did not want a child node for the
PWM since it has no resources of its own [1], and asked for #pwm-cells
on the system controller node with the driver probed through
mfd_add_devices() [2]. I put that into the commit message for v2.

[1] https://lore.kernel.org/r/20261113-fame-smock-6ea3b8fadcd0@spud
[2] https://lore.kernel.org/r/20261117-illicitly-translate-2d16b1279df9@spud

> > +#define AIROHA_PWM_GPIO_FLASH_SET_ID_WIDE GENMASK(3, 0)
>
> What is bit 3 for en7581? If it's reserved and reads as zero, you can
> set it to GENMASK(3, 0) unconditionally.

Sadly not, on the EN7581 bit 3 is the enable bit of the channel
(AIROHA_PWM_GPIO_FLASH_EN, one line above).

The rest is fixed in v2, which I will send tomorrow.

John