aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-12-12 08:27:56 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-12-23 07:13:19 -0500
commit90ca8bef9082c2036a200dd2cd17924944cd339b (patch)
treeddc42bc904967006d51745c7b4dd6d516f56b7d5
parent1e4518086ae863814a3481a180264a1ac89a730b (diff)
[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>
-rw-r--r--drivers/media/common/Kconfig4
-rw-r--r--drivers/media/common/Makefile1
-rw-r--r--drivers/media/pci/bt8xx/Kconfig1
-rw-r--r--drivers/media/pci/bt8xx/Makefile2
-rw-r--r--drivers/media/pci/bt8xx/btcx-risc.c (renamed from drivers/media/common/btcx-risc.c)30
-rw-r--r--drivers/media/pci/bt8xx/btcx-risc.h26
6 files changed, 35 insertions, 29 deletions
diff --git a/drivers/media/common/Kconfig b/drivers/media/common/Kconfig
index b85f88c8ddbd..21154dd87b0b 100644
--- a/drivers/media/common/Kconfig
+++ b/drivers/media/common/Kconfig
@@ -8,10 +8,6 @@ comment "common driver options"
8config VIDEO_CX2341X 8config VIDEO_CX2341X
9 tristate 9 tristate
10 10
11config VIDEO_BTCX
12 depends on PCI
13 tristate
14
15config VIDEO_TVEEPROM 11config VIDEO_TVEEPROM
16 tristate 12 tristate
17 depends on I2C 13 depends on I2C
diff --git a/drivers/media/common/Makefile b/drivers/media/common/Makefile
index d208de3b7cc0..89b795df2cdd 100644
--- a/drivers/media/common/Makefile
+++ b/drivers/media/common/Makefile
@@ -1,5 +1,4 @@
1obj-y += b2c2/ saa7146/ siano/ 1obj-y += b2c2/ saa7146/ siano/
2obj-$(CONFIG_VIDEO_CX2341X) += cx2341x.o 2obj-$(CONFIG_VIDEO_CX2341X) += cx2341x.o
3obj-$(CONFIG_VIDEO_BTCX) += btcx-risc.o
4obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o 3obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
5obj-$(CONFIG_CYPRESS_FIRMWARE) += cypress_firmware.o 4obj-$(CONFIG_CYPRESS_FIRMWARE) += cypress_firmware.o
diff --git a/drivers/media/pci/bt8xx/Kconfig b/drivers/media/pci/bt8xx/Kconfig
index 61d09e010814..496cf6b2dc43 100644
--- a/drivers/media/pci/bt8xx/Kconfig
+++ b/drivers/media/pci/bt8xx/Kconfig
@@ -2,7 +2,6 @@ config VIDEO_BT848
2 tristate "BT848 Video For Linux" 2 tristate "BT848 Video For Linux"
3 depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L2 3 depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L2
4 select I2C_ALGOBIT 4 select I2C_ALGOBIT
5 select VIDEO_BTCX
6 select VIDEOBUF_DMA_SG 5 select VIDEOBUF_DMA_SG
7 depends on RC_CORE 6 depends on RC_CORE
8 select VIDEO_TUNER 7 select VIDEO_TUNER
diff --git a/drivers/media/pci/bt8xx/Makefile b/drivers/media/pci/bt8xx/Makefile
index f9fe7c4e7d53..2d4c3dd88be1 100644
--- a/drivers/media/pci/bt8xx/Makefile
+++ b/drivers/media/pci/bt8xx/Makefile
@@ -1,6 +1,6 @@
1bttv-objs := bttv-driver.o bttv-cards.o bttv-if.o \ 1bttv-objs := bttv-driver.o bttv-cards.o bttv-if.o \
2 bttv-risc.o bttv-vbi.o bttv-i2c.o bttv-gpio.o \ 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
5obj-$(CONFIG_VIDEO_BT848) += bttv.o 5obj-$(CONFIG_VIDEO_BT848) += bttv.o
6obj-$(CONFIG_DVB_BT8XX) += bt878.o dvb-bt8xx.o dst.o dst_ca.o 6obj-$(CONFIG_DVB_BT8XX) += bt878.o dvb-bt8xx.o dst.o dst_ca.o
diff --git a/drivers/media/common/btcx-risc.c b/drivers/media/pci/bt8xx/btcx-risc.c
index e67338aa8c89..00f0880b6d66 100644
--- a/drivers/media/common/btcx-risc.c
+++ b/drivers/media/pci/bt8xx/btcx-risc.c
@@ -32,13 +32,9 @@
32 32
33#include "btcx-risc.h" 33#include "btcx-risc.h"
34 34
35MODULE_DESCRIPTION("some code shared by bttv and cx88xx drivers"); 35static unsigned int btcx_debug;
36MODULE_AUTHOR("Gerd Knorr"); 36module_param(btcx_debug, int, 0644);
37MODULE_LICENSE("GPL"); 37MODULE_PARM_DESC(btcx_debug,"debug messages, default is 0 (no)");
38
39static unsigned int debug;
40module_param(debug, int, 0644);
41MODULE_PARM_DESC(debug,"debug messages, default is 0 (no)");
42 38
43/* ---------------------------------------------------------- */ 39/* ---------------------------------------------------------- */
44/* allocate/free risc memory */ 40/* allocate/free risc memory */
@@ -50,7 +46,7 @@ void btcx_riscmem_free(struct pci_dev *pci,
50{ 46{
51 if (NULL == risc->cpu) 47 if (NULL == risc->cpu)
52 return; 48 return;
53 if (debug) { 49 if (btcx_debug) {
54 memcnt--; 50 memcnt--;
55 printk("btcx: riscmem free [%d] dma=%lx\n", 51 printk("btcx: riscmem free [%d] dma=%lx\n",
56 memcnt, (unsigned long)risc->dma); 52 memcnt, (unsigned long)risc->dma);
@@ -75,7 +71,7 @@ int btcx_riscmem_alloc(struct pci_dev *pci,
75 risc->cpu = cpu; 71 risc->cpu = cpu;
76 risc->dma = dma; 72 risc->dma = dma;
77 risc->size = size; 73 risc->size = size;
78 if (debug) { 74 if (btcx_debug) {
79 memcnt++; 75 memcnt++;
80 printk("btcx: riscmem alloc [%d] dma=%lx cpu=%p size=%d\n", 76 printk("btcx: riscmem alloc [%d] dma=%lx cpu=%p size=%d\n",
81 memcnt, (unsigned long)dma, cpu, size); 77 memcnt, (unsigned long)dma, cpu, size);
@@ -141,7 +137,7 @@ btcx_align(struct v4l2_rect *win, struct v4l2_clip *clips, unsigned int n, int m
141 dx = nx - win->left; 137 dx = nx - win->left;
142 win->left = nx; 138 win->left = nx;
143 win->width = nw; 139 win->width = nw;
144 if (debug) 140 if (btcx_debug)
145 printk(KERN_DEBUG "btcx: window align %dx%d+%d+%d [dx=%d]\n", 141 printk(KERN_DEBUG "btcx: window align %dx%d+%d+%d [dx=%d]\n",
146 win->width, win->height, win->left, win->top, dx); 142 win->width, win->height, win->left, win->top, dx);
147 143
@@ -153,7 +149,7 @@ btcx_align(struct v4l2_rect *win, struct v4l2_clip *clips, unsigned int n, int m
153 nw += mask+1; 149 nw += mask+1;
154 clips[i].c.left = nx; 150 clips[i].c.left = nx;
155 clips[i].c.width = nw; 151 clips[i].c.width = nw;
156 if (debug) 152 if (btcx_debug)
157 printk(KERN_DEBUG "btcx: clip align %dx%d+%d+%d\n", 153 printk(KERN_DEBUG "btcx: clip align %dx%d+%d+%d\n",
158 clips[i].c.width, clips[i].c.height, 154 clips[i].c.width, clips[i].c.height,
159 clips[i].c.left, clips[i].c.top); 155 clips[i].c.left, clips[i].c.top);
@@ -234,7 +230,7 @@ btcx_calc_skips(int line, int width, int *maxy,
234 *nskips = skip; 230 *nskips = skip;
235 *maxy = maxline; 231 *maxy = maxline;
236 232
237 if (debug) { 233 if (btcx_debug) {
238 printk(KERN_DEBUG "btcx: skips line %d-%d:",line,maxline); 234 printk(KERN_DEBUG "btcx: skips line %d-%d:",line,maxline);
239 for (skip = 0; skip < *nskips; skip++) { 235 for (skip = 0; skip < *nskips; skip++) {
240 printk(" %d-%d",skips[skip].start,skips[skip].end); 236 printk(" %d-%d",skips[skip].start,skips[skip].end);
@@ -242,13 +238,3 @@ btcx_calc_skips(int line, int width, int *maxy,
242 printk("\n"); 238 printk("\n");
243 } 239 }
244} 240}
245
246/* ---------------------------------------------------------- */
247
248EXPORT_SYMBOL(btcx_riscmem_alloc);
249EXPORT_SYMBOL(btcx_riscmem_free);
250
251EXPORT_SYMBOL(btcx_screen_clips);
252EXPORT_SYMBOL(btcx_align);
253EXPORT_SYMBOL(btcx_sort_clips);
254EXPORT_SYMBOL(btcx_calc_skips);
diff --git a/drivers/media/pci/bt8xx/btcx-risc.h b/drivers/media/pci/bt8xx/btcx-risc.h
new file mode 100644
index 000000000000..1ed7a000160a
--- /dev/null
+++ b/drivers/media/pci/bt8xx/btcx-risc.h
@@ -0,0 +1,26 @@
1struct btcx_riscmem {
2 unsigned int size;
3 __le32 *cpu;
4 __le32 *jmp;
5 dma_addr_t dma;
6};
7
8struct btcx_skiplist {
9 int start;
10 int end;
11};
12
13int btcx_riscmem_alloc(struct pci_dev *pci,
14 struct btcx_riscmem *risc,
15 unsigned int size);
16void btcx_riscmem_free(struct pci_dev *pci,
17 struct btcx_riscmem *risc);
18
19int btcx_screen_clips(int swidth, int sheight, struct v4l2_rect *win,
20 struct v4l2_clip *clips, unsigned int n);
21int btcx_align(struct v4l2_rect *win, struct v4l2_clip *clips,
22 unsigned int n, int mask);
23void btcx_sort_clips(struct v4l2_clip *clips, unsigned int nclips);
24void 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);