linux 4.1.36 中变化

1
ret = request_irq(IRQ_DMA2, s3c2440_dma2_irq, IRQF_DISABLED, "myalsa for playback", substream);

IRQF_DISABLED 换为 IRQF_TRIGGER_NONE

2
snd_soc_register_dai(&pdev->dev, &s3c2440_i2s_dai);
换为
static const struct snd_soc_component_driver s3c2440_i2s_component = {    
    .name = "s3c2440-iis",
};

ret = devm_snd_soc_register_component(&pdev->dev, &s3c2440_i2s_component, &s3c2440_i2s_dai, 1);

3

struct snd_soc_pcm_runtime *rtd

中没有 rtd->codec 成员。

4

snd_soc_dapm_new_widgets(dapm) 改为 dapm->card

5 devs.c 中没有 i2s 的配置  从 网上找到补丁, 结果还是不能使用。 先使用 ko 加载吧,也能使用,以后有空在编进内核。

#ifdef CONFIG_PLAT_S3C24XX
static struct resource s3c_iis_resource[] = {
    [0] = DEFINE_RES_MEM(S3C24XX_PA_IIS, S3C24XX_SZ_IIS),
};

static struct s3c_audio_pdata s3c_iis_platdata = {
    .dma_playback = (void *)DMACH_I2S_OUT,
    .dma_capture = (void *)DMACH_I2S_IN,
};

struct platform_device s3c_device_iis = {
    .name        = "s3c24xx-iis",
    .id        = -1,
    .num_resources    = ARRAY_SIZE(s3c_iis_resource),
    .resource    = s3c_iis_resource,
    .dev        = {
        .dma_mask        = &samsung_device_dma_mask,
        .coherent_dma_mask    = DMA_BIT_MASK(32),
        .platform_data = &s3c_iis_platdata,
    }
};

s3c24xx-i2s.c

添加头文件

//new add
#include <linux/platform_data/asoc-s3c.h>

static struct s3c_dma_params s3c24xx_i2s_pcm_stereo_out = {
    //.slave        = (void *)(uintptr_t)DMACH_I2S_OUT,
    .ch_name    = "tx",
    .dma_size    = 2,
};

static struct s3c_dma_params s3c24xx_i2s_pcm_stereo_in = {
    //.slave        = (void *)(uintptr_t)DMACH_I2S_IN,
    .ch_name    = "rx",
    .dma_size    = 2,
};

static int s3c24xx_iis_dev_probe(struct platform_device *pdev)
{
    int ret = 0;
    struct resource *res;
    //new add
    struct s3c_audio_pdata *pdata = dev_get_platdata(&pdev->dev);
    res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
    if (!res) {
        dev_err(&pdev->dev, "Can't get IO resource.\n");
        return -ENOENT;
    }
    s3c24xx_i2s.regs = devm_ioremap_resource(&pdev->dev, res);
    if (IS_ERR(s3c24xx_i2s.regs))
        return PTR_ERR(s3c24xx_i2s.regs);

s3c24xx_i2s_pcm_stereo_out.dma_addr = res->start + S3C2410_IISFIFO;
    s3c24xx_i2s_pcm_stereo_out.slave = pdata->dma_playback;
    s3c24xx_i2s_pcm_stereo_in.dma_addr = res->start + S3C2410_IISFIFO;
    s3c24xx_i2s_pcm_stereo_in.slave = pdata->dma_capture;

ret = devm_snd_soc_register_component(&pdev->dev,
            &s3c24xx_i2s_component, &s3c24xx_i2s_dai, 1);
    if (ret) {
        pr_err("failed to register the dai\n");
        return ret;
    }

ret = samsung_asoc_dma_platform_register(&pdev->dev);
    if (ret)
        pr_err("failed to register the dma: %d\n", ret);

return ret;
}

如果不配置就会出错

S3C24XX_UDA134X SoC Audio driver
soc-audio soc-audio: ASoC: machine S3C24XX_UDA134X should use snd_soc_register_card()
s3c24xx-iis s3c24xx-iis: Missing dma channel for stream: 0
s3c24xx-iis s3c24xx-iis: ASoC: pcm constructor failed: -22
soc-audio soc-audio: ASoC: can't create pcm UDA134X :-22
soc-audio soc-audio: ASoC: failed to instantiate card -22
soc-audio: probe of soc-audio failed with error -22

附上驱动成功的图

