/* sound/soc/samsung/s3c-i2s-v2.h1*2* ALSA Soc Audio Layer - S3C_I2SV2 I2S driver3*4* Copyright (c) 2007 Simtec Electronics5* http://armlinux.simtec.co.uk/6* Ben Dooks <[email protected]>7*8* This program is free software; you can redistribute it and/or modify it9* under the terms of the GNU General Public License as published by the10* Free Software Foundation; either version 2 of the License, or (at your11* option) any later version.12*/1314/* This code is the core support for the I2S block found in a number of15* Samsung SoC devices which is unofficially named I2S-V2. Currently the16* S3C2412 and the S3C64XX series use this block to provide 1 or 2 I2S17* channels via configurable GPIO.18*/1920#ifndef __SND_SOC_S3C24XX_S3C_I2SV2_I2S_H21#define __SND_SOC_S3C24XX_S3C_I2SV2_I2S_H __FILE__2223#define S3C_I2SV2_DIV_BCLK (1)24#define S3C_I2SV2_DIV_RCLK (2)25#define S3C_I2SV2_DIV_PRESCALER (3)2627#define S3C_I2SV2_CLKSRC_PCLK 028#define S3C_I2SV2_CLKSRC_AUDIOBUS 129#define S3C_I2SV2_CLKSRC_CDCLK 23031/* Set this flag for I2S controllers that have the bit IISMOD[12]32* bridge/break RCLK signal and external Xi2sCDCLK pin.33*/34#define S3C_FEATURE_CDCLKCON (1 << 0)3536/**37* struct s3c_i2sv2_info - S3C I2S-V2 information38* @dev: The parent device passed to use from the probe.39* @regs: The pointer to the device registe block.40* @feature: Set of bit-flags indicating features of the controller.41* @master: True if the I2S core is the I2S bit clock master.42* @dma_playback: DMA information for playback channel.43* @dma_capture: DMA information for capture channel.44* @suspend_iismod: PM save for the IISMOD register.45* @suspend_iiscon: PM save for the IISCON register.46* @suspend_iispsr: PM save for the IISPSR register.47*48* This is the private codec state for the hardware associated with an49* I2S channel such as the register mappings and clock sources.50*/51struct s3c_i2sv2_info {52struct device *dev;53void __iomem *regs;5455u32 feature;5657struct clk *iis_pclk;58struct clk *iis_cclk;5960unsigned char master;6162struct s3c_dma_params *dma_playback;63struct s3c_dma_params *dma_capture;6465u32 suspend_iismod;66u32 suspend_iiscon;67u32 suspend_iispsr;6869unsigned long base;70};7172extern struct clk *s3c_i2sv2_get_clock(struct snd_soc_dai *cpu_dai);7374struct s3c_i2sv2_rate_calc {75unsigned int clk_div; /* for prescaler */76unsigned int fs_div; /* for root frame clock */77};7879extern int s3c_i2sv2_iis_calc_rate(struct s3c_i2sv2_rate_calc *info,80unsigned int *fstab,81unsigned int rate, struct clk *clk);8283/**84* s3c_i2sv2_probe - probe for i2s device helper85* @dai: The ASoC DAI structure supplied to the original probe.86* @i2s: Our local i2s structure to fill in.87* @base: The base address for the registers.88*/89extern int s3c_i2sv2_probe(struct snd_soc_dai *dai,90struct s3c_i2sv2_info *i2s,91unsigned long base);9293/**94* s3c_i2sv2_register_dai - register dai with soc core95* @dev: DAI device96* @id: DAI ID97* @drv: The driver structure to register98*99* Fill in any missing fields and then register the given dai with the100* soc core.101*/102extern int s3c_i2sv2_register_dai(struct device *dev, int id,103struct snd_soc_dai_driver *drv);104105#endif /* __SND_SOC_S3C24XX_S3C_I2SV2_I2S_H */106107108