diff options
author | Dara Ramesh <dramesh@nvidia.com> | 2011-03-29 09:09:09 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-04-26 15:54:38 -0700 |
commit | a4c489fdb2a2d68bad0b2de74673bc9ff4a9a6c4 (patch) | |
tree | bac00a9accf8910c80f0008b35f2072e7dbab6ff /sound | |
parent | 20776fc64229014ea8f2563eaf50f5b5ec2f1745 (diff) |
arm: tegra: hda: support for suspend resume
adding support for suspend resume in hda driver
Bug 808190
Bug 808132
Original-Change-Id: I6f142312cffb990ce5dd724b93ecacfc9543e8ae
Reviewed-on: http://git-master/r/24617
Tested-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Change-Id: Ibefd60e840c1bc7e3f646143434f071401f0b15d
Diffstat (limited to 'sound')
-rw-r--r-- | sound/arm/tegra/hda_tegra.c | 49 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 22 | ||||
-rw-r--r-- | sound/pci/hda/lib_hda_intel.c | 22 |
3 files changed, 56 insertions, 37 deletions
diff --git a/sound/arm/tegra/hda_tegra.c b/sound/arm/tegra/hda_tegra.c index 8d27fb05d2bd..af1c26c25fca 100644 --- a/sound/arm/tegra/hda_tegra.c +++ b/sound/arm/tegra/hda_tegra.c @@ -448,6 +448,27 @@ azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec, return 0; } +#ifdef CONFIG_SND_HDA_POWER_SAVE +/* power-up/down the controller */ +void azx_power_notify(struct hda_bus *bus) +{ + struct azx *chip = bus->private_data; + struct hda_codec *c; + int power_on = 0; + + list_for_each_entry(c, &bus->codec_list, list) { + if (c->power_on) { + power_on = 1; + break; + } + } + if (power_on) + azx_init_chip(chip, 1); + else if (chip->running && power_save_controller && + !bus->power_keep_link_on) + azx_stop_chip(chip); +} +#endif /* CONFIG_SND_HDA_POWER_SAVE */ #ifdef CONFIG_PM @@ -456,22 +477,11 @@ azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec, */ static int nv_tegra_hda_controller_suspend(struct platform_device *pdev) { -#if 0 - struct snd_card *card = dev_get_drvdata(&pdev->dev); - struct azx *chip = card->private_data; - clk_disable(chip->clk); -#endif - return 0; -} + clk_disable(clk_hda2hdmicodec); + clk_disable(clk_hda2codec); + clk_disable(clk_hda); -static int nv_tegra_hda_controller_resume(struct platform_device *pdev) -{ -#if 0 - struct snd_card *card = dev_get_drvdata(&pdev->dev); - struct azx *chip = card->private_data; - clk_enable(chip->clk); -#endif - return 0; + return 0; } static int nv_tegra_azx_suspend(struct platform_device *pdev, @@ -496,6 +506,15 @@ static int nv_tegra_azx_suspend(struct platform_device *pdev, return nv_tegra_hda_controller_suspend(pdev); } +static int nv_tegra_hda_controller_resume(struct platform_device *pdev) +{ + clk_enable(clk_hda); + clk_enable(clk_hda2codec); + clk_enable(clk_hda2hdmicodec); + + return 0; +} + static int nv_tegra_azx_resume(struct platform_device *pdev) { struct snd_card *card = dev_get_drvdata(&pdev->dev); diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 6b5eb7642007..584ce9b2aaa0 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1340,6 +1340,28 @@ out_free: return err; } +#ifdef CONFIG_SND_HDA_POWER_SAVE +/* power-up/down the controller */ +void azx_power_notify(struct hda_bus *bus) +{ + struct azx *chip = bus->private_data; + struct hda_codec *c; + int power_on = 0; + + list_for_each_entry(c, &bus->codec_list, list) { + if (c->power_on) { + power_on = 1; + break; + } + } + if (power_on) + azx_init_chip(chip, 1); + else if (chip->running && power_save_controller && + !bus->power_keep_link_on) + azx_stop_chip(chip); +} +#endif /* CONFIG_SND_HDA_POWER_SAVE */ + static void __devexit azx_remove(struct pci_dev *pci) { snd_card_free(pci_get_drvdata(pci)); diff --git a/sound/pci/hda/lib_hda_intel.c b/sound/pci/hda/lib_hda_intel.c index 293480b0308d..1bd917f26620 100644 --- a/sound/pci/hda/lib_hda_intel.c +++ b/sound/pci/hda/lib_hda_intel.c @@ -1333,28 +1333,6 @@ void azx_stop_chip(struct azx *chip) chip->initialized = 0; } -#ifdef CONFIG_SND_HDA_POWER_SAVE -/* power-up/down the controller */ -void azx_power_notify(struct hda_bus *bus) -{ - struct azx *chip = bus->private_data; - struct hda_codec *c; - int power_on = 0; - - list_for_each_entry(c, &bus->codec_list, list) { - if (c->power_on) { - power_on = 1; - break; - } - } - if (power_on) - azx_init_chip(chip, 1); - else if (chip->running && power_save_controller && - !bus->power_keep_link_on) - azx_stop_chip(chip); -} -#endif /* CONFIG_SND_HDA_POWER_SAVE */ - #ifdef CONFIG_PM /* * power management |