Commit 064f6682 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: tfa9879: 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
...@@ -30,8 +30,8 @@ static int tfa9879_hw_params(struct snd_pcm_substream *substream, ...@@ -30,8 +30,8 @@ static int tfa9879_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 tfa9879_priv *tfa9879 = snd_soc_codec_get_drvdata(codec); struct tfa9879_priv *tfa9879 = snd_soc_component_get_drvdata(component);
int fs; int fs;
int i2s_set = 0; int i2s_set = 0;
...@@ -88,11 +88,11 @@ static int tfa9879_hw_params(struct snd_pcm_substream *substream, ...@@ -88,11 +88,11 @@ static int tfa9879_hw_params(struct snd_pcm_substream *substream,
} }
if (tfa9879->lsb_justified) if (tfa9879->lsb_justified)
snd_soc_update_bits(codec, TFA9879_SERIAL_INTERFACE_1, snd_soc_component_update_bits(component, TFA9879_SERIAL_INTERFACE_1,
TFA9879_I2S_SET_MASK, TFA9879_I2S_SET_MASK,
i2s_set << TFA9879_I2S_SET_SHIFT); i2s_set << TFA9879_I2S_SET_SHIFT);
snd_soc_update_bits(codec, TFA9879_SERIAL_INTERFACE_1, snd_soc_component_update_bits(component, TFA9879_SERIAL_INTERFACE_1,
TFA9879_I2S_FS_MASK, TFA9879_I2S_FS_MASK,
fs << TFA9879_I2S_FS_SHIFT); fs << TFA9879_I2S_FS_SHIFT);
return 0; return 0;
...@@ -100,9 +100,9 @@ static int tfa9879_hw_params(struct snd_pcm_substream *substream, ...@@ -100,9 +100,9 @@ static int tfa9879_hw_params(struct snd_pcm_substream *substream,
static int tfa9879_digital_mute(struct snd_soc_dai *dai, int mute) static int tfa9879_digital_mute(struct snd_soc_dai *dai, int mute)
{ {
struct snd_soc_codec *codec = dai->codec; struct snd_soc_component *component = dai->component;
snd_soc_update_bits(codec, TFA9879_MISC_CONTROL, snd_soc_component_update_bits(component, TFA9879_MISC_CONTROL,
TFA9879_S_MUTE_MASK, TFA9879_S_MUTE_MASK,
!!mute << TFA9879_S_MUTE_SHIFT); !!mute << TFA9879_S_MUTE_SHIFT);
...@@ -111,8 +111,8 @@ static int tfa9879_digital_mute(struct snd_soc_dai *dai, int mute) ...@@ -111,8 +111,8 @@ static int tfa9879_digital_mute(struct snd_soc_dai *dai, int mute)
static int tfa9879_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) static int tfa9879_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{ {
struct snd_soc_codec *codec = dai->codec; struct snd_soc_component *component = dai->component;
struct tfa9879_priv *tfa9879 = snd_soc_codec_get_drvdata(codec); struct tfa9879_priv *tfa9879 = snd_soc_component_get_drvdata(component);
int i2s_set; int i2s_set;
int sck_pol; int sck_pol;
...@@ -151,10 +151,10 @@ static int tfa9879_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -151,10 +151,10 @@ static int tfa9879_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
return -EINVAL; return -EINVAL;
} }
snd_soc_update_bits(codec, TFA9879_SERIAL_INTERFACE_1, snd_soc_component_update_bits(component, TFA9879_SERIAL_INTERFACE_1,
TFA9879_SCK_POL_MASK, TFA9879_SCK_POL_MASK,
sck_pol << TFA9879_SCK_POL_SHIFT); sck_pol << TFA9879_SCK_POL_SHIFT);
snd_soc_update_bits(codec, TFA9879_SERIAL_INTERFACE_1, snd_soc_component_update_bits(component, TFA9879_SERIAL_INTERFACE_1,
TFA9879_I2S_SET_MASK, TFA9879_I2S_SET_MASK,
i2s_set << TFA9879_I2S_SET_SHIFT); i2s_set << TFA9879_I2S_SET_SHIFT);
return 0; return 0;
...@@ -230,15 +230,17 @@ static const struct snd_soc_dapm_route tfa9879_dapm_routes[] = { ...@@ -230,15 +230,17 @@ static const struct snd_soc_dapm_route tfa9879_dapm_routes[] = {
{ "DAC", NULL, "POWER" }, { "DAC", NULL, "POWER" },
}; };
static const struct snd_soc_codec_driver tfa9879_codec = { static const struct snd_soc_component_driver tfa9879_component = {
.component_driver = { .controls = tfa9879_controls,
.controls = tfa9879_controls, .num_controls = ARRAY_SIZE(tfa9879_controls),
.num_controls = ARRAY_SIZE(tfa9879_controls), .dapm_widgets = tfa9879_dapm_widgets,
.dapm_widgets = tfa9879_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(tfa9879_dapm_widgets),
.num_dapm_widgets = ARRAY_SIZE(tfa9879_dapm_widgets), .dapm_routes = tfa9879_dapm_routes,
.dapm_routes = tfa9879_dapm_routes, .num_dapm_routes = ARRAY_SIZE(tfa9879_dapm_routes),
.num_dapm_routes = ARRAY_SIZE(tfa9879_dapm_routes), .idle_bias_on = 1,
}, .use_pmdown_time = 1,
.endianness = 1,
.non_legacy_dai_naming = 1,
}; };
static const struct regmap_config tfa9879_regmap = { static const struct regmap_config tfa9879_regmap = {
...@@ -295,17 +297,10 @@ static int tfa9879_i2c_probe(struct i2c_client *i2c, ...@@ -295,17 +297,10 @@ static int tfa9879_i2c_probe(struct i2c_client *i2c,
regmap_write(tfa9879->regmap, regmap_write(tfa9879->regmap,
tfa9879_regs[i].reg, tfa9879_regs[i].def); tfa9879_regs[i].reg, tfa9879_regs[i].def);
return snd_soc_register_codec(&i2c->dev, &tfa9879_codec, return devm_snd_soc_register_component(&i2c->dev, &tfa9879_component,
&tfa9879_dai, 1); &tfa9879_dai, 1);
} }
static int tfa9879_i2c_remove(struct i2c_client *client)
{
snd_soc_unregister_codec(&client->dev);
return 0;
}
static const struct i2c_device_id tfa9879_i2c_id[] = { static const struct i2c_device_id tfa9879_i2c_id[] = {
{ "tfa9879", 0 }, { "tfa9879", 0 },
{ } { }
...@@ -324,7 +319,6 @@ static struct i2c_driver tfa9879_i2c_driver = { ...@@ -324,7 +319,6 @@ static struct i2c_driver tfa9879_i2c_driver = {
.of_match_table = tfa9879_of_match, .of_match_table = tfa9879_of_match,
}, },
.probe = tfa9879_i2c_probe, .probe = tfa9879_i2c_probe,
.remove = tfa9879_i2c_remove,
.id_table = tfa9879_i2c_id, .id_table = tfa9879_i2c_id,
}; };
......
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