diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2014-08-10 05:26:01 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-09-08 09:01:00 -0400 |
commit | 4d63a25c4523b5d18e5307897d56aff785f43bf5 (patch) | |
tree | b17311a8d01f28fa57429e4031de00f60ff3067b /drivers/media/pci | |
parent | 96f233e97587a7f6c0f47476118cdb9a23a9ebe0 (diff) |
[media] cx23885: remove btcx-risc dependency
It's just as easy to do it in the driver. This dependency only uses a
fraction of the btcx-risc module and doing it directly in the driver
adds only a few lines. The btcx-risc module is really meant for the
bttv driver, not for other drivers.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r-- | drivers/media/pci/cx23885/Kconfig | 1 | ||||
-rw-r--r-- | drivers/media/pci/cx23885/Makefile | 1 | ||||
-rw-r--r-- | drivers/media/pci/cx23885/cx23885-alsa.c | 5 | ||||
-rw-r--r-- | drivers/media/pci/cx23885/cx23885-core.c | 36 | ||||
-rw-r--r-- | drivers/media/pci/cx23885/cx23885.h | 18 |
5 files changed, 35 insertions, 26 deletions
diff --git a/drivers/media/pci/cx23885/Kconfig b/drivers/media/pci/cx23885/Kconfig index 38c3b7bc7c2a..a883ea4968be 100644 --- a/drivers/media/pci/cx23885/Kconfig +++ b/drivers/media/pci/cx23885/Kconfig | |||
@@ -3,7 +3,6 @@ config VIDEO_CX23885 | |||
3 | depends on DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT && SND | 3 | depends on DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT && SND |
4 | select SND_PCM | 4 | select SND_PCM |
5 | select I2C_ALGOBIT | 5 | select I2C_ALGOBIT |
6 | select VIDEO_BTCX | ||
7 | select VIDEO_TUNER | 6 | select VIDEO_TUNER |
8 | select VIDEO_TVEEPROM | 7 | select VIDEO_TVEEPROM |
9 | depends on RC_CORE | 8 | depends on RC_CORE |
diff --git a/drivers/media/pci/cx23885/Makefile b/drivers/media/pci/cx23885/Makefile index 2a2cafb8cf5b..a2cbdcf15a8c 100644 --- a/drivers/media/pci/cx23885/Makefile +++ b/drivers/media/pci/cx23885/Makefile | |||
@@ -8,7 +8,6 @@ obj-$(CONFIG_VIDEO_CX23885) += cx23885.o | |||
8 | obj-$(CONFIG_MEDIA_ALTERA_CI) += altera-ci.o | 8 | obj-$(CONFIG_MEDIA_ALTERA_CI) += altera-ci.o |
9 | 9 | ||
10 | ccflags-y += -Idrivers/media/i2c | 10 | ccflags-y += -Idrivers/media/i2c |
11 | ccflags-y += -Idrivers/media/common | ||
12 | ccflags-y += -Idrivers/media/tuners | 11 | ccflags-y += -Idrivers/media/tuners |
13 | ccflags-y += -Idrivers/media/dvb-core | 12 | ccflags-y += -Idrivers/media/dvb-core |
14 | ccflags-y += -Idrivers/media/dvb-frontends | 13 | ccflags-y += -Idrivers/media/dvb-frontends |
diff --git a/drivers/media/pci/cx23885/cx23885-alsa.c b/drivers/media/pci/cx23885/cx23885-alsa.c index 1b162ee8c8c6..ae7c2e89ad1c 100644 --- a/drivers/media/pci/cx23885/cx23885-alsa.c +++ b/drivers/media/pci/cx23885/cx23885-alsa.c | |||
@@ -270,12 +270,15 @@ int cx23885_audio_irq(struct cx23885_dev *dev, u32 status, u32 mask) | |||
270 | 270 | ||
271 | static int dsp_buffer_free(struct cx23885_audio_dev *chip) | 271 | static int dsp_buffer_free(struct cx23885_audio_dev *chip) |
272 | { | 272 | { |
273 | struct cx23885_riscmem *risc; | ||
274 | |||
273 | BUG_ON(!chip->dma_size); | 275 | BUG_ON(!chip->dma_size); |
274 | 276 | ||
275 | dprintk(2, "Freeing buffer\n"); | 277 | dprintk(2, "Freeing buffer\n"); |
276 | cx23885_alsa_dma_unmap(chip); | 278 | cx23885_alsa_dma_unmap(chip); |
277 | cx23885_alsa_dma_free(chip->buf); | 279 | cx23885_alsa_dma_free(chip->buf); |
278 | btcx_riscmem_free(chip->pci, &chip->buf->risc); | 280 | risc = &chip->buf->risc; |
281 | pci_free_consistent(chip->pci, risc->size, risc->cpu, risc->dma); | ||
279 | kfree(chip->buf); | 282 | kfree(chip->buf); |
280 | 283 | ||
281 | chip->buf = NULL; | 284 | chip->buf = NULL; |
diff --git a/drivers/media/pci/cx23885/cx23885-core.c b/drivers/media/pci/cx23885/cx23885-core.c index 8d77a5649777..cb94366b9504 100644 --- a/drivers/media/pci/cx23885/cx23885-core.c +++ b/drivers/media/pci/cx23885/cx23885-core.c | |||
@@ -570,7 +570,7 @@ void cx23885_sram_channel_dump(struct cx23885_dev *dev, | |||
570 | } | 570 | } |
571 | 571 | ||
572 | static void cx23885_risc_disasm(struct cx23885_tsport *port, | 572 | static void cx23885_risc_disasm(struct cx23885_tsport *port, |
573 | struct btcx_riscmem *risc) | 573 | struct cx23885_riscmem *risc) |
574 | { | 574 | { |
575 | struct cx23885_dev *dev = port->dev; | 575 | struct cx23885_dev *dev = port->dev; |
576 | unsigned int i, j, n; | 576 | unsigned int i, j, n; |
@@ -1121,14 +1121,13 @@ static __le32 *cx23885_risc_field(__le32 *rp, struct scatterlist *sglist, | |||
1121 | return rp; | 1121 | return rp; |
1122 | } | 1122 | } |
1123 | 1123 | ||
1124 | int cx23885_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc, | 1124 | int cx23885_risc_buffer(struct pci_dev *pci, struct cx23885_riscmem *risc, |
1125 | struct scatterlist *sglist, unsigned int top_offset, | 1125 | struct scatterlist *sglist, unsigned int top_offset, |
1126 | unsigned int bottom_offset, unsigned int bpl, | 1126 | unsigned int bottom_offset, unsigned int bpl, |
1127 | unsigned int padding, unsigned int lines) | 1127 | unsigned int padding, unsigned int lines) |
1128 | { | 1128 | { |
1129 | u32 instructions, fields; | 1129 | u32 instructions, fields; |
1130 | __le32 *rp; | 1130 | __le32 *rp; |
1131 | int rc; | ||
1132 | 1131 | ||
1133 | fields = 0; | 1132 | fields = 0; |
1134 | if (UNSET != top_offset) | 1133 | if (UNSET != top_offset) |
@@ -1144,9 +1143,10 @@ int cx23885_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc, | |||
1144 | instructions = fields * (1 + ((bpl + padding) * lines) | 1143 | instructions = fields * (1 + ((bpl + padding) * lines) |
1145 | / PAGE_SIZE + lines); | 1144 | / PAGE_SIZE + lines); |
1146 | instructions += 5; | 1145 | instructions += 5; |
1147 | rc = btcx_riscmem_alloc(pci, risc, instructions*12); | 1146 | risc->size = instructions * 12; |
1148 | if (rc < 0) | 1147 | risc->cpu = pci_alloc_consistent(pci, risc->size, &risc->dma); |
1149 | return rc; | 1148 | if (risc->cpu == NULL) |
1149 | return -ENOMEM; | ||
1150 | 1150 | ||
1151 | /* write risc instructions */ | 1151 | /* write risc instructions */ |
1152 | rp = risc->cpu; | 1152 | rp = risc->cpu; |
@@ -1164,14 +1164,13 @@ int cx23885_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc, | |||
1164 | } | 1164 | } |
1165 | 1165 | ||
1166 | int cx23885_risc_databuffer(struct pci_dev *pci, | 1166 | int cx23885_risc_databuffer(struct pci_dev *pci, |
1167 | struct btcx_riscmem *risc, | 1167 | struct cx23885_riscmem *risc, |
1168 | struct scatterlist *sglist, | 1168 | struct scatterlist *sglist, |
1169 | unsigned int bpl, | 1169 | unsigned int bpl, |
1170 | unsigned int lines, unsigned int lpi) | 1170 | unsigned int lines, unsigned int lpi) |
1171 | { | 1171 | { |
1172 | u32 instructions; | 1172 | u32 instructions; |
1173 | __le32 *rp; | 1173 | __le32 *rp; |
1174 | int rc; | ||
1175 | 1174 | ||
1176 | /* estimate risc mem: worst case is one write per page border + | 1175 | /* estimate risc mem: worst case is one write per page border + |
1177 | one write per scan line + syncs + jump (all 2 dwords). Here | 1176 | one write per scan line + syncs + jump (all 2 dwords). Here |
@@ -1181,9 +1180,10 @@ int cx23885_risc_databuffer(struct pci_dev *pci, | |||
1181 | instructions = 1 + (bpl * lines) / PAGE_SIZE + lines; | 1180 | instructions = 1 + (bpl * lines) / PAGE_SIZE + lines; |
1182 | instructions += 4; | 1181 | instructions += 4; |
1183 | 1182 | ||
1184 | rc = btcx_riscmem_alloc(pci, risc, instructions*12); | 1183 | risc->size = instructions * 12; |
1185 | if (rc < 0) | 1184 | risc->cpu = pci_alloc_consistent(pci, risc->size, &risc->dma); |
1186 | return rc; | 1185 | if (risc->cpu == NULL) |
1186 | return -ENOMEM; | ||
1187 | 1187 | ||
1188 | /* write risc instructions */ | 1188 | /* write risc instructions */ |
1189 | rp = risc->cpu; | 1189 | rp = risc->cpu; |
@@ -1196,14 +1196,13 @@ int cx23885_risc_databuffer(struct pci_dev *pci, | |||
1196 | return 0; | 1196 | return 0; |
1197 | } | 1197 | } |
1198 | 1198 | ||
1199 | int cx23885_risc_vbibuffer(struct pci_dev *pci, struct btcx_riscmem *risc, | 1199 | int cx23885_risc_vbibuffer(struct pci_dev *pci, struct cx23885_riscmem *risc, |
1200 | struct scatterlist *sglist, unsigned int top_offset, | 1200 | struct scatterlist *sglist, unsigned int top_offset, |
1201 | unsigned int bottom_offset, unsigned int bpl, | 1201 | unsigned int bottom_offset, unsigned int bpl, |
1202 | unsigned int padding, unsigned int lines) | 1202 | unsigned int padding, unsigned int lines) |
1203 | { | 1203 | { |
1204 | u32 instructions, fields; | 1204 | u32 instructions, fields; |
1205 | __le32 *rp; | 1205 | __le32 *rp; |
1206 | int rc; | ||
1207 | 1206 | ||
1208 | fields = 0; | 1207 | fields = 0; |
1209 | if (UNSET != top_offset) | 1208 | if (UNSET != top_offset) |
@@ -1219,9 +1218,10 @@ int cx23885_risc_vbibuffer(struct pci_dev *pci, struct btcx_riscmem *risc, | |||
1219 | instructions = fields * (1 + ((bpl + padding) * lines) | 1218 | instructions = fields * (1 + ((bpl + padding) * lines) |
1220 | / PAGE_SIZE + lines); | 1219 | / PAGE_SIZE + lines); |
1221 | instructions += 5; | 1220 | instructions += 5; |
1222 | rc = btcx_riscmem_alloc(pci, risc, instructions*12); | 1221 | risc->size = instructions * 12; |
1223 | if (rc < 0) | 1222 | risc->cpu = pci_alloc_consistent(pci, risc->size, &risc->dma); |
1224 | return rc; | 1223 | if (risc->cpu == NULL) |
1224 | return -ENOMEM; | ||
1225 | /* write risc instructions */ | 1225 | /* write risc instructions */ |
1226 | rp = risc->cpu; | 1226 | rp = risc->cpu; |
1227 | 1227 | ||
@@ -1246,8 +1246,10 @@ int cx23885_risc_vbibuffer(struct pci_dev *pci, struct btcx_riscmem *risc, | |||
1246 | 1246 | ||
1247 | void cx23885_free_buffer(struct cx23885_dev *dev, struct cx23885_buffer *buf) | 1247 | void cx23885_free_buffer(struct cx23885_dev *dev, struct cx23885_buffer *buf) |
1248 | { | 1248 | { |
1249 | struct cx23885_riscmem *risc = &buf->risc; | ||
1250 | |||
1249 | BUG_ON(in_interrupt()); | 1251 | BUG_ON(in_interrupt()); |
1250 | btcx_riscmem_free(dev->pci, &buf->risc); | 1252 | pci_free_consistent(dev->pci, risc->size, risc->cpu, risc->dma); |
1251 | } | 1253 | } |
1252 | 1254 | ||
1253 | static void cx23885_tsport_reg_dump(struct cx23885_tsport *port) | 1255 | static void cx23885_tsport_reg_dump(struct cx23885_tsport *port) |
diff --git a/drivers/media/pci/cx23885/cx23885.h b/drivers/media/pci/cx23885/cx23885.h index 388e420d88e9..0e4f4061087f 100644 --- a/drivers/media/pci/cx23885/cx23885.h +++ b/drivers/media/pci/cx23885/cx23885.h | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <media/videobuf2-dvb.h> | 29 | #include <media/videobuf2-dvb.h> |
30 | #include <media/rc-core.h> | 30 | #include <media/rc-core.h> |
31 | 31 | ||
32 | #include "btcx-risc.h" | ||
33 | #include "cx23885-reg.h" | 32 | #include "cx23885-reg.h" |
34 | #include "media/cx2341x.h" | 33 | #include "media/cx2341x.h" |
35 | 34 | ||
@@ -152,6 +151,13 @@ enum cx23885_src_sel_type { | |||
152 | CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO | 151 | CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO |
153 | }; | 152 | }; |
154 | 153 | ||
154 | struct cx23885_riscmem { | ||
155 | unsigned int size; | ||
156 | __le32 *cpu; | ||
157 | __le32 *jmp; | ||
158 | dma_addr_t dma; | ||
159 | }; | ||
160 | |||
155 | /* buffer for one video frame */ | 161 | /* buffer for one video frame */ |
156 | struct cx23885_buffer { | 162 | struct cx23885_buffer { |
157 | /* common v4l buffer stuff -- must be first */ | 163 | /* common v4l buffer stuff -- must be first */ |
@@ -160,7 +166,7 @@ struct cx23885_buffer { | |||
160 | 166 | ||
161 | /* cx23885 specific */ | 167 | /* cx23885 specific */ |
162 | unsigned int bpl; | 168 | unsigned int bpl; |
163 | struct btcx_riscmem risc; | 169 | struct cx23885_riscmem risc; |
164 | struct cx23885_fmt *fmt; | 170 | struct cx23885_fmt *fmt; |
165 | u32 count; | 171 | u32 count; |
166 | }; | 172 | }; |
@@ -300,7 +306,7 @@ struct cx23885_kernel_ir { | |||
300 | 306 | ||
301 | struct cx23885_audio_buffer { | 307 | struct cx23885_audio_buffer { |
302 | unsigned int bpl; | 308 | unsigned int bpl; |
303 | struct btcx_riscmem risc; | 309 | struct cx23885_riscmem risc; |
304 | void *vaddr; | 310 | void *vaddr; |
305 | struct scatterlist *sglist; | 311 | struct scatterlist *sglist; |
306 | int sglen; | 312 | int sglen; |
@@ -489,13 +495,13 @@ extern int cx23885_sram_channel_setup(struct cx23885_dev *dev, | |||
489 | extern void cx23885_sram_channel_dump(struct cx23885_dev *dev, | 495 | extern void cx23885_sram_channel_dump(struct cx23885_dev *dev, |
490 | struct sram_channel *ch); | 496 | struct sram_channel *ch); |
491 | 497 | ||
492 | extern int cx23885_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc, | 498 | extern int cx23885_risc_buffer(struct pci_dev *pci, struct cx23885_riscmem *risc, |
493 | struct scatterlist *sglist, | 499 | struct scatterlist *sglist, |
494 | unsigned int top_offset, unsigned int bottom_offset, | 500 | unsigned int top_offset, unsigned int bottom_offset, |
495 | unsigned int bpl, unsigned int padding, unsigned int lines); | 501 | unsigned int bpl, unsigned int padding, unsigned int lines); |
496 | 502 | ||
497 | extern int cx23885_risc_vbibuffer(struct pci_dev *pci, | 503 | extern int cx23885_risc_vbibuffer(struct pci_dev *pci, |
498 | struct btcx_riscmem *risc, struct scatterlist *sglist, | 504 | struct cx23885_riscmem *risc, struct scatterlist *sglist, |
499 | unsigned int top_offset, unsigned int bottom_offset, | 505 | unsigned int top_offset, unsigned int bottom_offset, |
500 | unsigned int bpl, unsigned int padding, unsigned int lines); | 506 | unsigned int bpl, unsigned int padding, unsigned int lines); |
501 | 507 | ||
@@ -595,7 +601,7 @@ extern struct cx23885_audio_dev *cx23885_audio_register( | |||
595 | extern void cx23885_audio_unregister(struct cx23885_dev *dev); | 601 | extern void cx23885_audio_unregister(struct cx23885_dev *dev); |
596 | extern int cx23885_audio_irq(struct cx23885_dev *dev, u32 status, u32 mask); | 602 | extern int cx23885_audio_irq(struct cx23885_dev *dev, u32 status, u32 mask); |
597 | extern int cx23885_risc_databuffer(struct pci_dev *pci, | 603 | extern int cx23885_risc_databuffer(struct pci_dev *pci, |
598 | struct btcx_riscmem *risc, | 604 | struct cx23885_riscmem *risc, |
599 | struct scatterlist *sglist, | 605 | struct scatterlist *sglist, |
600 | unsigned int bpl, | 606 | unsigned int bpl, |
601 | unsigned int lines, | 607 | unsigned int lines, |