@@ -6105,6 +6105,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
case SAA7134_BOARD_AVERMEDIA_307:
case SAA7134_BOARD_AVERMEDIA_STUDIO_507:
case SAA7134_BOARD_AVERMEDIA_GO_007_FM:
+ case SAA7134_BOARD_AVERMEDIA_SUPER_007:
case SAA7134_BOARD_AVERMEDIA_777:
case SAA7134_BOARD_AVERMEDIA_M135A:
/* case SAA7134_BOARD_SABRENT_SBTTVFM: */ /* not finished yet */
@@ -101,18 +101,22 @@ int (*saa7134_dmasound_exit)(struct saa7134_dev *dev);
void saa7134_track_gpio(struct saa7134_dev *dev, char *msg)
{
- unsigned long mode,status;
+ unsigned long mode, status;
+ struct timeval tv;
if (!gpio_tracking)
return;
/* rising SAA7134_GPIO_GPRESCAN reads the status */
- saa_andorb(SAA7134_GPIO_GPMODE3,SAA7134_GPIO_GPRESCAN,0);
- saa_andorb(SAA7134_GPIO_GPMODE3,SAA7134_GPIO_GPRESCAN,SAA7134_GPIO_GPRESCAN);
+ saa_andorb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN, 0);
+ saa_andorb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN,
+ SAA7134_GPIO_GPRESCAN);
mode = saa_readl(SAA7134_GPIO_GPMODE0 >> 2) & 0xfffffff;
status = saa_readl(SAA7134_GPIO_GPSTATUS0 >> 2) & 0xfffffff;
- printk(KERN_DEBUG
- "%s: gpio: mode=0x%07lx in=0x%07lx out=0x%07lx [%s]\n",
- dev->name, mode, (~mode) & status, mode & status, msg);
+ do_gettimeofday(&tv);
+
+ printk(KERN_DEBUG "%s GPIO: time=%lu.%06lu mode=0x%07lx in=0x%07lx"
+ " out=0x%07lx [%s]\n", dev->name, tv.tv_sec, tv.tv_usec,
+ mode, (~mode) & status, mode & status, msg);
}
void saa7134_set_gpio(struct saa7134_dev *dev, int bit_no, int value)
@@ -566,24 +570,17 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id)
}
}
- if (report & SAA7134_IRQ_REPORT_GPIO18) {
- switch (dev->has_remote) {
- case SAA7134_REMOTE_GPIO:
- if (!dev->remote)
- break;
- if ((dev->remote->mask_keydown & 0x40000) ||
- (dev->remote->mask_keyup & 0x40000)) {
- saa7134_input_irq(dev);
- }
- break;
-
- case SAA7134_REMOTE_I2C:
- break; /* FIXME: invoke I2C get_key() */
-
- default: /* GPIO18 not used by IR remote */
- break;
- }
+ if (report & SAA7134_IRQ_REPORT_GPIO18 &&
+ dev->has_remote == SAA7134_REMOTE_GPIO && dev->remote &&
+ (dev->remote->mask_keydown |
+ dev->remote->mask_keyup) & 0x40000) {
+ if (gpio_tracking)
+ saa7134_track_gpio(dev, "GPIO18 IRQ");
+ saa7134_input_irq(dev);
}
+
+ /* SAA7134_REMOTE_I2C: FIXME: invoke I2C get_key() */
+ /* GPIO18 not used by IR remote */
}
if (10 == loop) {
@@ -695,9 +692,9 @@ static int saa7134_hw_enable2(struct saa7134_dev *dev)
if (dev->has_remote == SAA7134_REMOTE_GPIO && dev->remote) {
if (dev->remote->mask_keydown & 0x10000)
irq2_mask |= SAA7134_IRQ2_INTE_GPIO16;
- else if (dev->remote->mask_keydown & 0x40000)
+ if (dev->remote->mask_keydown & 0x40000) /* raising edge */
irq2_mask |= SAA7134_IRQ2_INTE_GPIO18;
- else if (dev->remote->mask_keyup & 0x40000)
+ if (dev->remote->mask_keyup & 0x40000) /* falling edge */
irq2_mask |= SAA7134_IRQ2_INTE_GPIO18A;
}
@@ -483,6 +483,12 @@ int saa7134_input_init1(struct saa7134_dev *dev)
saa_setb(SAA7134_GPIO_GPMODE1, 0x1);
saa_setb(SAA7134_GPIO_GPSTATUS1, 0x1);
break;
+ case SAA7134_BOARD_AVERMEDIA_SUPER_007:
+ ir_codes = ir_codes_avermedia;
+ mask_keyup = 0x40000; /* show falling edge of GPIO18 */
+ mask_keydown = 0x40000; /* show raising edge of GPIO18 */
+ rc5_gpio = 1;
+ break;
case SAA7134_BOARD_KWORLD_TERMINATOR:
ir_codes = ir_codes_pixelview;
mask_keycode = 0x00001f;