All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: saranya.gopal@intel.com, Hans de Goede <hdegoede@redhat.com>
Cc: linux-usb@vger.kernel.org, sathyanarayanan.kuppuswamy@intel.com,
	abhilash.k.v@intel.com, M Balaji <m.balaji@intel.com>
Subject: [V6] roles: Fix USB 3.0 OTG issue on Intel platform
Date: Fri, 7 Sep 2018 11:18:31 +0300	[thread overview]
Message-ID: <20180907081831.GG25121@kuha.fi.intel.com> (raw)

+Hans

On Fri, Sep 07, 2018 at 12:32:01PM +0530, saranya.gopal@intel.com wrote:
> From: Saranya Gopal <saranya.gopal@intel.com>
> 
> This patch adds static DRD mode for host/device
> mode switch. This fixes the issue where device
> mode was not working after DUT switches to host
> mode with 3.0 OTG connector.
> 
> Signed-off-by: Saranya Gopal <saranya.gopal@intel.com>
> Signed-off-by: M Balaji <m.balaji@intel.com>
> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> ---
>  changes since V5: Corrected the name format in From and Signed-off-by
>  changes since V4: Removed change-Id
>  changes since V3: Added Reviewed-by Sathyanarayanan tag
>  changes since V2: Incorporated Heikki's review comments and added Reviewed-by Heikki tag
>  changes since V1: none
> 
>  drivers/usb/roles/intel-xhci-usb-role-switch.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/roles/intel-xhci-usb-role-switch.c b/drivers/usb/roles/intel-xhci-usb-role-switch.c
> index dad2d19..0d1ea82 100644
> --- a/drivers/usb/roles/intel-xhci-usb-role-switch.c
> +++ b/drivers/usb/roles/intel-xhci-usb-role-switch.c
> @@ -25,6 +25,9 @@
>  #define SW_VBUS_VALID			BIT(24)
>  #define SW_IDPIN_EN			BIT(21)
>  #define SW_IDPIN			BIT(20)
> +#define SW_SWITCH_EN_CFG0		BIT(16)
> +#define SW_DRD_STATIC_HOST_CFG0		1
> +#define SW_DRD_STATIC_DEV_CFG0		2
>  
>  #define DUAL_ROLE_CFG1			0x6c
>  #define HOST_MODE			BIT(29)
> @@ -83,17 +86,22 @@ static int intel_xhci_usb_set_role(struct device *dev, enum usb_role role)
>  	case USB_ROLE_NONE:
>  		val |= SW_IDPIN;
>  		val &= ~SW_VBUS_VALID;
> +		val &= ~(SW_DRD_STATIC_DEV_CFG0 | SW_DRD_STATIC_HOST_CFG0);
>  		break;
>  	case USB_ROLE_HOST:
>  		val &= ~SW_IDPIN;
>  		val &= ~SW_VBUS_VALID;
> +		val &= ~SW_DRD_STATIC_DEV_CFG0;
> +		val |= SW_DRD_STATIC_HOST_CFG0;
>  		break;
>  	case USB_ROLE_DEVICE:
>  		val |= SW_IDPIN;
>  		val |= SW_VBUS_VALID;
> +		val &= ~SW_DRD_STATIC_HOST_CFG0;
> +		val |= SW_DRD_STATIC_DEV_CFG0;
>  		break;
>  	}
> -	val |= SW_IDPIN_EN;
> +	val |= SW_IDPIN_EN | SW_SWITCH_EN_CFG0;
>  
>  	writel(val, data->base + DUAL_ROLE_CFG0);
>  
> -- 
> 2.7.4

Thanks,

             reply	other threads:[~2018-09-07  8:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-07  8:18 Heikki Krogerus [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-09-10 10:32 [V6] roles: Fix USB 3.0 OTG issue on Intel platform Heikki Krogerus
2018-09-10 10:17 Hans de Goede
2018-09-10 10:13 Heikki Krogerus
2018-09-09 11:18 Hans de Goede
2018-09-07  8:37 Greg Kroah-Hartman
2018-09-07  8:33 Felipe Balbi
2018-09-07  8:12 saranya.gopal
2018-09-07  7:18 Greg Kroah-Hartman
2018-09-07  7:02 saranya.gopal

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=20180907081831.GG25121@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=abhilash.k.v@intel.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.balaji@intel.com \
    --cc=saranya.gopal@intel.com \
    --cc=sathyanarayanan.kuppuswamy@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.