1 /* sound/soc/samsung/i2s.c
3 * ALSA SoC Audio Layer - Samsung I2S Controller driver
5 * Copyright (c) 2010 Samsung Electronics Co. Ltd.
6 * Jaswinder Singh <jassisinghbrar@gmail.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include <dt-bindings/sound/samsung-i2s.h>
14 #include <linux/delay.h>
15 #include <linux/slab.h>
16 #include <linux/clk.h>
17 #include <linux/clk-provider.h>
19 #include <linux/module.h>
21 #include <linux/of_device.h>
22 #include <linux/of_gpio.h>
23 #include <linux/pm_runtime.h>
25 #include <sound/soc.h>
26 #include <sound/pcm_params.h>
28 #include <linux/platform_data/asoc-s3c.h>
35 #define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)
37 #define SAMSUNG_I2S_ID_PRIMARY 1
38 #define SAMSUNG_I2S_ID_SECONDARY 2
40 struct samsung_i2s_variant_regs {
45 unsigned int rclksrc_off;
47 unsigned int cdclkcon_off;
49 unsigned int bfs_mask;
50 unsigned int rfs_mask;
51 unsigned int ftx0cnt_off;
54 struct samsung_i2s_dai_data {
56 unsigned int pcm_rates;
57 const struct samsung_i2s_variant_regs *i2s_variant_regs;
61 /* Platform device for this DAI */
62 struct platform_device *pdev;
67 * Specifically requested RCLK,BCLK by MACHINE Driver.
68 * 0 indicates CPU driver is free to choose any value.
71 /* Pointer to the Primary_Fifo if this is Sec_Fifo, NULL otherwise */
72 struct i2s_dai *pri_dai;
73 /* Pointer to the Secondary_Fifo if it has one, NULL otherwise */
74 struct i2s_dai *sec_dai;
75 #define DAI_OPENED (1 << 0) /* Dai is opened */
76 #define DAI_MANAGER (1 << 1) /* Dai is the manager */
79 /* Driver for this DAI */
80 struct snd_soc_dai_driver *drv;
83 struct snd_dmaengine_dai_dma_data dma_playback;
84 struct snd_dmaengine_dai_dma_data dma_capture;
85 struct snd_dmaengine_dai_dma_data idma_playback;
88 struct samsung_i2s_priv *priv;
91 struct samsung_i2s_priv {
92 struct platform_device *pdev;
93 struct platform_device *pdev_sec;
95 /* Memory mapped SFR region */
98 /* Spinlock protecting access to the device's registers */
101 /* Lock for cross i/f checks */
104 /* CPU DAIs and their corresponding drivers */
106 struct snd_soc_dai_driver *dai_drv;
109 /* The I2S controller's core clock */
112 /* Clock for generating I2S signals */
115 /* Rate of RCLK source clock */
116 unsigned long rclk_srcrate;
118 /* Cache of selected I2S registers for system suspend */
123 const struct samsung_i2s_variant_regs *variant_regs;
126 /* The clock provider's data */
127 struct clk *clk_table[3];
128 struct clk_onecell_data clk_data;
131 /* Returns true if this is the 'overlay' stereo DAI */
132 static inline bool is_secondary(struct i2s_dai *i2s)
134 return i2s->drv->id == SAMSUNG_I2S_ID_SECONDARY;
137 /* If operating in SoC-Slave mode */
138 static inline bool is_slave(struct i2s_dai *i2s)
140 struct samsung_i2s_priv *priv = i2s->priv;
142 u32 mod = readl(priv->addr + I2SMOD);
143 return (mod & (1 << priv->variant_regs->mss_off)) ? true : false;
146 /* If this interface of the controller is transmitting data */
147 static inline bool tx_active(struct i2s_dai *i2s)
154 active = readl(i2s->priv->addr + I2SCON);
156 if (is_secondary(i2s))
157 active &= CON_TXSDMA_ACTIVE;
159 active &= CON_TXDMA_ACTIVE;
161 return active ? true : false;
164 /* Return pointer to the other DAI */
165 static inline struct i2s_dai *get_other_dai(struct i2s_dai *i2s)
167 return i2s->pri_dai ? : i2s->sec_dai;
170 /* If the other interface of the controller is transmitting data */
171 static inline bool other_tx_active(struct i2s_dai *i2s)
173 struct i2s_dai *other = get_other_dai(i2s);
175 return tx_active(other);
178 /* If any interface of the controller is transmitting data */
179 static inline bool any_tx_active(struct i2s_dai *i2s)
181 return tx_active(i2s) || other_tx_active(i2s);
184 /* If this interface of the controller is receiving data */
185 static inline bool rx_active(struct i2s_dai *i2s)
192 active = readl(i2s->priv->addr + I2SCON) & CON_RXDMA_ACTIVE;
194 return active ? true : false;
197 /* If the other interface of the controller is receiving data */
198 static inline bool other_rx_active(struct i2s_dai *i2s)
200 struct i2s_dai *other = get_other_dai(i2s);
202 return rx_active(other);
205 /* If any interface of the controller is receiving data */
206 static inline bool any_rx_active(struct i2s_dai *i2s)
208 return rx_active(i2s) || other_rx_active(i2s);
211 /* If the other DAI is transmitting or receiving data */
212 static inline bool other_active(struct i2s_dai *i2s)
214 return other_rx_active(i2s) || other_tx_active(i2s);
217 /* If this DAI is transmitting or receiving data */
218 static inline bool this_active(struct i2s_dai *i2s)
220 return tx_active(i2s) || rx_active(i2s);
223 /* If the controller is active anyway */
224 static inline bool any_active(struct i2s_dai *i2s)
226 return this_active(i2s) || other_active(i2s);
229 static inline struct i2s_dai *to_info(struct snd_soc_dai *dai)
231 struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai);
233 return &priv->dai[dai->id - 1];
236 static inline bool is_opened(struct i2s_dai *i2s)
238 if (i2s && (i2s->mode & DAI_OPENED))
244 static inline bool is_manager(struct i2s_dai *i2s)
246 if (is_opened(i2s) && (i2s->mode & DAI_MANAGER))
252 /* Read RCLK of I2S (in multiples of LRCLK) */
253 static inline unsigned get_rfs(struct i2s_dai *i2s)
255 struct samsung_i2s_priv *priv = i2s->priv;
258 rfs = readl(priv->addr + I2SMOD) >> priv->variant_regs->rfs_off;
259 rfs &= priv->variant_regs->rfs_mask;
273 /* Write RCLK of I2S (in multiples of LRCLK) */
274 static inline void set_rfs(struct i2s_dai *i2s, unsigned rfs)
276 struct samsung_i2s_priv *priv = i2s->priv;
277 u32 mod = readl(priv->addr + I2SMOD);
278 int rfs_shift = priv->variant_regs->rfs_off;
280 mod &= ~(priv->variant_regs->rfs_mask << rfs_shift);
284 mod |= (EXYNOS7_MOD_RCLK_192FS << rfs_shift);
287 mod |= (EXYNOS7_MOD_RCLK_96FS << rfs_shift);
290 mod |= (EXYNOS7_MOD_RCLK_128FS << rfs_shift);
293 mod |= (EXYNOS7_MOD_RCLK_64FS << rfs_shift);
296 mod |= (MOD_RCLK_768FS << rfs_shift);
299 mod |= (MOD_RCLK_512FS << rfs_shift);
302 mod |= (MOD_RCLK_384FS << rfs_shift);
305 mod |= (MOD_RCLK_256FS << rfs_shift);
309 writel(mod, priv->addr + I2SMOD);
312 /* Read Bit-Clock of I2S (in multiples of LRCLK) */
313 static inline unsigned get_bfs(struct i2s_dai *i2s)
315 struct samsung_i2s_priv *priv = i2s->priv;
318 bfs = readl(priv->addr + I2SMOD) >> priv->variant_regs->bfs_off;
319 bfs &= priv->variant_regs->bfs_mask;
334 /* Write Bit-Clock of I2S (in multiples of LRCLK) */
335 static inline void set_bfs(struct i2s_dai *i2s, unsigned bfs)
337 struct samsung_i2s_priv *priv = i2s->priv;
338 u32 mod = readl(priv->addr + I2SMOD);
339 int tdm = priv->quirks & QUIRK_SUPPORTS_TDM;
340 int bfs_shift = priv->variant_regs->bfs_off;
342 /* Non-TDM I2S controllers do not support BCLK > 48 * FS */
343 if (!tdm && bfs > 48) {
344 dev_err(&i2s->pdev->dev, "Unsupported BCLK divider\n");
348 mod &= ~(priv->variant_regs->bfs_mask << bfs_shift);
352 mod |= (MOD_BCLK_48FS << bfs_shift);
355 mod |= (MOD_BCLK_32FS << bfs_shift);
358 mod |= (MOD_BCLK_24FS << bfs_shift);
361 mod |= (MOD_BCLK_16FS << bfs_shift);
364 mod |= (EXYNOS5420_MOD_BCLK_64FS << bfs_shift);
367 mod |= (EXYNOS5420_MOD_BCLK_96FS << bfs_shift);
370 mod |= (EXYNOS5420_MOD_BCLK_128FS << bfs_shift);
373 mod |= (EXYNOS5420_MOD_BCLK_192FS << bfs_shift);
376 mod |= (EXYNOS5420_MOD_BCLK_256FS << bfs_shift);
379 dev_err(&i2s->pdev->dev, "Wrong BCLK Divider!\n");
383 writel(mod, priv->addr + I2SMOD);
387 static inline int get_blc(struct i2s_dai *i2s)
389 int blc = readl(i2s->priv->addr + I2SMOD);
391 blc = (blc >> 13) & 0x3;
400 /* TX Channel Control */
401 static void i2s_txctrl(struct i2s_dai *i2s, int on)
403 struct samsung_i2s_priv *priv = i2s->priv;
404 void __iomem *addr = priv->addr;
405 int txr_off = priv->variant_regs->txr_off;
406 u32 con = readl(addr + I2SCON);
407 u32 mod = readl(addr + I2SMOD) & ~(3 << txr_off);
411 con &= ~CON_TXCH_PAUSE;
413 if (is_secondary(i2s)) {
414 con |= CON_TXSDMA_ACTIVE;
415 con &= ~CON_TXSDMA_PAUSE;
417 con |= CON_TXDMA_ACTIVE;
418 con &= ~CON_TXDMA_PAUSE;
421 if (any_rx_active(i2s))
426 if (is_secondary(i2s)) {
427 con |= CON_TXSDMA_PAUSE;
428 con &= ~CON_TXSDMA_ACTIVE;
430 con |= CON_TXDMA_PAUSE;
431 con &= ~CON_TXDMA_ACTIVE;
434 if (other_tx_active(i2s)) {
435 writel(con, addr + I2SCON);
439 con |= CON_TXCH_PAUSE;
441 if (any_rx_active(i2s))
447 writel(mod, addr + I2SMOD);
448 writel(con, addr + I2SCON);
451 /* RX Channel Control */
452 static void i2s_rxctrl(struct i2s_dai *i2s, int on)
454 struct samsung_i2s_priv *priv = i2s->priv;
455 void __iomem *addr = priv->addr;
456 int txr_off = priv->variant_regs->txr_off;
457 u32 con = readl(addr + I2SCON);
458 u32 mod = readl(addr + I2SMOD) & ~(3 << txr_off);
461 con |= CON_RXDMA_ACTIVE | CON_ACTIVE;
462 con &= ~(CON_RXDMA_PAUSE | CON_RXCH_PAUSE);
464 if (any_tx_active(i2s))
469 con |= CON_RXDMA_PAUSE | CON_RXCH_PAUSE;
470 con &= ~CON_RXDMA_ACTIVE;
472 if (any_tx_active(i2s))
478 writel(mod, addr + I2SMOD);
479 writel(con, addr + I2SCON);
482 /* Flush FIFO of an interface */
483 static inline void i2s_fifo(struct i2s_dai *i2s, u32 flush)
491 if (is_secondary(i2s))
492 fic = i2s->priv->addr + I2SFICS;
494 fic = i2s->priv->addr + I2SFIC;
497 writel(readl(fic) | flush, fic);
500 val = msecs_to_loops(1) / 1000; /* 1 usec */
504 writel(readl(fic) & ~flush, fic);
507 static int i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int rfs,
510 struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai);
511 struct i2s_dai *i2s = to_info(dai);
512 struct i2s_dai *other = get_other_dai(i2s);
513 const struct samsung_i2s_variant_regs *i2s_regs = priv->variant_regs;
514 unsigned int cdcon_mask = 1 << i2s_regs->cdclkcon_off;
515 unsigned int rsrc_mask = 1 << i2s_regs->rclksrc_off;
516 u32 mod, mask, val = 0;
520 pm_runtime_get_sync(dai->dev);
522 spin_lock_irqsave(&priv->lock, flags);
523 mod = readl(priv->addr + I2SMOD);
524 spin_unlock_irqrestore(&priv->lock, flags);
527 case SAMSUNG_I2S_OPCLK:
528 mask = MOD_OPCLK_MASK;
529 val = (dir << MOD_OPCLK_SHIFT) & MOD_OPCLK_MASK;
531 case SAMSUNG_I2S_CDCLK:
532 mask = 1 << i2s_regs->cdclkcon_off;
533 /* Shouldn't matter in GATING(CLOCK_IN) mode */
534 if (dir == SND_SOC_CLOCK_IN)
537 if ((rfs && other && other->rfs && (other->rfs != rfs)) ||
539 (((dir == SND_SOC_CLOCK_IN)
540 && !(mod & cdcon_mask)) ||
541 ((dir == SND_SOC_CLOCK_OUT)
542 && (mod & cdcon_mask))))) {
543 dev_err(&i2s->pdev->dev,
544 "%s:%d Other DAI busy\n", __func__, __LINE__);
549 if (dir == SND_SOC_CLOCK_IN)
550 val = 1 << i2s_regs->cdclkcon_off;
555 case SAMSUNG_I2S_RCLKSRC_0: /* clock corrsponding to IISMOD[10] := 0 */
556 case SAMSUNG_I2S_RCLKSRC_1: /* clock corrsponding to IISMOD[10] := 1 */
557 mask = 1 << i2s_regs->rclksrc_off;
559 if ((priv->quirks & QUIRK_NO_MUXPSR)
560 || (clk_id == SAMSUNG_I2S_RCLKSRC_0))
565 if (!any_active(i2s)) {
566 if (priv->op_clk && !IS_ERR(priv->op_clk)) {
567 if ((clk_id && !(mod & rsrc_mask)) ||
568 (!clk_id && (mod & rsrc_mask))) {
569 clk_disable_unprepare(priv->op_clk);
570 clk_put(priv->op_clk);
573 clk_get_rate(priv->op_clk);
579 priv->op_clk = clk_get(&i2s->pdev->dev,
582 priv->op_clk = clk_get(&i2s->pdev->dev,
585 if (WARN_ON(IS_ERR(priv->op_clk))) {
586 ret = PTR_ERR(priv->op_clk);
591 ret = clk_prepare_enable(priv->op_clk);
593 clk_put(priv->op_clk);
597 priv->rclk_srcrate = clk_get_rate(priv->op_clk);
599 } else if ((!clk_id && (mod & rsrc_mask))
600 || (clk_id && !(mod & rsrc_mask))) {
601 dev_err(&i2s->pdev->dev,
602 "%s:%d Other DAI busy\n", __func__, __LINE__);
606 /* Call can't be on the active DAI */
611 val = 1 << i2s_regs->rclksrc_off;
614 dev_err(&i2s->pdev->dev, "We don't serve that!\n");
619 spin_lock_irqsave(&priv->lock, flags);
620 mod = readl(priv->addr + I2SMOD);
621 mod = (mod & ~mask) | val;
622 writel(mod, priv->addr + I2SMOD);
623 spin_unlock_irqrestore(&priv->lock, flags);
625 pm_runtime_put(dai->dev);
629 pm_runtime_put(dai->dev);
633 static int i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
635 struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai);
636 struct i2s_dai *i2s = to_info(dai);
637 int lrp_shift, sdf_shift, sdf_mask, lrp_rlow, mod_slave;
641 lrp_shift = priv->variant_regs->lrp_off;
642 sdf_shift = priv->variant_regs->sdf_off;
643 mod_slave = 1 << priv->variant_regs->mss_off;
645 sdf_mask = MOD_SDF_MASK << sdf_shift;
646 lrp_rlow = MOD_LR_RLOW << lrp_shift;
648 /* Format is priority */
649 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
650 case SND_SOC_DAIFMT_RIGHT_J:
652 tmp |= (MOD_SDF_MSB << sdf_shift);
654 case SND_SOC_DAIFMT_LEFT_J:
656 tmp |= (MOD_SDF_LSB << sdf_shift);
658 case SND_SOC_DAIFMT_I2S:
659 tmp |= (MOD_SDF_IIS << sdf_shift);
662 dev_err(&i2s->pdev->dev, "Format not supported\n");
667 * INV flag is relative to the FORMAT flag - if set it simply
668 * flips the polarity specified by the Standard
670 switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
671 case SND_SOC_DAIFMT_NB_NF:
673 case SND_SOC_DAIFMT_NB_IF:
680 dev_err(&i2s->pdev->dev, "Polarity not supported\n");
684 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
685 case SND_SOC_DAIFMT_CBM_CFM:
688 case SND_SOC_DAIFMT_CBS_CFS:
690 * Set default source clock in Master mode, only when the
691 * CLK_I2S_RCLK_SRC clock is not exposed so we ensure any
692 * clock configuration assigned in DT is not overwritten.
694 if (priv->rclk_srcrate == 0 && priv->clk_data.clks == NULL)
695 i2s_set_sysclk(dai, SAMSUNG_I2S_RCLKSRC_0,
696 0, SND_SOC_CLOCK_IN);
699 dev_err(&i2s->pdev->dev, "master/slave format not supported\n");
703 pm_runtime_get_sync(dai->dev);
704 spin_lock_irqsave(&priv->lock, flags);
705 mod = readl(priv->addr + I2SMOD);
707 * Don't change the I2S mode if any controller is active on this
710 if (any_active(i2s) &&
711 ((mod & (sdf_mask | lrp_rlow | mod_slave)) != tmp)) {
712 spin_unlock_irqrestore(&priv->lock, flags);
713 pm_runtime_put(dai->dev);
714 dev_err(&i2s->pdev->dev,
715 "%s:%d Other DAI busy\n", __func__, __LINE__);
719 mod &= ~(sdf_mask | lrp_rlow | mod_slave);
721 writel(mod, priv->addr + I2SMOD);
722 spin_unlock_irqrestore(&priv->lock, flags);
723 pm_runtime_put(dai->dev);
728 static int i2s_hw_params(struct snd_pcm_substream *substream,
729 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
731 struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai);
732 struct i2s_dai *i2s = to_info(dai);
733 u32 mod, mask = 0, val = 0;
737 WARN_ON(!pm_runtime_active(dai->dev));
739 if (!is_secondary(i2s))
740 mask |= (MOD_DC2_EN | MOD_DC1_EN);
742 switch (params_channels(params)) {
749 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
750 i2s->dma_playback.addr_width = 4;
752 i2s->dma_capture.addr_width = 4;
755 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
756 i2s->dma_playback.addr_width = 2;
758 i2s->dma_capture.addr_width = 2;
762 dev_err(&i2s->pdev->dev, "%d channels not supported\n",
763 params_channels(params));
767 if (is_secondary(i2s))
768 mask |= MOD_BLCS_MASK;
770 mask |= MOD_BLCP_MASK;
773 mask |= MOD_BLC_MASK;
775 switch (params_width(params)) {
777 if (is_secondary(i2s))
778 val |= MOD_BLCS_8BIT;
780 val |= MOD_BLCP_8BIT;
785 if (is_secondary(i2s))
786 val |= MOD_BLCS_16BIT;
788 val |= MOD_BLCP_16BIT;
790 val |= MOD_BLC_16BIT;
793 if (is_secondary(i2s))
794 val |= MOD_BLCS_24BIT;
796 val |= MOD_BLCP_24BIT;
798 val |= MOD_BLC_24BIT;
801 dev_err(&i2s->pdev->dev, "Format(%d) not supported\n",
802 params_format(params));
806 spin_lock_irqsave(&priv->lock, flags);
807 mod = readl(priv->addr + I2SMOD);
808 mod = (mod & ~mask) | val;
809 writel(mod, priv->addr + I2SMOD);
810 spin_unlock_irqrestore(&priv->lock, flags);
812 snd_soc_dai_init_dma_data(dai, &i2s->dma_playback, &i2s->dma_capture);
814 i2s->frmclk = params_rate(params);
816 rclksrc = priv->clk_table[CLK_I2S_RCLK_SRC];
817 if (rclksrc && !IS_ERR(rclksrc))
818 priv->rclk_srcrate = clk_get_rate(rclksrc);
823 /* We set constraints on the substream acc to the version of I2S */
824 static int i2s_startup(struct snd_pcm_substream *substream,
825 struct snd_soc_dai *dai)
827 struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai);
828 struct i2s_dai *i2s = to_info(dai);
829 struct i2s_dai *other = get_other_dai(i2s);
832 pm_runtime_get_sync(dai->dev);
834 spin_lock_irqsave(&priv->pcm_lock, flags);
836 i2s->mode |= DAI_OPENED;
838 if (is_manager(other))
839 i2s->mode &= ~DAI_MANAGER;
841 i2s->mode |= DAI_MANAGER;
843 if (!any_active(i2s) && (priv->quirks & QUIRK_NEED_RSTCLR))
844 writel(CON_RSTCLR, i2s->priv->addr + I2SCON);
846 spin_unlock_irqrestore(&priv->pcm_lock, flags);
851 static void i2s_shutdown(struct snd_pcm_substream *substream,
852 struct snd_soc_dai *dai)
854 struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai);
855 struct i2s_dai *i2s = to_info(dai);
856 struct i2s_dai *other = get_other_dai(i2s);
859 spin_lock_irqsave(&priv->pcm_lock, flags);
861 i2s->mode &= ~DAI_OPENED;
862 i2s->mode &= ~DAI_MANAGER;
864 if (is_opened(other))
865 other->mode |= DAI_MANAGER;
867 /* Reset any constraint on RFS and BFS */
871 spin_unlock_irqrestore(&priv->pcm_lock, flags);
873 pm_runtime_put(dai->dev);
876 static int config_setup(struct i2s_dai *i2s)
878 struct samsung_i2s_priv *priv = i2s->priv;
879 struct i2s_dai *other = get_other_dai(i2s);
880 unsigned rfs, bfs, blc;
890 /* Select least possible multiple(2) if no constraint set */
899 if ((rfs == 256 || rfs == 512) && (blc == 24)) {
900 dev_err(&i2s->pdev->dev,
901 "%d-RFS not supported for 24-blc\n", rfs);
906 if (bfs == 16 || bfs == 32)
912 /* If already setup and running */
913 if (any_active(i2s) && (get_rfs(i2s) != rfs || get_bfs(i2s) != bfs)) {
914 dev_err(&i2s->pdev->dev,
915 "%s:%d Other DAI busy\n", __func__, __LINE__);
922 /* Don't bother with PSR in Slave mode */
926 if (!(priv->quirks & QUIRK_NO_MUXPSR)) {
927 psr = priv->rclk_srcrate / i2s->frmclk / rfs;
928 writel(((psr - 1) << 8) | PSR_PSREN, priv->addr + I2SPSR);
929 dev_dbg(&i2s->pdev->dev,
930 "RCLK_SRC=%luHz PSR=%u, RCLK=%dfs, BCLK=%dfs\n",
931 priv->rclk_srcrate, psr, rfs, bfs);
937 static int i2s_trigger(struct snd_pcm_substream *substream,
938 int cmd, struct snd_soc_dai *dai)
940 struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai);
941 int capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE);
942 struct snd_soc_pcm_runtime *rtd = substream->private_data;
943 struct i2s_dai *i2s = to_info(rtd->cpu_dai);
947 case SNDRV_PCM_TRIGGER_START:
948 case SNDRV_PCM_TRIGGER_RESUME:
949 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
950 pm_runtime_get_sync(dai->dev);
951 spin_lock_irqsave(&priv->lock, flags);
953 if (config_setup(i2s)) {
954 spin_unlock_irqrestore(&priv->lock, flags);
963 spin_unlock_irqrestore(&priv->lock, flags);
965 case SNDRV_PCM_TRIGGER_STOP:
966 case SNDRV_PCM_TRIGGER_SUSPEND:
967 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
968 spin_lock_irqsave(&priv->lock, flags);
972 i2s_fifo(i2s, FIC_RXFLUSH);
975 i2s_fifo(i2s, FIC_TXFLUSH);
978 spin_unlock_irqrestore(&priv->lock, flags);
979 pm_runtime_put(dai->dev);
986 static int i2s_set_clkdiv(struct snd_soc_dai *dai,
989 struct i2s_dai *i2s = to_info(dai);
990 struct i2s_dai *other = get_other_dai(i2s);
993 case SAMSUNG_I2S_DIV_BCLK:
994 pm_runtime_get_sync(dai->dev);
995 if ((any_active(i2s) && div && (get_bfs(i2s) != div))
996 || (other && other->bfs && (other->bfs != div))) {
997 pm_runtime_put(dai->dev);
998 dev_err(&i2s->pdev->dev,
999 "%s:%d Other DAI busy\n", __func__, __LINE__);
1003 pm_runtime_put(dai->dev);
1006 dev_err(&i2s->pdev->dev,
1007 "Invalid clock divider(%d)\n", div_id);
1014 static snd_pcm_sframes_t
1015 i2s_delay(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
1017 struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai);
1018 struct i2s_dai *i2s = to_info(dai);
1019 u32 reg = readl(priv->addr + I2SFIC);
1020 snd_pcm_sframes_t delay;
1022 WARN_ON(!pm_runtime_active(dai->dev));
1024 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
1025 delay = FIC_RXCOUNT(reg);
1026 else if (is_secondary(i2s))
1027 delay = FICS_TXCOUNT(readl(priv->addr + I2SFICS));
1029 delay = (reg >> priv->variant_regs->ftx0cnt_off) & 0x7f;
1035 static int i2s_suspend(struct snd_soc_dai *dai)
1037 return pm_runtime_force_suspend(dai->dev);
1040 static int i2s_resume(struct snd_soc_dai *dai)
1042 return pm_runtime_force_resume(dai->dev);
1045 #define i2s_suspend NULL
1046 #define i2s_resume NULL
1049 static int samsung_i2s_dai_probe(struct snd_soc_dai *dai)
1051 struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai);
1052 struct i2s_dai *i2s = to_info(dai);
1053 struct i2s_dai *other = get_other_dai(i2s);
1054 unsigned long flags;
1056 pm_runtime_get_sync(dai->dev);
1058 if (is_secondary(i2s)) { /* If this is probe on the secondary DAI */
1059 snd_soc_dai_init_dma_data(dai, &i2s->dma_playback, NULL);
1061 snd_soc_dai_init_dma_data(dai, &i2s->dma_playback,
1064 if (priv->quirks & QUIRK_NEED_RSTCLR)
1065 writel(CON_RSTCLR, priv->addr + I2SCON);
1067 if (priv->quirks & QUIRK_SUPPORTS_IDMA)
1068 idma_reg_addr_init(priv->addr,
1069 other->idma_playback.addr);
1072 /* Reset any constraint on RFS and BFS */
1076 spin_lock_irqsave(&priv->lock, flags);
1079 i2s_fifo(i2s, FIC_TXFLUSH);
1080 i2s_fifo(other, FIC_TXFLUSH);
1081 i2s_fifo(i2s, FIC_RXFLUSH);
1082 spin_unlock_irqrestore(&priv->lock, flags);
1084 /* Gate CDCLK by default */
1085 if (!is_opened(other))
1086 i2s_set_sysclk(dai, SAMSUNG_I2S_CDCLK,
1087 0, SND_SOC_CLOCK_IN);
1088 pm_runtime_put(dai->dev);
1093 static int samsung_i2s_dai_remove(struct snd_soc_dai *dai)
1095 struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai);
1096 struct i2s_dai *i2s = to_info(dai);
1097 unsigned long flags;
1099 pm_runtime_get_sync(dai->dev);
1101 if (!is_secondary(i2s)) {
1102 if (priv->quirks & QUIRK_NEED_RSTCLR) {
1103 spin_lock_irqsave(&priv->lock, flags);
1104 writel(0, priv->addr + I2SCON);
1105 spin_unlock_irqrestore(&priv->lock, flags);
1109 pm_runtime_put(dai->dev);
1114 static const struct snd_soc_dai_ops samsung_i2s_dai_ops = {
1115 .trigger = i2s_trigger,
1116 .hw_params = i2s_hw_params,
1117 .set_fmt = i2s_set_fmt,
1118 .set_clkdiv = i2s_set_clkdiv,
1119 .set_sysclk = i2s_set_sysclk,
1120 .startup = i2s_startup,
1121 .shutdown = i2s_shutdown,
1125 static const struct snd_soc_dapm_widget samsung_i2s_widgets[] = {
1127 SND_SOC_DAPM_AIF_OUT("Mixer DAI TX", NULL, 0, SND_SOC_NOPM, 0, 0),
1128 SND_SOC_DAPM_AIF_IN("Mixer DAI RX", NULL, 0, SND_SOC_NOPM, 0, 0),
1130 /* Playback Mixer */
1131 SND_SOC_DAPM_MIXER("Playback Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
1134 static const struct snd_soc_dapm_route samsung_i2s_dapm_routes[] = {
1135 { "Playback Mixer", NULL, "Primary" },
1136 { "Playback Mixer", NULL, "Secondary" },
1138 { "Mixer DAI TX", NULL, "Playback Mixer" },
1139 { "Playback Mixer", NULL, "Mixer DAI RX" },
1142 static const struct snd_soc_component_driver samsung_i2s_component = {
1143 .name = "samsung-i2s",
1145 .dapm_widgets = samsung_i2s_widgets,
1146 .num_dapm_widgets = ARRAY_SIZE(samsung_i2s_widgets),
1148 .dapm_routes = samsung_i2s_dapm_routes,
1149 .num_dapm_routes = ARRAY_SIZE(samsung_i2s_dapm_routes),
1152 #define SAMSUNG_I2S_FMTS (SNDRV_PCM_FMTBIT_S8 | \
1153 SNDRV_PCM_FMTBIT_S16_LE | \
1154 SNDRV_PCM_FMTBIT_S24_LE)
1156 static int i2s_alloc_dais(struct samsung_i2s_priv *priv,
1157 const struct samsung_i2s_dai_data *i2s_dai_data,
1160 static const char *dai_names[] = { "samsung-i2s", "samsung-i2s-sec" };
1161 static const char *stream_names[] = { "Primary", "Secondary" };
1162 struct snd_soc_dai_driver *dai_drv;
1163 struct i2s_dai *dai;
1166 priv->dai = devm_kcalloc(&priv->pdev->dev, num_dais,
1167 sizeof(*dai), GFP_KERNEL);
1171 priv->dai_drv = devm_kcalloc(&priv->pdev->dev, num_dais,
1172 sizeof(*dai_drv), GFP_KERNEL);
1176 for (i = 0; i < num_dais; i++) {
1177 dai_drv = &priv->dai_drv[i];
1179 dai_drv->probe = samsung_i2s_dai_probe;
1180 dai_drv->remove = samsung_i2s_dai_remove;
1181 dai_drv->suspend = i2s_suspend;
1182 dai_drv->resume = i2s_resume;
1184 dai_drv->symmetric_rates = 1;
1185 dai_drv->ops = &samsung_i2s_dai_ops;
1187 dai_drv->playback.channels_min = 1;
1188 dai_drv->playback.channels_max = 2;
1189 dai_drv->playback.rates = i2s_dai_data->pcm_rates;
1190 dai_drv->playback.formats = SAMSUNG_I2S_FMTS;
1191 dai_drv->playback.stream_name = stream_names[i];
1193 dai_drv->id = i + 1;
1194 dai_drv->name = dai_names[i];
1196 priv->dai[i].drv = &priv->dai_drv[i];
1197 priv->dai[i].pdev = priv->pdev;
1200 /* Initialize capture only for the primary DAI */
1201 dai_drv = &priv->dai_drv[SAMSUNG_I2S_ID_PRIMARY - 1];
1203 dai_drv->capture.channels_min = 1;
1204 dai_drv->capture.channels_max = 2;
1205 dai_drv->capture.rates = i2s_dai_data->pcm_rates;
1206 dai_drv->capture.formats = SAMSUNG_I2S_FMTS;
1212 static int i2s_runtime_suspend(struct device *dev)
1214 struct samsung_i2s_priv *priv = dev_get_drvdata(dev);
1216 priv->suspend_i2smod = readl(priv->addr + I2SMOD);
1217 priv->suspend_i2scon = readl(priv->addr + I2SCON);
1218 priv->suspend_i2spsr = readl(priv->addr + I2SPSR);
1221 clk_disable_unprepare(priv->op_clk);
1222 clk_disable_unprepare(priv->clk);
1227 static int i2s_runtime_resume(struct device *dev)
1229 struct samsung_i2s_priv *priv = dev_get_drvdata(dev);
1232 ret = clk_prepare_enable(priv->clk);
1237 ret = clk_prepare_enable(priv->op_clk);
1239 clk_disable_unprepare(priv->clk);
1244 writel(priv->suspend_i2scon, priv->addr + I2SCON);
1245 writel(priv->suspend_i2smod, priv->addr + I2SMOD);
1246 writel(priv->suspend_i2spsr, priv->addr + I2SPSR);
1250 #endif /* CONFIG_PM */
1252 static void i2s_unregister_clocks(struct samsung_i2s_priv *priv)
1256 for (i = 0; i < priv->clk_data.clk_num; i++) {
1257 if (!IS_ERR(priv->clk_table[i]))
1258 clk_unregister(priv->clk_table[i]);
1262 static void i2s_unregister_clock_provider(struct samsung_i2s_priv *priv)
1264 of_clk_del_provider(priv->pdev->dev.of_node);
1265 i2s_unregister_clocks(priv);
1269 static int i2s_register_clock_provider(struct samsung_i2s_priv *priv)
1272 const char * const i2s_clk_desc[] = { "cdclk", "rclk_src", "prescaler" };
1273 const char *clk_name[2] = { "i2s_opclk0", "i2s_opclk1" };
1274 const char *p_names[2] = { NULL };
1275 struct device *dev = &priv->pdev->dev;
1276 const struct samsung_i2s_variant_regs *reg_info = priv->variant_regs;
1277 const char *i2s_clk_name[ARRAY_SIZE(i2s_clk_desc)];
1278 struct clk *rclksrc;
1281 /* Register the clock provider only if it's expected in the DTB */
1282 if (!of_find_property(dev->of_node, "#clock-cells", NULL))
1285 /* Get the RCLKSRC mux clock parent clock names */
1286 for (i = 0; i < ARRAY_SIZE(p_names); i++) {
1287 rclksrc = clk_get(dev, clk_name[i]);
1288 if (IS_ERR(rclksrc))
1290 p_names[i] = __clk_get_name(rclksrc);
1294 for (i = 0; i < ARRAY_SIZE(i2s_clk_desc); i++) {
1295 i2s_clk_name[i] = devm_kasprintf(dev, GFP_KERNEL, "%s_%s",
1296 dev_name(dev), i2s_clk_desc[i]);
1297 if (!i2s_clk_name[i])
1301 if (!(priv->quirks & QUIRK_NO_MUXPSR)) {
1302 /* Activate the prescaler */
1303 u32 val = readl(priv->addr + I2SPSR);
1304 writel(val | PSR_PSREN, priv->addr + I2SPSR);
1306 priv->clk_table[CLK_I2S_RCLK_SRC] = clk_register_mux(dev,
1307 i2s_clk_name[CLK_I2S_RCLK_SRC], p_names,
1308 ARRAY_SIZE(p_names),
1309 CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT,
1310 priv->addr + I2SMOD, reg_info->rclksrc_off,
1313 priv->clk_table[CLK_I2S_RCLK_PSR] = clk_register_divider(dev,
1314 i2s_clk_name[CLK_I2S_RCLK_PSR],
1315 i2s_clk_name[CLK_I2S_RCLK_SRC],
1316 CLK_SET_RATE_PARENT,
1317 priv->addr + I2SPSR, 8, 6, 0, &priv->lock);
1319 p_names[0] = i2s_clk_name[CLK_I2S_RCLK_PSR];
1320 priv->clk_data.clk_num = 2;
1323 priv->clk_table[CLK_I2S_CDCLK] = clk_register_gate(dev,
1324 i2s_clk_name[CLK_I2S_CDCLK], p_names[0],
1325 CLK_SET_RATE_PARENT,
1326 priv->addr + I2SMOD, reg_info->cdclkcon_off,
1327 CLK_GATE_SET_TO_DISABLE, &priv->lock);
1329 priv->clk_data.clk_num += 1;
1330 priv->clk_data.clks = priv->clk_table;
1332 ret = of_clk_add_provider(dev->of_node, of_clk_src_onecell_get,
1335 dev_err(dev, "failed to add clock provider: %d\n", ret);
1336 i2s_unregister_clocks(priv);
1342 /* Create platform device for the secondary PCM */
1343 static int i2s_create_secondary_device(struct samsung_i2s_priv *priv)
1345 struct platform_device *pdev;
1348 pdev = platform_device_register_simple("samsung-i2s-sec", -1, NULL, 0);
1352 ret = device_attach(&pdev->dev);
1354 dev_info(&pdev->dev, "device_attach() failed\n");
1358 priv->pdev_sec = pdev;
1363 static void i2s_delete_secondary_device(struct samsung_i2s_priv *priv)
1365 if (priv->pdev_sec) {
1366 platform_device_del(priv->pdev_sec);
1367 priv->pdev_sec = NULL;
1370 static int samsung_i2s_probe(struct platform_device *pdev)
1372 struct i2s_dai *pri_dai, *sec_dai = NULL;
1373 struct s3c_audio_pdata *i2s_pdata = pdev->dev.platform_data;
1374 struct resource *res;
1375 u32 regs_base, quirks = 0, idma_addr = 0;
1376 struct device_node *np = pdev->dev.of_node;
1377 const struct samsung_i2s_dai_data *i2s_dai_data;
1379 struct samsung_i2s_priv *priv;
1381 if (IS_ENABLED(CONFIG_OF) && pdev->dev.of_node)
1382 i2s_dai_data = of_device_get_match_data(&pdev->dev);
1384 i2s_dai_data = (struct samsung_i2s_dai_data *)
1385 platform_get_device_id(pdev)->driver_data;
1387 /* Nothing to do if it is the secondary device probe */
1391 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
1395 quirks = np ? i2s_dai_data->quirks : i2s_pdata->type.quirks;
1396 num_dais = (quirks & QUIRK_SEC_DAI) ? 2 : 1;
1398 priv->variant_regs = i2s_dai_data->i2s_variant_regs;
1399 priv->quirks = quirks;
1401 ret = i2s_alloc_dais(priv, i2s_dai_data, num_dais);
1405 pri_dai = &priv->dai[SAMSUNG_I2S_ID_PRIMARY - 1];
1407 spin_lock_init(&priv->lock);
1408 spin_lock_init(&priv->pcm_lock);
1411 if (i2s_pdata == NULL) {
1412 dev_err(&pdev->dev, "Can't work without s3c_audio_pdata\n");
1416 pri_dai->dma_playback.filter_data = i2s_pdata->dma_playback;
1417 pri_dai->dma_capture.filter_data = i2s_pdata->dma_capture;
1418 pri_dai->filter = i2s_pdata->dma_filter;
1420 idma_addr = i2s_pdata->type.idma_addr;
1422 if (of_property_read_u32(np, "samsung,idma-addr",
1424 if (quirks & QUIRK_SUPPORTS_IDMA) {
1425 dev_info(&pdev->dev, "idma address is not"\
1431 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1432 priv->addr = devm_ioremap_resource(&pdev->dev, res);
1433 if (IS_ERR(priv->addr))
1434 return PTR_ERR(priv->addr);
1436 regs_base = res->start;
1438 priv->clk = devm_clk_get(&pdev->dev, "iis");
1439 if (IS_ERR(priv->clk)) {
1440 dev_err(&pdev->dev, "Failed to get iis clock\n");
1441 return PTR_ERR(priv->clk);
1444 ret = clk_prepare_enable(priv->clk);
1446 dev_err(&pdev->dev, "failed to enable clock: %d\n", ret);
1449 pri_dai->dma_playback.addr = regs_base + I2STXD;
1450 pri_dai->dma_capture.addr = regs_base + I2SRXD;
1451 pri_dai->dma_playback.chan_name = "tx";
1452 pri_dai->dma_capture.chan_name = "rx";
1453 pri_dai->dma_playback.addr_width = 4;
1454 pri_dai->dma_capture.addr_width = 4;
1455 pri_dai->priv = priv;
1457 if (quirks & QUIRK_PRI_6CHAN)
1458 pri_dai->drv->playback.channels_max = 6;
1460 ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter,
1463 goto err_disable_clk;
1465 if (quirks & QUIRK_SEC_DAI) {
1466 sec_dai = &priv->dai[SAMSUNG_I2S_ID_SECONDARY - 1];
1468 sec_dai->dma_playback.addr = regs_base + I2STXDS;
1469 sec_dai->dma_playback.chan_name = "tx-sec";
1472 sec_dai->dma_playback.filter_data = i2s_pdata->dma_play_sec;
1473 sec_dai->filter = i2s_pdata->dma_filter;
1476 sec_dai->dma_playback.addr_width = 4;
1477 sec_dai->idma_playback.addr = idma_addr;
1478 sec_dai->pri_dai = pri_dai;
1479 sec_dai->priv = priv;
1480 pri_dai->sec_dai = sec_dai;
1482 ret = i2s_create_secondary_device(priv);
1484 goto err_disable_clk;
1486 ret = samsung_asoc_dma_platform_register(&priv->pdev_sec->dev,
1487 sec_dai->filter, "tx-sec", NULL,
1490 goto err_disable_clk;
1494 if (i2s_pdata && i2s_pdata->cfg_gpio && i2s_pdata->cfg_gpio(pdev)) {
1495 dev_err(&pdev->dev, "Unable to configure gpio\n");
1497 goto err_disable_clk;
1500 dev_set_drvdata(&pdev->dev, priv);
1502 ret = devm_snd_soc_register_component(&pdev->dev,
1503 &samsung_i2s_component,
1504 priv->dai_drv, num_dais);
1506 goto err_disable_clk;
1508 pm_runtime_set_active(&pdev->dev);
1509 pm_runtime_enable(&pdev->dev);
1511 ret = i2s_register_clock_provider(priv);
1513 goto err_disable_pm;
1515 priv->op_clk = clk_get_parent(priv->clk_table[CLK_I2S_RCLK_SRC]);
1520 pm_runtime_disable(&pdev->dev);
1522 clk_disable_unprepare(priv->clk);
1523 i2s_delete_secondary_device(priv);
1527 static int samsung_i2s_remove(struct platform_device *pdev)
1529 struct samsung_i2s_priv *priv = dev_get_drvdata(&pdev->dev);
1531 /* The secondary device has no driver data assigned */
1535 pm_runtime_get_sync(&pdev->dev);
1536 pm_runtime_disable(&pdev->dev);
1538 i2s_unregister_clock_provider(priv);
1539 clk_disable_unprepare(priv->clk);
1540 pm_runtime_put_noidle(&pdev->dev);
1541 i2s_delete_secondary_device(priv);
1546 static const struct samsung_i2s_variant_regs i2sv3_regs = {
1560 static const struct samsung_i2s_variant_regs i2sv6_regs = {
1574 static const struct samsung_i2s_variant_regs i2sv7_regs = {
1588 static const struct samsung_i2s_variant_regs i2sv5_i2s1_regs = {
1602 static const struct samsung_i2s_dai_data i2sv3_dai_type = {
1603 .quirks = QUIRK_NO_MUXPSR,
1604 .pcm_rates = SNDRV_PCM_RATE_8000_96000,
1605 .i2s_variant_regs = &i2sv3_regs,
1608 static const struct samsung_i2s_dai_data i2sv5_dai_type = {
1609 .quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI | QUIRK_NEED_RSTCLR |
1610 QUIRK_SUPPORTS_IDMA,
1611 .pcm_rates = SNDRV_PCM_RATE_8000_96000,
1612 .i2s_variant_regs = &i2sv3_regs,
1615 static const struct samsung_i2s_dai_data i2sv6_dai_type = {
1616 .quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI | QUIRK_NEED_RSTCLR |
1617 QUIRK_SUPPORTS_TDM | QUIRK_SUPPORTS_IDMA,
1618 .pcm_rates = SNDRV_PCM_RATE_8000_96000,
1619 .i2s_variant_regs = &i2sv6_regs,
1622 static const struct samsung_i2s_dai_data i2sv7_dai_type = {
1623 .quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI | QUIRK_NEED_RSTCLR |
1625 .pcm_rates = SNDRV_PCM_RATE_8000_192000,
1626 .i2s_variant_regs = &i2sv7_regs,
1629 static const struct samsung_i2s_dai_data i2sv5_dai_type_i2s1 = {
1630 .quirks = QUIRK_PRI_6CHAN | QUIRK_NEED_RSTCLR,
1631 .pcm_rates = SNDRV_PCM_RATE_8000_96000,
1632 .i2s_variant_regs = &i2sv5_i2s1_regs,
1635 static const struct platform_device_id samsung_i2s_driver_ids[] = {
1637 .name = "samsung-i2s",
1638 .driver_data = (kernel_ulong_t)&i2sv3_dai_type,
1640 .name = "samsung-i2s-sec",
1644 MODULE_DEVICE_TABLE(platform, samsung_i2s_driver_ids);
1647 static const struct of_device_id exynos_i2s_match[] = {
1649 .compatible = "samsung,s3c6410-i2s",
1650 .data = &i2sv3_dai_type,
1652 .compatible = "samsung,s5pv210-i2s",
1653 .data = &i2sv5_dai_type,
1655 .compatible = "samsung,exynos5420-i2s",
1656 .data = &i2sv6_dai_type,
1658 .compatible = "samsung,exynos7-i2s",
1659 .data = &i2sv7_dai_type,
1661 .compatible = "samsung,exynos7-i2s1",
1662 .data = &i2sv5_dai_type_i2s1,
1666 MODULE_DEVICE_TABLE(of, exynos_i2s_match);
1669 static const struct dev_pm_ops samsung_i2s_pm = {
1670 SET_RUNTIME_PM_OPS(i2s_runtime_suspend,
1671 i2s_runtime_resume, NULL)
1672 SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
1673 pm_runtime_force_resume)
1676 static struct platform_driver samsung_i2s_driver = {
1677 .probe = samsung_i2s_probe,
1678 .remove = samsung_i2s_remove,
1679 .id_table = samsung_i2s_driver_ids,
1681 .name = "samsung-i2s",
1682 .of_match_table = of_match_ptr(exynos_i2s_match),
1683 .pm = &samsung_i2s_pm,
1687 module_platform_driver(samsung_i2s_driver);
1689 /* Module information */
1690 MODULE_AUTHOR("Jaswinder Singh, <jassisinghbrar@gmail.com>");
1691 MODULE_DESCRIPTION("Samsung I2S Interface");
1692 MODULE_ALIAS("platform:samsung-i2s");
1693 MODULE_LICENSE("GPL");