At Tue, 14 Aug 2012 22:50:06 -0700, Ian Minett wrote:
From: Ian Minett ian_minett@creativelabs.com
Thanks for the recent feedback - based on that we've updated the recent draft patch for adding the DSP loader to patch_ca0132.c :
- move DMA buffer management out (to be handled in hda_intel)
- add call to cleanup DMA
- change start/stop flag to boolean
If the changes look acceptable, do we have enough for us to get started on adding the DSP loader updates to patch_ca0132 (working with the 'from scratch' CA0132 as you suggested)?
Please let us know if you can think of anything else that needs to be worked out, or anything we need to provide for the bus op mods.
Any missing thing will be revealed later once when you start coding the DSP loader part in hda_intel.c :)
So now, as I suggested, start writing a code just loading the firmware DSP code based on the _bare_ upstream tree. That is, don't base on the already modified patch_ca0132.c or hda_intel.c. Write a patch that can be applied on the top of the current Linus tree, for example.
There shouldn't be any addition of controls, etc, at this point. Just do load the firmware. This is the very first start.
I can help debugging or give review / advise. But obviously you are at the better position start writing it since you have the test hardware and the firmware data, both of which are missing for other developers (including me).
Once when a draft patch is ready or you face to a problem, let me know.
thanks,
Takashi
Thanks very much, Ian
Signed-off-by: Ian Minett ian_minett@creativelabs.com
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index 45dce9c..0d07445 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c @@ -1979,22 +1979,22 @@ static int dma_convert_to_hda_format(
static int dma_set_state(struct dma_engine *dma, enum dma_state state) {
- int cmd;
bool cmd;
CA0132_LOG("dma_set_state state=%d\n", state);
switch (state) { case DMA_STATE_STOP:
cmd = SNDRV_PCM_TRIGGER_STOP;
break; case DMA_STATE_RUN:cmd = false;
cmd = SNDRV_PCM_TRIGGER_START;
break; default: return 0; }cmd = true;
- return load_dsp_trigger(dma->codec->bus, cmd);
- return snd_hda_codec_load_dsp_trigger(dma->codec, cmd);
}
static unsigned int dma_get_buffer_size(struct dma_engine *dma) @@ -2281,10 +2281,8 @@ static int dspxfr_image(struct hda_codec *codec, return -1;
dma_engine = kzalloc(sizeof(*dma_engine), GFP_KERNEL);
- if (!dma_engine) {
status = -ENOMEM;
goto exit;
- }
if (!dma_engine)
return -ENOMEM;
memset((void*)dma_engine, 0, sizeof(*dma_engine));
dma_engine->codec = codec;
@@ -2292,12 +2290,6 @@ static int dspxfr_image(struct hda_codec *codec, dma_engine->m_converter_format = hda_format; dma_engine->m_buffer_size = ovly ? DSP_DMA_WRITE_BUFLEN_OVLY : DSP_DMA_WRITE_BUFLEN_INIT;
dma_engine->m_buffer_addr = kzalloc(dma_engine->m_buffer_size,
GFP_KERNEL);
if (!dma_engine->m_buffer_addr) {
status = -ENOMEM;
goto exit;
}
dma_chan = 0; do {
@@ -2308,11 +2300,11 @@ static int dspxfr_image(struct hda_codec *codec, break; }
status = load_dsp_prepare(codec->bus,
dma_engine->m_converter_format,
dma_engine->m_buffer_addr,
dma_engine->m_buffer_size);
if (FAILED(status))
dma_engine->m_buffer_addr =
snd_hda_codec_load_dsp_prepare(codec,
dma_engine->m_converter_format,
dma_engine->m_buffer_size);
if (!dma_engine->m_buffer_addr) break;
if (ovly) {
@@ -2372,8 +2364,9 @@ static int dspxfr_image(struct hda_codec *codec, if (ovly && (dma_chan != INVALID_DMA_CHANNEL)) status = dspio_free_dma_chan(codec, dma_chan);
-exit:
- kfree(dma_engine->m_buffer_addr);
snd_hda_codec_load_dsp_cleanup(codec,
dma_engine->m_buffer_addr,
dma_engine->m_buffer_size);
kfree(dma_engine);
return status;
-- 1.7.4.1