diff options
| author | mattis fjallstrom <mattis@acm.org> | 2015-07-06 19:44:02 -0700 |
|---|---|---|
| committer | mattis fjallstrom <mattis@acm.org> | 2015-07-06 19:44:02 -0700 |
| commit | 43d082d5be75eeb20bdeeec8df61cda12244435e (patch) | |
| tree | 4493ca94cf6d291e68dd6d92c11f0c56b90d0409 | |
| parent | cdfe941141942b368f24d98b9ee5733d4cab21ee (diff) | |
| download | olio-linux-3.10-43d082d5be75eeb20bdeeec8df61cda12244435e.tar.xz olio-linux-3.10-43d082d5be75eeb20bdeeec8df61cda12244435e.zip | |
First stab at making the microphone / sound card sleep during suspend.
Change-Id: I3a388bd912410b55ac5e860654e3e16965caccaa
| -rw-r--r-- | arch/arm/boot/dts/omap3_h1.dts | 7 | ||||
| -rw-r--r-- | arch/arm/configs/omap3_h1_defconfig | 18 | ||||
| -rw-r--r-- | sound/soc/omap/omap3h1.c | 44 |
3 files changed, 53 insertions, 16 deletions
diff --git a/arch/arm/boot/dts/omap3_h1.dts b/arch/arm/boot/dts/omap3_h1.dts index 45cc88876a9..29b1abcd625 100644 --- a/arch/arm/boot/dts/omap3_h1.dts +++ b/arch/arm/boot/dts/omap3_h1.dts @@ -210,8 +210,11 @@ 0x16e 0x4100 /* RX, input, off wake up */ 0x170 0x000 /* TX, output */ + /* GPIO146, aka UART2TX, aka Microphone enable */ + 0x148 0x204 /* OUTPUT | GPIO | OFF_ENABLE | OFF_PULL_LOW */ + /* BT_HOST_WAKE */ - /*0x9f4 0x4104 */ /* JTAG_EMU0 , (OMAP_MUX_MODE4 | OMAP_PIN_INPUT | OMAP_WAKEUPENABLE) */ + /* 0x9f4 0x4104 */ /* JTAG_EMU0 , (OMAP_MUX_MODE4 | OMAP_PIN_INPUT | OMAP_WAKEUPENABLE) */ /* Accelerometer interrupt */ /* I've tried configuring this both in the wkup pinmux (below) and here, @@ -228,7 +231,7 @@ 0x086 0x004 /* DRV2605 vibrator, output, GPIO */ /* 0x938 0x104 */ /* Battery state, input, GPIO */ >; - } + }; i2c1_pins: pinmux_i2c1_pins { pinctrl-single,pins = < diff --git a/arch/arm/configs/omap3_h1_defconfig b/arch/arm/configs/omap3_h1_defconfig index 2d6538486ca..eed0955c029 100644 --- a/arch/arm/configs/omap3_h1_defconfig +++ b/arch/arm/configs/omap3_h1_defconfig @@ -937,8 +937,8 @@ CONFIG_FIB_RULES=y # CONFIG_WIRELESS is not set # CONFIG_WIMAX is not set CONFIG_RFKILL=y -# CONFIG_RFKILL_PM is not set -CONFIG_RFKILL_INPUT=y +CONFIG_RFKILL_PM=y +# CONFIG_RFKILL_INPUT is not set # CONFIG_RFKILL_REGULATOR is not set CONFIG_RFKILL_GPIO=y # CONFIG_RFKILL_WL18XX is not set @@ -1842,22 +1842,18 @@ CONFIG_SND_JACK=y # CONFIG_SND_DRIVERS is not set CONFIG_SND_ARM=y CONFIG_SND_SPI=y -CONFIG_SND_USB=y -# CONFIG_SND_USB_AUDIO is not set -# CONFIG_SND_USB_UA101 is not set -# CONFIG_SND_USB_CAIAQ is not set -# CONFIG_SND_USB_6FIRE is not set +# CONFIG_SND_USB is not set CONFIG_SND_SOC=y CONFIG_SND_SOC_DMAENGINE_PCM=y # CONFIG_SND_ATMEL_SOC is not set # CONFIG_SND_DESIGNWARE_I2S is not set -CONFIG_SND_OMAP_SOC=y +CONFIG_SND_OMAP_SOC=m # CONFIG_SND_OMAP_SOC_C55 is not set -CONFIG_SND_OMAP_SOC_MCBSP=y -CONFIG_SND_OMAP_SOC_OMAP3_H1=y +CONFIG_SND_OMAP_SOC_MCBSP=m +CONFIG_SND_OMAP_SOC_OMAP3_H1=m CONFIG_SND_SOC_I2C_AND_SPI=y # CONFIG_SND_SOC_ALL_CODECS is not set -CONFIG_SND_SOC_DMIC=y +CONFIG_SND_SOC_DMIC=m # CONFIG_SND_SIMPLE_CARD is not set # CONFIG_SOUND_PRIME is not set diff --git a/sound/soc/omap/omap3h1.c b/sound/soc/omap/omap3h1.c index 2cd624744ea..69d4b1abc06 100644 --- a/sound/soc/omap/omap3h1.c +++ b/sound/soc/omap/omap3h1.c @@ -47,7 +47,8 @@ static int omap3h1_hw_params(struct snd_pcm_substream *substream, //freq = 256 * params_rate(params); // We are triggering from the 96 MHz FSCK - pr_info("ASoc OMAP3H1: setting system clock to: %d", freq); + + // pr_info("ASoc OMAP3H1: setting system clock to: %d", freq); ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_SYSCLK_CLKS_FCLK, 96000000, SND_SOC_CLOCK_OUT); if (ret < 0) { @@ -55,8 +56,9 @@ static int omap3h1_hw_params(struct snd_pcm_substream *substream, return ret; } - // Set the divider so that our clock rate is ~3KHz, this is about 48KHz sampling frequency on the mic - // (32-bit/channel, 2 channels, 48 Khz sampling) + // Set the divider so that our clock rate is ~3KHz, this is about + // 48KHz sampling frequency on the mic (32-bit/channel, 2 channels, 48 + // Khz sampling) ret = snd_soc_dai_set_clkdiv(cpu_dai, OMAP_MCBSP_CLKGDV, 32); if (ret < 0) { pr_err("ASoc OMAP3H1: can't set SRG clock divider\n"); @@ -149,6 +151,41 @@ static int omap3h1_card_remove(struct platform_device *pdev) return 0; } +/** + * omap3h1_sound_suspend - suspend microphone + * + */ + +static int omap3h1_sound_suspend(struct device *dev) { + printk ("OLIO %s:%s Suspending\n", __FILE__, __FUNCTION__); + + snd_soc_suspend(dev); + + return 0; +} + + +/** + * omap3h1_sound_resume - resume microphone + * + */ + +static int omap3h1_sound_resume(struct device *dev) { + printk ("OLIO %s:%s Resuming\n", __FILE__, __FUNCTION__); + + snd_soc_resume (dev); + + return 0; +} + + +/* ---------------------------------------------------------------------- */ + +static const struct dev_pm_ops omap3h1_sound_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(omap3h1_sound_suspend, omap3h1_sound_resume) +}; + + static const struct of_device_id omap_soc_h1_of_match[] = { {.compatible = "olio,omap-soc-omap3h1", }, { }, @@ -159,6 +196,7 @@ static struct platform_driver omap3h1_driver = { .driver = { .name = "omap-soc-omap3h1", .of_match_table = of_match_ptr(omap_soc_h1_of_match), + .pm = &omap3h1_sound_pm_ops, }, .probe = omap3h1_card_probe, .remove = omap3h1_card_remove, |