From dddc97e823033b705bbc06bc08b078200ad736a3 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 7 Dec 2018 14:55:31 +0100 Subject: phy: dphy: Add configuration helpers The MIPI D-PHY spec defines default values and boundaries for most of the parameters it defines. Introduce helpers to help drivers get meaningful values based on their current parameters, and validate the boundaries of these parameters if needed. Signed-off-by: Maxime Ripard Signed-off-by: Kishon Vijay Abraham I --- include/linux/phy/phy-mipi-dphy.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/linux/phy') diff --git a/include/linux/phy/phy-mipi-dphy.h b/include/linux/phy/phy-mipi-dphy.h index 29bf94db88ad..c08aacc0ac35 100644 --- a/include/linux/phy/phy-mipi-dphy.h +++ b/include/linux/phy/phy-mipi-dphy.h @@ -276,4 +276,10 @@ struct phy_configure_opts_mipi_dphy { unsigned char lanes; }; +int phy_mipi_dphy_get_default_config(unsigned long pixel_clock, + unsigned int bpp, + unsigned int lanes, + struct phy_configure_opts_mipi_dphy *cfg); +int phy_mipi_dphy_config_validate(struct phy_configure_opts_mipi_dphy *cfg); + #endif /* __PHY_MIPI_DPHY_H_ */ -- cgit v1.2.3-59-g8ed1b