Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] btcx-risc: move to bt8xx

The btcx-risc module is no longer used by other drivers except for bttv.
So move it from common to bt8xx and make it part of the bttv driver instead
of as a separate module.

This module should never have been a common module since most of the code
has always been bttv specific.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
90ca8bef 1e451808

+35 -29
-4
drivers/media/common/Kconfig
··· 8 8 config VIDEO_CX2341X 9 9 tristate 10 10 11 - config VIDEO_BTCX 12 - depends on PCI 13 - tristate 14 - 15 11 config VIDEO_TVEEPROM 16 12 tristate 17 13 depends on I2C
-1
drivers/media/common/Makefile
··· 1 1 obj-y += b2c2/ saa7146/ siano/ 2 2 obj-$(CONFIG_VIDEO_CX2341X) += cx2341x.o 3 - obj-$(CONFIG_VIDEO_BTCX) += btcx-risc.o 4 3 obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o 5 4 obj-$(CONFIG_CYPRESS_FIRMWARE) += cypress_firmware.o
+8 -22
drivers/media/common/btcx-risc.c drivers/media/pci/bt8xx/btcx-risc.c
··· 32 32 33 33 #include "btcx-risc.h" 34 34 35 - MODULE_DESCRIPTION("some code shared by bttv and cx88xx drivers"); 36 - MODULE_AUTHOR("Gerd Knorr"); 37 - MODULE_LICENSE("GPL"); 38 - 39 - static unsigned int debug; 40 - module_param(debug, int, 0644); 41 - MODULE_PARM_DESC(debug,"debug messages, default is 0 (no)"); 35 + static unsigned int btcx_debug; 36 + module_param(btcx_debug, int, 0644); 37 + MODULE_PARM_DESC(btcx_debug,"debug messages, default is 0 (no)"); 42 38 43 39 /* ---------------------------------------------------------- */ 44 40 /* allocate/free risc memory */ ··· 46 50 { 47 51 if (NULL == risc->cpu) 48 52 return; 49 - if (debug) { 53 + if (btcx_debug) { 50 54 memcnt--; 51 55 printk("btcx: riscmem free [%d] dma=%lx\n", 52 56 memcnt, (unsigned long)risc->dma); ··· 71 75 risc->cpu = cpu; 72 76 risc->dma = dma; 73 77 risc->size = size; 74 - if (debug) { 78 + if (btcx_debug) { 75 79 memcnt++; 76 80 printk("btcx: riscmem alloc [%d] dma=%lx cpu=%p size=%d\n", 77 81 memcnt, (unsigned long)dma, cpu, size); ··· 137 141 dx = nx - win->left; 138 142 win->left = nx; 139 143 win->width = nw; 140 - if (debug) 144 + if (btcx_debug) 141 145 printk(KERN_DEBUG "btcx: window align %dx%d+%d+%d [dx=%d]\n", 142 146 win->width, win->height, win->left, win->top, dx); 143 147 ··· 149 153 nw += mask+1; 150 154 clips[i].c.left = nx; 151 155 clips[i].c.width = nw; 152 - if (debug) 156 + if (btcx_debug) 153 157 printk(KERN_DEBUG "btcx: clip align %dx%d+%d+%d\n", 154 158 clips[i].c.width, clips[i].c.height, 155 159 clips[i].c.left, clips[i].c.top); ··· 230 234 *nskips = skip; 231 235 *maxy = maxline; 232 236 233 - if (debug) { 237 + if (btcx_debug) { 234 238 printk(KERN_DEBUG "btcx: skips line %d-%d:",line,maxline); 235 239 for (skip = 0; skip < *nskips; skip++) { 236 240 printk(" %d-%d",skips[skip].start,skips[skip].end); ··· 238 242 printk("\n"); 239 243 } 240 244 } 241 - 242 - /* ---------------------------------------------------------- */ 243 - 244 - EXPORT_SYMBOL(btcx_riscmem_alloc); 245 - EXPORT_SYMBOL(btcx_riscmem_free); 246 - 247 - EXPORT_SYMBOL(btcx_screen_clips); 248 - EXPORT_SYMBOL(btcx_align); 249 - EXPORT_SYMBOL(btcx_sort_clips); 250 - EXPORT_SYMBOL(btcx_calc_skips);
-1
drivers/media/pci/bt8xx/Kconfig
··· 2 2 tristate "BT848 Video For Linux" 3 3 depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L2 4 4 select I2C_ALGOBIT 5 - select VIDEO_BTCX 6 5 select VIDEOBUF_DMA_SG 7 6 depends on RC_CORE 8 7 select VIDEO_TUNER
+1 -1
drivers/media/pci/bt8xx/Makefile
··· 1 1 bttv-objs := bttv-driver.o bttv-cards.o bttv-if.o \ 2 2 bttv-risc.o bttv-vbi.o bttv-i2c.o bttv-gpio.o \ 3 - bttv-input.o bttv-audio-hook.o 3 + bttv-input.o bttv-audio-hook.o btcx-risc.o 4 4 5 5 obj-$(CONFIG_VIDEO_BT848) += bttv.o 6 6 obj-$(CONFIG_DVB_BT8XX) += bt878.o dvb-bt8xx.o dst.o dst_ca.o
+26
drivers/media/pci/bt8xx/btcx-risc.h
··· 1 + struct btcx_riscmem { 2 + unsigned int size; 3 + __le32 *cpu; 4 + __le32 *jmp; 5 + dma_addr_t dma; 6 + }; 7 + 8 + struct btcx_skiplist { 9 + int start; 10 + int end; 11 + }; 12 + 13 + int btcx_riscmem_alloc(struct pci_dev *pci, 14 + struct btcx_riscmem *risc, 15 + unsigned int size); 16 + void btcx_riscmem_free(struct pci_dev *pci, 17 + struct btcx_riscmem *risc); 18 + 19 + int btcx_screen_clips(int swidth, int sheight, struct v4l2_rect *win, 20 + struct v4l2_clip *clips, unsigned int n); 21 + int btcx_align(struct v4l2_rect *win, struct v4l2_clip *clips, 22 + unsigned int n, int mask); 23 + void btcx_sort_clips(struct v4l2_clip *clips, unsigned int nclips); 24 + void btcx_calc_skips(int line, int width, int *maxy, 25 + struct btcx_skiplist *skips, unsigned int *nskips, 26 + const struct v4l2_clip *clips, unsigned int nclips);