mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
media: i2c: rk628: fix interrupts can be triggered in suspend
Signed-off-by: Chen Shunqing <csq@rock-chips.com> Change-Id: I39955e126729c9ec1ffabcd53d3bc679d354cd0f
This commit is contained in:
@@ -308,6 +308,7 @@ struct rk628 {
|
||||
struct dentry *debug_dir;
|
||||
struct gpio_desc *hdmirx_det_gpio;
|
||||
bool last_mipi_status;
|
||||
bool is_suspend;
|
||||
};
|
||||
|
||||
#define rk628_dbg(rk628, format, ...) \
|
||||
|
||||
@@ -252,6 +252,8 @@ static bool tx_5v_power_present(struct v4l2_subdev *sd)
|
||||
|
||||
ret = rk628_hdmirx_tx_5v_power_detect(bt1120->plugin_det_gpio);
|
||||
v4l2_dbg(2, debug, sd, "%s: %d\n", __func__, ret);
|
||||
if (bt1120->rk628->is_suspend)
|
||||
ret = false;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1770,9 +1772,11 @@ static int rk628_bt1120_resume(struct device *dev)
|
||||
rk628_cru_initialize(bt1120->rk628);
|
||||
rk628_bt1120_initial(sd);
|
||||
rk628_hdmirx_plugout(sd);
|
||||
enable_irq(bt1120->plugin_irq);
|
||||
enable_irq(bt1120->hdmirx_irq);
|
||||
schedule_delayed_work(&bt1120->delayed_work_enable_hotplug,
|
||||
msecs_to_jiffies(500));
|
||||
bt1120->rk628->is_suspend = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1785,6 +1789,9 @@ static int rk628_bt1120_suspend(struct device *dev)
|
||||
|
||||
v4l2_info(sd, "%s: suspend!\n", __func__);
|
||||
|
||||
bt1120->rk628->is_suspend = true;
|
||||
rk628_hdmirx_plugout(sd);
|
||||
disable_irq(bt1120->plugin_irq);
|
||||
disable_irq(bt1120->hdmirx_irq);
|
||||
cancel_delayed_work_sync(&bt1120->delayed_work_res_change);
|
||||
cancel_delayed_work_sync(&bt1120->delayed_work_enable_hotplug);
|
||||
|
||||
@@ -383,6 +383,8 @@ static bool tx_5v_power_present(struct v4l2_subdev *sd)
|
||||
|
||||
ret = rk628_hdmirx_tx_5v_power_detect(csi->plugin_det_gpio);
|
||||
v4l2_dbg(2, debug, sd, "%s: %d\n", __func__, ret);
|
||||
if (csi->rk628->is_suspend)
|
||||
ret = false;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -3009,9 +3011,11 @@ static int rk628_csi_resume(struct device *dev)
|
||||
rk628_cru_initialize(csi->rk628);
|
||||
rk628_csi_initial(sd);
|
||||
rk628_hdmirx_plugout(sd);
|
||||
enable_irq(csi->plugin_irq);
|
||||
enable_irq(csi->hdmirx_irq);
|
||||
schedule_delayed_work(&csi->delayed_work_enable_hotplug,
|
||||
msecs_to_jiffies(500));
|
||||
csi->rk628->is_suspend = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -3024,6 +3028,9 @@ static int rk628_csi_suspend(struct device *dev)
|
||||
|
||||
v4l2_info(sd, "%s: suspend!\n", __func__);
|
||||
|
||||
csi->rk628->is_suspend = true;
|
||||
rk628_hdmirx_plugout(sd);
|
||||
disable_irq(csi->plugin_irq);
|
||||
disable_irq(csi->hdmirx_irq);
|
||||
cancel_delayed_work_sync(&csi->delayed_work_res_change);
|
||||
cancel_delayed_work_sync(&csi->delayed_work_enable_hotplug);
|
||||
|
||||
Reference in New Issue
Block a user