2 * siu_dai.c - ALSA SoC driver for Renesas SH7343, SH7722 SIU peripheral.
4 * Copyright (C) 2009-2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
5 * Copyright (C) 2006 Carlos Munoz <carlos@kenati.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include <linux/delay.h>
23 #include <linux/firmware.h>
24 #include <linux/pm_runtime.h>
25 #include <linux/slab.h>
27 #include <asm/clock.h>
30 #include <sound/control.h>
31 #include <sound/soc.h>
36 #if defined(CONFIG_CPU_SUBTYPE_SH7722)
37 # define SIU_MAX_VOLUME 0x1000
39 # define SIU_MAX_VOLUME 0x7fff
42 #define PRAM_SIZE 0x2000
43 #define XRAM_SIZE 0x800
44 #define YRAM_SIZE 0x800
46 #define XRAM_OFFSET 0x4000
47 #define YRAM_OFFSET 0x6000
48 #define REG_OFFSET 0xc000
50 #define PLAYBACK_ENABLED 1
51 #define CAPTURE_ENABLED 2
53 #define VOLUME_CAPTURE 0
54 #define VOLUME_PLAYBACK 1
55 #define DFLT_VOLUME_LEVEL 0x08000800
58 * SPDIF is only available on port A and on some SIU implementations it is only
59 * available for input. Due to the lack of hardware to test it, SPDIF is left
60 * disabled in this driver version
70 struct format_flag playback
;
71 struct format_flag capture
;
74 struct siu_info
*siu_i2s_data
;
76 static struct port_flag siu_flags
[SIU_PORT_NUM
] = {
81 .spdif
= 0x80000000, /* not on all SIU versions */
95 .spdif
= 0, /* impossible - turn off */
101 .spdif
= 0, /* impossible - turn off */
107 static void siu_dai_start(struct siu_port
*port_info
)
109 struct siu_info
*info
= siu_i2s_data
;
110 u32 __iomem
*base
= info
->reg
;
112 dev_dbg(port_info
->pcm
->card
->dev
, "%s\n", __func__
);
114 /* Turn on SIU clock */
115 pm_runtime_get_sync(info
->dev
);
117 /* Issue software reset to siu */
118 siu_write32(base
+ SIU_SRCTL
, 0);
120 /* Wait for the reset to take effect */
123 port_info
->stfifo
= 0;
124 port_info
->trdat
= 0;
126 /* portA, portB, SIU operate */
127 siu_write32(base
+ SIU_SRCTL
, 0x301);
129 /* portA=256fs, portB=256fs */
130 siu_write32(base
+ SIU_CKCTL
, 0x40400000);
132 /* portA's BRG does not divide SIUCKA */
133 siu_write32(base
+ SIU_BRGASEL
, 0);
134 siu_write32(base
+ SIU_BRRA
, 0);
136 /* portB's BRG divides SIUCKB by half */
137 siu_write32(base
+ SIU_BRGBSEL
, 1);
138 siu_write32(base
+ SIU_BRRB
, 0);
140 siu_write32(base
+ SIU_IFCTL
, 0x44440000);
142 /* portA: 32 bit/fs, master; portB: 32 bit/fs, master */
143 siu_write32(base
+ SIU_SFORM
, 0x0c0c0000);
146 * Volume levels: looks like the DSP firmware implements volume controls
147 * differently from what's described in the datasheet
149 siu_write32(base
+ SIU_SBDVCA
, port_info
->playback
.volume
);
150 siu_write32(base
+ SIU_SBDVCB
, port_info
->capture
.volume
);
153 static void siu_dai_stop(struct siu_port
*port_info
)
155 struct siu_info
*info
= siu_i2s_data
;
156 u32 __iomem
*base
= info
->reg
;
158 /* SIU software reset */
159 siu_write32(base
+ SIU_SRCTL
, 0);
161 /* Turn off SIU clock */
162 pm_runtime_put_sync(info
->dev
);
165 static void siu_dai_spbAselect(struct siu_port
*port_info
)
167 struct siu_info
*info
= siu_i2s_data
;
168 struct siu_firmware
*fw
= &info
->fw
;
169 u32
*ydef
= fw
->yram0
;
178 ydef
[0] = (fw
->spbpar
[idx
].ab1a
<< 16) |
179 (fw
->spbpar
[idx
].ab0a
<< 8) |
180 (fw
->spbpar
[idx
].dir
<< 7) | 3;
181 ydef
[1] = fw
->yram0
[1]; /* 0x03000300 */
182 ydef
[2] = (16 / 2) << 24;
183 ydef
[3] = fw
->yram0
[3]; /* 0 */
184 ydef
[4] = fw
->yram0
[4]; /* 0 */
185 ydef
[7] = fw
->spbpar
[idx
].event
;
186 port_info
->stfifo
|= fw
->spbpar
[idx
].stfifo
;
187 port_info
->trdat
|= fw
->spbpar
[idx
].trdat
;
190 static void siu_dai_spbBselect(struct siu_port
*port_info
)
192 struct siu_info
*info
= siu_i2s_data
;
193 struct siu_firmware
*fw
= &info
->fw
;
194 u32
*ydef
= fw
->yram0
;
203 ydef
[5] = (fw
->spbpar
[idx
].ab1a
<< 16) |
204 (fw
->spbpar
[idx
].ab0a
<< 8) | 1;
205 ydef
[6] = fw
->spbpar
[idx
].event
;
206 port_info
->stfifo
|= fw
->spbpar
[idx
].stfifo
;
207 port_info
->trdat
|= fw
->spbpar
[idx
].trdat
;
210 static void siu_dai_open(struct siu_stream
*siu_stream
)
212 struct siu_info
*info
= siu_i2s_data
;
213 u32 __iomem
*base
= info
->reg
;
216 srctl
= siu_read32(base
+ SIU_SRCTL
);
217 ifctl
= siu_read32(base
+ SIU_IFCTL
);
219 switch (info
->port_id
) {
232 siu_write32(base
+ SIU_SRCTL
, srctl
);
233 /* Unmute and configure portA */
234 siu_write32(base
+ SIU_IFCTL
, ifctl
);
238 * At the moment only fixed Left-upper, Left-lower, Right-upper, Right-lower
239 * packing is supported
241 static void siu_dai_pcmdatapack(struct siu_stream
*siu_stream
)
243 struct siu_info
*info
= siu_i2s_data
;
244 u32 __iomem
*base
= info
->reg
;
247 dpak
= siu_read32(base
+ SIU_DPAK
);
249 switch (info
->port_id
) {
258 siu_write32(base
+ SIU_DPAK
, dpak
);
261 static int siu_dai_spbstart(struct siu_port
*port_info
)
263 struct siu_info
*info
= siu_i2s_data
;
264 u32 __iomem
*base
= info
->reg
;
265 struct siu_firmware
*fw
= &info
->fw
;
266 u32
*ydef
= fw
->yram0
;
271 /* Load SPB Program in PRAM */
274 for (cnt
= 0; cnt
< PRAM0_SIZE
; cnt
++, add
++, ptr
++)
275 siu_write32(add
, *ptr
);
278 add
= info
->pram
+ (0x0100 / sizeof(u32
));
279 for (cnt
= 0; cnt
< PRAM1_SIZE
; cnt
++, add
++, ptr
++)
280 siu_write32(add
, *ptr
);
282 /* XRAM initialization */
284 for (cnt
= 0; cnt
< XRAM0_SIZE
+ XRAM1_SIZE
+ XRAM2_SIZE
; cnt
++, add
++)
287 /* YRAM variable area initialization */
289 for (cnt
= 0; cnt
< YRAM_DEF_SIZE
; cnt
++, add
++)
290 siu_write32(add
, ydef
[cnt
]);
292 /* YRAM FIR coefficient area initialization */
293 add
= info
->yram
+ (0x0200 / sizeof(u32
));
294 for (cnt
= 0; cnt
< YRAM_FIR_SIZE
; cnt
++, add
++)
295 siu_write32(add
, fw
->yram_fir_coeff
[cnt
]);
297 /* YRAM IIR coefficient area initialization */
298 add
= info
->yram
+ (0x0600 / sizeof(u32
));
299 for (cnt
= 0; cnt
< YRAM_IIR_SIZE
; cnt
++, add
++)
302 siu_write32(base
+ SIU_TRDAT
, port_info
->trdat
);
303 port_info
->trdat
= 0x0;
306 /* SPB start condition: software */
307 siu_write32(base
+ SIU_SBACTIV
, 0);
309 siu_write32(base
+ SIU_SBCTL
, 0xc0000000);
310 /* Wait for program to halt */
312 while (--cnt
&& siu_read32(base
+ SIU_SBCTL
) != 0x80000000)
318 /* SPB program start address setting */
319 siu_write32(base
+ SIU_SBPSET
, 0x00400000);
320 /* SPB hardware start(FIFOCTL source) */
321 siu_write32(base
+ SIU_SBACTIV
, 0xc0000000);
326 static void siu_dai_spbstop(struct siu_port
*port_info
)
328 struct siu_info
*info
= siu_i2s_data
;
329 u32 __iomem
*base
= info
->reg
;
331 siu_write32(base
+ SIU_SBACTIV
, 0);
333 siu_write32(base
+ SIU_SBCTL
, 0);
335 port_info
->stfifo
= 0;
340 /* Playback and capture hardware properties are identical */
341 static struct snd_pcm_hardware siu_dai_pcm_hw
= {
342 .info
= SNDRV_PCM_INFO_INTERLEAVED
,
343 .formats
= SNDRV_PCM_FMTBIT_S16
,
344 .rates
= SNDRV_PCM_RATE_8000_48000
,
349 .buffer_bytes_max
= SIU_BUFFER_BYTES_MAX
,
350 .period_bytes_min
= SIU_PERIOD_BYTES_MIN
,
351 .period_bytes_max
= SIU_PERIOD_BYTES_MAX
,
352 .periods_min
= SIU_PERIODS_MIN
,
353 .periods_max
= SIU_PERIODS_MAX
,
356 static int siu_dai_info_volume(struct snd_kcontrol
*kctrl
,
357 struct snd_ctl_elem_info
*uinfo
)
359 struct siu_port
*port_info
= snd_kcontrol_chip(kctrl
);
361 dev_dbg(port_info
->pcm
->card
->dev
, "%s\n", __func__
);
363 uinfo
->type
= SNDRV_CTL_ELEM_TYPE_INTEGER
;
365 uinfo
->value
.integer
.min
= 0;
366 uinfo
->value
.integer
.max
= SIU_MAX_VOLUME
;
371 static int siu_dai_get_volume(struct snd_kcontrol
*kctrl
,
372 struct snd_ctl_elem_value
*ucontrol
)
374 struct siu_port
*port_info
= snd_kcontrol_chip(kctrl
);
375 struct device
*dev
= port_info
->pcm
->card
->dev
;
378 dev_dbg(dev
, "%s\n", __func__
);
380 switch (kctrl
->private_value
) {
381 case VOLUME_PLAYBACK
:
382 /* Playback is always on port 0 */
383 vol
= port_info
->playback
.volume
;
384 ucontrol
->value
.integer
.value
[0] = vol
& 0xffff;
385 ucontrol
->value
.integer
.value
[1] = vol
>> 16 & 0xffff;
388 /* Capture is always on port 1 */
389 vol
= port_info
->capture
.volume
;
390 ucontrol
->value
.integer
.value
[0] = vol
& 0xffff;
391 ucontrol
->value
.integer
.value
[1] = vol
>> 16 & 0xffff;
394 dev_err(dev
, "%s() invalid private_value=%ld\n",
395 __func__
, kctrl
->private_value
);
402 static int siu_dai_put_volume(struct snd_kcontrol
*kctrl
,
403 struct snd_ctl_elem_value
*ucontrol
)
405 struct siu_port
*port_info
= snd_kcontrol_chip(kctrl
);
406 struct device
*dev
= port_info
->pcm
->card
->dev
;
407 struct siu_info
*info
= siu_i2s_data
;
408 u32 __iomem
*base
= info
->reg
;
412 dev_dbg(dev
, "%s\n", __func__
);
414 if (ucontrol
->value
.integer
.value
[0] < 0 ||
415 ucontrol
->value
.integer
.value
[0] > SIU_MAX_VOLUME
||
416 ucontrol
->value
.integer
.value
[1] < 0 ||
417 ucontrol
->value
.integer
.value
[1] > SIU_MAX_VOLUME
)
420 new_vol
= ucontrol
->value
.integer
.value
[0] |
421 ucontrol
->value
.integer
.value
[1] << 16;
423 /* See comment above - DSP firmware implementation */
424 switch (kctrl
->private_value
) {
425 case VOLUME_PLAYBACK
:
426 /* Playback is always on port 0 */
427 cur_vol
= port_info
->playback
.volume
;
428 siu_write32(base
+ SIU_SBDVCA
, new_vol
);
429 port_info
->playback
.volume
= new_vol
;
432 /* Capture is always on port 1 */
433 cur_vol
= port_info
->capture
.volume
;
434 siu_write32(base
+ SIU_SBDVCB
, new_vol
);
435 port_info
->capture
.volume
= new_vol
;
438 dev_err(dev
, "%s() invalid private_value=%ld\n",
439 __func__
, kctrl
->private_value
);
443 if (cur_vol
!= new_vol
)
449 static struct snd_kcontrol_new playback_controls
= {
450 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
451 .name
= "PCM Playback Volume",
453 .info
= siu_dai_info_volume
,
454 .get
= siu_dai_get_volume
,
455 .put
= siu_dai_put_volume
,
456 .private_value
= VOLUME_PLAYBACK
,
459 static struct snd_kcontrol_new capture_controls
= {
460 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
461 .name
= "PCM Capture Volume",
463 .info
= siu_dai_info_volume
,
464 .get
= siu_dai_get_volume
,
465 .put
= siu_dai_put_volume
,
466 .private_value
= VOLUME_CAPTURE
,
469 int siu_init_port(int port
, struct siu_port
**port_info
, struct snd_card
*card
)
471 struct device
*dev
= card
->dev
;
472 struct snd_kcontrol
*kctrl
;
475 *port_info
= kzalloc(sizeof(**port_info
), GFP_KERNEL
);
479 dev_dbg(dev
, "%s: port #%d@%p\n", __func__
, port
, *port_info
);
481 (*port_info
)->playback
.volume
= DFLT_VOLUME_LEVEL
;
482 (*port_info
)->capture
.volume
= DFLT_VOLUME_LEVEL
;
485 * Add mixer support. The SPB is used to change the volume. Both
486 * ports use the same SPB. Therefore, we only register one
487 * control instance since it will be used by both channels.
488 * In error case we continue without controls.
490 kctrl
= snd_ctl_new1(&playback_controls
, *port_info
);
491 ret
= snd_ctl_add(card
, kctrl
);
494 "failed to add playback controls %p port=%d err=%d\n",
497 kctrl
= snd_ctl_new1(&capture_controls
, *port_info
);
498 ret
= snd_ctl_add(card
, kctrl
);
501 "failed to add capture controls %p port=%d err=%d\n",
507 void siu_free_port(struct siu_port
*port_info
)
512 static int siu_dai_startup(struct snd_pcm_substream
*substream
,
513 struct snd_soc_dai
*dai
)
515 struct siu_info
*info
= snd_soc_dai_get_drvdata(dai
);
516 struct snd_pcm_runtime
*rt
= substream
->runtime
;
517 struct siu_port
*port_info
= siu_port_info(substream
);
520 dev_dbg(substream
->pcm
->card
->dev
, "%s: port=%d@%p\n", __func__
,
521 info
->port_id
, port_info
);
523 snd_soc_set_runtime_hwparams(substream
, &siu_dai_pcm_hw
);
525 ret
= snd_pcm_hw_constraint_integer(rt
, SNDRV_PCM_HW_PARAM_PERIODS
);
526 if (unlikely(ret
< 0))
529 siu_dai_start(port_info
);
534 static void siu_dai_shutdown(struct snd_pcm_substream
*substream
,
535 struct snd_soc_dai
*dai
)
537 struct siu_info
*info
= snd_soc_dai_get_drvdata(dai
);
538 struct siu_port
*port_info
= siu_port_info(substream
);
540 dev_dbg(substream
->pcm
->card
->dev
, "%s: port=%d@%p\n", __func__
,
541 info
->port_id
, port_info
);
543 if (substream
->stream
== SNDRV_PCM_STREAM_PLAYBACK
)
544 port_info
->play_cap
&= ~PLAYBACK_ENABLED
;
546 port_info
->play_cap
&= ~CAPTURE_ENABLED
;
548 /* Stop the siu if the other stream is not using it */
549 if (!port_info
->play_cap
) {
550 /* during stmread or stmwrite ? */
551 BUG_ON(port_info
->playback
.rw_flg
|| port_info
->capture
.rw_flg
);
552 siu_dai_spbstop(port_info
);
553 siu_dai_stop(port_info
);
557 /* PCM part of siu_dai_playback_prepare() / siu_dai_capture_prepare() */
558 static int siu_dai_prepare(struct snd_pcm_substream
*substream
,
559 struct snd_soc_dai
*dai
)
561 struct siu_info
*info
= snd_soc_dai_get_drvdata(dai
);
562 struct snd_pcm_runtime
*rt
= substream
->runtime
;
563 struct siu_port
*port_info
= siu_port_info(substream
);
564 struct siu_stream
*siu_stream
;
567 dev_dbg(substream
->pcm
->card
->dev
,
568 "%s: port %d, active streams %lx, %d channels\n",
569 __func__
, info
->port_id
, port_info
->play_cap
, rt
->channels
);
571 if (substream
->stream
== SNDRV_PCM_STREAM_PLAYBACK
) {
572 self
= PLAYBACK_ENABLED
;
573 siu_stream
= &port_info
->playback
;
575 self
= CAPTURE_ENABLED
;
576 siu_stream
= &port_info
->capture
;
579 /* Set up the siu if not already done */
580 if (!port_info
->play_cap
) {
581 siu_stream
->rw_flg
= 0; /* stream-data transfer flag */
583 siu_dai_spbAselect(port_info
);
584 siu_dai_spbBselect(port_info
);
586 siu_dai_open(siu_stream
);
588 siu_dai_pcmdatapack(siu_stream
);
590 ret
= siu_dai_spbstart(port_info
);
597 port_info
->play_cap
|= self
;
604 * SIU can set bus format to I2S / PCM / SPDIF independently for playback and
605 * capture, however, the current API sets the bus format globally for a DAI.
607 static int siu_dai_set_fmt(struct snd_soc_dai
*dai
,
610 struct siu_info
*info
= snd_soc_dai_get_drvdata(dai
);
611 u32 __iomem
*base
= info
->reg
;
614 dev_dbg(dai
->dev
, "%s: fmt 0x%x on port %d\n",
615 __func__
, fmt
, info
->port_id
);
617 if (info
->port_id
< 0)
620 /* Here select between I2S / PCM / SPDIF */
621 switch (fmt
& SND_SOC_DAIFMT_FORMAT_MASK
) {
622 case SND_SOC_DAIFMT_I2S
:
623 ifctl
= siu_flags
[info
->port_id
].playback
.i2s
|
624 siu_flags
[info
->port_id
].capture
.i2s
;
626 case SND_SOC_DAIFMT_LEFT_J
:
627 ifctl
= siu_flags
[info
->port_id
].playback
.pcm
|
628 siu_flags
[info
->port_id
].capture
.pcm
;
630 /* SPDIF disabled - see comment at the top */
635 ifctl
|= ~(siu_flags
[info
->port_id
].playback
.mask
|
636 siu_flags
[info
->port_id
].capture
.mask
) &
637 siu_read32(base
+ SIU_IFCTL
);
638 siu_write32(base
+ SIU_IFCTL
, ifctl
);
643 static int siu_dai_set_sysclk(struct snd_soc_dai
*dai
, int clk_id
,
644 unsigned int freq
, int dir
)
646 struct clk
*siu_clk
, *parent_clk
;
647 char *siu_name
, *parent_name
;
650 if (dir
!= SND_SOC_CLOCK_IN
)
653 dev_dbg(dai
->dev
, "%s: using clock %d\n", __func__
, clk_id
);
657 siu_name
= "siua_clk";
658 parent_name
= "pll_clk";
661 siu_name
= "siua_clk";
662 parent_name
= "siumcka_clk";
665 siu_name
= "siub_clk";
666 parent_name
= "pll_clk";
669 siu_name
= "siub_clk";
670 parent_name
= "siumckb_clk";
676 siu_clk
= clk_get(dai
->dev
, siu_name
);
677 if (IS_ERR(siu_clk
)) {
678 dev_err(dai
->dev
, "%s: cannot get a SIU clock: %ld\n", __func__
,
680 return PTR_ERR(siu_clk
);
683 parent_clk
= clk_get(dai
->dev
, parent_name
);
684 if (IS_ERR(parent_clk
)) {
685 ret
= PTR_ERR(parent_clk
);
686 dev_err(dai
->dev
, "cannot get a SIU clock parent: %d\n", ret
);
690 ret
= clk_set_parent(siu_clk
, parent_clk
);
692 dev_err(dai
->dev
, "cannot reparent the SIU clock: %d\n", ret
);
696 ret
= clk_set_rate(siu_clk
, freq
);
698 dev_err(dai
->dev
, "cannot set SIU clock rate: %d\n", ret
);
700 /* TODO: when clkdev gets reference counting we'll move these to siu_dai_shutdown() */
709 static struct snd_soc_dai_ops siu_dai_ops
= {
710 .startup
= siu_dai_startup
,
711 .shutdown
= siu_dai_shutdown
,
712 .prepare
= siu_dai_prepare
,
713 .set_sysclk
= siu_dai_set_sysclk
,
714 .set_fmt
= siu_dai_set_fmt
,
717 static struct snd_soc_dai_driver siu_i2s_dai
= {
718 .name
= "siu-i2s-dai",
722 .formats
= SNDRV_PCM_FMTBIT_S16
,
723 .rates
= SNDRV_PCM_RATE_8000_48000
,
728 .formats
= SNDRV_PCM_FMTBIT_S16
,
729 .rates
= SNDRV_PCM_RATE_8000_48000
,
734 static int __devinit
siu_probe(struct platform_device
*pdev
)
736 const struct firmware
*fw_entry
;
737 struct resource
*res
, *region
;
738 struct siu_info
*info
;
741 info
= kmalloc(sizeof(*info
), GFP_KERNEL
);
745 info
->dev
= &pdev
->dev
;
747 ret
= request_firmware(&fw_entry
, "siu_spb.bin", &pdev
->dev
);
752 * Loaded firmware is "const" - read only, but we have to modify it in
753 * snd_siu_sh7343_spbAselect() and snd_siu_sh7343_spbBselect()
755 memcpy(&info
->fw
, fw_entry
->data
, fw_entry
->size
);
757 release_firmware(fw_entry
);
759 res
= platform_get_resource(pdev
, IORESOURCE_MEM
, 0);
765 region
= request_mem_region(res
->start
, resource_size(res
),
768 dev_err(&pdev
->dev
, "SIU region already claimed\n");
774 info
->pram
= ioremap(res
->start
, PRAM_SIZE
);
777 info
->xram
= ioremap(res
->start
+ XRAM_OFFSET
, XRAM_SIZE
);
780 info
->yram
= ioremap(res
->start
+ YRAM_OFFSET
, YRAM_SIZE
);
783 info
->reg
= ioremap(res
->start
+ REG_OFFSET
, resource_size(res
) -
788 dev_set_drvdata(&pdev
->dev
, info
);
790 /* register using ARRAY version so we can keep dai name */
791 ret
= snd_soc_register_dais(&pdev
->dev
, &siu_i2s_dai
, 1);
795 ret
= snd_soc_register_platform(&pdev
->dev
, &siu_platform
);
799 pm_runtime_enable(&pdev
->dev
);
804 snd_soc_unregister_dai(&pdev
->dev
);
814 release_mem_region(res
->start
, resource_size(res
));
823 static int __devexit
siu_remove(struct platform_device
*pdev
)
825 struct siu_info
*info
= dev_get_drvdata(&pdev
->dev
);
826 struct resource
*res
;
828 pm_runtime_disable(&pdev
->dev
);
830 snd_soc_unregister_platform(&pdev
->dev
);
831 snd_soc_unregister_dai(&pdev
->dev
);
837 res
= platform_get_resource(pdev
, IORESOURCE_MEM
, 0);
839 release_mem_region(res
->start
, resource_size(res
));
845 static struct platform_driver siu_driver
= {
847 .owner
= THIS_MODULE
,
848 .name
= "siu-pcm-audio",
851 .remove
= __devexit_p(siu_remove
),
854 static int __init
siu_init(void)
856 return platform_driver_register(&siu_driver
);
859 static void __exit
siu_exit(void)
861 platform_driver_unregister(&siu_driver
);
864 module_init(siu_init
)
865 module_exit(siu_exit
)
867 MODULE_AUTHOR("Carlos Munoz <carlos@kenati.com>");
868 MODULE_DESCRIPTION("ALSA SoC SH7722 SIU driver");
869 MODULE_LICENSE("GPL");