aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/cx25821/cx25821-audio-upstream.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-04-30 08:01:04 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-04-30 08:01:04 -0400
commitdf90e2258950fd631cdbf322c1ee1f22068391aa (patch)
tree0b6dd2717c04bb7f93db6abdeda208aeea4cd74e /drivers/media/pci/cx25821/cx25821-audio-upstream.c
parentaad797c89903d570c17f6affc770eb98afd74e62 (diff)
parent02615ed5e1b2283db2495af3cf8f4ee172c77d80 (diff)
Merge branch 'devel-for-v3.10' into v4l_for_linus
* patchwork: (831 commits) [media] cx88: make core less verbose [media] em28xx: fix oops at em28xx_dvb_bus_ctrl() [media] s5c73m3: fix indentation of the help section in Kconfig [media] cx25821-alsa: get rid of a __must_check warning [media] cx25821-video: declare cx25821_vidioc_s_std as static [media] cx25821-video: remove maxw from cx25821_vidioc_try_fmt_vid_cap [media] r820t: Remove a warning for an unused value [media] dib0090: Fix a warning at dib0090_set_EFUSE [media] dib8000: fix a warning [media] dib8000: Fix sub-channel range [media] dib8000: store dtv_property_cache in a temp var [media] dib8000: warning fix: declare internal functions as static [media] r820t: quiet gcc warning on n_ring [media] r820t: memory leak in release() [media] r820t: precendence bug in r820t_xtal_check() [media] videodev2.h: Remove the unused old V4L1 buffer types [media] anysee: Grammar s/report the/report to/ [media] anysee: Initialize ret = 0 in anysee_frontend_attach() [media] media: videobuf2: fix the length check for mmap [media] em28xx: save isoc endpoint number for DVB only if endpoint has alt settings with xMaxPacketSize != 0 ... Conflicts: drivers/media/pci/cx25821/cx25821-video.c drivers/media/platform/Kconfig
Diffstat (limited to 'drivers/media/pci/cx25821/cx25821-audio-upstream.c')
-rw-r--r--drivers/media/pci/cx25821/cx25821-audio-upstream.c43
1 files changed, 17 insertions, 26 deletions
diff --git a/drivers/media/pci/cx25821/cx25821-audio-upstream.c b/drivers/media/pci/cx25821/cx25821-audio-upstream.c
index 87491ca05ee5..b9be535e32b8 100644
--- a/drivers/media/pci/cx25821/cx25821-audio-upstream.c
+++ b/drivers/media/pci/cx25821/cx25821-audio-upstream.c
@@ -45,7 +45,7 @@ static int _intr_msk = FLD_AUD_SRC_RISCI1 | FLD_AUD_SRC_OF |
45 FLD_AUD_SRC_SYNC | FLD_AUD_SRC_OPC_ERR; 45 FLD_AUD_SRC_SYNC | FLD_AUD_SRC_OPC_ERR;
46 46
47static int cx25821_sram_channel_setup_upstream_audio(struct cx25821_dev *dev, 47static int cx25821_sram_channel_setup_upstream_audio(struct cx25821_dev *dev,
48 struct sram_channel *ch, 48 const struct sram_channel *ch,
49 unsigned int bpl, u32 risc) 49 unsigned int bpl, u32 risc)
50{ 50{
51 unsigned int i, lines; 51 unsigned int i, lines;
@@ -106,7 +106,7 @@ static __le32 *cx25821_risc_field_upstream_audio(struct cx25821_dev *dev,
106 int fifo_enable) 106 int fifo_enable)
107{ 107{
108 unsigned int line; 108 unsigned int line;
109 struct sram_channel *sram_ch = 109 const struct sram_channel *sram_ch =
110 dev->channels[dev->_audio_upstream_channel].sram_channels; 110 dev->channels[dev->_audio_upstream_channel].sram_channels;
111 int offset = 0; 111 int offset = 0;
112 112
@@ -215,7 +215,7 @@ static void cx25821_free_memory_audio(struct cx25821_dev *dev)
215 215
216void cx25821_stop_upstream_audio(struct cx25821_dev *dev) 216void cx25821_stop_upstream_audio(struct cx25821_dev *dev)
217{ 217{
218 struct sram_channel *sram_ch = 218 const struct sram_channel *sram_ch =
219 dev->channels[AUDIO_UPSTREAM_SRAM_CHANNEL_B].sram_channels; 219 dev->channels[AUDIO_UPSTREAM_SRAM_CHANNEL_B].sram_channels;
220 u32 tmp = 0; 220 u32 tmp = 0;
221 221
@@ -257,7 +257,7 @@ void cx25821_free_mem_upstream_audio(struct cx25821_dev *dev)
257} 257}
258 258
259static int cx25821_get_audio_data(struct cx25821_dev *dev, 259static int cx25821_get_audio_data(struct cx25821_dev *dev,
260 struct sram_channel *sram_ch) 260 const struct sram_channel *sram_ch)
261{ 261{
262 struct file *myfile; 262 struct file *myfile;
263 int frame_index_temp = dev->_audioframe_index; 263 int frame_index_temp = dev->_audioframe_index;
@@ -352,7 +352,7 @@ static void cx25821_audioups_handler(struct work_struct *work)
352} 352}
353 353
354static int cx25821_openfile_audio(struct cx25821_dev *dev, 354static int cx25821_openfile_audio(struct cx25821_dev *dev,
355 struct sram_channel *sram_ch) 355 const struct sram_channel *sram_ch)
356{ 356{
357 struct file *myfile; 357 struct file *myfile;
358 int i = 0, j = 0; 358 int i = 0, j = 0;
@@ -433,7 +433,7 @@ static int cx25821_openfile_audio(struct cx25821_dev *dev,
433} 433}
434 434
435static int cx25821_audio_upstream_buffer_prepare(struct cx25821_dev *dev, 435static int cx25821_audio_upstream_buffer_prepare(struct cx25821_dev *dev,
436 struct sram_channel *sram_ch, 436 const struct sram_channel *sram_ch,
437 int bpl) 437 int bpl)
438{ 438{
439 int ret = 0; 439 int ret = 0;
@@ -495,7 +495,7 @@ static int cx25821_audio_upstream_irq(struct cx25821_dev *dev, int chan_num,
495{ 495{
496 int i = 0; 496 int i = 0;
497 u32 int_msk_tmp; 497 u32 int_msk_tmp;
498 struct sram_channel *channel = dev->channels[chan_num].sram_channels; 498 const struct sram_channel *channel = dev->channels[chan_num].sram_channels;
499 dma_addr_t risc_phys_jump_addr; 499 dma_addr_t risc_phys_jump_addr;
500 __le32 *rp; 500 __le32 *rp;
501 501
@@ -587,7 +587,7 @@ static irqreturn_t cx25821_upstream_irq_audio(int irq, void *dev_id)
587 struct cx25821_dev *dev = dev_id; 587 struct cx25821_dev *dev = dev_id;
588 u32 audio_status; 588 u32 audio_status;
589 int handled = 0; 589 int handled = 0;
590 struct sram_channel *sram_ch; 590 const struct sram_channel *sram_ch;
591 591
592 if (!dev) 592 if (!dev)
593 return -1; 593 return -1;
@@ -611,7 +611,7 @@ static irqreturn_t cx25821_upstream_irq_audio(int irq, void *dev_id)
611} 611}
612 612
613static void cx25821_wait_fifo_enable(struct cx25821_dev *dev, 613static void cx25821_wait_fifo_enable(struct cx25821_dev *dev,
614 struct sram_channel *sram_ch) 614 const struct sram_channel *sram_ch)
615{ 615{
616 int count = 0; 616 int count = 0;
617 u32 tmp; 617 u32 tmp;
@@ -635,7 +635,7 @@ static void cx25821_wait_fifo_enable(struct cx25821_dev *dev,
635} 635}
636 636
637static int cx25821_start_audio_dma_upstream(struct cx25821_dev *dev, 637static int cx25821_start_audio_dma_upstream(struct cx25821_dev *dev,
638 struct sram_channel *sram_ch) 638 const struct sram_channel *sram_ch)
639{ 639{
640 u32 tmp = 0; 640 u32 tmp = 0;
641 int err = 0; 641 int err = 0;
@@ -699,7 +699,7 @@ fail_irq:
699 699
700int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select) 700int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select)
701{ 701{
702 struct sram_channel *sram_ch; 702 const struct sram_channel *sram_ch;
703 int err = 0; 703 int err = 0;
704 704
705 if (dev->_audio_is_running) { 705 if (dev->_audio_is_running) {
@@ -728,26 +728,17 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select)
728 dev->_audio_lines_count = LINES_PER_AUDIO_BUFFER; 728 dev->_audio_lines_count = LINES_PER_AUDIO_BUFFER;
729 _line_size = AUDIO_LINE_SIZE; 729 _line_size = AUDIO_LINE_SIZE;
730 730
731 if (dev->input_audiofilename) { 731 if ((dev->input_audiofilename) &&
732 (strcmp(dev->input_audiofilename, "") != 0))
732 dev->_audiofilename = kstrdup(dev->input_audiofilename, 733 dev->_audiofilename = kstrdup(dev->input_audiofilename,
733 GFP_KERNEL); 734 GFP_KERNEL);
734 735 else
735 if (!dev->_audiofilename) {
736 err = -ENOMEM;
737 goto error;
738 }
739
740 /* Default if filename is empty string */
741 if (strcmp(dev->input_audiofilename, "") == 0)
742 dev->_audiofilename = "/root/audioGOOD.wav";
743 } else {
744 dev->_audiofilename = kstrdup(_defaultAudioName, 736 dev->_audiofilename = kstrdup(_defaultAudioName,
745 GFP_KERNEL); 737 GFP_KERNEL);
746 738
747 if (!dev->_audiofilename) { 739 if (!dev->_audiofilename) {
748 err = -ENOMEM; 740 err = -ENOMEM;
749 goto error; 741 goto error;
750 }
751 } 742 }
752 743
753 cx25821_sram_channel_setup_upstream_audio(dev, sram_ch, 744 cx25821_sram_channel_setup_upstream_audio(dev, sram_ch,