]> Gentwo Git Trees - linux/.git/commitdiff
mfd: da9063: Occupy second I2C address
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 23 Oct 2025 06:55:59 +0000 (08:55 +0200)
committerLee Jones <lee@kernel.org>
Thu, 6 Nov 2025 14:03:46 +0000 (14:03 +0000)
The second address can be used as a shortcut to access register pages
2+3. The driver does not use this feature yet. The second address should
still be marked as used, otherwise userspace could interfere with the
driver.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Peter Rosin <peda@axentia.se>
Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Link: https://patch.msgid.link/20251023065610.2855-2-wsa+renesas@sang-engineering.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/da9063-i2c.c

index 1ec9ab56442dfc0322fe0dc96a28f93660013362..a803b7440f09bc87ce46c51d9f780c1789597504 100644 (file)
@@ -469,6 +469,9 @@ static int da9063_i2c_probe(struct i2c_client *i2c)
                }
        }
 
+       /* Reserve our unused second address so userspace won't interfere */
+       devm_i2c_new_dummy_device(&i2c->dev, i2c->adapter, i2c->addr + 1);
+
        return da9063_device_init(da9063, i2c->irq);
 }