linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	Alan Stern <stern@rowland.harvard.edu>
Cc: linux-usb@vger.kernel.org, Greg KH <greg@kroah.com>
Subject: usb: uhci: Add clk support to uhci-platform
Date: Sat, 13 Jan 2018 09:27:19 +1100	[thread overview]
Message-ID: <1515796039.31850.110.camel@kernel.crashing.org> (raw)

On Fri, 2018-01-12 at 10:35 +0300, Sergei Shtylyov wrote:
> Hello!
> 
> On 1/12/2018 8:51 AM, Benjamin Herrenschmidt wrote:
> 
> > The Aspeed SoCs use uhci-platform. With the new dynamic clock
> > control framework, the corresponding IP block clock must be
> > properly enabled.
> > 
> > This is a simplified variant of what ehci-platform does, it
> > looks for *one* clock attached to the device, and if it's
> > there, enables it.
> > 
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> 
> [...]
> > diff --git a/drivers/usb/host/uhci-platform.c b/drivers/usb/host/uhci-platform.c
> > index 6cb16d4b2257..7d959071f92b 100644
> > --- a/drivers/usb/host/uhci-platform.c
> > +++ b/drivers/usb/host/uhci-platform.c
> > @@ -119,6 +119,21 @@ static int uhci_hcd_platform_probe(struct platform_device *pdev)
> >   				 "Enabled Aspeed implementation workarounds\n");
> >   		}
> >   	}
> > +
> > +	/* Get and enable clock if any specified */
> > +	uhci->clk = devm_clk_get(&pdev->dev, NULL);
> > +        if (IS_ERR(uhci->clk)) {
> > +                ret = PTR_ERR(uhci->clk);
> > +                goto err_rmr;
> > +        }
> 
>     Indent with tabs as elsewhere, please.

Oops, there should have been, I suppose a copy/paste brought spaces
from the original file ;-) I'll fix that.

> > +	if (uhci->clk) {
> > +		ret = clk_prepare_enable(uhci->clk);
> > +		if (ret) {
> > +			dev_err(&pdev->dev, "Error couldn't enable clock (%d)\n", ret);
> > +			goto err_rmr;
> > +		}
> > +        }
> > +
> >   	ret = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_SHARED);
> >   	if (ret)
> >   		goto err_rmr;
> > 
> 
> [...]
> 
> MBR, Segei
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2018-01-12 22:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 22:27 Benjamin Herrenschmidt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-01-12  7:35 usb: uhci: Add clk support to uhci-platform Sergei Shtylyov
2018-01-12  5:51 Benjamin Herrenschmidt

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=1515796039.31850.110.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=greg@kroah.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=stern@rowland.harvard.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).