]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: typec: fsa4480: Check if the chip is really there
authorKonrad Dybcio <konrad.dybcio@linaro.org>
Mon, 29 Jul 2024 08:42:58 +0000 (10:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Aug 2024 13:34:27 +0000 (15:34 +0200)
commiteaf01a990645a0be78f9aeeae02bb7bd4794dfb0
tree7e75a3cb59d5fe04194aaf0b7c35dfd0e007bdbf
parent9db7aabbcf94d1406acd2dc4bc202827c9324e40
usb: typec: fsa4480: Check if the chip is really there

commit e885f5f1f2b43575aa8e4e31404132d77d6663d1 upstream.

Currently, the driver will happily register the switch/mux devices, and
so long as the i2c master doesn't complain, the user would never know
there's something wrong.

Add a device id check (based on [1]) and return -ENODEV if the read
fails or returns nonsense.

Checking the value on a Qualcomm SM6115P-based Lenovo Tab P11 tablet,
the ID mentioned in the datasheet does indeed show up:
 fsa4480 1-0042: Found FSA4480 v1.1 (Vendor ID = 0)

[1] https://www.onsemi.com/pdf/datasheet/fsa4480-d.pdf

Fixes: 1dc246320c6b ("usb: typec: mux: Add On Semi fsa4480 driver")
Cc: stable <stable@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20240729-topic-fs4480_check-v3-1-f5bf732d3424@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/mux/fsa4480.c