[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1201171021320.1818-100000@iolanthe.rowland.org>
Date: Tue, 17 Jan 2012 10:22:50 -0500 (EST)
From: Alan Stern <stern@...land.harvard.edu>
To: Kelvin Cheung <keguang.zhang@...il.com>
cc: ralf@...ux-mips.org, <linux-mips@...ux-mips.org>,
<linux-usb@...r.kernel.org>, <gregkh@...e.de>,
<zhzhl555@...il.com>, <peppe.cavallaro@...com>,
<wuzhangjin@...il.com>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V6 4/5] USB: Add EHCI bus glue for Loongson1x SoCs
On Tue, 17 Jan 2012, Kelvin Cheung wrote:
> The Loongson1x SoCs have a built-in EHCI controller.
> This patch adds the necessary glue code to make the generic EHCI
> driver usable for them.
> --- /dev/null
> +++ b/drivers/usb/host/ehci-ls1x.c
> @@ -0,0 +1,170 @@
> +/*
> + * Bus Glue for Loongson LS1X built-in EHCI controller.
> + *
> + * Copyright (c) 2012 Zhang, Keguang <keguang.zhang@...il.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 2 as published
> + * by the Free Software Foundation.
> + */
> +
> +
> +#include <linux/platform_device.h>
> +
> +static int ehci_ls1x_setup(struct usb_hcd *hcd)
> +{
> + struct ehci_hcd *ehci = hcd_to_ehci(hcd);
> + int ret;
> +
> + ehci->caps = hcd->regs;
> + ehci->regs = hcd->regs +
> + HC_LENGTH(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase));
> + dbg_hcs_params(ehci, "reset");
> + dbg_hcc_params(ehci, "reset");
> +
> + /* cache this readonly data; minimize chip reads */
> + ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
> + ehci->sbrn = 0x20;
> +
> + ehci_reset(ehci);
> +
> + /* data structure init */
> + ret = ehci_init(hcd);
> + if (ret)
> + return ret;
> +
> + ehci_port_power(ehci, 0);
> +
> + return 0;
> +}
Most of this routine should be replaced with a call to ehci_setup().
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists