Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07476f4c authored by Banajit Goswami's avatar Banajit Goswami Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: wcd: use component probe/remove on WCD/WSA drivers



codec driver and component driver has duplicated .probe/.remove
functions, and codec side is just relayed it. This was quick-hack,
but no longer needed.
This patch uses component .probe/.remove.
These changes are in accordance with the upstream changes
in ASoC between Linux-4.4 and Linux-4.9 versions.

Change-Id: I676403b3989411aba2dba50065b56c2acff156a0
Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
parent 8e306f0a
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -8767,8 +8767,9 @@ static int tomtom_cpe_initialize(struct snd_soc_codec *codec)
	return 0;
}

static int tomtom_codec_probe(struct snd_soc_codec *codec)
static int tomtom_codec_probe(struct snd_soc_component *component)
{
	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
	struct wcd9xxx *control;
	struct tomtom_priv *tomtom;
	struct wcd9xxx_pdata *pdata;
@@ -8971,8 +8972,9 @@ static int tomtom_codec_probe(struct snd_soc_codec *codec)
	devm_kfree(codec->dev, tomtom);
	return ret;
}
static int tomtom_codec_remove(struct snd_soc_codec *codec)
static int tomtom_codec_remove(struct snd_soc_component *component)
{
	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
	struct tomtom_priv *tomtom = snd_soc_codec_get_drvdata(codec);
	struct wcd9xxx *control;

@@ -9009,12 +9011,12 @@ static struct regmap *tomtom_get_regmap(struct device *dev)
}

