提交 8bb58964 编写于 作者: H Hans de Goede 提交者: Mauro Carvalho Chehab

[media] gspca: Add reset_resume callback to all sub-drivers

1) The gspca-core's suspend/resume code is such that resume being called after
a reset is safe / ok.

2) All devices tested sofar seem to need the reset_resume callback to work
properly over a suspend

3) The USB-core won't call the reset_resume callback for devices which don't
need it

Thus it seems the simplest and the best to just add the callback to all
sub-drivers, rather then adding the callbacks one-by-one as each driver gets
tested with suspend/resume.
Signed-off-by: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 12891794
...@@ -282,6 +282,7 @@ static struct usb_driver sd_driver = { ...@@ -282,6 +282,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -959,6 +959,7 @@ static struct usb_driver sd_driver = { ...@@ -959,6 +959,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -1898,6 +1898,7 @@ static struct usb_driver sd_driver = { ...@@ -1898,6 +1898,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -792,6 +792,7 @@ static struct usb_driver sd_driver = { ...@@ -792,6 +792,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -299,6 +299,7 @@ static struct usb_driver sd_driver = { ...@@ -299,6 +299,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -521,6 +521,7 @@ static struct usb_driver sd_driver = { ...@@ -521,6 +521,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -541,6 +541,7 @@ static struct usb_driver sd_driver = { ...@@ -541,6 +541,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -505,8 +505,6 @@ static void sd_stop0(struct gspca_dev *gspca_dev) ...@@ -505,8 +505,6 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
/* sub-driver description */ /* sub-driver description */
static const struct sd_desc sd_desc = { static const struct sd_desc sd_desc = {
.name = MODULE_NAME, .name = MODULE_NAME,
/* .ctrls = none have been detected */
/* .nctrls = ARRAY_SIZE(sd_ctrls), */
.config = sd_config, .config = sd_config,
.init = sd_init, .init = sd_init,
.start = sd_start, .start = sd_start,
...@@ -536,6 +534,7 @@ static struct usb_driver sd_driver = { ...@@ -536,6 +534,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -401,6 +401,7 @@ static struct usb_driver sd_driver = { ...@@ -401,6 +401,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -472,6 +472,7 @@ static struct usb_driver sd_driver = { ...@@ -472,6 +472,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -400,6 +400,7 @@ static struct usb_driver sd_driver = { ...@@ -400,6 +400,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
.disconnect = m5602_disconnect .disconnect = m5602_disconnect
}; };
......
...@@ -1084,6 +1084,7 @@ static struct usb_driver sd_driver = { ...@@ -1084,6 +1084,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -2087,6 +2087,7 @@ static struct usb_driver sd_driver = { ...@@ -2087,6 +2087,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -4981,6 +4981,7 @@ static struct usb_driver sd_driver = { ...@@ -4981,6 +4981,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -1537,6 +1537,7 @@ static struct usb_driver sd_driver = { ...@@ -1537,6 +1537,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -1493,6 +1493,7 @@ static struct usb_driver sd_driver = { ...@@ -1493,6 +1493,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -462,6 +462,7 @@ static struct usb_driver sd_driver = { ...@@ -462,6 +462,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -925,6 +925,7 @@ static struct usb_driver sd_driver = { ...@@ -925,6 +925,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -694,6 +694,7 @@ static struct usb_driver sd_driver = { ...@@ -694,6 +694,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -730,6 +730,7 @@ static struct usb_driver sd_driver = { ...@@ -730,6 +730,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
.pre_reset = sd_pre_reset, .pre_reset = sd_pre_reset,
.post_reset = sd_post_reset, .post_reset = sd_post_reset,
......
...@@ -734,6 +734,7 @@ static struct usb_driver sd_driver = { ...@@ -734,6 +734,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -1486,6 +1486,7 @@ static struct usb_driver sd_driver = { ...@@ -1486,6 +1486,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -3199,6 +3199,7 @@ static struct usb_driver sd_driver = { ...@@ -3199,6 +3199,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -437,6 +437,7 @@ static struct usb_driver sd_driver = { ...@@ -437,6 +437,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -983,6 +983,7 @@ static struct usb_driver sd_driver = { ...@@ -983,6 +983,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -2047,6 +2047,7 @@ static struct usb_driver sd_driver = { ...@@ -2047,6 +2047,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -800,6 +800,7 @@ static struct usb_driver sd_driver = { ...@@ -800,6 +800,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -605,6 +605,7 @@ static struct usb_driver sd_driver = { ...@@ -605,6 +605,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -1533,6 +1533,7 @@ static struct usb_driver sd_driver = { ...@@ -1533,6 +1533,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -922,6 +922,7 @@ static struct usb_driver sd_driver = { ...@@ -922,6 +922,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -433,6 +433,7 @@ static struct usb_driver sd_driver = { ...@@ -433,6 +433,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -340,6 +340,7 @@ static struct usb_driver sd_driver = { ...@@ -340,6 +340,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -1165,6 +1165,7 @@ static struct usb_driver sd_driver = { ...@@ -1165,6 +1165,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -439,6 +439,7 @@ static struct usb_driver sd_driver = { ...@@ -439,6 +439,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -352,6 +352,7 @@ static struct usb_driver sd_driver = { ...@@ -352,6 +352,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -1078,6 +1078,7 @@ static struct usb_driver sd_driver = { ...@@ -1078,6 +1078,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -1043,6 +1043,7 @@ static struct usb_driver sd_driver = { ...@@ -1043,6 +1043,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -371,6 +371,7 @@ static struct usb_driver sd_driver = { ...@@ -371,6 +371,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -3846,6 +3846,7 @@ static struct usb_driver sd_driver = { ...@@ -3846,6 +3846,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -358,6 +358,7 @@ static struct usb_driver sd_driver = { ...@@ -358,6 +358,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
...@@ -3135,6 +3135,7 @@ static struct usb_driver sd_driver = { ...@@ -3135,6 +3135,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = gspca_suspend, .suspend = gspca_suspend,
.resume = gspca_resume, .resume = gspca_resume,
.reset_resume = gspca_resume,
#endif #endif
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册