linux/sound/soc/codecs/rt274.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * rt274.c  --  RT274 ALSA SoC audio codec driver
 *
 * Copyright 2017 Realtek Semiconductor Corp.
 * Author: Bard Liao <[email protected]>
 */

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
#include <linux/dmi.h>
#include <linux/acpi.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include <sound/jack.h>
#include <linux/workqueue.h>

#include "rl6347a.h"
#include "rt274.h"

#define RT274_VENDOR_ID

struct rt274_priv {};

static const struct reg_default rt274_index_def[] =;
#define INDEX_CACHE_SIZE

static const struct reg_default rt274_reg[] =;

static bool rt274_volatile_register(struct device *dev, unsigned int reg)
{}

static bool rt274_readable_register(struct device *dev, unsigned int reg)
{}

#ifdef CONFIG_PM
static void rt274_index_sync(struct snd_soc_component *component)
{}
#endif

static int rt274_jack_detect(struct rt274_priv *rt274, bool *hp, bool *mic)
{}

static void rt274_jack_detect_work(struct work_struct *work)
{}

static irqreturn_t rt274_irq(int irq, void *data);

static int rt274_mic_detect(struct snd_soc_component *component,
	struct snd_soc_jack *jack,  void *data)
{}

static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -6350, 50, 0);
static const DECLARE_TLV_DB_SCALE(mic_vol_tlv, 0, 1000, 0);

static const struct snd_kcontrol_new rt274_snd_controls[] =;

static const struct snd_kcontrol_new hpol_enable_control =;

static const struct snd_kcontrol_new hpor_enable_control =;

static const struct snd_kcontrol_new loutl_enable_control =;

static const struct snd_kcontrol_new loutr_enable_control =;

/* ADC0 source */
static const char * const rt274_adc_src[] =;

static SOC_ENUM_SINGLE_DECL(
	rt274_adc0_enum, RT274_ADC0_MUX, RT274_ADC_SEL_SFT,
	rt274_adc_src);

static const struct snd_kcontrol_new rt274_adc0_mux =;

static SOC_ENUM_SINGLE_DECL(
	rt274_adc1_enum, RT274_ADC1_MUX, RT274_ADC_SEL_SFT,
	rt274_adc_src);

static const struct snd_kcontrol_new rt274_adc1_mux =;

static const char * const rt274_dac_src[] =;
/* HP-OUT source */
static SOC_ENUM_SINGLE_DECL(rt274_hpo_enum, RT274_HPO_MUX,
				0, rt274_dac_src);

static const struct snd_kcontrol_new rt274_hpo_mux =;

/* Line out source */
static SOC_ENUM_SINGLE_DECL(rt274_lout_enum, RT274_LOUT_MUX,
				0, rt274_dac_src);

static const struct snd_kcontrol_new rt274_lout_mux =;

static const struct snd_soc_dapm_widget rt274_dapm_widgets[] =;

static const struct snd_soc_dapm_route rt274_dapm_routes[] =;

static int rt274_hw_params(struct snd_pcm_substream *substream,
			    struct snd_pcm_hw_params *params,
			    struct snd_soc_dai *dai)
{}

static int rt274_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{}

static int rt274_set_dai_pll(struct snd_soc_dai *dai, int pll_id, int source,
			unsigned int freq_in, unsigned int freq_out)
{}

static int rt274_set_dai_sysclk(struct snd_soc_dai *dai,
				int clk_id, unsigned int freq, int dir)
{}

static int rt274_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio)
{}

static int rt274_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
			unsigned int rx_mask, int slots, int slot_width)

{}

static int rt274_set_bias_level(struct snd_soc_component *component,
				 enum snd_soc_bias_level level)
{}

static irqreturn_t rt274_irq(int irq, void *data)
{}

static int rt274_probe(struct snd_soc_component *component)
{}

static void rt274_remove(struct snd_soc_component *component)
{}

#ifdef CONFIG_PM
static int rt274_suspend(struct snd_soc_component *component)
{}

static int rt274_resume(struct snd_soc_component *component)
{}
#else
#define rt274_suspend
#define rt274_resume
#endif

#define RT274_STEREO_RATES
#define RT274_FORMATS

static const struct snd_soc_dai_ops rt274_aif_dai_ops =;

static struct snd_soc_dai_driver rt274_dai[] =;

static const struct snd_soc_component_driver soc_component_dev_rt274 =;

static const struct regmap_config rt274_regmap =;

#ifdef CONFIG_OF
static const struct of_device_id rt274_of_match[] =;
MODULE_DEVICE_TABLE(of, rt274_of_match);
#endif

static const struct i2c_device_id rt274_i2c_id[] =;
MODULE_DEVICE_TABLE(i2c, rt274_i2c_id);

#ifdef CONFIG_ACPI
static const struct acpi_device_id rt274_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, rt274_acpi_match);
#endif

static int rt274_i2c_probe(struct i2c_client *i2c)
{}

static void rt274_i2c_remove(struct i2c_client *i2c)
{}


static struct i2c_driver rt274_i2c_driver =;

module_i2c_driver();

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