From df0598c4ed71f32b1ed55dbca99ab609508fdf91 Mon Sep 17 00:00:00 2001 From: Chris Fries Date: Tue, 11 Jan 2011 17:10:01 -0600 Subject: [PATCH] [ARM] mfd: cpcap-audio: Deadlock in audio capture after LP0 LP0 was clearing out the DAC/DAP configuration registers. Currently the CPCAP audio driver owns their configuration at runtime, so fix the port config during system resume. Change-Id: Ib7f26085d55a9184649b79ec8f647830d135489b Signed-off-by: Iliyan Malchev --- drivers/mfd/tegra-cpcap-audio.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/tegra-cpcap-audio.c b/drivers/mfd/tegra-cpcap-audio.c index a05793ec68c5..5838a7da7766 100644 --- a/drivers/mfd/tegra-cpcap-audio.c +++ b/drivers/mfd/tegra-cpcap-audio.c @@ -44,6 +44,7 @@ static struct cpcap_audio_stream current_input = { static int codec_rate; static int stdac_rate; static bool dock_connected; +static bool bluetooth_byp; static int cpcap_audio_ctl_open(struct inode *inode, struct file *file) { @@ -426,8 +427,9 @@ static long cpcap_audio_ctl_ioctl(struct file *file, unsigned int cmd, tegra_setup_audio_in_rate(rate); break; case CPCAP_AUDIO_SET_BLUETOOTH_BYPASS: + bluetooth_byp = (bool)arg; if (pdata->bluetooth_bypass) - pdata->bluetooth_bypass((bool)arg); + pdata->bluetooth_bypass(bluetooth_byp); else pr_err("%s: no bluetooth bypass handler\n", __func__); break; @@ -524,12 +526,35 @@ fail1: return rc; } +#ifdef CONFIG_PM +static int tegra_audio_suspend(struct platform_device *pdev, pm_message_t mesg) +{ + dev_dbg(&pdev->dev, "%s\n", __func__); + return 0; +} + +static int tegra_audio_resume(struct platform_device *pdev) +{ + dev_dbg(&pdev->dev, "%s\n", __func__); + /* initialize DAC/DAP connections */ + if (pdata->bluetooth_bypass) + pdata->bluetooth_bypass(bluetooth_byp); + else + pr_warn("No function for setting up DAC/DAP."); + return 0; +} +#endif + static struct platform_driver cpcap_audio_driver = { .probe = cpcap_audio_probe, .driver = { .name = "cpcap_audio", .owner = THIS_MODULE, }, +#ifdef CONFIG_PM + .suspend = tegra_audio_suspend, + .resume = tegra_audio_resume, +#endif }; static int __init tegra_cpcap_audio_init(void) -- 2.34.1