All of lore.kernel.org
 help / color / mirror / Atom feed
From: Prashant Malani <pmalani@chromium.org>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	Benson Leung <bleung@chromium.org>,
	"Mani, Rajmohan" <rajmohan.mani@intel.com>,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: typec: mux: intel_pmc_mux: Fix DP alternate mode entry
Date: Fri, 29 May 2020 15:18:40 -0700	[thread overview]
Message-ID: <20200529221840.GA109930@google.com> (raw)
In-Reply-To: <20200529131753.15587-1-heikki.krogerus@linux.intel.com>

Hi Heikki,

On Fri, May 29, 2020 at 04:17:53PM +0300, Heikki Krogerus wrote:
> The PMC needs to be notified separately about HPD (hotplug
> detected) signal being high after mode entry. There is a bit
> "HPD High" in the Alternate Mode Request that the driver
> already sets, but that bit is only valid when the
> DisplayPort Alternate Mode is directly entered from
> disconnected state.
> 
> Fixes: 5c4edcdbcd97 ("usb: typec: mux: intel: Fix DP_HPD_LVL bit field")
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

Tried this out; my DP monitor seems to enumerate correctly, so:

Tested-by: Prashant Malani <pmalani@chromium.org>
> ---
>  drivers/usb/typec/mux/intel_pmc_mux.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c
> index 962bc69a6a59e..70ddc9d6d49e4 100644
> --- a/drivers/usb/typec/mux/intel_pmc_mux.c
> +++ b/drivers/usb/typec/mux/intel_pmc_mux.c
> @@ -148,7 +148,8 @@ pmc_usb_mux_dp_hpd(struct pmc_usb_port *port, struct typec_mux_state *state)
>  	msg[0] = PMC_USB_DP_HPD;
>  	msg[0] |= port->usb3_port << PMC_USB_MSG_USB3_PORT_SHIFT;
>  
> -	msg[1] = PMC_USB_DP_HPD_IRQ;
> +	if (data->status & DP_STATUS_IRQ_HPD)
> +		msg[1] = PMC_USB_DP_HPD_IRQ;
>  
>  	if (data->status & DP_STATUS_HPD_STATE)
>  		msg[1] |= PMC_USB_DP_HPD_LVL;
> @@ -161,6 +162,7 @@ pmc_usb_mux_dp(struct pmc_usb_port *port, struct typec_mux_state *state)
>  {
>  	struct typec_displayport_data *data = state->data;
>  	struct altmode_req req = { };
> +	int ret;
>  
>  	if (data->status & DP_STATUS_IRQ_HPD)
>  		return pmc_usb_mux_dp_hpd(port, state);
> @@ -181,7 +183,14 @@ pmc_usb_mux_dp(struct pmc_usb_port *port, struct typec_mux_state *state)
>  	if (data->status & DP_STATUS_HPD_STATE)
>  		req.mode_data |= PMC_USB_ALTMODE_HPD_HIGH;
>  
> -	return pmc_usb_command(port, (void *)&req, sizeof(req));
> +	ret = pmc_usb_command(port, (void *)&req, sizeof(req));
> +	if (ret)
> +		return ret;
> +
> +	if (data->status & DP_STATUS_HPD_STATE)
> +		return pmc_usb_mux_dp_hpd(port, state);
> +
> +	return 0;
>  }
>  
>  static int
> -- 
> 2.26.2
> 

      reply	other threads:[~2020-05-29 22:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29 13:17 [PATCH] usb: typec: mux: intel_pmc_mux: Fix DP alternate mode entry Heikki Krogerus
2020-05-29 22:18 ` Prashant Malani [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=20200529221840.GA109930@google.com \
    --to=pmalani@chromium.org \
    --cc=bleung@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=rajmohan.mani@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.