linux/sound/soc/codecs/sma1303.c

// SPDX-License-Identifier: GPL-2.0-or-later
//
// sma1303.c -- sma1303 ALSA SoC Audio driver
//
// Copyright 2023 Iron Device Corporation
//
// Auther: Gyuhwa Park <[email protected]>
//         Kiseok Jo <[email protected]>

#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/i2c.h>
#include <linux/regmap.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include <linux/slab.h>
#include <asm/div64.h>

#include "sma1303.h"

#define CHECK_PERIOD_TIME
#define MAX_CONTROL_NAME

#define PLL_MATCH(_input_clk_name, _output_clk_name, _input_clk,\
		_post_n, _n, _vco,  _p_cp)

enum sma1303_type {};

struct sma1303_pll_match {};

struct sma1303_priv {};

static struct sma1303_pll_match sma1303_pll_matches[] =;

static int sma1303_startup(struct snd_soc_component *);
static int sma1303_shutdown(struct snd_soc_component *);

static const struct reg_default sma1303_reg_def[] =;

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

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

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

static const DECLARE_TLV_DB_SCALE(sma1303_spk_tlv, -6000, 50, 0);

static int sma1303_regmap_write(struct sma1303_priv *sma1303,
				unsigned int reg, unsigned int val)
{}

static int sma1303_regmap_update_bits(struct sma1303_priv *sma1303,
	unsigned int reg, unsigned int mask, unsigned int val, bool *change)
{}

static int sma1303_regmap_read(struct sma1303_priv *sma1303,
			unsigned int reg, unsigned int *val)
{}

static const char * const sma1303_aif_in_source_text[] =;
static const char * const sma1303_aif_out_source_text[] =;
static const char * const sma1303_tdm_slot_text[] =;

static const struct soc_enum sma1303_aif_in_source_enum =;
static const struct soc_enum sma1303_aif_out_source_enum =;
static const struct soc_enum sma1303_tdm_slot_enum =;

static int sma1303_force_mute_get(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{}

static int sma1303_force_mute_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{}

static int sma1303_postscaler_get(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{}

static int sma1303_postscaler_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{}

static int sma1303_tdm_slot_rx_get(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{}

static int sma1303_tdm_slot_rx_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{}

static int sma1303_tdm_slot_tx_get(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{}

static int sma1303_tdm_slot_tx_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{}

static int sma1303_startup(struct snd_soc_component *component)
{}

static int sma1303_shutdown(struct snd_soc_component *component)
{}

static int sma1303_aif_in_event(struct snd_soc_dapm_widget *w,
			struct snd_kcontrol *kcontrol, int event)
{}

static int sma1303_aif_out_event(struct snd_soc_dapm_widget *w,
			struct snd_kcontrol *kcontrol, int event)
{}

static int sma1303_sdo_event(struct snd_soc_dapm_widget *w,
		struct snd_kcontrol *kcontrol, int event)
{}

static int sma1303_post_scaler_event(struct snd_soc_dapm_widget *w,
		struct snd_kcontrol *kcontrol, int event)
{}

static int sma1303_power_event(struct snd_soc_dapm_widget *w,
		struct snd_kcontrol *kcontrol, int event)
{}

static const struct snd_kcontrol_new sma1303_aif_in_source_control =;
static const struct snd_kcontrol_new sma1303_aif_out_source_control =;
static const struct snd_kcontrol_new sma1303_sdo_control =;
static const struct snd_kcontrol_new sma1303_post_scaler_control =;
static const struct snd_kcontrol_new sma1303_enable_control =;

static const struct snd_kcontrol_new sma1303_snd_controls[] =;

static const struct snd_soc_dapm_widget sma1303_dapm_widgets[] =;

static const struct snd_soc_dapm_route sma1303_audio_map[] =;

static int sma1303_setup_pll(struct snd_soc_component *component,
		unsigned int bclk)
{}

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

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

static int sma1303_dai_mute(struct snd_soc_dai *dai, int mute, int stream)
{}

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

static int sma1303_dai_set_tdm_slot(struct snd_soc_dai *dai,
				unsigned int tx_mask, unsigned int rx_mask,
				int slots, int slot_width)
{}

static const struct snd_soc_dai_ops sma1303_dai_ops_amp =;

#define SMA1303_RATES
#define SMA1303_FORMATS

static struct snd_soc_dai_driver sma1303_dai[] =;

static void sma1303_check_fault_worker(struct work_struct *work)
{}

static int sma1303_probe(struct snd_soc_component *component)
{}

static void sma1303_remove(struct snd_soc_component *component)
{}

static const struct snd_soc_component_driver sma1303_component =;

static const struct regmap_config sma_i2c_regmap =;

static ssize_t check_fault_period_show(struct device *dev,
	struct device_attribute *devattr, char *buf)
{}

static ssize_t check_fault_period_store(struct device *dev,
	struct device_attribute *devattr, const char *buf, size_t count)
{}

static DEVICE_ATTR_RW(check_fault_period);

static ssize_t check_fault_status_show(struct device *dev,
	struct device_attribute *devattr, char *buf)
{}

static ssize_t check_fault_status_store(struct device *dev,
	struct device_attribute *devattr, const char *buf, size_t count)
{}

static DEVICE_ATTR_RW(check_fault_status);

static struct attribute *sma1303_attr[] =;

static struct attribute_group sma1303_attr_group =;

static int sma1303_i2c_probe(struct i2c_client *client)
{}

static void sma1303_i2c_remove(struct i2c_client *client)
{}

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

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

static struct i2c_driver sma1303_i2c_driver =;

module_i2c_driver();

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