#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/delay.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/reset.h>
#include <linux/spinlock.h>
#include <sound/dmaengine_pcm.h>
#include <sound/pcm_params.h>
#include "rockchip_i2s_tdm.h"
#define DRV_NAME …
#define DEFAULT_MCLK_FS …
#define CH_GRP_MAX …
#define MULTIPLEX_CH_MAX …
#define TRCM_TXRX …
#define TRCM_TX …
#define TRCM_RX …
struct txrx_config { … };
struct rk_i2s_soc_data { … };
struct rk_i2s_tdm_dev { … };
static int to_ch_num(unsigned int val)
{ … }
static void i2s_tdm_disable_unprepare_mclk(struct rk_i2s_tdm_dev *i2s_tdm)
{ … }
static int i2s_tdm_prepare_enable_mclk(struct rk_i2s_tdm_dev *i2s_tdm)
{ … }
static int __maybe_unused i2s_tdm_runtime_suspend(struct device *dev)
{ … }
static int __maybe_unused i2s_tdm_runtime_resume(struct device *dev)
{ … }
static inline struct rk_i2s_tdm_dev *to_info(struct snd_soc_dai *dai)
{ … }
static void rockchip_snd_xfer_sync_reset(struct rk_i2s_tdm_dev *i2s_tdm)
{ … }
static void rockchip_snd_reset(struct reset_control *rc)
{ … }
static void rockchip_snd_xfer_clear(struct rk_i2s_tdm_dev *i2s_tdm,
unsigned int clr)
{ … }
static inline void rockchip_enable_tde(struct regmap *regmap)
{ … }
static inline void rockchip_disable_tde(struct regmap *regmap)
{ … }
static inline void rockchip_enable_rde(struct regmap *regmap)
{ … }
static inline void rockchip_disable_rde(struct regmap *regmap)
{ … }
static void rockchip_snd_txrxctrl(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai, int on)
{ … }
static void rockchip_snd_txctrl(struct rk_i2s_tdm_dev *i2s_tdm, int on)
{ … }
static void rockchip_snd_rxctrl(struct rk_i2s_tdm_dev *i2s_tdm, int on)
{ … }
static int rockchip_i2s_tdm_set_fmt(struct snd_soc_dai *cpu_dai,
unsigned int fmt)
{ … }
static void rockchip_i2s_tdm_xfer_pause(struct snd_pcm_substream *substream,
struct rk_i2s_tdm_dev *i2s_tdm)
{ … }
static void rockchip_i2s_tdm_xfer_resume(struct snd_pcm_substream *substream,
struct rk_i2s_tdm_dev *i2s_tdm)
{ … }
static int rockchip_i2s_ch_to_io(unsigned int ch, bool substream_capture)
{ … }
static int rockchip_i2s_io_multiplex(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{ … }
static int rockchip_i2s_trcm_mode(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai,
unsigned int div_bclk,
unsigned int div_lrck,
unsigned int fmt)
{ … }
static int rockchip_i2s_tdm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
static int rockchip_i2s_tdm_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
{ … }
static int rockchip_i2s_tdm_dai_probe(struct snd_soc_dai *dai)
{ … }
static int rockchip_dai_tdm_slot(struct snd_soc_dai *dai,
unsigned int tx_mask, unsigned int rx_mask,
int slots, int slot_width)
{ … }
static int rockchip_i2s_tdm_set_bclk_ratio(struct snd_soc_dai *dai,
unsigned int ratio)
{ … }
static const struct snd_soc_dai_ops rockchip_i2s_tdm_dai_ops = …;
static const struct snd_soc_component_driver rockchip_i2s_tdm_component = …;
static bool rockchip_i2s_tdm_wr_reg(struct device *dev, unsigned int reg)
{ … }
static bool rockchip_i2s_tdm_rd_reg(struct device *dev, unsigned int reg)
{ … }
static bool rockchip_i2s_tdm_volatile_reg(struct device *dev, unsigned int reg)
{ … }
static bool rockchip_i2s_tdm_precious_reg(struct device *dev, unsigned int reg)
{ … }
static const struct reg_default rockchip_i2s_tdm_reg_defaults[] = …;
static const struct regmap_config rockchip_i2s_tdm_regmap_config = …;
static int common_soc_init(struct device *dev, u32 addr)
{ … }
static const struct txrx_config px30_txrx_config[] = …;
static const struct txrx_config rk1808_txrx_config[] = …;
static const struct txrx_config rk3308_txrx_config[] = …;
static const struct txrx_config rk3568_txrx_config[] = …;
static const struct txrx_config rv1126_txrx_config[] = …;
static const struct rk_i2s_soc_data px30_i2s_soc_data = …;
static const struct rk_i2s_soc_data rk1808_i2s_soc_data = …;
static const struct rk_i2s_soc_data rk3308_i2s_soc_data = …;
static const struct rk_i2s_soc_data rk3568_i2s_soc_data = …;
static const struct rk_i2s_soc_data rv1126_i2s_soc_data = …;
static const struct of_device_id rockchip_i2s_tdm_match[] = …;
static const struct snd_soc_dai_driver i2s_tdm_dai = …;
static int rockchip_i2s_tdm_init_dai(struct rk_i2s_tdm_dev *i2s_tdm)
{ … }
static int rockchip_i2s_tdm_path_check(struct rk_i2s_tdm_dev *i2s_tdm,
int num,
bool is_rx_path)
{ … }
static void rockchip_i2s_tdm_tx_path_config(struct rk_i2s_tdm_dev *i2s_tdm,
int num)
{ … }
static void rockchip_i2s_tdm_rx_path_config(struct rk_i2s_tdm_dev *i2s_tdm,
int num)
{ … }
static void rockchip_i2s_tdm_path_config(struct rk_i2s_tdm_dev *i2s_tdm,
int num, bool is_rx_path)
{ … }
static int rockchip_i2s_tdm_path_prepare(struct rk_i2s_tdm_dev *i2s_tdm,
struct device_node *np,
bool is_rx_path)
{ … }
static int rockchip_i2s_tdm_tx_path_prepare(struct rk_i2s_tdm_dev *i2s_tdm,
struct device_node *np)
{ … }
static int rockchip_i2s_tdm_rx_path_prepare(struct rk_i2s_tdm_dev *i2s_tdm,
struct device_node *np)
{ … }
static int rockchip_i2s_tdm_probe(struct platform_device *pdev)
{ … }
static void rockchip_i2s_tdm_remove(struct platform_device *pdev)
{ … }
static int __maybe_unused rockchip_i2s_tdm_suspend(struct device *dev)
{ … }
static int __maybe_unused rockchip_i2s_tdm_resume(struct device *dev)
{ … }
static const struct dev_pm_ops rockchip_i2s_tdm_pm_ops = …;
static struct platform_driver rockchip_i2s_tdm_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;
MODULE_DEVICE_TABLE(of, rockchip_i2s_tdm_match);