[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <02a2787a-1fb9-4238-820b-c3b1e8460e5a@wanadoo.fr>
Date: Sat, 9 Dec 2023 09:42:49 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Neil Armstrong <neil.armstrong@...aro.org>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>
Cc: linux-arm-msm@...r.kernel.org, linux-usb@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] usb: typec: mux: add Qualcomm WCD939X USB SubSystem
Altmode Mux driver
Le 08/12/2023 à 16:27, Neil Armstrong a écrit :
> Qualcomm WCD9390/WCD9395 is a standalone Hi-Fi audio codec IC with a
> functionally separate USB SubSystem for Altmode/Analog Audio Switch
> accessible over an I2C interface.
>
> It provides switching USB-C USB2.0 lines between USB and Audio Headphones
> speaker lines, and the USB-C SBU lines between DisplayPort AUX and Audio
> Headphones Microphone/Ground.
>
> The Audio Headphone and Microphone data path between the Codec and the
> USB-C Mux subsystems are external to the IC, thus requiring DT
> port-endpoint graph description to handle USB-C altmode & orientation
> switching for Audio Accessory Mode.
>
> Signed-off-by: Neil Armstrong <neil.armstrong@...aro.org>
> ---
...
> + usbss->sw = typec_switch_register(dev, &sw_desc);
> + if (IS_ERR(usbss->sw)) {
> + ret = dev_err_probe(dev, PTR_ERR(usbss->sw), "failed to register typec switch\n");
> + goto err_regulator_disable;
> + }
> +
> + mux_desc.drvdata = usbss;
> + mux_desc.fwnode = dev_fwnode(dev);
> + mux_desc.set = wcd939x_usbss_mux_set;
> +
> + usbss->mux = typec_mux_register(dev, &mux_desc);
> + if (IS_ERR(usbss->mux)) {
> + typec_switch_unregister(usbss->sw);
Already called at the 'err_switch_unregister' label below.
> + ret = dev_err_probe(dev, PTR_ERR(usbss->mux), "failed to register typec mux\n");
> + goto err_switch_unregister;
> + }
> +
> + i2c_set_clientdata(client, usbss);
> +
> + return 0;
> +
> +err_switch_unregister:
> + typec_switch_unregister(usbss->sw);
> +
> +err_regulator_disable:
> + regulator_disable(usbss->vdd_supply);
> +
> +err_mux_switch:
> + typec_switch_put(usbss->codec_switch);
> +
> +err_mux_put:
> + typec_mux_put(usbss->codec);
> +
> + return ret;
> +}
> +
> +static void wcd939x_usbss_remove(struct i2c_client *client)
> +{
> + struct wcd939x_usbss *usbss = i2c_get_clientdata(client);
> +
> + typec_mux_unregister(usbss->mux);
> + typec_switch_unregister(usbss->sw);
> +
> + regulator_disable(usbss->vdd_supply);
Based on error hadling of the probe: typec_switch_put() missing?
> +
> + typec_mux_put(usbss->codec);
> +}
CJ
Powered by blists - more mailing lists