Unverified Commit 999f7f5a authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: remove Codec related code



Now no one is using Codec related code.
Let's remove all

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 11fb14f8
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -313,7 +313,6 @@ struct snd_soc_dai {
	unsigned int sample_bits;

	/* parent platform/codec */
	struct snd_soc_codec *codec;
	struct snd_soc_component *component;

	/* CODEC TDM slot masks and params (for fixup) */
+0 −265
Original line number Diff line number Diff line
@@ -402,8 +402,6 @@ struct snd_soc_pcm_runtime;
struct snd_soc_dai;
struct snd_soc_dai_driver;
struct snd_soc_dai_link;
struct snd_soc_codec;
struct snd_soc_codec_driver;
struct snd_soc_component;
struct snd_soc_component_driver;
struct soc_enum;
@@ -428,13 +426,6 @@ enum snd_soc_card_subclass {
	SND_SOC_CARD_CLASS_RUNTIME	= 1,
};

int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id,
			     int source, unsigned int freq, int dir);
int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source,
			  unsigned int freq_in, unsigned int freq_out);
int snd_soc_codec_set_jack(struct snd_soc_codec *codec,
			   struct snd_soc_jack *jack, void *data);

int snd_soc_register_card(struct snd_soc_card *card);
int snd_soc_unregister_card(struct snd_soc_card *card);
int devm_snd_soc_register_card(struct device *dev, struct snd_soc_card *card);
@@ -453,10 +444,6 @@ static inline int snd_soc_resume(struct device *dev)
}
#endif
int snd_soc_poweroff(struct device *dev);
int snd_soc_register_codec(struct device *dev,
		const struct snd_soc_codec_driver *codec_drv,
		struct snd_soc_dai_driver *dai_drv, int num_dai);
void snd_soc_unregister_codec(struct device *dev);
int snd_soc_add_component(struct device *dev,
		struct snd_soc_component *component,
		const struct snd_soc_component_driver *component_driver,
@@ -559,23 +546,7 @@ static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
}
#endif

/* codec register bit access */
int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned int reg,
				unsigned int mask, unsigned int value);
int snd_soc_update_bits_locked(struct snd_soc_codec *codec,
			       unsigned int reg, unsigned int mask,
			       unsigned int value);
int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg,
				unsigned int mask, unsigned int value);

#ifdef CONFIG_SND_SOC_AC97_BUS
#define snd_soc_alloc_ac97_codec(codec) \
	snd_soc_alloc_ac97_component(&codec->component)
#define snd_soc_new_ac97_codec(codec, id, id_mask) \
	snd_soc_new_ac97_component(&codec->component, id, id_mask)
#define snd_soc_free_ac97_codec(ac97) \
	snd_soc_free_ac97_component(ac97)

struct snd_ac97 *snd_soc_alloc_ac97_component(struct snd_soc_component *component);
struct snd_ac97 *snd_soc_new_ac97_component(struct snd_soc_component *component,
	unsigned int id, unsigned int id_mask);
@@ -609,8 +580,6 @@ struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card,
					       const char *name);
int snd_soc_add_component_controls(struct snd_soc_component *component,
	const struct snd_kcontrol_new *controls, unsigned int num_controls);
int snd_soc_add_codec_controls(struct snd_soc_codec *codec,
	const struct snd_kcontrol_new *controls, unsigned int num_controls);
int snd_soc_add_card_controls(struct snd_soc_card *soc_card,
	const struct snd_kcontrol_new *controls, int num_controls);
