Re: [PATCH v6 02/12] mfd: Add max7360 support

From: Andy Shevchenko
Date: Thu Apr 17 2025 - 14:17:00 EST


On Wed, Apr 09, 2025 at 04:55:49PM +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_probe(struct i2c_client *client)
> +{
> + struct device *dev = &client->dev;
> + struct regmap *regmap;
> + int ret;
> +
> + regmap = devm_regmap_init_i2c(client, &max7360_regmap_config);
> + if (IS_ERR(regmap))
> + return dev_err_probe(dev, PTR_ERR(regmap), "Failed to initialise regmap\n");

> + i2c_set_clientdata(client, regmap);

Is it used somehow? In children?

> + ret = max7360_reset(regmap);
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to reset device\n");
> +
> + /* Get the device out of shutdown mode. */
> + ret = regmap_write_bits(regmap, MAX7360_REG_GPIOCFG,
> + MAX7360_GPIO_CFG_GPIO_EN,
> + MAX7360_GPIO_CFG_GPIO_EN);
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to enable GPIO and PWM module\n");
> +
> + ret = max7360_mask_irqs(regmap);
> + if (ret)
> + return dev_err_probe(dev, ret, "Could not mask interrupts\n");
> +
> + ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE,
> + max7360_cells, ARRAY_SIZE(max7360_cells),
> + NULL, 0, NULL);
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to register child devices\n");
> +
> + return 0;
> +}

--
With Best Regards,
Andy Shevchenko