Skip to contentSkip to conversation

media: cec: meson: ao-cec-g12a: name the CEC core regmap to avoid debugfs clash

PATCH In review Yi Ding 2 participants 2 messages May 29

Subsystems (4)
lore
Share & tools
lore

Yi Ding

author
#0 lore raw

PATCH 1/1 media: cec: meson: ao-cec-g12a: name the CEC core regmap to avoid debugfs clash

The driver registers two regmaps on the same platform device: an MMIO regmap for the AO CEC registers, and an indirect regmap (using reg_read()/reg_write() callbacks) for the CEC controller core registers. Neither regmap_config sets a .name, so both default their debugfs directory to the device name and collide:

debugfs: 'ff800280.cec' already exists in 'regmap'

Because of the clash the second regmap's debugfs directory fails to register, so its registers can no longer be inspected via debugfs.

Give the indirect CEC core regmap a distinct name. The two debugfs directories then become "<dev>.cec" and "<dev>.cec-core". This only affects debugfs naming; register access is unchanged.

Tested on an ODROID-N2 (Amlogic S922X): the warning is gone and both /sys/kernel/debug/regmap/ff800280.cec and ff800280.cec-core are present.

Fixes b7778c46683c ("media: platform: meson: Add Amlogic Meson G12A AO CEC Controller driver")
Assisted-by Claude:claude-opus-4-8
---
 drivers/media/cec/platform/meson/ao-cec-g12a.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/cec/platform/meson/ao-cec-g12a.c +1 -0
index 41f5b8669..2c914f000 100644
@@ -405,6 +405,7 @@ static int meson_ao_cec_g12a_write(void *context, unsigned int addr,
 }
 
 static const struct regmap_config meson_ao_cec_g12a_cec_regmap_conf = {
+	.name = "core",
 	.reg_bits = 8,
 	.val_bits = 8,
 	.reg_read = meson_ao_cec_g12a_read,
Signature · 1 line
2.47.3
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 30 lines · Yi Ding

The driver registers two regmaps on the same platform device: an MMIO regmap for the AO CEC registers, and an indirect regmap (using reg_read()/reg_write() callbacks) for the CEC controller core registers. Neither regmap_config sets a .name, so both default their debugfs directory to the device name and collide:

debugfs: 'ff800280.cec' already exists in 'regmap'

Because of the clash the second regmap's debugfs directory fails to register, so its registers can no longer be inspected via debugfs.

Give the indirect CEC core regmap a distinct name. The two debugfs directories then become "<dev>.cec" and "<dev>.cec-core". This only affects debugfs naming; register access is unchanged.

Tested on an ODROID-N2 (Amlogic S922X): the warning is gone and both /sys/kernel/debug/regmap/ff800280.cec and ff800280.cec-core are present.

Fixes b7778c46683c ("media: platform: meson: Add Amlogic Meson G12A AO CEC Controller driver")
Assisted-by Claude:claude-opus-4-8
---
  drivers/media/cec/platform/meson/ao-cec-g12a.c | 1 +
  1 file changed, 1 insertion(+)
drivers/media/cec/platform/meson/ao-cec-g12a.c +0 -0
index 41f5b8669..2c914f000 100644

drivers/media/cec/platform/meson/ao-cec-g12a.c static int meson_ao_cec_g12a_write(void *context, unsigned int addr, · line 411

Quoted 7 lines
drivers/media/cec/platform/meson/ao-cec-g12a.c +1 -0
@@ -405,6 +405,7 @@ static int meson_ao_cec_g12a_write(void *context, unsigned int addr,
  }
 
  static const struct regmap_config meson_ao_cec_g12a_cec_regmap_conf = {
+	.name = "core",
  	.reg_bits = 8,
  	.val_bits = 8,
  	.reg_read = meson_ao_cec_g12a_read,

Good catch

Thanks,
Neil