diff options
Diffstat (limited to 'kernel/sound/soc/omap')
-rw-r--r-- | kernel/sound/soc/omap/Kconfig | 2 | ||||
-rw-r--r-- | kernel/sound/soc/omap/mcbsp.c | 20 | ||||
-rw-r--r-- | kernel/sound/soc/omap/n810.c | 3 | ||||
-rw-r--r-- | kernel/sound/soc/omap/omap-hdmi-audio.c | 22 | ||||
-rw-r--r-- | kernel/sound/soc/omap/omap-twl4030.c | 3 | ||||
-rw-r--r-- | kernel/sound/soc/omap/omap3pandora.c | 6 | ||||
-rw-r--r-- | kernel/sound/soc/omap/rx51.c | 45 |
7 files changed, 39 insertions, 62 deletions
diff --git a/kernel/sound/soc/omap/Kconfig b/kernel/sound/soc/omap/Kconfig index 30d010970..5185a3844 100644 --- a/kernel/sound/soc/omap/Kconfig +++ b/kernel/sound/soc/omap/Kconfig @@ -24,7 +24,7 @@ config SND_OMAP_SOC_HDMI_AUDIO component also under DSS HDMI device. Dummy codec is used as as codec component. The hdmi audio driver implements also the card and registers it under its own platform device. - The device for the dirver is registered by OMAPDSS hdmi + The device for the driver is registered by OMAPDSS hdmi driver. config SND_OMAP_SOC_N810 diff --git a/kernel/sound/soc/omap/mcbsp.c b/kernel/sound/soc/omap/mcbsp.c index 68a125205..c7563e230 100644 --- a/kernel/sound/soc/omap/mcbsp.c +++ b/kernel/sound/soc/omap/mcbsp.c @@ -965,25 +965,15 @@ int omap_mcbsp_init(struct platform_device *pdev) mcbsp->free = true; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); - if (!res) { + if (!res) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(mcbsp->dev, "invalid memory resource\n"); - return -ENOMEM; - } - } - if (!devm_request_mem_region(&pdev->dev, res->start, resource_size(res), - dev_name(&pdev->dev))) { - dev_err(mcbsp->dev, "memory region already claimed\n"); - return -ENODEV; - } + + mcbsp->io_base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(mcbsp->io_base)) + return PTR_ERR(mcbsp->io_base); mcbsp->phys_base = res->start; mcbsp->reg_cache_size = resource_size(res); - mcbsp->io_base = devm_ioremap(&pdev->dev, res->start, - resource_size(res)); - if (!mcbsp->io_base) - return -ENOMEM; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma"); if (!res) diff --git a/kernel/sound/soc/omap/n810.c b/kernel/sound/soc/omap/n810.c index dcb5336b5..190f868e7 100644 --- a/kernel/sound/soc/omap/n810.c +++ b/kernel/sound/soc/omap/n810.c @@ -99,8 +99,7 @@ static int n810_startup(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_pcm_runtime *rtd = substream->private_data; - snd_pcm_hw_constraint_minmax(runtime, - SNDRV_PCM_HW_PARAM_CHANNELS, 2, 2); + snd_pcm_hw_constraint_single(runtime, SNDRV_PCM_HW_PARAM_CHANNELS, 2); n810_ext_control(&rtd->card->dapm); return clk_prepare_enable(sys_clkout2); diff --git a/kernel/sound/soc/omap/omap-hdmi-audio.c b/kernel/sound/soc/omap/omap-hdmi-audio.c index 4775da4c4..584b23723 100644 --- a/kernel/sound/soc/omap/omap-hdmi-audio.c +++ b/kernel/sound/soc/omap/omap-hdmi-audio.c @@ -81,7 +81,15 @@ static int hdmi_dai_startup(struct snd_pcm_substream *substream, ret = snd_pcm_hw_constraint_step(substream->runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 128); if (ret < 0) { - dev_err(dai->dev, "could not apply constraint\n"); + dev_err(dai->dev, "Could not apply period constraint: %d\n", + ret); + return ret; + } + ret = snd_pcm_hw_constraint_step(substream->runtime, 0, + SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 128); + if (ret < 0) { + dev_err(dai->dev, "Could not apply buffer constraint: %d\n", + ret); return ret; } @@ -210,16 +218,18 @@ static int hdmi_dai_hw_params(struct snd_pcm_substream *substream, cea->db3 = 0; /* not used, all zeros */ - /* - * The OMAP HDMI IP requires to use the 8-channel channel code when - * transmitting more than two channels. - */ if (params_channels(params) == 2) cea->db4_ca = 0x0; + else if (params_channels(params) == 6) + cea->db4_ca = 0xb; else cea->db4_ca = 0x13; - cea->db5_dminh_lsv = CEA861_AUDIO_INFOFRAME_DB5_DM_INH_PROHIBITED; + if (cea->db4_ca == 0x00) + cea->db5_dminh_lsv = CEA861_AUDIO_INFOFRAME_DB5_DM_INH_PERMITTED; + else + cea->db5_dminh_lsv = CEA861_AUDIO_INFOFRAME_DB5_DM_INH_PROHIBITED; + /* the expression is trivial but makes clear what we are doing */ cea->db5_dminh_lsv |= (0 & CEA861_AUDIO_INFOFRAME_DB5_LSV); diff --git a/kernel/sound/soc/omap/omap-twl4030.c b/kernel/sound/soc/omap/omap-twl4030.c index 3673ada43..743131473 100644 --- a/kernel/sound/soc/omap/omap-twl4030.c +++ b/kernel/sound/soc/omap/omap-twl4030.c @@ -159,9 +159,8 @@ static inline void twl4030_disconnect_pin(struct snd_soc_dapm_context *dapm, static int omap_twl4030_init(struct snd_soc_pcm_runtime *rtd) { - struct snd_soc_codec *codec = rtd->codec; struct snd_soc_card *card = rtd->card; - struct snd_soc_dapm_context *dapm = &codec->dapm; + struct snd_soc_dapm_context *dapm = &card->dapm; struct omap_tw4030_pdata *pdata = dev_get_platdata(card->dev); struct omap_twl4030 *priv = snd_soc_card_get_drvdata(card); int ret = 0; diff --git a/kernel/sound/soc/omap/omap3pandora.c b/kernel/sound/soc/omap/omap3pandora.c index 076bec606..732e749a1 100644 --- a/kernel/sound/soc/omap/omap3pandora.c +++ b/kernel/sound/soc/omap/omap3pandora.c @@ -154,8 +154,7 @@ static const struct snd_soc_dapm_route omap3pandora_map[] = { static int omap3pandora_out_init(struct snd_soc_pcm_runtime *rtd) { - struct snd_soc_codec *codec = rtd->codec; - struct snd_soc_dapm_context *dapm = &codec->dapm; + struct snd_soc_dapm_context *dapm = &rtd->card->dapm; /* All TWL4030 output pins are floating */ snd_soc_dapm_nc_pin(dapm, "EARPIECE"); @@ -174,8 +173,7 @@ static int omap3pandora_out_init(struct snd_soc_pcm_runtime *rtd) static int omap3pandora_in_init(struct snd_soc_pcm_runtime *rtd) { - struct snd_soc_codec *codec = rtd->codec; - struct snd_soc_dapm_context *dapm = &codec->dapm; + struct snd_soc_dapm_context *dapm = &rtd->card->dapm; /* Not comnnected */ snd_soc_dapm_nc_pin(dapm, "HSMIC"); diff --git a/kernel/sound/soc/omap/rx51.c b/kernel/sound/soc/omap/rx51.c index c2ddf0fbf..5e21f0857 100644 --- a/kernel/sound/soc/omap/rx51.c +++ b/kernel/sound/soc/omap/rx51.c @@ -107,8 +107,7 @@ static int rx51_startup(struct snd_pcm_substream *substream) struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_card *card = rtd->card; - snd_pcm_hw_constraint_minmax(runtime, - SNDRV_PCM_HW_PARAM_CHANNELS, 2, 2); + snd_pcm_hw_constraint_single(runtime, SNDRV_PCM_HW_PARAM_CHANNELS, 2); rx51_ext_control(&card->dapm); return 0; @@ -245,6 +244,8 @@ static const struct snd_soc_dapm_widget aic34_dapm_widgets[] = { static const struct snd_soc_dapm_route audio_map[] = { {"Ext Spk", NULL, "HPLOUT"}, {"Ext Spk", NULL, "HPROUT"}, + {"Ext Spk", NULL, "HPLCOM"}, + {"Ext Spk", NULL, "HPRCOM"}, {"Headphone Jack", NULL, "LLOUT"}, {"Headphone Jack", NULL, "RLOUT"}, {"FM Transmitter", NULL, "LLOUT"}, @@ -288,21 +289,14 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd) struct snd_soc_codec *codec = rtd->codec; struct snd_soc_card *card = rtd->card; struct rx51_audio_pdata *pdata = snd_soc_card_get_drvdata(card); - - struct snd_soc_dapm_context *dapm = &codec->dapm; int err; - /* Set up NC codec pins */ - snd_soc_dapm_nc_pin(dapm, "MIC3L"); - snd_soc_dapm_nc_pin(dapm, "MIC3R"); - snd_soc_dapm_nc_pin(dapm, "LINE1R"); - err = tpa6130a2_add_controls(codec); if (err < 0) { dev_err(card->dev, "Failed to add TPA6130A2 controls\n"); return err; } - snd_soc_limit_volume(codec, "TPA6130A2 Headphone Playback Volume", 42); + snd_soc_limit_volume(card, "TPA6130A2 Headphone Playback Volume", 42); err = omap_mcbsp_st_add_controls(rtd, 2); if (err < 0) { @@ -383,6 +377,7 @@ static struct snd_soc_card rx51_sound_card = { .num_aux_devs = ARRAY_SIZE(rx51_aux_dev), .codec_conf = rx51_codec_conf, .num_configs = ARRAY_SIZE(rx51_codec_conf), + .fully_routed = true, .controls = aic34_rx51_controls, .num_controls = ARRAY_SIZE(aic34_rx51_controls), @@ -455,50 +450,36 @@ static int rx51_soc_probe(struct platform_device *pdev) snd_soc_card_set_drvdata(card, pdata); pdata->tvout_selection_gpio = devm_gpiod_get(card->dev, - "tvout-selection"); + "tvout-selection", + GPIOD_OUT_LOW); if (IS_ERR(pdata->tvout_selection_gpio)) { dev_err(card->dev, "could not get tvout selection gpio\n"); return PTR_ERR(pdata->tvout_selection_gpio); } - err = gpiod_direction_output(pdata->tvout_selection_gpio, 0); - if (err) { - dev_err(card->dev, "could not setup tvout selection gpio\n"); - return err; - } - pdata->jack_detection_gpio = devm_gpiod_get(card->dev, - "jack-detection"); + "jack-detection", + GPIOD_ASIS); if (IS_ERR(pdata->jack_detection_gpio)) { dev_err(card->dev, "could not get jack detection gpio\n"); return PTR_ERR(pdata->jack_detection_gpio); } - pdata->eci_sw_gpio = devm_gpiod_get(card->dev, "eci-switch"); + pdata->eci_sw_gpio = devm_gpiod_get(card->dev, "eci-switch", + GPIOD_OUT_HIGH); if (IS_ERR(pdata->eci_sw_gpio)) { dev_err(card->dev, "could not get eci switch gpio\n"); return PTR_ERR(pdata->eci_sw_gpio); } - err = gpiod_direction_output(pdata->eci_sw_gpio, 1); - if (err) { - dev_err(card->dev, "could not setup eci switch gpio\n"); - return err; - } - pdata->speaker_amp_gpio = devm_gpiod_get(card->dev, - "speaker-amplifier"); + "speaker-amplifier", + GPIOD_OUT_LOW); if (IS_ERR(pdata->speaker_amp_gpio)) { dev_err(card->dev, "could not get speaker enable gpio\n"); return PTR_ERR(pdata->speaker_amp_gpio); } - err = gpiod_direction_output(pdata->speaker_amp_gpio, 0); - if (err) { - dev_err(card->dev, "could not setup speaker enable gpio\n"); - return err; - } - err = devm_snd_soc_register_card(card->dev, card); if (err) { dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", err); |