int snd_soc_add_dai_controls(struct snd_soc_dai *dai,
@@ -843,8 +812,6 @@ struct snd_soc_component {

	unsigned int active;

	unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */
	unsigned int registered_as_component:1;
	unsigned int suspended:1; /* is in suspend PM state */

	struct list_head list;
@@ -856,9 +823,6 @@ struct snd_soc_component {
	struct list_head dai_list;
	int num_dai;

	int (*read)(struct snd_soc_component *, unsigned int, unsigned int *);
	int (*write)(struct snd_soc_component *, unsigned int, unsigned int);

	struct regmap *regmap;
	int val_bytes;

@@ -880,22 +844,6 @@ struct snd_soc_component {
	/* Don't use these, use snd_soc_component_get_dapm() */
	struct snd_soc_dapm_context dapm;

	struct snd_soc_codec *codec;

	int (*probe)(struct snd_soc_component *);
	void (*remove)(struct snd_soc_component *);
	int (*suspend)(struct snd_soc_component *);
	int (*resume)(struct snd_soc_component *);

	int (*set_sysclk)(struct snd_soc_component *component,
			  int clk_id, int source, unsigned int freq, int dir);
	int (*set_pll)(struct snd_soc_component *component, int pll_id,
		       int source, unsigned int freq_in, unsigned int freq_out);
	int (*set_jack)(struct snd_soc_component *component,
			struct snd_soc_jack *jack,  void *data);
	int (*set_bias_level)(struct snd_soc_component *component,
			      enum snd_soc_bias_level level);

	/* machine specific init */
	int (*init)(struct snd_soc_component *component);

@@ -916,50 +864,6 @@ snd_soc_rtdcom_lookup(struct snd_soc_pcm_runtime *rtd,
#define for_each_rtdcom_safe(rtd, rtdcom1, rtdcom2) \
	list_for_each_entry_safe(rtdcom1, rtdcom2, &(rtd)->component_list, list)

/* SoC Audio Codec device */
struct snd_soc_codec {
	struct device *dev;
	const struct snd_soc_codec_driver *driver;

	struct list_head list;

	/* component */
	struct snd_soc_component component;
};

/* codec driver */
struct snd_soc_codec_driver {

	/* driver ops */
	int (*probe)(struct snd_soc_codec *);
	int (*remove)(struct snd_soc_codec *);
	int (*suspend)(struct snd_soc_codec *);
	int (*resume)(struct snd_soc_codec *);
	struct snd_soc_component_driver component_driver;

	/* codec wide operations */
	int (*set_sysclk)(struct snd_soc_codec *codec,
			  int clk_id, int source, unsigned int freq, int dir);
	int (*set_pll)(struct snd_soc_codec *codec, int pll_id, int source,
		unsigned int freq_in, unsigned int freq_out);
	int (*set_jack)(struct snd_soc_codec *codec,
			struct snd_soc_jack *jack,  void *data);

	unsigned int (*read)(struct snd_soc_codec *, unsigned int);
	int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);

	/* codec bias level */
	int (*set_bias_level)(struct snd_soc_codec *,
			      enum snd_soc_bias_level level);
	bool idle_bias_off;
	bool suspend_bias_off;

	void (*seq_notifier)(struct snd_soc_dapm_context *,
			     enum snd_soc_dapm_type, int);

	bool ignore_pmdown_time;  /* Doesn't benefit from pmdown delay */
};

struct snd_soc_dai_link_component {
	const char *name;
	struct device_node *of_node;
@@ -1213,7 +1117,6 @@ struct snd_soc_pcm_runtime {
	/* runtime devices */
	struct snd_pcm *pcm;
	struct snd_compr *compr;
	struct snd_soc_codec *codec;
	struct snd_soc_dai *codec_dai;
	struct snd_soc_dai *cpu_dai;

@@ -1281,19 +1184,6 @@ struct soc_enum {
	struct snd_soc_dobj dobj;
};

/**
 * snd_soc_component_to_codec() - Casts a component to the CODEC it is embedded in
 * @component: The component to cast to a CODEC
 *
 * This function must only be used on components that are known to be CODECs.
 * Otherwise the behavior is undefined.
 */
static inline struct snd_soc_codec *snd_soc_component_to_codec(
	struct snd_soc_component *component)
{
	return container_of(component, struct snd_soc_codec, component);
}

/**
 * snd_soc_dapm_to_component() - Casts a DAPM context to the component it is
 *  embedded in
@@ -1309,19 +1199,6 @@ static inline struct snd_soc_component *snd_soc_dapm_to_component(
	return container_of(dapm, struct snd_soc_component, dapm);
}

/**
 * snd_soc_dapm_to_codec() - Casts a DAPM context to the CODEC it is embedded in
 * @dapm: The DAPM context to cast to the CODEC
 *
 * This function must only be used on DAPM contexts that are known to be part of
 * a CODEC (e.g. in a CODEC driver). Otherwise the behavior is undefined.
 */
static inline struct snd_soc_codec *snd_soc_dapm_to_codec(
	struct snd_soc_dapm_context *dapm)
{
	return snd_soc_component_to_codec(snd_soc_dapm_to_component(dapm));
}

/**
 * snd_soc_component_get_dapm() - Returns the DAPM context associated with a
 *  component
@@ -1333,31 +1210,6 @@ static inline struct snd_soc_dapm_context *snd_soc_component_get_dapm(
	return &component->dapm;
}

/**
 * snd_soc_codec_get_dapm() - Returns the DAPM context for the CODEC
 * @codec: The CODEC for which to get the DAPM context
 *
 * Note: Use this function instead of directly accessing the CODEC's dapm field
 */
static inline struct snd_soc_dapm_context *snd_soc_codec_get_dapm(
	struct snd_soc_codec *codec)
{
	return snd_soc_component_get_dapm(&codec->component);
}

/**
 * snd_soc_dapm_init_bias_level() - Initialize CODEC DAPM bias level
 * @codec: The CODEC for which to initialize the DAPM bias level
 * @level: The DAPM level to initialize to
 *
 * Initializes the CODEC DAPM bias level. See snd_soc_dapm_init_bias_level().
 */
static inline void snd_soc_codec_init_bias_level(struct snd_soc_codec *codec,
	enum snd_soc_bias_level level)
{
	snd_soc_dapm_init_bias_level(snd_soc_codec_get_dapm(codec), level);
}

/**
 * snd_soc_component_init_bias_level() - Initialize COMPONENT DAPM bias level
 * @component: The COMPONENT for which to initialize the DAPM bias level
@@ -1373,18 +1225,6 @@ snd_soc_component_init_bias_level(struct snd_soc_component *component,
		snd_soc_component_get_dapm(component), level);
}

/**
 * snd_soc_dapm_get_bias_level() - Get current CODEC DAPM bias level
 * @codec: The CODEC for which to get the DAPM bias level
 *
 * Returns: The current DAPM bias level of the CODEC.
 */
static inline enum snd_soc_bias_level snd_soc_codec_get_bias_level(
	struct snd_soc_codec *codec)
{
	return snd_soc_dapm_get_bias_level(snd_soc_codec_get_dapm(codec));
}

/**
 * snd_soc_component_get_bias_level() - Get current COMPONENT DAPM bias level
 * @component: The COMPONENT for which to get the DAPM bias level
@@ -1398,21 +1238,6 @@ snd_soc_component_get_bias_level(struct snd_soc_component *component)
		snd_soc_component_get_dapm(component));
}

/**
 * snd_soc_codec_force_bias_level() - Set the CODEC DAPM bias level
 * @codec: The CODEC for which to set the level
 * @level: The level to set to
 *
 * Forces the CODEC bias level to a specific state. See
 * snd_soc_dapm_force_bias_level().
 */
static inline int snd_soc_codec_force_bias_level(struct snd_soc_codec *codec,
	enum snd_soc_bias_level level)
{
	return snd_soc_dapm_force_bias_level(snd_soc_codec_get_dapm(codec),
		level);
}

/**
 * snd_soc_component_force_bias_level() - Set the COMPONENT DAPM bias level
 * @component: The COMPONENT for which to set the level
@@ -1430,19 +1255,6 @@ snd_soc_component_force_bias_level(struct snd_soc_component *component,
		level);
}

/**
 * snd_soc_dapm_kcontrol_codec() - Returns the codec associated to a kcontrol
 * @kcontrol: The kcontrol
 *
 * This function must only be used on DAPM contexts that are known to be part of
 * a CODEC (e.g. in a CODEC driver). Otherwise the behavior is undefined.
 */
static inline struct snd_soc_codec *snd_soc_dapm_kcontrol_codec(
	struct snd_kcontrol *kcontrol)
{
	return snd_soc_dapm_to_codec(snd_soc_dapm_kcontrol_dapm(kcontrol));
}

/**
 * snd_soc_dapm_kcontrol_component() - Returns the component associated to a kcontrol
 * @kcontrol: The kcontrol
@@ -1456,22 +1268,6 @@ static inline struct snd_soc_component *snd_soc_dapm_kcontrol_component(
	return snd_soc_dapm_to_component(snd_soc_dapm_kcontrol_dapm(kcontrol));
}

/* codec IO */
unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg);
int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg,
	unsigned int val);

/**
 * snd_soc_cache_sync() - Sync the register cache with the hardware
 * @codec: CODEC to sync
 *
 * Note: This function will call regcache_sync()
 */
static inline int snd_soc_cache_sync(struct snd_soc_codec *codec)
{
	return regcache_sync(codec->component.regmap);
}

/**
 * snd_soc_component_cache_sync() - Sync the register cache with the hardware
 * @component: COMPONENT to sync
@@ -1514,37 +1310,6 @@ void snd_soc_component_init_regmap(struct snd_soc_component *component,
	struct regmap *regmap);
void snd_soc_component_exit_regmap(struct snd_soc_component *component);

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

/**
 * snd_soc_codec_exit_regmap() - De-initialize regmap instance for the CODEC
 * @codec: The CODEC for which to de-initialize the regmap instance
 *
 * Calls regmap_exit() on the regmap instance associated to the CODEC and
 * removes the regmap instance from the CODEC.
 *
 * This function should only be used if snd_soc_codec_init_regmap() was used to
 * initialize the regmap instance.
 */
static inline void snd_soc_codec_exit_regmap(struct snd_soc_codec *codec)
{
	snd_soc_component_exit_regmap(&codec->component);
}

#endif

/* device driver data */
@@ -1571,17 +1336,6 @@ static inline void *snd_soc_component_get_drvdata(struct snd_soc_component *c)
	return dev_get_drvdata(c->dev);
}

static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec,
		void *data)
{
	snd_soc_component_set_drvdata(&codec->component, data);
}

static inline void *snd_soc_codec_get_drvdata(struct snd_soc_codec *codec)
{
	return snd_soc_component_get_drvdata(&codec->component);
}

static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card)
{
	INIT_LIST_HEAD(&card->widgets);
@@ -1633,11 +1387,6 @@ static inline bool snd_soc_component_is_active(
	return component->active != 0;
}

static inline bool snd_soc_codec_is_active(struct snd_soc_codec *codec)
{
	return snd_soc_component_is_active(&codec->component);
}

/**
 * snd_soc_kcontrol_component() - Returns the component that registered the
 *  control
@@ -1654,20 +1403,6 @@ static inline struct snd_soc_component *snd_soc_kcontrol_component(
	return snd_kcontrol_chip(kcontrol);
}

/**
 * snd_soc_kcontrol_codec() - Returns the CODEC that registered the control
 * @kcontrol: The control for which to get the CODEC
 *
 * Note: This function will only work correctly if the control has been
 * registered with snd_soc_add_codec_controls() or via table based setup of
 * snd_soc_codec_driver. Otherwise the behavior is undefined.
 */
static inline struct snd_soc_codec *snd_soc_kcontrol_codec(
	struct snd_kcontrol *kcontrol)
{
	return snd_soc_component_to_codec(snd_soc_kcontrol_component(kcontrol));
}

int snd_soc_util_init(void);
void snd_soc_util_exit(void);

+11 −320

File changed.

Preview size limit exceeded, changes collapsed.

+0 −62
Original line number Diff line number Diff line
@@ -32,8 +32,6 @@ int snd_soc_component_read(struct snd_soc_component *component,

	if (component->regmap)
		ret = regmap_read(component->regmap, reg, val);
	else if (component->read)
		ret = component->read(component, reg, val);
	else if (component->driver->read) {
		*val = component->driver->read(component, reg);
		ret = 0;
@@ -72,8 +70,6 @@ int snd_soc_component_write(struct snd_soc_component *component,
{
	if (component->regmap)
		return regmap_write(component->regmap, reg, val);
	else if (component->write)
		return component->write(component, reg, val);
	else if (component->driver->write)
		return component->driver->write(component, reg, val);
	else
@@ -209,61 +205,3 @@ int snd_soc_component_test_bits(struct snd_soc_component *component,
	return old != new;
}
EXPORT_SYMBOL_GPL(snd_soc_component_test_bits);

unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg)
{
	unsigned int val;
	int ret;

	ret = snd_soc_component_read(&codec->component, reg, &val);
	if (ret < 0)
		return -1;

	return val;
}
EXPORT_SYMBOL_GPL(snd_soc_read);

int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg,
	unsigned int val)
{
	return snd_soc_component_write(&codec->component, reg, val);
}
EXPORT_SYMBOL_GPL(snd_soc_write);

/**
 * snd_soc_update_bits - update codec register bits
 * @codec: audio codec
 * @reg: codec register
 * @mask: register mask
 * @value: new value
 *
 * Writes new register value.
 *
 * Returns 1 for change, 0 for no change, or negative error code.
 */
int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned int reg,
				unsigned int mask, unsigned int value)
{
	return snd_soc_component_update_bits(&codec->component, reg, mask,
		value);
}
EXPORT_SYMBOL_GPL(snd_soc_update_bits);

/**
 * snd_soc_test_bits - test register for change
 * @codec: audio codec
 * @reg: codec register
 * @mask: register mask
 * @value: new value
 *
 * Tests a register with a new value and checks if the new value is
 * different from the old value.
 *
 * Returns 1 for change else 0.
 */
int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg,
				unsigned int mask, unsigned int value)
{
	return snd_soc_component_test_bits(&codec->component, reg, mask, value);
}
EXPORT_SYMBOL_GPL(snd_soc_test_bits);
+0 −22
Original line number Diff line number Diff line
@@ -28,24 +28,6 @@ struct jack_gpio_tbl {
	struct snd_soc_jack_gpio *gpios;
};

/**
 * snd_soc_codec_set_jack - configure codec jack.
 * @codec: CODEC
 * @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_codec_set_jack(struct snd_soc_codec *codec,
	struct snd_soc_jack *jack, void *data)
{
	if (codec->driver->set_jack)
		return codec->driver->set_jack(codec, jack, data);
	else
		return -ENOTSUPP;
}
EXPORT_SYMBOL_GPL(snd_soc_codec_set_jack);

/**
 * snd_soc_component_set_jack - configure component jack.
 * @component: COMPONENTs
@@ -57,10 +39,6 @@ EXPORT_SYMBOL_GPL(snd_soc_codec_set_jack);
int snd_soc_component_set_jack(struct snd_soc_component *component,
			       struct snd_soc_jack *jack, void *data)
{
	/* will be removed */
	if (component->set_jack)
		return component->set_jack(component, jack, data);

	if (component->driver->set_jack)
		return component->driver->set_jack(component, jack, data);

Loading