-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'usb-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/…
…git/gregkh/usb Pull USB updates from Greg KH: "Here is the big USB patchset for 4.6-rc1. The normal mess is here, gadget and xhci fixes and updates, and lots of other driver updates and cleanups as well. Full details are in the shortlog. All have been in linux-next for a while with no reported issues" * tag 'usb-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (266 commits) USB: core: let USB device know device node usb: devio: Add ioctl to disallow detaching kernel USB drivers. usb: gadget: f_acm: Fix configfs attr name usb: udc: lpc32xx: remove USB PLL and USB OTG clock management usb: udc: lpc32xx: remove direct access to clock controller registers usb: udc: lpc32xx: switch to clock prepare/unprepare model usb: renesas_usbhs: gadget: fix giveback status code in usbhsg_pipe_disable() usb: gadget: renesas_usb3: Use ARCH_RENESAS usb: dwc2: Fix issues in dwc2_complete_non_isoc_xfer_ddma() usb: dwc2: Add support for Lantiq ARX and XRX SoCs usb: phy: generic: Handle late registration of gadget usb: gadget: bdc_udc: fix race condition in bdc_udc_exit() usb: musb: core: added missing const qualifier to musb_hdrc_platform_data::config usb: dwc2: Move host-specific core functions into hcd.c usb: dwc2: Move register save and restore functions usb: dwc2: Use kmem_cache_free() usb: dwc2: host: If using uframe scheduler, end splits better usb: dwc2: host: Totally redo the microframe scheduler usb: dwc2: host: Properly set even/odd frame usb: dwc2: host: Add dwc2_hcd_get_future_frame_number() call ...
- Loading branch information
Showing
192 changed files
with
9,738 additions
and
6,111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Rockchip specific extensions to the Analogix Display Port PHY | ||
------------------------------------ | ||
|
||
Required properties: | ||
- compatible : should be one of the following supported values: | ||
- "rockchip.rk3288-dp-phy" | ||
- clocks: from common clock binding: handle to dp clock. | ||
of memory mapped region. | ||
- clock-names: from common clock binding: | ||
Required elements: "24m" | ||
- rockchip,grf: phandle to the syscon managing the "general register files" | ||
- #phy-cells : from the generic PHY bindings, must be 0; | ||
|
||
Example: | ||
|
||
edp_phy: edp-phy { | ||
compatible = "rockchip,rk3288-dp-phy"; | ||
rockchip,grf = <&grf>; | ||
clocks = <&cru SCLK_EDP_24M>; | ||
clock-names = "24m"; | ||
#phy-cells = <0>; | ||
}; |
19 changes: 19 additions & 0 deletions
19
Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Rockchip EMMC PHY | ||
----------------------- | ||
|
||
Required properties: | ||
- compatible: rockchip,rk3399-emmc-phy | ||
- rockchip,grf : phandle to the syscon managing the "general | ||
register files" | ||
- #phy-cells: must be 0 | ||
- reg: PHY configure reg address offset in "general | ||
register files" | ||
|
||
Example: | ||
|
||
emmcphy: phy { | ||
compatible = "rockchip,rk3399-emmc-phy"; | ||
rockchip,grf = <&grf>; | ||
reg = <0xf780>; | ||
#phy-cells = <0>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Generic USB Device Properties | ||
|
||
Usually, we only use device tree for hard wired USB device. | ||
The reference binding doc is from: | ||
http://www.firmware.org/1275/bindings/usb/usb-1_0.ps | ||
|
||
Required properties: | ||
- compatible: usbVID,PID. The textual representation of VID, PID shall | ||
be in lower case hexadecimal with leading zeroes suppressed. The | ||
other compatible strings from the above standard binding could also | ||
be used, but a device adhering to this binding may leave out all except | ||
for usbVID,PID. | ||
- reg: the port number which this device is connecting to, the range | ||
is 1-31. | ||
|
||
Example: | ||
|
||
&usb1 { | ||
status = "okay"; | ||
|
||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
hub: genesys@1 { | ||
compatible = "usb5e3,608"; | ||
reg = <1>; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
#include <sys/ioctl.h> | ||
#include <sys/types.h> | ||
#include <sys/stat.h> | ||
#include <fcntl.h> | ||
#include <stdio.h> | ||
#include <errno.h> | ||
#include <string.h> | ||
#include <inttypes.h> | ||
#include <unistd.h> | ||
|
||
#include <linux/usbdevice_fs.h> | ||
|
||
/* For building without an updated set of headers */ | ||
#ifndef USBDEVFS_DROP_PRIVILEGES | ||
#define USBDEVFS_DROP_PRIVILEGES _IOW('U', 30, __u32) | ||
#define USBDEVFS_CAP_DROP_PRIVILEGES 0x40 | ||
#endif | ||
|
||
void drop_privileges(int fd, uint32_t mask) | ||
{ | ||
int res; | ||
|
||
res = ioctl(fd, USBDEVFS_DROP_PRIVILEGES, &mask); | ||
if (res) | ||
printf("ERROR: USBDEVFS_DROP_PRIVILEGES returned %d\n", res); | ||
else | ||
printf("OK: privileges dropped!\n"); | ||
} | ||
|
||
void reset_device(int fd) | ||
{ | ||
int res; | ||
|
||
res = ioctl(fd, USBDEVFS_RESET); | ||
if (!res) | ||
printf("OK: USBDEVFS_RESET succeeded\n"); | ||
else | ||
printf("ERROR: reset failed! (%d - %s)\n", | ||
-res, strerror(-res)); | ||
} | ||
|
||
void claim_some_intf(int fd) | ||
{ | ||
int i, res; | ||
|
||
for (i = 0; i < 4; i++) { | ||
res = ioctl(fd, USBDEVFS_CLAIMINTERFACE, &i); | ||
if (!res) | ||
printf("OK: claimed if %d\n", i); | ||
else | ||
printf("ERROR claiming if %d (%d - %s)\n", | ||
i, -res, strerror(-res)); | ||
} | ||
} | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
uint32_t mask, caps; | ||
int c, fd; | ||
|
||
fd = open(argv[1], O_RDWR); | ||
if (fd < 0) { | ||
printf("Failed to open file\n"); | ||
goto err_fd; | ||
} | ||
|
||
/* | ||
* check if dropping privileges is supported, | ||
* bail on systems where the capability is not present | ||
*/ | ||
ioctl(fd, USBDEVFS_GET_CAPABILITIES, &caps); | ||
if (!(caps & USBDEVFS_CAP_DROP_PRIVILEGES)) { | ||
printf("DROP_PRIVILEGES not supported\n"); | ||
goto err; | ||
} | ||
|
||
/* | ||
* Drop privileges but keep the ability to claim all | ||
* free interfaces (i.e., those not used by kernel drivers) | ||
*/ | ||
drop_privileges(fd, -1U); | ||
|
||
printf("Available options:\n" | ||
"[0] Exit now\n" | ||
"[1] Reset device. Should fail if device is in use\n" | ||
"[2] Claim 4 interfaces. Should succeed where not in use\n" | ||
"[3] Narrow interface permission mask\n" | ||
"Which option shall I run?: "); | ||
|
||
while (scanf("%d", &c) == 1) { | ||
switch (c) { | ||
case 0: | ||
goto exit; | ||
case 1: | ||
reset_device(fd); | ||
break; | ||
case 2: | ||
claim_some_intf(fd); | ||
break; | ||
case 3: | ||
printf("Insert new mask: "); | ||
scanf("%x", &mask); | ||
drop_privileges(fd, mask); | ||
break; | ||
default: | ||
printf("I don't recognize that\n"); | ||
} | ||
|
||
printf("Which test shall I run next?: "); | ||
} | ||
|
||
exit: | ||
close(fd); | ||
return 0; | ||
|
||
err: | ||
close(fd); | ||
err_fd: | ||
return 1; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.