static struct snd_soc_codec_driver soc_codec_dev_tomtom = {
	.probe = tomtom_codec_probe,
	.remove = tomtom_codec_remove,
	.controls = tomtom_snd_controls,
	.num_controls = ARRAY_SIZE(tomtom_snd_controls),
	.get_regmap = tomtom_get_regmap,
	.component_driver = {
		.probe = tomtom_codec_probe,
		.remove = tomtom_codec_remove,
		.dapm_widgets = tomtom_dapm_widgets,
		.num_dapm_widgets = ARRAY_SIZE(tomtom_dapm_widgets),
		.dapm_routes = audio_map,
+6 −4
Original line number Diff line number Diff line
@@ -13522,8 +13522,9 @@ static struct regulator *tasha_codec_find_ondemand_regulator(
	return NULL;
}

static int tasha_codec_probe(struct snd_soc_codec *codec)
static int tasha_codec_probe(struct snd_soc_component *component)
{
	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
	struct wcd9xxx *control;
	struct tasha_priv *tasha;
	struct wcd9xxx_pdata *pdata;
@@ -13741,8 +13742,9 @@ static int tasha_codec_probe(struct snd_soc_codec *codec)
	return ret;
}

static int tasha_codec_remove(struct snd_soc_codec *codec)
static int tasha_codec_remove(struct snd_soc_component *component)
{
	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
	struct tasha_priv *tasha = snd_soc_codec_get_drvdata(codec);
	struct wcd9xxx *control;

@@ -13765,12 +13767,12 @@ static struct regmap *tasha_get_regmap(struct device *dev)
}

static struct snd_soc_codec_driver soc_codec_dev_tasha = {
	.probe = tasha_codec_probe,
	.remove = tasha_codec_remove,
	.controls = tasha_snd_controls,
	.num_controls = ARRAY_SIZE(tasha_snd_controls),
	.get_regmap = tasha_get_regmap,
	.component_driver = {
		.probe = tasha_codec_probe,
		.remove = tasha_codec_remove,
		.dapm_widgets = tasha_dapm_widgets,
		.num_dapm_widgets = ARRAY_SIZE(tasha_dapm_widgets),
		.dapm_routes = audio_map,
+6 −4
Original line number Diff line number Diff line
@@ -8863,8 +8863,9 @@ static int tavil_post_reset_cb(struct wcd9xxx *wcd9xxx)
	return ret;
}

static int tavil_soc_codec_probe(struct snd_soc_codec *codec)
static int tavil_soc_codec_probe(struct snd_soc_component *component)
{
	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
	struct wcd9xxx *control;
	struct tavil_priv *tavil;
	struct wcd9xxx_pdata *pdata;
@@ -9027,8 +9028,9 @@ static int tavil_soc_codec_probe(struct snd_soc_codec *codec)
	return ret;
}

static int tavil_soc_codec_remove(struct snd_soc_codec *codec)
static int tavil_soc_codec_remove(struct snd_soc_component *component)
{
	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
	struct wcd9xxx *control;
	struct tavil_priv *tavil = snd_soc_codec_get_drvdata(codec);

@@ -9056,12 +9058,12 @@ static struct regmap *tavil_get_regmap(struct device *dev)
}

static struct snd_soc_codec_driver soc_codec_dev_tavil = {
	.probe = tavil_soc_codec_probe,
	.remove = tavil_soc_codec_remove,
	.controls = tavil_snd_controls,
	.num_controls = ARRAY_SIZE(tavil_snd_controls),
	.get_regmap = tavil_get_regmap,
	.component_driver = {
		.probe = tavil_soc_codec_probe,
		.remove = tavil_soc_codec_remove,
		.dapm_widgets = tavil_dapm_widgets,
		.num_dapm_widgets = ARRAY_SIZE(tavil_dapm_widgets),
		.dapm_routes = tavil_audio_map,
+7 −5
Original line number Diff line number Diff line
@@ -1019,8 +1019,9 @@ static int32_t wsa881x_temp_reg_read(struct snd_soc_codec *codec,
	return ret;
}

static int wsa881x_probe(struct snd_soc_codec *codec)
static int wsa881x_probe(struct snd_soc_component *component)
{
	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
	struct i2c_client *client;
	int ret = 0;
	int wsa881x_index = 0;
@@ -1073,8 +1074,9 @@ static int wsa881x_probe(struct snd_soc_codec *codec)
	return 0;
}

static int wsa881x_remove(struct snd_soc_codec *codec)
static int wsa881x_remove(struct snd_soc_component *component)
{
	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
	struct wsa881x_pdata *wsa881x = snd_soc_codec_get_drvdata(codec);

	if (wsa881x->tz_pdata.tz_dev)
@@ -1086,9 +1088,6 @@ static int wsa881x_remove(struct snd_soc_codec *codec)
}

static struct snd_soc_codec_driver soc_codec_dev_wsa881x = {
	.probe	= wsa881x_probe,
	.remove	= wsa881x_remove,

	.read = wsa881x_i2c_read,
	.write = wsa881x_i2c_write,

@@ -1100,6 +1099,9 @@ static struct snd_soc_codec_driver soc_codec_dev_wsa881x = {
	.num_controls = ARRAY_SIZE(wsa881x_snd_controls),

	.component_driver = {
		.probe	= wsa881x_probe,
		.remove	= wsa881x_remove,

		.dapm_widgets = wsa881x_dapm_widgets,
		.num_dapm_widgets = ARRAY_SIZE(wsa881x_dapm_widgets),
		.dapm_routes = wsa881x_audio_map,
+6 −4
Original line number Diff line number Diff line
@@ -1026,8 +1026,9 @@ static int32_t wsa881x_temp_reg_read(struct snd_soc_codec *codec,
	return 0;
}

static int wsa881x_probe(struct snd_soc_codec *codec)
static int wsa881x_probe(struct snd_soc_component *component)
{
	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
	struct wsa881x_priv *wsa881x = snd_soc_codec_get_drvdata(codec);
	struct swr_device *dev;

@@ -1052,8 +1053,9 @@ static int wsa881x_probe(struct snd_soc_codec *codec)
	return 0;
}

static int wsa881x_remove(struct snd_soc_codec *codec)
static int wsa881x_remove(struct snd_soc_component *component)
{
	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
	struct wsa881x_priv *wsa881x = snd_soc_codec_get_drvdata(codec);

	if (wsa881x->tz_pdata.tz_dev)
@@ -1075,12 +1077,12 @@ static struct regmap *wsa881x_get_regmap(struct device *dev)
}

static struct snd_soc_codec_driver soc_codec_dev_wsa881x = {
	.probe = wsa881x_probe,
	.remove = wsa881x_remove,
	.controls = wsa881x_snd_controls,
	.num_controls = ARRAY_SIZE(wsa881x_snd_controls),
	.get_regmap = wsa881x_get_regmap,
	.component_driver = {
		.probe = wsa881x_probe,
		.remove = wsa881x_remove,
		.dapm_widgets = wsa881x_dapm_widgets,
		.num_dapm_widgets = ARRAY_SIZE(wsa881x_dapm_widgets),
		.dapm_routes = wsa881x_audio_map,