summaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/omap-abe-twl6040.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-04 16:26:56 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-04 16:26:56 -0700
commit977dbfcf8e9ff1783355b260d93101af315de18a (patch)
treeb586ca678499d1ccc2d199a97d65996c630b25d8 /sound/soc/omap/omap-abe-twl6040.c
parentaa7054f5a5a9ff728ce291cb103afa19f4f849eb (diff)
parentb054087dbacee30a9dddaef2c9a96312146be04e (diff)
downloadop-kernel-dev-977dbfcf8e9ff1783355b260d93101af315de18a.zip
op-kernel-dev-977dbfcf8e9ff1783355b260d93101af315de18a.tar.gz
Merge tag 'sound-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai: "Changes are seen in a wide range of codes, mainly due to ASoC DAPM requirements; HD-audio shows a high peak in diffstat, it's just a removal of bunch of old static quirks. Some highlights: - HDPM: Updates for AIO/RayDAT support, TCO/sync support - RME96: Add PCM sync support - HD-audio: * A few HDMI/DP audio updates (CA assignment fix, stream switching fix, Intel DP device list support) * Device specific fixes (ASUS/CXT HP mic support, Thinkpad mic improvements, Chromebook fixes, STAC9228 Dell fixes) * Replace the all static quirks for AD codecs with the generic parser * WAKEEN support for handling irqs in the power saving mode - USB-audio: Clean up implicit fb handling and related codes - DAPM is now mandatory for ASoC CODEC drivers; all existing drivers have had some level of DAPM support added. In addition, a lot of cleanups and improvements in DAPM. - Support for ASoC cross-platform compile test - New drivers and support for Analog Devices ADAU1702 and ADAU1401(a), Asahi Kasei Microdevices AK4554, Atmel AT91ASM9x5 and WM8904 based machines, Freescale S/PDIF and SSI AC'97, Renesas R-Car SoCs, Samsung Exynos5420 SoCs, Texas Instruments PCM1681 and PCM1792A and Wolfson Microelectronics WM8997 - DT bindings for kirkwood and i.MX S/PDIF - Clean up and bug fixes: ssm2602, rt5640 and sgtl5000. - Core helpers for bitbanged AC'97 reset" * tag 'sound-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (375 commits) ALSA: hda - Re-setup HDMI pin and audio infoframe on stream switches ALSA: hda - hdmi: Fallback to ALSA allocation when selecting CA ASoC: mxs-sgtl5000: Configure the dai_links as unidirectional ASoC: soc-pcm: Allow to specify unidirectional dai_link ASoC: fsl_spdif: Staticse non-exported symbols ASoC: ssm2602: Fix cache sync ASoC: Remove unused sysfs_registered field from snd_soc_codec struct ASoC: Remove unused debugfs_dapm field from snd_soc_{platform,codec} struct ASoC: Remove unused control_type field from snd_soc_codec struct ASoC: fsl: Add one blank space after ':=' in Makefile ASoC: fsl: Add wrapping for dev_dbg() in fsl_spdif.c ASoC: rt5640: change widget sequence for depop ASoC: dapm: Fix auto-disable for inverted controls ASoC: fsl: Drop SND_SOC_FSL_UTILS from SND_SOC_IMX_SPDIF ASoC: Samsung: Do not queue cyclic buffers multiple times ASoC: ep93xx-i2s: Remove unnecessary dev_set_drvdata() ASoC: designware_i2s: Remove unnecessary dev_set_drvdata() ASoC: fsl_spdif: remove redundant dev_err call in fsl_spdif_probe() ASoC: fsl: Add S/PDIF machine driver ASoc: kirkwood: Use the Kirkwood audio driver in Dove boards ...
Diffstat (limited to 'sound/soc/omap/omap-abe-twl6040.c')
-rw-r--r--sound/soc/omap/omap-abe-twl6040.c133
1 files changed, 41 insertions, 92 deletions
diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
index 70cd5c7..ebb1390 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -23,7 +23,6 @@
#include <linux/clk.h>
#include <linux/platform_device.h>
#include <linux/mfd/twl6040.h>
-#include <linux/platform_data/omap-abe-twl6040.h>
#include <linux/module.h>
#include <linux/of.h>
@@ -166,19 +165,10 @@ static const struct snd_soc_dapm_route audio_map[] = {
{"AFMR", NULL, "Line In"},
};
-static inline void twl6040_disconnect_pin(struct snd_soc_dapm_context *dapm,
- int connected, char *pin)
-{
- if (!connected)
- snd_soc_dapm_disable_pin(dapm, pin);
-}
-
static int omap_abe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_card *card = codec->card;
- struct snd_soc_dapm_context *dapm = &codec->dapm;
- struct omap_abe_twl6040_data *pdata = dev_get_platdata(card->dev);
struct abe_twl6040 *priv = snd_soc_card_get_drvdata(card);
int hs_trim;
int ret = 0;
@@ -203,24 +193,6 @@ static int omap_abe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
twl6040_hs_jack_detect(codec, &hs_jack, SND_JACK_HEADSET);
}
- /*
- * NULL pdata means we booted with DT. In this case the routing is
- * provided and the card is fully routed, no need to mark pins.
- */
- if (!pdata)
- return ret;
-
- /* Disable not connected paths if not used */
- twl6040_disconnect_pin(dapm, pdata->has_hs, "Headset Stereophone");
- twl6040_disconnect_pin(dapm, pdata->has_hf, "Ext Spk");
- twl6040_disconnect_pin(dapm, pdata->has_ep, "Earphone Spk");
- twl6040_disconnect_pin(dapm, pdata->has_aux, "Line Out");
- twl6040_disconnect_pin(dapm, pdata->has_vibra, "Vibrator");
- twl6040_disconnect_pin(dapm, pdata->has_hsmic, "Headset Mic");
- twl6040_disconnect_pin(dapm, pdata->has_mainmic, "Main Handset Mic");
- twl6040_disconnect_pin(dapm, pdata->has_submic, "Sub Handset Mic");
- twl6040_disconnect_pin(dapm, pdata->has_afm, "Line In");
-
return ret;
}
@@ -274,13 +246,18 @@ static struct snd_soc_card omap_abe_card = {
static int omap_abe_probe(struct platform_device *pdev)
{
- struct omap_abe_twl6040_data *pdata = dev_get_platdata(&pdev->dev);
struct device_node *node = pdev->dev.of_node;
struct snd_soc_card *card = &omap_abe_card;
+ struct device_node *dai_node;
struct abe_twl6040 *priv;
int num_links = 0;
int ret = 0;
+ if (!node) {
+ dev_err(&pdev->dev, "of node is missing.\n");
+ return -ENODEV;
+ }
+
card->dev = &pdev->dev;
priv = devm_kzalloc(&pdev->dev, sizeof(struct abe_twl6040), GFP_KERNEL);
@@ -289,78 +266,50 @@ static int omap_abe_probe(struct platform_device *pdev)
priv->dmic_codec_dev = ERR_PTR(-EINVAL);
- if (node) {
- struct device_node *dai_node;
-
- if (snd_soc_of_parse_card_name(card, "ti,model")) {
- dev_err(&pdev->dev, "Card name is not provided\n");
- return -ENODEV;
- }
+ if (snd_soc_of_parse_card_name(card, "ti,model")) {
+ dev_err(&pdev->dev, "Card name is not provided\n");
+ return -ENODEV;
+ }
- ret = snd_soc_of_parse_audio_routing(card,
- "ti,audio-routing");
- if (ret) {
- dev_err(&pdev->dev,
- "Error while parsing DAPM routing\n");
- return ret;
- }
+ ret = snd_soc_of_parse_audio_routing(card, "ti,audio-routing");
+ if (ret) {
+ dev_err(&pdev->dev, "Error while parsing DAPM routing\n");
+ return ret;
+ }
- dai_node = of_parse_phandle(node, "ti,mcpdm", 0);
- if (!dai_node) {
- dev_err(&pdev->dev, "McPDM node is not provided\n");
- return -EINVAL;
- }
- abe_twl6040_dai_links[0].cpu_dai_name = NULL;
- abe_twl6040_dai_links[0].cpu_of_node = dai_node;
+ dai_node = of_parse_phandle(node, "ti,mcpdm", 0);
+ if (!dai_node) {
+ dev_err(&pdev->dev, "McPDM node is not provided\n");
+ return -EINVAL;
+ }
+ abe_twl6040_dai_links[0].cpu_dai_name = NULL;
+ abe_twl6040_dai_links[0].cpu_of_node = dai_node;
- dai_node = of_parse_phandle(node, "ti,dmic", 0);
- if (dai_node) {
- num_links = 2;
- abe_twl6040_dai_links[1].cpu_dai_name = NULL;
- abe_twl6040_dai_links[1].cpu_of_node = dai_node;
+ dai_node = of_parse_phandle(node, "ti,dmic", 0);
+ if (dai_node) {
+ num_links = 2;
+ abe_twl6040_dai_links[1].cpu_dai_name = NULL;
+ abe_twl6040_dai_links[1].cpu_of_node = dai_node;
- priv->dmic_codec_dev = platform_device_register_simple(
+ 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;
- }
-
- priv->jack_detection = of_property_read_bool(node,
- "ti,jack-detection");
- 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;
+ if (IS_ERR(priv->dmic_codec_dev)) {
+ dev_err(&pdev->dev, "Can't instantiate dmic-codec\n");
+ return PTR_ERR(priv->dmic_codec_dev);
}
-
- omap_abe_card.fully_routed = 1;
- } else if (pdata) {
- if (pdata->card_name) {
- card->name = pdata->card_name;
- } else {
- dev_err(&pdev->dev, "Card name is not provided\n");
- return -ENODEV;
- }
-
- if (pdata->has_dmic)
- num_links = 2;
- else
- num_links = 1;
-
- priv->jack_detection = pdata->jack_detection;
- priv->mclk_freq = pdata->mclk_freq;
} else {
- dev_err(&pdev->dev, "Missing pdata\n");
- return -ENODEV;
+ num_links = 1;
+ }
+
+ priv->jack_detection = of_property_read_bool(node, "ti,jack-detection");
+ 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;
}
+ card->fully_routed = 1;
if (!priv->mclk_freq) {
dev_err(&pdev->dev, "MCLK frequency missing\n");
OpenPOWER on IntegriCloud