* snd-soc - platform_device_add failed
@ 2010-11-13 12:38 Vaclav Peroutka
0 siblings, 0 replies; only message in thread
From: Vaclav Peroutka @ 2010-11-13 12:38 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 612 bytes --]
Hello,
I am trying to create alsa driver for MAX9880 which is connected to
S3C6410. I "copied" the initialization code from other examples in
sound/soc/ but during initialization I am getting "platform_device_add
failed". I attached the code for kernel 2.6.29, ALSA 1.0.18a. For me
it does not have anything which can fail. But I never wrote drivers
for ALSA.
I have another question. In the kernel code sound/soc/s3c_64xx/, there
is a plenty of s3c_i2s files. Different versions but no description,
which version should I use. Does anybody know, which one is the right
version ?
Thank you in advance,
Vaclav
[-- Attachment #2: s3c6410-max9880.c --]
[-- Type: text/x-csrc, Size: 2803 bytes --]
/*
* Samsung S8000 Jet Audio Subsystem
*
* (c) 2010 Vaclav Peroutka - vaclavpe@gmail.com
*
* Licensed under the GPLv2.
*
* Revision history
* 2010/11/11 Initial version
*
*/
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/timer.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/i2c.h>
#include <linux/delay.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <asm/mach-types.h>
#include <asm/hardware/scoop.h>
#include <asm/io.h>
#include <mach/hardware.h>
#include <mach/audio.h>
#include <mach/map.h>
#include <plat/gpio-cfg.h>
#include <plat/regs-gpio.h>
#include <plat/regs-iic.h>
#include <plat/regs-clock.h>
#include <plat/regs-iis.h>
#include "s3c-pcm.h"
#include "s3c6410-i2s.h"
#include "../codecs/max9880.h"
#define SUBJECT "Jet_max9880"
static struct max9880_setup_data max9880_setup = {
.i2c_address = (0x20 >> 1),
};
static struct snd_soc_dai_link s3c6410_max9880_dai = {
.name = "MAX9880",
.stream_name = "MAX9880 Codec",
.cpu_dai = &s3c_i2s_dai,
.codec_dai = &max9880_dai,
.init = NULL,
.ops = NULL,
};
static struct snd_soc_card s3c6410_max9880_soc_card = {
.name = "S3C6410 MAX9880",
.platform = &s3c24xx_soc_platform,
.dai_link = &s3c6410_max9880_dai,
.num_links = 1,
};
static struct snd_soc_device s3c6410_max9880_snd_devdata = {
.card = &s3c6410_max9880_soc_card,
.codec_dev = &soc_codec_dev_max9880,
.codec_data = &max9880_setup,
};
static struct platform_device *s3c6410_max9880_snd_device;
static int __init s3c6410_max9880_init(void)
{
int ret;
printk("[%s]", __FUNCTION__);
s3c6410_max9880_snd_device = platform_device_alloc("soc-audio", -1);
if (!s3c6410_max9880_snd_device)
{
printk(" - soc-audio create fail \n");
return -ENOMEM;
}
printk("[%s] platform_set_drvdata \n",__FUNCTION__);
platform_set_drvdata( s3c6410_max9880_snd_device, &s3c6410_max9880_snd_devdata);
s3c6410_max9880_snd_devdata.dev = &s3c6410_max9880_snd_device->dev;
ret = platform_device_add( s3c6410_max9880_snd_device);
if (ret) {
platform_device_put( s3c6410_max9880_snd_device);
printk("[s3c6410_max9880] init passed \n");
} else {
printk("[s3c6410_max9880] platform_device_add fail \n");
}
return ret;
}
static void __exit s3c6410_max9880_exit(void)
{
platform_device_unregister(s3c6410_max9880_snd_device);
}
module_init(s3c6410_max9880_init);
module_exit(s3c6410_max9880_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Samsung S8000 Jet Audio Subsystem");
MODULE_AUTHOR("Vaclav Peroutka <vaclavpe@gmail.com>");
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-11-13 12:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-13 12:38 snd-soc - platform_device_add failed Vaclav Peroutka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).