Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1283269
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCHv2 2/2] usb: pci-quirks: register USB mux found on Cherrytrail SOC |
| Date | Thu, 03 Dec 2015 20:10:02 +0100 |
| Message-ID | <qBHqq-Kh-19@gated-at.bofh.it> (permalink) |
| References | <qBywN-38I-9@gated-at.bofh.it> <qBywO-38I-21@gated-at.bofh.it> |
| X-Original-To | Heikki Krogerus <heikki.krogerus@linux.intel.com>, Chanwoo Choi <cw00.choi@samsung.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=5+aMwcdi8gtj7QevY18zi38x10C3NW2AvClQKMNJvQI=; b=QrU+NjG6Ws/u038i8nJTohNrX4vQY+w7Wzs9Yx3sU4gurPDJsWU6iQ4obivFNefaCQ oUW1sZSczM6C0xyG1WQ++MHiRcRkuxfTAsGIOWyoQxGD7hbxDxTmHI6k5nhuz7s6kNFp 7/m8NPxEHrjapZKcS7yw6b/uXVlKa2Dbz4znwG1nCqhdKjxdtMEi15hBarrRjIAoGEmo MoPM7w8u+wDIFAUo/y38LFfNVop766rKXc06VK5/ybk4UwFyA5py8beb2GT0yvPMkGd8 8MQv91C4f1miEE7kfWYtaOjYk+Op8y0UqMnNFJHncwLX03i5IWG2yO2ATy10CN87levp nAfA== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:organization :message-id:date:user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=5+aMwcdi8gtj7QevY18zi38x10C3NW2AvClQKMNJvQI=; b=KCs9zuUV7eFhrR+CbOZ47BkhVeNxynvWYPioGkzp7B8qzw1pejpBgkCJIoFcBtKSzU 79X0xIBe4wltXoec+FYzbPrtNOoV7RrKGffT8MqvSgCULC1WflgNa8all8ON/BZcil1k ijyciOv2NnsnWSssBL4wovJ71j22lPVEPrPB+pTxHobtlrZlX5tqoFJKSBx68emiEugD 93ObDlf1iMUrxznbsCG/lUJ1E4esjH0pVMkzK1Ur98RbT8shovpGAPKUydpDO3MTJj93 1UQwslvsIPpdT7IUWBLoaQO6Xl49ueaw7tEjrmg7Wd5Qmf7UZgek0ZOCspWrgFW7zMZB LwBQ== |
| X-Gm-Message-State | ALoCoQnoANVHbtNow8QRVl9mL2oTOk8sLZknk4wlC9gusGHXhkxF9Rg1WxtP9/Z6YamQEQceiHLG |
| X-Received | by 10.25.20.160 with SMTP id 32mr6511508lfu.28.1449169302273; Thu, 03 Dec 2015 11:01:42 -0800 (PST) |
| Organization | Cogent Embedded |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 75 |
| X-Original-Cc | MyungJoo Ham <myungjoo.ham@samsung.com>, David Cohen <david.a.cohen@linux.intel.com>, Lu Baolu <baolu.lu@linux.intel.com>, Mathias Nyman <mathias.nyman@linux.intel.com>, Felipe Balbi <balbi@ti.com>, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org |
| X-Original-Date | Thu, 3 Dec 2015 22:01:39 +0300 |
| X-Original-Message-ID | <56609193.4090801@cogentembedded.com> |
| X-Original-References | <1449134991-39095-1-git-send-email-heikki.krogerus@linux.intel.com> <1449134991-39095-3-git-send-email-heikki.krogerus@linux.intel.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1283269 |
Show key headers only | View raw
Hello.
On 12/03/2015 12:29 PM, Heikki Krogerus wrote:
> Intel Braswell/Cherrytrail has an internal mux that shares
> one USB port between USB Device Controller and xHCI. The
> same mux is found on several SOCs from Intel, but only on
> a few Cherrytrail based platforms the OS is expected to
> configure it. Normally BIOS takes care of it.
>
> The driver for the mux is an "extcon" driver. With this we
> only register the mux if it's detected.
Hm, I had somewhat identical case on the Renesas SoC: the 2 channel mux
was mapped to the USB device PHY register space, so I chose to implement a PHY
driver, not extcon...
I don't quite understand how mux maps to the extcon core -- doesn't it
provide support only the input signals?
> Suggested-by: Lu Baolu <baolu.lu@linux.intel.com>
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/host/pci-quirks.c | 26 +++++++++++++++++++++++++-
> 1 file changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
> index 26cb8c8..ee875e1 100644
> --- a/drivers/usb/host/pci-quirks.c
> +++ b/drivers/usb/host/pci-quirks.c
[...]
> @@ -1022,9 +1023,32 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
> writel(val, base + ext_cap_offset + XHCI_LEGACY_CONTROL_OFFSET);
>
> hc_init:
> - if (pdev->vendor == PCI_VENDOR_ID_INTEL)
> + if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
> usb_enable_intel_xhci_ports(pdev);
>
> + /*
> + * Initialize the internal mux that shares a port between USB
> + * Device Controller and xHCI on platforms that have it.
> + */
> +#define XHCI_INTEL_VENDOR_CAPS 192
> +#define XHCI_INTEL_USB_MUX_OFFSET 0x80d8
> + if (xhci_find_next_ext_cap(base, 0, XHCI_INTEL_VENDOR_CAPS)) {
> + struct intel_usb_mux *mux;
> + struct resource r;
> +
> + r.start = pci_resource_start(pdev, 0) +
> + XHCI_INTEL_USB_MUX_OFFSET;
> + r.end = r.start + 8;
> + r.flags = IORESOURCE_MEM;
> +
> + mux = intel_usb_mux_register(&pdev->dev, &r);
> + if (IS_ERR(mux) && PTR_ERR(mux) == -ENOTSUPP)
I think you can drop IS_ERR() check here...
> + dev_dbg(&pdev->dev, "USB mux not supported\n");
> + else if (IS_ERR(mux))
> + dev_err(&pdev->dev, "failed to register mux\n");
> + }
> + }
> +
> op_reg_base = base + XHCI_HC_LENGTH(readl(base));
>
> /* Wait for the host controller to be ready before writing any
MBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCHv2 0/2] extcon: driver for Intel USB MUX Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2015-12-03 10:40 +0100
[PATCHv2 1/2] extcon: add driver for Intel USB mux Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2015-12-03 10:40 +0100
Re: [PATCHv2 1/2] extcon: add driver for Intel USB mux Chanwoo Choi <cw00.choi@samsung.com> - 2015-12-03 10:50 +0100
Re: [PATCHv2 1/2] extcon: add driver for Intel USB mux Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2015-12-04 10:00 +0100
Re: [PATCHv2 1/2] extcon: add driver for Intel USB mux Chanwoo Choi <cw00.choi@samsung.com> - 2015-12-07 02:30 +0100
Re: [PATCHv2 1/2] extcon: add driver for Intel USB mux Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2015-12-07 14:00 +0100
Re: [PATCHv2 1/2] extcon: add driver for Intel USB mux Chanwoo Choi <cw00.choi@samsung.com> - 2015-12-08 02:20 +0100
Re: [PATCHv2 1/2] extcon: add driver for Intel USB mux Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2015-12-08 13:30 +0100
Re: [PATCHv2 1/2] extcon: add driver for Intel USB mux Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-12-03 20:20 +0100
[PATCHv2 2/2] usb: pci-quirks: register USB mux found on Cherrytrail SOC Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2015-12-03 10:40 +0100
Re: [PATCHv2 2/2] usb: pci-quirks: register USB mux found on Cherrytrail SOC Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-12-03 20:10 +0100
csiph-web