linux/sound/soc/codecs/ssm2602.c

// SPDX-License-Identifier: GPL-2.0-or-later
//
// File:         sound/soc/codecs/ssm2602.c
// Author:       Cliff Cai <[email protected]>
//
// Created:      Tue June 06 2008
// Description:  Driver for ssm2602 sound chip
//
// Modified:
//               Copyright 2008 Analog Devices Inc.
//
// Bugs:         Enter bugs at http://blackfin.uclinux.org/

#include <linux/delay.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/slab.h>

#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/tlv.h>

#include "ssm2602.h"

/* codec private data */
struct ssm2602_priv {};

/*
 * ssm2602 register cache
 * We can't read the ssm2602 register space when we are
 * using 2 wire for device control, so we cache them instead.
 * There is no point in caching the reset register
 */
static const struct reg_default ssm2602_reg[SSM2602_CACHEREGNUM] =;

/*
 * ssm2602 register patch
 * Workaround for playback distortions after power up: activates digital
 * core, and then powers on output, DAC, and whole chip at the same time
 */

static const struct reg_sequence ssm2602_patch[] =;


/*Appending several "None"s just for OSS mixer use*/
static const char *ssm2602_input_select[] =;

static const char *ssm2602_deemph[] =;

static const struct soc_enum ssm2602_enum[] =;

static const DECLARE_TLV_DB_RANGE(ssm260x_outmix_tlv,
	0, 47, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 0),
	48, 127, TLV_DB_SCALE_ITEM(-7400, 100, 0)
);

static const DECLARE_TLV_DB_SCALE(ssm260x_inpga_tlv, -3450, 150, 0);
static const DECLARE_TLV_DB_SCALE(ssm260x_sidetone_tlv, -1500, 300, 0);

static const struct snd_kcontrol_new ssm260x_snd_controls[] =;

static const struct snd_kcontrol_new ssm2602_snd_controls[] =;

/* Output Mixer */
static const struct snd_kcontrol_new ssm260x_output_mixer_controls[] =;

static const struct snd_kcontrol_new mic_ctl =;

/* Input mux */
static const struct snd_kcontrol_new ssm2602_input_mux_controls =;

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

static const struct snd_soc_dapm_widget ssm260x_dapm_widgets[] =;

static const struct snd_soc_dapm_widget ssm2602_dapm_widgets[] =;

static const struct snd_soc_dapm_widget ssm2604_dapm_widgets[] =;

static const struct snd_soc_dapm_route ssm260x_routes[] =;

static const struct snd_soc_dapm_route ssm2602_routes[] =;

static const struct snd_soc_dapm_route ssm2604_routes[] =;

static const unsigned int ssm2602_rates_12288000[] =;

static const struct snd_pcm_hw_constraint_list ssm2602_constraints_12288000 =;

static const unsigned int ssm2602_rates_11289600[] =;

static const struct snd_pcm_hw_constraint_list ssm2602_constraints_11289600 =;

struct ssm2602_coeff {};

#define SSM2602_COEFF_SRATE(sr, bosr, usb)

/* codec mclk clock coefficients */
static const struct ssm2602_coeff ssm2602_coeff_table[] =;

static inline int ssm2602_get_coeff(int mclk, int rate)
{}

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

static int ssm2602_startup(struct snd_pcm_substream *substream,
			   struct snd_soc_dai *dai)
{}

static int ssm2602_mute(struct snd_soc_dai *dai, int mute, int direction)
{}

static int ssm2602_set_dai_sysclk(struct snd_soc_dai *codec_dai,
		int clk_id, unsigned int freq, int dir)
{}

static int ssm2602_set_dai_fmt(struct snd_soc_dai *codec_dai,
		unsigned int fmt)
{}

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

#define SSM2602_RATES

#define SSM2602_FORMATS

static const struct snd_soc_dai_ops ssm2602_dai_ops =;

static struct snd_soc_dai_driver ssm2602_dai =;

static int ssm2602_resume(struct snd_soc_component *component)
{}

static int ssm2602_component_probe(struct snd_soc_component *component)
{}

static int ssm2604_component_probe(struct snd_soc_component *component)
{}

static int ssm260x_component_probe(struct snd_soc_component *component)
{}

static const struct snd_soc_component_driver soc_component_dev_ssm2602 =;

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

const struct regmap_config ssm2602_regmap_config =;
EXPORT_SYMBOL_GPL();

int ssm2602_probe(struct device *dev, enum ssm2602_type type,
	struct regmap *regmap)
{}
EXPORT_SYMBOL_GPL();

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