Commit 0ec65b67 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: cs4349: replace codec to component

Now we can replace Codec to Component. Let's do it.

Note:
	xxx_codec_xxx()		->	xxx_component_xxx()
	.idle_bias_off = 0	->	.idle_bias_on = 1
	.ignore_pmdown_time = 0	->	.use_pmdown_time = 1
	-			->	.endianness = 1
	-			->	.non_legacy_dai_naming = 1
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7928b2cb
...@@ -74,8 +74,8 @@ static bool cs4349_writeable_register(struct device *dev, unsigned int reg) ...@@ -74,8 +74,8 @@ static bool cs4349_writeable_register(struct device *dev, unsigned int reg)
static int cs4349_set_dai_fmt(struct snd_soc_dai *codec_dai, static int cs4349_set_dai_fmt(struct snd_soc_dai *codec_dai,
unsigned int format) unsigned int format)
{ {
struct snd_soc_codec *codec = codec_dai->codec; struct snd_soc_component *component = codec_dai->component;
struct cs4349_private *cs4349 = snd_soc_codec_get_drvdata(codec); struct cs4349_private *cs4349 = snd_soc_component_get_drvdata(component);
unsigned int fmt; unsigned int fmt;
fmt = format & SND_SOC_DAIFMT_FORMAT_MASK; fmt = format & SND_SOC_DAIFMT_FORMAT_MASK;
...@@ -97,8 +97,8 @@ static int cs4349_pcm_hw_params(struct snd_pcm_substream *substream, ...@@ -97,8 +97,8 @@ static int cs4349_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct snd_soc_codec *codec = dai->codec; struct snd_soc_component *component = dai->component;
struct cs4349_private *cs4349 = snd_soc_codec_get_drvdata(codec); struct cs4349_private *cs4349 = snd_soc_component_get_drvdata(component);
int fmt, ret; int fmt, ret;
cs4349->rate = params_rate(params); cs4349->rate = params_rate(params);
...@@ -126,7 +126,7 @@ static int cs4349_pcm_hw_params(struct snd_pcm_substream *substream, ...@@ -126,7 +126,7 @@ static int cs4349_pcm_hw_params(struct snd_pcm_substream *substream,
return -EINVAL; return -EINVAL;
} }
ret = snd_soc_update_bits(codec, CS4349_MODE, DIF_MASK, ret = snd_soc_component_update_bits(component, CS4349_MODE, DIF_MASK,
MODE_FORMAT(fmt)); MODE_FORMAT(fmt));
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -136,14 +136,14 @@ static int cs4349_pcm_hw_params(struct snd_pcm_substream *substream, ...@@ -136,14 +136,14 @@ static int cs4349_pcm_hw_params(struct snd_pcm_substream *substream,
static int cs4349_digital_mute(struct snd_soc_dai *dai, int mute) static int cs4349_digital_mute(struct snd_soc_dai *dai, int mute)
{ {
struct snd_soc_codec *codec = dai->codec; struct snd_soc_component *component = dai->component;
int reg; int reg;
reg = 0; reg = 0;
if (mute) if (mute)
reg = MUTE_AB_MASK; reg = MUTE_AB_MASK;
return snd_soc_update_bits(codec, CS4349_MUTE, MUTE_AB_MASK, reg); return snd_soc_component_update_bits(component, CS4349_MUTE, MUTE_AB_MASK, reg);
} }
static DECLARE_TLV_DB_SCALE(dig_tlv, -12750, 50, 0); static DECLARE_TLV_DB_SCALE(dig_tlv, -12750, 50, 0);
...@@ -255,15 +255,17 @@ static struct snd_soc_dai_driver cs4349_dai = { ...@@ -255,15 +255,17 @@ static struct snd_soc_dai_driver cs4349_dai = {
.symmetric_rates = 1, .symmetric_rates = 1,
}; };
static const struct snd_soc_codec_driver soc_codec_dev_cs4349 = { static const struct snd_soc_component_driver soc_component_dev_cs4349 = {
.component_driver = { .controls = cs4349_snd_controls,
.controls = cs4349_snd_controls, .num_controls = ARRAY_SIZE(cs4349_snd_controls),
.num_controls = ARRAY_SIZE(cs4349_snd_controls), .dapm_widgets = cs4349_dapm_widgets,
.dapm_widgets = cs4349_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(cs4349_dapm_widgets),
.num_dapm_widgets = ARRAY_SIZE(cs4349_dapm_widgets), .dapm_routes = cs4349_routes,
.dapm_routes = cs4349_routes, .num_dapm_routes = ARRAY_SIZE(cs4349_routes),
.num_dapm_routes = ARRAY_SIZE(cs4349_routes), .idle_bias_on = 1,
}, .use_pmdown_time = 1,
.endianness = 1,
.non_legacy_dai_naming = 1,
}; };
static const struct regmap_config cs4349_regmap = { static const struct regmap_config cs4349_regmap = {
...@@ -305,7 +307,8 @@ static int cs4349_i2c_probe(struct i2c_client *client, ...@@ -305,7 +307,8 @@ static int cs4349_i2c_probe(struct i2c_client *client,
i2c_set_clientdata(client, cs4349); i2c_set_clientdata(client, cs4349);
return snd_soc_register_codec(&client->dev, &soc_codec_dev_cs4349, return devm_snd_soc_register_component(&client->dev,
&soc_component_dev_cs4349,
&cs4349_dai, 1); &cs4349_dai, 1);
} }
...@@ -313,8 +316,6 @@ static int cs4349_i2c_remove(struct i2c_client *client) ...@@ -313,8 +316,6 @@ static int cs4349_i2c_remove(struct i2c_client *client)
{ {
struct cs4349_private *cs4349 = i2c_get_clientdata(client); struct cs4349_private *cs4349 = i2c_get_clientdata(client);
snd_soc_unregister_codec(&client->dev);
/* Hold down reset */ /* Hold down reset */
gpiod_set_value_cansleep(cs4349->reset_gpio, 0); gpiod_set_value_cansleep(cs4349->reset_gpio, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment