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: gpio-sbu: Make enable gpio optional

The enable gpio is not required when the SBU mux is used only for
orientation, make it optional.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240603083558.9629-3-francesco@dolcini.it
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Francesco Dolcini and committed by
Greg Kroah-Hartman
df1c5d55 f12e04c3

+5 -1
+5 -1
drivers/usb/typec/mux/gpio-sbu-mux.c
··· 66 66 { 67 67 struct gpio_sbu_mux *sbu_mux = typec_mux_get_drvdata(mux); 68 68 69 + if (!sbu_mux->enable_gpio) 70 + return -EOPNOTSUPP; 71 + 69 72 mutex_lock(&sbu_mux->lock); 70 73 71 74 switch (state->mode) { ··· 105 102 106 103 mutex_init(&sbu_mux->lock); 107 104 108 - sbu_mux->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); 105 + sbu_mux->enable_gpio = devm_gpiod_get_optional(dev, "enable", 106 + GPIOD_OUT_LOW); 109 107 if (IS_ERR(sbu_mux->enable_gpio)) 110 108 return dev_err_probe(dev, PTR_ERR(sbu_mux->enable_gpio), 111 109 "unable to acquire enable gpio\n");