| To: | Florian Fainelli <florian@openwrt.org> |
|---|---|
| Subject: | Re: [PATCH 24/25] MIPS: Alchemy: use the OHCI platform driver |
| From: | Manuel Lauss <manuel.lauss@gmail.com> |
| Date: | Wed, 3 Oct 2012 18:07:28 +0200 |
| Cc: | stern@rowland.harvard.edu, linux-usb@vger.kernel.org, Ralf Baechle <ralf@linux-mips.org>, Manuel Lauss <manuel.lauss@googlemail.com>, Thomas Meyer <thomas@m3y3r.de>, "David S. Miller" <davem@davemloft.net>, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org |
| Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=gz3/6vFgAP+EwgkF1kgusgPhq2i4IdusC7rozyWrBUk=; b=HxtO8Efc5AefLZMvWPrIDjLPltNN5FkIl3DezJL0PBtX2KNl/p6tyBAfdcim5qfRJb WywIx9BXrUPn851Kln1OlVoymKF9clcN1agVrVWQDKJUvmws/oYWPIVuGgOHG++rdMjY uFuwh4w4MGmo1b0sCwKLHbPrNth/MUGepAXsGmYDJKLEpyIDwZFycXnmkjCiUi5/hTcF Wm1mefup8cLlLK4NqEuKr3wG9LRXCPDzavIfD6Dd5jnpo76k1VOpqGW65caaoOFqdLf7 wv+i6hf1bYw1yFuTxdSNrjgnL5wNa9aUgRuk743ZopU/UdNYRws5XK6GI9E/a8F7Tevy mtYQ== |
| In-reply-to: | <1349276601-8371-26-git-send-email-florian@openwrt.org> |
| List-archive: | <http://www.linux-mips.org/archives/linux-mips/> |
| List-help: | <mailto:ecartis@linux-mips.org?Subject=help> |
| List-id: | linux-mips <linux-mips.eddie.linux-mips.org> |
| List-owner: | <mailto:ralf@linux-mips.org> |
| List-post: | <mailto:linux-mips@linux-mips.org> |
| List-software: | Ecartis version 1.0.0 |
| List-subscribe: | <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips> |
| List-unsubscribe: | <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips> |
| References: | <1349276601-8371-1-git-send-email-florian@openwrt.org> <1349276601-8371-26-git-send-email-florian@openwrt.org> |
| Sender: | linux-mips-bounce@linux-mips.org |
On Wed, Oct 3, 2012 at 5:03 PM, Florian Fainelli <florian@openwrt.org> wrote:
> This also greatly simplifies the power_{on,off} callbacks and make them
> work on platform device id instead of checking the OHCI controller base
> address like what was done in ohci-au1xxx.c.
>
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> arch/mips/alchemy/common/platform.c | 31 +++++++++++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
>
> diff --git a/arch/mips/alchemy/common/platform.c
> b/arch/mips/alchemy/common/platform.c
> index 57335a2..cd12458 100644
> --- a/arch/mips/alchemy/common/platform.c
> +++ b/arch/mips/alchemy/common/platform.c
> @@ -18,6 +18,7 @@
> #include <linux/serial_8250.h>
> #include <linux/slab.h>
> #include <linux/usb/ehci_pdriver.h>
> +#include <linux/usb/ohci_pdriver.h>
>
> #include <asm/mach-au1x00/au1000.h>
> #include <asm/mach-au1x00/au1xxx_dbdma.h>
> @@ -142,6 +143,34 @@ static struct usb_ehci_pdata alchemy_ehci_pdata = {
> .power_suspend = alchemy_ehci_power_off,
> };
>
> +/* Power on callback for the ohci platform driver */
> +static int alchemy_ohci_power_on(struct platform_device *pdev)
> +{
> + int unit;
> +
> + unit = (pdev->id == 1) ?
> + ALCHEMY_USB_OHCI1 : ALCHEMY_USB_OHCI0;
> +
> + return alchemy_usb_control(unit, 1);
> +}
> +
> +/* Power off/suspend callback for the ohci platform driver */
> +static void alchemy_ohci_power_off(struct platform_device *pdev)
> +{
> + int unit;
> +
> + unit = (pdev->id == 1) ?
> + ALCHEMY_USB_OHCI1 : ALCHEMY_USB_OHCI0;
> +
> + alchemy_usb_control(unit, 0);
> +}
> +
> +static struct usb_ohci_pdata alchemy_ohci_pdata = {
> + .power_on = alchemy_ohci_power_on,
> + .power_off = alchemy_ohci_power_off,
> + .power_suspend = alchemy_ohci_power_off,
> +};
> +
> static unsigned long alchemy_ohci_data[][2] __initdata = {
> [ALCHEMY_CPU_AU1000] = { AU1000_USB_OHCI_PHYS_ADDR,
> AU1000_USB_HOST_INT },
> [ALCHEMY_CPU_AU1500] = { AU1000_USB_OHCI_PHYS_ADDR,
> AU1500_USB_HOST_INT },
> @@ -192,6 +221,7 @@ static void __init alchemy_setup_usb(int ctype)
> pdev->name = "au1xxx-ohci";
Should be "ohci-platform" (2x). With this change USB works on all my
Alchemy boards.
I'd also suggest to move drivers/usb/host/alchemy-common.c to
arch/mips/alchemy/common/usb.c.
(same for octeon2-common.c)
Manuel
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH 24/25] MIPS: Alchemy: use the OHCI platform driver, Florian Fainelli |
|---|---|
| Next by Date: | Re: [PATCH 09/25] MIPS: Octeon: use ehci-platform driver, David Daney |
| Previous by Thread: | Re: [PATCH 24/25] MIPS: Alchemy: use the OHCI platform driver, Manuel Lauss |
| Next by Thread: | Re: [PATCH 24/25] MIPS: Alchemy: use the OHCI platform driver, Florian Fainelli |
| Indexes: | [Date] [Thread] [Top] [All Lists] |