linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] USB_DR device support for FSL MPC831x
@ 2007-07-17  0:58 Vitaly Bordug
  2007-07-17 12:21 ` Li Yang-r58472
  0 siblings, 1 reply; 2+ messages in thread
From: Vitaly Bordug @ 2007-07-17  0:58 UTC (permalink / raw)
  To: Greg KH; +Cc: linuxppc-dev


This adds support for USB device mode on mpc831x series. 
Devicetree node modification is required to make it work - 

dr_mode ="peripheral";

which should be commented out if host mode is desired onboot.

Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>

---

 arch/powerpc/sysdev/fsl_soc.c |    1 +
 include/linux/fsl_devices.h   |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index c0ddc80..27a1510 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -514,6 +514,7 @@ static int __init fsl_usb_of_init(void)
 			}
 		} else if (prop && !strcmp(prop, "peripheral")) {
 			usb_data.operating_mode = FSL_USB2_DR_DEVICE;
+			usb_data.max_ep_nr = *(unsigned int*)of_get_property(np, "max_ep_nr",NULL);
 			usb_dev_dr_client = platform_device_register_simple(
 					"fsl-usb2-udc", i, r, 2);
 			if (IS_ERR(usb_dev_dr_client)) {
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 12e631f..a3feb34 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -103,6 +103,7 @@ struct fsl_usb2_platform_data {
 	enum fsl_usb2_operating_modes	operating_mode;
 	enum fsl_usb2_phy_modes		phy_mode;
 	unsigned int			port_enables;
+	unsigned int			max_ep_nr;
 };
 
 /* Flags in fsl_usb2_mph_platform_data */

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] USB_DR device support for FSL MPC831x
  2007-07-17  0:58 [PATCH] USB_DR device support for FSL MPC831x Vitaly Bordug
@ 2007-07-17 12:21 ` Li Yang-r58472
  0 siblings, 0 replies; 2+ messages in thread
From: Li Yang-r58472 @ 2007-07-17 12:21 UTC (permalink / raw)
  To: Vitaly Bordug, Greg KH; +Cc: linuxppc-dev

Hi Vitaly,

The max_ep_nr will be read from DCCPARAMS register with my patch in
2.6.23 queue:
http://www.kernel.org/pub/linux/kernel/people/gregkh/usb/2.6/2.6.22/usb-
fsl_usb2_udc-get-max-ep-number-from-dccparams-register.patch

- Leo

> -----Original Message-----
> From: linuxppc-dev-bounces+leoli=3Dfreescale.com@ozlabs.org=20
> [mailto:linuxppc-dev-bounces+leoli=3Dfreescale.com@ozlabs.org]=20
> On Behalf Of Vitaly Bordug
> Sent: Tuesday, July 17, 2007 8:59 AM
> To: Greg KH
> Cc: linuxppc-dev@ozlabs.org
> Subject: [PATCH] USB_DR device support for FSL MPC831x
>=20
>=20
> This adds support for USB device mode on mpc831x series.=20
> Devicetree node modification is required to make it work -=20
>=20
> dr_mode =3D"peripheral";
>=20
> which should be commented out if host mode is desired onboot.
>=20
> Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>
>=20
> ---
>=20
>  arch/powerpc/sysdev/fsl_soc.c |    1 +
>  include/linux/fsl_devices.h   |    1 +
>  2 files changed, 2 insertions(+), 0 deletions(-)
>=20
> diff --git a/arch/powerpc/sysdev/fsl_soc.c=20
> b/arch/powerpc/sysdev/fsl_soc.c index c0ddc80..27a1510 100644
> --- a/arch/powerpc/sysdev/fsl_soc.c
> +++ b/arch/powerpc/sysdev/fsl_soc.c
> @@ -514,6 +514,7 @@ static int __init fsl_usb_of_init(void)
>  			}
>  		} else if (prop && !strcmp(prop, "peripheral")) {
>  			usb_data.operating_mode =3D FSL_USB2_DR_DEVICE;
> +			usb_data.max_ep_nr =3D *(unsigned=20
> int*)of_get_property(np,=20
> +"max_ep_nr",NULL);
>  			usb_dev_dr_client =3D=20
> platform_device_register_simple(
>  					"fsl-usb2-udc", i, r, 2);
>  			if (IS_ERR(usb_dev_dr_client)) {
> diff --git a/include/linux/fsl_devices.h=20
> b/include/linux/fsl_devices.h index 12e631f..a3feb34 100644
> --- a/include/linux/fsl_devices.h
> +++ b/include/linux/fsl_devices.h
> @@ -103,6 +103,7 @@ struct fsl_usb2_platform_data {
>  	enum fsl_usb2_operating_modes	operating_mode;
>  	enum fsl_usb2_phy_modes		phy_mode;
>  	unsigned int			port_enables;
> +	unsigned int			max_ep_nr;
>  };
> =20
>  /* Flags in fsl_usb2_mph_platform_data */
>=20
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>=20

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-17 12:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-17  0:58 [PATCH] USB_DR device support for FSL MPC831x Vitaly Bordug
2007-07-17 12:21 ` Li Yang-r58472

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).