[alsa-devel] [PATCH 0/5] ASoC: mxs: Several cleanups and bugfixes for the MXS sound driver
Lothar Waßmann (5): General cleanups Add .owner to struct snd_soc_card Export symbols 'mxs_saif_put_mclk()' and 'mxs_saif_get_mclk()' Add missing MODULE_LICENSE("GPL") Add appropriate MODULE_ALIAS()
sound/soc/codecs/sgtl5000.c | 13 ++++++------- sound/soc/mxs/mxs-pcm.c | 3 +++ sound/soc/mxs/mxs-saif.c | 4 +++- sound/soc/mxs/mxs-sgtl5000.c | 2 ++ 4 files changed, 14 insertions(+), 8 deletions(-)
Some textual cleanups without functional changes
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de --- sound/soc/codecs/sgtl5000.c | 13 ++++++------- sound/soc/mxs/mxs-saif.c | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index bbcf921..fd0489b 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -73,7 +73,7 @@ enum sgtl5000_regulator_supplies { static const char *supply_names[SGTL5000_SUPPLY_NUM] = { "VDDA", "VDDIO", - "VDDD" + "VDDD", };
#define LDO_CONSUMER_NAME "VDDD_LDO" @@ -1278,7 +1278,6 @@ err_regulator_free: if (external_vddd) ldo_regulator_remove(codec); return ret; - }
static int sgtl5000_probe(struct snd_soc_codec *codec) @@ -1431,7 +1430,7 @@ static __devexit int sgtl5000_i2c_remove(struct i2c_client *client)
static const struct i2c_device_id sgtl5000_id[] = { {"sgtl5000", 0}, - {}, + { /* sentinel */ } };
MODULE_DEVICE_TABLE(i2c, sgtl5000_id); @@ -1444,10 +1443,10 @@ MODULE_DEVICE_TABLE(of, sgtl5000_dt_ids);
static struct i2c_driver sgtl5000_i2c_driver = { .driver = { - .name = "sgtl5000", - .owner = THIS_MODULE, - .of_match_table = sgtl5000_dt_ids, - }, + .name = "sgtl5000", + .owner = THIS_MODULE, + .of_match_table = sgtl5000_dt_ids, + }, .probe = sgtl5000_i2c_probe, .remove = __devexit_p(sgtl5000_i2c_remove), .id_table = sgtl5000_id, diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c index 76dc74d..487d2ff 100644 --- a/sound/soc/mxs/mxs-saif.c +++ b/sound/soc/mxs/mxs-saif.c @@ -481,7 +481,7 @@ static int mxs_saif_trigger(struct snd_pcm_substream *substream, int cmd,
/* * If the saif's master is not himself, we also need to enable - * itself clk for its internal basic logic to work. + * its clk for its internal basic logic to work. */ if (saif != master_saif) { clk_enable(saif->clk);
This will prevent the module from being removed from underneath its users
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de --- sound/soc/mxs/mxs-sgtl5000.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/sound/soc/mxs/mxs-sgtl5000.c b/sound/soc/mxs/mxs-sgtl5000.c index 7fbeaec..db5c184 100644 --- a/sound/soc/mxs/mxs-sgtl5000.c +++ b/sound/soc/mxs/mxs-sgtl5000.c @@ -105,6 +105,7 @@ static struct snd_soc_dai_link mxs_sgtl5000_dai[] = {
static struct snd_soc_card mxs_sgtl5000 = { .name = "mxs_sgtl5000", + .owner = THIS_MODULE, .dai_link = mxs_sgtl5000_dai, .num_links = ARRAY_SIZE(mxs_sgtl5000_dai), };
Fixes the following errors with MXS sound support built as module: |ERROR: "mxs_saif_put_mclk" [sound/soc/mxs/snd-soc-mxs-sgtl5000.ko] undefined! |ERROR: "mxs_saif_get_mclk" [sound/soc/mxs/snd-soc-mxs-sgtl5000.ko] undefined!
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de --- sound/soc/mxs/mxs-saif.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c index 487d2ff..ec66a29 100644 --- a/sound/soc/mxs/mxs-saif.c +++ b/sound/soc/mxs/mxs-saif.c @@ -221,6 +221,7 @@ int mxs_saif_put_mclk(unsigned int saif_id) saif->mclk_in_use = 0; return 0; } +EXPORT_SYMBOL(mxs_saif_put_mclk);
/* * Get MCLK and set clock rate, then enable it @@ -274,6 +275,7 @@ int mxs_saif_get_mclk(unsigned int saif_id, unsigned int mclk,
return 0; } +EXPORT_SYMBOL(mxs_saif_get_mclk);
/* * SAIF DAI format configuration.
The sound driver refuses to load as module, because of the missing MODULE_LICENSE("GPL"). The file header indicates that the driver is indeed published under the GPL.
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de --- sound/soc/mxs/mxs-pcm.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/sound/soc/mxs/mxs-pcm.c b/sound/soc/mxs/mxs-pcm.c index dea5aa4..8646913 100644 --- a/sound/soc/mxs/mxs-pcm.c +++ b/sound/soc/mxs/mxs-pcm.c @@ -357,3 +357,5 @@ static void __exit snd_mxs_pcm_exit(void) platform_driver_unregister(&mxs_pcm_driver); } module_exit(snd_mxs_pcm_exit); + +MODULE_LICENSE("GPL");
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de --- sound/soc/mxs/mxs-pcm.c | 1 + sound/soc/mxs/mxs-sgtl5000.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/sound/soc/mxs/mxs-pcm.c b/sound/soc/mxs/mxs-pcm.c index 8646913..f39d7dd 100644 --- a/sound/soc/mxs/mxs-pcm.c +++ b/sound/soc/mxs/mxs-pcm.c @@ -359,3 +359,4 @@ static void __exit snd_mxs_pcm_exit(void) module_exit(snd_mxs_pcm_exit);
MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:mxs-pcm-audio"); diff --git a/sound/soc/mxs/mxs-sgtl5000.c b/sound/soc/mxs/mxs-sgtl5000.c index db5c184..228bbc5 100644 --- a/sound/soc/mxs/mxs-sgtl5000.c +++ b/sound/soc/mxs/mxs-sgtl5000.c @@ -172,3 +172,4 @@ module_exit(mxs_sgtl5000_exit); MODULE_AUTHOR("Freescale Semiconductor, Inc."); MODULE_DESCRIPTION("MXS ALSA SoC Machine driver"); MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:mxs-sgtl5000");
On Fri, Dec 09, 2011 at 02:38:12PM +0100, Lothar Waßmann wrote:
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de
Acked-by: Wolfram Sang w.sang@pengutronix.de
On Fri, Dec 09, 2011 at 02:38:12PM +0100, Lothar Waßmann wrote:
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de
Applied, thanks.
On Fri, Dec 09, 2011 at 02:38:11PM +0100, Lothar Waßmann wrote:
The sound driver refuses to load as module, because of the missing MODULE_LICENSE("GPL"). The file header indicates that the driver is indeed published under the GPL.
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de
Acked-by: Wolfram Sang w.sang@pengutronix.de
Sascha's code was also GPL and this code was derived from it.
On Fri, Dec 09, 2011 at 02:38:11PM +0100, Lothar Waßmann wrote:
The sound driver refuses to load as module, because of the missing MODULE_LICENSE("GPL"). The file header indicates that the driver is indeed published under the GPL.
Applied, thanks.
On Fri, Dec 09, 2011 at 02:38:10PM +0100, Lothar Waßmann wrote:
Fixes the following errors with MXS sound support built as module: |ERROR: "mxs_saif_put_mclk" [sound/soc/mxs/snd-soc-mxs-sgtl5000.ko] undefined! |ERROR: "mxs_saif_get_mclk" [sound/soc/mxs/snd-soc-mxs-sgtl5000.ko] undefined!
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de
sound/soc/mxs/mxs-saif.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c index 487d2ff..ec66a29 100644 --- a/sound/soc/mxs/mxs-saif.c +++ b/sound/soc/mxs/mxs-saif.c @@ -221,6 +221,7 @@ int mxs_saif_put_mclk(unsigned int saif_id) saif->mclk_in_use = 0; return 0; } +EXPORT_SYMBOL(mxs_saif_put_mclk);
EXPORT_SYMBOL_GPL. I'd vote this is an implementation issue.
On Fri, Dec 09, 2011 at 03:15:30PM +0100, Wolfram Sang wrote:
On Fri, Dec 09, 2011 at 02:38:10PM +0100, Lothar Waßmann wrote:
+EXPORT_SYMBOL(mxs_saif_put_mclk);
EXPORT_SYMBOL_GPL. I'd vote this is an implementation issue.
Yes, please - the entire subsystem is exported _GPL.
On Fri, Dec 09, 2011 at 02:38:09PM +0100, Lothar Waßmann wrote:
This will prevent the module from being removed from underneath its users
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de
I can't find any other instance setting owner in snd_soc_card?
Hi,
Wolfram Sang writes:
On Fri, Dec 09, 2011 at 02:38:09PM +0100, Lothar Waßmann wrote:
This will prevent the module from being removed from underneath its users
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de
I can't find any other instance setting owner in snd_soc_card?
Then that other uses are most probably faulty too.
You can easily test it by loading all necessary sound modules, starting some application that uses the sound device (e.g. alsamixer) and then removing the snd-soc-mxs-sgtl5000 module.
Without the patch the removal will succeed crashing the application. With this patch the refcount of the module will be
0 as long as an application is using it, preventing the
removal.
Lothar Waßmann
On Fri, Dec 09, 2011 at 03:36:06PM +0100, Lothar Waßmann wrote:
Wolfram Sang writes:
I can't find any other instance setting owner in snd_soc_card?
Then that other uses are most probably faulty too.
This needs to be fixed up generally, not just for a specific driver.
Hi,
Mark Brown writes:
On Fri, Dec 09, 2011 at 03:36:06PM +0100, Lothar Waßmann wrote:
Wolfram Sang writes:
I can't find any other instance setting owner in snd_soc_card?
Then that other uses are most probably faulty too.
This needs to be fixed up generally, not just for a specific driver.
There are 84 drivers affected by this. I did not check though whether all of them are compilable as module. I could provide a patch for all of these, but I can at most do a compile testing for some of them.
Lothar Waßmann
On Mon, Dec 12, 2011 at 10:10:36AM +0100, Lothar Waßmann wrote:
There are 84 drivers affected by this. I did not check though whether all of them are compilable as module. I could provide a patch for all of these, but I can at most do a compile testing for some of them.
Compile only testing is absolutely fine.
On Fri, Dec 09, 2011 at 02:38:08PM +0100, Lothar Waßmann wrote:
Some textual cleanups without functional changes
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de
sound/soc/codecs/sgtl5000.c | 13 ++++++------- sound/soc/mxs/mxs-saif.c | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-)
I wonder if it is okay to change those two files in one patch, but for the changes itself:
Acked-by: Wolfram Sang w.sang@pengutronix.de
On Fri, Dec 09, 2011 at 02:38:08PM +0100, Lothar Waßmann wrote:
Some textual cleanups without functional changes
Signed-off-by: Lothar Waßmann LW@KARO-electronics.de
sound/soc/codecs/sgtl5000.c | 13 ++++++------- sound/soc/mxs/mxs-saif.c | 2 +-
This is mostly a patch to a CODEC driver not anything to do with mxs as the subject says and
static const struct i2c_device_id sgtl5000_id[] = { {"sgtl5000", 0},
- {},
- { /* sentinel */ }
I'm not sure I actually find that an improvement; if we're going to actively go out and do that we should do it consistently.
participants (3)
-
Lothar Waßmann
-
Mark Brown
-
Wolfram Sang