diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-11-16 06:59:49 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-11-18 08:44:51 -0200 |
commit | 7b61ba8ff838dbee422d428fbd882ab83db4b2d9 (patch) | |
tree | caa863cac4a8e249bdaa8f4016e76d52ea467306 /drivers/media/pci/cx88 | |
parent | 65bc2fe86e667077b38a63ce6cb40677be09bc4f (diff) |
[media] cx88: make checkpatch happier
This driver is old, and have lots of checkpatch violations.
As we're touching a lot on this driver due to the printk
conversions, let's run checkpatch --fix on it, in order to
solve some of those issues.
Also, do a few manual adjustments:
- remove the FSF address and use the usual coding style
for the initial comments;
- use WARN_ON() instead of BUG_ON();
- remove an unused typedef;
- break a few long lines.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/pci/cx88')
-rw-r--r-- | drivers/media/pci/cx88/cx88-alsa.c | 79 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-blackbird.c | 94 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-cards.c | 85 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-core.c | 121 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-dsp.c | 11 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-dvb.c | 112 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-i2c.c | 95 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-input.c | 18 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-mpeg.c | 63 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-reg.h | 13 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-tvaudio.c | 87 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-vbi.c | 20 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-video.c | 195 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-vp3054-i2c.c | 44 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88.h | 37 |
15 files changed, 515 insertions, 559 deletions
diff --git a/drivers/media/pci/cx88/cx88-alsa.c b/drivers/media/pci/cx88/cx88-alsa.c index d2f1880a157e..56770e84b3d5 100644 --- a/drivers/media/pci/cx88/cx88-alsa.c +++ b/drivers/media/pci/cx88/cx88-alsa.c @@ -1,5 +1,4 @@ /* - * * Support for audio capture * PCI function #1 of the cx2388x. * @@ -18,10 +17,6 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "cx88.h" @@ -118,8 +113,8 @@ MODULE_VERSION(CX88_VERSION); MODULE_SUPPORTED_DEVICE("{{Conexant,23881},{{Conexant,23882},{{Conexant,23883}"); static unsigned int debug; -module_param(debug,int,0644); -MODULE_PARM_DESC(debug,"enable debug messages"); +module_param(debug, int, 0644); +MODULE_PARM_DESC(debug, "enable debug messages"); /**************************************************************************** Module specific funtions @@ -132,7 +127,7 @@ MODULE_PARM_DESC(debug,"enable debug messages"); static int _cx88_start_audio_dma(snd_cx88_card_t *chip) { struct cx88_audio_buffer *buf = chip->buf; - struct cx88_core *core=chip->core; + struct cx88_core *core = chip->core; const struct sram_channel *audio_ch = &cx88_sram_channels[SRAM_CH25]; /* Make sure RISC/FIFO are off before changing FIFO/RISC settings */ @@ -177,7 +172,8 @@ static int _cx88_start_audio_dma(snd_cx88_card_t *chip) */ static int _cx88_stop_audio_dma(snd_cx88_card_t *chip) { - struct cx88_core *core=chip->core; + struct cx88_core *core = chip->core; + dprintk(1, "Stopping audio DMA\n"); /* stop dma */ @@ -261,7 +257,7 @@ static irqreturn_t cx8801_irq(int irq, void *dev_id) for (loop = 0; loop < MAX_IRQ_LOOP; loop++) { status = cx_read(MO_PCI_INTSTAT) & (core->pci_irqmask | PCI_INT_AUDINT); - if (0 == status) + if (status == 0) goto out; dprintk(3, "cx8801_irq loop %d/%d, status %x\n", loop, MAX_IRQ_LOOP, status); @@ -274,7 +270,7 @@ static irqreturn_t cx8801_irq(int irq, void *dev_id) cx8801_aud_irq(chip); } - if (MAX_IRQ_LOOP == loop) { + if (loop == MAX_IRQ_LOOP) { pr_err("IRQ loop detected, disabling interrupts\n"); cx_clear(MO_PCI_INTMSK, PCI_INT_AUDINT); } @@ -290,7 +286,7 @@ static int cx88_alsa_dma_init(struct cx88_audio_dev *chip, int nr_pages) int i; buf->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT); - if (NULL == buf->vaddr) { + if (buf->vaddr == NULL) { dprintk(1, "vmalloc_32(%d pages) failed\n", nr_pages); return -ENOMEM; } @@ -303,13 +299,13 @@ static int cx88_alsa_dma_init(struct cx88_audio_dev *chip, int nr_pages) buf->nr_pages = nr_pages; buf->sglist = vzalloc(buf->nr_pages * sizeof(*buf->sglist)); - if (NULL == buf->sglist) + if (buf->sglist == NULL) goto vzalloc_err; sg_init_table(buf->sglist, buf->nr_pages); for (i = 0; i < buf->nr_pages; i++) { pg = vmalloc_to_page(buf->vaddr + i * PAGE_SIZE); - if (NULL == pg) + if (pg == NULL) goto vmalloc_to_page_err; sg_set_page(&buf->sglist[i], pg, PAGE_SIZE, 0); } @@ -331,7 +327,7 @@ static int cx88_alsa_dma_map(struct cx88_audio_dev *dev) buf->sglen = dma_map_sg(&dev->pci->dev, buf->sglist, buf->nr_pages, PCI_DMA_FROMDEVICE); - if (0 == buf->sglen) { + if (buf->sglen == 0) { pr_warn("%s: cx88_alsa_map_sg failed\n", __func__); return -ENOMEM; } @@ -366,7 +362,7 @@ static int dsp_buffer_free(snd_cx88_card_t *chip) BUG_ON(!chip->dma_size); - dprintk(2,"Freeing buffer\n"); + dprintk(2, "Freeing buffer\n"); cx88_alsa_dma_unmap(chip); cx88_alsa_dma_free(chip->buf); if (risc->cpu) @@ -431,6 +427,7 @@ static int snd_cx88_pcm_open(struct snd_pcm_substream *substream) if (cx88_sram_channels[SRAM_CH25].fifo_size != DEFAULT_FIFO_SIZE) { unsigned int bpl = cx88_sram_channels[SRAM_CH25].fifo_size / 4; + bpl &= ~7; /* must be multiple of 8 */ runtime->hw.period_bytes_min = bpl; runtime->hw.period_bytes_max = bpl; @@ -438,7 +435,7 @@ static int snd_cx88_pcm_open(struct snd_pcm_substream *substream) return 0; _error: - dprintk(1,"Error opening PCM!\n"); + dprintk(1, "Error opening PCM!\n"); return err; } @@ -453,8 +450,8 @@ static int snd_cx88_close(struct snd_pcm_substream *substream) /* * hw_params callback */ -static int snd_cx88_hw_params(struct snd_pcm_substream * substream, - struct snd_pcm_hw_params * hw_params) +static int snd_cx88_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *hw_params) { snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); @@ -474,7 +471,7 @@ static int snd_cx88_hw_params(struct snd_pcm_substream * substream, BUG_ON(chip->num_periods & (chip->num_periods-1)); buf = kzalloc(sizeof(*buf), GFP_KERNEL); - if (NULL == buf) + if (buf == NULL) return -ENOMEM; chip->buf = buf; @@ -511,7 +508,7 @@ error: /* * hw free callback */ -static int snd_cx88_hw_free(struct snd_pcm_substream * substream) +static int snd_cx88_hw_free(struct snd_pcm_substream *substream) { snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); @@ -545,13 +542,13 @@ static int snd_cx88_card_trigger(struct snd_pcm_substream *substream, int cmd) switch (cmd) { case SNDRV_PCM_TRIGGER_START: - err=_cx88_start_audio_dma(chip); + err = _cx88_start_audio_dma(chip); break; case SNDRV_PCM_TRIGGER_STOP: - err=_cx88_stop_audio_dma(chip); + err = _cx88_stop_audio_dma(chip); break; default: - err=-EINVAL; + err = -EINVAL; break; } @@ -584,6 +581,7 @@ static struct page *snd_cx88_page(struct snd_pcm_substream *substream, unsigned long offset) { void *pageptr = substream->runtime->dma_area + offset; + return vmalloc_to_page(pageptr); } @@ -638,7 +636,7 @@ static int snd_cx88_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *value) { snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol); - struct cx88_core *core=chip->core; + struct cx88_core *core = chip->core; int vol = 0x3f - (cx_read(AUD_VOL_CTL) & 0x3f), bal = cx_read(AUD_BAL_CTL); @@ -675,7 +673,7 @@ static int snd_cx88_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *value) { snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol); - struct cx88_core *core=chip->core; + struct cx88_core *core = chip->core; int left, right, v, b; int changed = 0; u32 old; @@ -814,8 +812,8 @@ static struct snd_kcontrol_new snd_cx88_alc_switch = { */ static const struct pci_device_id cx88_audio_pci_tbl[] = { - {0x14f1,0x8801,PCI_ANY_ID,PCI_ANY_ID,0,0,0}, - {0x14f1,0x8811,PCI_ANY_ID,PCI_ANY_ID,0,0,0}, + {0x14f1, 0x8801, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x14f1, 0x8811, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {0, } }; MODULE_DEVICE_TABLE(pci, cx88_audio_pci_tbl); @@ -830,7 +828,7 @@ static int snd_cx88_free(snd_cx88_card_t *chip) if (chip->irq >= 0) free_irq(chip->irq, chip); - cx88_core_put(chip->core,chip->pci); + cx88_core_put(chip->core, chip->pci); pci_disable_device(chip->pci); return 0; @@ -839,7 +837,7 @@ static int snd_cx88_free(snd_cx88_card_t *chip) /* * Component Destructor */ -static void snd_cx88_dev_free(struct snd_card * card) +static void snd_cx88_dev_free(struct snd_card *card) { snd_cx88_card_t *chip = card->private_data; @@ -872,14 +870,14 @@ static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci, chip = card->private_data; core = cx88_core_get(pci); - if (NULL == core) { + if (core == NULL) { err = -EINVAL; return err; } - err = pci_set_dma_mask(pci,DMA_BIT_MASK(32)); + err = pci_set_dma_mask(pci, DMA_BIT_MASK(32)); if (err) { - dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name); + dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n", core->name); cx88_core_put(core, pci); return err; } @@ -908,7 +906,7 @@ static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci, dprintk(1, "ALSA %s/%i: found at %s, rev: %d, irq: %d, latency: %d, mmio: 0x%llx\n", core->name, devno, pci_name(pci), pci->revision, pci->irq, - pci_lat, (unsigned long long)pci_resource_start(pci,0)); + pci_lat, (unsigned long long)pci_resource_start(pci, 0)); chip->irq = pci->irq; synchronize_irq(chip->irq); @@ -964,19 +962,20 @@ static int cx88_audio_initdev(struct pci_dev *pci, if (core->sd_wm8775) snd_ctl_add(card, snd_ctl_new1(&snd_cx88_alc_switch, chip)); - strcpy (card->driver, "CX88x"); + strcpy(card->driver, "CX88x"); sprintf(card->shortname, "Conexant CX%x", pci->device); sprintf(card->longname, "%s at %#llx", - card->shortname,(unsigned long long)pci_resource_start(pci, 0)); - strcpy (card->mixername, "CX88"); + card->shortname, + (unsigned long long)pci_resource_start(pci, 0)); + strcpy(card->mixername, "CX88"); - dprintk (0, "%s/%i: ALSA support for cx2388x boards\n", - card->driver,devno); + dprintk(0, "%s/%i: ALSA support for cx2388x boards\n", + card->driver, devno); err = snd_card_register(card); if (err < 0) goto error; - pci_set_drvdata(pci,card); + pci_set_drvdata(pci, card); devno++; return 0; diff --git a/drivers/media/pci/cx88/cx88-blackbird.c b/drivers/media/pci/cx88/cx88-blackbird.c index 4163e777825d..bffd064daff5 100644 --- a/drivers/media/pci/cx88/cx88-blackbird.c +++ b/drivers/media/pci/cx88/cx88-blackbird.c @@ -1,5 +1,4 @@ /* - * * Support for a cx23416 mpeg encoder via cx2388x host port. * "blackbird" reference design. * @@ -20,10 +19,6 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "cx88.h" @@ -46,8 +41,8 @@ MODULE_LICENSE("GPL"); MODULE_VERSION(CX88_VERSION); static unsigned int debug; -module_param(debug,int,0644); -MODULE_PARM_DESC(debug,"enable debug messages [blackbird]"); +module_param(debug, int, 0644); +MODULE_PARM_DESC(debug, "enable debug messages [blackbird]"); #define dprintk(level, fmt, arg...) do { \ if (debug + 1 > level) \ @@ -216,14 +211,14 @@ static void host_setup(struct cx88_core *core) static int wait_ready_gpio0_bit1(struct cx88_core *core, u32 state) { unsigned long timeout = jiffies + msecs_to_jiffies(1); - u32 gpio0,need; + u32 gpio0, need; need = state ? 2 : 0; for (;;) { gpio0 = cx_read(MO_GP0_IO) & 2; if (need == gpio0) return 0; - if (time_after(jiffies,timeout)) + if (time_after(jiffies, timeout)) return -1; udelay(1); } @@ -242,7 +237,7 @@ static int memory_write(struct cx88_core *core, u32 address, u32 value) cx_read(P1_MDATA0); cx_read(P1_MADDR0); - return wait_ready_gpio0_bit1(core,1); + return wait_ready_gpio0_bit1(core, 1); } static int memory_read(struct cx88_core *core, u32 address, u32 *value) @@ -256,7 +251,7 @@ static int memory_read(struct cx88_core *core, u32 address, u32 *value) cx_writeb(P1_MADDR0, (unsigned int)address); cx_read(P1_MADDR0); - retval = wait_ready_gpio0_bit1(core,1); + retval = wait_ready_gpio0_bit1(core, 1); cx_writeb(P1_MDATA3, 0); val = (unsigned char)cx_read(P1_MDATA3) << 24; @@ -283,7 +278,7 @@ static int register_write(struct cx88_core *core, u32 address, u32 value) cx_read(P1_RDATA0); cx_read(P1_RADDR0); - return wait_ready_gpio0_bit1(core,1); + return wait_ready_gpio0_bit1(core, 1); } @@ -297,7 +292,7 @@ static int register_read(struct cx88_core *core, u32 address, u32 *value) cx_writeb(P1_RRDWR, 0); cx_read(P1_RADDR0); - retval = wait_ready_gpio0_bit1(core,1); + retval = wait_ready_gpio0_bit1(core, 1); val = (unsigned char)cx_read(P1_RDATA0); val |= (unsigned char)cx_read(P1_RDATA1) << 8; val |= (unsigned char)cx_read(P1_RDATA2) << 16; @@ -316,7 +311,7 @@ static int blackbird_mbox_func(void *priv, u32 command, int in, int out, u32 dat u32 value, flag, retval; int i; - dprintk(1,"%s: 0x%X\n", __func__, command); + dprintk(1, "%s: 0x%X\n", __func__, command); /* this may not be 100% safe if we can't read any memory location without side effects */ @@ -354,7 +349,7 @@ static int blackbird_mbox_func(void *priv, u32 command, int in, int out, u32 dat memory_read(dev->core, dev->mailbox, &flag); if (0 != (flag & 4)) break; - if (time_after(jiffies,timeout)) { + if (time_after(jiffies, timeout)) { dprintk(0, "ERROR: API Mailbox timeout %x\n", command); return -EIO; } @@ -368,7 +363,7 @@ static int blackbird_mbox_func(void *priv, u32 command, int in, int out, u32 dat } memory_read(dev->core, dev->mailbox + 2, &retval); - dprintk(1, "API result = %d\n",retval); + dprintk(1, "API result = %d\n", retval); flag = 0; memory_write(dev->core, dev->mailbox, flag); @@ -400,8 +395,8 @@ static int blackbird_api_cmd(struct cx8802_dev *dev, u32 command, static int blackbird_find_mailbox(struct cx8802_dev *dev) { - u32 signature[4]={0x12345678, 0x34567812, 0x56781234, 0x78123456}; - int signaturecnt=0; + u32 signature[4] = {0x12345678, 0x34567812, 0x56781234, 0x78123456}; + int signaturecnt = 0; u32 value; int i; @@ -411,7 +406,7 @@ static int blackbird_find_mailbox(struct cx8802_dev *dev) signaturecnt++; else signaturecnt = 0; - if (4 == signaturecnt) { + if (signaturecnt == 4) { dprintk(1, "Mailbox signature found\n"); return i+1; } @@ -459,14 +454,14 @@ static int blackbird_load_firmware(struct cx8802_dev *dev) return -EINVAL; } - if (0 != memcmp(firmware->data, magic, 8)) { + if (memcmp(firmware->data, magic, 8) != 0) { pr_err("Firmware magic mismatch, wrong file?\n"); release_firmware(firmware); return -EINVAL; } /* transfer to the chip */ - dprintk(1,"Loading firmware ...\n"); + dprintk(1, "Loading firmware ...\n"); dataptr = (__le32 *)firmware->data; for (i = 0; i < (firmware->size >> 2); i++) { value = le32_to_cpu(*dataptr); @@ -534,7 +529,7 @@ static int blackbird_initialize_codec(struct cx8802_dev *dev) int version; int retval; - dprintk(1,"Initialize codec\n"); + dprintk(1, "Initialize codec\n"); retval = blackbird_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0); /* ping */ if (retval < 0) { /* ping was not successful, reset and upload firmware */ @@ -782,7 +777,7 @@ static int vidioc_querycap(struct file *file, void *priv, return 0; } -static int vidioc_enum_fmt_vid_cap (struct file *file, void *priv, +static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, struct v4l2_fmtdesc *f) { if (f->index != 0) @@ -815,7 +810,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, { struct cx8802_dev *dev = video_drvdata(file); struct cx88_core *core = dev->core; - unsigned maxw, maxh; + unsigned int maxw, maxh; enum v4l2_field field; f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; @@ -871,14 +866,14 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, return 0; } -static int vidioc_s_frequency (struct file *file, void *priv, +static int vidioc_s_frequency(struct file *file, void *priv, const struct v4l2_frequency *f) { struct cx8802_dev *dev = video_drvdata(file); struct cx88_core *core = dev->core; bool streaming; - if (unlikely(UNSET == core->board.tuner_type)) + if (unlikely(core->board.tuner_type == UNSET)) return -EINVAL; if (unlikely(f->tuner != 0)) return -EINVAL; @@ -886,7 +881,7 @@ static int vidioc_s_frequency (struct file *file, void *priv, if (streaming) blackbird_stop_codec(dev); - cx88_set_freq (core,f); + cx88_set_freq(core, f); blackbird_initialize_codec(dev); cx88_set_scale(core, core->width, core->height, core->field); @@ -895,7 +890,7 @@ static int vidioc_s_frequency (struct file *file, void *priv, return 0; } -static int vidioc_log_status (struct file *file, void *priv) +static int vidioc_log_status(struct file *file, void *priv) { struct cx8802_dev *dev = video_drvdata(file); struct cx88_core *core = dev->core; @@ -907,21 +902,22 @@ static int vidioc_log_status (struct file *file, void *priv) return 0; } -static int vidioc_enum_input (struct file *file, void *priv, +static int vidioc_enum_input(struct file *file, void *priv, struct v4l2_input *i) { struct cx8802_dev *dev = video_drvdata(file); struct cx88_core *core = dev->core; - return cx88_enum_input (core,i); + + return cx88_enum_input(core, i); } -static int vidioc_g_frequency (struct file *file, void *priv, +static int vidioc_g_frequency(struct file *file, void *priv, struct v4l2_frequency *f) { struct cx8802_dev *dev = video_drvdata(file); struct cx88_core *core = dev->core; - if (unlikely(UNSET == core->board.tuner_type)) + if (unlikely(core->board.tuner_type == UNSET)) return -EINVAL; if (unlikely(f->tuner != 0)) return -EINVAL; @@ -932,7 +928,7 @@ static int vidioc_g_frequency (struct file *file, void *priv, return 0; } -static int vidioc_g_input (struct file *file, void *priv, unsigned int *i) +static int vidioc_g_input(struct file *file, void *priv, unsigned int *i) { struct cx8802_dev *dev = video_drvdata(file); struct cx88_core *core = dev->core; @@ -941,7 +937,7 @@ static int vidioc_g_input (struct file *file, void *priv, unsigned int *i) return 0; } -static int vidioc_s_input (struct file *file, void *priv, unsigned int i) +static int vidioc_s_input(struct file *file, void *priv, unsigned int i) { struct cx8802_dev *dev = video_drvdata(file); struct cx88_core *core = dev->core; @@ -952,20 +948,20 @@ static int vidioc_s_input (struct file *file, void *priv, unsigned int i) return -EINVAL; cx88_newstation(core); - cx88_video_mux(core,i); + cx88_video_mux(core, i); return 0; } -static int vidioc_g_tuner (struct file *file, void *priv, +static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t) { struct cx8802_dev *dev = video_drvdata(file); struct cx88_core *core = dev->core; u32 reg; - if (unlikely(UNSET == core->board.tuner_type)) + if (unlikely(core->board.tuner_type == UNSET)) return -EINVAL; - if (0 != t->index) + if (t->index != 0) return -EINVAL; strcpy(t->name, "Television"); @@ -973,21 +969,21 @@ static int vidioc_g_tuner (struct file *file, void *priv, t->rangehigh = 0xffffffffUL; call_all(core, tuner, g_tuner, t); - cx88_get_stereo(core ,t); + cx88_get_stereo(core, t); reg = cx_read(MO_DEVICE_STATUS); t->signal = (reg & (1<<5)) ? 0xffff : 0x0000; return 0; } -static int vidioc_s_tuner (struct file *file, void *priv, +static int vidioc_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *t) { struct cx8802_dev *dev = video_drvdata(file); struct cx88_core *core = dev->core; - if (UNSET == core->board.tuner_type) + if (core->board.tuner_type == UNSET) return -EINVAL; - if (0 != t->index) + if (t->index != 0) return -EINVAL; cx88_set_stereo(core, t->audmode, 1); @@ -1011,8 +1007,8 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id) return cx88_set_tvnorm(core, id); } -static const struct v4l2_file_operations mpeg_fops = -{ +static const struct v4l2_file_operations mpeg_fops = { + .owner = THIS_MODULE, .open = v4l2_fh_open, .release = vb2_fop_release, @@ -1051,7 +1047,7 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { static struct video_device cx8802_mpeg_template = { .name = "cx8802", .fops = &mpeg_fops, - .ioctl_ops = &mpeg_ioctl_ops, + .ioctl_ops = &mpeg_ioctl_ops, .tvnorms = CX88_NORMS, }; @@ -1136,8 +1132,8 @@ static int cx8802_blackbird_probe(struct cx8802_driver *drv) struct vb2_queue *q; int err; - dprintk( 1, "%s\n", __func__); - dprintk( 1, " ->being probed by Card=%d Name=%s, PCI %02x:%02x\n", + dprintk(1, "%s\n", __func__); + dprintk(1, " ->being probed by Card=%d Name=%s, PCI %02x:%02x\n", core->boardnr, core->name, core->pci_bus, @@ -1165,8 +1161,8 @@ static int cx8802_blackbird_probe(struct cx8802_driver *drv) /* initial device configuration: needed ? */ // init_controls(core); - cx88_set_tvnorm(core,core->tvnorm); - cx88_video_mux(core,0); + cx88_set_tvnorm(core, core->tvnorm); + cx88_video_mux(core, 0); cx2341x_handler_set_50hz(&dev->cxhdl, core->height == 576); cx2341x_handler_setup(&dev->cxhdl); diff --git a/drivers/media/pci/cx88/cx88-cards.c b/drivers/media/pci/cx88/cx88-cards.c index 1a65db957dcb..269179142cd8 100644 --- a/drivers/media/pci/cx88/cx88-cards.c +++ b/drivers/media/pci/cx88/cx88-cards.c @@ -1,5 +1,4 @@ /* - * * device driver for Conexant 2388x based TV cards * card-specific stuff. * @@ -14,10 +13,6 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "cx88.h" @@ -38,19 +33,19 @@ module_param_array(tuner, int, NULL, 0444); module_param_array(radio, int, NULL, 0444); module_param_array(card, int, NULL, 0444); -MODULE_PARM_DESC(tuner,"tuner type"); -MODULE_PARM_DESC(radio,"radio tuner type"); -MODULE_PARM_DESC(card,"card type"); +MODULE_PARM_DESC(tuner, "tuner type"); +MODULE_PARM_DESC(radio, "radio tuner type"); +MODULE_PARM_DESC(card, "card type"); static unsigned int latency = UNSET; -module_param(latency,int,0444); -MODULE_PARM_DESC(latency,"pci latency timer"); +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(disable_ir, "Disable IR support"); -#define dprintk(level,fmt, arg...) do { \ +#define dprintk(level, fmt, arg...) do { \ if (cx88_core_debug >= level) \ printk(KERN_DEBUG pr_fmt("%s: core:" fmt), \ __func__, ##arg); \ @@ -2911,33 +2906,33 @@ static const struct { int fm; const char *name; } gdi_tuner[] = { - [ 0x01 ] = { .id = UNSET, + [0x01] = { .id = UNSET, .name = "NTSC_M" }, - [ 0x02 ] = { .id = UNSET, + [0x02] = { .id = UNSET, .name = "PAL_B" }, - [ 0x03 ] = { .id = UNSET, + [0x03] = { .id = UNSET, .name = "PAL_I" }, - [ 0x04 ] = { .id = UNSET, + [0x04] = { .id = UNSET, .name = "PAL_D" }, - [ 0x05 ] = { .id = UNSET, + [0x05] = { .id = UNSET, .name = "SECAM" }, - [ 0x10 ] = { .id = UNSET, + [0x10] = { .id = UNSET, .fm = 1, .name = "TEMIC_4049" }, - [ 0x11 ] = { .id = TUNER_TEMIC_4136FY5, + [0x11] = { .id = TUNER_TEMIC_4136FY5, .name = "TEMIC_4136" }, - [ 0x12 ] = { .id = UNSET, + [0x12] = { .id = UNSET, .name = "TEMIC_4146" }, - [ 0x20 ] = { .id = TUNER_PHILIPS_FQ1216ME, + [0x20] = { .id = TUNER_PHILIPS_FQ1216ME, .fm = 1, .name = "PHILIPS_FQ1216_MK3" }, - [ 0x21 ] = { .id = UNSET, .fm = 1, + [0x21] = { .id = UNSET, .fm = 1, .name = "PHILIPS_FQ1236_MK3" }, - [ 0x22 ] = { .id = UNSET, + [0x22] = { .id = UNSET, .name = "PHILIPS_FI1236_MK3" }, - [ 0x23 ] = { .id = UNSET, + [0x23] = { .id = UNSET, .name = "PHILIPS_FI1216_MK3" }, }; @@ -2947,7 +2942,7 @@ static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data) ? gdi_tuner[eeprom_data[0x0d]].name : NULL; pr_info("GDI: tuner=%s\n", name ? name : "unknown"); - if (NULL == name) + if (name == NULL) return; core->board.tuner_type = gdi_tuner[eeprom_data[0x0d]].id; core->board.radio.type = gdi_tuner[eeprom_data[0x0d]].fm ? @@ -3167,7 +3162,7 @@ static int cx88_xc4000_tuner_callback(struct cx88_core *core, } /* ----------------------------------------------------------------------- */ -/* Tuner callback function. Currently only needed for the Pinnacle * +/* Tuner callback function. Currently only needed for the Pinnacle * * PCTV HD 800i with an xc5000 sillicon tuner. This is used for both * * analog tuner attach (tuner-core.c) and dvb tuner attach (cx88-dvb.c) */ @@ -3401,7 +3396,7 @@ static void cx88_card_setup(struct cx88_core *core) memset(&tun_setup, 0, sizeof(tun_setup)); - if (0 == core->i2c_rc) { + if (core->i2c_rc == 0) { core->i2c_client.addr = 0xa0 >> 1; tveeprom_read(&core->i2c_client, eeprom, sizeof(eeprom)); } @@ -3409,17 +3404,17 @@ static void cx88_card_setup(struct cx88_core *core) switch (core->boardnr) { case CX88_BOARD_HAUPPAUGE: case CX88_BOARD_HAUPPAUGE_ROSLYN: - if (0 == core->i2c_rc) + if (core->i2c_rc == 0) hauppauge_eeprom(core, eeprom+8); break; case CX88_BOARD_GDI: - if (0 == core->i2c_rc) + if (core->i2c_rc == 0) gdi_eeprom(core, eeprom); break; case CX88_BOARD_LEADTEK_PVR2000: case CX88_BOARD_WINFAST_DV2000: case CX88_BOARD_WINFAST2000XP_EXPERT: - if (0 == core->i2c_rc) + if (core->i2c_rc == 0) leadtek_eeprom(core, eeprom); break; case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: @@ -3432,7 +3427,7 @@ static void cx88_card_setup(struct cx88_core *core) case CX88_BOARD_HAUPPAUGE_HVR4000: case CX88_BOARD_HAUPPAUGE_HVR4000LITE: case CX88_BOARD_HAUPPAUGE_IRONLY: - if (0 == core->i2c_rc) + if (core->i2c_rc == 0) hauppauge_eeprom(core, eeprom); break; case CX88_BOARD_KWORLD_DVBS_100: @@ -3478,21 +3473,21 @@ static void cx88_card_setup(struct cx88_core *core) cx_write(MO_GP0_IO, 0x00080808); break; case CX88_BOARD_ATI_HDTVWONDER: - if (0 == core->i2c_rc) { + if (core->i2c_rc == 0) { /* enable tuner */ int i; - static const u8 buffer [][2] = { - {0x10,0x12}, - {0x13,0x04}, - {0x16,0x00}, - {0x14,0x04}, - {0x17,0x00} + static const u8 buffer[][2] = { + {0x10, 0x12}, + {0x13, 0x04}, + {0x16, 0x00}, + {0x14, 0x04}, + {0x17, 0x00} }; core->i2c_client.addr = 0x0a; for (i = 0; i < ARRAY_SIZE(buffer); i++) if (2 != i2c_master_send(&core->i2c_client, - buffer[i],2)) + buffer[i], 2)) pr_warn("Unable to enable tuner(%i).\n", i); } @@ -3616,7 +3611,7 @@ static int cx88_pci_quirks(const char *name, struct pci_dev *pci) #endif /* check insmod options */ - if (UNSET != latency) + if (latency != UNSET) lat = latency; /* apply stuff */ @@ -3625,7 +3620,7 @@ static int cx88_pci_quirks(const char *name, struct pci_dev *pci) value |= ctrl; pci_write_config_byte(pci, CX88X_DEVCTRL, value); } - if (UNSET != lat) { + if (lat != UNSET) { pr_info("setting pci latency timer to %d\n", latency); pci_write_config_byte(pci, PCI_LATENCY_TIMER, latency); @@ -3635,8 +3630,8 @@ static int cx88_pci_quirks(const char *name, struct pci_dev *pci) int cx88_get_resources(const struct cx88_core *core, struct pci_dev *pci) { - if (request_mem_region(pci_resource_start(pci,0), - pci_resource_len(pci,0), + if (request_mem_region(pci_resource_start(pci, 0), + pci_resource_len(pci, 0), core->name)) return 0; pr_err("func %d: Can't get MMIO memory @ 0x%llx, subsystem: %04x:%04x\n", @@ -3692,7 +3687,7 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) return NULL; } - if (0 != cx88_get_resources(core, pci)) { + if (cx88_get_resources(core, pci) != 0) { v4l2_ctrl_handler_free(&core->video_hdl); v4l2_ctrl_handler_free(&core->audio_hdl); v4l2_device_unregister(&core->v4l2_dev); @@ -3724,7 +3719,7 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) if (pci->subsystem_vendor == cx88_subids[i].subvendor && pci->subsystem_device == cx88_subids[i].subdevice) core->boardnr = cx88_subids[i].card; - if (UNSET == core->boardnr) { + if (core->boardnr == UNSET) { core->boardnr = CX88_BOARD_UNKNOWN; cx88_card_list(core, pci); } @@ -3754,7 +3749,7 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) cx88_i2c_init(core, pci); /* load tuner module, if needed */ - if (UNSET != core->board.tuner_type) { + if (core->board.tuner_type != UNSET) { /* Ignore 0x6b and 0x6f on cx88 boards. * FusionHDTV5 RT Gold has an ir receiver at 0x6b * and an RTC at 0x6f which can get corrupted if probed. */ diff --git a/drivers/media/pci/cx88/cx88-core.c b/drivers/media/pci/cx88/cx88-core.c index 27203e094655..33719f0b06a5 100644 --- a/drivers/media/pci/cx88/cx88-core.c +++ b/drivers/media/pci/cx88/cx88-core.c @@ -1,5 +1,4 @@ /* - * * device driver for Conexant 2388x based TV cards * driver core * @@ -19,10 +18,6 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "cx88.h" @@ -54,12 +49,12 @@ module_param_named(core_debug, cx88_core_debug, int, 0644); MODULE_PARM_DESC(core_debug, "enable debug messages [core]"); static unsigned int nicam; -module_param(nicam,int,0644); -MODULE_PARM_DESC(nicam,"tv audio is nicam"); +module_param(nicam, int, 0644); +MODULE_PARM_DESC(nicam, "tv audio is nicam"); static unsigned int nocomb; -module_param(nocomb,int,0644); -MODULE_PARM_DESC(nocomb,"disable comb filter"); +module_param(nocomb, int, 0644); +MODULE_PARM_DESC(nocomb, "disable comb filter"); #define dprintk0(fmt, arg...) \ printk(KERN_DEBUG pr_fmt("%s: core:" fmt), \ @@ -79,13 +74,13 @@ static DEFINE_MUTEX(devlist); |