media: i2c: rk628: check if phy is locked

Signed-off-by: Chen Shunqing <csq@rock-chips.com>
Change-Id: I0de339129dbd969ffcdfccc1fc3d84c6ee424461
This commit is contained in:
Chen Shunqing
2024-10-17 15:58:33 +08:00
committed by Tao Huang
parent 012fb67a53
commit 5e31f848c9
4 changed files with 23 additions and 2 deletions

View File

@@ -627,7 +627,8 @@ static void enable_stream(struct v4l2_subdev *sd, bool en)
if (en) {
if (bt1120->rk628->version >= RK628F_VERSION) {
rk628_i2c_read(bt1120->rk628, HDMI_RX_SCDC_REGS2, &val);
if (rk628_hdmirx_scdc_ced_err(bt1120->rk628)) {
if (rk628_hdmirx_scdc_ced_err(bt1120->rk628) ||
!rk628_hdmirx_is_locked(bt1120->rk628)) {
rk628_hdmirx_plugout(sd);
schedule_delayed_work(&bt1120->delayed_work_enable_hotplug,
msecs_to_jiffies(800));

View File

@@ -939,7 +939,8 @@ static void enable_stream(struct v4l2_subdev *sd, bool en)
return;
}
if (rk628_hdmirx_scdc_ced_err(csi->rk628)) {
if (rk628_hdmirx_scdc_ced_err(csi->rk628) ||
!rk628_hdmirx_is_locked(csi->rk628)) {
rk628_hdmirx_plugout(sd);
schedule_delayed_work(&csi->delayed_work_enable_hotplug,
msecs_to_jiffies(800));

View File

@@ -1885,6 +1885,24 @@ bool rk628_hdmirx_scdc_ced_err(struct rk628 *rk628)
}
EXPORT_SYMBOL(rk628_hdmirx_scdc_ced_err);
bool rk628_hdmirx_is_locked(struct rk628 *rk628)
{
u32 val;
rk628_i2c_read(rk628, HDMI_RX_SCDC_REGS1, &val);
if (!(val & 0x100))
return false;
if (!(val & 0x200))
return false;
if (!(val & 0x400))
return false;
if (!(val & 0x800))
return false;
return true;
}
EXPORT_SYMBOL(rk628_hdmirx_is_locked);
bool rk628_hdmirx_is_signal_change_ists(struct rk628 *rk628, u32 md_ints, u32 pdec_ints)
{
u32 md_mask, pded_madk;

View File

@@ -547,6 +547,7 @@ u8 rk628_hdmirx_get_color_space(struct rk628 *rk628);
int rk628_hdmirx_get_hdcp_enc_status(struct rk628 *rk628);
void rk628_hdmirx_controller_reset(struct rk628 *rk628);
bool rk628_hdmirx_scdc_ced_err(struct rk628 *rk628);
bool rk628_hdmirx_is_locked(struct rk628 *rk628);
bool rk628_hdmirx_is_signal_change_ists(struct rk628 *rk628, u32 md_ints, u32 pdec_ints);
void rk628_hdmirx_cec_irq(struct rk628 *rk628, struct rk628_hdmirx_cec *cec);