ALSA 声卡 驱动 linux 4.1.36 中变化的更多相关文章

  1. Linux ALSA声卡驱动之八:ASoC架构中的Platform

    1.  Platform驱动在ASoC中的作用 前面几章内容已经说过,ASoC被分为Machine,Platform和Codec三大部件,Platform驱动的主要作用是完成音频数据的管理,最终通过C ...

  2. Linux ALSA声卡驱动之七:ASoC架构中的Codec

    1.  Codec简介(ad/da) 在移动设备中,Codec的作用可以归结为4种,分别是: 对PCM等信号进行D/A转换,把数字的音频信号转换为模拟信号 对Mic.Linein或者其他输入源的模拟信 ...

  3. Linux ALSA声卡驱动之五:移动设备中的ALSA(ASoC)

    转自http://blog.csdn.net/droidphone/article/details/7165482 1.  ASoC的由来 ASoC--ALSA System on Chip ,是建立 ...

  4. Linux ALSA声卡驱动之六:ASoC架构中的Machine

    前面一节的内容我们提到,ASoC被分为Machine.Platform和Codec三大部分,其中的Machine驱动负责Platform和Codec之间的耦合以及部分和设备或板子特定的代码,再次引用上 ...

  5. 36、ALSA声卡驱动和应用

    (注意:内核上电的时候会把一些没运行的控制器模块的时钟都关掉,所有在写驱动的时候需要在使用的使用使用clk_get和clk_enable使能时钟) (说明:与ALSA声卡对应的是OSS架构,第二期视频 ...

  6. ALSA声卡驱动中的DAPM详解之四:在驱动程序中初始化并注册widget和route

    前几篇文章我们从dapm的数据结构入手,了解了代表音频控件的widget,代表连接路径的route以及用于连接两个widget的path.之前都是一些概念的讲解以及对数据结构中各个字段的说明,从本章开 ...

  7. ALSA声卡驱动中的DAPM详解之三:如何定义各种widget

    上一节中,介绍了DAPM框架中几个重要的数据结构:snd_soc_dapm_widget,snd_soc_dapm_path,snd_soc_dapm_route.其中snd_soc_dapm_pat ...

  8. Linux&nbsp;ALSA声卡驱动之一:ALS…

    声明:本博内容均由http://blog.csdn.net/droidphone原创,转载请注明出处,谢谢! 一.  概述 ALSA是Advanced Linux Sound Architecture ...

  9. ALSA声卡驱动中的DAPM详解之五:建立widget之间的连接关系

    前面我们主要着重于codec.platform.machine驱动程序中如何使用和建立dapm所需要的widget,route,这些是音频驱动开发人员必须要了解的内容,经过前几章的介绍,我们应该知道如 ...

随机推荐

  1. 59)PHP,管理员表中所存在的项

    用户ID 用户名 用户密码 用户权限(就是他的角色等级,比如是1级  2级,  三级等等) 上次登录的IP 上次登录的时间

  2. python掉包侠与深浅拷贝

    今日所得 包 logging模块 hashlib模块 openpyxl模块 深浅拷贝 包 在学习模块的时候我们了解过模块的四种表现形式,其中的一种就是包. 什么是包? 它是一系列模块文件的结合体,表示 ...

  3. HLS图像处理总结(一)

    HLS工具 以个人的理解,xilinx将HLS(高层次综合)定位于更方便的将复杂算法转化为硬件语言,通过添加某些配置条件HLS工具可以把可并行化的C/C++的代码转化为vhdl或verilog,相比于 ...

  4. UFT三种录制方式

    1.正常录制(Normal Recording) QTP默认的录制模式,这种录制模式是QTP最突出的特点,是直接对对象的操作,可以说此类模式继承了对象模型的所有优点,能够充分发挥对象库的威力.它通过识 ...

  5. miracle|

    N-COUNT 奇迹;出人意料的事If you say that a good event is a miracle, you mean that it is very surprising and ...

  6. leetcode 1.回文数-(easy)

    2019.7.11leetcode刷题 难度 easy 题目名称 回文数 题目摘要 判断一个整数是否是回文数.回文数是指正序(从左向右)和倒序(从右向左)读都是一样的整数. 思路 一些一定不为回文数的 ...

  7. 默认的Settings.xml文件(无修改过)-Maven

    Tip: 当什么都不作修改时,默认是从Maven中央仓库进行下载,https://repo.maven.apache.org/maven2. 打开maven源码下的lib文件夹,找到maven-mod ...

  8. TCP-IP-part7-IP协议相关技术(一)

    仅凭IP是无法完成通信的,需要一些IP的辅助技术.这些技术的包格式可能不一样,但它们都是基于IP地址进行的,都是通过匹配路由表来进行的,只是功能不一样.例如DHCP分配IP地址,它只管通知这条信息,具 ...

  9. Chrome 调试 react-native 通过Network面板查看网络请求

    参考 https://github.com/facebook/react-native/issues/934 三楼 真机或模拟器下 Debug JS Remotely, 会打开chrome,地址为ip ...

  10. http2.0与WebSocket的关系是怎么样的

    按照OSI网络分层模型,IP是网络层协议,TCP是传输层协议,而HTTP是应用层的协议.在这三者之间,SPDY和WebSocket都是与HTTP相关的协议,而TCP是HTTP底层的协议.WebSock ...