media: i2c: lt6911uxc: fix hotplug event report

Signed-off-by: Jianwei Fan <jianwei.fan@rock-chips.com>
Change-Id: Iff105f294deaf39e3bb24c0a2376ac11b3cc9bfd
This commit is contained in:
Jianwei Fan
2022-07-05 07:47:27 +00:00
committed by Tao Huang
parent e165028391
commit 9010eda830

View File

@@ -522,6 +522,8 @@ static void lt6911uxc_delayed_work_enable_hotplug(struct work_struct *work)
struct v4l2_subdev *sd = &lt6911uxc->sd;
v4l2_dbg(2, debug, sd, "%s:\n", __func__);
v4l2_ctrl_s_ctrl(lt6911uxc->detect_tx_5v_ctrl, tx_5v_power_present(sd));
lt6911uxc_config_hpd(sd);
}
@@ -606,21 +608,6 @@ static void lt6911uxc_format_change(struct v4l2_subdev *sd)
v4l2_subdev_notify_event(sd, &lt6911uxc_ev_fmt);
}
static int lt6911uxc_get_ctrl(struct v4l2_ctrl *ctrl)
{
int ret = -1;
struct lt6911uxc *lt6911uxc = container_of(ctrl->handler,
struct lt6911uxc, hdl);
struct v4l2_subdev *sd = &(lt6911uxc->sd);
if (ctrl->id == V4L2_CID_DV_RX_POWER_PRESENT) {
ret = tx_5v_power_present(sd);
*ctrl->p_new.p_s32 = ret;
}
return ret;
}
static int lt6911uxc_isr(struct v4l2_subdev *sd, u32 status, bool *handled)
{
struct lt6911uxc *lt6911uxc = to_state(sd);
@@ -1011,10 +998,6 @@ static long lt6911uxc_compat_ioctl32(struct v4l2_subdev *sd,
}
#endif
static const struct v4l2_ctrl_ops lt6911uxc_ctrl_ops = {
.g_volatile_ctrl = lt6911uxc_get_ctrl,
};
static const struct v4l2_subdev_core_ops lt6911uxc_core_ops = {
.interrupt_service_routine = lt6911uxc_isr,
.subscribe_event = lt6911uxc_subscribe_event,
@@ -1101,10 +1084,8 @@ static int lt6911uxc_init_v4l2_ctrls(struct lt6911uxc *lt6911uxc)
0, LT6911UXC_PIXEL_RATE, 1, LT6911UXC_PIXEL_RATE);
lt6911uxc->detect_tx_5v_ctrl = v4l2_ctrl_new_std(&lt6911uxc->hdl,
&lt6911uxc_ctrl_ops, V4L2_CID_DV_RX_POWER_PRESENT,
NULL, V4L2_CID_DV_RX_POWER_PRESENT,
0, 1, 0, 0);
if (lt6911uxc->detect_tx_5v_ctrl)
lt6911uxc->detect_tx_5v_ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE;
lt6911uxc->audio_sampling_rate_ctrl =
v4l2_ctrl_new_custom(&lt6911uxc->hdl,