summaryrefslogtreecommitdiff
path: root/drivers/usb/emul/usb-emul-uclass.c
AgeCommit message (Collapse)AuthorFilesLines
2020-05-19common: Drop log.h from common headerSimon Glass1-0/+1
Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-09-11usb: Add nonblock argument to submit_int_msgMichal Suchanek1-2/+4
This will be used to implement non-blocking keyboard polling in case of errors. Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini1-2/+1
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-27Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTRTom Rini1-2/+0
We have a large number of places where while we historically referenced gd in the code we no longer do, as well as cases where the code added that line "just in case" during development and never dropped it. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-10-01dm: usb: emul: Drop usb_emul_reset()Bin Meng1-8/+0
With the root hub unbinding in usb_stop(), there is no need to do a Sandbox-specific reset operation. usb_emul_reset() is no longer used anywhere, drop it. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01usb: emul: Expose find_descriptor() as a public APIBin Meng1-3/+2
This can be useful outside of the sandbox usb emulation uclass driver. Expose it as a public API with a proper prefix (usb_emul_). Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01usb: sandbox: Fix emulator device select logic in usb_emul_find_devnum()Bin Meng1-5/+37
Current emulator select logic in usb_emul_find_devnum() is to test the USB address. The USB address of the device being enumerated is initialized to zero at the beginning of the enumeration process in usb_setup_device(). At this point, the saved USB address in the platform data has not been assigned to any valid USB address either. This means: the logic will select an emulator device according to its sequence of declaring order in the device tree. Take test.dts for example, flash-stick@0 will be selected before flash-stick@1. But unfortunately such logic is wrong. In fact USB devices show up in a random order during the enumeration which means usb_emul_find_devnum() may be called on port 3 for keyb@3 before on port 0 for flash-stick@0. To fix this, we introduce a new emulator uclass specific platdata to store the USB device's port number on its parent hub, and update the logic to test the port number instead. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01usb: emul: Remove maxpacketsize in usb_emul_setup_device()Bin Meng1-2/+2
This parameter is never used. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2016-07-27dm: Use dm_scan_fdt_dev() directly where possibleSimon Glass1-7/+1
Quite a few places have a bind() method which just calls dm_scan_fdt_dev(). We may as well call dm_scan_fdt_dev() directly. Update the code to do this. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-07-27dm: Convert users from dm_scan_fdt_node() to dm_scan_fdt_dev()Simon Glass1-2/+1
This new function is more convenient for callers, and handles pre-relocation situations automatically. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-11-20usb: sandbox: Add support for interrupt operationsSimon Glass1-0/+12
Allow USB device emulation to support interrupt URBs so that we can use USB keyboards with sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-11-20sandbox: usb: Allow finding a USB emulator for a deviceSimon Glass1-2/+15
Each USB device has an emulator. Currently this can only be found by supplying the 'pipe' value, which contains the device number. Add a way to find it directly from the emulated device. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-18dm: usb: sandbox: Add a uclass for USB device emulationSimon Glass1-0/+263
With sandbox we want to be able to emulate USB devices so that we can test the USB stack. Add a uclass to support this. It implements the same operations as a normal USB device driver, but in this case passes them on to an emulation driver. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>