From: peter.chen@freescale.com (Peter Chen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] usb: chipidea: usbmisc: skip clocks on i.MX6
Date: Wed, 10 Dec 2014 13:09:30 +0800 [thread overview]
Message-ID: <20141210050928.GB11802@shlinux2> (raw)
In-Reply-To: <1418141616-29671-1-git-send-email-p.zabel@pengutronix.de>
On Tue, Dec 09, 2014 at 05:13:35PM +0100, Philipp Zabel wrote:
> On i.MX6Q, the USBMISC registers are clocked by the IPG clock,
> so there is no need to enable USBOH3 for the USBMISC driver.
>
Access the registers at usbmisc needs the same clock with chipidea core,
both are usboh3.
For i.mx6 series, there is only one usb clock gate at ccm which is
usboh3, it is used to access register. For transfer data, it needs
usb phy's (using mxs phy) clock is enabled.
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
> drivers/usb/chipidea/usbmisc_imx.c | 32 ++++++++++++++++++--------------
> 1 file changed, 18 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> index 926c997..f7b878d 100644
> --- a/drivers/usb/chipidea/usbmisc_imx.c
> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> @@ -338,23 +338,27 @@ static int usbmisc_imx_probe(struct platform_device *pdev)
> if (IS_ERR(data->base))
> return PTR_ERR(data->base);
>
> - data->clk = devm_clk_get(&pdev->dev, NULL);
> - if (IS_ERR(data->clk)) {
> - dev_err(&pdev->dev,
> - "failed to get clock, err=%ld\n", PTR_ERR(data->clk));
> - return PTR_ERR(data->clk);
> - }
> -
> - ret = clk_prepare_enable(data->clk);
> - if (ret) {
> - dev_err(&pdev->dev,
> - "clk_prepare_enable failed, err=%d\n", ret);
> - return ret;
> - }
> -
> tmp_dev = (struct of_device_id *)
> of_match_device(usbmisc_imx_dt_ids, &pdev->dev);
> data->ops = (const struct usbmisc_ops *)tmp_dev->data;
> +
> + /* on i.MX6Q, the USBMISC register space is clocked by the IPG clock */
> + if (data->ops != &imx6q_usbmisc_ops) {
> + data->clk = devm_clk_get(&pdev->dev, NULL);
> + if (IS_ERR(data->clk)) {
> + dev_err(&pdev->dev, "failed to get clock, err=%ld\n",
> + PTR_ERR(data->clk));
> + return PTR_ERR(data->clk);
> + }
> +
> + ret = clk_prepare_enable(data->clk);
> + if (ret) {
> + dev_err(&pdev->dev,
> + "clk_prepare_enable failed, err=%d\n", ret);
> + return ret;
> + }
> + }
> +
> platform_set_drvdata(pdev, data);
>
> return 0;
> --
> 2.1.3
>
--
Best Regards,
Peter Chen
next prev parent reply other threads:[~2014-12-10 5:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-09 16:13 [PATCH 1/2] usb: chipidea: usbmisc: skip clocks on i.MX6 Philipp Zabel
2014-12-09 16:13 ` [PATCH 2/2] ARM: dts: imx6qdl: remove USBOH3 clock from usbmisc, it is clocked by IPG Philipp Zabel
2014-12-10 5:09 ` Peter Chen [this message]
2014-12-10 10:26 ` [PATCH 1/2] usb: chipidea: usbmisc: skip clocks on i.MX6 Philipp Zabel
2014-12-10 7:46 ` Uwe Kleine-König
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=20141210050928.GB11802@shlinux2 \
--to=peter.chen@freescale.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).