* [PATCH] media: i2c: wm9090: replace codec to component
@ 2018-03-28 1:46 Kuninori Morimoto
2018-03-29 2:33 ` kbuild test robot
0 siblings, 1 reply; 3+ messages in thread
From: Kuninori Morimoto @ 2018-03-28 1:46 UTC (permalink / raw)
To: Mark Brown, Tim Harvey, Mauro Carvalho Chehab
Cc: Linux-ALSA, linux-media, linux-kernel
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>
---
Hi Mark, Tim, Mauro
ALSA SoC had replaced codec to component, thus, we can't use it anymore.
This patch fixes it. But, I don't know who/how can handle it.
drivers/media/i2c/tda1997x.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c
index 3021913..5c5de3e 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,23 @@ 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 int tda1997x_codec_remove(struct snd_soc_component *component)
{
return 0;
}
-static struct snd_soc_codec_driver tda1997x_codec_driver = {
+static struct snd_soc_component_driver tda1997x_codec_driver = {
.probe = tda1997x_codec_probe,
.remove = tda1997x_codec_remove,
- .reg_word_size = sizeof(u16),
+ .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 +2740,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 +2785,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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] media: i2c: wm9090: replace codec to component
2018-03-28 1:46 [PATCH] media: i2c: wm9090: replace codec to component Kuninori Morimoto
@ 2018-03-29 2:33 ` kbuild test robot
2018-03-29 5:33 ` Kuninori Morimoto
0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2018-03-29 2:33 UTC (permalink / raw)
To: Kuninori Morimoto
Cc: kbuild-all, Mark Brown, Tim Harvey, Mauro Carvalho Chehab,
Linux-ALSA, linux-media, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2174 bytes --]
Hi Kuninori,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on next-20180328]
[cannot apply to v4.16-rc7]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Kuninori-Morimoto/media-i2c-wm9090-replace-codec-to-component/20180329-082843
base: git://linuxtv.org/media_tree.git master
config: i386-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
>> drivers/media/i2c/tda1997x.c:2494:12: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.remove = tda1997x_codec_remove,
^~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/tda1997x.c:2494:12: note: (near initialization for 'tda1997x_codec_driver.remove')
cc1: some warnings being treated as errors
vim +2494 drivers/media/i2c/tda1997x.c
9ac0038d Tim Harvey 2018-02-15 2491
b534b135 Kuninori Morimoto 2018-03-28 2492 static struct snd_soc_component_driver tda1997x_codec_driver = {
9ac0038d Tim Harvey 2018-02-15 2493 .probe = tda1997x_codec_probe,
9ac0038d Tim Harvey 2018-02-15 @2494 .remove = tda1997x_codec_remove,
b534b135 Kuninori Morimoto 2018-03-28 2495 .idle_bias_on = 1,
b534b135 Kuninori Morimoto 2018-03-28 2496 .use_pmdown_time = 1,
b534b135 Kuninori Morimoto 2018-03-28 2497 .endianness = 1,
b534b135 Kuninori Morimoto 2018-03-28 2498 .non_legacy_dai_naming = 1,
9ac0038d Tim Harvey 2018-02-15 2499 };
9ac0038d Tim Harvey 2018-02-15 2500
:::::: The code at line 2494 was first introduced by commit
:::::: 9ac0038db9a7e10fc8f425010ec98b7afc2ff621 media: i2c: Add TDA1997x HDMI receiver driver
:::::: TO: Tim Harvey <tharvey@gateworks.com>
:::::: CC: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 63181 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] media: i2c: wm9090: replace codec to component
2018-03-29 2:33 ` kbuild test robot
@ 2018-03-29 5:33 ` Kuninori Morimoto
0 siblings, 0 replies; 3+ messages in thread
From: Kuninori Morimoto @ 2018-03-29 5:33 UTC (permalink / raw)
To: kbuild test robot
Cc: kbuild-all, Mark Brown, Tim Harvey, Mauro Carvalho Chehab,
Linux-ALSA, linux-media, linux-kernel
Hi
Thank you for this report.
I will post v2 patch, soon
kbuild test robot wrote:
>
> [1 <text/plain; us-ascii (7bit)>]
> Hi Kuninori,
>
> Thank you for the patch! Yet something to improve:
>
> [auto build test ERROR on linuxtv-media/master]
> [also build test ERROR on next-20180328]
> [cannot apply to v4.16-rc7]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url: https://github.com/0day-ci/linux/commits/Kuninori-Morimoto/media-i2c-wm9090-replace-codec-to-component/20180329-082843
> base: git://linuxtv.org/media_tree.git master
> config: i386-allmodconfig (attached as .config)
> compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=i386
>
> All errors (new ones prefixed by >>):
>
> >> drivers/media/i2c/tda1997x.c:2494:12: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
> .remove = tda1997x_codec_remove,
> ^~~~~~~~~~~~~~~~~~~~~
> drivers/media/i2c/tda1997x.c:2494:12: note: (near initialization for 'tda1997x_codec_driver.remove')
> cc1: some warnings being treated as errors
>
> vim +2494 drivers/media/i2c/tda1997x.c
>
> 9ac0038d Tim Harvey 2018-02-15 2491
> b534b135 Kuninori Morimoto 2018-03-28 2492 static struct snd_soc_component_driver tda1997x_codec_driver = {
> 9ac0038d Tim Harvey 2018-02-15 2493 .probe = tda1997x_codec_probe,
> 9ac0038d Tim Harvey 2018-02-15 @2494 .remove = tda1997x_codec_remove,
> b534b135 Kuninori Morimoto 2018-03-28 2495 .idle_bias_on = 1,
> b534b135 Kuninori Morimoto 2018-03-28 2496 .use_pmdown_time = 1,
> b534b135 Kuninori Morimoto 2018-03-28 2497 .endianness = 1,
> b534b135 Kuninori Morimoto 2018-03-28 2498 .non_legacy_dai_naming = 1,
> 9ac0038d Tim Harvey 2018-02-15 2499 };
> 9ac0038d Tim Harvey 2018-02-15 2500
>
> :::::: The code at line 2494 was first introduced by commit
> :::::: 9ac0038db9a7e10fc8f425010ec98b7afc2ff621 media: i2c: Add TDA1997x HDMI receiver driver
>
> :::::: TO: Tim Harvey <tharvey@gateworks.com>
> :::::: CC: Mauro Carvalho Chehab <mchehab@s-opensource.com>
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
> [2 .config.gz <application/gzip (base64)>]
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-03-29 5:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-28 1:46 [PATCH] media: i2c: wm9090: replace codec to component Kuninori Morimoto
2018-03-29 2:33 ` kbuild test robot
2018-03-29 5:33 ` Kuninori Morimoto
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).