linux/sound/soc/codecs/cs35l41-lib.c

// SPDX-License-Identifier: GPL-2.0
//
// cs35l41-lib.c -- CS35L41 Common functions for HDA and ASoC Audio drivers
//
// Copyright 2017-2021 Cirrus Logic, Inc.
//
// Author: David Rhodes <[email protected]>
// Author: Lucas Tanure <[email protected]>

#include <linux/dev_printk.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/firmware/cirrus/wmfw.h>

#include <sound/cs35l41.h>

#define CS35L41_FIRMWARE_OLD_VERSION

static const struct reg_default cs35l41_reg[] =;

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

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

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

static const struct cs35l41_otp_packed_element_t otp_map_1[] =;

static const struct cs35l41_otp_packed_element_t otp_map_2[] =;

static const struct reg_sequence cs35l41_reva0_errata_patch[] =;

static const struct reg_sequence cs35l41_revb0_errata_patch[] =;

static const struct reg_sequence cs35l41_revb2_errata_patch[] =;

static const struct reg_sequence cs35l41_fs_errata_patch[] =;

static const struct cs35l41_otp_map_element_t cs35l41_otp_map_map[] =;

struct regmap_config cs35l41_regmap_i2c =;
EXPORT_SYMBOL_GPL();

struct regmap_config cs35l41_regmap_spi =;
EXPORT_SYMBOL_GPL();

static const struct cs35l41_otp_map_element_t *cs35l41_find_otp_map(u32 otp_id)
{}

int cs35l41_test_key_unlock(struct device *dev, struct regmap *regmap)
{}
EXPORT_SYMBOL_GPL();

int cs35l41_test_key_lock(struct device *dev, struct regmap *regmap)
{}
EXPORT_SYMBOL_GPL();

/* Must be called with the TEST_KEY unlocked */
int cs35l41_otp_unpack(struct device *dev, struct regmap *regmap)
{}
EXPORT_SYMBOL_GPL();

/* Must be called with the TEST_KEY unlocked */
int cs35l41_register_errata_patch(struct device *dev, struct regmap *reg, unsigned int reg_revid)
{}
EXPORT_SYMBOL_GPL();

int cs35l41_set_channels(struct device *dev, struct regmap *reg,
			 unsigned int tx_num, const unsigned int *tx_slot,
			 unsigned int rx_num, const unsigned int *rx_slot)
{}
EXPORT_SYMBOL_GPL();

static const unsigned char cs35l41_bst_k1_table[4][5] =;

static const unsigned char cs35l41_bst_k2_table[4][5] =;

static const unsigned char cs35l41_bst_slope_table[4] =;

static int cs35l41_boost_config(struct device *dev, struct regmap *regmap, int boost_ind,
				int boost_cap, int boost_ipk)
{}

static const struct reg_sequence cs35l41_safe_to_reset[] =;

static const struct reg_sequence cs35l41_active_to_safe_start[] =;

static const struct reg_sequence cs35l41_active_to_safe_end[] =;

static const struct reg_sequence cs35l41_safe_to_active_start[] =;

static const struct reg_sequence cs35l41_safe_to_active_en_spk[] =;

static const struct reg_sequence cs35l41_reset_to_safe[] =;

static const struct reg_sequence cs35l41_actv_seq[] =;

static const struct reg_sequence cs35l41_pass_seq[] =;

int cs35l41_init_boost(struct device *dev, struct regmap *regmap,
		       struct cs35l41_hw_cfg *hw_cfg)
{}
EXPORT_SYMBOL_GPL();

bool cs35l41_safe_reset(struct regmap *regmap, enum cs35l41_boost_type b_type)
{}
EXPORT_SYMBOL_GPL();

/*
 * Enabling the CS35L41_SHD_BOOST_ACTV and CS35L41_SHD_BOOST_PASS shared boosts
 * does also require a call to cs35l41_mdsync_up(), but not before getting the
 * PLL Lock signal.
 *
 * PLL Lock seems to be triggered soon after snd_pcm_start() is executed and
 * SNDRV_PCM_TRIGGER_START command is processed, which happens (long) after the
 * SND_SOC_DAPM_PRE_PMU event handler is invoked as part of snd_pcm_prepare().
 *
 * This event handler is where cs35l41_global_enable() is normally called from,
 * but waiting for PLL Lock here will time out. Increasing the wait duration
 * will not help, as the only consequence of it would be to add an unnecessary
 * delay in the invocation of snd_pcm_start().
 *
 * Trying to move the wait in the SNDRV_PCM_TRIGGER_START callback is not a
 * solution either, as the trigger is executed in an IRQ-off atomic context.
 *
 * The current approach is to invoke cs35l41_mdsync_up() right after receiving
 * the PLL Lock interrupt, in the IRQ handler.
 */
int cs35l41_global_enable(struct device *dev, struct regmap *regmap, enum cs35l41_boost_type b_type,
			  int enable, struct cs_dsp *dsp)
{}
EXPORT_SYMBOL_GPL();

/*
 * To be called after receiving the IRQ Lock interrupt, in order to complete
 * any shared boost activation initiated by cs35l41_global_enable().
 */
int cs35l41_mdsync_up(struct regmap *regmap)
{}
EXPORT_SYMBOL_GPL();

int cs35l41_gpio_config(struct regmap *regmap, struct cs35l41_hw_cfg *hw_cfg)
{}
EXPORT_SYMBOL_GPL();

static const struct cs_dsp_region cs35l41_dsp1_regions[] =;

void cs35l41_configure_cs_dsp(struct device *dev, struct regmap *reg, struct cs_dsp *dsp)
{}
EXPORT_SYMBOL_GPL();

static bool cs35l41_check_cspl_mbox_sts(enum cs35l41_cspl_mbox_cmd cmd,
					enum cs35l41_cspl_mbox_status sts)
{}

int cs35l41_set_cspl_mbox_cmd(struct device *dev, struct regmap *regmap,
			      enum cs35l41_cspl_mbox_cmd cmd)
{}
EXPORT_SYMBOL_GPL();

int cs35l41_write_fs_errata(struct device *dev, struct regmap *regmap)
{}
EXPORT_SYMBOL_GPL();

int cs35l41_enter_hibernate(struct device *dev, struct regmap *regmap,
			    enum cs35l41_boost_type b_type)
{}
EXPORT_SYMBOL_GPL();

static void cs35l41_wait_for_pwrmgt_sts(struct device *dev, struct regmap *regmap)
{}

int cs35l41_exit_hibernate(struct device *dev, struct regmap *regmap)
{}
EXPORT_SYMBOL_GPL();

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