diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-04 10:38:08 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-04 10:38:08 -0700 |
commit | f63b759c44b0561c76a67894c734157df3313b42 (patch) | |
tree | 4e9638f6c1aa5c0faa62ad4213282cc7cb39772a /drivers/media/video/cx88 | |
parent | 4a35cee066df1b1958e25e71595b3845d06b192e (diff) | |
parent | 844a9e93d7fcd910cd94f6eb262e2cc43cacbe56 (diff) |
Merge branch 'v4l_for_2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (243 commits)
V4L/DVB: sms: Convert IR support to use the Remote Controller core
V4L/DVB: sms: properly initialize IR phys and IR name
V4L/DVB: standardize names at rc-dib0700 tables
V4L/DVB: smsusb: enable IR port for Hauppauge WinTV MiniStick
V4L/DVB: dib0700: Fix RC protocol logic to properly handle NEC/NECx and RC-5
V4L/DVB: dib0700: properly implement IR change_protocol
V4L/DVB: dib0700: break keytable into NEC and RC-5 variants
V4L/DVB: dib0700: avoid bad repeat
V4L/DVB: Port dib0700 to rc-core
V4L/DVB: Add a keymap file with dib0700 table
V4L/DVB: dvb-usb: add support for rc-core mode
V4L/DVB: dvb-usb: prepare drivers for using rc-core
V4L/DVB: dvb-usb: get rid of struct dvb_usb_rc_key
V4L/DVB: rj54n1cb0c: fix a comment in the driver
V4L/DVB: V4L2: sh_vou: VOU does support the full PAL resolution too
V4L/DVB: V4L2: sh_mobile_camera_ceu: add support for CSI2
V4L/DVB: V4L2: soc-camera: add a MIPI CSI-2 driver for SH-Mobile platforms
V4L/DVB: V4L2: soc-camera: export soc-camera bus type for notifications
V4L/DVB: V4L2: mediabus: add 12-bit Bayer and YUV420 pixel formats
V4L/DVB: mediabus: fix ambiguous pixel code names
...
Diffstat (limited to 'drivers/media/video/cx88')
-rw-r--r-- | drivers/media/video/cx88/cx88-alsa.c | 37 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-cards.c | 9 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-core.c | 2 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-i2c.c | 6 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-input.c | 46 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88.h | 1 |
6 files changed, 49 insertions, 52 deletions
diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c index 33082c96745..4f383cdf529 100644 --- a/drivers/media/video/cx88/cx88-alsa.c +++ b/drivers/media/video/cx88/cx88-alsa.c @@ -54,6 +54,12 @@ Data type declarations - Can be moded to a header file later ****************************************************************************/ +struct cx88_audio_buffer { + unsigned int bpl; + struct btcx_riscmem risc; + struct videobuf_dmabuf dma; +}; + struct cx88_audio_dev { struct cx88_core *core; struct cx88_dmaqueue q; @@ -75,7 +81,7 @@ struct cx88_audio_dev { struct videobuf_dmabuf *dma_risc; - struct cx88_buffer *buf; + struct cx88_audio_buffer *buf; struct snd_pcm_substream *substream; }; @@ -123,7 +129,7 @@ MODULE_PARM_DESC(debug,"enable debug messages"); static int _cx88_start_audio_dma(snd_cx88_card_t *chip) { - struct cx88_buffer *buf = chip->buf; + struct cx88_audio_buffer *buf = chip->buf; struct cx88_core *core=chip->core; struct sram_channel *audio_ch = &cx88_sram_channels[SRAM_CH25]; @@ -283,7 +289,7 @@ static int dsp_buffer_free(snd_cx88_card_t *chip) BUG_ON(!chip->dma_size); dprintk(2,"Freeing buffer\n"); - videobuf_sg_dma_unmap(&chip->pci->dev, chip->dma_risc); + videobuf_dma_unmap(&chip->pci->dev, chip->dma_risc); videobuf_dma_free(chip->dma_risc); btcx_riscmem_free(chip->pci,&chip->buf->risc); kfree(chip->buf); @@ -376,7 +382,7 @@ static int snd_cx88_hw_params(struct snd_pcm_substream * substream, snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); struct videobuf_dmabuf *dma; - struct cx88_buffer *buf; + struct cx88_audio_buffer *buf; int ret; if (substream->runtime->dma_area) { @@ -391,30 +397,25 @@ static int snd_cx88_hw_params(struct snd_pcm_substream * substream, BUG_ON(!chip->dma_size); BUG_ON(chip->num_periods & (chip->num_periods-1)); - buf = videobuf_sg_alloc(sizeof(*buf)); + buf = kzalloc(sizeof(*buf), GFP_KERNEL); if (NULL == buf) return -ENOMEM; - buf->vb.memory = V4L2_MEMORY_MMAP; - buf->vb.field = V4L2_FIELD_NONE; - buf->vb.width = chip->period_size; - buf->bpl = chip->period_size; - buf->vb.height = chip->num_periods; - buf->vb.size = chip->dma_size; + buf->bpl = chip->period_size; - dma = videobuf_to_dma(&buf->vb); + dma = &buf->dma; videobuf_dma_init(dma); ret = videobuf_dma_init_kernel(dma, PCI_DMA_FROMDEVICE, - (PAGE_ALIGN(buf->vb.size) >> PAGE_SHIFT)); + (PAGE_ALIGN(chip->dma_size) >> PAGE_SHIFT)); if (ret < 0) goto error; - ret = videobuf_sg_dma_map(&chip->pci->dev, dma); + ret = videobuf_dma_map(&chip->pci->dev, dma); if (ret < 0) goto error; ret = cx88_risc_databuffer(chip->pci, &buf->risc, dma->sglist, - buf->vb.width, buf->vb.height, 1); + chip->period_size, chip->num_periods, 1); if (ret < 0) goto error; @@ -422,12 +423,10 @@ static int snd_cx88_hw_params(struct snd_pcm_substream * substream, buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP|RISC_IRQ1|RISC_CNT_INC); buf->risc.jmp[1] = cpu_to_le32(buf->risc.dma); - buf->vb.state = VIDEOBUF_PREPARED; - chip->buf = buf; chip->dma_risc = dma; - substream->runtime->dma_area = chip->dma_risc->vmalloc; + substream->runtime->dma_area = chip->dma_risc->vaddr; substream->runtime->dma_bytes = chip->dma_size; substream->runtime->dma_addr = 0; return 0; @@ -740,7 +739,7 @@ static int __devinit snd_cx88_create(struct snd_card *card, pci_set_master(pci); - chip = (snd_cx88_card_t *) card->private_data; + chip = card->private_data; core = cx88_core_get(pci); if (NULL == core) { diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 2918a6e38fe..e8416b76da6 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -45,6 +45,10 @@ static unsigned int latency = UNSET; module_param(latency,int,0444); MODULE_PARM_DESC(latency,"pci latency timer"); +static int disable_ir; +module_param(disable_ir, int, 0444); +MODULE_PARM_DESC(latency, "Disable IR support"); + #define info_printk(core, fmt, arg...) \ printk(KERN_INFO "%s: " fmt, core->name , ## arg) @@ -3498,7 +3502,10 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) } cx88_card_setup(core); - cx88_ir_init(core, pci); + if (!disable_ir) { + cx88_i2c_init_ir(core); + cx88_ir_init(core, pci); + } return core; } diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c index 8b21457111b..85eb266fb35 100644 --- a/drivers/media/video/cx88/cx88-core.c +++ b/drivers/media/video/cx88/cx88-core.c @@ -218,7 +218,7 @@ cx88_free_buffer(struct videobuf_queue *q, struct cx88_buffer *buf) BUG_ON(in_interrupt()); videobuf_waiton(&buf->vb,0,0); - videobuf_dma_unmap(q, dma); + videobuf_dma_unmap(q->dev, dma); videobuf_dma_free(dma); btcx_riscmem_free(to_pci_dev(q->dev), &buf->risc); buf->vb.state = VIDEOBUF_NEEDS_INIT; diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c index fb39f118455..375ad53f796 100644 --- a/drivers/media/video/cx88/cx88-i2c.c +++ b/drivers/media/video/cx88/cx88-i2c.c @@ -181,6 +181,11 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci) } else printk("%s: i2c register FAILED\n", core->name); + return core->i2c_rc; +} + +void cx88_i2c_init_ir(struct cx88_core *core) +{ /* Instantiate the IR receiver device, if present */ if (0 == core->i2c_rc) { struct i2c_board_info info; @@ -207,7 +212,6 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci) } } } - return core->i2c_rc; } /* ----------------------------------------------------------------------- */ diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c index e185289e446..eccc5e49a35 100644 --- a/drivers/media/video/cx88/cx88-input.c +++ b/drivers/media/video/cx88/cx88-input.c @@ -30,6 +30,7 @@ #include <linux/module.h> #include "cx88.h" +#include <media/ir-core.h> #include <media/ir-common.h> #define MODULE_NAME "cx88xx" @@ -39,8 +40,8 @@ struct cx88_IR { struct cx88_core *core; struct input_dev *input; - struct ir_input_state ir; struct ir_dev_props props; + u64 ir_type; int users; @@ -51,7 +52,6 @@ struct cx88_IR { u32 sampling; u32 samples[16]; int scount; - unsigned long release; /* poll external decoder */ int polling; @@ -125,29 +125,21 @@ static void cx88_ir_handle_key(struct cx88_IR *ir) data = (data << 4) | ((gpio_key & 0xf0) >> 4); - ir_input_keydown(ir->input, &ir->ir, data); - ir_input_nokey(ir->input, &ir->ir); + ir_keydown(ir->input, data, 0); } else if (ir->mask_keydown) { /* bit set on keydown */ - if (gpio & ir->mask_keydown) { - ir_input_keydown(ir->input, &ir->ir, data); - } else { - ir_input_nokey(ir->input, &ir->ir); - } + if (gpio & ir->mask_keydown) + ir_keydown(ir->input, data, 0); } else if (ir->mask_keyup) { /* bit cleared on keydown */ - if (0 == (gpio & ir->mask_keyup)) { - ir_input_keydown(ir->input, &ir->ir, data); - } else { - ir_input_nokey(ir->input, &ir->ir); - } + if (0 == (gpio & ir->mask_keyup)) + ir_keydown(ir->input, data, 0); } else { /* can't distinguish keydown/up :-/ */ - ir_input_keydown(ir->input, &ir->ir, data); - ir_input_nokey(ir->input, &ir->ir); + ir_keydown(ir->input, data, 0); } } @@ -439,9 +431,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) snprintf(ir->name, sizeof(ir->name), "cx88 IR (%s)", core->board.name); snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci)); - err = ir_input_init(input_dev, &ir->ir, ir_type); - if (err < 0) - goto err_out_free; + ir->ir_type = ir_type; input_dev->name = ir->name; input_dev->phys = ir->phys; @@ -516,8 +506,6 @@ void cx88_ir_irq(struct cx88_core *core) } if (!ir->scount) { /* nothing to sample */ - if (ir->ir.keypressed && time_after(jiffies, ir->release)) - ir_input_nokey(ir->input, &ir->ir); return; } @@ -553,7 +541,7 @@ void cx88_ir_irq(struct cx88_core *core) if (ircode == 0) { /* key still pressed */ ir_dprintk("pulse distance decoded repeat code\n"); - ir->release = jiffies + msecs_to_jiffies(120); + ir_repeat(ir->input); break; } @@ -567,10 +555,8 @@ void cx88_ir_irq(struct cx88_core *core) break; } - ir_dprintk("Key Code: %x\n", (ircode >> 16) & 0x7f); - - ir_input_keydown(ir->input, &ir->ir, (ircode >> 16) & 0x7f); - ir->release = jiffies + msecs_to_jiffies(120); + ir_dprintk("Key Code: %x\n", (ircode >> 16) & 0xff); + ir_keydown(ir->input, (ircode >> 16) & 0xff, 0); break; case CX88_BOARD_HAUPPAUGE: case CX88_BOARD_HAUPPAUGE_DVB_T1: @@ -606,16 +592,16 @@ void cx88_ir_irq(struct cx88_core *core) if ( dev != 0x1e && dev != 0x1f ) /* not a hauppauge remote */ break; - ir_input_keydown(ir->input, &ir->ir, code); - ir->release = jiffies + msecs_to_jiffies(120); + ir_keydown(ir->input, code, toggle); break; case CX88_BOARD_PINNACLE_PCTV_HD_800i: ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7); ir_dprintk("biphase decoded: %x\n", ircode); if ((ircode & 0xfffff000) != 0x3000) break; - ir_input_keydown(ir->input, &ir->ir, ircode & 0x3f); - ir->release = jiffies + msecs_to_jiffies(120); + /* Note: bit 0x800 being the toggle is assumed, not checked + with real hardware */ + ir_keydown(ir->input, ircode & 0x3f, ircode & 0x0800 ? 1 : 0); break; } diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index bdb03d33653..33d161a1172 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h @@ -636,6 +636,7 @@ extern struct videobuf_queue_ops cx8800_vbi_qops; /* cx88-i2c.c */ extern int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci); +extern void cx88_i2c_init_ir(struct cx88_core *core); /* ----------------------------------------------------------- */ |