linux/sound/soc/soc-component.c

// SPDX-License-Identifier: GPL-2.0
//
// soc-component.c
//
// Copyright 2009-2011 Wolfson Microelectronics PLC.
// Copyright (C) 2019 Renesas Electronics Corp.
//
// Mark Brown <[email protected]>
// Kuninori Morimoto <[email protected]>
//
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <sound/soc.h>
#include <linux/bitops.h>

#define soc_component_ret(dai, ret)
#define soc_component_ret_reg_rw(dai, ret, reg)
static inline int _soc_component_ret(struct snd_soc_component *component,
				     const char *func, int ret, int reg)
{}

static inline int soc_component_field_shift(struct snd_soc_component *component,
					    unsigned int mask)
{}

/*
 * We might want to check substream by using list.
 * In such case, we can update these macros.
 */
#define soc_component_mark_push(component, substream, tgt)
#define soc_component_mark_pop(component, substream, tgt)
#define soc_component_mark_match(component, substream, tgt)

void snd_soc_component_set_aux(struct snd_soc_component *component,
			       struct snd_soc_aux_dev *aux)
{}

int snd_soc_component_init(struct snd_soc_component *component)
{}

/**
 * snd_soc_component_set_sysclk - configure COMPONENT system or master clock.
 * @component: COMPONENT
 * @clk_id: DAI specific clock ID
 * @source: Source for the clock
 * @freq: new clock frequency in Hz
 * @dir: new clock direction - input/output.
 *
 * Configures the CODEC master (MCLK) or system (SYSCLK) clocking.
 */
int snd_soc_component_set_sysclk(struct snd_soc_component *component,
				 int clk_id, int source, unsigned int freq,
				 int dir)
{}
EXPORT_SYMBOL_GPL();

/*
 * snd_soc_component_set_pll - configure component PLL.
 * @component: COMPONENT
 * @pll_id: DAI specific PLL ID
 * @source: DAI specific source for the PLL
 * @freq_in: PLL input clock frequency in Hz
 * @freq_out: requested PLL output clock frequency in Hz
 *
 * Configures and enables PLL to generate output clock based on input clock.
 */
int snd_soc_component_set_pll(struct snd_soc_component *component, int pll_id,
			      int source, unsigned int freq_in,
			      unsigned int freq_out)
{}
EXPORT_SYMBOL_GPL();

void snd_soc_component_seq_notifier(struct snd_soc_component *component,
				    enum snd_soc_dapm_type type, int subseq)
{}

int snd_soc_component_stream_event(struct snd_soc_component *component,
				   int event)
{}

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

int snd_soc_component_enable_pin(struct snd_soc_component *component,
				 const char *pin)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_enable_pin_unlocked(struct snd_soc_component *component,
					  const char *pin)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_disable_pin(struct snd_soc_component *component,
				  const char *pin)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_disable_pin_unlocked(struct snd_soc_component *component,
					   const char *pin)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_nc_pin(struct snd_soc_component *component,
			     const char *pin)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_nc_pin_unlocked(struct snd_soc_component *component,
				      const char *pin)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_get_pin_status(struct snd_soc_component *component,
				     const char *pin)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_force_enable_pin(struct snd_soc_component *component,
				       const char *pin)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_force_enable_pin_unlocked(
	struct snd_soc_component *component,
	const char *pin)
{}
EXPORT_SYMBOL_GPL();

static void soc_get_kcontrol_name(struct snd_soc_component *component,
				  char *buf, int size, const char * const ctl)
{}

struct snd_kcontrol *snd_soc_component_get_kcontrol(struct snd_soc_component *component,
						    const char * const ctl)
{}
EXPORT_SYMBOL_GPL();

struct snd_kcontrol *
snd_soc_component_get_kcontrol_locked(struct snd_soc_component *component,
				      const char * const ctl)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_notify_control(struct snd_soc_component *component,
				     const char * const ctl)
{}
EXPORT_SYMBOL_GPL();

/**
 * snd_soc_component_set_jack - configure component jack.
 * @component: COMPONENTs
 * @jack: structure to use for the jack
 * @data: can be used if codec driver need extra data for configuring jack
 *
 * Configures and enables jack detection function.
 */
int snd_soc_component_set_jack(struct snd_soc_component *component,
			       struct snd_soc_jack *jack, void *data)
{}
EXPORT_SYMBOL_GPL();

/**
 * snd_soc_component_get_jack_type
 * @component: COMPONENTs
 *
 * Returns the jack type of the component
 * This can either be the supported type or one read from
 * devicetree with the property: jack-type.
 */
int snd_soc_component_get_jack_type(
	struct snd_soc_component *component)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_module_get(struct snd_soc_component *component,
				 void *mark, int upon_open)
{}

void snd_soc_component_module_put(struct snd_soc_component *component,
				  void *mark, int upon_open, int rollback)
{}

int snd_soc_component_open(struct snd_soc_component *component,
			   struct snd_pcm_substream *substream)
{}

int snd_soc_component_close(struct snd_soc_component *component,
			    struct snd_pcm_substream *substream,
			    int rollback)
{}

void snd_soc_component_suspend(struct snd_soc_component *component)
{}

void snd_soc_component_resume(struct snd_soc_component *component)
{}

int snd_soc_component_is_suspended(struct snd_soc_component *component)
{}

int snd_soc_component_probe(struct snd_soc_component *component)
{}

void snd_soc_component_remove(struct snd_soc_component *component)
{}

int snd_soc_component_of_xlate_dai_id(struct snd_soc_component *component,
				      struct device_node *ep)
{}

int snd_soc_component_of_xlate_dai_name(struct snd_soc_component *component,
					const struct of_phandle_args *args,
					const char **dai_name)
{}

void snd_soc_component_setup_regmap(struct snd_soc_component *component)
{}

#ifdef CONFIG_REGMAP

/**
 * snd_soc_component_init_regmap() - Initialize regmap instance for the
 *                                   component
 * @component: The component for which to initialize the regmap instance
 * @regmap: The regmap instance that should be used by the component
 *
 * This function allows deferred assignment of the regmap instance that is
 * associated with the component. Only use this if the regmap instance is not
 * yet ready when the component is registered. The function must also be called
 * before the first IO attempt of the component.
 */
void snd_soc_component_init_regmap(struct snd_soc_component *component,
				   struct regmap *regmap)
{}
EXPORT_SYMBOL_GPL();

/**
 * snd_soc_component_exit_regmap() - De-initialize regmap instance for the
 *                                   component
 * @component: The component for which to de-initialize the regmap instance
 *
 * Calls regmap_exit() on the regmap instance associated to the component and
 * removes the regmap instance from the component.
 *
 * This function should only be used if snd_soc_component_init_regmap() was used
 * to initialize the regmap instance.
 */
void snd_soc_component_exit_regmap(struct snd_soc_component *component)
{}
EXPORT_SYMBOL_GPL();

#endif

int snd_soc_component_compr_open(struct snd_soc_component *component,
				 struct snd_compr_stream *cstream)
{}
EXPORT_SYMBOL_GPL();

void snd_soc_component_compr_free(struct snd_soc_component *component,
				  struct snd_compr_stream *cstream,
				  int rollback)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_compr_trigger(struct snd_compr_stream *cstream, int cmd)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_compr_set_params(struct snd_compr_stream *cstream,
				       struct snd_compr_params *params)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_compr_get_params(struct snd_compr_stream *cstream,
				       struct snd_codec *params)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_compr_get_caps(struct snd_compr_stream *cstream,
				     struct snd_compr_caps *caps)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_compr_get_codec_caps(struct snd_compr_stream *cstream,
					   struct snd_compr_codec_caps *codec)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_compr_ack(struct snd_compr_stream *cstream, size_t bytes)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_compr_pointer(struct snd_compr_stream *cstream,
				    struct snd_compr_tstamp *tstamp)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_compr_copy(struct snd_compr_stream *cstream,
				 char __user *buf, size_t count)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_compr_set_metadata(struct snd_compr_stream *cstream,
					 struct snd_compr_metadata *metadata)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_component_compr_get_metadata(struct snd_compr_stream *cstream,
					 struct snd_compr_metadata *metadata)
{}
EXPORT_SYMBOL_GPL();

static unsigned int soc_component_read_no_lock(
	struct snd_soc_component *component,
	unsigned int reg)
{}

/**
 * snd_soc_component_read() - Read register value
 * @component: Component to read from
 * @reg: Register to read
 *
 * Return: read value
 */
unsigned int snd_soc_component_read(struct snd_soc_component *component,
				    unsigned int reg)
{}
EXPORT_SYMBOL_GPL();

static int soc_component_write_no_lock(
	struct snd_soc_component *component,
	unsigned int reg, unsigned int val)
{}

/**
 * snd_soc_component_write() - Write register value
 * @component: Component to write to
 * @reg: Register to write
 * @val: Value to write to the register
 *
 * Return: 0 on success, a negative error code otherwise.
 */
int snd_soc_component_write(struct snd_soc_component *component,
			    unsigned int reg, unsigned int val)
{}
EXPORT_SYMBOL_GPL();

static int snd_soc_component_update_bits_legacy(
	struct snd_soc_component *component, unsigned int reg,
	unsigned int mask, unsigned int val, bool *change)
{}

/**
 * snd_soc_component_update_bits() - Perform read/modify/write cycle
 * @component: Component to update
 * @reg: Register to update
 * @mask: Mask that specifies which bits to update
 * @val: New value for the bits specified by mask
 *
 * Return: 1 if the operation was successful and the value of the register
 * changed, 0 if the operation was successful, but the value did not change.
 * Returns a negative error code otherwise.
 */
int snd_soc_component_update_bits(struct snd_soc_component *component,
				  unsigned int reg, unsigned int mask, unsigned int val)
{}
EXPORT_SYMBOL_GPL();

/**
 * snd_soc_component_update_bits_async() - Perform asynchronous
 *  read/modify/write cycle
 * @component: Component to update
 * @reg: Register to update
 * @mask: Mask that specifies which bits to update
 * @val: New value for the bits specified by mask
 *
 * This function is similar to snd_soc_component_update_bits(), but the update
 * operation is scheduled asynchronously. This means it may not be completed
 * when the function returns. To make sure that all scheduled updates have been
 * completed snd_soc_component_async_complete() must be called.
 *
 * Return: 1 if the operation was successful and the value of the register
 * changed, 0 if the operation was successful, but the value did not change.
 * Returns a negative error code otherwise.
 */
int snd_soc_component_update_bits_async(struct snd_soc_component *component,
					unsigned int reg, unsigned int mask, unsigned int val)
{}
EXPORT_SYMBOL_GPL();

/**
 * snd_soc_component_read_field() - Read register field value
 * @component: Component to read from
 * @reg: Register to read
 * @mask: mask of the register field
 *
 * Return: read value of register field.
 */
unsigned int snd_soc_component_read_field(struct snd_soc_component *component,
					  unsigned int reg, unsigned int mask)
{}
EXPORT_SYMBOL_GPL();

/**
 * snd_soc_component_write_field() - write to register field
 * @component: Component to write to
 * @reg: Register to write
 * @mask: mask of the register field to update
 * @val: value of the field to write
 *
 * Return: 1 for change, otherwise 0.
 */
int snd_soc_component_write_field(struct snd_soc_component *component,
				  unsigned int reg, unsigned int mask,
				  unsigned int val)
{}
EXPORT_SYMBOL_GPL();

/**
 * snd_soc_component_async_complete() - Ensure asynchronous I/O has completed
 * @component: Component for which to wait
 *
 * This function blocks until all asynchronous I/O which has previously been
 * scheduled using snd_soc_component_update_bits_async() has completed.
 */
void snd_soc_component_async_complete(struct snd_soc_component *component)
{}
EXPORT_SYMBOL_GPL();

/**
 * snd_soc_component_test_bits - Test register for change
 * @component: component
 * @reg: Register to test
 * @mask: Mask that specifies which bits to test
 * @value: Value to test against
 *
 * Tests a register with a new value and checks if the new value is
 * different from the old value.
 *
 * Return: 1 for change, otherwise 0.
 */
int snd_soc_component_test_bits(struct snd_soc_component *component,
				unsigned int reg, unsigned int mask, unsigned int value)
{}
EXPORT_SYMBOL_GPL();

int snd_soc_pcm_component_pointer(struct snd_pcm_substream *substream)
{}

static bool snd_soc_component_is_codec_on_rtd(struct snd_soc_pcm_runtime *rtd,
					      struct snd_soc_component *component)
{}

void snd_soc_pcm_component_delay(struct snd_pcm_substream *substream,
				 snd_pcm_sframes_t *cpu_delay,
				 snd_pcm_sframes_t *codec_delay)
{}

int snd_soc_pcm_component_ioctl(struct snd_pcm_substream *substream,
				unsigned int cmd, void *arg)
{}

int snd_soc_pcm_component_sync_stop(struct snd_pcm_substream *substream)
{}

int snd_soc_pcm_component_copy(struct snd_pcm_substream *substream,
			       int channel, unsigned long pos,
			       struct iov_iter *iter, unsigned long bytes)
{}

struct page *snd_soc_pcm_component_page(struct snd_pcm_substream *substream,
					unsigned long offset)
{}

int snd_soc_pcm_component_mmap(struct snd_pcm_substream *substream,
			       struct vm_area_struct *vma)
{}

int snd_soc_pcm_component_new(struct snd_soc_pcm_runtime *rtd)
{}

void snd_soc_pcm_component_free(struct snd_soc_pcm_runtime *rtd)
{}

int snd_soc_pcm_component_prepare(struct snd_pcm_substream *substream)
{}

int snd_soc_pcm_component_hw_params(struct snd_pcm_substream *substream,
				    struct snd_pcm_hw_params *params)
{}

void snd_soc_pcm_component_hw_free(struct snd_pcm_substream *substream,
				   int rollback)
{}

static int soc_component_trigger(struct snd_soc_component *component,
				 struct snd_pcm_substream *substream,
				 int cmd)
{}

int snd_soc_pcm_component_trigger(struct snd_pcm_substream *substream,
				  int cmd, int rollback)
{}

int snd_soc_pcm_component_pm_runtime_get(struct snd_soc_pcm_runtime *rtd,
					 void *stream)
{}

void snd_soc_pcm_component_pm_runtime_put(struct snd_soc_pcm_runtime *rtd,
					  void *stream, int rollback)
{}

int snd_soc_pcm_component_ack(struct snd_pcm_substream *substream)
{}