phy/rockchip: mipi-dphy: optimized power on/off sequences
we can power off the bandgap to reduce power consumption. Change-Id: I7959e6f1d38a6abca70d6d904264668a19ace920 Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
This commit is contained in:
parent
e18e74beb7
commit
b8a66c99b7
1 changed files with 18 additions and 0 deletions
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
/* Innosilicon MIPI D-PHY registers */
|
||||
#define INNO_PHY_LANE_CTRL 0x00000
|
||||
#define MIPI_BGPD BIT(7)
|
||||
#define PWROK_BP BIT(1)
|
||||
#define PWROK BIT(0)
|
||||
#define INNO_PHY_POWER_CTRL 0x00004
|
||||
|
|
@ -67,6 +68,8 @@
|
|||
#define TTL_MODE_ENABLE BIT(2)
|
||||
#define LVDS_MODE_ENABLE BIT(1)
|
||||
#define MIPI_MODE_ENABLE BIT(0)
|
||||
#define INNO_PHY_LVDS_CTRL 0x003ac
|
||||
#define LVDS_BGPD BIT(0)
|
||||
|
||||
#define INNO_CLOCK_LANE_REG_BASE 0x00100
|
||||
#define INNO_DATA_LANE_0_REG_BASE 0x00180
|
||||
|
|
@ -409,6 +412,19 @@ static inline void inno_mipi_dphy_da_pwrok_disable(struct inno_mipi_dphy *inno)
|
|||
PWROK_BP | PWROK, PWROK_BP);
|
||||
}
|
||||
|
||||
static inline void inno_mipi_dphy_bgpd_enable(struct inno_mipi_dphy *inno)
|
||||
{
|
||||
regmap_update_bits(inno->regmap, INNO_PHY_LANE_CTRL, MIPI_BGPD, 0);
|
||||
}
|
||||
|
||||
static inline void inno_mipi_dphy_bgpd_disable(struct inno_mipi_dphy *inno)
|
||||
{
|
||||
regmap_update_bits(inno->regmap, INNO_PHY_LANE_CTRL,
|
||||
MIPI_BGPD, MIPI_BGPD);
|
||||
regmap_update_bits(inno->regmap, INNO_PHY_LVDS_CTRL,
|
||||
LVDS_BGPD, LVDS_BGPD);
|
||||
}
|
||||
|
||||
static inline void inno_mipi_dphy_lane_enable(struct inno_mipi_dphy *inno)
|
||||
{
|
||||
u8 map[] = {0x44, 0x4c, 0x5c, 0x7c};
|
||||
|
|
@ -655,6 +671,7 @@ static int inno_mipi_dphy_power_on(struct phy *phy)
|
|||
clk_prepare_enable(inno->h2p_clk);
|
||||
clk_prepare_enable(inno->pclk);
|
||||
pm_runtime_get_sync(inno->dev);
|
||||
inno_mipi_dphy_bgpd_enable(inno);
|
||||
inno_mipi_dphy_da_pwrok_enable(inno);
|
||||
inno_mipi_dphy_pll_enable(inno);
|
||||
inno_mipi_dphy_lane_enable(inno);
|
||||
|
|
@ -672,6 +689,7 @@ static int inno_mipi_dphy_power_off(struct phy *phy)
|
|||
inno_mipi_dphy_lane_disable(inno);
|
||||
inno_mipi_dphy_pll_disable(inno);
|
||||
inno_mipi_dphy_da_pwrok_disable(inno);
|
||||
inno_mipi_dphy_bgpd_disable(inno);
|
||||
pm_runtime_put(inno->dev);
|
||||
clk_disable_unprepare(inno->pclk);
|
||||
clk_disable_unprepare(inno->h2p_clk);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue