linux/sound/soc/fsl/fsl-asoc-card.c

// SPDX-License-Identifier: GPL-2.0
//
// Freescale Generic ASoC Sound Card driver with ASRC
//
// Copyright (C) 2014 Freescale Semiconductor, Inc.
//
// Author: Nicolin Chen <[email protected]>

#include <linux/clk.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#if IS_ENABLED(CONFIG_SND_AC97_CODEC)
#include <sound/ac97_codec.h>
#endif
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/jack.h>
#include <sound/simple_card_utils.h>

#include "fsl_esai.h"
#include "fsl_sai.h"
#include "imx-audmux.h"

#include "../codecs/sgtl5000.h"
#include "../codecs/wm8962.h"
#include "../codecs/wm8960.h"
#include "../codecs/wm8994.h"
#include "../codecs/tlv320aic31xx.h"
#include "../codecs/nau8822.h"
#include "../codecs/wm8904.h"

#define DRIVER_NAME

#define CS427x_SYSCLK_MCLK

#define RX
#define TX

/* Default DAI format without Master and Slave flag */
#define DAI_FMT_BASE

/**
 * struct codec_priv - CODEC private data
 * @mclk: Main clock of the CODEC
 * @mclk_freq: Clock rate of MCLK
 * @free_freq: Clock rate of MCLK for hw_free()
 * @mclk_id: MCLK (or main clock) id for set_sysclk()
 * @fll_id: FLL (or secordary clock) id for set_sysclk()
 * @pll_id: PLL id for set_pll()
 */
struct codec_priv {};

/**
 * struct cpu_priv - CPU private data
 * @sysclk_freq: SYSCLK rates for set_sysclk()
 * @sysclk_dir: SYSCLK directions for set_sysclk()
 * @sysclk_id: SYSCLK ids for set_sysclk()
 * @slot_width: Slot width of each frame
 * @slot_num: Number of slots of each frame
 *
 * Note: [1] for tx and [0] for rx
 */
struct cpu_priv {};

/**
 * struct fsl_asoc_card_priv - Freescale Generic ASOC card private data
 * @dai_link: DAI link structure including normal one and DPCM link
 * @hp_jack: Headphone Jack structure
 * @mic_jack: Microphone Jack structure
 * @pdev: platform device pointer
 * @codec_priv: CODEC private data
 * @cpu_priv: CPU private data
 * @card: ASoC card structure
 * @streams: Mask of current active streams
 * @sample_rate: Current sample rate
 * @sample_format: Current sample format
 * @asrc_rate: ASRC sample rate used by Back-Ends
 * @asrc_format: ASRC sample format used by Back-Ends
 * @dai_fmt: DAI format between CPU and CODEC
 * @name: Card name
 */

struct fsl_asoc_card_priv {};

/*
 * This dapm route map exists for DPCM link only.
 * The other routes shall go through Device Tree.
 *
 * Note: keep all ASRC routes in the second half
 *	 to drop them easily for non-ASRC cases.
 */
static const struct snd_soc_dapm_route audio_map[] =;

static const struct snd_soc_dapm_route audio_map_ac97[] =;

static const struct snd_soc_dapm_route audio_map_tx[] =;

static const struct snd_soc_dapm_route audio_map_rx[] =;

/* Add all possible widgets into here without being redundant */
static const struct snd_soc_dapm_widget fsl_asoc_card_dapm_widgets[] =;

static bool fsl_asoc_card_is_ac97(struct fsl_asoc_card_priv *priv)
{}

static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream,
				   struct snd_pcm_hw_params *params)
{}

static int fsl_asoc_card_hw_free(struct snd_pcm_substream *substream)
{}

static const struct snd_soc_ops fsl_asoc_card_ops =;

static int be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
			      struct snd_pcm_hw_params *params)
{}

static const struct snd_soc_dai_link fsl_asoc_card_dai[] =;

static int fsl_asoc_card_audmux_init(struct device_node *np,
				     struct fsl_asoc_card_priv *priv)
{}

static int fsl_asoc_card_spdif_init(struct device_node *codec_np[],
				    struct device_node *cpu_np,
				    const char *codec_dai_name[],
				    struct fsl_asoc_card_priv *priv)
{}

static int hp_jack_event(struct notifier_block *nb, unsigned long event,
			 void *data)
{}

static struct notifier_block hp_jack_nb =;

static int mic_jack_event(struct notifier_block *nb, unsigned long event,
			  void *data)
{}

static struct notifier_block mic_jack_nb =;

static int fsl_asoc_card_late_probe(struct snd_soc_card *card)
{}

static int fsl_asoc_card_probe(struct platform_device *pdev)
{}

static const struct of_device_id fsl_asoc_card_dt_ids[] =;
MODULE_DEVICE_TABLE(of, fsl_asoc_card_dt_ids);

static struct platform_driver fsl_asoc_card_driver =;
module_platform_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_ALIAS();
MODULE_LICENSE();