#include <linux/clk.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/spinlock.h>
#include <sound/dmaengine_pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#define SPDIFRX_CR …
#define SPDIFRX_MR …
#define SPDIFRX_IER …
#define SPDIFRX_IDR …
#define SPDIFRX_IMR …
#define SPDIFRX_ISR …
#define SPDIFRX_RSR …
#define SPDIFRX_RHR …
#define SPDIFRX_CHSR(channel, reg) …
#define SPDIFRX_CHUD(channel, reg) …
#define SPDIFRX_WPMR …
#define SPDIFRX_WPSR …
#define SPDIFRX_VERSION …
#define SPDIFRX_CR_SWRST …
#define SPDIFRX_MR_RXEN_MASK …
#define SPDIFRX_MR_RXEN_DISABLE …
#define SPDIFRX_MR_RXEN_ENABLE …
#define SPDIFRX_MR_VBMODE_MASK …
#define SPDIFRX_MR_VBMODE_ALWAYS_LOAD …
#define SPDIFRX_MR_VBMODE_DISCARD_IF_VB1 …
#define SPDIFRX_MR_ENDIAN_MASK …
#define SPDIFRX_MR_ENDIAN_LITTLE …
#define SPDIFRX_MR_ENDIAN_BIG …
#define SPDIFRX_MR_PBMODE_MASK …
#define SPDIFRX_MR_PBMODE_PARCHECK …
#define SPDIFRX_MR_PBMODE_NOPARCHECK …
#define SPDIFRX_MR_DATAWIDTH_MASK …
#define SPDIFRX_MR_DATAWIDTH(width) …
#define SPDIFRX_MR_PACK_MASK …
#define SPDIFRX_MR_PACK_DISABLED …
#define SPDIFRX_MR_PACK_ENABLED …
#define SPDIFRX_MR_SBMODE_MASK …
#define SPDIFRX_MR_SBMODE_ALWAYS_LOAD …
#define SPDIFRX_MR_SBMODE_DISCARD …
#define SPDIFRX_MR_AUTORST_MASK …
#define SPDIFRX_MR_AUTORST_NOACTION …
#define SPDIFRX_MR_AUTORST_UNLOCK_ON_PRE_ERR …
#define SPDIFRX_IR_RXRDY …
#define SPDIFRX_IR_LOCKED …
#define SPDIFRX_IR_LOSS …
#define SPDIFRX_IR_BLOCKEND …
#define SPDIFRX_IR_SFE …
#define SPDIFRX_IR_PAR_ERR …
#define SPDIFRX_IR_OVERRUN …
#define SPDIFRX_IR_RXFULL …
#define SPDIFRX_IR_CSC(ch) …
#define SPDIFRX_IR_SECE …
#define SPDIFRX_IR_BLOCKST …
#define SPDIFRX_IR_NRZ_ERR …
#define SPDIFRX_IR_PRE_ERR …
#define SPDIFRX_IR_CP_ERR …
#define SPDIFRX_RSR_ULOCK …
#define SPDIFRX_RSR_BADF …
#define SPDIFRX_RSR_LOWF …
#define SPDIFRX_RSR_NOSIGNAL …
#define SPDIFRX_RSR_IFS_MASK …
#define SPDIFRX_RSR_IFS(reg) …
#define SPDIFRX_VERSION_MASK …
#define SPDIFRX_VERSION_MFN_MASK …
#define SPDIFRX_VERSION_MFN(reg) …
static bool mchp_spdifrx_readable_reg(struct device *dev, unsigned int reg)
{ … }
static bool mchp_spdifrx_writeable_reg(struct device *dev, unsigned int reg)
{ … }
static bool mchp_spdifrx_precious_reg(struct device *dev, unsigned int reg)
{ … }
static bool mchp_spdifrx_volatile_reg(struct device *dev, unsigned int reg)
{ … }
static const struct regmap_config mchp_spdifrx_regmap_config = …;
#define SPDIFRX_GCLK_RATIO_MIN …
#define SPDIFRX_CS_BITS …
#define SPDIFRX_UD_BITS …
#define SPDIFRX_CHANNELS …
struct mchp_spdifrx_ch_stat { … };
struct mchp_spdifrx_user_data { … };
struct mchp_spdifrx_mixer_control { … };
struct mchp_spdifrx_dev { … };
static void mchp_spdifrx_channel_status_read(struct mchp_spdifrx_dev *dev,
int channel)
{ … }
static void mchp_spdifrx_channel_user_data_read(struct mchp_spdifrx_dev *dev,
int channel)
{ … }
static irqreturn_t mchp_spdif_interrupt(int irq, void *dev_id)
{ … }
static int mchp_spdifrx_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai)
{ … }
static int mchp_spdifrx_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
#define MCHP_SPDIF_RATES …
#define MCHP_SPDIF_FORMATS …
static int mchp_spdifrx_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int mchp_spdifrx_cs_get(struct mchp_spdifrx_dev *dev,
int channel,
struct snd_ctl_elem_value *uvalue)
{ … }
static int mchp_spdifrx_cs1_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *uvalue)
{ … }
static int mchp_spdifrx_cs2_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *uvalue)
{ … }
static int mchp_spdifrx_cs_mask(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *uvalue)
{ … }
static int mchp_spdifrx_subcode_ch_get(struct mchp_spdifrx_dev *dev,
int channel,
struct snd_ctl_elem_value *uvalue)
{ … }
static int mchp_spdifrx_subcode_ch1_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *uvalue)
{ … }
static int mchp_spdifrx_subcode_ch2_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *uvalue)
{ … }
static int mchp_spdifrx_boolean_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int mchp_spdifrx_ulock_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *uvalue)
{ … }
static int mchp_spdifrx_badf_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *uvalue)
{ … }
static int mchp_spdifrx_signal_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *uvalue)
{ … }
static int mchp_spdifrx_rate_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int mchp_spdifrx_rate_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static struct snd_kcontrol_new mchp_spdifrx_ctrls[] = …;
static int mchp_spdifrx_dai_probe(struct snd_soc_dai *dai)
{ … }
static int mchp_spdifrx_dai_remove(struct snd_soc_dai *dai)
{ … }
static const struct snd_soc_dai_ops mchp_spdifrx_dai_ops = …;
static struct snd_soc_dai_driver mchp_spdifrx_dai = …;
static const struct snd_soc_component_driver mchp_spdifrx_component = …;
static const struct of_device_id mchp_spdifrx_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, mchp_spdifrx_dt_ids);
static int mchp_spdifrx_runtime_suspend(struct device *dev)
{ … }
static int mchp_spdifrx_runtime_resume(struct device *dev)
{ … }
static const struct dev_pm_ops mchp_spdifrx_pm_ops = …;
static int mchp_spdifrx_probe(struct platform_device *pdev)
{ … }
static void mchp_spdifrx_remove(struct platform_device *pdev)
{ … }
static struct platform_driver mchp_spdifrx_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;