linux/sound/soc/codecs/adau1701.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Driver for ADAU1701 SigmaDSP processor
 *
 * Copyright 2011 Analog Devices Inc.
 * Author: Lars-Peter Clausen <[email protected]>
 *	based on an inital version by Cliff Cai <[email protected]>
 */

#include <linux/module.h>
#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/gpio/consumer.h>
#include <linux/regulator/consumer.h>
#include <linux/regmap.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>

#include <asm/unaligned.h>

#include "sigmadsp.h"
#include "adau1701.h"

#define ADAU1701_SAFELOAD_DATA(i)
#define ADAU1701_SAFELOAD_ADDR(i)

#define ADAU1701_DSPCTRL
#define ADAU1701_SEROCTL
#define ADAU1701_SERICTL

#define ADAU1701_AUXNPOW
#define ADAU1701_PINCONF_0
#define ADAU1701_PINCONF_1
#define ADAU1701_AUXNPOW

#define ADAU1701_OSCIPOW
#define ADAU1701_DACSET

#define ADAU1701_MAX_REGISTER

#define ADAU1701_DSPCTRL_CR
#define ADAU1701_DSPCTRL_DAM
#define ADAU1701_DSPCTRL_ADM
#define ADAU1701_DSPCTRL_IST
#define ADAU1701_DSPCTRL_SR_48
#define ADAU1701_DSPCTRL_SR_96
#define ADAU1701_DSPCTRL_SR_192
#define ADAU1701_DSPCTRL_SR_MASK

#define ADAU1701_SEROCTL_INV_LRCLK
#define ADAU1701_SEROCTL_INV_BCLK
#define ADAU1701_SEROCTL_MASTER

#define ADAU1701_SEROCTL_OBF16
#define ADAU1701_SEROCTL_OBF8
#define ADAU1701_SEROCTL_OBF4
#define ADAU1701_SEROCTL_OBF2
#define ADAU1701_SEROCTL_OBF_MASK

#define ADAU1701_SEROCTL_OLF1024
#define ADAU1701_SEROCTL_OLF512
#define ADAU1701_SEROCTL_OLF256
#define ADAU1701_SEROCTL_OLF_MASK

#define ADAU1701_SEROCTL_MSB_DEALY1
#define ADAU1701_SEROCTL_MSB_DEALY0
#define ADAU1701_SEROCTL_MSB_DEALY8
#define ADAU1701_SEROCTL_MSB_DEALY12
#define ADAU1701_SEROCTL_MSB_DEALY16
#define ADAU1701_SEROCTL_MSB_DEALY_MASK

#define ADAU1701_SEROCTL_WORD_LEN_24
#define ADAU1701_SEROCTL_WORD_LEN_20
#define ADAU1701_SEROCTL_WORD_LEN_16
#define ADAU1701_SEROCTL_WORD_LEN_MASK

#define ADAU1701_AUXNPOW_VBPD
#define ADAU1701_AUXNPOW_VRPD

#define ADAU1701_SERICTL_I2S
#define ADAU1701_SERICTL_LEFTJ
#define ADAU1701_SERICTL_TDM
#define ADAU1701_SERICTL_RIGHTJ_24
#define ADAU1701_SERICTL_RIGHTJ_20
#define ADAU1701_SERICTL_RIGHTJ_18
#define ADAU1701_SERICTL_RIGHTJ_16
#define ADAU1701_SERICTL_MODE_MASK
#define ADAU1701_SERICTL_INV_BCLK
#define ADAU1701_SERICTL_INV_LRCLK

#define ADAU1701_OSCIPOW_OPD
#define ADAU1701_DACSET_DACINIT

#define ADAU1707_CLKDIV_UNSET

#define ADAU1701_FIRMWARE

static const char * const supply_names[] =;

struct adau1701 {};

static const struct snd_kcontrol_new adau1701_controls[] =;

static const struct snd_soc_dapm_widget adau1701_dapm_widgets[] =;

static const struct snd_soc_dapm_route adau1701_dapm_routes[] =;

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

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

static int adau1701_reg_write(void *context, unsigned int reg,
			      unsigned int value)
{}

static int adau1701_reg_read(void *context, unsigned int reg,
			     unsigned int *value)
{}

static int adau1701_safeload(struct sigmadsp *sigmadsp, unsigned int addr,
	const uint8_t bytes[], size_t len)
{}

static const struct sigmadsp_ops adau1701_sigmadsp_ops =;

static int adau1701_reset(struct snd_soc_component *component, unsigned int clkdiv,
	unsigned int rate)
{}

static int adau1701_set_capture_pcm_format(struct snd_soc_component *component,
					   struct snd_pcm_hw_params *params)
{}

static int adau1701_set_playback_pcm_format(struct snd_soc_component *component,
					    struct snd_pcm_hw_params *params)
{}

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

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

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

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

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

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

#define ADAU1701_RATES

#define ADAU1701_FORMATS

static const struct snd_soc_dai_ops adau1701_dai_ops =;

static struct snd_soc_dai_driver adau1701_dai =;

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

static int adau1701_probe(struct snd_soc_component *component)
{}

static void adau1701_remove(struct snd_soc_component *component)
{}

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

static int adau1701_resume(struct snd_soc_component *component)
{}
#else
#define adau1701_resume
#define adau1701_suspend
#endif /* CONFIG_PM */

static const struct snd_soc_component_driver adau1701_component_drv =;

static const struct regmap_config adau1701_regmap =;

static int adau1701_i2c_probe(struct i2c_client *client)
{}

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

static struct i2c_driver adau1701_i2c_driver =;

module_i2c_driver();

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