Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: typec: mux: fsa4480: add regulator support

The fsa4480 vcc lane could be driven by some external regulator.
This patch is adding support to enable the regulator before probing.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250404-ml-topic-typec-mux-fs4480-v1-1-475377ef22a3@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Michael Grzeschik and committed by
Greg Kroah-Hartman
89ecf105 f41f7b3d

+5
+5
drivers/usb/typec/mux/fsa4480.c
··· 12 12 #include <linux/regmap.h> 13 13 #include <linux/usb/typec_dp.h> 14 14 #include <linux/usb/typec_mux.h> 15 + #include <linux/regulator/consumer.h> 15 16 16 17 #define FSA4480_DEVICE_ID 0x00 17 18 #define FSA4480_DEVICE_ID_VENDOR_ID GENMASK(7, 6) ··· 273 272 fsa->regmap = devm_regmap_init_i2c(client, &fsa4480_regmap_config); 274 273 if (IS_ERR(fsa->regmap)) 275 274 return dev_err_probe(dev, PTR_ERR(fsa->regmap), "failed to initialize regmap\n"); 275 + 276 + ret = devm_regulator_get_enable_optional(dev, "vcc"); 277 + if (ret && ret != -ENODEV) 278 + return dev_err_probe(dev, ret, "Failed to get regulator\n"); 276 279 277 280 ret = regmap_read(fsa->regmap, FSA4480_DEVICE_ID, &val); 278 281 if (ret)