From: Magnus Damm <magnus.damm@gmail.com> Date: 2014-06-06 10:42:09
staging: Emma Mobile USB driver and KZM9D board code V3
[PATCH v3 01/05] staging: emxx_udc: Add Emma Mobile USB Gadget driver
[PATCH v3 02/05] staging: emxx_udc: I/O memory and IRQ resource support
[PATCH v3 03/05] staging: emxx_udc: Add TODO file
[PATCH v3 04/05] staging: board: Initial board staging support
[PATCH v3 05/05] staging: board: kzm9d: Board staging support for emxx_udc
This patch series is V3 of the old USB Gadget driver for Emma Mobile
that gets slightly adjusted to make use of the platform device interface
which in turn is used to add USB Gadget support to the KZM9D board.
Two separate staging components are included in this series:
1) the emxx_udc driver - from out-of-tree Android 2.6.35.7
2) board staging support for KZM9D - platform device for DT-only KZM9D
The two components above will be used to continously improve the driver
and board integration code until the driver can be moved out of staging
and/or DT bindings are available so the board staging platform device code
can be replaced with a DT node.
Changes since V2:
- Added CONFIG_OF_ADDRESS dependency for the board staging bits
Changes since V1:
- Added TODO file for emxx_udc
- Broke out board staging base support, included TODO file
- Added code to avoid registering platform device if DT node exists
- Modified KZM9D board code build condition to use SoC Kconfig entry
Many thanks to Dan Carpenter, Geert Uytterhoeven, Greg KH and
Paul Bolle for feedback!
Please let me know if you would like me to rebase this code somehow.
Signed-off-by: Magnus Damm <redacted>
---
Written against renesas git repo at kernel.org using tag
renesas-devel-v3.15-rc8-20140606
drivers/staging/Kconfig | 4
drivers/staging/Makefile | 2
drivers/staging/board/Kconfig | 8
drivers/staging/board/Makefile | 2
drivers/staging/board/TODO | 2
drivers/staging/board/board.c | 41
drivers/staging/board/board.h | 20
drivers/staging/board/kzm9d.c | 19
drivers/staging/emxx_udc/Kconfig | 10
drivers/staging/emxx_udc/Makefile | 1
drivers/staging/emxx_udc/TODO | 4
drivers/staging/emxx_udc/emxx_udc.c | 3616 ++++++++++++++++++++++++++++++++++-
drivers/staging/emxx_udc/emxx_udc.h | 671 ++++++
13 files changed, 4352 insertions(+), 48 deletions(-)
From: Magnus Damm <magnus.damm@gmail.com> Date: 2014-06-06 10:42:28
From: Magnus Damm <redacted>
Adjust the emxx_udc driver to make use of the standard
driver model to pass I/O memory and IRQ as resources
instead of hard coding those things in the driver.
Needs more work - the VBUS signal is yet not handled.
Signed-off-by: Magnus Damm <redacted>
---
Changes since V2:
- None
Changes since V1:
- None
drivers/staging/emxx_udc/emxx_udc.c | 57 +++++++++++------------------------
drivers/staging/emxx_udc/emxx_udc.h | 9 -----
2 files changed, 18 insertions(+), 48 deletions(-)
@@ -3356,37 +3356,38 @@ static int nbu2ss_drv_probe(struct platf{intstatus=-ENODEV;structnbu2ss_udc*udc;+structresource*r;+intirq;+void__iomem*mmio_base;udc=&udc_controller;memset(udc,0,sizeof(structnbu2ss_udc));platform_set_drvdata(pdev,udc);-/* IO Memory Region */-if(!request_mem_region(USB_BASE_ADDRESS,USB_BASE_SIZE-,driver_name)){+/* require I/O memory and IRQ to be provided as resources */+r=platform_get_resource(pdev,IORESOURCE_MEM,0);+mmio_base=devm_request_and_ioremap(&pdev->dev,r);+if(IS_ERR(mmio_base)){+dev_err(&pdev->dev,"failed to map I/O memory\n");+returnPTR_ERR(mmio_base);+}-ERR("request_mem_region failed\n");-return-EBUSY;+irq=platform_get_irq(pdev,0);+if(irq<0){+dev_err(&pdev->dev,"failed to get IRQ\n");+returnirq;}+status=devm_request_irq(&pdev->dev,irq,_nbu2ss_udc_irq,+0,driver_name,udc);/* IO Memory */-udc->p_regs=(PT_FC_REGS)ioremap(USB_BASE_ADDRESS,USB_BASE_SIZE);-if(!udc->p_regs){-ERR("request_io_mem failed\n");-gotocleanup3;-}+udc->p_regs=(PT_FC_REGS)mmio_base;/* USB Function Controller Interrupt */-status=request_irq(USB_UDC_IRQ_1,-_nbu2ss_udc_irq,-IRQF_DISABLED,-driver_name,-udc);-if(status!=0){ERR("request_irq(USB_UDC_IRQ_1) failed\n");-gotocleanup2;+gotocleanup1;}/* Driver Initialization */
From: Magnus Damm <magnus.damm@gmail.com> Date: 2014-06-06 10:42:35
From: Magnus Damm <redacted>
Add a TODO file for emxx_udc to show what is left to do.
Signed-off-by: Magnus Damm <redacted>
---
Changes since V2:
- None
Changes since V1:
- New patch
drivers/staging/emxx_udc/TODO | 4 ++++
1 file changed, 4 insertions(+)
@@ -0,0 +1,4 @@+* add clock framework support (platform device with CCF needs special care)+* break out board-specific VBUS GPIO to work with multiplatform+* DT bindings+* move driver into drivers/usb/gadget/
From: Magnus Damm <magnus.damm@gmail.com> Date: 2014-06-06 10:42:44
From: Magnus Damm <redacted>
Add staging board base support to allow continuous upstream
in-tree development and integration of platform devices.
Helps developers integrate devices as platform devices for
device drivers that only provide platform device bindings.
This in turn allows for incremental development of both
hardware feature support and DT binding work in parallel.
Two separate pieces of board staging functionality is
provided to ease per-board staging board support:
- The board_staging() macro allows easy per-board callbacks
- The board_staging_dt_node_available() provides DT node checking
Tested on the KZM9D board with the emxx_udc staging driver.
Signed-off-by: Magnus Damm <redacted>
---
Changes since V2:
- Added CONFIG_OF_ADDRESS dependency
Changes since V1:
- New broken out staging board base support
- Added the function board_staging_dt_node_available()
- Added a TODO file
drivers/staging/Kconfig | 2 +
drivers/staging/Makefile | 1
drivers/staging/board/Kconfig | 8 +++++++
drivers/staging/board/Makefile | 1
drivers/staging/board/TODO | 2 +
drivers/staging/board/board.c | 41 ++++++++++++++++++++++++++++++++++++++++
drivers/staging/board/board.h | 20 +++++++++++++++++++
7 files changed, 75 insertions(+)
From: Magnus Damm <magnus.damm@gmail.com> Date: 2014-06-06 10:42:52
From: Magnus Damm <redacted>
Add staging board support for the KZM9D board and add
an emxx_udc platform device to allow in-tree continous
development of the driver on the KZM9D board.
When DT bindings are ready for the emxx_udc driver then
the platform device in the KZM9D staging board code can
easily be removed. Until then we use platform devices
to continously improve the driver and integration code.
Signed-off-by: Magnus Damm <redacted>
---
Changes since V2:
- None
Changes since V1:
- Broke out staging board base patch
- Compile in if CONFIG_ARCH_EMEV2 is selected
- Make use of board_staging_dt_node_available()
drivers/staging/board/Makefile | 1 +
drivers/staging/board/kzm9d.c | 19 +++++++++++++++++++
2 files changed, 20 insertions(+)
On Fri, Jun 06, 2014 at 07:44:08PM +0900, Magnus Damm wrote:
staging: Emma Mobile USB driver and KZM9D board code V3
[PATCH v3 01/05] staging: emxx_udc: Add Emma Mobile USB Gadget driver
[PATCH v3 02/05] staging: emxx_udc: I/O memory and IRQ resource support
[PATCH v3 03/05] staging: emxx_udc: Add TODO file
[PATCH v3 04/05] staging: board: Initial board staging support
[PATCH v3 05/05] staging: board: kzm9d: Board staging support for emxx_udc
This patch series is V3 of the old USB Gadget driver for Emma Mobile
that gets slightly adjusted to make use of the platform device interface
which in turn is used to add USB Gadget support to the KZM9D board.
Two separate staging components are included in this series:
1) the emxx_udc driver - from out-of-tree Android 2.6.35.7
2) board staging support for KZM9D - platform device for DT-only KZM9D
The two components above will be used to continously improve the driver
and board integration code until the driver can be moved out of staging
and/or DT bindings are available so the board staging platform device code
can be replaced with a DT node.
Changes since V2:
- Added CONFIG_OF_ADDRESS dependency for the board staging bits
Changes since V1:
- Added TODO file for emxx_udc
- Broke out board staging base support, included TODO file
- Added code to avoid registering platform device if DT node exists
- Modified KZM9D board code build condition to use SoC Kconfig entry
Many thanks to Dan Carpenter, Geert Uytterhoeven, Greg KH and
Paul Bolle for feedback!
Please let me know if you would like me to rebase this code somehow.
At quick glance, this looks good. I'll queue it up after 3.16-rc1 is
out as it's too late for this merge window.
thanks,
greg k-h
From: Magnus Damm <magnus.damm@gmail.com> Date: 2014-06-09 05:14:42
On Sat, Jun 7, 2014 at 12:39 AM, Greg KH [off-list ref] wrote:
On Fri, Jun 06, 2014 at 07:44:08PM +0900, Magnus Damm wrote:
quoted
staging: Emma Mobile USB driver and KZM9D board code V3
[PATCH v3 01/05] staging: emxx_udc: Add Emma Mobile USB Gadget driver
[PATCH v3 02/05] staging: emxx_udc: I/O memory and IRQ resource support
[PATCH v3 03/05] staging: emxx_udc: Add TODO file
[PATCH v3 04/05] staging: board: Initial board staging support
[PATCH v3 05/05] staging: board: kzm9d: Board staging support for emxx_udc
This patch series is V3 of the old USB Gadget driver for Emma Mobile
that gets slightly adjusted to make use of the platform device interface
which in turn is used to add USB Gadget support to the KZM9D board.
Two separate staging components are included in this series:
1) the emxx_udc driver - from out-of-tree Android 2.6.35.7
2) board staging support for KZM9D - platform device for DT-only KZM9D
The two components above will be used to continously improve the driver
and board integration code until the driver can be moved out of staging
and/or DT bindings are available so the board staging platform device code
can be replaced with a DT node.
Changes since V2:
- Added CONFIG_OF_ADDRESS dependency for the board staging bits
Changes since V1:
- Added TODO file for emxx_udc
- Broke out board staging base support, included TODO file
- Added code to avoid registering platform device if DT node exists
- Modified KZM9D board code build condition to use SoC Kconfig entry
Many thanks to Dan Carpenter, Geert Uytterhoeven, Greg KH and
Paul Bolle for feedback!
Please let me know if you would like me to rebase this code somehow.
At quick glance, this looks good. I'll queue it up after 3.16-rc1 is
out as it's too late for this merge window.
Thanks, Greg! This sounds perfect to me!
Cheers,
/ magnus
From: Simon Horman <horms@verge.net.au> Date: 2014-06-10 01:57:44
On Mon, Jun 09, 2014 at 02:14:38PM +0900, Magnus Damm wrote:
On Sat, Jun 7, 2014 at 12:39 AM, Greg KH [off-list ref] wrote:
quoted
On Fri, Jun 06, 2014 at 07:44:08PM +0900, Magnus Damm wrote:
quoted
staging: Emma Mobile USB driver and KZM9D board code V3
[PATCH v3 01/05] staging: emxx_udc: Add Emma Mobile USB Gadget driver
[PATCH v3 02/05] staging: emxx_udc: I/O memory and IRQ resource support
[PATCH v3 03/05] staging: emxx_udc: Add TODO file
[PATCH v3 04/05] staging: board: Initial board staging support
[PATCH v3 05/05] staging: board: kzm9d: Board staging support for emxx_udc
This patch series is V3 of the old USB Gadget driver for Emma Mobile
that gets slightly adjusted to make use of the platform device interface
which in turn is used to add USB Gadget support to the KZM9D board.
Two separate staging components are included in this series:
1) the emxx_udc driver - from out-of-tree Android 2.6.35.7
2) board staging support for KZM9D - platform device for DT-only KZM9D
The two components above will be used to continously improve the driver
and board integration code until the driver can be moved out of staging
and/or DT bindings are available so the board staging platform device code
can be replaced with a DT node.
Changes since V2:
- Added CONFIG_OF_ADDRESS dependency for the board staging bits
Changes since V1:
- Added TODO file for emxx_udc
- Broke out board staging base support, included TODO file
- Added code to avoid registering platform device if DT node exists
- Modified KZM9D board code build condition to use SoC Kconfig entry
Many thanks to Dan Carpenter, Geert Uytterhoeven, Greg KH and
Paul Bolle for feedback!
Please let me know if you would like me to rebase this code somehow.
At quick glance, this looks good. I'll queue it up after 3.16-rc1 is
out as it's too late for this merge window.