]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
V4L/DVB (9770): em28xx: turn off tuner when not used
authorMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 5 Dec 2008 13:39:12 +0000 (10:39 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 30 Dec 2008 11:38:15 +0000 (09:38 -0200)
em28xx devices generally get hot when xc3028 tuner is powered on. This
patch solves this by turning power off when the device is not used, at the
expense of having a higher load time, when calling a TV application.

Since firmware load happens on 1 or 2 seconds on most devices, this is not a pain.

Also, it helps to save the planet by saving some power :)

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/em28xx/em28xx-video.c

index 32b437fd7936824866bb15245a14302b039090a0..6e558d2ca0f3b4801bcedd20aefbad1b500a211d 100644 (file)
@@ -1695,6 +1695,9 @@ static int em28xx_v4l2_close(struct inode *inode, struct file *filp)
                        return 0;
                }
 
+               /* Save some power by putting tuner to sleep */
+               em28xx_i2c_call_clients(dev, TUNER_SET_STANDBY, NULL);
+
                /* do this before setting alternate! */
                em28xx_uninit_isoc(dev);
                em28xx_set_mode(dev, EM28XX_SUSPEND);
@@ -2132,6 +2135,9 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
        mutex_unlock(&em28xx_extension_devlist_lock);
        mutex_unlock(&em28xx_devlist_mutex);
 
+       /* Save some power by putting tuner to sleep */
+       em28xx_i2c_call_clients(dev, TUNER_SET_STANDBY, NULL);
+
        return 0;
 
 fail_reg_devices: