Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1234523 > unrolled thread

[PATCH v4 21/26] ARM: pxa: magician: Add support for PXA27x UDC

Started byPetr Cvek <petr.cvek@tul.cz>
First post2015-09-28 23:40 +0200
Last post2015-10-03 15:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v4 21/26] ARM: pxa: magician: Add support for PXA27x UDC Petr Cvek <petr.cvek@tul.cz> - 2015-09-28 23:40 +0200
    Re: [PATCH v4 21/26] ARM: pxa: magician: Add support for PXA27x UDC Philipp Zabel <philipp.zabel@gmail.com> - 2015-10-03 15:00 +0200

#1234523 — [PATCH v4 21/26] ARM: pxa: magician: Add support for PXA27x UDC

FromPetr Cvek <petr.cvek@tul.cz>
Date2015-09-28 23:40 +0200
Subject[PATCH v4 21/26] ARM: pxa: magician: Add support for PXA27x UDC
Message-ID<qdOjo-3fZ-13@gated-at.bofh.it>
A PXA27x SoC supports USB device mode, this patch adds support for that.

Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
---
 arch/arm/mach-pxa/magician.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 490d79f..331dfd1 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -54,6 +54,10 @@
 
 #include <linux/regulator/max1586.h>
 
+#include <linux/platform_data/pxa2xx_udc.h>
+#include <mach/udc.h>
+#include <mach/pxa27x-udc.h>
+
 #include "devices.h"
 #include "generic.h"
 
@@ -582,6 +586,23 @@ static struct platform_device pasic3 = {
  * PXA UDC
  */
 
+static void magician_udc_command(int cmd)
+{
+	if (cmd == PXA2XX_UDC_CMD_CONNECT)
+		UP2OCR |= UP2OCR_DPPUE | UP2OCR_DPPUBE;
+	else if (cmd == PXA2XX_UDC_CMD_DISCONNECT)
+		UP2OCR &= ~(UP2OCR_DPPUE | UP2OCR_DPPUBE);
+}
+
+static struct pxa2xx_udc_mach_info magician_udc_info __initdata = {
+	.udc_command	= magician_udc_command,
+	.gpio_pullup	= GPIO27_MAGICIAN_USBC_PUEN,
+};
+
+/*
+ * USB device VUSB detection
+ */
+
 static struct resource gpio_vbus_resource = {
 	.flags	= IORESOURCE_IRQ,
 	.start	= IRQ_MAGICIAN_VBUS,
@@ -1120,6 +1141,7 @@ static void __init magician_init(void)
 
 	pxa_set_mci_info(&magician_mci_info);
 	pxa_set_ohci_info(&magician_ohci_info);
+	pxa_set_udc_info(&magician_udc_info);
 
 	/* Check LCD type we have */
 	cpld = ioremap_nocache(PXA_CS3_PHYS, 0x1000);
-- 
1.7.12.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1238854

FromPhilipp Zabel <philipp.zabel@gmail.com>
Date2015-10-03 15:00 +0200
Message-ID<qfuzT-2gi-3@gated-at.bofh.it>
In reply to#1234523
Am Montag, den 28.09.2015, 23:39 +0200 schrieb Petr Cvek:
> A PXA27x SoC supports USB device mode, this patch adds support for
> that.
> 
> Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
> ---
>  arch/arm/mach-pxa/magician.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach
> -pxa/magician.c
> index 490d79f..331dfd1 100644
> --- a/arch/arm/mach-pxa/magician.c
> +++ b/arch/arm/mach-pxa/magician.c
> @@ -54,6 +54,10 @@
>  
>  #include <linux/regulator/max1586.h>
>  
> +#include <linux/platform_data/pxa2xx_udc.h>
> +#include <mach/udc.h>
> +#include <mach/pxa27x-udc.h>
> +
>  #include "devices.h"
>  #include "generic.h"
>  
> @@ -582,6 +586,23 @@ static struct platform_device pasic3 = {
>   * PXA UDC
>   */

This comment should be part of this patch.

> +static void magician_udc_command(int cmd)
> +{
> +	if (cmd == PXA2XX_UDC_CMD_CONNECT)
> +		UP2OCR |= UP2OCR_DPPUE | UP2OCR_DPPUBE;
> +	else if (cmd == PXA2XX_UDC_CMD_DISCONNECT)
> +		UP2OCR &= ~(UP2OCR_DPPUE | UP2OCR_DPPUBE);
> +}
> +
> +static struct pxa2xx_udc_mach_info magician_udc_info __initdata = {
> +	.udc_command	= magician_udc_command,
> +	.gpio_pullup	= GPIO27_MAGICIAN_USBC_PUEN,
> +};
> +
> +/*
> + * USB device VUSB detection
> + */
> +

Move this comment to the earlier comment fixup patch.

Otherwise,
Acked-by: Philipp Zabel <philipp.zabel@gmail.com>

regards
Philipp
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web