diff options
author | Ravindra Lokhande <rlokhande@nvidia.com> | 2011-07-22 21:46:13 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-08-08 11:08:57 -0700 |
commit | d5919c8c936620c36d6e2e1be046f253f889d05c (patch) | |
tree | 749ac7c72d4b5f9415fb1e94faeaaf1e412a753e | |
parent | 974606cd4604c0850bcdcec9691f761f9924ebb7 (diff) |
arm: tegra: fix ldk audio regression
arm: tegra: fixed system hang in SPDIF recording mode
arm: tegra: remove white space.
arm: tegra: added clock_disable function for SPDIF record.
arm: tegra: remove white space
Change-Id: I97fa43ad9a0aed5541d8eb1e16743da7675daf13
Reviewed-on: http://git-master/r/45566
Reviewed-by: Songhee Baek <sbaek@nvidia.com>
Tested-by: Songhee Baek <sbaek@nvidia.com>
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: Scott Peterson <speterson@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/audio_manager.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/audio_manager.c b/arch/arm/mach-tegra/audio_manager.c index 93bb6239f0ad..9072d7659aa4 100644 --- a/arch/arm/mach-tegra/audio_manager.c +++ b/arch/arm/mach-tegra/audio_manager.c @@ -464,7 +464,7 @@ int free_dam_connection(aud_dev_info *devinfo) struct am_dev_fns *am_fn = &init_am_dev_fns[devinfo->dev_type]; am_fn->aud_dev_free_dma_requestor(devinfo->dev_id, fifo_mode); - i2s_clock_disable(devinfo->dev_id, fifo_mode); + am_fn->aud_dev_clock_disable(devinfo->dev_id, fifo_mode); } AM_DEBUG_PRINT("%s--\n", __func__); return 0; @@ -549,8 +549,9 @@ int am_get_dma_requestor(aud_dev_info* devinfo) fifo_mode, (void *)&ch->inacif); } } else { - if (devinfo->dev_type == AUDIO_I2S_DEVICE) - i2s_clock_enable(dev_id, fifo_mode); + struct am_dev_fns *am_fn = &init_am_dev_fns[devinfo->dev_type]; + + am_fn->aud_dev_clock_enable(devinfo->dev_id, fifo_mode); ch->dmach[fifo_mode] = default_record_connection(devinfo); } @@ -976,10 +977,27 @@ int tegra_das_power_mode(bool is_normal) } EXPORT_SYMBOL_GPL(tegra_das_power_mode); +inline static int get_bit_size(int nbits) +{ + switch (nbits) { + case 24: + return AUDIO_BIT_SIZE_24; + case 32: + return AUDIO_BIT_SIZE_32; + case 8: + return AUDIO_BIT_SIZE_8; + default: + return AUDIO_BIT_SIZE_16; + } +} + int tegra_das_open(void) { int err = 0; + struct audio_dev_property dev_prop; + struct am_ch_info *ch = NULL; + aud_manager = kzalloc(sizeof(struct audio_manager_context), GFP_KERNEL); if (!aud_manager) return -ENOMEM; @@ -1009,6 +1027,14 @@ int tegra_das_open(void) aud_manager->bt_port_idx = tegra_das_get_device_i2s_port( tegra_audio_codec_type_bluetooth); + memset(&dev_prop, 0 , sizeof(struct audio_dev_property)); + tegra_das_get_device_property(tegra_audio_codec_type_hifi, + &dev_prop); + ch = &aud_manager->i2s_ch[aud_manager->hifi_port_idx]; + ch->sfmt.bitsize = get_bit_size(dev_prop.bits_per_sample); + ch->sfmt.channels = dev_prop.num_channels - 1; + ch->sfmt.samplerate = dev_prop.rate; + return err; fail_clock: |