media: i2c: rk628: hdmirx phy power off when plug out

Change-Id: I0173e25ce4c87ba883c87c36322112a7d1821c30
Signed-off-by: Chen Shunqing <csq@rock-chips.com>
This commit is contained in:
Chen Shunqing
2024-04-19 14:40:22 +08:00
parent 853e8825b3
commit ee034abd43
4 changed files with 14 additions and 2 deletions

View File

@@ -332,6 +332,7 @@ static void rk628_hdmirx_plugout(struct v4l2_subdev *sd)
rk628_hdmirx_audio_cancel_work_audio(bt1120->audio_info, true);
rk628_hdmirx_hpd_ctrl(sd, false);
rk628_hdmirx_inno_phy_power_off(sd);
rk628_hdmirx_verisyno_phy_power_off(bt1120->rk628);
rk628_hdmirx_controller_reset(bt1120->rk628);
rk628_clk_set_rate(bt1120->rk628, CGU_CLK_CPLL, CPLL_REF_CLK);
}
@@ -471,7 +472,7 @@ static void rk628_delayed_work_res_change(struct work_struct *work)
rk628_bt1120_enable_interrupts(sd, false);
rk628_hdmirx_audio_cancel_work_audio(bt1120->audio_info, true);
rk628_hdmirx_hpd_ctrl(sd, false);
rk628_hdmirx_inno_phy_power_off(sd);
rk628_hdmirx_verisyno_phy_power_off(bt1120->rk628);
rk628_hdmirx_controller_reset(bt1120->rk628);
schedule_delayed_work(&bt1120->delayed_work_enable_hotplug,
msecs_to_jiffies(1100));

View File

@@ -474,6 +474,7 @@ static void rk628_hdmirx_plugout(struct v4l2_subdev *sd)
rk628_hdmirx_audio_cancel_work_audio(csi->audio_info, true);
rk628_hdmirx_hpd_ctrl(sd, false);
rk628_hdmirx_inno_phy_power_off(sd);
rk628_hdmirx_verisyno_phy_power_off(csi->rk628);
rk628_hdmirx_controller_reset(csi->rk628);
rk628_clk_set_rate(csi->rk628, CGU_CLK_CPLL, CPLL_REF_CLK);
}
@@ -580,7 +581,7 @@ static void rk628_delayed_work_res_change(struct work_struct *work)
rk628_csi_enable_interrupts(sd, false);
rk628_hdmirx_audio_cancel_work_audio(csi->audio_info, true);
rk628_hdmirx_hpd_ctrl(sd, false);
rk628_hdmirx_inno_phy_power_off(sd);
rk628_hdmirx_verisyno_phy_power_off(csi->rk628);
rk628_hdmirx_controller_reset(csi->rk628);
schedule_delayed_work(&csi->delayed_work_enable_hotplug,
msecs_to_jiffies(1100));

View File

@@ -1186,6 +1186,15 @@ void rk628_hdmirx_verisyno_phy_power_on(struct rk628 *rk628)
}
EXPORT_SYMBOL(rk628_hdmirx_verisyno_phy_power_on);
void rk628_hdmirx_verisyno_phy_power_off(struct rk628 *rk628)
{
if (rk628->version < RK628F_VERSION)
return;
rk628_i2c_write(rk628, GRF_SW_HDMIRXPHY_CRTL, 0x07);
}
EXPORT_SYMBOL(rk628_hdmirx_verisyno_phy_power_off);
void rk628_hdmirx_phy_prepclk_cfg(struct rk628 *rk628)
{
u32 format;

View File

@@ -511,6 +511,7 @@ void rk628_csi_isr_ctsn(HAUDINFO info, u32 pdec_ints);
void rk628_csi_isr_fifoints(HAUDINFO info, u32 fifo_ints);
int rk628_is_avi_ready(struct rk628 *rk628, bool avi_rcv_rdy);
void rk628_hdmirx_verisyno_phy_power_on(struct rk628 *rk628);
void rk628_hdmirx_verisyno_phy_power_off(struct rk628 *rk628);
void rk628_hdmirx_phy_prepclk_cfg(struct rk628 *rk628);
int rk628_hdmirx_verisyno_phy_init(struct rk628 *rk628);
u8 rk628_hdmirx_get_format(struct rk628 *rk628);