linux/sound/soc/codecs/max98363.c

// SPDX-License-Identifier: GPL-2.0-only
// Copyright (c) 2022, Analog Devices Inc.

#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/soundwire/sdw.h>
#include <linux/soundwire/sdw_registers.h>
#include <linux/soundwire/sdw_type.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/tlv.h>

#include "max98363.h"

static struct reg_default max98363_reg[] =;

static bool max98363_readable_register(struct device *dev, unsigned int reg)
{
	switch (reg) {
	case MAX98363_R2001_INTR_RAW:
	case MAX98363_R2003_INTR_STATE:
	case MAX98363_R2005_INTR_FALG:
	case MAX98363_R2007_INTR_EN:
	case MAX98363_R2009_INTR_CLR:
	case MAX98363_R2021_ERR_MON_CTRL ... MAX98363_R2023_SPK_MON_DURATION:
	case MAX98363_R2030_TONE_GEN_CFG:
	case MAX98363_R203F_TONE_GEN_EN:
	case MAX98363_R2040_AMP_VOL:
	case MAX98363_R2041_AMP_GAIN:
	case MAX98363_R2042_DSP_CFG:
	case MAX98363_R21FF_REV_ID:
		return true;
	default:
		return false;
	}
};

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

static const struct regmap_config max98363_sdw_regmap =;

static int max98363_suspend(struct device *dev)
{}

#define MAX98363_PROBE_TIMEOUT

static int max98363_resume(struct device *dev)
{}

static DEFINE_RUNTIME_DEV_PM_OPS(max98363_pm, max98363_suspend, max98363_resume, NULL);

static int max98363_read_prop(struct sdw_slave *slave)
{}

static int max98363_io_init(struct sdw_slave *slave)
{}

#define MAX98363_RATES
#define MAX98363_FORMATS

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

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

static int max98363_set_sdw_stream(struct snd_soc_dai *dai,
				   void *sdw_stream, int direction)
{}

static const struct snd_soc_dai_ops max98363_dai_sdw_ops =;

static struct snd_soc_dai_driver max98363_dai[] =;

static int max98363_update_status(struct sdw_slave *slave,
				  enum sdw_slave_status status)
{}

static const struct sdw_slave_ops max98363_slave_ops =;

static DECLARE_TLV_DB_SCALE(max98363_digital_tlv, -6350, 50, 1);
static const DECLARE_TLV_DB_RANGE(max98363_spk_tlv,
	0, 5, TLV_DB_SCALE_ITEM(-300, 300, 0),
);

static const char * const max98363_tone_cfg_text[] =;

static SOC_ENUM_SINGLE_DECL(max98363_tone_cfg_enum,
			    MAX98363_R2030_TONE_GEN_CFG, 0,
			    max98363_tone_cfg_text);

static const char * const max98363_spkmon_duration_text[] =;

static SOC_ENUM_SINGLE_DECL(max98363_spkmon_duration_enum,
			    MAX98363_R2023_SPK_MON_DURATION, 0,
			    max98363_spkmon_duration_text);

static const struct snd_kcontrol_new max98363_snd_controls[] =;

static const struct snd_soc_dapm_widget max98363_dapm_widgets[] =;

static const struct snd_soc_dapm_route max98363_audio_map[] =;

static const struct snd_soc_component_driver soc_codec_dev_max98363 =;

static int max98363_init(struct sdw_slave *slave, struct regmap *regmap)
{}

static int max98363_sdw_probe(struct sdw_slave *slave,
			      const struct sdw_device_id *id)
{}

static const struct sdw_device_id max98363_id[] =;
MODULE_DEVICE_TABLE(sdw, max98363_id);

static struct sdw_driver max98363_sdw_driver =;

module_sdw_driver();

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