]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
i3c: don't fail if GETHDRCAP is unsupported
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Fri, 4 Jul 2025 20:44:32 +0000 (22:44 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 7 Jul 2025 21:14:26 +0000 (23:14 +0200)
'I3C_BCR_HDR_CAP' is still spec v1.0 and has been renamed to 'advanced
capabilities' in v1.1 onwards. The ST pressure sensor LPS22DF does not
have HDR, but has the 'advanced cap' bit set. The core still wants to
get additional information using the CCC 'GETHDRCAP' (or GETCAPS in v1.1
onwards). Not all controllers support this CCC and will notify the upper
layers about it. For instantiating the device, we can ignore this
unsupported CCC as standard communication will work. Without this patch,
the device will not be instantiated at all.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250704204524.6124-1-wsa+renesas@sang-engineering.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/i3c/master.c

index 68b8ea9174b984a6c89b389c4b3a9669239def70..dfa0bad991cf7279e876fb4899f4fba3f17d29bd 100644 (file)
@@ -1439,7 +1439,7 @@ static int i3c_master_retrieve_dev_info(struct i3c_dev_desc *dev)
 
        if (dev->info.bcr & I3C_BCR_HDR_CAP) {
                ret = i3c_master_gethdrcap_locked(master, &dev->info);
-               if (ret)
+               if (ret && ret != -ENOTSUPP)
                        return ret;
        }