summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/stv06xx/stv06xx.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-05-06 09:28:30 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-14 09:38:12 -0300
commitdec9c51442b5a524c137b6f4a54ec109a197a65a (patch)
tree25c5dfbcd381868228fe9b44468a98ec6c2592fc /drivers/media/video/gspca/stv06xx/stv06xx.c
parent7135d88495b0043c0d61bd85408542dc0cb0bca0 (diff)
downloadtalos-obmc-linux-dec9c51442b5a524c137b6f4a54ec109a197a65a.tar.gz
talos-obmc-linux-dec9c51442b5a524c137b6f4a54ec109a197a65a.zip
[media] gspca_stv06xx: Convert to the control framework
HdG: 1) Let the gspca-core cleanup the controls on control-init error, like with the other converted sub drivers 2) Note this also fixes a bug in the hdcs1020 support which was wrongly reporting an exposure range of 0-65535, even though the effective range was only 0-255 Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/stv06xx/stv06xx.c')
-rw-r--r--drivers/media/video/gspca/stv06xx/stv06xx.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx.c b/drivers/media/video/gspca/stv06xx/stv06xx.c
index 91d99b4cc57b..3a8d034421fc 100644
--- a/drivers/media/video/gspca/stv06xx/stv06xx.c
+++ b/drivers/media/video/gspca/stv06xx/stv06xx.c
@@ -261,6 +261,17 @@ static int stv06xx_init(struct gspca_dev *gspca_dev)
return (err < 0) ? err : 0;
}
+/* this function is called at probe time */
+static int stv06xx_init_controls(struct gspca_dev *gspca_dev)
+{
+ struct sd *sd = (struct sd *) gspca_dev;
+
+ PDEBUG(D_PROBE, "Initializing controls");
+
+ gspca_dev->vdev.ctrl_handler = &sd->ctrl_handler;
+ return sd->sensor->init_controls(sd);
+}
+
/* Start the camera */
static int stv06xx_start(struct gspca_dev *gspca_dev)
{
@@ -512,6 +523,7 @@ static const struct sd_desc sd_desc = {
.name = MODULE_NAME,
.config = stv06xx_config,
.init = stv06xx_init,
+ .init_controls = stv06xx_init_controls,
.start = stv06xx_start,
.stopN = stv06xx_stopN,
.pkt_scan = stv06xx_pkt_scan,
@@ -594,11 +606,12 @@ static void sd_disconnect(struct usb_interface *intf)
{
struct gspca_dev *gspca_dev = usb_get_intfdata(intf);
struct sd *sd = (struct sd *) gspca_dev;
+ void *priv = sd->sensor_priv;
PDEBUG(D_PROBE, "Disconnecting the stv06xx device");
- if (sd->sensor->disconnect)
- sd->sensor->disconnect(sd);
+ sd->sensor = NULL;
gspca_disconnect(intf);
+ kfree(priv);
}
static struct usb_driver sd_driver = {
@@ -609,6 +622,7 @@ static struct usb_driver sd_driver = {
#ifdef CONFIG_PM
.suspend = gspca_suspend,
.resume = gspca_resume,
+ .reset_resume = gspca_resume,
#endif
};
OpenPOWER on IntegriCloud