summaryrefslogtreecommitdiff
path: root/drivers/usb/host/ehci-generic.c
AgeCommit message (Collapse)AuthorFilesLines
2020-12-13dm: treewide: Rename auto_alloc_size members to be shorterSimon Glass1-1/+1
This construct is quite long-winded. In earlier days it made some sense since auto-allocation was a strange concept. But with driver model now used pretty universally, we can shorten this to 'auto'. This reduces verbosity and makes it easier to read. Coincidentally it also ensures that every declaration is on one line, thus making dtoc's job easier. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-06dm: add cells_count parameter in *_count_phandle_with_argsPatrick Delaunay1-2/+2
The cell_count argument is required when cells_name is NULL. This patch adds this parameter in live tree API - of_count_phandle_with_args - ofnode_count_phandle_with_args - dev_count_phandle_with_args This parameter solves issue when these API is used to count the number of element of a cell without cell name. This parameter allow to force the size cell. For example: count = dev_count_phandle_with_args(dev, "array", NULL, 3); Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
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>
2020-02-06dm: core: Create a new header file for 'compat' featuresSimon Glass1-0/+1
At present dm/device.h includes the linux-compatible features. This requires including linux/compat.h which in turn includes a lot of headers. One of these is malloc.h which we thus end up including in every file in U-Boot. Apart from the inefficiency of this, it is problematic for sandbox which needs to use the system malloc() in some files. Move the compatibility features into a separate header file. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-06dm: core: Require users of devres to include the headerSimon Glass1-0/+1
At present devres.h is included in all files that include dm.h but few make use of it. Also this pulls in linux/compat which adds several more headers. Drop the automatic inclusion and require files to include devres themselves. This provides a good indication of which files use devres. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2019-09-11usb: ehci-generic: don't probe fail if there is no clk_enable() opsKever Yang1-1/+1
Some clock driver do not have a clk_enable() call back, and we should not treat this as fail in ehci probe like other modules, eg. clk_enabl_bulk() do not return fail if ret value is '-ENOSYS' Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2018-09-15usb: ehci-generic: Add vbus-supply regulator supportPatrice Chotard1-1/+61
Add vbus-supply regulator support. On some board vbus is not controlled by the phy but by an external regulator. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2018-08-28usb: ehci: Make the PHY handling genericMarek Vasut1-53/+3
Pull out the EHCI PHY functions into the ehci-hcd.c to let other EHCI drivers use them. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
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-03-17usb: ehci-generic: replace pr_err() by dev_err()Patrice Chotard1-7/+9
As we get access to struct udevice, use dev_err() instead of pr_err(). Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2018-03-17usb: ehci-generic: factorize PHY operationPatrice Chotard1-40/+59
Factorize PHY get/init/poweron and PHY poweroff/exit operations into separate function, it simplify the error path. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2018-03-17usb: ehci-generic: handle phy power on/offPatrice Chotard1-0/+17
Add generic_phy_power_on() and generic_phy_power_off() calls to switch ON/OFF phy during probe and remove functions. Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2017-10-04treewide: replace with error() with pr_err()Masahiro Yamada1-9/+9
U-Boot widely uses error() as a bit noisier variant of printf(). This macro causes name conflict with the following line in include/linux/compiler-gcc.h: # define __compiletime_error(message) __attribute__((error(message))) This prevents us from using __compiletime_error(), and makes it difficult to fully sync BUILD_BUG macros with Linux. (Notice Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().) Let's convert error() into now treewide-available pr_err(). Done with the help of Coccinelle, excluing tools/ directory. The semantic patch I used is as follows: // <smpl> @@@@ -error +pr_err (...) // </smpl> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Re-run Coccinelle] Signed-off-by: Tom Rini <trini@konsulko.com>
2017-09-27usb: host: ehci-generic: convert to livetreePhilipp Tomsich1-1/+1
Update the generic EHCI driver to support a live tree. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-07-29usb: host: ehci-generic: initialize PHY only when foundPatrice Chotard1-5/+6
Call generic_phy_init() only when a PHY was found. This will avoid a crash if no "phys" property is found in DT. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reported-by: Patrick Delaunay <patrick.delaunay@st.com>
2017-07-29usb: host: ehci-generic: add generic PHY supportPatrice Chotard1-1/+30
Extend ehci-generic driver with generic PHY framework Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-29usb: host: ehci-generic: add error path and .remove callbackPatrice Chotard1-23/+95
Use an array to save enabled clocks reference and deasserted resets in order to respectively disabled and asserted them in case of error during probe() or during driver removal. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-29usb: host: ehci-generic: replace printf() by error()Patrice Chotard1-2/+2
this allows to get file, line and function location of the current error message. Signed-off-by: patrice chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-06-01dm: Rename dev_addr..() functionsSimon Glass1-1/+1
These support the flat device tree. We want to use the dev_read_..() prefix for functions that support both flat tree and live tree. So rename the existing functions to avoid confusion. In the end we will have: 1. dev_read_addr...() - works on devices, supports flat/live tree 2. devfdt_get_addr...() - current functions, flat tree only 3. of_get_address() etc. - new functions, live tree only All drivers will be written to use 1. That function will in turn call either 2 or 3 depending on whether the flat or live tree is in use. Note this involves changing some dead code - the imx_lpi2c.c file. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-24usb: ehci-generic: support reset control for generic EHCIMasahiro Yamada1-0/+13
This driver is designed in a generic manner, so resets should be handled generically as well. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-09-24usb: replace ehci_*_remove() with usb_deregister()Masahiro Yamada1-6/+1
The remove callbacks of EHCI drivers are often just a wrapper of ehci_deregister. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Stephen Warren <swarren@nvidia.com>
2016-06-20clk: convert API to match reset/mailbox styleStephen Warren1-7/+7
The following changes are made to the clock API: * The concept of "clocks" and "peripheral clocks" are unified; each clock provider now implements a single set of clocks. This provides a simpler conceptual interface to clients, and better aligns with device tree clock bindings. * Clocks are now identified with a single "struct clk", rather than requiring clients to store the clock provider device and clock identity values separately. For simple clock consumers, this isolates clients from internal details of the clock API. * clk.h is split so it only contains the client/consumer API, whereas clk-uclass.h contains the provider API. This aligns with the recently added reset and mailbox APIs. * clk_ops .of_xlate(), .request(), and .free() are added so providers can customize these operations if needed. This also aligns with the recently added reset and mailbox APIs. * clk_disable() is added. * All users of the current clock APIs are updated. * Sandbox clock tests are updated to exercise clock lookup via DT, and clock enable/disable. * rkclk_get_clk() is removed and replaced with standard APIs. Buildman shows no clock-related errors for any board for which buildman can download a toolchain. test/py passes for sandbox (which invokes the dm clk test amongst others). Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
2016-02-24usb: ehci: Use map_physmem in ehci-genericMarek Vasut1-1/+3
Some architectures, like MIPS, require remapping of the registers. Add the map_physmem() call to handle it. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Hans de Goede <hdegoede@redhat.com>
2016-01-25usb: add clock support for generic EHCIMasahiro Yamada1-0/+14
This driver is designed in a generic manner, so clocks should be handled genericly as well. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-12-07usb: add support for generic EHCI devicesAlexey Brodkin1-0/+50
This driver is meant to be used with any EHCI-compatible host controller in case if there's no need for platform-specific glue such as setup of controller or PHY's power mode via GPIOs etc. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: Simon Glass <sjg@chromium.org> Cc: Marek Vasut <marex@denx.de>