linux/sound/soc/codecs/cs35l35.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * cs35l35.c -- CS35L35 ALSA SoC audio driver
 *
 * Copyright 2017 Cirrus Logic, Inc.
 *
 * Author: Brian Austin <[email protected]>
 */

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
#include <linux/gpio/consumer.h>
#include <linux/of.h>
#include <linux/regmap.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/cs35l35.h>
#include <linux/completion.h>

#include "cs35l35.h"
#include "cirrus_legacy.h"

/*
 * Some fields take zero as a valid value so use a high bit flag that won't
 * get written to the device to mark those.
 */
#define CS35L35_VALID_PDATA

static const struct reg_default cs35l35_reg[] =;

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

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

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

static void cs35l35_reset(struct cs35l35_private *cs35l35)
{}

static int cs35l35_wait_for_pdn(struct cs35l35_private *cs35l35)
{}

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

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

static DECLARE_TLV_DB_SCALE(amp_gain_tlv, 0, 1, 1);
static DECLARE_TLV_DB_SCALE(dig_vol_tlv, -10200, 50, 0);

static const struct snd_kcontrol_new cs35l35_aud_controls[] =;

static const struct snd_kcontrol_new cs35l35_adv_controls[] =;

static const struct snd_soc_dapm_widget cs35l35_dapm_widgets[] =;

static const struct snd_soc_dapm_route cs35l35_audio_map[] =;

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

struct cs35l35_sysclk_config {};

static struct cs35l35_sysclk_config cs35l35_clk_ctl[] =;

static int cs35l35_get_clk_config(int sysclk, int srate)
{}

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

static const unsigned int cs35l35_src_rates[] =;

static const struct snd_pcm_hw_constraint_list cs35l35_constraints =;

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

static const unsigned int cs35l35_pdm_rates[] =;

static const struct snd_pcm_hw_constraint_list cs35l35_pdm_constraints =;

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

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

static const struct snd_soc_dai_ops cs35l35_ops =;

static const struct snd_soc_dai_ops cs35l35_pdm_ops =;

static struct snd_soc_dai_driver cs35l35_dai[] =;

static int cs35l35_component_set_sysclk(struct snd_soc_component *component,
				int clk_id, int source, unsigned int freq,
				int dir)
{}

static int cs35l35_boost_inductor(struct cs35l35_private *cs35l35,
				  int inductor)
{}

static int cs35l35_component_probe(struct snd_soc_component *component)
{}

static const struct snd_soc_component_driver soc_component_dev_cs35l35 =;

static const struct regmap_config cs35l35_regmap =;

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


static int cs35l35_handle_of_data(struct i2c_client *i2c_client,
				struct cs35l35_platform_data *pdata)
{}

/* Errata Rev A0 */
static const struct reg_sequence cs35l35_errata_patch[] =;

static int cs35l35_i2c_probe(struct i2c_client *i2c_client)
{}

static void cs35l35_i2c_remove(struct i2c_client *i2c_client)
{}

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

static const struct i2c_device_id cs35l35_id[] =;

MODULE_DEVICE_TABLE(i2c, cs35l35_id);

static struct i2c_driver cs35l35_i2c_driver =;

module_i2c_driver();

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