aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/sh')
-rw-r--r--sound/soc/sh/fsi.c102
1 files changed, 35 insertions, 67 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index aea5adb54e38..07a0350f771e 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -101,13 +101,10 @@
101 101
102#define FSI_FMTS (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE) 102#define FSI_FMTS (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE)
103 103
104/************************************************************************ 104/*
105 105 * struct
106 106 */
107 struct
108
109 107
110************************************************************************/
111struct fsi_priv { 108struct fsi_priv {
112 void __iomem *base; 109 void __iomem *base;
113 struct snd_pcm_substream *substream; 110 struct snd_pcm_substream *substream;
@@ -142,13 +139,10 @@ struct fsi_master {
142 spinlock_t lock; 139 spinlock_t lock;
143}; 140};
144 141
145/************************************************************************ 142/*
146 143 * basic read write function
147 144 */
148 basic read write function
149
150 145
151************************************************************************/
152static void __fsi_reg_write(u32 reg, u32 data) 146static void __fsi_reg_write(u32 reg, u32 data)
153{ 147{
154 /* valid data area is 24bit */ 148 /* valid data area is 24bit */
@@ -251,13 +245,10 @@ static void fsi_master_mask_set(struct fsi_master *master,
251 spin_unlock_irqrestore(&master->lock, flags); 245 spin_unlock_irqrestore(&master->lock, flags);
252} 246}
253 247
254/************************************************************************ 248/*
255 249 * basic function
256 250 */
257 basic function
258
259 251
260************************************************************************/
261static struct fsi_master *fsi_get_master(struct fsi_priv *fsi) 252static struct fsi_master *fsi_get_master(struct fsi_priv *fsi)
262{ 253{
263 return fsi->master; 254 return fsi->master;
@@ -362,13 +353,10 @@ static u8 *fsi_dma_get_area(struct fsi_priv *fsi)
362 return fsi->substream->runtime->dma_area + fsi->byte_offset; 353 return fsi->substream->runtime->dma_area + fsi->byte_offset;
363} 354}
364 355
365/************************************************************************ 356/*
366 357 * irq function
367 358 */
368 irq function
369
370 359
371************************************************************************/
372static void fsi_irq_enable(struct fsi_priv *fsi, int is_play) 360static void fsi_irq_enable(struct fsi_priv *fsi, int is_play)
373{ 361{
374 u32 data = fsi_port_ab_io_bit(fsi, is_play); 362 u32 data = fsi_port_ab_io_bit(fsi, is_play);
@@ -409,13 +397,11 @@ static void fsi_irq_clear_status(struct fsi_priv *fsi)
409 fsi_master_mask_set(master, master->core->int_st, data, 0); 397 fsi_master_mask_set(master, master->core->int_st, data, 0);
410} 398}
411 399
412/************************************************************************ 400/*
413 401 * SPDIF master clock function
414 402 *
415 SPDIF master clock function 403 * These functions are used later FSI2
416 404 */
417These functions are used later FSI2
418************************************************************************/
419static void fsi_spdif_clk_ctrl(struct fsi_priv *fsi, int enable) 405static void fsi_spdif_clk_ctrl(struct fsi_priv *fsi, int enable)
420{ 406{
421 struct fsi_master *master = fsi_get_master(fsi); 407 struct fsi_master *master = fsi_get_master(fsi);
@@ -432,13 +418,10 @@ static void fsi_spdif_clk_ctrl(struct fsi_priv *fsi, int enable)
432 fsi_master_mask_set(master, fsi->mst_ctrl, val, 0); 418 fsi_master_mask_set(master, fsi->mst_ctrl, val, 0);
433} 419}
434 420
435/************************************************************************ 421/*
436 422 * ctrl function
437 423 */
438 ctrl function
439
440 424
441************************************************************************/
442static void fsi_clk_ctrl(struct fsi_priv *fsi, int enable) 425static void fsi_clk_ctrl(struct fsi_priv *fsi, int enable)
443{ 426{
444 u32 val = fsi_is_port_a(fsi) ? (1 << 0) : (1 << 4); 427 u32 val = fsi_is_port_a(fsi) ? (1 << 0) : (1 << 4);
@@ -697,13 +680,10 @@ static irqreturn_t fsi_interrupt(int irq, void *data)
697 return IRQ_HANDLED; 680 return IRQ_HANDLED;
698} 681}
699 682
700/************************************************************************ 683/*
701 684 * dai ops
702 685 */
703 dai ops
704
705 686
706************************************************************************/
707static int fsi_dai_startup(struct snd_pcm_substream *substream, 687static int fsi_dai_startup(struct snd_pcm_substream *substream,
708 struct snd_soc_dai *dai) 688 struct snd_soc_dai *dai)
709{ 689{
@@ -922,13 +902,10 @@ static struct snd_soc_dai_ops fsi_dai_ops = {
922 .hw_params = fsi_dai_hw_params, 902 .hw_params = fsi_dai_hw_params,
923}; 903};
924 904
925/************************************************************************ 905/*
926 906 * pcm ops
927 907 */
928 pcm ops
929
930 908
931************************************************************************/
932static struct snd_pcm_hardware fsi_pcm_hardware = { 909static struct snd_pcm_hardware fsi_pcm_hardware = {
933 .info = SNDRV_PCM_INFO_INTERLEAVED | 910 .info = SNDRV_PCM_INFO_INTERLEAVED |
934 SNDRV_PCM_INFO_MMAP | 911 SNDRV_PCM_INFO_MMAP |
@@ -994,13 +971,10 @@ static struct snd_pcm_ops fsi_pcm_ops = {
994 .pointer = fsi_pointer, 971 .pointer = fsi_pointer,
995}; 972};
996 973
997/************************************************************************ 974/*
998 975 * snd_soc_platform
999 976 */
1000 snd_soc_platform
1001
1002 977
1003************************************************************************/
1004#define PREALLOC_BUFFER (32 * 1024) 978#define PREALLOC_BUFFER (32 * 1024)
1005#define PREALLOC_BUFFER_MAX (32 * 1024) 979#define PREALLOC_BUFFER_MAX (32 * 1024)
1006 980
@@ -1024,13 +998,10 @@ static int fsi_pcm_new(struct snd_card *card,
1024 PREALLOC_BUFFER, PREALLOC_BUFFER_MAX); 998 PREALLOC_BUFFER, PREALLOC_BUFFER_MAX);
1025} 999}
1026 1000
1027/************************************************************************ 1001/*
1028 1002 * alsa struct
1029 1003 */
1030 alsa struct
1031
1032 1004
1033************************************************************************/
1034static struct snd_soc_dai_driver fsi_soc_dai[] = { 1005static struct snd_soc_dai_driver fsi_soc_dai[] = {
1035 { 1006 {
1036 .name = "fsia-dai", 1007 .name = "fsia-dai",
@@ -1072,13 +1043,10 @@ static struct snd_soc_platform_driver fsi_soc_platform = {
1072 .pcm_free = fsi_pcm_free, 1043 .pcm_free = fsi_pcm_free,
1073}; 1044};
1074 1045
1075/************************************************************************ 1046/*
1076 1047 * platform function
1077 1048 */
1078 platform function
1079
1080 1049
1081************************************************************************/
1082static int fsi_probe(struct platform_device *pdev) 1050static int fsi_probe(struct platform_device *pdev)
1083{ 1051{
1084 struct fsi_master *master; 1052 struct fsi_master *master;