summaryrefslogtreecommitdiff
path: root/drivers/media/dvb/dvb-usb/dvb-usb-init.c
diff options
context:
space:
mode:
authorPatrick Boettcher <pb@linuxtv.org>2006-09-20 13:06:11 +0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-10-03 22:13:18 +0400
commita37ddced86b092f8f4fd8dc20d4f5dce2e7cc6d3 (patch)
treea65b8f04b7489e27b0efef5ebda105084f1692c5 /drivers/media/dvb/dvb-usb/dvb-usb-init.c
parent1d57436040a7ff486fb90a82b6f542fbe275f624 (diff)
downloadlinux-a37ddced86b092f8f4fd8dc20d4f5dce2e7cc6d3.tar.xz
V4L/DVB (4657): Power control of the device for dual board
Corrected power control of the device for dual boards Signed-off-by: Patrick Boettcher <pb@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dvb-usb-init.c')
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-init.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/drivers/media/dvb/dvb-usb/dvb-usb-init.c
index 0dd90d1fe67c..ffdde83d1e77 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-init.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-init.c
@@ -136,7 +136,7 @@ static int dvb_usb_init(struct dvb_usb_device *d)
if (d->priv == NULL) {
err("no memory for priv in 'struct dvb_usb_device'");
return -ENOMEM;
- }
+ }
}
/* check the capabilities and set appropriate variables */
@@ -197,8 +197,13 @@ static struct dvb_usb_device_description * dvb_usb_find_device(struct usb_device
int dvb_usb_device_power_ctrl(struct dvb_usb_device *d, int onoff)
{
- if (d->powered == !onoff) {
- d->powered = onoff;
+ if (onoff)
+ d->powered++;
+ else
+ d->powered--;
+
+ if (d->powered == 0 || (onoff && d->powered == 1)) { // when switching from 1 to 0 or from 0 to 1
+ deb_info("power control: %d\n", onoff);
if (d->props.power_ctrl)
return d->props.power_ctrl(d, onoff);
}