Thanks Vaibhav for answering,
So the files that i should edit are davinci-evm.c (platform driver?) and 
wm8782.c (codec driver), right?

I have a few questions :)

*What snd_soc_dai_link structure should i edit? *
(I choosed the da830_dai_link because that was the snd_soc_card struct 
loaded when the BB Audio cape was inserted, but which one should i edit?)
I also tried to write a new davinci-evm.c based on 
this<https://github.com/koalo/linux/blob/rpi-3.10.y-asoc/sound/soc/bcm/rpi-dac.c>
 file 
(from a kernel source for the raspberry pi), here is the code:
/*
 * ASoC Driver.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 */

#include <linux/module.h>
#include <linux/platform_device.h>

#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/jack.h>

static int evm_wm8782_init(struct snd_soc_pcm_runtime *rtd)
{
return 0;
}

static int evm_wm8782_hw_params(struct snd_pcm_substream *substream,
       struct snd_pcm_hw_params *params)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;

/*return snd_soc_dai_set_bclk_ratio(cpu_dai, 32*2);*/
return 0;
}

/* machine stream operations */
static struct snd_soc_ops evm_wm8782_ops = {
.hw_params = evm_wm8782_hw_params,
};

static struct snd_soc_dai_link evm_wm8782_dai[] = {
{
.name = "PCM1803 board",
.stream_name = "PCM1803 board",
.cpu_dai_name = "davinci-mcasp.0",
.codec_dai_name = "wm8782-hifi",
.platform_name = "davinci-pcm-audio",
.codec_name = "wm8782-codec.3-001b",
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBS_CFS,
.ops = &evm_wm8782_ops,
.init = evm_wm8782_init,
},
};

/* audio machine driver */
static struct snd_soc_card snd_wm8782_adc = {
.name         = "snd_wm8782_adc",
.dai_link     = evm_wm8782_dai,
.num_links    = ARRAY_SIZE(evm_wm8782_dai),
};

static int snd_wm8782_probe(struct platform_device *pdev)
{
int ret = 0;

snd_wm8782_adc.dev = &pdev->dev;
ret = snd_soc_register_card(&snd_wm8782_adc);
if (ret)
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ret);

return ret;
}

static int snd_wm8782_remove(struct platform_device *pdev)
{
return snd_soc_unregister_card(&snd_wm8782_adc);
}

static struct platform_driver snd_wm8782_driver = {
        .driver = {
                .name   = "snd-wm8782-adc",
                .owner  = THIS_MODULE,
        },
        .probe          = snd_wm8782_probe,
        .remove         = snd_wm8782_remove,
};

module_platform_driver(snd_wm8782_driver);

MODULE_AUTHOR("E.E.R");
MODULE_DESCRIPTION("ASoC Driver for pcm1803 ADC");
MODULE_LICENSE("GPL v2");

and the codec driver so far is this:


 * sound/soc/codecs/wm8782.c
 * simple, strap-pin configured 24bit 2ch ADC
 *
 * Copyright: 2011 Raumfeld GmbH
 * Author: Johannes Stezenbach <[email protected]>
 *
 * based on ad73311.c
 * Copyright: Analog Device Inc.
 * Author: Cliff Cai <[email protected]>
 *
 * This program is free software; you can redistribute  it and/or modify it
 * under  the terms of  the GNU General  Public License as published by the
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * option) any later version.
 */

#include <linux/init.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/ac97_codec.h>
#include <sound/initval.h>
#include <sound/soc.h>

static struct snd_soc_dai_driver wm8782_dai = {
.name = "wm8782-hifi",
.capture = {
.stream_name = "Capture",
.channels_min = 1,
.channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_192000,
.formats = SNDRV_PCM_FMTBIT_S16_LE |
   SNDRV_PCM_FMTBIT_S24_LE,
},
};

static struct snd_soc_codec_driver soc_codec_dev_wm8782;

static int wm8782_probe(struct platform_device *pdev)
{
return snd_soc_register_codec(&pdev->dev,
&soc_codec_dev_wm8782, &wm8782_dai, 1);
}

static int wm8782_remove(struct platform_device *pdev)
{
snd_soc_unregister_codec(&pdev->dev);
return 0;
}

static struct platform_driver wm8782_codec_driver = {
.driver = {
.name = "wm8782",
.owner = THIS_MODULE,
},
.probe = wm8782_probe,
.remove = wm8782_remove,
};

module_platform_driver(wm8782_codec_driver);

MODULE_DESCRIPTION("ASoC WM8782 driver");
MODULE_AUTHOR("Johannes Stezenbach <[email protected]>");
MODULE_LICENSE("GPL");


When you say "*You should be looking at the device tree files now*" you 
mean the .dts files?
BTW i'm running ubuntu with 3.8.13 kernel version.

Thanks again for your support!

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to