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 <maxime.ripard@bootlin.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
This commit is contained in:
Maxime Ripard
2018-12-07 14:55:31 +01:00
committed by Kishon Vijay Abraham I
parent 2ed869990e
commit dddc97e823
4 changed files with 181 additions and 0 deletions

View File

@@ -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_ */