Re: [PATCH v7 02/11] mfd: Add max7360 support
From: Andy Shevchenko
Date: Fri May 02 2025 - 06:11:08 EST
On Mon, Apr 28, 2025 at 01:57:20PM +0200, mathieu.dubois-briand@xxxxxxxxxxx wrote:
> From: Kamel Bouhara <kamel.bouhara@xxxxxxxxxxx>
>
> Add core driver to support MAX7360 i2c chip, multi function device
> with keypad, GPIO, PWM, GPO and rotary encoder submodules.
...
> +static int max7360_mask_irqs(struct regmap *regmap)
So, AFAICS this is used only at probe stage...
> +{
> + struct device *dev = regmap_get_device(regmap);
> + unsigned int val;
> + int ret;
> +
> + /*
> + * GPIO/PWM interrupts are not masked on reset: as the MAX7360 "INTI"
> + * interrupt line is shared between GPIOs and rotary encoder, this could
> + * result in repeated spurious interrupts on the rotary encoder driver
> + * if the GPIO driver is not loaded. Mask them now to avoid this
> + * situation.
> + */
> + for (unsigned int i = 0; i < MAX7360_PORT_PWM_COUNT; i++) {
> + ret = regmap_write_bits(regmap, MAX7360_REG_PWMCFG(i),
> + MAX7360_PORT_CFG_INTERRUPT_MASK,
> + MAX7360_PORT_CFG_INTERRUPT_MASK);
> + if (ret) {
> + dev_err(dev, "Failed to write max7360 port configuration");
> + return ret;
...if it's the case, use return dev_err_probe(...) here...
> + }
> + }
> +
> + /* Read GPIO in register, to ACK any pending IRQ. */
> + ret = regmap_read(regmap, MAX7360_REG_GPIOIN, &val);
> + if (ret)
> + dev_err(dev, "Failed to read gpio values: %d\n", ret);
> +
> + return ret;
...and here.
> +}
--
With Best Regards,
Andy Shevchenko