Re: [PATCH v3 12/23] mfd: Add new driver for MAX77705 PMIC
Hi Dzmitry, kernel test robot noticed the following build errors: [auto build test ERROR on 6906a84c482f098d31486df8dc98cead21cce2d0] url: https://github.com/intel-lab-lkp/linux/commits/Dzmitry-Sankouski/power-supply-add-undervoltage-health-status-property/20240618-222456 base: 6906a84c482f098d31486df8dc98cead21cce2d0 patch link: https://lore.kernel.org/r/20240618-starqltechn_integration_upstream-v3-12-e3f6662017ac%40gmail.com patch subject: [PATCH v3 12/23] mfd: Add new driver for MAX77705 PMIC config: riscv-allmodconfig (https://download.01.org/0day-ci/archive/20240622/202406220754.8crtewer-...@intel.com/config) compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project ad79a14c9e5ec4a369eed4adf567c22cc029863f) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240622/202406220754.8crtewer-...@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202406220754.8crtewer-...@intel.com/ All errors (new ones prefixed by >>): In file included from drivers/mfd/max77705-core.c:14: In file included from include/linux/i2c.h:19: In file included from include/linux/regulator/consumer.h:35: In file included from include/linux/suspend.h:5: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:13: In file included from include/linux/cgroup.h:25: In file included from include/linux/kernel_stat.h:8: In file included from include/linux/interrupt.h:22: In file included from arch/riscv/include/asm/sections.h:9: In file included from include/linux/mm.h:2214: include/linux/vmstat.h:484:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 484 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + |~ ^ 485 |item]; | include/linux/vmstat.h:491:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 491 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + |~ ^ 492 |NR_VM_NUMA_EVENT_ITEMS + |~~ include/linux/vmstat.h:498:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 498 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~ ^ ~~~ include/linux/vmstat.h:503:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 503 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + |~ ^ 504 |NR_VM_NUMA_EVENT_ITEMS + |~~ include/linux/vmstat.h:512:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 512 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + |~ ^ 513 |NR_VM_NUMA_EVENT_ITEMS + |~~ In file included from drivers/mfd/max77705-core.c:20: >> include/linux/mfd/max77705-private.h:243:19: error: use of undeclared >> identifier 'MAX77705_USBC_REG_END'; did you mean 'MAX77705_PMIC_REG_END'? 243 | u8 reg_muic_dump[MAX77705_USBC_REG_END]; | ^ | MAX77705_PMIC_REG_END include/linux/mfd/max77705-private.h:96:2: note: 'MAX77705_PMIC_REG_END' declared here 96 | MAX77705_PMIC_REG_END, | ^ 5 warnings and 1 error generated. vim +243 include/linux/mfd/max77705-private.h 216 217 struct max77705_dev { 218 struct device *dev; 219 struct i2c_client *i2c; /* 0xCC; Haptic, PMIC */ 220 struct i2c_client *charger; /* 0xD2; Charger */ 221 struct i2c_client *fuelgauge; /* 0x6C; Fuelgauge */ 222 struct i2c_client *muic; /* 0x4A; MUIC */ 223 struct i2c_client *debug; /* 0xC4; Debug */ 224 struct mutex i2c_lock; 225 226 struct regmap *regmap; 227 struct regmap *regmap_fg; 228 struct regmap *regmap_charger; 229 struct regmap *regmap_leds; 230 231 int type; 232 233 int
Re: [PATCH v3 12/23] mfd: Add new driver for MAX77705 PMIC
Hi Dzmitry, kernel test robot noticed the following build errors: [auto build test ERROR on 6906a84c482f098d31486df8dc98cead21cce2d0] url: https://github.com/intel-lab-lkp/linux/commits/Dzmitry-Sankouski/power-supply-add-undervoltage-health-status-property/20240618-222456 base: 6906a84c482f098d31486df8dc98cead21cce2d0 patch link: https://lore.kernel.org/r/20240618-starqltechn_integration_upstream-v3-12-e3f6662017ac%40gmail.com patch subject: [PATCH v3 12/23] mfd: Add new driver for MAX77705 PMIC config: mips-allmodconfig (https://download.01.org/0day-ci/archive/20240622/202406220025.tzn8maew-...@intel.com/config) compiler: mips-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240622/202406220025.tzn8maew-...@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202406220025.tzn8maew-...@intel.com/ All errors (new ones prefixed by >>): In file included from drivers/mfd/max77705-core.c:20: >> include/linux/mfd/max77705-private.h:243:26: error: 'MAX77705_USBC_REG_END' >> undeclared here (not in a function); did you mean 'MAX77705_PMIC_REG_END'? 243 | u8 reg_muic_dump[MAX77705_USBC_REG_END]; | ^ | MAX77705_PMIC_REG_END vim +243 include/linux/mfd/max77705-private.h 216 217 struct max77705_dev { 218 struct device *dev; 219 struct i2c_client *i2c; /* 0xCC; Haptic, PMIC */ 220 struct i2c_client *charger; /* 0xD2; Charger */ 221 struct i2c_client *fuelgauge; /* 0x6C; Fuelgauge */ 222 struct i2c_client *muic; /* 0x4A; MUIC */ 223 struct i2c_client *debug; /* 0xC4; Debug */ 224 struct mutex i2c_lock; 225 226 struct regmap *regmap; 227 struct regmap *regmap_fg; 228 struct regmap *regmap_charger; 229 struct regmap *regmap_leds; 230 231 int type; 232 233 int irq; 234 int irq_base; 235 int irq_masks_cur[MAX77705_IRQ_GROUP_NR]; 236 int irq_masks_cache[MAX77705_IRQ_GROUP_NR]; 237 bool wakeup; 238 struct mutex irqlock; 239 240 #ifdef CONFIG_HIBERNATION 241 /* For hibernation */ 242 u8 reg_pmic_dump[MAX77705_PMIC_REG_END]; > 243 u8 reg_muic_dump[MAX77705_USBC_REG_END]; 244 u8 reg_led_dump[MAX77705_LED_REG_END]; 245 #endif 246 247 /* pmic VER/REV register */ 248 u8 pmic_rev;/* pmic Rev */ 249 u8 pmic_ver;/* pmic version */ 250 251 u8 cc_booting_complete; 252 253 wait_queue_head_t queue_empty_wait_q; 254 int doing_irq; 255 int is_usbc_queue; 256 257 struct max77705_platform_data *pdata; 258 }; 259 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Re: [PATCH v3 12/23] mfd: Add new driver for MAX77705 PMIC
On 18/06/2024 15:59, Dzmitry Sankouski wrote: > Add the core MFD driver for max77705 PMIC. We define five sub-devices > for which the drivers will be added in subsequent patches. > > Signed-off-by: Dzmitry Sankouski > Co-authored-by: Rose Hudson > --- > MAINTAINERS | 2 + > drivers/mfd/Kconfig | 12 ++ > drivers/mfd/Makefile | 3 + > drivers/mfd/max77705-core.c | 278 > drivers/mfd/max77705-irq.c | 299 > +++ > include/linux/mfd/max77705-private.h | 281 > include/linux/mfd/max77705.h | 20 +++ > 7 files changed, 895 insertions(+) > > diff --git a/MAINTAINERS b/MAINTAINERS > index fae3b8ea9ce4..f66f08825db9 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -13690,6 +13690,7 @@ F:drivers/*/*max77843.c > F: drivers/*/max14577*.c > F: drivers/*/max77686*.c > F: drivers/*/max77693*.c > +F: drivers/*/max77705*.c > F: drivers/clk/clk-max77686.c > F: drivers/extcon/extcon-max14577.c > F: drivers/extcon/extcon-max77693.c > @@ -13697,6 +13698,7 @@ F:drivers/rtc/rtc-max77686.c > F: include/linux/mfd/max14577*.h > F: include/linux/mfd/max77686*.h > F: include/linux/mfd/max77693*.h > +F: include/linux/mfd/max77705*.h > > MAXIRADIO FM RADIO RECEIVER DRIVER > M: Hans Verkuil > diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig > index 266b4f54af60..c4eb8ff2dcad 100644 > --- a/drivers/mfd/Kconfig > +++ b/drivers/mfd/Kconfig > @@ -880,6 +880,18 @@ config MFD_MAX77693 > additional drivers must be enabled in order to use the functionality > of the device. > > +config MFD_MAX77705 > + tristate "Maxim Semiconductor MAX77705 PMIC Support" > + depends on I2C > + select MFD_CORE > + help > + Say yes here to add support for Maxim Semiconductor MAX77705. > + This is a Power Management IC with Charger, safe LDOs, Flash, Haptic > + and MUIC controls on chip. > + This driver provides common support for accessing the device; > + additional drivers must be enabled in order to use the functionality > + of the device. > + > config MFD_MAX77714 > tristate "Maxim Semiconductor MAX77714 PMIC Support" > depends on I2C > diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile > index db1ba39de3b5..bf65cc36d59c 100644 > --- a/drivers/mfd/Makefile > +++ b/drivers/mfd/Makefile > @@ -162,6 +162,8 @@ obj-$(CONFIG_MFD_MAX77620)+= max77620.o > obj-$(CONFIG_MFD_MAX77650) += max77650.o > obj-$(CONFIG_MFD_MAX77686) += max77686.o > obj-$(CONFIG_MFD_MAX77693) += max77693.o > +max77705-objs := max77705-core.o max77705-irq.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 > @@ -226,6 +228,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 ??? That's not related. > obj-$(CONFIG_MFD_SYSCON) += syscon.o > obj-$(CONFIG_MFD_LM3533) += lm3533-core.o lm3533-ctrlbank.o > obj-$(CONFIG_MFD_VEXPRESS_SYSREG)+= vexpress-sysreg.o > diff --git a/drivers/mfd/max77705-core.c b/drivers/mfd/max77705-core.c > new file mode 100644 > index ..7cb71a0a9688 > --- /dev/null > +++ b/drivers/mfd/max77705-core.c > @@ -0,0 +1,278 @@ > +// SPDX-License-Identifier: GPL-2.0-or-later > +/* > + * max77705.c - mfd core driver for the Maxim 77705 > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + * > + * Copyright (C) 2024 Dzmitry Sankouski > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define I2C_ADDR_PMIC(0xCC >> 1) /* Top sys, Haptic */ > +#define I2C_ADDR_MUIC(0x4A >> 1) > +#define I2C_ADDR_CHG(0xD2 >> 1) > +#define I2C_ADDR_FG (0x6C >> 1) > +#define I2C_ADDR_DEBUG (0xC4 >> 1) > + > +static struct dentry *debugfs_file; > + > +static int max77705_debugfs_show(struct seq_file *s, void *data) > +{ > + struct max77705_dev *max77705 = s->private; > + struct regmap *regmap = max77705->regmap; > + unsigned int i, reg, reg_data, pmic_id, pmic_rev; > + int regs[] = { > + MAX77705_PMIC_REG_MAINCTRL1, > + MAX77705_PMIC_REG_MCONFIG, > + MAX77705_PMIC_REG_MCONFIG2, > + MAX77705_PMIC_REG_INTSRC, > + MAX77705_PMIC_REG_INTSRC_MASK, > + MAX77705_PMIC_REG_SYSTEM_INT, > +