Commit 336cfbb0 authored by Vinod Koul's avatar Vinod Koul Committed by Mark Brown

ASoC: Intel: mrfld- add ACPI module

Add the last ACPI module support which also uses core module like the PCI
part
Signed-off-by: default avatarSubhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9b105fe4
...@@ -20,6 +20,11 @@ config SND_SST_IPC_PCI ...@@ -20,6 +20,11 @@ config SND_SST_IPC_PCI
tristate tristate
select SND_SST_IPC select SND_SST_IPC
config SND_SST_IPC_ACPI
tristate
select SND_SST_IPC
depends on ACPI
config SND_SOC_INTEL_SST config SND_SOC_INTEL_SST
tristate "ASoC support for Intel(R) Smart Sound Technology" tristate "ASoC support for Intel(R) Smart Sound Technology"
select SND_SOC_INTEL_SST_ACPI if ACPI select SND_SOC_INTEL_SST_ACPI if ACPI
......
snd-intel-sst-core-objs := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o snd-intel-sst-core-objs := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
snd-intel-sst-pci-objs += sst_pci.o snd-intel-sst-pci-objs += sst_pci.o
snd-intel-sst-acpi-objs += sst_acpi.o
obj-$(CONFIG_SND_SST_IPC) += snd-intel-sst-core.o obj-$(CONFIG_SND_SST_IPC) += snd-intel-sst-core.o
obj-$(CONFIG_SND_SST_IPC_PCI) += snd-intel-sst-pci.o obj-$(CONFIG_SND_SST_IPC_PCI) += snd-intel-sst-pci.o
obj-$(CONFIG_SND_SST_IPC_ACPI) += snd-intel-sst-acpi.o
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/pm_qos.h> #include <linux/pm_qos.h>
#include <linux/async.h> #include <linux/async.h>
#include <linux/acpi.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/soc.h> #include <sound/soc.h>
#include <asm/platform_sst_audio.h> #include <asm/platform_sst_audio.h>
...@@ -181,6 +182,7 @@ int sst_driver_ops(struct intel_sst_drv *sst) ...@@ -181,6 +182,7 @@ int sst_driver_ops(struct intel_sst_drv *sst)
switch (sst->dev_id) { switch (sst->dev_id) {
case SST_MRFLD_PCI_ID: case SST_MRFLD_PCI_ID:
case SST_BYT_ACPI_ID:
sst->tstamp = SST_TIME_STAMP_MRFLD; sst->tstamp = SST_TIME_STAMP_MRFLD;
sst->ops = &mrfld_ops; sst->ops = &mrfld_ops;
return 0; return 0;
...@@ -323,7 +325,7 @@ EXPORT_SYMBOL_GPL(sst_context_init); ...@@ -323,7 +325,7 @@ EXPORT_SYMBOL_GPL(sst_context_init);
void sst_context_cleanup(struct intel_sst_drv *ctx) void sst_context_cleanup(struct intel_sst_drv *ctx)
{ {
pm_runtime_get_noresume(ctx->dev); pm_runtime_get_noresume(ctx->dev);
pm_runtime_forbid(ctx->dev); pm_runtime_disable(ctx->dev);
sst_unregister(ctx->dev); sst_unregister(ctx->dev);
sst_set_fw_state_locked(ctx, SST_SHUTDOWN); sst_set_fw_state_locked(ctx, SST_SHUTDOWN);
flush_scheduled_work(); flush_scheduled_work();
...@@ -371,8 +373,19 @@ void sst_configure_runtime_pm(struct intel_sst_drv *ctx) ...@@ -371,8 +373,19 @@ void sst_configure_runtime_pm(struct intel_sst_drv *ctx)
{ {
pm_runtime_set_autosuspend_delay(ctx->dev, SST_SUSPEND_DELAY); pm_runtime_set_autosuspend_delay(ctx->dev, SST_SUSPEND_DELAY);
pm_runtime_use_autosuspend(ctx->dev); pm_runtime_use_autosuspend(ctx->dev);
pm_runtime_allow(ctx->dev); /*
pm_runtime_put_noidle(ctx->dev); * For acpi devices, the actual physical device state is
* initially active. So change the state to active before
* enabling the pm
*/
if (acpi_disabled) {
pm_runtime_set_active(ctx->dev);
pm_runtime_enable(ctx->dev);
} else {
pm_runtime_allow(ctx->dev);
pm_runtime_put_noidle(ctx->dev);
}
sst_save_shim64(ctx, ctx->shim, ctx->shim_regs64);
} }
EXPORT_SYMBOL_GPL(sst_configure_runtime_pm); EXPORT_SYMBOL_GPL(sst_configure_runtime_pm);
...@@ -395,6 +408,9 @@ static int intel_sst_runtime_suspend(struct device *dev) ...@@ -395,6 +408,9 @@ static int intel_sst_runtime_suspend(struct device *dev)
synchronize_irq(ctx->irq_num); synchronize_irq(ctx->irq_num);
flush_workqueue(ctx->post_msg_wq); flush_workqueue(ctx->post_msg_wq);
/* save the shim registers because PMC doesn't save state */
sst_save_shim64(ctx, ctx->shim, ctx->shim_regs64);
return ret; return ret;
} }
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
/* driver names */ /* driver names */
#define SST_DRV_NAME "intel_sst_driver" #define SST_DRV_NAME "intel_sst_driver"
#define SST_MRFLD_PCI_ID 0x119A #define SST_MRFLD_PCI_ID 0x119A
#define SST_BYT_ACPI_ID 0x80860F28
#define SST_SUSPEND_DELAY 2000 #define SST_SUSPEND_DELAY 2000
#define FW_CONTEXT_MEM (64*1024) #define FW_CONTEXT_MEM (64*1024)
......
This diff is collapsed.
...@@ -117,6 +117,7 @@ unsigned long long read_shim_data(struct intel_sst_drv *sst, int addr) ...@@ -117,6 +117,7 @@ unsigned long long read_shim_data(struct intel_sst_drv *sst, int addr)
switch (sst->dev_id) { switch (sst->dev_id) {
case SST_MRFLD_PCI_ID: case SST_MRFLD_PCI_ID:
case SST_BYT_ACPI_ID:
val = sst_shim_read64(sst->shim, addr); val = sst_shim_read64(sst->shim, addr);
break; break;
} }
...@@ -128,6 +129,7 @@ void write_shim_data(struct intel_sst_drv *sst, int addr, ...@@ -128,6 +129,7 @@ void write_shim_data(struct intel_sst_drv *sst, int addr,
{ {
switch (sst->dev_id) { switch (sst->dev_id) {
case SST_MRFLD_PCI_ID: case SST_MRFLD_PCI_ID:
case SST_BYT_ACPI_ID:
sst_shim_write64(sst->shim, addr, (u64) data); sst_shim_write64(sst->shim, addr, (u64) data);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment