1 From c72bc41d018519de5d63ec7790965fbf4605276a Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Tue, 3 Dec 2013 20:18:13 +0100
4 Subject: [PATCH] asoc: add mt7620 support
6 Signed-off-by: John Crispin <blogic@openwrt.org>
8 sound/soc/Kconfig | 1 +
9 sound/soc/Makefile | 1 +
10 sound/soc/ralink/Kconfig | 24 +++
11 sound/soc/ralink/Makefile | 13 ++
12 sound/soc/ralink/mt7620-i2s.c | 429 ++++++++++++++++++++++++++++++++++++++
13 sound/soc/ralink/mt7620-pcm.c | 77 +++++++
14 sound/soc/ralink/mt7620-wm8960.c | 124 +++++++++++
15 7 files changed, 669 insertions(+)
16 create mode 100644 sound/soc/ralink/Kconfig
17 create mode 100644 sound/soc/ralink/Makefile
18 create mode 100644 sound/soc/ralink/mt7620-i2s.c
19 create mode 100644 sound/soc/ralink/mt7620-pcm.c
20 create mode 100644 sound/soc/ralink/mt7620-wm8960.c
22 Index: linux-3.10.18/sound/soc/Kconfig
23 ===================================================================
24 --- linux-3.10.18.orig/sound/soc/Kconfig 2013-11-04 13:31:29.000000000 +0100
25 +++ linux-3.10.18/sound/soc/Kconfig 2013-12-04 17:52:32.884756569 +0100
27 source "sound/soc/mid-x86/Kconfig"
28 source "sound/soc/mxs/Kconfig"
29 source "sound/soc/pxa/Kconfig"
30 +source "sound/soc/ralink/Kconfig"
31 source "sound/soc/samsung/Kconfig"
32 source "sound/soc/s6000/Kconfig"
33 source "sound/soc/sh/Kconfig"
34 Index: linux-3.10.18/sound/soc/Makefile
35 ===================================================================
36 --- linux-3.10.18.orig/sound/soc/Makefile 2013-11-04 13:31:29.000000000 +0100
37 +++ linux-3.10.18/sound/soc/Makefile 2013-12-04 17:52:32.884756569 +0100
39 obj-$(CONFIG_SND_SOC) += omap/
40 obj-$(CONFIG_SND_SOC) += kirkwood/
41 obj-$(CONFIG_SND_SOC) += pxa/
42 +obj-$(CONFIG_SND_SOC) += ralink/
43 obj-$(CONFIG_SND_SOC) += samsung/
44 obj-$(CONFIG_SND_SOC) += s6000/
45 obj-$(CONFIG_SND_SOC) += sh/
46 Index: linux-3.10.18/sound/soc/ralink/Kconfig
47 ===================================================================
48 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
49 +++ linux-3.10.18/sound/soc/ralink/Kconfig 2013-12-04 17:52:32.884756569 +0100
51 +config SND_MT7620_SOC_I2S
52 + depends on SOC_MT7620 && SND_SOC
53 + select SND_SOC_GENERIC_DMAENGINE_PCM
54 + tristate "SoC Audio (I2S protocol) for Ralink MT7620 SoC"
56 + Say Y if you want to use I2S protocol and I2S codec on Ingenic MT7620
59 +config SND_MT7620_SOC_WM8960
60 + tristate "SoC Audio support for Ralink WM8960"
61 + select SND_MT7620_SOC_I2S
62 + select SND_SOC_WM8960
64 + Say Y if you want to add support for ASoC audio on the Qi LB60 board
65 + a.k.a Qi Ben NanoNote.
66 Index: linux-3.10.18/sound/soc/ralink/Makefile
67 ===================================================================
68 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
69 +++ linux-3.10.18/sound/soc/ralink/Makefile 2013-12-04 17:52:32.884756569 +0100
72 +# Jz4740 Platform Support
74 +snd-soc-mt7620-i2s-objs := mt7620-i2s.o
76 +obj-$(CONFIG_SND_MT7620_SOC_I2S) += snd-soc-mt7620-i2s.o
78 +# Jz4740 Machine Support
79 +snd-soc-mt7620-wm8960-objs := mt7620-wm8960.o
81 +obj-$(CONFIG_SND_MT7620_SOC_WM8960) += snd-soc-mt7620-wm8960.o
82 Index: linux-3.10.18/sound/soc/ralink/mt7620-i2s.c
83 ===================================================================
84 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
85 +++ linux-3.10.18/sound/soc/ralink/mt7620-i2s.c 2013-12-05 21:18:46.913130624 +0100
88 + * Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de>
90 + * This program is free software; you can redistribute it and/or modify it
91 + * under the terms of the GNU General Public License as published by the
92 + * Free Software Foundation; either version 2 of the License, or (at your
93 + * option) any later version.
95 + * You should have received a copy of the GNU General Public License along
96 + * with this program; if not, write to the Free Software Foundation, Inc.,
97 + * 675 Mass Ave, Cambridge, MA 02139, USA.
101 +#include <linux/init.h>
102 +#include <linux/io.h>
103 +#include <linux/kernel.h>
104 +#include <linux/module.h>
105 +#include <linux/platform_device.h>
106 +#include <linux/slab.h>
108 +#include <linux/delay.h>
110 +#include <linux/dma-mapping.h>
112 +#include <sound/core.h>
113 +#include <sound/pcm.h>
114 +#include <sound/pcm_params.h>
115 +#include <sound/soc.h>
116 +#include <sound/initval.h>
117 +#include <sound/dmaengine_pcm.h>
119 +#include <ralink_regs.h>
121 +#define I2S_REG_CFG0 0x00
122 +#define I2S_REG_CFG0_EN BIT(31)
123 +#define I2S_REG_CFG0_DMA_EN BIT(30)
124 +#define I2S_REG_CFG0_BYTE_SWAP BIT(28)
125 +#define I2S_REG_CFG0_TX_EN BIT(24)
126 +#define I2S_REG_CFG0_RX_EN BIT(20)
127 +#define I2S_REG_CFG0_SLAVE BIT(16)
128 +#define I2S_REG_CFG0_RX_THRES 12
129 +#define I2S_REG_CFG0_TX_THRES 4
130 +#define I2S_REG_CFG0_DFT_THRES (4 << I2S_REG_CFG0_RX_THRES) | \
131 + (4 << I2S_REG_CFG0_TX_THRES)
133 +#define I2S_REG_INT_STATUS 0x04
134 +#define I2S_REG_INT_EN 0x08
135 +#define I2S_REG_FF_STATUS 0x0c
136 +#define I2S_REG_WREG 0x10
137 +#define I2S_REG_RREG 0x14
138 +#define I2S_REG_CFG1 0x18
140 +#define I2S_REG_DIVCMP 0x20
141 +#define I2S_REG_DIVINT 0x24
142 +#define I2S_REG_CLK_EN BIT(31)
145 + struct resource *mem;
146 + void __iomem *base;
147 + dma_addr_t phys_base;
149 + struct snd_dmaengine_dai_dma_data playback_dma_data;
150 + struct snd_dmaengine_dai_dma_data capture_dma_data;
153 +static inline uint32_t mt7620_i2s_read(const struct mt7620_i2s *i2s,
156 + return readl(i2s->base + reg);
159 +static inline void mt7620_i2s_write(const struct mt7620_i2s *i2s,
160 + unsigned int reg, uint32_t value)
162 + //printk("i2s --> %p = 0x%08X\n", i2s->base + reg, value);
163 + writel(value, i2s->base + reg);
166 +static int mt7620_i2s_startup(struct snd_pcm_substream *substream,
167 + struct snd_soc_dai *dai)
169 + struct mt7620_i2s *i2s = snd_soc_dai_get_drvdata(dai);
175 + cfg = mt7620_i2s_read(i2s, I2S_REG_CFG0);
176 + cfg |= I2S_REG_CFG0_EN;
177 + mt7620_i2s_write(i2s, I2S_REG_CFG0, cfg);
182 +static void mt7620_i2s_shutdown(struct snd_pcm_substream *substream,
183 + struct snd_soc_dai *dai)
185 + struct mt7620_i2s *i2s = snd_soc_dai_get_drvdata(dai);
191 + cfg = mt7620_i2s_read(i2s, I2S_REG_CFG0);
192 + cfg &= ~I2S_REG_CFG0_EN;
193 + mt7620_i2s_write(i2s, I2S_REG_CFG0, cfg);
196 +static int mt7620_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
197 + struct snd_soc_dai *dai)
199 + struct mt7620_i2s *i2s = snd_soc_dai_get_drvdata(dai);
204 + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
205 + mask = I2S_REG_CFG0_TX_EN;
207 + mask = I2S_REG_CFG0_RX_EN;
209 + cfg = mt7620_i2s_read(i2s, I2S_REG_CFG0);
212 + case SNDRV_PCM_TRIGGER_START:
213 + case SNDRV_PCM_TRIGGER_RESUME:
214 + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
217 + case SNDRV_PCM_TRIGGER_STOP:
218 + case SNDRV_PCM_TRIGGER_SUSPEND:
219 + case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
226 + if (cfg & (I2S_REG_CFG0_TX_EN | I2S_REG_CFG0_RX_EN))
227 + cfg |= I2S_REG_CFG0_DMA_EN;
229 + cfg &= ~I2S_REG_CFG0_DMA_EN;
231 + mt7620_i2s_write(i2s, I2S_REG_CFG0, cfg);
236 +static int mt7620_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
238 + struct mt7620_i2s *i2s = snd_soc_dai_get_drvdata(dai);
241 + cfg = mt7620_i2s_read(i2s, I2S_REG_CFG0);
243 + switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
244 + case SND_SOC_DAIFMT_CBS_CFS:
245 + cfg |= I2S_REG_CFG0_SLAVE;
247 + case SND_SOC_DAIFMT_CBM_CFM:
248 + cfg &= ~I2S_REG_CFG0_SLAVE;
250 + case SND_SOC_DAIFMT_CBM_CFS:
255 + switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
256 + case SND_SOC_DAIFMT_I2S:
257 + case SND_SOC_DAIFMT_MSB:
258 + cfg &= ~I2S_REG_CFG0_BYTE_SWAP;
260 + case SND_SOC_DAIFMT_LSB:
261 + cfg |= I2S_REG_CFG0_BYTE_SWAP;
267 + switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
268 + case SND_SOC_DAIFMT_NB_NF:
274 + mt7620_i2s_write(i2s, I2S_REG_CFG0, cfg);
279 +static int mt7620_i2s_hw_params(struct snd_pcm_substream *substream,
280 + struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
286 +unsigned long i2sMaster_inclk_int[11] = {
287 + 78, 56, 52, 39, 28, 26, 19, 14, 13, 9, 6};
288 +unsigned long i2sMaster_inclk_comp[11] = {
289 + 64, 352, 42, 32, 176, 21, 272, 88, 10, 455, 261};
292 +static int mt7620_i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id,
293 + unsigned int freq, int dir)
295 + struct mt7620_i2s *i2s = snd_soc_dai_get_drvdata(dai);
297 + printk("Internal REFCLK with fractional division\n");
299 + mt7620_i2s_write(i2s, I2S_REG_DIVINT, i2sMaster_inclk_int[7]);
300 + mt7620_i2s_write(i2s, I2S_REG_DIVCMP,
301 + i2sMaster_inclk_comp[7] | I2S_REG_CLK_EN);
303 +/* struct mt7620_i2s *i2s = snd_soc_dai_get_drvdata(dai);
304 + struct clk *parent;
308 + case JZ4740_I2S_CLKSRC_EXT:
309 + parent = clk_get(NULL, "ext");
310 + clk_set_parent(i2s->clk_i2s, parent);
312 + case JZ4740_I2S_CLKSRC_PLL:
313 + parent = clk_get(NULL, "pll half");
314 + clk_set_parent(i2s->clk_i2s, parent);
315 + ret = clk_set_rate(i2s->clk_i2s, freq);
326 +static int mt7620_i2s_suspend(struct snd_soc_dai *dai)
328 + struct mt7620_i2s *i2s = snd_soc_dai_get_drvdata(dai);
332 + cfg = mt7620_i2s_read(i2s, I2S_REG_CFG0);
333 + cfg &= ~I2S_REG_CFG0_TX_EN;
334 + mt7620_i2s_write(i2s, I2S_REG_CFG0, cfg);
340 +static int mt7620_i2s_resume(struct snd_soc_dai *dai)
342 + struct mt7620_i2s *i2s = snd_soc_dai_get_drvdata(dai);
346 + cfg = mt7620_i2s_read(i2s, I2S_REG_CFG0);
347 + cfg |= I2S_REG_CFG0_TX_EN;
348 + mt7620_i2s_write(i2s, I2S_REG_CFG0, cfg);
354 +static void mt7620_i2c_init_pcm_config(struct mt7620_i2s *i2s)
356 + struct snd_dmaengine_dai_dma_data *dma_data;
359 + dma_data = &i2s->playback_dma_data;
360 + dma_data->maxburst = 16;
361 + dma_data->slave_id = 2; //JZ4740_DMA_TYPE_AIC_TRANSMIT;
362 + dma_data->addr = i2s->phys_base + I2S_REG_WREG;
365 + dma_data = &i2s->capture_dma_data;
366 + dma_data->maxburst = 16;
367 + dma_data->slave_id = 3; //JZ4740_DMA_TYPE_AIC_RECEIVE;
368 + dma_data->addr = i2s->phys_base + I2S_REG_RREG;
371 +static int mt7620_i2s_dai_probe(struct snd_soc_dai *dai)
373 + struct mt7620_i2s *i2s = snd_soc_dai_get_drvdata(dai);
376 + mt7620_i2c_init_pcm_config(i2s);
377 + dai->playback_dma_data = &i2s->playback_dma_data;
378 + dai->capture_dma_data = &i2s->capture_dma_data;
380 + /* set share pins to i2s/gpio mode and i2c mode */
381 + data = rt_sysc_r32(0x60);
382 + data &= 0xFFFFFFE2;
383 + data |= 0x00000018;
384 + rt_sysc_w32(data, 0x60);
386 + printk("Internal REFCLK with fractional division\n");
388 + mt7620_i2s_write(i2s, I2S_REG_CFG0, I2S_REG_CFG0_DFT_THRES);
389 + mt7620_i2s_write(i2s, I2S_REG_CFG1, 0);
390 + mt7620_i2s_write(i2s, I2S_REG_INT_EN, 0);
392 + mt7620_i2s_write(i2s, I2S_REG_DIVINT, i2sMaster_inclk_int[7]);
393 + mt7620_i2s_write(i2s, I2S_REG_DIVCMP,
394 + i2sMaster_inclk_comp[7] | I2S_REG_CLK_EN);
399 +static int mt7620_i2s_dai_remove(struct snd_soc_dai *dai)
404 +static const struct snd_soc_dai_ops mt7620_i2s_dai_ops = {
405 + .startup = mt7620_i2s_startup,
406 + .shutdown = mt7620_i2s_shutdown,
407 + .trigger = mt7620_i2s_trigger,
408 + .hw_params = mt7620_i2s_hw_params,
409 + .set_fmt = mt7620_i2s_set_fmt,
410 + .set_sysclk = mt7620_i2s_set_sysclk,
413 +#define JZ4740_I2S_FMTS (SNDRV_PCM_FMTBIT_S8 | \
414 + SNDRV_PCM_FMTBIT_S16_LE)
416 +static struct snd_soc_dai_driver mt7620_i2s_dai = {
417 + .probe = mt7620_i2s_dai_probe,
418 + .remove = mt7620_i2s_dai_remove,
422 + .rates = SNDRV_PCM_RATE_8000_48000,
423 + .formats = JZ4740_I2S_FMTS,
428 + .rates = SNDRV_PCM_RATE_8000_48000,
429 + .formats = JZ4740_I2S_FMTS,
431 + .symmetric_rates = 1,
432 + .ops = &mt7620_i2s_dai_ops,
433 + .suspend = mt7620_i2s_suspend,
434 + .resume = mt7620_i2s_resume,
437 +static const struct snd_pcm_hardware mt7620_pcm_hardware = {
438 + .info = SNDRV_PCM_INFO_MMAP |
439 + SNDRV_PCM_INFO_MMAP_VALID |
440 + SNDRV_PCM_INFO_INTERLEAVED |
441 + SNDRV_PCM_INFO_BLOCK_TRANSFER,
442 + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8,
443 + .period_bytes_min = PAGE_SIZE,
444 + .period_bytes_max = 64 * 1024,
446 + .periods_max = 128,
447 + .buffer_bytes_max = 128 * 1024,
451 +static const struct snd_dmaengine_pcm_config mt7620_dmaengine_pcm_config = {
452 + .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
453 + .pcm_hardware = &mt7620_pcm_hardware,
454 + .prealloc_buffer_size = 256 * PAGE_SIZE,
457 +static const struct snd_soc_component_driver mt7620_i2s_component = {
458 + .name = "mt7620-i2s",
461 +static int mt7620_i2s_dev_probe(struct platform_device *pdev)
463 + struct mt7620_i2s *i2s;
466 + snd_dmaengine_pcm_register(&pdev->dev,
467 + &mt7620_dmaengine_pcm_config,
468 + SND_DMAENGINE_PCM_FLAG_COMPAT);
470 + i2s = kzalloc(sizeof(*i2s), GFP_KERNEL);
474 + i2s->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
480 + i2s->mem = request_mem_region(i2s->mem->start, resource_size(i2s->mem),
487 + i2s->base = ioremap_nocache(i2s->mem->start, resource_size(i2s->mem));
490 + goto err_release_mem_region;
493 + i2s->phys_base = i2s->mem->start;
495 + platform_set_drvdata(pdev, i2s);
496 + ret = snd_soc_register_component(&pdev->dev, &mt7620_i2s_component,
497 + &mt7620_i2s_dai, 1);
500 + dev_err(&pdev->dev, "loaded\n");
504 + dev_err(&pdev->dev, "Failed to register DAI\n");
505 + iounmap(i2s->base);
507 +err_release_mem_region:
508 + release_mem_region(i2s->mem->start, resource_size(i2s->mem));
515 +static int mt7620_i2s_dev_remove(struct platform_device *pdev)
517 + struct mt7620_i2s *i2s = platform_get_drvdata(pdev);
519 + snd_soc_unregister_component(&pdev->dev);
521 + iounmap(i2s->base);
522 + release_mem_region(i2s->mem->start, resource_size(i2s->mem));
526 + snd_dmaengine_pcm_unregister(&pdev->dev);
531 +static const struct of_device_id mt7620_i2s_match[] = {
532 + { .compatible = "ralink,mt7620a-i2s" },
535 +MODULE_DEVICE_TABLE(of, mt7620_i2s_match);
537 +static struct platform_driver mt7620_i2s_driver = {
538 + .probe = mt7620_i2s_dev_probe,
539 + .remove = mt7620_i2s_dev_remove,
541 + .name = "mt7620-i2s",
542 + .owner = THIS_MODULE,
543 + .of_match_table = mt7620_i2s_match,
547 +module_platform_driver(mt7620_i2s_driver);
549 +MODULE_AUTHOR("Lars-Peter Clausen, <lars@metafoo.de>");
550 +MODULE_DESCRIPTION("Ingenic JZ4740 SoC I2S driver");
551 +MODULE_LICENSE("GPL");
552 +MODULE_ALIAS("platform:mt7620-i2s");
553 Index: linux-3.10.18/sound/soc/ralink/mt7620-wm8960.c
554 ===================================================================
555 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
556 +++ linux-3.10.18/sound/soc/ralink/mt7620-wm8960.c 2013-12-04 17:52:32.884756569 +0100
559 + * Copyright (C) 2009, Lars-Peter Clausen <lars@metafoo.de>
561 + * This program is free software; you can redistribute it and/or modify
562 + * it under the terms of the GNU General Public License version 2 as
563 + * published by the Free Software Foundation.
565 + * You should have received a copy of the GNU General Public License along
566 + * with this program; if not, write to the Free Software Foundation, Inc.,
567 + * 675 Mass Ave, Cambridge, MA 02139, USA.
571 +#include <linux/module.h>
572 +#include <linux/moduleparam.h>
573 +#include <linux/of.h>
574 +#include <linux/timer.h>
575 +#include <linux/interrupt.h>
576 +#include <linux/platform_device.h>
577 +#include <sound/core.h>
578 +#include <sound/pcm.h>
579 +#include <sound/soc.h>
582 +static const struct snd_soc_dapm_widget mt7620_wm8960_widgets[] = {
583 + SND_SOC_DAPM_SPK("Speaker", NULL),
586 +static const struct snd_soc_dapm_route mt7620_wm8960_routes[] = {
587 + {"Speaker", NULL, "HP_L"},
588 + {"Speaker", NULL, "HP_R"},
591 +#define MT7620_DAIFMT (SND_SOC_DAIFMT_I2S | \
592 + SND_SOC_DAIFMT_NB_NF | \
593 + SND_SOC_DAIFMT_CBM_CFM)
595 +static int mt7620_wm8960_codec_init(struct snd_soc_pcm_runtime *rtd)
597 + struct snd_soc_codec *codec = rtd->codec;
598 + struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
599 + struct snd_soc_dapm_context *dapm = &codec->dapm;
602 + snd_soc_dapm_enable_pin(dapm, "HP_L");
603 + snd_soc_dapm_enable_pin(dapm, "HP_R");
605 + ret = snd_soc_dai_set_fmt(cpu_dai, MT7620_DAIFMT);
607 + dev_err(codec->dev, "Failed to set cpu dai format: %d\n", ret);
614 +static struct snd_soc_dai_link mt7620_wm8960_dai = {
616 + .stream_name = "mt7620",
617 + .init = mt7620_wm8960_codec_init,
618 + .codec_dai_name = "wm8960-hifi",
621 +static struct snd_soc_card mt7620_wm8960 = {
622 + .name = "mt7620-wm8960",
623 + .owner = THIS_MODULE,
624 + .dai_link = &mt7620_wm8960_dai,
627 + .dapm_widgets = mt7620_wm8960_widgets,
628 + .num_dapm_widgets = ARRAY_SIZE(mt7620_wm8960_widgets),
629 + .dapm_routes = mt7620_wm8960_routes,
630 + .num_dapm_routes = ARRAY_SIZE(mt7620_wm8960_routes),
633 +static int mt7620_wm8960_probe(struct platform_device *pdev)
635 + struct device_node *np = pdev->dev.of_node;
636 + struct snd_soc_card *card = &mt7620_wm8960;
639 + card->dev = &pdev->dev;
641 + mt7620_wm8960_dai.cpu_of_node = of_parse_phandle(np, "cpu-dai", 0);
642 + mt7620_wm8960_dai.codec_of_node = of_parse_phandle(np, "codec-dai", 0);
643 + mt7620_wm8960_dai.platform_of_node = mt7620_wm8960_dai.cpu_of_node;
645 + ret = snd_soc_register_card(card);
647 + dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
653 +static int mt7620_wm8960_remove(struct platform_device *pdev)
655 + struct snd_soc_card *card = platform_get_drvdata(pdev);
657 + snd_soc_unregister_card(card);
661 +static const struct of_device_id mt7620_audio_match[] = {
662 + { .compatible = "ralink,wm8960-audio" },
665 +MODULE_DEVICE_TABLE(of, mt7620_audio_match);
667 +static struct platform_driver mt7620_wm8960_driver = {
669 + .name = "wm8960-audio",
670 + .owner = THIS_MODULE,
671 + .of_match_table = mt7620_audio_match,
673 + .probe = mt7620_wm8960_probe,
674 + .remove = mt7620_wm8960_remove,
677 +module_platform_driver(mt7620_wm8960_driver);
679 +MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
680 +MODULE_DESCRIPTION("ALSA SoC QI LB60 Audio support");
681 +MODULE_LICENSE("GPL v2");
682 +MODULE_ALIAS("platform:qi-lb60-audio");
683 Index: linux-3.10.18/arch/mips/ralink/of.c
684 ===================================================================
685 --- linux-3.10.18.orig/arch/mips/ralink/of.c 2013-12-04 17:52:32.736756565 +0100
686 +++ linux-3.10.18/arch/mips/ralink/of.c 2013-12-04 17:52:32.884756569 +0100
688 #include <linux/of_fdt.h>
689 #include <linux/kernel.h>
690 #include <linux/bootmem.h>
691 +#include <linux/module.h>
692 #include <linux/of_platform.h>
693 #include <linux/of_address.h>
698 __iomem void *rt_sysc_membase;
699 +EXPORT_SYMBOL(rt_sysc_membase);
700 __iomem void *rt_memc_membase;
702 extern struct boot_param_header __dtb_start;
703 Index: linux-3.10.18/sound/soc/soc-io.c
704 ===================================================================
705 --- linux-3.10.18.orig/sound/soc/soc-io.c 2013-11-04 13:31:29.000000000 +0100
706 +++ linux-3.10.18/sound/soc/soc-io.c 2013-12-04 17:52:32.888756569 +0100
709 #include <trace/events/asoc.h>
711 -#ifdef CONFIG_REGMAP
712 static int hw_write(struct snd_soc_codec *codec, unsigned int reg,
716 return PTR_RET(codec->control_data);
718 EXPORT_SYMBOL_GPL(snd_soc_codec_set_cache_io);
720 -int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
721 - int addr_bits, int data_bits,
722 - enum snd_soc_control_type control)
726 -EXPORT_SYMBOL_GPL(snd_soc_codec_set_cache_io);