From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Saranya Gopal <saranya.gopal@intel.com>
Cc: hdegoede@redhat.com, gregkh@linuxfoundation.org,
mathias.nyman@intel.com, linux-usb@vger.kernel.org,
Balaji Manoharan <m.balaji@intel.com>
Subject: Re: [PATCH v4 1/2] xhci-ext-caps.c: Add property to disable Intel SW switch
Date: Thu, 29 Aug 2019 14:03:48 +0300 [thread overview]
Message-ID: <20190829110348.GE5486@kuha.fi.intel.com> (raw)
In-Reply-To: <1567075327-24016-1-git-send-email-saranya.gopal@intel.com>
On Thu, Aug 29, 2019 at 04:12:06PM +0530, Saranya Gopal wrote:
> In platforms like Cherrytrail, 'SW switch enable' bit
> should not be enabled for role switch. This patch
> adds a property to Intel USB Role Switch platform driver
> to denote that SW switch should be disabled in
> Cherrytrail devices.
>
> Signed-off-by: Saranya Gopal <saranya.gopal@intel.com>
> Signed-off-by: Balaji Manoharan <m.balaji@intel.com>
> Suggested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> changes since v3: none
> changes since v2: Added suggested-by tag
> changes since v1: none
>
> drivers/usb/host/xhci-ext-caps.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-ext-caps.c b/drivers/usb/host/xhci-ext-caps.c
> index 399113f..f498160 100644
> --- a/drivers/usb/host/xhci-ext-caps.c
> +++ b/drivers/usb/host/xhci-ext-caps.c
> @@ -6,11 +6,20 @@
> */
>
> #include <linux/platform_device.h>
> +#include <linux/property.h>
> +#include <linux/pci.h>
> #include "xhci.h"
>
> #define USB_SW_DRV_NAME "intel_xhci_usb_sw"
> #define USB_SW_RESOURCE_SIZE 0x400
>
> +#define PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI 0x22b5
> +
> +static const struct property_entry role_switch_props[] = {
> + PROPERTY_ENTRY_BOOL("sw_switch_disable"),
> + {},
> +};
> +
> static void xhci_intel_unregister_pdev(void *arg)
> {
> platform_device_unregister(arg);
> @@ -21,6 +30,7 @@ static int xhci_create_intel_xhci_sw_pdev(struct xhci_hcd *xhci, u32 cap_offset)
> struct usb_hcd *hcd = xhci_to_hcd(xhci);
> struct device *dev = hcd->self.controller;
> struct platform_device *pdev;
> + struct pci_dev *pci = to_pci_dev(dev);
> struct resource res = { 0, };
> int ret;
>
> @@ -43,6 +53,14 @@ static int xhci_create_intel_xhci_sw_pdev(struct xhci_hcd *xhci, u32 cap_offset)
> return ret;
> }
>
> + if (pci->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI) {
> + ret = platform_device_add_properties(pdev, role_switch_props);
> + if (ret) {
> + dev_err(dev, "failed to register device properties\n");
> + return ret;
> + }
> + }
> +
> pdev->dev.parent = dev;
>
> ret = platform_device_add(pdev);
> --
> 1.9.1
thanks,
--
heikki
prev parent reply other threads:[~2019-08-29 11:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-29 10:42 [PATCH v4 1/2] xhci-ext-caps.c: Add property to disable Intel SW switch Saranya Gopal
2019-08-29 10:42 ` [PATCH v4 2/2] usb: roles: intel: Enable static DRD mode for role switch Saranya Gopal
2019-08-29 11:04 ` Hans de Goede
2019-08-29 11:11 ` Gopal, Saranya
2019-08-29 11:04 ` Heikki Krogerus
2019-08-29 11:03 ` Heikki Krogerus [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=20190829110348.GE5486@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=linux-usb@vger.kernel.org \
--cc=m.balaji@intel.com \
--cc=mathias.nyman@intel.com \
--cc=saranya.gopal@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.