linux/sound/soc/codecs/cs35l36.c

// SPDX-License-Identifier: GPL-2.0
//
// cs35l36.c -- CS35L36 ALSA SoC audio driver
//
// Copyright 2018 Cirrus Logic, Inc.
//
// Author: James Schulman <[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/workqueue.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
#include <linux/gpio/consumer.h>
#include <linux/irq.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/cs35l36.h>
#include <linux/completion.h>

#include "cs35l36.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 CS35L36_VALID_PDATA

static const char * const cs35l36_supplies[] =;

struct  cs35l36_private {};

struct cs35l36_pll_config {};

static const struct cs35l36_pll_config cs35l36_pll_sysclk[] =;

static struct reg_default cs35l36_reg[] =;

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

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

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

static const DECLARE_TLV_DB_RANGE(dig_vol_tlv, 0, 912,
				  TLV_DB_MINMAX_ITEM(-10200, 1200));
static DECLARE_TLV_DB_SCALE(amp_gain_tlv, 0, 1, 1);

static const char * const cs35l36_pcm_sftramp_text[] =;

static SOC_ENUM_SINGLE_DECL(pcm_sft_ramp, CS35L36_AMP_DIG_VOL_CTRL, 0,
			    cs35l36_pcm_sftramp_text);

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

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

static const struct snd_kcontrol_new cs35l36_aud_controls[] =;

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

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

static const char * const cs35l36_chan_text[] =;

static SOC_ENUM_SINGLE_DECL(chansel_enum, CS35L36_ASP_RX1_SLOT, 0,
			    cs35l36_chan_text);

static const struct snd_kcontrol_new cs35l36_chan_mux =;

static const struct snd_kcontrol_new amp_enable_ctrl =;

static const struct snd_kcontrol_new boost_ctrl =;

static const char * const asp_tx_src_text[] =;

static const unsigned int asp_tx_src_values[] =;

static SOC_VALUE_ENUM_SINGLE_DECL(asp_tx1_src_enum, CS35L36_ASP_TX1_SEL, 0,
				  CS35L36_APS_TX_SEL_MASK, asp_tx_src_text,
				  asp_tx_src_values);

static const struct snd_kcontrol_new asp_tx1_src =;

static SOC_VALUE_ENUM_SINGLE_DECL(asp_tx2_src_enum, CS35L36_ASP_TX2_SEL, 0,
				  CS35L36_APS_TX_SEL_MASK, asp_tx_src_text,
				  asp_tx_src_values);

static const struct snd_kcontrol_new asp_tx2_src =;

static SOC_VALUE_ENUM_SINGLE_DECL(asp_tx3_src_enum, CS35L36_ASP_TX3_SEL, 0,
				  CS35L36_APS_TX_SEL_MASK, asp_tx_src_text,
				  asp_tx_src_values);

static const struct snd_kcontrol_new asp_tx3_src =;

static SOC_VALUE_ENUM_SINGLE_DECL(asp_tx4_src_enum, CS35L36_ASP_TX4_SEL, 0,
				  CS35L36_APS_TX_SEL_MASK, asp_tx_src_text,
				  asp_tx_src_values);

static const struct snd_kcontrol_new asp_tx4_src =;

static SOC_VALUE_ENUM_SINGLE_DECL(asp_tx5_src_enum, CS35L36_ASP_TX5_SEL, 0,
				  CS35L36_APS_TX_SEL_MASK, asp_tx_src_text,
				  asp_tx_src_values);

static const struct snd_kcontrol_new asp_tx5_src =;

static SOC_VALUE_ENUM_SINGLE_DECL(asp_tx6_src_enum, CS35L36_ASP_TX6_SEL, 0,
				  CS35L36_APS_TX_SEL_MASK, asp_tx_src_text,
				  asp_tx_src_values);

static const struct snd_kcontrol_new asp_tx6_src =;

static const struct snd_soc_dapm_widget cs35l36_dapm_widgets[] =;

static const struct snd_soc_dapm_route cs35l36_audio_map[] =;

static int cs35l36_set_dai_fmt(struct snd_soc_dai *component_dai,
			       unsigned int fmt)
{}

struct cs35l36_global_fs_config {};

static const struct cs35l36_global_fs_config cs35l36_fs_rates[] =;

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

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

static const struct cs35l36_pll_config *cs35l36_get_clk_config(
		struct cs35l36_private *cs35l36, int freq)
{}

static const unsigned int cs35l36_src_rates[] =;

static const struct snd_pcm_hw_constraint_list cs35l36_constraints =;

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

static const struct snd_soc_dai_ops cs35l36_ops =;

static struct snd_soc_dai_driver cs35l36_dai[] =;

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

static int cs35l36_boost_inductor(struct cs35l36_private *cs35l36, int inductor)
{}

static int cs35l36_component_probe(struct snd_soc_component *component)
{}

static const struct snd_soc_component_driver soc_component_dev_cs35l36 =;

static const struct regmap_config cs35l36_regmap =;

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

static int cs35l36_handle_of_data(struct i2c_client *i2c_client,
				struct cs35l36_platform_data *pdata)
{}

static int cs35l36_pac(struct cs35l36_private *cs35l36)
{}

static void cs35l36_apply_vpbr_config(struct cs35l36_private *cs35l36)
{}

static const struct reg_sequence cs35l36_reva0_errata_patch[] =;

static const struct reg_sequence cs35l36_revb0_errata_patch[] =;

static int cs35l36_i2c_probe(struct i2c_client *i2c_client)
{}

static void cs35l36_i2c_remove(struct i2c_client *client)
{}
static const struct of_device_id cs35l36_of_match[] =;
MODULE_DEVICE_TABLE(of, cs35l36_of_match);

static const struct i2c_device_id cs35l36_id[] =;

MODULE_DEVICE_TABLE(i2c, cs35l36_id);

static struct i2c_driver cs35l36_i2c_driver =;
module_i2c_driver();

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