-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branches 'asoc/fix/max98371', 'asoc/fix/nau8825…
…', 'asoc/fix/omap', 'asoc/fix/samsung', 'asoc/fix/simple' and 'asoc/fix/wm2000' into asoc-linus
- Loading branch information
Showing
9 changed files
with
82 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
obj-$(CONFIG_SND_SIMPLE_CARD_UTILS) := simple-card-utils.o | ||
|
||
snd-soc-simple-card-utils-objs := simple-card-utils.o | ||
snd-soc-simple-card-objs := simple-card.o | ||
|
||
obj-$(CONFIG_SND_SIMPLE_CARD) += snd-soc-simple-card.o | ||
obj-$(CONFIG_SND_SIMPLE_CARD_UTILS) += snd-soc-simple-card-utils.o | ||
obj-$(CONFIG_SND_SIMPLE_CARD) += snd-soc-simple-card.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
#include <linux/module.h> | ||
#include <linux/of.h> | ||
#include <sound/simple_card_utils.h> | ||
|
||
|
@@ -95,3 +96,8 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card, | |
return 0; | ||
} | ||
EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name); | ||
|
||
/* Module information */ | ||
MODULE_AUTHOR("Kuninori Morimoto <[email protected]>"); | ||
MODULE_DESCRIPTION("ALSA SoC Simple Card Utils"); | ||
MODULE_LICENSE("GPL v2"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,10 +38,10 @@ | |
struct abe_twl6040 { | ||
int jack_detection; /* board can detect jack events */ | ||
int mclk_freq; /* MCLK frequency speed for twl6040 */ | ||
|
||
struct platform_device *dmic_codec_dev; | ||
}; | ||
|
||
struct platform_device *dmic_codec_dev; | ||
|
||
static int omap_abe_hw_params(struct snd_pcm_substream *substream, | ||
struct snd_pcm_hw_params *params) | ||
{ | ||
|
@@ -258,8 +258,6 @@ static int omap_abe_probe(struct platform_device *pdev) | |
if (priv == NULL) | ||
return -ENOMEM; | ||
|
||
priv->dmic_codec_dev = ERR_PTR(-EINVAL); | ||
|
||
if (snd_soc_of_parse_card_name(card, "ti,model")) { | ||
dev_err(&pdev->dev, "Card name is not provided\n"); | ||
return -ENODEV; | ||
|
@@ -284,13 +282,6 @@ static int omap_abe_probe(struct platform_device *pdev) | |
num_links = 2; | ||
abe_twl6040_dai_links[1].cpu_of_node = dai_node; | ||
abe_twl6040_dai_links[1].platform_of_node = dai_node; | ||
|
||
priv->dmic_codec_dev = platform_device_register_simple( | ||
"dmic-codec", -1, NULL, 0); | ||
if (IS_ERR(priv->dmic_codec_dev)) { | ||
dev_err(&pdev->dev, "Can't instantiate dmic-codec\n"); | ||
return PTR_ERR(priv->dmic_codec_dev); | ||
} | ||
} else { | ||
num_links = 1; | ||
} | ||
|
@@ -299,16 +290,14 @@ static int omap_abe_probe(struct platform_device *pdev) | |
of_property_read_u32(node, "ti,mclk-freq", &priv->mclk_freq); | ||
if (!priv->mclk_freq) { | ||
dev_err(&pdev->dev, "MCLK frequency not provided\n"); | ||
ret = -EINVAL; | ||
goto err_unregister; | ||
return -EINVAL; | ||
} | ||
|
||
card->fully_routed = 1; | ||
|
||
if (!priv->mclk_freq) { | ||
dev_err(&pdev->dev, "MCLK frequency missing\n"); | ||
ret = -ENODEV; | ||
goto err_unregister; | ||
return -ENODEV; | ||
} | ||
|
||
card->dai_link = abe_twl6040_dai_links; | ||
|
@@ -317,31 +306,19 @@ static int omap_abe_probe(struct platform_device *pdev) | |
snd_soc_card_set_drvdata(card, priv); | ||
|
||
ret = snd_soc_register_card(card); | ||
if (ret) { | ||
if (ret) | ||
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", | ||
ret); | ||
goto err_unregister; | ||
} | ||
|
||
return 0; | ||
|
||
err_unregister: | ||
if (!IS_ERR(priv->dmic_codec_dev)) | ||
platform_device_unregister(priv->dmic_codec_dev); | ||
|
||
return ret; | ||
} | ||
|
||
static int omap_abe_remove(struct platform_device *pdev) | ||
{ | ||
struct snd_soc_card *card = platform_get_drvdata(pdev); | ||
struct abe_twl6040 *priv = snd_soc_card_get_drvdata(card); | ||
|
||
snd_soc_unregister_card(card); | ||
|
||
if (!IS_ERR(priv->dmic_codec_dev)) | ||
platform_device_unregister(priv->dmic_codec_dev); | ||
|
||
return 0; | ||
} | ||
|
||
|
@@ -361,7 +338,33 @@ static struct platform_driver omap_abe_driver = { | |
.remove = omap_abe_remove, | ||
}; | ||
|
||
module_platform_driver(omap_abe_driver); | ||
static int __init omap_abe_init(void) | ||
{ | ||
int ret; | ||
|
||
dmic_codec_dev = platform_device_register_simple("dmic-codec", -1, NULL, | ||
0); | ||
if (IS_ERR(dmic_codec_dev)) { | ||
pr_err("%s: dmic-codec device registration failed\n", __func__); | ||
return PTR_ERR(dmic_codec_dev); | ||
} | ||
|
||
ret = platform_driver_register(&omap_abe_driver); | ||
if (ret) { | ||
pr_err("%s: platform driver registration failed\n", __func__); | ||
platform_device_unregister(dmic_codec_dev); | ||
} | ||
|
||
return ret; | ||
} | ||
module_init(omap_abe_init); | ||
|
||
static void __exit omap_abe_exit(void) | ||
{ | ||
platform_driver_unregister(&omap_abe_driver); | ||
platform_device_unregister(dmic_codec_dev); | ||
} | ||
module_exit(omap_abe_exit); | ||
|
||
MODULE_AUTHOR("Misael Lopez Cruz <[email protected]>"); | ||
MODULE_DESCRIPTION("ALSA SoC for OMAP boards with ABE and twl6040 codec"); | ||
|
Oops, something went wrong.