Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
s3c-i2s-v2.h
Go to the documentation of this file.
1 /* sound/soc/samsung/s3c-i2s-v2.h
2  *
3  * ALSA Soc Audio Layer - S3C_I2SV2 I2S driver
4  *
5  * Copyright (c) 2007 Simtec Electronics
6  * http://armlinux.simtec.co.uk/
7  * Ben Dooks <[email protected]>
8  *
9  * This program is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU General Public License as published by the
11  * Free Software Foundation; either version 2 of the License, or (at your
12  * option) any later version.
13 */
14 
15 /* This code is the core support for the I2S block found in a number of
16  * Samsung SoC devices which is unofficially named I2S-V2. Currently the
17  * S3C2412 and the S3C64XX series use this block to provide 1 or 2 I2S
18  * channels via configurable GPIO.
19  */
20 
21 #ifndef __SND_SOC_S3C24XX_S3C_I2SV2_I2S_H
22 #define __SND_SOC_S3C24XX_S3C_I2SV2_I2S_H __FILE__
23 
24 #define S3C_I2SV2_DIV_BCLK (1)
25 #define S3C_I2SV2_DIV_RCLK (2)
26 #define S3C_I2SV2_DIV_PRESCALER (3)
27 
28 #define S3C_I2SV2_CLKSRC_PCLK 0
29 #define S3C_I2SV2_CLKSRC_AUDIOBUS 1
30 #define S3C_I2SV2_CLKSRC_CDCLK 2
31 
32 /* Set this flag for I2S controllers that have the bit IISMOD[12]
33  * bridge/break RCLK signal and external Xi2sCDCLK pin.
34  */
35 #define S3C_FEATURE_CDCLKCON (1 << 0)
36 
53  struct device *dev;
54  void __iomem *regs;
55 
57 
58  struct clk *iis_pclk;
59  struct clk *iis_cclk;
60 
61  unsigned char master;
62 
65 
69 
70  unsigned long base;
71 };
72 
73 extern struct clk *s3c_i2sv2_get_clock(struct snd_soc_dai *cpu_dai);
74 
76  unsigned int clk_div; /* for prescaler */
77  unsigned int fs_div; /* for root frame clock */
78 };
79 
81  unsigned int *fstab,
82  unsigned int rate, struct clk *clk);
83 
90 extern int s3c_i2sv2_probe(struct snd_soc_dai *dai,
91  struct s3c_i2sv2_info *i2s,
92  unsigned long base);
93 
103 extern int s3c_i2sv2_register_dai(struct device *dev, int id,
104  struct snd_soc_dai_driver *drv);
105 
106 #endif /* __SND_SOC_S3C24XX_S3C_I2SV2_I2S_H */