Skip to content

Commit

Permalink
V4L/DVB: tm6000: add ir support
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Stefan Ringel authored and Mauro Carvalho Chehab committed Aug 2, 2010
1 parent bd0db8c commit d064f96
Show file tree
Hide file tree
Showing 4 changed files with 402 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/staging/tm6000/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ tm6000-objs := tm6000-cards.o \
tm6000-core.o \
tm6000-i2c.o \
tm6000-video.o \
tm6000-stds.o
tm6000-stds.o \
tm6000-input.o

obj-$(CONFIG_VIDEO_TM6000) += tm6000.o
obj-$(CONFIG_VIDEO_TM6000_ALSA) += tm6000-alsa.o
Expand Down
28 changes: 27 additions & 1 deletion drivers/staging/tm6000/tm6000-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <media/tuner.h>
#include <media/tvaudio.h>
#include <media/i2c-addr.h>
#include <media/rc-map.h>

#include "tm6000.h"
#include "tm6000-regs.h"
Expand Down Expand Up @@ -69,6 +70,8 @@ struct tm6000_board {
int demod_addr; /* demodulator address */

struct tm6000_gpio gpio;

char *ir_codes;
};

struct tm6000_board tm6000_boards[] = {
Expand Down Expand Up @@ -276,6 +279,7 @@ struct tm6000_board tm6000_boards[] = {
.dvb_led = TM6010_GPIO_5,
.ir = TM6010_GPIO_0,
},
.ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
},
[TM6010_BOARD_TWINHAN_TU501] = {
.name = "Twinhan TU501(704D1)",
Expand Down Expand Up @@ -361,6 +365,8 @@ int tm6000_tuner_callback(void *ptr, int component, int command, int arg)

switch (command) {
case XC2028_RESET_CLK:
tm6000_ir_wait(dev, 0);

tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT,
0x02, arg);
msleep(10);
Expand Down Expand Up @@ -410,13 +416,14 @@ int tm6000_tuner_callback(void *ptr, int component, int command, int arg)
msleep(130);
break;
}

tm6000_ir_wait(dev, 1);
break;
case 1:
tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT,
0x02, 0x01);
msleep(10);
break;

case 2:
rc = tm6000_i2c_reset(dev, 100);
break;
Expand Down Expand Up @@ -636,6 +643,8 @@ static int tm6000_init_dev(struct tm6000_core *dev)

dev->gpio = tm6000_boards[dev->model].gpio;

dev->ir_codes = tm6000_boards[dev->model].ir_codes;

dev->demod_addr = tm6000_boards[dev->model].demod_addr;

dev->caps = tm6000_boards[dev->model].caps;
Expand Down Expand Up @@ -684,6 +693,8 @@ static int tm6000_init_dev(struct tm6000_core *dev)
tm6000_add_into_devlist(dev);
tm6000_init_extension(dev);

tm6000_ir_init(dev);

mutex_unlock(&dev->lock);
return 0;

Expand Down Expand Up @@ -829,6 +840,19 @@ static int tm6000_usb_probe(struct usb_interface *interface,
&dev->isoc_out);
}
break;
case USB_ENDPOINT_XFER_INT:
if (!dir_out) {
get_max_endpoint(usbdev,
&interface->altsetting[i],
"INT IN", e,
&dev->int_in);
} else {
get_max_endpoint(usbdev,
&interface->altsetting[i],
"INT OUT", e,
&dev->int_out);
}
break;
}
}
}
Expand Down Expand Up @@ -887,6 +911,8 @@ static void tm6000_usb_disconnect(struct usb_interface *interface)

mutex_lock(&dev->lock);

tm6000_ir_fini(dev);

if (dev->gpio.power_led) {
switch (dev->model) {
case TM6010_BOARD_HAUPPAUGE_900H:
Expand Down
Loading

0 comments on commit d064f96

Please sign in to comment.