]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
usb: typec: fsa4480: Relax CHIP_ID check
authorLuca Weiss <luca.weiss@fairphone.com>
Sun, 18 Aug 2024 20:21:01 +0000 (22:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Aug 2024 09:29:40 +0000 (17:29 +0800)
Some FSA4480-compatible chips like the OCP96011 used on Fairphone 5
return 0x00 from the CHIP_ID register. Handle that gracefully and only
fail probe when the I2C read has failed.

With this the dev_dbg will print 0 but otherwise continue working.

  [    0.251581] fsa4480 1-0042: Found FSA4480 v0.0 (Vendor ID = 0)

Cc: stable@vger.kernel.org
Fixes: e885f5f1f2b4 ("usb: typec: fsa4480: Check if the chip is really there")
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240818-fsa4480-chipid-fix-v1-1-17c239435cf7@fairphone.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/mux/fsa4480.c

index cd235339834b0b8aa0492e9eb194e283dc5b0958..f71dba8bf07c981a97c71f04bb00aca3b3738dd5 100644 (file)
@@ -274,7 +274,7 @@ static int fsa4480_probe(struct i2c_client *client)
                return dev_err_probe(dev, PTR_ERR(fsa->regmap), "failed to initialize regmap\n");
 
        ret = regmap_read(fsa->regmap, FSA4480_DEVICE_ID, &val);
-       if (ret || !val)
+       if (ret)
                return dev_err_probe(dev, -ENODEV, "FSA4480 not found\n");
 
        dev_dbg(dev, "Found FSA4480 v%lu.%lu (Vendor ID = %lu)\n",