Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c41a957 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'usb-for-v4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next



Felipe writes:

usb: patches for v4.1 merge window

As usual, a big pile of commits. This time a total
of 111 non-merge commits.

Other than the usual set of cleanups and non-critical
fixes, we have some interesting work for AM335x's MUSB
babble recovery. Now that takes a lot less time and we
don't have to Reset MUSB all the time.

The printer gadget has been converted to configfs interface
and the atmel udc has learned suspend/resume with wakeup.

Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parents cd0e0757 3e457371
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
What:		/config/usb-gadget/gadget/functions/printer.name
Date:		Apr 2015
KernelVersion:	4.1
Description:
		The attributes:

		pnp_string	- Data to be passed to the host in pnp string
		q_len		- Number of requests per endpoint
+1 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ Optional properties:
 - phys: from the *Generic PHY* bindings
 - phy-names: from the *Generic PHY* bindings
 - tx-fifo-resize: determines if the FIFO *has* to be reallocated.
 - snps,usb3_lpm_capable: determines if platform is USB3 LPM capable
 - snps,disable_scramble_quirk: true when SW should disable data scrambling.
	Only really useful for FPGA builds.
 - snps,has-lpm-erratum: true when DWC3 was configured with LPM Erratum enabled
+4 −1
Original line number Diff line number Diff line
@@ -15,7 +15,10 @@ Optional properties:
  - phys: phandle + phy specifier pair
  - phy-names: must be "usb"
  - dmas: Must contain a list of references to DMA specifiers.
  - dma-names : Must contain a list of DMA names, "tx" or "rx".
  - dma-names : Must contain a list of DMA names:
   - tx0 ... tx<n>
   - rx0 ... rx<n>
    - This <n> means DnFIFO in USBHS module.

Example:
	usbhs: usb@e6590000 {
+47 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ provided by gadgets.
16. UAC1 function
17. UAC2 function
18. UVC function
19. PRINTER function


1. ACM function
@@ -726,3 +727,49 @@ with these patches:
http://www.spinics.net/lists/linux-usb/msg99220.html

host: luvcview -f yuv

19. PRINTER function
====================

The function is provided by usb_f_printer.ko module.

Function-specific configfs interface
------------------------------------

The function name to use when creating the function directory is "printer".
The printer function provides these attributes in its function directory:

	pnp_string	- Data to be passed to the host in pnp string
	q_len		- Number of requests per endpoint

Testing the PRINTER function
----------------------------

The most basic testing:

device: run the gadget
# ls -l /devices/virtual/usb_printer_gadget/

should show g_printer<number>.

If udev is active, then /dev/g_printer<number> should appear automatically.

host:

If udev is active, then e.g. /dev/usb/lp0 should appear.

host->device transmission:

device:
# cat /dev/g_printer<number>
host:
# cat > /dev/usb/lp0

device->host transmission:

# cat > /dev/g_printer<number>
host:
# cat /dev/usb/lp0

More advanced testing can be done with the prn_example
described in Documentation/usb/gadget-printer.txt.
+5 −5
Original line number Diff line number Diff line
@@ -86,10 +86,8 @@ static int hw_device_state(struct ci_hdrc *ci, u32 dma)
		/* interrupt, error, port change, reset, sleep/suspend */
		hw_write(ci, OP_USBINTR, ~0,
			     USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI);
		hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
	} else {
		hw_write(ci, OP_USBINTR, ~0, 0);
		hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
	}
	return 0;
}
@@ -1508,7 +1506,9 @@ static int ci_udc_vbus_session(struct usb_gadget *_gadget, int is_active)
			hw_device_reset(ci);
			hw_device_state(ci, ci->ep0out->qh.dma);
			usb_gadget_set_state(_gadget, USB_STATE_POWERED);
			usb_udc_vbus_handler(_gadget, true);
		} else {
			usb_udc_vbus_handler(_gadget, false);
			if (ci->driver)
				ci->driver->disconnect(&ci->gadget);
			hw_device_state(ci, 0);
@@ -1574,13 +1574,12 @@ static int ci_udc_pullup(struct usb_gadget *_gadget, int is_on)
{
	struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget);

	if (!ci->vbus_active)
		return -EOPNOTSUPP;

	pm_runtime_get_sync(&ci->gadget.dev);
	if (is_on)
		hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
	else
		hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
	pm_runtime_put_sync(&ci->gadget.dev);

	return 0;
}
@@ -1710,6 +1709,7 @@ static int ci_udc_start(struct usb_gadget *gadget,
		spin_lock_irqsave(&ci->lock, flags);
		hw_device_reset(ci);
	} else {
		usb_udc_vbus_handler(&ci->gadget, false);
		pm_runtime_put_sync(&ci->gadget.dev);
		return retval;
	}
Loading