From: Chanwoo Choi <chanwoo@kernel.org>
To: Yannis Bolliger <yannis.bolliger@protonmail.com>,
MyungJoo Ham <myungjoo.ham@samsung.com>,
Chanwoo Choi <cw00.choi@samsung.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] extcon: usbc-tusb320: Make typec-power-opmode optional
Date: Mon, 24 Nov 2025 00:53:08 +0900 [thread overview]
Message-ID: <00ea1f56-335f-4c87-87c6-a92fd258769c@kernel.org> (raw)
In-Reply-To: <aPKZJ6WTZlhSOyST@yaene-desktop>
25. 10. 18. 04:30에 Yannis Bolliger 이(가) 쓴 글:
> The driver returned an error in the probe function when a usb c
> connector is configured in the DT without a "typec-power-opmode"
> property. This property is used to initialize the CURRENT_MODE_ADVERTISE
> register of the TUSB320, which is unused when operating as a UFP.
> Requiring this property causes unnecessary configuration overhead and
> inconsistency with the USB connector DT bindings, which do not specify
> it as required.
>
> This change makes typec-power-opmode optional. When the property is not
> present, the driver will skip programming the CURRENT_MODE_ADVERTISE
> register and rely on the hardware default.
>
> Signed-off-by: Yannis Bolliger <yannis.bolliger@protonmail.com>
> ---
> drivers/extcon/extcon-usbc-tusb320.c | 25 +++++++++++--------------
> 1 file changed, 11 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/extcon/extcon-usbc-tusb320.c b/drivers/extcon/extcon-usbc-tusb320.c
> index 2eab341de6b7..b8ff91010e63 100644
> --- a/drivers/extcon/extcon-usbc-tusb320.c
> +++ b/drivers/extcon/extcon-usbc-tusb320.c
> @@ -454,20 +454,17 @@ static int tusb320_typec_probe(struct i2c_client *client,
> priv->port_type = priv->cap.type;
>
> /* This goes into register 0x8 field CURRENT_MODE_ADVERTISE */
> - ret = fwnode_property_read_string(connector, "typec-power-opmode", &cap_str);
> - if (ret)
> - goto err_put;
> -
> - ret = typec_find_pwr_opmode(cap_str);
> - if (ret < 0)
> - goto err_put;
> -
> - priv->pwr_opmode = ret;
> -
> - /* Initialize the hardware with the devicetree settings. */
> - ret = tusb320_set_adv_pwr_mode(priv);
> - if (ret)
> - goto err_put;
> + if (!fwnode_property_read_string(connector, "typec-power-opmode",
> + &cap_str)) {
> + ret = typec_find_pwr_opmode(cap_str);
> + if (ret < 0)
> + goto err_put;
> + priv->pwr_opmode = ret;
> + /* Initialize the hardware with the devicetree settings. */
> + ret = tusb320_set_adv_pwr_mode(priv);
> + if (ret)
> + goto err_put;
> + }
>
> priv->cap.revision = USB_TYPEC_REV_1_1;
> priv->cap.accessory[0] = TYPEC_ACCESSORY_AUDIO;
Applied it. Thanks.
--
Best Regards,
Samsung Electronics
Chanwoo Choi
prev parent reply other threads:[~2025-11-23 15:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-17 19:30 [PATCH] extcon: usbc-tusb320: Make typec-power-opmode optional Yannis Bolliger
2025-11-23 15:53 ` Chanwoo Choi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=00ea1f56-335f-4c87-87c6-a92fd258769c@kernel.org \
--to=chanwoo@kernel.org \
--cc=cw00.choi@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=yannis.bolliger@protonmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox