[PATCH v2 4/8] phy: qcom-qmp-combo: Introduce orientation variable

Johan Hovold johan at kernel.org
Fri May 12 02:22:28 PDT 2023


On Tue, May 09, 2023 at 08:19:26PM -0700, Bjorn Andersson wrote:
> In multiple places throughout the driver code has been written in
> prepration for handling of orientation switching.
> 
> Introduce a typec_orientation in qmp_combo and fill out the various
> "placeholders" with the associated logic. By initializing the
> orientation to "normal" this change has no functional impact, but
> reduces the size of the upcoming introduction of dynamic orientation
> switching.
> 
> Signed-off-by: Bjorn Andersson <quic_bjorande at quicinc.com>
> Reviewed-by: Neil Armstrong <neil.armstrong at linaro.org>
> Tested-by: Abel Vesa <abel.vesa at linaro.org>
> Tested-by: Steev Klimaszewski <steev at kali.org>
> Tested-by: Neil Armstrong <neil.armstrong at linaro.org> # on HDK8450
> Tested-by: Johan Hovold <johan+linaro at kernel.org>	# X13s
> ---
> 
> Changes since v1:
> - X-mas in qmp_combo_configure_dp_mode()
> 
>  drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 54 +++++++++++++----------
>  1 file changed, 30 insertions(+), 24 deletions(-)
 
>  static bool qmp_combo_configure_dp_mode(struct qmp_combo *qmp)
>  {
> +	bool reverse = qmp->orientation == TYPEC_ORIENTATION_REVERSE;

Nit: I still think parentheses around the right-hand side would improve
readability.

> +	const struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts;
>  	u32 val;
> -	bool reverse = false;

> @@ -2235,7 +2236,7 @@ static int qmp_v4_configure_dp_phy(struct qmp_combo *qmp)
>  {
>  	const struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts;
>  	u32 bias0_en, drvr0_en, bias1_en, drvr1_en;
> -	bool reverse = false;
> +	bool reverse = qmp->orientation == TYPEC_ORIENTATION_REVERSE;

Same here and below.

And maintaining reverse xmas style throughout the driver would be nice
for consistency too.

>  	u32 status;
>  	int ret;

Looks good otherwise:

Reviewed-by: Johan Hovold <johan+linaro at kernel.org>

Johan



More information about the linux-phy mailing list