Re: [PATCH phy-next 12/22] phy: move provider API out of public <linux/phy/phy.h>
From: Dmitry Baryshkov
Date: Wed Mar 04 2026 - 18:56:32 EST
On Wed, Mar 04, 2026 at 07:57:25PM +0200, Vladimir Oltean wrote:
> The major goal is to hide the contents of struct phy from consumer
> drivers.
>
> The idea with "phy-props.h" is that both consumers and providers make
> use of some data types. So both headers include "phy-props.h".
>
> Two slight points of contention.
>
> 1. phy_set_bus_width(): Vinod explains that despite the current caller
> situation (9 providers, 1 consumer), it is a consumer API function.
>
> The use case is that the controller (for example UFS) may have
> limitations and should set the expected lanes to be used and width on
> those lanes. A number of Generic PHYs can support multiple lanes and
> multiple width so this is way for controller telling I am using this
> configuration.
>
> 2. phy-provider.h should go to include/linux/phy/ or to drivers/phy/?
> We do have 3 PHY providers outside of drivers/phy/:
>
> drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_dphy.c
> drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> drivers/pinctrl/tegra/pinctrl-tegra-xusb.c
>
> but the practice is not encouraged, and with time, these should be
> moved to the subsystem. This is not something that I can do now.
>
> For temporary compatibility, keep including the provider header. This
> will be removed when abuses are all gotten rid of.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@xxxxxxx>
> ---
> drivers/phy/phy-core.c | 34 +++
> drivers/phy/phy-provider.h | 256 +++++++++++++++++
> include/linux/phy/phy-props.h | 75 +++++
> include/linux/phy/phy.h | 499 +++++++---------------------------
> 4 files changed, 458 insertions(+), 406 deletions(-)
> create mode 100644 drivers/phy/phy-provider.h
> create mode 100644 include/linux/phy/phy-props.h
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>
--
With best wishes
Dmitry