Message ID | 1363593333-6077-3-git-send-email-chao.xie@marvell.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Mon, Mar 18, 2013 at 03:55:29AM -0400, Chao Xie wrote: > The origianl understanding of clock is wrong. The OTG controller > only have one clock input. > Passing clock name by pdata is wrong. The clock is defined by device > iteself. > > Signed-off-by: Chao Xie <chao.xie@marvell.com> please rebase against my 'next' branch.
On Wed, Mar 20, 2013 at 9:09 PM, Felipe Balbi <balbi@ti.com> wrote: > On Mon, Mar 18, 2013 at 03:55:29AM -0400, Chao Xie wrote: >> The origianl understanding of clock is wrong. The OTG controller >> only have one clock input. >> Passing clock name by pdata is wrong. The clock is defined by device >> iteself. >> >> Signed-off-by: Chao Xie <chao.xie@marvell.com> > > please rebase against my 'next' branch. > > -- > balbi hi Do you mean git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git - branch "usb-next"? Or some other git?
Hi, On Thursday 21 March 2013 02:46 PM, Chao Xie wrote: > On Wed, Mar 20, 2013 at 9:09 PM, Felipe Balbi <balbi@ti.com> wrote: >> On Mon, Mar 18, 2013 at 03:55:29AM -0400, Chao Xie wrote: >>> The origianl understanding of clock is wrong. The OTG controller >>> only have one clock input. >>> Passing clock name by pdata is wrong. The clock is defined by device >>> iteself. >>> >>> Signed-off-by: Chao Xie <chao.xie@marvell.com> >> >> please rebase against my 'next' branch. >> >> -- >> balbi > hi > Do you mean git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git - > branch "usb-next"? > Or some other git? git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next Thanks Kishon
On Thu, Mar 21, 2013 at 05:16:15PM +0800, Chao Xie wrote: > On Wed, Mar 20, 2013 at 9:09 PM, Felipe Balbi <balbi@ti.com> wrote: > > On Mon, Mar 18, 2013 at 03:55:29AM -0400, Chao Xie wrote: > >> The origianl understanding of clock is wrong. The OTG controller > >> only have one clock input. > >> Passing clock name by pdata is wrong. The clock is defined by device > >> iteself. > >> > >> Signed-off-by: Chao Xie <chao.xie@marvell.com> > > > > please rebase against my 'next' branch. > > > > -- > > balbi > hi > Do you mean git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git - > branch "usb-next"? > Or some other git? from MAINTAINERS: 8293 USB GADGET/PERIPHERAL SUBSYSTEM 8294 M: Felipe Balbi <balbi@ti.com> 8295 L: linux-usb@vger.kernel.org 8296 W: http://www.linux-usb.org/gadget 8297 T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git 8298 S: Maintained 8299 F: drivers/usb/gadget/ 8300 F: include/linux/usb/gadget*
diff --git a/drivers/usb/otg/mv_otg.c b/drivers/usb/otg/mv_otg.c index b6a9be3..ee66283 100644 --- a/drivers/usb/otg/mv_otg.c +++ b/drivers/usb/otg/mv_otg.c @@ -237,18 +237,12 @@ static void mv_otg_start_periphrals(struct mv_otg *mvotg, int on) static void otg_clock_enable(struct mv_otg *mvotg) { - unsigned int i; - - for (i = 0; i < mvotg->clknum; i++) - clk_prepare_enable(mvotg->clk[i]); + clk_prepare_enable(mvotg->clk); } static void otg_clock_disable(struct mv_otg *mvotg) { - unsigned int i; - - for (i = 0; i < mvotg->clknum; i++) - clk_disable_unprepare(mvotg->clk[i]); + clk_disable_unprepare(mvotg->clk); } static int mv_otg_enable_internal(struct mv_otg *mvotg) @@ -684,16 +678,14 @@ static int mv_otg_probe(struct platform_device *pdev) struct mv_otg *mvotg; struct usb_otg *otg; struct resource *r; - int retval = 0, clk_i, i; - size_t size; + int retval = 0, i; if (pdata == NULL) { dev_err(&pdev->dev, "failed to get platform data\n"); return -ENODEV; } - size = sizeof(*mvotg) + sizeof(struct clk *) * pdata->clknum; - mvotg = devm_kzalloc(&pdev->dev, size, GFP_KERNEL); + mvotg = devm_kzalloc(&pdev->dev, sizeof(*mvotg), GFP_KERNEL); if (!mvotg) { dev_err(&pdev->dev, "failed to allocate memory!\n"); return -ENOMEM; @@ -708,15 +700,9 @@ static int mv_otg_probe(struct platform_device *pdev) mvotg->pdev = pdev; mvotg->pdata = pdata; - mvotg->clknum = pdata->clknum; - for (clk_i = 0; clk_i < mvotg->clknum; clk_i++) { - mvotg->clk[clk_i] = devm_clk_get(&pdev->dev, - pdata->clkname[clk_i]); - if (IS_ERR(mvotg->clk[clk_i])) { - retval = PTR_ERR(mvotg->clk[clk_i]); - return retval; - } - } + mvotg->clk = devm_clk_get(&pdev->dev, NULL); + if (IS_ERR(mvotg->clk)) + return PTR_ERR(mvotg->clk); mvotg->qwork = create_singlethread_workqueue("mv_otg_queue"); if (!mvotg->qwork) { diff --git a/drivers/usb/otg/mv_otg.h b/drivers/usb/otg/mv_otg.h index 8a9e351..551da6e 100644 --- a/drivers/usb/otg/mv_otg.h +++ b/drivers/usb/otg/mv_otg.h @@ -158,8 +158,7 @@ struct mv_otg { unsigned int active; unsigned int clock_gating; - unsigned int clknum; - struct clk *clk[0]; + struct clk *clk; }; #endif
The origianl understanding of clock is wrong. The OTG controller only have one clock input. Passing clock name by pdata is wrong. The clock is defined by device iteself. Signed-off-by: Chao Xie <chao.xie@marvell.com> --- drivers/usb/otg/mv_otg.c | 28 +++++++--------------------- drivers/usb/otg/mv_otg.h | 3 +-- 2 files changed, 8 insertions(+), 23 deletions(-)