All of lore.kernel.org
 help / color / mirror / Atom feed
From: peter.chen@freescale.com (Peter Chen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 7/7] usb: chipidea: usbmisc: add post handling and errata fix for mx25
Date: Fri, 23 Nov 2012 14:59:38 +0800	[thread overview]
Message-ID: <20121123065937.GE22420@nchen-desktop> (raw)
In-Reply-To: <1353506793-8354-8-git-send-email-m.grzeschik@pengutronix.de>

On Wed, Nov 21, 2012 at 03:06:33PM +0100, Michael Grzeschik wrote:
> This adds a post handling routine which is called after
> ci13xxx_add_device was called. The first user is the mx25, which has to
> disable the external-vbus-divider after the ude has started.
udc has started?
> 
>  
> +static int usbmisc_imx25_post(struct device *dev)
> +{
> +	struct usbmisc_usb_device *usbdev;
> +	void __iomem *reg;
> +	unsigned long flags;
> +	u32 val;
> +
> +	usbdev = get_usbdev(dev);
> +	if (IS_ERR(usbdev))
> +		return PTR_ERR(usbdev);
> +
> +	reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET;
> +
> +	if (usbdev->evdo) {
> +		spin_lock_irqsave(&usbmisc->lock, flags);
> +		val = readl(reg);
> +		writel(val | MX25_BM_EXTERNAL_VBUS_DIVIDER, reg);
> +		spin_unlock_irqrestore(&usbmisc->lock, flags);
> +		mdelay(5); /* needed to stabilize voltage */
better use usleep_range to avoid busy-wait.
> +	}
> +
> +	return 0;
> +}
> +
>  static int usbmisc_imx53_init(struct device *dev)
>  {
>  	struct usbmisc_usb_device *usbdev;
> @@ -122,6 +150,10 @@ static int usbmisc_imx6q_init(struct device *dev)
>  	return 0;
>  }
>  
> +static const struct usbmisc_ops imx25_usbmisc_ops = {
> +	.post = usbmisc_imx25_post,
> +};
> +
>  static const struct usbmisc_ops imx53_usbmisc_ops = {
>  	.init = usbmisc_imx53_init,
>  };
> @@ -131,6 +163,7 @@ static const struct usbmisc_ops imx6q_usbmisc_ops = {
>  };
>  
>  static const struct of_device_id usbmisc_imx_dt_ids[] = {
> +	{ .compatible = "fsl,imx25-usbmisc", .data = (void *)&imx25_usbmisc_ops },
>  	{ .compatible = "fsl,imx53-usbmisc", .data = (void *)&imx53_usbmisc_ops },
>  	{ .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
>  	{ /* sentinel */ }
> -- 
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 

Best Regards,
Peter Chen

WARNING: multiple messages have this Message-ID (diff)
From: Peter Chen <peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
To: Michael Grzeschik <m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: Re: [PATCH v3 7/7] usb: chipidea: usbmisc: add post handling and errata fix for mx25
Date: Fri, 23 Nov 2012 14:59:38 +0800	[thread overview]
Message-ID: <20121123065937.GE22420@nchen-desktop> (raw)
In-Reply-To: <1353506793-8354-8-git-send-email-m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

On Wed, Nov 21, 2012 at 03:06:33PM +0100, Michael Grzeschik wrote:
> This adds a post handling routine which is called after
> ci13xxx_add_device was called. The first user is the mx25, which has to
> disable the external-vbus-divider after the ude has started.
udc has started?
> 
>  
> +static int usbmisc_imx25_post(struct device *dev)
> +{
> +	struct usbmisc_usb_device *usbdev;
> +	void __iomem *reg;
> +	unsigned long flags;
> +	u32 val;
> +
> +	usbdev = get_usbdev(dev);
> +	if (IS_ERR(usbdev))
> +		return PTR_ERR(usbdev);
> +
> +	reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET;
> +
> +	if (usbdev->evdo) {
> +		spin_lock_irqsave(&usbmisc->lock, flags);
> +		val = readl(reg);
> +		writel(val | MX25_BM_EXTERNAL_VBUS_DIVIDER, reg);
> +		spin_unlock_irqrestore(&usbmisc->lock, flags);
> +		mdelay(5); /* needed to stabilize voltage */
better use usleep_range to avoid busy-wait.
> +	}
> +
> +	return 0;
> +}
> +
>  static int usbmisc_imx53_init(struct device *dev)
>  {
>  	struct usbmisc_usb_device *usbdev;
> @@ -122,6 +150,10 @@ static int usbmisc_imx6q_init(struct device *dev)
>  	return 0;
>  }
>  
> +static const struct usbmisc_ops imx25_usbmisc_ops = {
> +	.post = usbmisc_imx25_post,
> +};
> +
>  static const struct usbmisc_ops imx53_usbmisc_ops = {
>  	.init = usbmisc_imx53_init,
>  };
> @@ -131,6 +163,7 @@ static const struct usbmisc_ops imx6q_usbmisc_ops = {
>  };
>  
>  static const struct of_device_id usbmisc_imx_dt_ids[] = {
> +	{ .compatible = "fsl,imx25-usbmisc", .data = (void *)&imx25_usbmisc_ops },
>  	{ .compatible = "fsl,imx53-usbmisc", .data = (void *)&imx53_usbmisc_ops },
>  	{ .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
>  	{ /* sentinel */ }
> -- 
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 

Best Regards,
Peter Chen

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-11-23  6:59 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21 14:06 [PATCH v3 0/7] support other fsl SoCs with usbmisc + small fixes Michael Grzeschik
2012-11-21 14:06 ` Michael Grzeschik
2012-11-21 14:06 ` [PATCH v3 1/7] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx Michael Grzeschik
2012-11-21 14:06   ` Michael Grzeschik
2012-11-21 14:06 ` [PATCH v3 2/7] usb: chipidea: usbmisc: unset global varibale usbmisc on driver remove Michael Grzeschik
2012-11-21 14:06   ` Michael Grzeschik
2012-11-21 14:06 ` [PATCH v3 3/7] usb: chipidea: usbmisc: fix a potential race condition Michael Grzeschik
2012-11-21 14:06   ` Michael Grzeschik
2012-11-23  5:36   ` Peter Chen
2012-11-23  5:36     ` Peter Chen
2012-11-23  7:37     ` Sascha Hauer
2012-11-23  7:37       ` Sascha Hauer
2012-11-23  9:01       ` Alexander Shishkin
2012-11-23  9:01         ` Alexander Shishkin
2012-11-23 10:00     ` Marc Kleine-Budde
2012-11-23 10:00       ` Marc Kleine-Budde
2012-11-21 14:06 ` [PATCH v3 4/7] usb: chipidea: usbmisc: prepare driver to handle more than one soc Michael Grzeschik
2012-11-21 14:06   ` Michael Grzeschik
2012-11-21 14:06 ` [PATCH v3 5/7] usb: chipidea: usbmisc: add support for ahb, ipg and per clock Michael Grzeschik
2012-11-21 14:06   ` Michael Grzeschik
2012-11-23  6:51   ` Peter Chen
2012-11-23  6:51     ` Peter Chen
2012-11-23 16:20     ` Michael Grzeschik
2012-11-23 16:20       ` Michael Grzeschik
2012-11-25  9:18       ` Peter Chen
2012-11-25  9:18         ` Peter Chen
2012-11-26 15:44         ` Michael Grzeschik
2012-11-26 15:44           ` Michael Grzeschik
2012-11-21 14:06 ` [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support Michael Grzeschik
2012-11-21 14:06   ` Michael Grzeschik
2012-11-21 20:28   ` Sergei Shtylyov
2012-11-21 20:28     ` Sergei Shtylyov
2012-11-21 19:58     ` Michael Grzeschik
2012-11-21 19:58       ` Michael Grzeschik
2012-11-23  6:53   ` Peter Chen
2012-11-23  6:53     ` Peter Chen
2012-11-23  7:39     ` Sascha Hauer
2012-11-23  7:39       ` Sascha Hauer
2012-11-25  8:05       ` Peter Chen
2012-11-25  8:05         ` Peter Chen
2012-11-23 10:02     ` Marc Kleine-Budde
2012-11-23 10:02       ` Marc Kleine-Budde
2012-11-25  8:09       ` Peter Chen
2012-11-25  8:09         ` Peter Chen
2012-11-26 15:40         ` Grant Likely
2012-11-26 15:40           ` Grant Likely
2012-11-21 14:06 ` [PATCH v3 7/7] usb: chipidea: usbmisc: add post handling and errata fix for mx25 Michael Grzeschik
2012-11-21 14:06   ` Michael Grzeschik
2012-11-23  6:59   ` Peter Chen [this message]
2012-11-23  6:59     ` Peter Chen
2012-11-22  9:24 ` [PATCH v3 0/7] support other fsl SoCs with usbmisc + small fixes Alexander Shishkin
2012-11-22  9:24   ` Alexander Shishkin
2012-11-22  9:31   ` Peter Chen
2012-11-22  9:31     ` Peter Chen

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=20121123065937.GE22420@nchen-desktop \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.