From f7519d8c8290765a9408a52db4ba4a368ff72ca5 Mon Sep 17 00:00:00 2001 From: Janusz Krzysztofik Date: Tue, 20 Dec 2011 22:54:18 +0100 Subject: ARM: OMAP1: ams-delta: register latch dependent devices later In preparation to converting Amstrad Delta on-board latches to basic_mmio_gpio devices, registration of platform devices which depend on latches and will require initialization of their GPIO pins first, should be moved out of .machine_init down to late_initcall level, as the gpio-generic driver is not available until device_initcall time. The latch reset operation, which will be replaced with GPIO initialization, must also be moved to late_initcall for the same reason. Since there was already another, separate arch_initcall function for setting up one of those latch dependent devices, the on-board modem device, reuse that function, i.e., rename it to a name that matches the new purpose, extend with other device setup relocated from .machine_init, and move down to the late_initcall level. While being at it, add missing gpio_free() in case the modem platform device registration fails. Thanks to Tony Lindgren who suggested this approach instead of shifting up the gpio-generic driver initialization. In addition, defer registration of the Amstrad Delta ASoC and serio devices, done from their device driver files, until late_initcall time, as those drivers will depend on their GPIO pins already requested from the board late_init() function until updated to register their GPIO pins themselves. Signed-off-by: Janusz Krzysztofik Acked-by: Mark Brown Signed-off-by: Tony Lindgren --- sound/soc/omap/ams-delta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c index ccb8a6a..be81bc7 100644 --- a/sound/soc/omap/ams-delta.c +++ b/sound/soc/omap/ams-delta.c @@ -636,7 +636,7 @@ err: platform_device_put(ams_delta_audio_platform_device); return ret; } -module_init(ams_delta_module_init); +late_initcall(ams_delta_module_init); static void __exit ams_delta_module_exit(void) { -- cgit v1.1 From 210762268466634ddbfaddb48fdf5181ce4b5f2d Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Sat, 27 Aug 2011 18:53:03 +0200 Subject: firewire: move fw_device reference counting from drivers to core fw_unit device drivers invariably need to talk to the fw_unit's parent (an fw_device) and grandparent (an fw_card). firewire-core already maintains an fw_card reference for the entire lifetime of an fw_device. Likewise, let firewire-core maintain an fw_device reference for the entire lifetime of an fw_unit so that fw_unit drivers don't have to. Signed-off-by: Stefan Richter --- sound/firewire/isight.c | 4 +--- sound/firewire/speakers.c | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) (limited to 'sound') diff --git a/sound/firewire/isight.c b/sound/firewire/isight.c index 4400308..412b65f 100644 --- a/sound/firewire/isight.c +++ b/sound/firewire/isight.c @@ -612,7 +612,6 @@ static void isight_card_free(struct snd_card *card) fw_iso_resources_destroy(&isight->resources); fw_unit_put(isight->unit); - fw_device_put(isight->device); mutex_destroy(&isight->mutex); } @@ -645,7 +644,7 @@ static int isight_probe(struct device *unit_dev) isight->card = card; mutex_init(&isight->mutex); isight->unit = fw_unit_get(unit); - isight->device = fw_device_get(fw_dev); + isight->device = fw_dev; isight->audio_base = get_unit_base(unit); if (!isight->audio_base) { dev_err(&unit->device, "audio unit base not found\n"); @@ -682,7 +681,6 @@ static int isight_probe(struct device *unit_dev) err_unit: fw_unit_put(isight->unit); - fw_device_put(isight->device); mutex_destroy(&isight->mutex); error: snd_card_free(card); diff --git a/sound/firewire/speakers.c b/sound/firewire/speakers.c index 3fc257d..18b9b56 100644 --- a/sound/firewire/speakers.c +++ b/sound/firewire/speakers.c @@ -656,12 +656,10 @@ static u32 fwspk_read_firmware_version(struct fw_unit *unit) static void fwspk_card_free(struct snd_card *card) { struct fwspk *fwspk = card->private_data; - struct fw_device *dev = fw_parent_device(fwspk->unit); amdtp_out_stream_destroy(&fwspk->stream); cmp_connection_destroy(&fwspk->connection); fw_unit_put(fwspk->unit); - fw_device_put(dev); mutex_destroy(&fwspk->mutex); } @@ -718,7 +716,6 @@ static int __devinit fwspk_probe(struct device *unit_dev) fwspk = card->private_data; fwspk->card = card; mutex_init(&fwspk->mutex); - fw_device_get(fw_dev); fwspk->unit = fw_unit_get(unit); fwspk->device_info = fwspk_detect(fw_dev); if (!fwspk->device_info) { @@ -767,7 +764,6 @@ err_connection: cmp_connection_destroy(&fwspk->connection); err_unit: fw_unit_put(fwspk->unit); - fw_device_put(fw_dev); mutex_destroy(&fwspk->mutex); error: snd_card_free(card); -- cgit v1.1 From 9482ee7175d1c312c96ffc85c7c413b283cf847b Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Tue, 3 Jan 2012 17:10:17 -0600 Subject: sound: pxa2xx-ac97: include mach/irqs.h directly In preparation of removing mach/irqs.h include from asm/irq.h, include mach/irqs.h directly. Signed-off-by: Rob Herring --- sound/arm/pxa2xx-ac97-lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c index d1aa421..0e9e822 100644 --- a/sound/arm/pxa2xx-ac97-lib.c +++ b/sound/arm/pxa2xx-ac97-lib.c @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include -- cgit v1.1 From c0fa6c8af7ab4f5d69d512a0d5fc3de512f337ae Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 9 Jan 2012 10:32:48 +0100 Subject: ASoC: i.MX: Add missing dma_async_issue_pending Signed-off-by: Sascha Hauer Acked-by: Mark Brown Signed-off-by: Vinod Koul --- sound/soc/imx/imx-pcm-dma-mx2.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound') diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c index 5780c9b..1acfd25 100644 --- a/sound/soc/imx/imx-pcm-dma-mx2.c +++ b/sound/soc/imx/imx-pcm-dma-mx2.c @@ -206,6 +206,7 @@ static int snd_imx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: dmaengine_submit(iprtd->desc); + dma_async_issue_pending(iprtd->dma_chan); break; -- cgit v1.1 From a80581d0d1b11b2d4bbb9333c1cac5416714112d Mon Sep 17 00:00:00 2001 From: "Justin P. Mattock" Date: Sat, 11 Feb 2012 05:55:58 -0800 Subject: Typos: change aditional to additional. The below patch fixes some typos "aditional" to "additional", and also fixes a comment with another word mispelled. Signed-off-by: Justin P. Mattock Signed-off-by: Jiri Kosina --- sound/pci/hda/patch_conexant.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index a7a5733..51e3ed4 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -1643,7 +1643,7 @@ static void cxt5051_update_speaker(struct hda_codec *codec) pinctl = (!spec->hp_present && spec->cur_eapd) ? PIN_OUT : 0; snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, pinctl); - /* on ideapad there is an aditional speaker (subwoofer) to mute */ + /* on ideapad there is an additional speaker (subwoofer) to mute */ if (spec->ideapad) snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, -- cgit v1.1 From 258aea76f552cc755da92e7e823abbb85e021514 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Wed, 1 Feb 2012 16:12:19 +0530 Subject: dmaengine: Pass dma_slave_config .device_fc = NULL for all existing users .device_fc is added in struct dma_slave_config recently. All user drivers, which want DMA to be the flow controller must pass this field as false. As earlier driver don't look to use this feature, mark it false for now. Signed-off-by: Viresh Kumar Acked-by: Linus Walleij Signed-off-by: Vinod Koul --- sound/soc/imx/imx-pcm-dma-mx2.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sound') diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c index 1acfd25..52b0ded 100644 --- a/sound/soc/imx/imx-pcm-dma-mx2.c +++ b/sound/soc/imx/imx-pcm-dma-mx2.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -108,6 +109,8 @@ static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream, return 0; } + slave_config.device_fc = false; + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { slave_config.direction = DMA_MEM_TO_DEV; slave_config.dst_addr = dma_params->dma_addr; -- cgit v1.1 From e2b35f3dbfc080f15b72834d08f04f0269dbe9be Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Wed, 1 Feb 2012 16:12:27 +0530 Subject: dmaengine/dw_dmac: Fix dw_dmac user drivers to adapt to slave_config changes There are few existing user drivers of dw_dmac. They will break as soon as we remove unused fields from struct dw_dma_slave. This patch focuses to fix these user drivers to use dma_slave_config() routine. Signed-off-by: Viresh Kumar Signed-off-by: Vinod Koul --- sound/atmel/abdac.c | 18 ++++++++++++++---- sound/atmel/ac97c.c | 41 +++++++++++++++++++++++++++++++++-------- 2 files changed, 47 insertions(+), 12 deletions(-) (limited to 'sound') diff --git a/sound/atmel/abdac.c b/sound/atmel/abdac.c index 4fa1dbd..f7c2bb0 100644 --- a/sound/atmel/abdac.c +++ b/sound/atmel/abdac.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -467,15 +468,24 @@ static int __devinit atmel_abdac_probe(struct platform_device *pdev) snd_card_set_dev(card, &pdev->dev); if (pdata->dws.dma_dev) { - struct dw_dma_slave *dws = &pdata->dws; dma_cap_mask_t mask; - dws->tx_reg = regs->start + DAC_DATA; - dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); - dac->dma.chan = dma_request_channel(mask, filter, dws); + dac->dma.chan = dma_request_channel(mask, filter, &pdata->dws); + if (dac->dma.chan) { + struct dma_slave_config dma_conf = { + .dst_addr = regs->start + DAC_DATA, + .dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES, + .src_maxburst = 1, + .dst_maxburst = 1, + .direction = DMA_MEM_TO_DEV, + .device_fc = false, + }; + + dmaengine_slave_config(dac->dma.chan, &dma_conf); + } } if (!pdata->dws.dma_dev || !dac->dma.chan) { dev_dbg(&pdev->dev, "DMA not available\n"); diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c index 61dade6..115313e 100644 --- a/sound/atmel/ac97c.c +++ b/sound/atmel/ac97c.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -1014,16 +1015,28 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev) if (cpu_is_at32ap7000()) { if (pdata->rx_dws.dma_dev) { - struct dw_dma_slave *dws = &pdata->rx_dws; dma_cap_mask_t mask; - dws->rx_reg = regs->start + AC97C_CARHR + 2; - dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); chip->dma.rx_chan = dma_request_channel(mask, filter, - dws); + &pdata->rx_dws); + if (chip->dma.rx_chan) { + struct dma_slave_config dma_conf = { + .src_addr = regs->start + AC97C_CARHR + + 2, + .src_addr_width = + DMA_SLAVE_BUSWIDTH_2_BYTES, + .src_maxburst = 1, + .dst_maxburst = 1, + .direction = DMA_DEV_TO_MEM, + .device_fc = false, + }; + + dmaengine_slave_config(chip->dma.rx_chan, + &dma_conf); + } dev_info(&chip->pdev->dev, "using %s for DMA RX\n", dev_name(&chip->dma.rx_chan->dev->device)); @@ -1031,16 +1044,28 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev) } if (pdata->tx_dws.dma_dev) { - struct dw_dma_slave *dws = &pdata->tx_dws; dma_cap_mask_t mask; - dws->tx_reg = regs->start + AC97C_CATHR + 2; - dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); chip->dma.tx_chan = dma_request_channel(mask, filter, - dws); + &pdata->tx_dws); + if (chip->dma.tx_chan) { + struct dma_slave_config dma_conf = { + .dst_addr = regs->start + AC97C_CATHR + + 2, + .dst_addr_width = + DMA_SLAVE_BUSWIDTH_2_BYTES, + .src_maxburst = 1, + .dst_maxburst = 1, + .direction = DMA_MEM_TO_DEV, + .device_fc = false, + }; + + dmaengine_slave_config(chip->dma.tx_chan, + &dma_conf); + } dev_info(&chip->pdev->dev, "using %s for DMA TX\n", dev_name(&chip->dma.tx_chan->dev->device)); -- cgit v1.1 From 462835e4a7f898662cc30064a33177af4823ef9d Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Sat, 21 Jan 2012 12:11:53 +0000 Subject: mfd/ASoC: Convert WM8994 driver to use regmap patches Early revisions of several of the WM8994 variants have register updates to improve performance. Move these over to using the regmap patch system instead of open coding them in the audio driver. Since the regmap init is done by the MFD the code is moved there. Signed-off-by: Mark Brown Acked-by: Samuel Ortiz --- sound/soc/codecs/wm8994.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index ec69a6c..7c686ab 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -2099,26 +2099,9 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec, case SND_SOC_BIAS_STANDBY: if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { switch (control->type) { - case WM8994: - if (wm8994->revision < 4) { - /* Tweak DC servo and DSP - * configuration for improved - * performance. */ - snd_soc_write(codec, 0x102, 0x3); - snd_soc_write(codec, 0x56, 0x3); - snd_soc_write(codec, 0x817, 0); - snd_soc_write(codec, 0x102, 0); - } - break; - case WM8958: if (wm8994->revision == 0) { /* Optimise performance for rev A */ - snd_soc_write(codec, 0x102, 0x3); - snd_soc_write(codec, 0xcb, 0x81); - snd_soc_write(codec, 0x817, 0); - snd_soc_write(codec, 0x102, 0); - snd_soc_update_bits(codec, WM8958_CHARGE_PUMP_2, WM8958_CP_DISCH, @@ -2126,13 +2109,7 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec, } break; - case WM1811: - if (wm8994->revision < 2) { - snd_soc_write(codec, 0x102, 0x3); - snd_soc_write(codec, 0x5d, 0x7e); - snd_soc_write(codec, 0x5e, 0x0); - snd_soc_write(codec, 0x102, 0x0); - } + default: break; } -- cgit v1.1 From b130d5c29544fe4cedafd35b112d27a06550d844 Mon Sep 17 00:00:00 2001 From: Kukjin Kim Date: Fri, 3 Feb 2012 14:29:23 +0900 Subject: ARM: S3C24XX: change the ARCH_S3C2410 to ARCH_S3C24XX This patch changes the ARCH name to "ARCH_S3C24XX" for Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443, and S3C2450 SoCs so that we can merge the mach-xxx directories and plat-s3c24xx dir. to just one mach-s3c24xx for them. I think this should be sent to upstream via samsung tree because this touches many samsung stuff. Cc: Dmitry Torokhov Cc: Richard Purdie Cc: Chris Ball Cc: David Woodhouse Cc: Alessandro Zummo Cc: Grant Likely Cc: Greg Kroah-Hartman [for the gadget part:] Acked-by: Felipe Balbi [for the framebuffer (video) part:] Acked-by: Florian Tobias Schandinat [For the watchdog-part:] Acked-by: Wim Van Sebroeck Cc: Sangbeom Kim Cc: Liam Girdwood Cc: Mark Brown Cc: Russell King Signed-off-by: Kukjin Kim --- sound/soc/samsung/Kconfig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sound') diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index f3417f2..fe3995c 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -1,8 +1,8 @@ config SND_SOC_SAMSUNG tristate "ASoC support for Samsung" - depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_S5P64X0 || ARCH_EXYNOS4 + depends on ARCH_S3C24XX || ARCH_S3C64XX || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_S5P64X0 || ARCH_EXYNOS4 select S3C64XX_DMA if ARCH_S3C64XX - select S3C2410_DMA if ARCH_S3C2410 + select S3C2410_DMA if ARCH_S3C24XX help Say Y or M if you want to add support for codecs attached to the Samsung SoCs' Audio interfaces. You will also need to @@ -84,7 +84,7 @@ config SND_SOC_SAMSUNG_SMDK2443_WM9710 config SND_SOC_SAMSUNG_LN2440SBC_ALC650 tristate "SoC AC97 Audio support for LN2440SBC - ALC650" - depends on SND_SOC_SAMSUNG && ARCH_S3C2410 + depends on SND_SOC_SAMSUNG && ARCH_S3C24XX select S3C2410_DMA select AC97_BUS select SND_SOC_AC97_CODEC @@ -95,7 +95,7 @@ config SND_SOC_SAMSUNG_LN2440SBC_ALC650 config SND_SOC_SAMSUNG_S3C24XX_UDA134X tristate "SoC I2S Audio support UDA134X wired to a S3C24XX" - depends on SND_SOC_SAMSUNG && ARCH_S3C2410 + depends on SND_SOC_SAMSUNG && ARCH_S3C24XX select SND_S3C24XX_I2S select SND_SOC_L3 select SND_SOC_UDA134X @@ -107,14 +107,14 @@ config SND_SOC_SAMSUNG_SIMTEC config SND_SOC_SAMSUNG_SIMTEC_TLV320AIC23 tristate "SoC I2S Audio support for TLV320AIC23 on Simtec boards" - depends on SND_SOC_SAMSUNG && ARCH_S3C2410 + depends on SND_SOC_SAMSUNG && ARCH_S3C24XX select SND_S3C24XX_I2S select SND_SOC_TLV320AIC23 select SND_SOC_SAMSUNG_SIMTEC config SND_SOC_SAMSUNG_SIMTEC_HERMES tristate "SoC I2S Audio support for Simtec Hermes board" - depends on SND_SOC_SAMSUNG && ARCH_S3C2410 + depends on SND_SOC_SAMSUNG && ARCH_S3C24XX select SND_S3C24XX_I2S select SND_SOC_TLV320AIC3X select SND_SOC_SAMSUNG_SIMTEC -- cgit v1.1 From 0379c1f55b734d9d112f535e12f4508b90a1bab1 Mon Sep 17 00:00:00 2001 From: Janusz Krzysztofik Date: Mon, 5 Mar 2012 17:05:12 +0100 Subject: ASoC: OMAP: ams-delta: drop .set_bias_level callback This functionality has already been implemented in the cx20442 codec driver (commit f75a8ff67d161b5166a2c2360bb2ffaefd5eb853, "ASoC: cx20442: add bias control over a platform provided regulator"), no need to keep it here duplicated. Once done, remove the no longer used AMS_DELTA_LATCH2_MODEM_NRESET symbol from the board header file and a call to the regulator_toggle() helper function from the old API wrapper found in the board file. While being at it, simplify the way the modem .pm callback handles the regulator and drop that helper function and its related consumer setup completely. Depends on patches 1/3 and 2/3 for clean apply and keep things working. Signed-off-by: Janusz Krzysztofik Acked-by: Mark Brown Cc: Tony Lindgren Signed-off-by: Tony Lindgren --- sound/soc/omap/ams-delta.c | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'sound') diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c index da6e005..f610260 100644 --- a/sound/soc/omap/ams-delta.c +++ b/sound/soc/omap/ams-delta.c @@ -426,29 +426,6 @@ static struct snd_soc_ops ams_delta_ops = { }; -/* Board specific codec bias level control */ -static int ams_delta_set_bias_level(struct snd_soc_card *card, - struct snd_soc_dapm_context *dapm, - enum snd_soc_bias_level level) -{ - switch (level) { - case SND_SOC_BIAS_ON: - case SND_SOC_BIAS_PREPARE: - case SND_SOC_BIAS_STANDBY: - if (card->dapm.bias_level == SND_SOC_BIAS_OFF) - ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET, - AMS_DELTA_LATCH2_MODEM_NRESET); - break; - case SND_SOC_BIAS_OFF: - if (card->dapm.bias_level != SND_SOC_BIAS_OFF) - ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET, - 0); - } - card->dapm.bias_level = level; - - return 0; -} - /* Digital mute implemented using modem/CPU multiplexer. * Shares hardware with codec config pulse generation */ static bool ams_delta_muted = 1; @@ -512,9 +489,6 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd) ams_delta_ops.shutdown = ams_delta_shutdown; } - /* Set codec bias level */ - ams_delta_set_bias_level(card, dapm, SND_SOC_BIAS_STANDBY); - /* Add hook switch - can be used to control the codec from userspace * even if line discipline fails */ ret = snd_soc_jack_new(rtd->codec, "hook_switch", @@ -598,7 +572,6 @@ static struct snd_soc_card ams_delta_audio_card = { .owner = THIS_MODULE, .dai_link = &ams_delta_dai_link, .num_links = 1, - .set_bias_level = ams_delta_set_bias_level, }; /* Module init/exit */ @@ -647,11 +620,6 @@ static void __exit ams_delta_module_exit(void) ARRAY_SIZE(ams_delta_hook_switch_gpios), ams_delta_hook_switch_gpios); - /* Keep modem power on */ - ams_delta_set_bias_level(&ams_delta_audio_card, - &ams_delta_audio_card.rtd[0].codec->dapm, - SND_SOC_BIAS_STANDBY); - platform_device_unregister(cx20442_platform_device); platform_device_unregister(ams_delta_audio_platform_device); } -- cgit v1.1 From 51990e825431089747f8896244b5c17d3a6423f1 Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Sun, 22 Jan 2012 11:23:42 -0500 Subject: device.h: cleanup users outside of linux/include (C files) For files that are actively using linux/device.h, make sure that they call it out. This will allow us to clean up some of the implicit uses of linux/device.h within include/* without introducing build regressions. Yes, this was created by "cheating" -- i.e. the headers were cleaned up, and then the fallout was found and fixed, and then the two commits were reordered. This ensures we don't introduce build regressions into the git history. Signed-off-by: Paul Gortmaker --- sound/core/init.c | 1 + sound/core/pcm.c | 1 + sound/core/seq/seq.c | 1 + sound/core/timer.c | 1 + 4 files changed, 4 insertions(+) (limited to 'sound') diff --git a/sound/core/init.c b/sound/core/init.c index 3ac49b1..995fc5d 100644 --- a/sound/core/init.c +++ b/sound/core/init.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/sound/core/pcm.c b/sound/core/pcm.c index 8928ca87..1888a90 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/sound/core/seq/seq.c b/sound/core/seq/seq.c index 9d8379a..7121105 100644 --- a/sound/core/seq/seq.c +++ b/sound/core/seq/seq.c @@ -21,6 +21,7 @@ #include #include +#include #include #include diff --git a/sound/core/timer.c b/sound/core/timer.c index 8e7561d..6ddcf06 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include -- cgit v1.1 From f15855bfaad29b2badd4a5c30ad73e0542a19d16 Mon Sep 17 00:00:00 2001 From: Ryan Mallon Date: Wed, 11 Jan 2012 11:04:42 +1100 Subject: ep93xx: Don't use system controller defines in audio drivers Both the Snapper CL15 and EDB93xx audio drivers set the same audio configuration in ep93xx_i2s_acquire. Remove the arguments to ep93xx_i2s_acquire so that the audio drivers no longer need the EP93XX_SYSCON defines exported. Signed-off-by: Ryan Mallon Cc: Liam Girdwood Cc: Mark Brown Reviewed-by: Mika Westerberg Acked-by: Hartley Sweeten --- sound/soc/ep93xx/edb93xx.c | 4 +--- sound/soc/ep93xx/snappercl15.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'sound') diff --git a/sound/soc/ep93xx/edb93xx.c b/sound/soc/ep93xx/edb93xx.c index bae5cbb..e01cb02 100644 --- a/sound/soc/ep93xx/edb93xx.c +++ b/sound/soc/ep93xx/edb93xx.c @@ -85,9 +85,7 @@ static int __devinit edb93xx_probe(struct platform_device *pdev) struct snd_soc_card *card = &snd_soc_edb93xx; int ret; - ret = ep93xx_i2s_acquire(EP93XX_SYSCON_DEVCFG_I2SONAC97, - EP93XX_SYSCON_I2SCLKDIV_ORIDE | - EP93XX_SYSCON_I2SCLKDIV_SPOL); + ret = ep93xx_i2s_acquire(); if (ret) return ret; diff --git a/sound/soc/ep93xx/snappercl15.c b/sound/soc/ep93xx/snappercl15.c index ccae34a..a193cea 100644 --- a/sound/soc/ep93xx/snappercl15.c +++ b/sound/soc/ep93xx/snappercl15.c @@ -103,9 +103,7 @@ static int __devinit snappercl15_probe(struct platform_device *pdev) struct snd_soc_card *card = &snd_soc_snappercl15; int ret; - ret = ep93xx_i2s_acquire(EP93XX_SYSCON_DEVCFG_I2SONAC97, - EP93XX_SYSCON_I2SCLKDIV_ORIDE | - EP93XX_SYSCON_I2SCLKDIV_SPOL); + ret = ep93xx_i2s_acquire(); if (ret) return ret; -- cgit v1.1 From 9e5ed094c89e55fbf11d2e81d60be98eb12346c0 Mon Sep 17 00:00:00 2001 From: viresh kumar Date: Thu, 15 Mar 2012 10:40:38 +0100 Subject: ARM: 7362/1: AMBA: Add module_amba_driver() helper macro for amba_driver For simple modules that contain a single amba_driver without any additional setup code then ends up being a block of duplicated boilerplate. This patch adds a new macro, module_amba_driver(), which replaces the module_init()/module_exit() registrations with template functions. Signed-off-by: Viresh Kumar Signed-off-by: Russell King --- sound/arm/aaci.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'sound') diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index b37b702a..5119fda 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c @@ -1110,18 +1110,7 @@ static struct amba_driver aaci_driver = { .id_table = aaci_ids, }; -static int __init aaci_init(void) -{ - return amba_driver_register(&aaci_driver); -} - -static void __exit aaci_exit(void) -{ - amba_driver_unregister(&aaci_driver); -} - -module_init(aaci_init); -module_exit(aaci_exit); +module_amba_driver(aaci_driver); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("ARM PrimeCell PL041 Advanced Audio CODEC Interface driver"); -- cgit v1.1 From d4ecc83b79cc290eadf1ffb33a589c3c72bbc295 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 27 Feb 2012 05:30:13 -0300 Subject: [media] tea575x-tuner: update to latest V4L2 framework requirements The tea575x-tuner module has been updated to use the latest V4L2 framework functionality. This also required changes in the drivers that rely on it. The tea575x changes are: - The drivers must provide a v4l2_device struct to the tea module. - The radio_nr module parameter must be part of the actual radio driver, and not of the tea module. - Changed the frequency range to the normal 76-108 MHz range instead of 50-150. - Add hardware frequency seek support. - Fix broken rxsubchans/audmode handling. - The application can now select between stereo and mono. - Support polling for control events. - Add V4L2 priority handling. And radio-sf16fmr2.c now uses the isa bus kernel framework. Signed-off-by: Hans Verkuil Thanks-to: Ondrej Zary Signed-off-by: Mauro Carvalho Chehab --- sound/i2c/other/tea575x-tuner.c | 146 ++++++++++++++++++++++------------------ sound/pci/es1968.c | 15 +++++ sound/pci/fm801.c | 20 +++++- 3 files changed, 113 insertions(+), 68 deletions(-) (limited to 'sound') diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c index 6b68c82..b291bd8 100644 --- a/sound/i2c/other/tea575x-tuner.c +++ b/sound/i2c/other/tea575x-tuner.c @@ -25,21 +25,20 @@ #include #include #include -#include +#include +#include #include +#include #include +#include #include MODULE_AUTHOR("Jaroslav Kysela "); MODULE_DESCRIPTION("Routines for control of TEA5757/5759 Philips AM/FM radio tuner chips"); MODULE_LICENSE("GPL"); -static int radio_nr = -1; -module_param(radio_nr, int, 0); - -#define RADIO_VERSION KERNEL_VERSION(0, 0, 2) -#define FREQ_LO (50UL * 16000) -#define FREQ_HI (150UL * 16000) +#define FREQ_LO (76U * 16000) +#define FREQ_HI (108U * 16000) /* * definitions @@ -121,28 +120,10 @@ static unsigned int snd_tea575x_read(struct snd_tea575x *tea) return data; } -static void snd_tea575x_get_freq(struct snd_tea575x *tea) -{ - unsigned long freq; - - freq = snd_tea575x_read(tea) & TEA575X_BIT_FREQ_MASK; - /* freq *= 12.5 */ - freq *= 125; - freq /= 10; - /* crystal fixup */ - if (tea->tea5759) - freq += TEA575X_FMIF; - else - freq -= TEA575X_FMIF; - - tea->freq = freq * 16; /* from kHz */ -} - static void snd_tea575x_set_freq(struct snd_tea575x *tea) { - unsigned long freq; + u32 freq = tea->freq; - freq = clamp(tea->freq, FREQ_LO, FREQ_HI); freq /= 16; /* to kHz */ /* crystal fixup */ if (tea->tea5759) @@ -167,12 +148,14 @@ static int vidioc_querycap(struct file *file, void *priv, { struct snd_tea575x *tea = video_drvdata(file); - strlcpy(v->driver, "tea575x-tuner", sizeof(v->driver)); + strlcpy(v->driver, tea->v4l2_dev->name, sizeof(v->driver)); strlcpy(v->card, tea->card, sizeof(v->card)); strlcat(v->card, tea->tea5759 ? " TEA5759" : " TEA5757", sizeof(v->card)); strlcpy(v->bus_info, tea->bus_info, sizeof(v->bus_info)); - v->version = RADIO_VERSION; - v->capabilities = V4L2_CAP_TUNER | V4L2_CAP_RADIO; + v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO; + if (!tea->cannot_read_data) + v->device_caps |= V4L2_CAP_HW_FREQ_SEEK; + v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS; return 0; } @@ -191,18 +174,24 @@ static int vidioc_g_tuner(struct file *file, void *priv, v->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; v->rangelow = FREQ_LO; v->rangehigh = FREQ_HI; - v->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; - v->audmode = tea->stereo ? V4L2_TUNER_MODE_STEREO : V4L2_TUNER_MODE_MONO; + v->rxsubchans = tea->stereo ? V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO; + v->audmode = (tea->val & TEA575X_BIT_MONO) ? + V4L2_TUNER_MODE_MONO : V4L2_TUNER_MODE_STEREO; v->signal = tea->tuned ? 0xffff : 0; - return 0; } static int vidioc_s_tuner(struct file *file, void *priv, struct v4l2_tuner *v) { - if (v->index > 0) + struct snd_tea575x *tea = video_drvdata(file); + + if (v->index) return -EINVAL; + tea->val &= ~TEA575X_BIT_MONO; + if (v->audmode == V4L2_TUNER_MODE_MONO) + tea->val |= TEA575X_BIT_MONO; + snd_tea575x_write(tea, tea->val); return 0; } @@ -214,7 +203,6 @@ static int vidioc_g_frequency(struct file *file, void *priv, if (f->tuner != 0) return -EINVAL; f->type = V4L2_TUNER_RADIO; - snd_tea575x_get_freq(tea); f->frequency = tea->freq; return 0; } @@ -227,32 +215,47 @@ static int vidioc_s_frequency(struct file *file, void *priv, if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) return -EINVAL; - if (f->frequency < FREQ_LO || f->frequency > FREQ_HI) - return -EINVAL; - - tea->freq = f->frequency; - + tea->val &= ~TEA575X_BIT_SEARCH; + tea->freq = clamp(f->frequency, FREQ_LO, FREQ_HI); snd_tea575x_set_freq(tea); - return 0; } -static int vidioc_g_audio(struct file *file, void *priv, - struct v4l2_audio *a) +static int vidioc_s_hw_freq_seek(struct file *file, void *fh, + struct v4l2_hw_freq_seek *a) { - if (a->index > 1) - return -EINVAL; - - strcpy(a->name, "Radio"); - a->capability = V4L2_AUDCAP_STEREO; - return 0; -} + struct snd_tea575x *tea = video_drvdata(file); -static int vidioc_s_audio(struct file *file, void *priv, - struct v4l2_audio *a) -{ - if (a->index != 0) + if (tea->cannot_read_data) + return -ENOTTY; + if (a->tuner || a->wrap_around) return -EINVAL; + tea->val |= TEA575X_BIT_SEARCH; + tea->val &= ~TEA575X_BIT_UPDOWN; + if (a->seek_upward) + tea->val |= TEA575X_BIT_UPDOWN; + snd_tea575x_write(tea, tea->val); + for (;;) { + unsigned val = snd_tea575x_read(tea); + + if (!(val & TEA575X_BIT_SEARCH)) { + /* Found a frequency */ + val &= TEA575X_BIT_FREQ_MASK; + val = (val * 10) / 125; + if (tea->tea5759) + val += TEA575X_FMIF; + else + val -= TEA575X_FMIF; + tea->freq = clamp(val * 16, FREQ_LO, FREQ_HI); + return 0; + } + if (schedule_timeout_interruptible(msecs_to_jiffies(10))) { + /* some signal arrived, stop search */ + tea->val &= ~TEA575X_BIT_SEARCH; + snd_tea575x_write(tea, tea->val); + return -ERESTARTSYS; + } + } return 0; } @@ -273,23 +276,27 @@ static int tea575x_s_ctrl(struct v4l2_ctrl *ctrl) static const struct v4l2_file_operations tea575x_fops = { .owner = THIS_MODULE, .unlocked_ioctl = video_ioctl2, + .open = v4l2_fh_open, + .release = v4l2_fh_release, + .poll = v4l2_ctrl_poll, }; static const struct v4l2_ioctl_ops tea575x_ioctl_ops = { .vidioc_querycap = vidioc_querycap, .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, - .vidioc_g_audio = vidioc_g_audio, - .vidioc_s_audio = vidioc_s_audio, .vidioc_g_frequency = vidioc_g_frequency, .vidioc_s_frequency = vidioc_s_frequency, + .vidioc_s_hw_freq_seek = vidioc_s_hw_freq_seek, + .vidioc_log_status = v4l2_ctrl_log_status, + .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, + .vidioc_unsubscribe_event = v4l2_event_unsubscribe, }; -static struct video_device tea575x_radio = { - .name = "tea575x-tuner", +static const struct video_device tea575x_radio = { .fops = &tea575x_fops, .ioctl_ops = &tea575x_ioctl_ops, - .release = video_device_release_empty, + .release = video_device_release_empty, }; static const struct v4l2_ctrl_ops tea575x_ctrl_ops = { @@ -303,11 +310,15 @@ int snd_tea575x_init(struct snd_tea575x *tea) { int retval; - tea->mute = 1; + tea->mute = true; - snd_tea575x_write(tea, 0x55AA); - if (snd_tea575x_read(tea) != 0x55AA) - return -ENODEV; + /* Not all devices can or know how to read the data back. + Such devices can set cannot_read_data to true. */ + if (!tea->cannot_read_data) { + snd_tea575x_write(tea, 0x55AA); + if (snd_tea575x_read(tea) != 0x55AA) + return -ENODEV; + } tea->val = TEA575X_BIT_BAND_FM | TEA575X_BIT_SEARCH_10_40; tea->freq = 90500 * 16; /* 90.5Mhz default */ @@ -316,14 +327,17 @@ int snd_tea575x_init(struct snd_tea575x *tea) tea->vd = tea575x_radio; video_set_drvdata(&tea->vd, tea); mutex_init(&tea->mutex); + strlcpy(tea->vd.name, tea->v4l2_dev->name, sizeof(tea->vd.name)); tea->vd.lock = &tea->mutex; + tea->vd.v4l2_dev = tea->v4l2_dev; + tea->vd.ctrl_handler = &tea->ctrl_handler; + set_bit(V4L2_FL_USE_FH_PRIO, &tea->vd.flags); v4l2_ctrl_handler_init(&tea->ctrl_handler, 1); - tea->vd.ctrl_handler = &tea->ctrl_handler; v4l2_ctrl_new_std(&tea->ctrl_handler, &tea575x_ctrl_ops, V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1); retval = tea->ctrl_handler.error; if (retval) { - printk(KERN_ERR "tea575x-tuner: can't initialize controls\n"); + v4l2_err(tea->v4l2_dev, "can't initialize controls\n"); v4l2_ctrl_handler_free(&tea->ctrl_handler); return retval; } @@ -338,9 +352,9 @@ int snd_tea575x_init(struct snd_tea575x *tea) v4l2_ctrl_handler_setup(&tea->ctrl_handler); - retval = video_register_device(&tea->vd, VFL_TYPE_RADIO, radio_nr); + retval = video_register_device(&tea->vd, VFL_TYPE_RADIO, tea->radio_nr); if (retval) { - printk(KERN_ERR "tea575x-tuner: can't register video device!\n"); + v4l2_err(tea->v4l2_dev, "can't register video device!\n"); v4l2_ctrl_handler_free(&tea->ctrl_handler); return retval; } diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index cb557c6..a8faae1 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c @@ -142,6 +142,7 @@ static int enable_mpu[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2}; #ifdef SUPPORT_JOYSTICK static bool joystick[SNDRV_CARDS]; #endif +static int radio_nr[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1}; module_param_array(index, int, NULL, 0444); MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard."); @@ -165,6 +166,9 @@ MODULE_PARM_DESC(enable_mpu, "Enable MPU401. (0 = off, 1 = on, 2 = auto)"); module_param_array(joystick, bool, NULL, 0444); MODULE_PARM_DESC(joystick, "Enable joystick."); #endif +module_param_array(radio_nr, int, NULL, 0444); +MODULE_PARM_DESC(radio_nr, "Radio device numbers"); + #define NR_APUS 64 @@ -558,6 +562,7 @@ struct es1968 { struct work_struct hwvol_work; #ifdef CONFIG_SND_ES1968_RADIO + struct v4l2_device v4l2_dev; struct snd_tea575x tea; #endif }; @@ -2613,6 +2618,7 @@ static int snd_es1968_free(struct es1968 *chip) #ifdef CONFIG_SND_ES1968_RADIO snd_tea575x_exit(&chip->tea); + v4l2_device_unregister(&chip->v4l2_dev); #endif if (chip->irq >= 0) @@ -2655,6 +2661,7 @@ static int __devinit snd_es1968_create(struct snd_card *card, int capt_streams, int chip_type, int do_pm, + int radio_nr, struct es1968 **chip_ret) { static struct snd_device_ops ops = { @@ -2751,7 +2758,14 @@ static int __devinit snd_es1968_create(struct snd_card *card, snd_card_set_dev(card, &pci->dev); #ifdef CONFIG_SND_ES1968_RADIO + err = v4l2_device_register(&pci->dev, &chip->v4l2_dev); + if (err < 0) { + snd_es1968_free(chip); + return err; + } + chip->tea.v4l2_dev = &chip->v4l2_dev; chip->tea.private_data = chip; + chip->tea.radio_nr = radio_nr; chip->tea.ops = &snd_es1968_tea_ops; strlcpy(chip->tea.card, "SF64-PCE2", sizeof(chip->tea.card)); sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci)); @@ -2797,6 +2811,7 @@ static int __devinit snd_es1968_probe(struct pci_dev *pci, pcm_substreams_c[dev], pci_id->driver_data, use_pm[dev], + radio_nr[dev], &chip)) < 0) { snd_card_free(card); return err; diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index 9597ef1..a416ea8 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c @@ -58,6 +58,7 @@ static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card * High 16-bits are video (radio) device number + 1 */ static int tea575x_tuner[SNDRV_CARDS]; +static int radio_nr[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1}; module_param_array(index, int, NULL, 0444); MODULE_PARM_DESC(index, "Index value for the FM801 soundcard."); @@ -67,6 +68,9 @@ module_param_array(enable, bool, NULL, 0444); MODULE_PARM_DESC(enable, "Enable FM801 soundcard."); module_param_array(tea575x_tuner, int, NULL, 0444); MODULE_PARM_DESC(tea575x_tuner, "TEA575x tuner access method (0 = auto, 1 = SF256-PCS, 2=SF256-PCP, 3=SF64-PCR, 8=disable, +16=tuner-only)."); +module_param_array(radio_nr, int, NULL, 0444); +MODULE_PARM_DESC(radio_nr, "Radio device numbers"); + #define TUNER_DISABLED (1<<3) #define TUNER_ONLY (1<<4) @@ -197,6 +201,7 @@ struct fm801 { struct snd_info_entry *proc_entry; #ifdef CONFIG_SND_FM801_TEA575X_BOOL + struct v4l2_device v4l2_dev; struct snd_tea575x tea; #endif @@ -1154,8 +1159,10 @@ static int snd_fm801_free(struct fm801 *chip) __end_hw: #ifdef CONFIG_SND_FM801_TEA575X_BOOL - if (!(chip->tea575x_tuner & TUNER_DISABLED)) + if (!(chip->tea575x_tuner & TUNER_DISABLED)) { snd_tea575x_exit(&chip->tea); + v4l2_device_unregister(&chip->v4l2_dev); + } #endif if (chip->irq >= 0) free_irq(chip->irq, chip); @@ -1175,6 +1182,7 @@ static int snd_fm801_dev_free(struct snd_device *device) static int __devinit snd_fm801_create(struct snd_card *card, struct pci_dev * pci, int tea575x_tuner, + int radio_nr, struct fm801 ** rchip) { struct fm801 *chip; @@ -1234,6 +1242,13 @@ static int __devinit snd_fm801_create(struct snd_card *card, snd_card_set_dev(card, &pci->dev); #ifdef CONFIG_SND_FM801_TEA575X_BOOL + err = v4l2_device_register(&pci->dev, &chip->v4l2_dev); + if (err < 0) { + snd_fm801_free(chip); + return err; + } + chip->tea.v4l2_dev = &chip->v4l2_dev; + chip->tea.radio_nr = radio_nr; chip->tea.private_data = chip; chip->tea.ops = &snd_fm801_tea_ops; sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci)); @@ -1241,6 +1256,7 @@ static int __devinit snd_fm801_create(struct snd_card *card, (tea575x_tuner & TUNER_TYPE_MASK) < 4) { if (snd_tea575x_init(&chip->tea)) { snd_printk(KERN_ERR "TEA575x radio not found\n"); + snd_fm801_free(chip); return -ENODEV; } } else if ((tea575x_tuner & TUNER_TYPE_MASK) == 0) { @@ -1287,7 +1303,7 @@ static int __devinit snd_card_fm801_probe(struct pci_dev *pci, err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); if (err < 0) return err; - if ((err = snd_fm801_create(card, pci, tea575x_tuner[dev], &chip)) < 0) { + if ((err = snd_fm801_create(card, pci, tea575x_tuner[dev], radio_nr[dev], &chip)) < 0) { snd_card_free(card); return err; } -- cgit v1.1 From bc2b395c031430639e5ad5dcb2669cfcf1fa5fd2 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 27 Feb 2012 05:31:58 -0300 Subject: [media] tea575x: fix HW seek Fix HW seek in TEA575x to work properly: - a delay must be present after search start and before first register read or the seek does weird things - when the search stops, the new frequency is not available immediately, we must wait until it appears in the register (fortunately, we can clear the frequency bits when starting the search as it starts at the frequency currently set, not from the value written) - sometimes, seek remains on the current frequency (or moves only a little), so repeat it until it moves by at least 50 kHz Signed-off-by: Ondrej Zary Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- sound/i2c/other/tea575x-tuner.c | 79 +++++++++++++++++++++++++++++++---------- 1 file changed, 61 insertions(+), 18 deletions(-) (limited to 'sound') diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c index b291bd8..a63faec 100644 --- a/sound/i2c/other/tea575x-tuner.c +++ b/sound/i2c/other/tea575x-tuner.c @@ -89,7 +89,7 @@ static void snd_tea575x_write(struct snd_tea575x *tea, unsigned int val) tea->ops->set_pins(tea, 0); } -static unsigned int snd_tea575x_read(struct snd_tea575x *tea) +static u32 snd_tea575x_read(struct snd_tea575x *tea) { u16 l, rdata; u32 data = 0; @@ -120,6 +120,25 @@ static unsigned int snd_tea575x_read(struct snd_tea575x *tea) return data; } +static u32 snd_tea575x_get_freq(struct snd_tea575x *tea) +{ + u32 freq = snd_tea575x_read(tea) & TEA575X_BIT_FREQ_MASK; + + if (freq == 0) + return freq; + + /* freq *= 12.5 */ + freq *= 125; + freq /= 10; + /* crystal fixup */ + if (tea->tea5759) + freq += TEA575X_FMIF; + else + freq -= TEA575X_FMIF; + + return clamp(freq * 16, FREQ_LO, FREQ_HI); /* from kHz */ +} + static void snd_tea575x_set_freq(struct snd_tea575x *tea) { u32 freq = tea->freq; @@ -225,38 +244,62 @@ static int vidioc_s_hw_freq_seek(struct file *file, void *fh, struct v4l2_hw_freq_seek *a) { struct snd_tea575x *tea = video_drvdata(file); + unsigned long timeout; + int i; if (tea->cannot_read_data) return -ENOTTY; if (a->tuner || a->wrap_around) return -EINVAL; + + /* clear the frequency, HW will fill it in */ + tea->val &= ~TEA575X_BIT_FREQ_MASK; tea->val |= TEA575X_BIT_SEARCH; - tea->val &= ~TEA575X_BIT_UPDOWN; if (a->seek_upward) tea->val |= TEA575X_BIT_UPDOWN; + else + tea->val &= ~TEA575X_BIT_UPDOWN; snd_tea575x_write(tea, tea->val); + timeout = jiffies + msecs_to_jiffies(10000); for (;;) { - unsigned val = snd_tea575x_read(tea); - - if (!(val & TEA575X_BIT_SEARCH)) { - /* Found a frequency */ - val &= TEA575X_BIT_FREQ_MASK; - val = (val * 10) / 125; - if (tea->tea5759) - val += TEA575X_FMIF; - else - val -= TEA575X_FMIF; - tea->freq = clamp(val * 16, FREQ_LO, FREQ_HI); - return 0; - } + if (time_after(jiffies, timeout)) + break; if (schedule_timeout_interruptible(msecs_to_jiffies(10))) { /* some signal arrived, stop search */ tea->val &= ~TEA575X_BIT_SEARCH; - snd_tea575x_write(tea, tea->val); + snd_tea575x_set_freq(tea); return -ERESTARTSYS; } + if (!(snd_tea575x_read(tea) & TEA575X_BIT_SEARCH)) { + u32 freq; + + /* Found a frequency, wait until it can be read */ + for (i = 0; i < 100; i++) { + msleep(10); + freq = snd_tea575x_get_freq(tea); + if (freq) /* available */ + break; + } + if (freq == 0) /* shouldn't happen */ + break; + /* + * if we moved by less than 50 kHz, or in the wrong + * direction, continue seeking + */ + if (abs(tea->freq - freq) < 16 * 50 || + (a->seek_upward && freq < tea->freq) || + (!a->seek_upward && freq > tea->freq)) { + snd_tea575x_write(tea, tea->val); + continue; + } + tea->freq = freq; + tea->val &= ~TEA575X_BIT_SEARCH; + return 0; + } } - return 0; + tea->val &= ~TEA575X_BIT_SEARCH; + snd_tea575x_set_freq(tea); + return -EAGAIN; } static int tea575x_s_ctrl(struct v4l2_ctrl *ctrl) @@ -320,7 +363,7 @@ int snd_tea575x_init(struct snd_tea575x *tea) return -ENODEV; } - tea->val = TEA575X_BIT_BAND_FM | TEA575X_BIT_SEARCH_10_40; + tea->val = TEA575X_BIT_BAND_FM | TEA575X_BIT_SEARCH_5_28; tea->freq = 90500 * 16; /* 90.5Mhz default */ snd_tea575x_set_freq(tea); -- cgit v1.1 From 16052827d98fbc13c31ebad560af4bd53e2b4dd5 Mon Sep 17 00:00:00 2001 From: Alexandre Bounine Date: Thu, 8 Mar 2012 16:11:18 -0500 Subject: dmaengine/dma_slave: introduce inline wrappers Add inline wrappers for device_prep_slave_sg() and device_prep_dma_cyclic() interfaces to hide new parameter from current users of affected interfaces. Convert current users to use new wrappers instead of direct calls. Suggested by Russell King [https://lkml.org/lkml/2012/2/3/269]. Signed-off-by: Alexandre Bounine Signed-off-by: Vinod Koul --- sound/soc/ep93xx/ep93xx-pcm.c | 3 +-- sound/soc/imx/imx-pcm-dma-mx2.c | 2 +- sound/soc/mxs/mxs-pcm.c | 2 +- sound/soc/sh/siu_pcm.c | 4 ++-- sound/soc/txx9/txx9aclc.c | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) (limited to 'sound') diff --git a/sound/soc/ep93xx/ep93xx-pcm.c b/sound/soc/ep93xx/ep93xx-pcm.c index de83904..50593e5 100644 --- a/sound/soc/ep93xx/ep93xx-pcm.c +++ b/sound/soc/ep93xx/ep93xx-pcm.c @@ -142,11 +142,10 @@ static int ep93xx_pcm_dma_submit(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct ep93xx_runtime_data *rtd = runtime->private_data; struct dma_chan *chan = rtd->dma_chan; - struct dma_device *dma_dev = chan->device; struct dma_async_tx_descriptor *desc; rtd->pointer_bytes = 0; - desc = dma_dev->device_prep_dma_cyclic(chan, runtime->dma_addr, + desc = dmaengine_prep_dma_cyclic(chan, runtime->dma_addr, rtd->period_bytes * rtd->periods, rtd->period_bytes, rtd->dma_data.direction); diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c index 52b0ded..af46b4e 100644 --- a/sound/soc/imx/imx-pcm-dma-mx2.c +++ b/sound/soc/imx/imx-pcm-dma-mx2.c @@ -160,7 +160,7 @@ static int snd_imx_pcm_hw_params(struct snd_pcm_substream *substream, iprtd->buf = (unsigned int *)substream->dma_buffer.area; - iprtd->desc = chan->device->device_prep_dma_cyclic(chan, dma_addr, + iprtd->desc = dmaengine_prep_dma_cyclic(chan, dma_addr, iprtd->period_bytes * iprtd->periods, iprtd->period_bytes, substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? diff --git a/sound/soc/mxs/mxs-pcm.c b/sound/soc/mxs/mxs-pcm.c index 105f42a..661b678 100644 --- a/sound/soc/mxs/mxs-pcm.c +++ b/sound/soc/mxs/mxs-pcm.c @@ -132,7 +132,7 @@ static int snd_mxs_pcm_hw_params(struct snd_pcm_substream *substream, iprtd->buf = substream->dma_buffer.area; - iprtd->desc = chan->device->device_prep_dma_cyclic(chan, dma_addr, + iprtd->desc = dmaengine_prep_dma_cyclic(chan, dma_addr, iprtd->period_bytes * iprtd->periods, iprtd->period_bytes, substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? diff --git a/sound/soc/sh/siu_pcm.c b/sound/soc/sh/siu_pcm.c index 0193e59..5cfcc65 100644 --- a/sound/soc/sh/siu_pcm.c +++ b/sound/soc/sh/siu_pcm.c @@ -130,7 +130,7 @@ static int siu_pcm_wr_set(struct siu_port *port_info, sg_dma_len(&sg) = size; sg_dma_address(&sg) = buff; - desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan, + desc = dmaengine_prep_slave_sg(siu_stream->chan, &sg, 1, DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); if (!desc) { dev_err(dev, "Failed to allocate a dma descriptor\n"); @@ -180,7 +180,7 @@ static int siu_pcm_rd_set(struct siu_port *port_info, sg_dma_len(&sg) = size; sg_dma_address(&sg) = buff; - desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan, + desc = dmaengine_prep_slave_sg(siu_stream->chan, &sg, 1, DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); if (!desc) { dev_err(dev, "Failed to allocate dma descriptor\n"); diff --git a/sound/soc/txx9/txx9aclc.c b/sound/soc/txx9/txx9aclc.c index 2155461..b609d2c 100644 --- a/sound/soc/txx9/txx9aclc.c +++ b/sound/soc/txx9/txx9aclc.c @@ -132,7 +132,7 @@ txx9aclc_dma_submit(struct txx9aclc_dmadata *dmadata, dma_addr_t buf_dma_addr) sg_set_page(&sg, pfn_to_page(PFN_DOWN(buf_dma_addr)), dmadata->frag_bytes, buf_dma_addr & (PAGE_SIZE - 1)); sg_dma_address(&sg) = buf_dma_addr; - desc = chan->device->device_prep_slave_sg(chan, &sg, 1, + desc = dmaengine_prep_slave_sg(chan, &sg, 1, dmadata->substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); -- cgit v1.1 From 23019a733bb83c8499f192fb428b7e6e81c95a34 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Tue, 20 Mar 2012 14:33:19 -0500 Subject: ARM: pxa: use common IOMEM definition pxa was missed in the moving of IOMEM to a common definition, so lots of IOMEM redefined warnings were introduced. So remove pxa IOMEM definition and fix all the fallout. Reported-by: Paul Gortmaker Signed-off-by: Rob Herring Cc: Eric Miao Cc: Russell King Cc: Haojian Zhuang Cc: Alessandro Zummo Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: rtc-linux@googlegroups.com Cc: alsa-devel@alsa-project.org --- sound/arm/pxa2xx-ac97-lib.c | 1 + sound/arm/pxa2xx-ac97.c | 1 + sound/soc/pxa/pxa2xx-ac97.c | 1 + 3 files changed, 3 insertions(+) (limited to 'sound') diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c index d1aa421..d760371 100644 --- a/sound/arm/pxa2xx-ac97-lib.c +++ b/sound/arm/pxa2xx-ac97-lib.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c index 3a39626..afef72c 100644 --- a/sound/arm/pxa2xx-ac97.c +++ b/sound/arm/pxa2xx-ac97.c @@ -11,6 +11,7 @@ */ #include +#include #include #include diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index 837ff34..b4bfd97 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -11,6 +11,7 @@ */ #include +#include #include #include -- cgit v1.1 From 3946860409130038ef6e0e5c50f2203053eae2b7 Mon Sep 17 00:00:00 2001 From: Huang Shijie Date: Thu, 16 Feb 2012 14:17:32 +0800 Subject: mxs-dma : move the mxs dma.h to a more common place Move the header to a more common place. The mxs dma engine is not only used in mx23/mx28, but also used in mx50/mx6q. It will also be used in the future chips. Rename it to mxs-dma.h, and create a new folder include/linux/fsl/ to store the Freescale's header files. change mxs-dma driver, mxs-mmc driver, gpmi-nand driver, mxs-saif driver to the new header file. Acked-by: Shawn Guo Acked-by: Mark Brown Signed-off-by: Huang Shijie Acked-by: Vinod Koul Acked-by: Chris Ball Signed-off-by: David Woodhouse --- sound/soc/mxs/mxs-pcm.c | 2 +- sound/soc/mxs/mxs-pcm.h | 2 +- sound/soc/mxs/mxs-saif.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/mxs/mxs-pcm.c b/sound/soc/mxs/mxs-pcm.c index 105f42a..420715e 100644 --- a/sound/soc/mxs/mxs-pcm.c +++ b/sound/soc/mxs/mxs-pcm.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -35,7 +36,6 @@ #include #include -#include #include "mxs-pcm.h" static struct snd_pcm_hardware snd_mxs_hardware = { diff --git a/sound/soc/mxs/mxs-pcm.h b/sound/soc/mxs/mxs-pcm.h index f55ac4f..d2c8b12 100644 --- a/sound/soc/mxs/mxs-pcm.h +++ b/sound/soc/mxs/mxs-pcm.h @@ -19,7 +19,7 @@ #ifndef _MXS_PCM_H #define _MXS_PCM_H -#include +#include struct mxs_pcm_dma_params { int chan_irq; diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c index f204dba..ce59112 100644 --- a/sound/soc/mxs/mxs-saif.c +++ b/sound/soc/mxs/mxs-saif.c @@ -24,12 +24,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include #include -- cgit v1.1 From 9ffc93f203c18a70623f21950f1dd473c9ec48cd Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 28 Mar 2012 18:30:03 +0100 Subject: Remove all #inclusions of asm/system.h Remove all #inclusions of asm/system.h preparatory to splitting and killing it. Performed with the following command: perl -p -i -e 's!^#\s*include\s*.*\n!!' `grep -Irl '^#\s*include\s*' *` Signed-off-by: David Howells --- sound/oss/os.h | 1 - sound/oss/vidc.c | 1 - sound/oss/waveartist.c | 1 - sound/pci/asihpi/hpios.h | 1 - sound/pci/aw2/aw2-saa7146.c | 1 - 5 files changed, 5 deletions(-) (limited to 'sound') diff --git a/sound/oss/os.h b/sound/oss/os.h index a1a962d..75ad0cd 100644 --- a/sound/oss/os.h +++ b/sound/oss/os.h @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/sound/oss/vidc.c b/sound/oss/vidc.c index 12ba28e..92ca5bee 100644 --- a/sound/oss/vidc.c +++ b/sound/oss/vidc.c @@ -28,7 +28,6 @@ #include #include #include -#include #include "sound_config.h" #include "vidc.h" diff --git a/sound/oss/waveartist.c b/sound/oss/waveartist.c index 5246874..24c430f 100644 --- a/sound/oss/waveartist.c +++ b/sound/oss/waveartist.c @@ -42,7 +42,6 @@ #include #include -#include #include "sound_config.h" #include "waveartist.h" diff --git a/sound/pci/asihpi/hpios.h b/sound/pci/asihpi/hpios.h index c5cef11..d3fbd0d 100644 --- a/sound/pci/asihpi/hpios.h +++ b/sound/pci/asihpi/hpios.h @@ -30,7 +30,6 @@ HPI Operating System Specific macros for Linux Kernel driver #define HPI_BUILD_KERNEL_MODE #include -#include #include #include #include diff --git a/sound/pci/aw2/aw2-saa7146.c b/sound/pci/aw2/aw2-saa7146.c index 8afd8b5..4439636 100644 --- a/sound/pci/aw2/aw2-saa7146.c +++ b/sound/pci/aw2/aw2-saa7146.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include -- cgit v1.1 From 970e2486492aa1eb47a436a5a4c81e92558986a9 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Fri, 30 Mar 2012 13:37:16 -0700 Subject: Documentation: remove references to /etc/modprobe.conf Usage of /etc/modprobe.conf file was deprecated by module-init-tools and is no longer parsed by new kmod tool. References to this file are replaced in Documentation, comments and Kconfig according to the context. There are also some references to the old /etc/modules.conf from 2.4 kernels that are being removed. Signed-off-by: Lucas De Marchi Acked-by: Takashi Iwai Acked-by: Mauro Carvalho Chehab Signed-off-by: Randy Dunlap Signed-off-by: Linus Torvalds --- sound/core/seq/seq_dummy.c | 2 +- sound/drivers/Kconfig | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/core/seq/seq_dummy.c b/sound/core/seq/seq_dummy.c index bbe32d2..dbc5507 100644 --- a/sound/core/seq/seq_dummy.c +++ b/sound/core/seq/seq_dummy.c @@ -46,7 +46,7 @@ The number of ports to be created can be specified via the module parameter "ports". For example, to create four ports, add the - following option in /etc/modprobe.conf: + following option in a configuration file under /etc/modprobe.d/: option snd-seq-dummy ports=4 diff --git a/sound/drivers/Kconfig b/sound/drivers/Kconfig index c896116..fe5ae09 100644 --- a/sound/drivers/Kconfig +++ b/sound/drivers/Kconfig @@ -50,7 +50,8 @@ config SND_PCSP before the other sound driver of yours, making the pc-speaker a default sound device. Which is likely not what you want. To make this driver play nicely with other - sound driver, you can add this into your /etc/modprobe.conf: + sound driver, you can add this in a configuration file under + /etc/modprobe.d/ directory: options snd-pcsp index=2 You don't need this driver if you only want your pc-speaker to beep. -- cgit v1.1 From f0cdcf3ab6c62b3f774a2af15dfa01988e7a9b02 Mon Sep 17 00:00:00 2001 From: Zeng Zhaoming Date: Fri, 30 Mar 2012 00:13:02 +0800 Subject: ASoC: sgtl5000: Enable VAG when DAC/ADC up As manual described, VAG is an internal voltage reference of DAC/ADC, So enabled it before DAC/ADC up. One more thing should care about is VAG fully ramped down requires 400ms, wait it to avoid pop. Signed-off-by: Zeng Zhaoming Signed-off-by: Shawn Guo Signed-off-by: Mark Brown --- sound/soc/codecs/sgtl5000.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index d192626..8e92fb8 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -143,11 +143,11 @@ static int mic_bias_event(struct snd_soc_dapm_widget *w, } /* - * using codec assist to small pop, hp_powerup or lineout_powerup - * should stay setting until vag_powerup is fully ramped down, - * vag fully ramped down require 400ms. + * As manual described, ADC/DAC only works when VAG powerup, + * So enabled VAG before ADC/DAC up. + * In power down case, we need wait 400ms when vag fully ramped down. */ -static int small_pop_event(struct snd_soc_dapm_widget *w, +static int power_vag_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { switch (event) { @@ -156,7 +156,7 @@ static int small_pop_event(struct snd_soc_dapm_widget *w, SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP); break; - case SND_SOC_DAPM_PRE_PMD: + case SND_SOC_DAPM_POST_PMD: snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER, SGTL5000_VAG_POWERUP, 0); msleep(400); @@ -201,12 +201,8 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = { mic_bias_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), - SND_SOC_DAPM_PGA_E("HP", SGTL5000_CHIP_ANA_POWER, 4, 0, NULL, 0, - small_pop_event, - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD), - SND_SOC_DAPM_PGA_E("LO", SGTL5000_CHIP_ANA_POWER, 0, 0, NULL, 0, - small_pop_event, - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD), + SND_SOC_DAPM_PGA("HP", SGTL5000_CHIP_ANA_POWER, 4, 0, NULL, 0), + SND_SOC_DAPM_PGA("LO", SGTL5000_CHIP_ANA_POWER, 0, 0, NULL, 0), SND_SOC_DAPM_MUX("Capture Mux", SND_SOC_NOPM, 0, 0, &adc_mux), SND_SOC_DAPM_MUX("Headphone Mux", SND_SOC_NOPM, 0, 0, &dac_mux), @@ -221,8 +217,11 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = { 0, SGTL5000_CHIP_DIG_POWER, 1, 0), - SND_SOC_DAPM_ADC("ADC", "Capture", SGTL5000_CHIP_ANA_POWER, 1, 0), + SND_SOC_DAPM_SUPPLY("VAG_POWER", SGTL5000_CHIP_ANA_POWER, 7, 0, + power_vag_event, + SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), + SND_SOC_DAPM_ADC("ADC", "Capture", SGTL5000_CHIP_ANA_POWER, 1, 0), SND_SOC_DAPM_DAC("DAC", "Playback", SGTL5000_CHIP_ANA_POWER, 3, 0), }; @@ -231,9 +230,11 @@ static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = { {"Capture Mux", "LINE_IN", "LINE_IN"}, /* line_in --> adc_mux */ {"Capture Mux", "MIC_IN", "MIC_IN"}, /* mic_in --> adc_mux */ + {"ADC", NULL, "VAG_POWER"}, {"ADC", NULL, "Capture Mux"}, /* adc_mux --> adc */ {"AIFOUT", NULL, "ADC"}, /* adc --> i2s_out */ + {"DAC", NULL, "VAG_POWER"}, {"DAC", NULL, "AIFIN"}, /* i2s-->dac,skip audio mux */ {"Headphone Mux", "DAC", "DAC"}, /* dac --> hp_mux */ {"LO", NULL, "DAC"}, /* dac --> line_out */ -- cgit v1.1 From cd1506736f3a77429f619ede817a119a7ff5f7e5 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Fri, 30 Mar 2012 17:07:17 -0600 Subject: ASoC: tegra: ensure clocks are enabled when touching registers Debugfs files could be accessed any time, so explicitly enable clocks when reading registers to generate debugfs file content. Signed-off-by: Stephen Warren Signed-off-by: Mark Brown --- sound/soc/tegra/tegra_i2s.c | 4 ++++ sound/soc/tegra/tegra_spdif.c | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'sound') diff --git a/sound/soc/tegra/tegra_i2s.c b/sound/soc/tegra/tegra_i2s.c index 33509de..2d98c92 100644 --- a/sound/soc/tegra/tegra_i2s.c +++ b/sound/soc/tegra/tegra_i2s.c @@ -79,11 +79,15 @@ static int tegra_i2s_show(struct seq_file *s, void *unused) struct tegra_i2s *i2s = s->private; int i; + clk_enable(i2s->clk_i2s); + for (i = 0; i < ARRAY_SIZE(regs); i++) { u32 val = tegra_i2s_read(i2s, regs[i].offset); seq_printf(s, "%s = %08x\n", regs[i].name, val); } + clk_disable(i2s->clk_i2s); + return 0; } diff --git a/sound/soc/tegra/tegra_spdif.c b/sound/soc/tegra/tegra_spdif.c index 475428c..9ff2c60 100644 --- a/sound/soc/tegra/tegra_spdif.c +++ b/sound/soc/tegra/tegra_spdif.c @@ -79,11 +79,15 @@ static int tegra_spdif_show(struct seq_file *s, void *unused) struct tegra_spdif *spdif = s->private; int i; + clk_enable(spdif->clk_spdif_out); + for (i = 0; i < ARRAY_SIZE(regs); i++) { u32 val = tegra_spdif_read(spdif, regs[i].offset); seq_printf(s, "%s = %08x\n", regs[i].name, val); } + clk_disable(spdif->clk_spdif_out); + return 0; } -- cgit v1.1 From e95cee0e36c671db2804f2763b547a86930061ea Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Mon, 2 Apr 2012 10:24:08 +0200 Subject: ASoC: pxa: pxa2xx-i2s: add io.h for IOMEM macro * fixes sound/soc/pxa/pxa2xx-i2s.c:86:2: error: implicit declaration of function 'IOMEM' [-Werror=implicit-function-declaration] sound/soc/pxa/pxa2xx-i2s.c:86:2: error: initializer element is not constant after 23019a733bb83c8499f192fb428b7e6e81c95a34 removed IOMEM definition from arch/arm/mach-pxa/include/mach/hardware.h Signed-off-by: Martin Jansa Signed-off-by: Mark Brown --- sound/soc/pxa/pxa2xx-i2s.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound') diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c index 609abd5..d085837 100644 --- a/sound/soc/pxa/pxa2xx-i2s.c +++ b/sound/soc/pxa/pxa2xx-i2s.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include -- cgit v1.1 From 1f99e44cf059d2ed43c5a0724fa738b83800f725 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Wed, 4 Apr 2012 23:28:01 -0700 Subject: ASoC: ak4642: fixup: mute needs +1 step ak4642 out_tlv is +12.0dB to -115.0 dB, and it supports mute. But current settings didn't care +1 step for mute. This patch adds it Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown Cc: stable@vger.kernel.org --- sound/soc/codecs/ak4642.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c index f8e10ce..b3e24f2 100644 --- a/sound/soc/codecs/ak4642.c +++ b/sound/soc/codecs/ak4642.c @@ -140,7 +140,7 @@ * min : 0xFE : -115.0 dB * mute: 0xFF */ -static const DECLARE_TLV_DB_SCALE(out_tlv, -11500, 50, 1); +static const DECLARE_TLV_DB_SCALE(out_tlv, -11550, 50, 1); static const struct snd_kcontrol_new ak4642_snd_controls[] = { -- cgit v1.1 From 00792ac4e0d88e82fc489a5e1c4d4435125a301c Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Thu, 5 Apr 2012 09:45:51 -0300 Subject: ASoC: imx-audmux: Fix ssi port numbers in sysfs Doing a 'cat /sys/kernel/debug/audmux/ssi7' causes the following oops to be printed by the kernel: Uhandled fault: external abort on non-linefetch (0x008) at 0xf53b003c Internal error: : 8 [#1] PREEMPT Modules linked in: CPU: 0 Not tainted (3.3.0-00033-gecc726e-dirty #307) PC is at audmux_read_file+0x68/0x2f4 LR is at clk_enable+0x3c/0x48 pc : [] lr : [] psr: a0000013 sp : c3ad3f38 ip : c30a4000 fp : 00000003 r10: 00001000 r9 : be83fb00 r8 : c3ad3f80 r7 : c3ad3f80 r6 : 00000007 r5 : 00031010 r4 : c30a5000 r3 : f53b0000 r2 : 0000003c r1 : 380fa100 r0 : c068dda0 Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user Control: 0005317f Table: 83034000 DAC: 00000015 Process cat (pid: 1042, stack limit = 0xc3ad2270) Stack: (0xc3ad3f38 to 0xc3ad4000) 3f20: c3139180 00000000 3f40: c3bc6500 00001000 be83fb00 c3ad3f80 00001000 c3ad2000 00000000 c0095f3c 3f60: 00000003 c3bc6508 c3bc6500 be83fb00 00000000 00000000 00001000 c0096010 3f80: 00000000 00000000 b6fe2050 00000000 00001000 be83fb00 00000003 00000003 3fa0: c000eb88 c000e9e0 00001000 be83fb00 00000003 be83fb00 00001000 00000000 3fc0: 00001000 be83fb00 00000003 00000003 00000001 00000001 00000000 00000003 3fe0: 000bec8c be83fae0 0000f808 b6ea8d5c 60000010 00000003 7dff7ede 749bedf1 [] (audmux_read_file+0x68/0x2f4) from [] (vfs_read+0xb0/0x144) [] (vfs_read+0xb0/0x144) from [] (sys_read+0x40/0x70) [] (sys_read+0x40/0x70) from [] (ret_fast_syscall+0x0/0x2c) Code: e1a02186 e2822004 e3500000 e7935186 (e7937002) ---[ end trace 4d046e31309023de ]--- Fix the ssi port numbers in sysfs to fix this problem. Reported-by: Joan Carles Signed-off-by: Fabio Estevam Signed-off-by: Mark Brown --- sound/soc/imx/imx-audmux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/imx/imx-audmux.c b/sound/soc/imx/imx-audmux.c index 601df80..912a342 100644 --- a/sound/soc/imx/imx-audmux.c +++ b/sound/soc/imx/imx-audmux.c @@ -158,7 +158,7 @@ static void __init audmux_debugfs_init(void) return; } - for (i = 1; i < 8; i++) { + for (i = 0; i < MX31_AUDMUX_PORT6_SSI_PINS_6 + 1; i++) { snprintf(buf, sizeof(buf), "ssi%d", i); if (!debugfs_create_file(buf, 0444, audmux_debugfs_root, (void *)i, &audmux_debugfs_fops)) -- cgit v1.1 From 66bb2a7f835a28a9405f3f6571fbf34156e6bc1e Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Thu, 5 Apr 2012 10:57:51 -0300 Subject: ASoC: imx-audmux: Check for NULL pointer Check for NULL pointer before accessing it. Signed-off-by: Fabio Estevam Signed-off-by: Mark Brown --- sound/soc/imx/imx-audmux.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sound') diff --git a/sound/soc/imx/imx-audmux.c b/sound/soc/imx/imx-audmux.c index 912a342..0fe66c3 100644 --- a/sound/soc/imx/imx-audmux.c +++ b/sound/soc/imx/imx-audmux.c @@ -79,6 +79,9 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf, if (!buf) return -ENOMEM; + if (!audmux_base) + return -ENOSYS; + if (audmux_clk) clk_prepare_enable(audmux_clk); -- cgit v1.1 From 3fec6b6d5a53d37194735268b9e220f75ca37f19 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Thu, 5 Apr 2012 12:28:01 -0600 Subject: ASoC: set idle_bias_off=1 for all platform DAPM contexts The ASoC core currently defaults to using STANDBY rather than OFF for idle ASoC platform devices, which causes a permanent pm_runtime_get() on them. This keeps the device active unnecessarily. This can be especially problematic when the ASoC platform device and DAI device are the same device. The distinction between OFF and STANDBY is likely not relevant for ASoC platform drivers, since they aren't analog devices. So, solve this issue by hard-coding idle_bias_off = 1 for all ASoC platform devices. If this turns out to be a problem, this value could be sourced from the snd_soc_platform_driver, similarly to soc_probe_codec(). Note: Prior to this change, this caused a large (10) runtime_active count for the Tegra I2S controller even when not in use, and a leak in that value as streams were started and stopped. This change probably hides a bug. Signed-off-by: Stephen Warren Signed-off-by: Mark Brown --- sound/soc/soc-core.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound') diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index a4deebc..8d2ebf5 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1087,6 +1087,8 @@ static int soc_probe_platform(struct snd_soc_card *card, snd_soc_dapm_new_controls(&platform->dapm, driver->dapm_widgets, driver->num_dapm_widgets); + platform->dapm.idle_bias_off = 1; + if (driver->probe) { ret = driver->probe(platform); if (ret < 0) { -- cgit v1.1 From 8abe05c6eb358967f16bce8a02c88d57c82cfbd6 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Thu, 5 Apr 2012 23:11:16 -0600 Subject: ASoC: tegra: fix i2s compilation when !CONFIG_DEBUG_FS Commit d4a2eca "ASoC: Tegra I2S: Remove dependency on pdev->id" changed the prototype of tegra_i2s_debug_add, but didn't update the dummy inline used when !CONFIG_DEBUG_FS. Fix that. Signed-off-by: Stephen Warren Signed-off-by: Mark Brown Cc: # 3.3 --- sound/soc/tegra/tegra_i2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/tegra/tegra_i2s.c b/sound/soc/tegra/tegra_i2s.c index 2d98c92..e533499 100644 --- a/sound/soc/tegra/tegra_i2s.c +++ b/sound/soc/tegra/tegra_i2s.c @@ -116,7 +116,7 @@ static void tegra_i2s_debug_remove(struct tegra_i2s *i2s) debugfs_remove(i2s->debug); } #else -static inline void tegra_i2s_debug_add(struct tegra_i2s *i2s, int id) +static inline void tegra_i2s_debug_add(struct tegra_i2s *i2s) { } -- cgit v1.1