aboutsummaryrefslogtreecommitdiff
path: root/drivers/phy/phy-stm32-usbphyc.c
Commit message (Collapse)AuthorAgeFilesLines
* common: Drop linux/printk.h from common headerSimon Glass2023-09-241-0/+1
| | | | | | | | | This old patch was marked as deferred. Bring it back to life, to continue towards the removal of common.h Move this out of the common header and include it only where needed. Signed-off-by: Simon Glass <sjg@chromium.org>
* drivers: fix debug string with fdt_addr_t inputJohan Jonker2023-05-061-2/+2
| | | | | | | | | The fdt_addr_t and phys_addr_t size have been decoupled. A 32bit CPU can expect 64-bit data from the device tree parser, so fix some debug strings with fdt_addr_t to be able to handle both sizes. Signed-off-by: Johan Jonker <jbx6244@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* phy: usbphyc: use regulator_set_enable_if_allowed for disabling vbus supplyPatrick Delaunay2022-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use regulator_set_enable_if_allowed() api instead of regulator_set_enable() while disabling vbus supply. This way the driver doesn't see an error when it disable an always-on regulator for VBUS. This patch is needed for STM32MP157C-DK2 board when the regulator v3v3: buck4 used as the phy vbus supply in kernel device tree is always on with the next hack for low power use-case: &usbphyc_port0 { ... /* * Hack to keep hub active until all connected devices are suspended * otherwise the hub will be powered off as soon as the v3v3 is disabled * and it can disturb connected devices. */ connector { compatible = "usb-a-connector"; vbus-supply = <&v3v3>; }; }; Without this patch and the previous update in DT the command "usb stop" failed and the next command "usb start" cause a crash. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Marek Vasut <marex@denx.de>
* phy: stm32-usbphyc: usbphyc is a clock provider of ck_usbo_48m clockPatrick Delaunay2022-09-061-0/+79
| | | | | | | | | | ck_usbo_48m is generated by usbphyc PLL and used by OTG controller for Full-Speed use cases with dedicated Full-Speed transceiver. ck_usbo_48m is available as soon as the PLL is enabled. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* phy: stm32-usbphyc: add counter of PLL consumerPatrick Delaunay2022-09-061-28/+48
| | | | | | | | | | | Add the counter of the PLL user n_pll_cons managed by the 2 functions stm32_usbphyc_pll_enable / stm32_usbphyc_pll_disable. This counter allow to remove the function stm32_usbphyc_is_init and it is a preliminary step for ck_usbo_48m introduction. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* phy: stm32-usbphyc: stm32-usbphyc: Add DT phy tuning supportPatrice Chotard2022-05-101-0/+167
| | | | | | | | Add support of phy-tuning properties for sm32-usbphyc's phy tuning aligned with v5.15 kernel bindings. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
* phy: stm32-usbphyc: stm32: usbphyc: add protection on phy sub-nodePatrick Delaunay2021-10-081-10/+12
| | | | | | | | Add protection on presence and order of the phy node sub node by using the mandatory reg information. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* phy: stm32-usbphyc: use connector for vbus-supply with phy-stm32-usbphycPatrick Delaunay2021-10-081-5/+7
| | | | | | | | | | | | | | | | | | | | | | | The vbus-supply is an optional property of sub-node connector node. and no more in the usb phyc node (in first proposed binding). This regulator for USB VBUS may be needed for host mode. See the latest kernel binding for details in Documentation/devicetree/bindings/phy/phy-stm32-usbphyc.yaml. usbphyc_port0: usb-phy@0 { reg = <0>; phy-supply = <&vdd_usb>; #phy-cells = <0>; connector { compatible = "usb-a-connector"; vbus-supply = <&vbus_sw>; }; }; Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* phy: stm32-usbphyc: migrate trace to dev and log macroPatrick Delaunay2021-01-131-8/+10
| | | | | | | | | | Change pr_debug to log_debug or dev_dbg macro and define LOG_CATEGORY. Remove the "%s:" __func__ header as it is managed by dev macro (dev->name is displayed) or log macro (CONFIG_LOGF_FUNC). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
* dm: treewide: Rename auto_alloc_size members to be shorterSimon Glass2020-12-131-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>
* phy: stm32: usbphyc: manage optional vbus regulator on phy_power_on/offPatrick Delaunay2020-11-251-10/+23
| | | | | | | | This patch adds support for optional vbus regulator. It is managed on phy_power_on/off calls and may be needed for host mode. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
* phy: usbphyc: Fix not calling dev_err with a deviceSean Anderson2020-09-301-1/+1
| | | | | | | | | Use the phy's device. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com> Tested-by: Patrick Delaunay <patrick.delaunay@st.com>
* phy: usbphyc: use regulator_set_enable_if_allowed for disabling vdd supplyPatrick Delaunay2020-07-281-1/+1
| | | | | | | | | | | | | | Use regulator_set_enable_if_allowed() api instead of regulator_set_enable() while disabling vdd supply. This way the driver doesn't see an error when disabling an always-on regulator. This patch is needed since the commit f93fab312615 ("Revert 'power: regulator: Return success on attempt to disable an always-on regulator'") and use the API introduced by commit cc4a224af226 ("power: regulator: Introduce regulator_set_enable_if_allowed api"). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
* common: Drop linux/delay.h from common headerSimon Glass2020-05-181-0/+1
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop log.h from common headerSimon Glass2020-05-181-0/+1
| | | | | | Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Create a new header file for 'compat' featuresSimon Glass2020-02-051-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>
* phy: usbphyc: increase PLL wait timeoutPatrick Delaunay2019-04-211-6/+4
| | | | | | | wait 200us to solve USB init issue on device mode (ums and stm32prog commands) Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* phy: usbphyc: move vdda1v1 and vdda1v8 in phy_initPatrick Delaunay2019-04-211-29/+31
| | | | | | | vdda1v1 and vdda1v8 are used by the PLL. Both need to be enabled before starting the PLL. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* phy: usbphyc: Binding update of vdda supplyPatrick Delaunay2019-04-211-24/+30
| | | | | | | Move supply vdda1v1 and vdda1v8 in usbphyc node and no more in port Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* phy: usbphyc: update xlate with DT bindingPatrick Delaunay2019-04-211-9/+10
| | | | | | | | | | | | | | | | | | | | | Parameter added for port 1, for example: &usbh_ehci { phys = <&usbphyc_port0>; phy-names = "usb"; vbus-supply = <&vbus_sw>; status = "okay"; }; &usbotg_hs { pinctrl-names = "default"; pinctrl-0 = <&usbotg_hs_pins_a>; phys = <&usbphyc_port1 0>; phy-names = "usb2-phy"; status = "okay"; }; Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* phy: usbphyc: remove unused variable indexPatrick Delaunay2019-04-211-2/+0
| | | | | | Remove unused field index in struct stm32_usbphyc_phy. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* SPDX: Fixup SPDX tags in a few new filesTom Rini2018-05-201-1/+1
| | | | Signed-off-by: Tom Rini <trini@konsulko.com>
* phy: add support for STM32 usb phy controllerPatrice Chotard2018-05-181-0/+402
This patch adds phy tranceiver driver for STM32 USB PHY Controller (usbphyc) that provides dual port High-Speed phy for OTG (single port) and EHCI/OHCI host controller (two ports). One port of the phy is shared between the two USB controllers through a UTMI+ switch. Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>