LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v3][RESEND] media: i2c: tda1997: replace codec to component
@ 2018-04-23 2:10 Kuninori Morimoto
2018-04-23 16:44 ` Tim Harvey
0 siblings, 1 reply; 6+ messages in thread
From: Kuninori Morimoto @ 2018-04-23 2:10 UTC (permalink / raw)
To: Mark Brown, Tim Harvey, Mauro Carvalho Chehab
Cc: Linux-ALSA, linux-kernel, linux-media
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
Tim, Mauro
2 weeks passed. I re-send.
This replace patch is needed for ALSA SoC, otherwise it can't probe anymore.
v2 -> v3
- fixup driver name (= tda1997)
drivers/media/i2c/tda1997x.c | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c
index 3021913..33d7fcf 100644
--- a/drivers/media/i2c/tda1997x.c
+++ b/drivers/media/i2c/tda1997x.c
@@ -2444,7 +2444,7 @@ static int tda1997x_pcm_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct tda1997x_state *state = snd_soc_dai_get_drvdata(dai);
- struct snd_soc_codec *codec = dai->codec;
+ struct snd_soc_component *component = dai->component;
struct snd_pcm_runtime *rtd = substream->runtime;
int rate, err;
@@ -2452,11 +2452,11 @@ static int tda1997x_pcm_startup(struct snd_pcm_substream *substream,
err = snd_pcm_hw_constraint_minmax(rtd, SNDRV_PCM_HW_PARAM_RATE,
rate, rate);
if (err < 0) {
- dev_err(codec->dev, "failed to constrain samplerate to %dHz\n",
+ dev_err(component->dev, "failed to constrain samplerate to %dHz\n",
rate);
return err;
}
- dev_info(codec->dev, "set samplerate constraint to %dHz\n", rate);
+ dev_info(component->dev, "set samplerate constraint to %dHz\n", rate);
return 0;
}
@@ -2479,20 +2479,22 @@ static int tda1997x_pcm_startup(struct snd_pcm_substream *substream,
.ops = &tda1997x_dai_ops,
};
-static int tda1997x_codec_probe(struct snd_soc_codec *codec)
+static int tda1997x_codec_probe(struct snd_soc_component *component)
{
return 0;
}
-static int tda1997x_codec_remove(struct snd_soc_codec *codec)
+static void tda1997x_codec_remove(struct snd_soc_component *component)
{
- return 0;
}
-static struct snd_soc_codec_driver tda1997x_codec_driver = {
- .probe = tda1997x_codec_probe,
- .remove = tda1997x_codec_remove,
- .reg_word_size = sizeof(u16),
+static struct snd_soc_component_driver tda1997x_codec_driver = {
+ .probe = tda1997x_codec_probe,
+ .remove = tda1997x_codec_remove,
+ .idle_bias_on = 1,
+ .use_pmdown_time = 1,
+ .endianness = 1,
+ .non_legacy_dai_naming = 1,
};
static int tda1997x_probe(struct i2c_client *client,
@@ -2737,7 +2739,7 @@ static int tda1997x_probe(struct i2c_client *client,
else
formats = SNDRV_PCM_FMTBIT_S16_LE;
tda1997x_audio_dai.capture.formats = formats;
- ret = snd_soc_register_codec(&state->client->dev,
+ ret = devm_snd_soc_register_component(&state->client->dev,
&tda1997x_codec_driver,
&tda1997x_audio_dai, 1);
if (ret) {
@@ -2782,7 +2784,6 @@ static int tda1997x_remove(struct i2c_client *client)
struct tda1997x_platform_data *pdata = &state->pdata;
if (pdata->audout_format) {
- snd_soc_unregister_codec(&client->dev);
mutex_destroy(&state->audio_lock);
}
--
1.9.1
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3][RESEND] media: i2c: tda1997: replace codec to component
2018-04-23 2:10 [PATCH v3][RESEND] media: i2c: tda1997: replace codec to component Kuninori Morimoto
@ 2018-04-23 16:44 ` Tim Harvey
2018-04-23 16:52 ` Mark Brown
0 siblings, 1 reply; 6+ messages in thread
From: Tim Harvey @ 2018-04-23 16:44 UTC (permalink / raw)
To: Kuninori Morimoto
Cc: Mark Brown, Mauro Carvalho Chehab, Linux-ALSA, linux-kernel, linux-media
On Sun, Apr 22, 2018 at 7:10 PM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> 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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> Tim, Mauro
>
> 2 weeks passed. I re-send.
> This replace patch is needed for ALSA SoC, otherwise it can't probe anymore.
>
> v2 -> v3
>
> - fixup driver name (= tda1997)
>
Kuninori,
Could you add some detail to the commit explaining why we need to
replace codec to component? I don't really know what that means.
Please refer to a commit if the ASoC API is changing in some way we
need to catch up with.
Regards,
Tim
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3][RESEND] media: i2c: tda1997: replace codec to component
2018-04-23 16:44 ` Tim Harvey
@ 2018-04-23 16:52 ` Mark Brown
2018-04-23 20:59 ` Tim Harvey
0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2018-04-23 16:52 UTC (permalink / raw)
To: Tim Harvey
Cc: Kuninori Morimoto, Mauro Carvalho Chehab, Linux-ALSA,
linux-kernel, linux-media
[-- Attachment #1: Type: text/plain, Size: 711 bytes --]
On Mon, Apr 23, 2018 at 09:44:17AM -0700, Tim Harvey wrote:
> Could you add some detail to the commit explaining why we need to
> replace codec to component? I don't really know what that means.
> Please refer to a commit if the ASoC API is changing in some way we
> need to catch up with.
This is a big transition in the ASoC API which is nearing completion -
this driver is one of the last users of the CODEC struct, we've (well,
mainly Morimoto-san) been migrating things away from it to the more
general purpose component. There's no one commit to point at really as
the two have coexisted for a while and we won't be able to finally
remove the CODEC struct until all the drivers have transitioned away.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3][RESEND] media: i2c: tda1997: replace codec to component
2018-04-23 16:52 ` Mark Brown
@ 2018-04-23 20:59 ` Tim Harvey
2018-04-25 0:23 ` Kuninori Morimoto
2018-05-04 18:58 ` Mauro Carvalho Chehab
0 siblings, 2 replies; 6+ messages in thread
From: Tim Harvey @ 2018-04-23 20:59 UTC (permalink / raw)
To: Mark Brown, Kuninori Morimoto
Cc: Mauro Carvalho Chehab, Linux-ALSA, linux-kernel, linux-media
On Mon, Apr 23, 2018 at 9:52 AM, Mark Brown <broonie@kernel.org> wrote:
> On Mon, Apr 23, 2018 at 09:44:17AM -0700, Tim Harvey wrote:
>
>> Could you add some detail to the commit explaining why we need to
>> replace codec to component? I don't really know what that means.
>> Please refer to a commit if the ASoC API is changing in some way we
>> need to catch up with.
>
> This is a big transition in the ASoC API which is nearing completion -
> this driver is one of the last users of the CODEC struct, we've (well,
> mainly Morimoto-san) been migrating things away from it to the more
> general purpose component. There's no one commit to point at really as
> the two have coexisted for a while and we won't be able to finally
> remove the CODEC struct until all the drivers have transitioned away.
Mark,
Ok - thanks for the explanation!
Kuninori,
Sorry this took so long to get to. Tested on a GW5404
Tested-by: Tim Harvey <tharvey@gateworks.com>
Acked-by: Tim Harvey <tharvey@gateworks.com>
Regards,
Tim
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3][RESEND] media: i2c: tda1997: replace codec to component
2018-04-23 20:59 ` Tim Harvey
@ 2018-04-25 0:23 ` Kuninori Morimoto
2018-05-04 18:58 ` Mauro Carvalho Chehab
1 sibling, 0 replies; 6+ messages in thread
From: Kuninori Morimoto @ 2018-04-25 0:23 UTC (permalink / raw)
To: Tim Harvey
Cc: Mark Brown, Mauro Carvalho Chehab, Linux-ALSA, linux-kernel, linux-media
Hi Tim, Mark
> >> Could you add some detail to the commit explaining why we need to
> >> replace codec to component? I don't really know what that means.
> >> Please refer to a commit if the ASoC API is changing in some way we
> >> need to catch up with.
> >
> > This is a big transition in the ASoC API which is nearing completion -
> > this driver is one of the last users of the CODEC struct, we've (well,
> > mainly Morimoto-san) been migrating things away from it to the more
> > general purpose component. There's no one commit to point at really as
> > the two have coexisted for a while and we won't be able to finally
> > remove the CODEC struct until all the drivers have transitioned away.
Thank you Mark for explaining.
> Sorry this took so long to get to. Tested on a GW5404
>
> Tested-by: Tim Harvey <tharvey@gateworks.com>
> Acked-by: Tim Harvey <tharvey@gateworks.com>
Thank you Tim.
And sorry that it couldn't explain detail things on log
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3][RESEND] media: i2c: tda1997: replace codec to component
2018-04-23 20:59 ` Tim Harvey
2018-04-25 0:23 ` Kuninori Morimoto
@ 2018-05-04 18:58 ` Mauro Carvalho Chehab
1 sibling, 0 replies; 6+ messages in thread
From: Mauro Carvalho Chehab @ 2018-05-04 18:58 UTC (permalink / raw)
To: Tim Harvey, Takashi Iwai
Cc: Mark Brown, Kuninori Morimoto, Mauro Carvalho Chehab, Linux-ALSA,
linux-kernel, linux-media
Em Mon, 23 Apr 2018 13:59:32 -0700
Tim Harvey <tharvey@gateworks.com> escreveu:
> On Mon, Apr 23, 2018 at 9:52 AM, Mark Brown <broonie@kernel.org> wrote:
> > On Mon, Apr 23, 2018 at 09:44:17AM -0700, Tim Harvey wrote:
> >
> >> Could you add some detail to the commit explaining why we need to
> >> replace codec to component? I don't really know what that means.
> >> Please refer to a commit if the ASoC API is changing in some way we
> >> need to catch up with.
> >
> > This is a big transition in the ASoC API which is nearing completion -
> > this driver is one of the last users of the CODEC struct, we've (well,
> > mainly Morimoto-san) been migrating things away from it to the more
> > general purpose component. There's no one commit to point at really as
> > the two have coexisted for a while and we won't be able to finally
> > remove the CODEC struct until all the drivers have transitioned away.
>
> Mark,
>
> Ok - thanks for the explanation!
>
> Kuninori,
>
> Sorry this took so long to get to. Tested on a GW5404
>
> Tested-by: Tim Harvey <tharvey@gateworks.com>
> Acked-by: Tim Harvey <tharvey@gateworks.com>
In order to keep it together with the patches doing the removal of
the old API, it is probably better to apply this via ALSA tree:
Acked-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
>
> Regards,
>
> Tim
Thanks,
Mauro
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-05-04 18:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-23 2:10 [PATCH v3][RESEND] media: i2c: tda1997: replace codec to component Kuninori Morimoto
2018-04-23 16:44 ` Tim Harvey
2018-04-23 16:52 ` Mark Brown
2018-04-23 20:59 ` Tim Harvey
2018-04-25 0:23 ` Kuninori Morimoto
2018-05-04 18:58 ` Mauro Carvalho Chehab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).