Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c6c0b2c authored by Mark Weaver's avatar Mark Weaver Committed by Linus Torvalds
Browse files

[PATCH] v4l: (939) Support for nebula rc5 based gpio remote



Support for Nebula rc5-based gpio remote.

Signed-off-by: default avatarMark Weaver <mark-clist@npsl.co.uk>
Signed-off-by: default avatarNickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 871242b9
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2133,7 +2133,10 @@ struct tvcard bttv_tvcards[] = {
		.tuner_addr	= ADDR_UNSET,
		.radio_addr     = ADDR_UNSET,
		.has_dvb        = 1,
		.has_remote	= 1,
		.gpiomask	= 0x1b,
		.no_gpioirq     = 1,
		.any_irq		= 1,
	},
	[BTTV_BOARD_PV143] = {
		/* Jorge Boncompte - DTI2 <jorge@dti2.net> */
@@ -3384,6 +3387,8 @@ void __devinit bttv_init_card2(struct bttv *btv)
		btv->has_remote=1;
	if (!bttv_tvcards[btv->c.type].no_gpioirq)
		btv->gpioirq=1;
	if (bttv_tvcards[btv->c.type].any_irq)
		btv->any_irq = 1;
	if (bttv_tvcards[btv->c.type].audio_hook)
		btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;

+4 −0
Original line number Diff line number Diff line
@@ -3667,6 +3667,10 @@ static irqreturn_t bttv_irq(int irq, void *dev_id, struct pt_regs * regs)
	int handled = 0;

	btv=(struct bttv *)dev_id;

	if (btv->any_irq)
		handled = bttv_any_irq(&btv->c);

	count=0;
	while (1) {
		/* get/clear interrupt status bits */
+18 −0
Original line number Diff line number Diff line
@@ -113,6 +113,24 @@ void bttv_gpio_irq(struct bttv_core *core)
	}
}

int bttv_any_irq(struct bttv_core *core)
{
	struct bttv_sub_driver *drv;
	struct bttv_sub_device *dev;
	struct list_head *item;
	int handled = 0;

	list_for_each(item,&core->subs) {
		dev = list_entry(item,struct bttv_sub_device,list);
		drv = to_bttv_sub_drv(dev->dev.driver);
		if (drv && drv->any_irq) {
			if (drv->any_irq(dev))
				handled = 1;
		}
	}
	return handled;
}

/* ----------------------------------------------------------------------- */
/* external: sub-driver register/unregister                                */

+2 −0
Original line number Diff line number Diff line
@@ -235,6 +235,7 @@ struct tvcard
	unsigned int has_dvb:1;
	unsigned int has_remote:1;
	unsigned int no_gpioirq:1;
	unsigned int any_irq:1;

	/* other settings */
	unsigned int pll;
@@ -334,6 +335,7 @@ struct bttv_sub_driver {
	struct device_driver   drv;
	char                   wanted[BUS_ID_SIZE];
	void                   (*gpio_irq)(struct bttv_sub_device *sub);
	int                    (*any_irq)(struct bttv_sub_device *sub);
};
#define to_bttv_sub_drv(x) container_of((x), struct bttv_sub_driver, drv)

+2 −0
Original line number Diff line number Diff line
@@ -208,6 +208,7 @@ extern struct bus_type bttv_sub_bus_type;
int bttv_sub_add_device(struct bttv_core *core, char *name);
int bttv_sub_del_devices(struct bttv_core *core);
void bttv_gpio_irq(struct bttv_core *core);
int bttv_any_irq(struct bttv_core *core);


/* ---------------------------------------------------------- */
@@ -273,6 +274,7 @@ struct bttv {
	struct bttv_pll_info pll;
	int triton1;
	int gpioirq;
	int any_irq;
	int use_i2c_hw;

	/* old gpio interface */
Loading