Re: [PATCH v15 5/7] mfd: Add new driver for MAX77705 PMIC
From: Krzysztof Kozlowski
Date: Fri Jan 17 2025 - 02:55:50 EST
On Thu, Jan 16, 2025 at 07:26:07PM +0300, Dzmitry Sankouski wrote:
> config MFD_MAX77714
> tristate "Maxim Semiconductor MAX77714 PMIC Support"
> depends on I2C
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index e057d6d6faef..d981690b5a12 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -168,6 +168,7 @@ obj-$(CONFIG_MFD_MAX77620) += max77620.o
> obj-$(CONFIG_MFD_MAX77650) += max77650.o
> obj-$(CONFIG_MFD_MAX77686) += max77686.o
> obj-$(CONFIG_MFD_MAX77693) += max77693.o
> +obj-$(CONFIG_MFD_MAX77705) += max77705.o
> obj-$(CONFIG_MFD_MAX77714) += max77714.o
> obj-$(CONFIG_MFD_MAX77843) += max77843.o
> obj-$(CONFIG_MFD_MAX8907) += max8907.o
> @@ -233,6 +234,7 @@ obj-$(CONFIG_MFD_RK8XX_I2C) += rk8xx-i2c.o
> obj-$(CONFIG_MFD_RK8XX_SPI) += rk8xx-spi.o
> obj-$(CONFIG_MFD_RN5T618) += rn5t618.o
> obj-$(CONFIG_MFD_SEC_CORE) += sec-core.o sec-irq.o
> +obj-$(CONFIG_MFD_S2DOS05) += s2dos05.o
Hm? How so? And how does it even work?
> obj-$(CONFIG_MFD_SYSCON) += syscon.o
> obj-$(CONFIG_MFD_LM3533) += lm3533-core.o lm3533-ctrlbank.o
> obj-$(CONFIG_MFD_VEXPRESS_SYSREG) += vexpress-sysreg.o
...
> +
> +static int max77705_suspend(struct device *dev)
> +{
> + struct i2c_client *i2c = to_i2c_client(dev);
> +
> + disable_irq(i2c->irq);
> +
> + if (device_may_wakeup(dev))
> + enable_irq_wake(i2c->irq);
> +
> + return 0;
> +}
> +
> +static int max77705_resume(struct device *dev)
> +{
> + struct i2c_client *i2c = to_i2c_client(dev);
> +
> + if (device_may_wakeup(dev))
> + disable_irq_wake(i2c->irq);
> +
> + enable_irq(i2c->irq);
> +
> + return 0;
> +}
> +DEFINE_SIMPLE_DEV_PM_OPS(max77705_pm_ops, max77705_suspend, max77705_resume);
> +
> +static const struct of_device_id max77705_i2c_of_match[] = {
> + { .compatible = "maxim,max77705" },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, max77705_i2c_of_match);
> +
> +static struct i2c_driver max77705_i2c_driver = {
> + .driver = {
> + .name = "max77705",
> + .of_match_table = max77705_i2c_of_match,
> + .pm = pm_sleep_ptr(&max77705_pm_ops),
> + .suppress_bind_attrs = true,
I don't see any reason for that. This is allowed only for core
SoC components and power supply driver is neither part of SoC, nor a
core component.
Best regards,
Krzysztof