* [PATCH 0/9] ASoC: Intel: more modulartion of init and add ACPI
@ 2014-10-30 10:51 Vinod Koul
2014-10-30 10:51 ` [PATCH 1/9] ASoC: Intel: mfld-pcm: Fix to Store device context in sst_data Vinod Koul
` (8 more replies)
0 siblings, 9 replies; 25+ messages in thread
From: Vinod Koul @ 2014-10-30 10:51 UTC (permalink / raw)
To: alsa-devel; +Cc: Vinod Koul, broonie, subhransu.s.prusty, lgirdwood
The first patch is a fix of mfld-pcm driver
Rest of the series is devoted to ACPI support with 7 patch moving the probe
routine and sperating into common and PCI and later moving PCI code to
sst-pci file so that it can be shared with ACPI
Lats patch adds support for ACPI with BYT driver support.
This series is dependent upon the PM and compressed series sent earlier
today
Subhransu S. Prusty (9):
ASoC: Intel: mfld-pcm: Fix to Store device context in sst_data
ASoC: Intel: move the driver wq init to a routine
ASoC: Intel: move the lock and wq initialization to routine
ASoC: Intel: move the driver context allocation to routine
ASoC: Intel: modularize driver probe and remove
ASoC: Intel: more probe modularization for sst
ASoC: Intel: move PCI probe to a seprate file
ASoC: Intel: add shim save context and restore routines
ASoC: Intel: Add ACPI driver for SST
sound/soc/intel/Kconfig | 7 +
sound/soc/intel/sst-mfld-platform-pcm.c | 1 +
sound/soc/intel/sst/Makefile | 8 +
sound/soc/intel/sst/sst.c | 391 ++++++++++++-------------------
sound/soc/intel/sst/sst.h | 7 +
sound/soc/intel/sst/sst_acpi.c | 387 ++++++++++++++++++++++++++++++
sound/soc/intel/sst/sst_pci.c | 225 ++++++++++++++++++
sound/soc/intel/sst/sst_pvt.c | 2 +
8 files changed, 793 insertions(+), 235 deletions(-)
create mode 100644 sound/soc/intel/sst/sst_acpi.c
create mode 100644 sound/soc/intel/sst/sst_pci.c
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 1/9] ASoC: Intel: mfld-pcm: Fix to Store device context in sst_data
2014-10-30 10:51 [PATCH 0/9] ASoC: Intel: more modulartion of init and add ACPI Vinod Koul
@ 2014-10-30 10:51 ` Vinod Koul
2014-10-30 10:51 ` [PATCH 2/9] ASoC: Intel: move the driver wq init to a routine Vinod Koul
` (7 subsequent siblings)
8 siblings, 0 replies; 25+ messages in thread
From: Vinod Koul @ 2014-10-30 10:51 UTC (permalink / raw)
To: alsa-devel; +Cc: Vinod Koul, broonie, subhransu.s.prusty, lgirdwood
From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Some debug prints use dev context in sst_data. Store the device context for
the same.
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/intel/sst-mfld-platform-pcm.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/sound/soc/intel/sst-mfld-platform-pcm.c b/sound/soc/intel/sst-mfld-platform-pcm.c
index e7cf18d..6032f18 100644
--- a/sound/soc/intel/sst-mfld-platform-pcm.c
+++ b/sound/soc/intel/sst-mfld-platform-pcm.c
@@ -706,6 +706,7 @@ static int sst_platform_probe(struct platform_device *pdev)
pdata->pdev_strm_map = dpcm_strm_map;
pdata->strm_map_size = ARRAY_SIZE(dpcm_strm_map);
drv->pdata = pdata;
+ drv->pdev = pdev;
mutex_init(&drv->lock);
dev_set_drvdata(&pdev->dev, drv);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 2/9] ASoC: Intel: move the driver wq init to a routine
2014-10-30 10:51 [PATCH 0/9] ASoC: Intel: more modulartion of init and add ACPI Vinod Koul
2014-10-30 10:51 ` [PATCH 1/9] ASoC: Intel: mfld-pcm: Fix to Store device context in sst_data Vinod Koul
@ 2014-10-30 10:51 ` Vinod Koul
2014-10-30 10:51 ` [PATCH 3/9] ASoC: Intel: move the lock and wq initialization to routine Vinod Koul
` (6 subsequent siblings)
8 siblings, 0 replies; 25+ messages in thread
From: Vinod Koul @ 2014-10-30 10:51 UTC (permalink / raw)
To: alsa-devel; +Cc: Vinod Koul, broonie, subhransu.s.prusty, lgirdwood
From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
This will be used by APCI code as well, so moving to common routine helps
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/intel/sst/sst.c | 34 +++++++++++++++++++---------------
1 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/sound/soc/intel/sst/sst.c b/sound/soc/intel/sst/sst.c
index ff0ff9f..253b917 100644
--- a/sound/soc/intel/sst/sst.c
+++ b/sound/soc/intel/sst/sst.c
@@ -206,6 +206,22 @@ void sst_process_pending_msg(struct work_struct *work)
ctx->ops->post_message(ctx, NULL, false);
}
+static int sst_workqueue_init(struct intel_sst_drv *ctx)
+{
+ INIT_LIST_HEAD(&ctx->memcpy_list);
+ INIT_LIST_HEAD(&ctx->rx_list);
+ INIT_LIST_HEAD(&ctx->ipc_dispatch_list);
+ INIT_LIST_HEAD(&ctx->block_list);
+ INIT_WORK(&ctx->ipc_post_msg_wq, sst_process_pending_msg);
+ init_waitqueue_head(&ctx->wait_queue);
+
+ ctx->post_msg_wq =
+ create_singlethread_workqueue("sst_post_msg_wq");
+ if (!ctx->post_msg_wq)
+ return -EBUSY;
+ return 0;
+}
+
/*
* intel_sst_probe - PCI probe function
*
@@ -254,24 +270,13 @@ static int intel_sst_probe(struct pci_dev *pci,
sst_drv_ctx->use_dma = 0;
sst_drv_ctx->use_lli = 0;
- INIT_LIST_HEAD(&sst_drv_ctx->memcpy_list);
- INIT_LIST_HEAD(&sst_drv_ctx->ipc_dispatch_list);
- INIT_LIST_HEAD(&sst_drv_ctx->block_list);
- INIT_LIST_HEAD(&sst_drv_ctx->rx_list);
-
- sst_drv_ctx->post_msg_wq =
- create_singlethread_workqueue("sst_post_msg_wq");
- if (!sst_drv_ctx->post_msg_wq) {
- ret = -EINVAL;
- goto do_free_drv_ctx;
- }
- INIT_WORK(&sst_drv_ctx->ipc_post_msg_wq, sst_process_pending_msg);
- init_waitqueue_head(&sst_drv_ctx->wait_queue);
-
spin_lock_init(&sst_drv_ctx->ipc_spin_lock);
spin_lock_init(&sst_drv_ctx->block_lock);
spin_lock_init(&sst_drv_ctx->rx_msg_lock);
+ if (sst_workqueue_init(sst_drv_ctx))
+ return -EINVAL;
+
dev_info(sst_drv_ctx->dev, "Got drv data max stream %d\n",
sst_drv_ctx->info.max_streams);
for (i = 1; i <= sst_drv_ctx->info.max_streams; i++) {
@@ -414,7 +419,6 @@ do_release_regions:
pci_release_regions(pci);
do_free_mem:
destroy_workqueue(sst_drv_ctx->post_msg_wq);
-do_free_drv_ctx:
dev_err(sst_drv_ctx->dev, "Probe failed with %d\n", ret);
return ret;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 3/9] ASoC: Intel: move the lock and wq initialization to routine
2014-10-30 10:51 [PATCH 0/9] ASoC: Intel: more modulartion of init and add ACPI Vinod Koul
2014-10-30 10:51 ` [PATCH 1/9] ASoC: Intel: mfld-pcm: Fix to Store device context in sst_data Vinod Koul
2014-10-30 10:51 ` [PATCH 2/9] ASoC: Intel: move the driver wq init to a routine Vinod Koul
@ 2014-10-30 10:51 ` Vinod Koul
2014-10-30 10:51 ` [PATCH 4/9] ASoC: Intel: move the driver context allocation " Vinod Koul
` (5 subsequent siblings)
8 siblings, 0 replies; 25+ messages in thread
From: Vinod Koul @ 2014-10-30 10:51 UTC (permalink / raw)
To: alsa-devel; +Cc: Vinod Koul, broonie, subhransu.s.prusty, lgirdwood
From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
This will be used by APCI code as well, so moving to common routine helps
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/intel/sst/sst.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/sound/soc/intel/sst/sst.c b/sound/soc/intel/sst/sst.c
index 253b917..7c9c65a 100644
--- a/sound/soc/intel/sst/sst.c
+++ b/sound/soc/intel/sst/sst.c
@@ -222,6 +222,14 @@ static int sst_workqueue_init(struct intel_sst_drv *ctx)
return 0;
}
+static void sst_init_locks(struct intel_sst_drv *ctx)
+{
+ mutex_init(&ctx->sst_lock);
+ spin_lock_init(&ctx->rx_msg_lock);
+ spin_lock_init(&ctx->ipc_spin_lock);
+ spin_lock_init(&ctx->block_lock);
+}
+
/*
* intel_sst_probe - PCI probe function
*
@@ -259,7 +267,7 @@ static int intel_sst_probe(struct pci_dev *pci,
return -EINVAL;
ops = sst_drv_ctx->ops;
- mutex_init(&sst_drv_ctx->sst_lock);
+ sst_init_locks(sst_drv_ctx);
/* pvt_id 0 reserved for async messages */
sst_drv_ctx->pvt_id = 1;
@@ -270,10 +278,6 @@ static int intel_sst_probe(struct pci_dev *pci,
sst_drv_ctx->use_dma = 0;
sst_drv_ctx->use_lli = 0;
- spin_lock_init(&sst_drv_ctx->ipc_spin_lock);
- spin_lock_init(&sst_drv_ctx->block_lock);
- spin_lock_init(&sst_drv_ctx->rx_msg_lock);
-
if (sst_workqueue_init(sst_drv_ctx))
return -EINVAL;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 4/9] ASoC: Intel: move the driver context allocation to routine
2014-10-30 10:51 [PATCH 0/9] ASoC: Intel: more modulartion of init and add ACPI Vinod Koul
` (2 preceding siblings ...)
2014-10-30 10:51 ` [PATCH 3/9] ASoC: Intel: move the lock and wq initialization to routine Vinod Koul
@ 2014-10-30 10:51 ` Vinod Koul
2014-10-30 10:51 ` [PATCH 5/9] ASoC: Intel: modularize driver probe and remove Vinod Koul
` (4 subsequent siblings)
8 siblings, 0 replies; 25+ messages in thread
From: Vinod Koul @ 2014-10-30 10:51 UTC (permalink / raw)
To: alsa-devel; +Cc: Vinod Koul, broonie, subhransu.s.prusty, lgirdwood
From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
This will be used by APCI code as well, so moving to common routine helps
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/intel/sst/sst.c | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/sound/soc/intel/sst/sst.c b/sound/soc/intel/sst/sst.c
index 7c9c65a..cbbe9a7 100644
--- a/sound/soc/intel/sst/sst.c
+++ b/sound/soc/intel/sst/sst.c
@@ -230,6 +230,20 @@ static void sst_init_locks(struct intel_sst_drv *ctx)
spin_lock_init(&ctx->block_lock);
}
+int sst_alloc_drv_context(struct intel_sst_drv **ctx,
+ struct device *dev, unsigned int dev_id)
+{
+ *ctx = devm_kzalloc(dev, sizeof(struct intel_sst_drv), GFP_KERNEL);
+ if (!(*ctx))
+ return -ENOMEM;
+
+ (*ctx)->dev = dev;
+ (*ctx)->dev_id = dev_id;
+
+ return 0;
+}
+
+
/*
* intel_sst_probe - PCI probe function
*
@@ -247,12 +261,11 @@ static int intel_sst_probe(struct pci_dev *pci,
int ddr_base;
dev_dbg(&pci->dev, "Probe for DID %x\n", pci->device);
- sst_drv_ctx = devm_kzalloc(&pci->dev, sizeof(*sst_drv_ctx), GFP_KERNEL);
- if (!sst_drv_ctx)
- return -ENOMEM;
- sst_drv_ctx->dev = &pci->dev;
- sst_drv_ctx->dev_id = pci->device;
+ ret = sst_alloc_drv_context(&sst_drv_ctx, &pci->dev, pci->device);
+ if (ret < 0)
+ return ret;
+
if (!sst_pdata)
return -EINVAL;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 5/9] ASoC: Intel: modularize driver probe and remove
2014-10-30 10:51 [PATCH 0/9] ASoC: Intel: more modulartion of init and add ACPI Vinod Koul
` (3 preceding siblings ...)
2014-10-30 10:51 ` [PATCH 4/9] ASoC: Intel: move the driver context allocation " Vinod Koul
@ 2014-10-30 10:51 ` Vinod Koul
2014-10-31 16:46 ` Mark Brown
2014-10-30 10:51 ` [PATCH 6/9] ASoC: Intel: more probe modularization for sst Vinod Koul
` (3 subsequent siblings)
8 siblings, 1 reply; 25+ messages in thread
From: Vinod Koul @ 2014-10-30 10:51 UTC (permalink / raw)
To: alsa-devel; +Cc: Vinod Koul, broonie, subhransu.s.prusty, lgirdwood
From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
The driver probe which initializes driver and remove which cleans up can be
shared with APCI as well, so move them to common init_context and
cleanup_context routines which can be used by ACPI as well
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/intel/sst/sst.c | 165 +++++++++++++++++++++++++-------------------
1 files changed, 94 insertions(+), 71 deletions(-)
diff --git a/sound/soc/intel/sst/sst.c b/sound/soc/intel/sst/sst.c
index cbbe9a7..e621922 100644
--- a/sound/soc/intel/sst/sst.c
+++ b/sound/soc/intel/sst/sst.c
@@ -243,6 +243,94 @@ int sst_alloc_drv_context(struct intel_sst_drv **ctx,
return 0;
}
+int sst_context_init(struct intel_sst_drv *ctx)
+{
+ int ret = 0, i;
+
+ if (!ctx->pdata)
+ return -EINVAL;
+
+ if (!ctx->pdata->probe_data)
+ return -EINVAL;
+
+ memcpy(&ctx->info, ctx->pdata->probe_data, sizeof(ctx->info));
+
+ ret = sst_driver_ops(ctx);
+ if (ret != 0)
+ return -EINVAL;
+
+ sst_init_locks(ctx);
+
+ /* pvt_id 0 reserved for async messages */
+ ctx->pvt_id = 1;
+ ctx->stream_cnt = 0;
+ ctx->fw_in_mem = NULL;
+ /* we use memcpy, so set to 0 */
+ ctx->use_dma = 0;
+ ctx->use_lli = 0;
+
+ if (sst_workqueue_init(ctx))
+ return -EINVAL;
+
+ ctx->mailbox_recv_offset = ctx->pdata->ipc_info->mbox_recv_off;
+ ctx->ipc_reg.ipcx = SST_IPCX + ctx->pdata->ipc_info->ipc_offset;
+ ctx->ipc_reg.ipcd = SST_IPCD + ctx->pdata->ipc_info->ipc_offset;
+
+ dev_info(ctx->dev, "Got drv data max stream %d\n",
+ ctx->info.max_streams);
+
+ for (i = 1; i <= ctx->info.max_streams; i++) {
+ struct stream_info *stream = &ctx->streams[i];
+
+ memset(stream, 0, sizeof(*stream));
+ stream->pipe_id = PIPE_RSVD;
+ mutex_init(&stream->lock);
+ }
+
+ /* Register the ISR */
+ ret = devm_request_threaded_irq(ctx->dev, ctx->irq_num, ctx->ops->interrupt,
+ ctx->ops->irq_thread, 0, SST_DRV_NAME,
+ ctx);
+ if (ret)
+ goto do_free_mem;
+
+ dev_dbg(ctx->dev, "Registered IRQ %#x\n", ctx->irq_num);
+
+ /* default intr are unmasked so set this as masked */
+ sst_shim_write64(ctx->shim, SST_IMRX, 0xFFFF0038);
+
+ ctx->qos = devm_kzalloc(ctx->dev,
+ sizeof(struct pm_qos_request), GFP_KERNEL);
+ if (!ctx->qos) {
+ ret = -ENOMEM;
+ goto do_free_mem;
+ }
+ pm_qos_add_request(ctx->qos, PM_QOS_CPU_DMA_LATENCY,
+ PM_QOS_DEFAULT_VALUE);
+ return 0;
+
+do_free_mem:
+ destroy_workqueue(ctx->post_msg_wq);
+ return ret;
+}
+
+void sst_context_cleanup(struct intel_sst_drv *ctx)
+{
+ pm_runtime_get_noresume(ctx->dev);
+ pm_runtime_forbid(ctx->dev);
+ sst_unregister(ctx->dev);
+ sst_set_fw_state_locked(ctx, SST_SHUTDOWN);
+ flush_scheduled_work();
+ destroy_workqueue(ctx->post_msg_wq);
+ pm_qos_remove_request(ctx->qos);
+ kfree(ctx->fw_sg_list.src);
+ kfree(ctx->fw_sg_list.dst);
+ ctx->fw_sg_list.list_len = 0;
+ kfree(ctx->fw_in_mem);
+ ctx->fw_in_mem = NULL;
+ sst_memcpy_free_resources(ctx);
+ ctx = NULL;
+}
/*
* intel_sst_probe - PCI probe function
@@ -254,9 +342,8 @@ int sst_alloc_drv_context(struct intel_sst_drv **ctx,
static int intel_sst_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{
- int i, ret = 0;
+ int ret = 0;
struct intel_sst_drv *sst_drv_ctx;
- struct intel_sst_ops *ops;
struct sst_platform_info *sst_pdata = pci->dev.platform_data;
int ddr_base;
@@ -266,43 +353,12 @@ static int intel_sst_probe(struct pci_dev *pci,
if (ret < 0)
return ret;
- if (!sst_pdata)
- return -EINVAL;
-
sst_drv_ctx->pdata = sst_pdata;
- if (!sst_drv_ctx->pdata->probe_data)
- return -EINVAL;
-
- memcpy(&sst_drv_ctx->info, sst_drv_ctx->pdata->probe_data,
- sizeof(sst_drv_ctx->info));
-
- if (0 != sst_driver_ops(sst_drv_ctx))
- return -EINVAL;
-
- ops = sst_drv_ctx->ops;
- sst_init_locks(sst_drv_ctx);
-
- /* pvt_id 0 reserved for async messages */
- sst_drv_ctx->pvt_id = 1;
- sst_drv_ctx->stream_cnt = 0;
- sst_drv_ctx->fw_in_mem = NULL;
-
- /* we use memcpy, so set to 0 */
- sst_drv_ctx->use_dma = 0;
- sst_drv_ctx->use_lli = 0;
-
- if (sst_workqueue_init(sst_drv_ctx))
- return -EINVAL;
- dev_info(sst_drv_ctx->dev, "Got drv data max stream %d\n",
- sst_drv_ctx->info.max_streams);
- for (i = 1; i <= sst_drv_ctx->info.max_streams; i++) {
- struct stream_info *stream = &sst_drv_ctx->streams[i];
+ ret = sst_context_init(sst_drv_ctx);
+ if (ret < 0)
+ goto do_free_drv_ctx;
- memset(stream, 0, sizeof(*stream));
- stream->pipe_id = PIPE_RSVD;
- mutex_init(&stream->lock);
- }
/* Init the device */
ret = pcim_enable_device(pci);
@@ -402,18 +458,6 @@ static int intel_sst_probe(struct pci_dev *pci,
}
sst_drv_ctx->irq_num = pci->irq;
- /* Register the ISR */
- ret = devm_request_threaded_irq(&pci->dev, pci->irq,
- sst_drv_ctx->ops->interrupt,
- sst_drv_ctx->ops->irq_thread, 0, SST_DRV_NAME,
- sst_drv_ctx);
- if (ret)
- goto do_release_regions;
- dev_dbg(sst_drv_ctx->dev, "Registered IRQ 0x%x\n", pci->irq);
-
- /* default intr are unmasked so set this as masked */
- if (sst_drv_ctx->dev_id == SST_MRFLD_PCI_ID)
- sst_shim_write64(sst_drv_ctx->shim, SST_IMRX, 0xFFFF0038);
pci_set_drvdata(pci, sst_drv_ctx);
pm_runtime_set_autosuspend_delay(sst_drv_ctx->dev, SST_SUSPEND_DELAY);
@@ -421,14 +465,6 @@ static int intel_sst_probe(struct pci_dev *pci,
pm_runtime_allow(sst_drv_ctx->dev);
pm_runtime_put_noidle(sst_drv_ctx->dev);
sst_register(sst_drv_ctx->dev);
- sst_drv_ctx->qos = devm_kzalloc(&pci->dev,
- sizeof(struct pm_qos_request), GFP_KERNEL);
- if (!sst_drv_ctx->qos) {
- ret = -ENOMEM;
- goto do_release_regions;
- }
- pm_qos_add_request(sst_drv_ctx->qos, PM_QOS_CPU_DMA_LATENCY,
- PM_QOS_DEFAULT_VALUE);
return ret;
@@ -436,6 +472,7 @@ do_release_regions:
pci_release_regions(pci);
do_free_mem:
destroy_workqueue(sst_drv_ctx->post_msg_wq);
+do_free_drv_ctx:
dev_err(sst_drv_ctx->dev, "Probe failed with %d\n", ret);
return ret;
}
@@ -452,22 +489,8 @@ static void intel_sst_remove(struct pci_dev *pci)
{
struct intel_sst_drv *sst_drv_ctx = pci_get_drvdata(pci);
- pm_runtime_get_noresume(sst_drv_ctx->dev);
- pm_runtime_forbid(sst_drv_ctx->dev);
- sst_unregister(sst_drv_ctx->dev);
+ sst_context_cleanup(sst_drv_ctx);
pci_dev_put(sst_drv_ctx->pci);
- sst_set_fw_state_locked(sst_drv_ctx, SST_SHUTDOWN);
-
- flush_scheduled_work();
- destroy_workqueue(sst_drv_ctx->post_msg_wq);
- pm_qos_remove_request(sst_drv_ctx->qos);
- kfree(sst_drv_ctx->fw_sg_list.src);
- kfree(sst_drv_ctx->fw_sg_list.dst);
- sst_drv_ctx->fw_sg_list.list_len = 0;
- kfree(sst_drv_ctx->fw_in_mem);
- sst_drv_ctx->fw_in_mem = NULL;
- sst_memcpy_free_resources(sst_drv_ctx);
- sst_drv_ctx = NULL;
pci_release_regions(pci);
pci_set_drvdata(pci, NULL);
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 6/9] ASoC: Intel: more probe modularization for sst
2014-10-30 10:51 [PATCH 0/9] ASoC: Intel: more modulartion of init and add ACPI Vinod Koul
` (4 preceding siblings ...)
2014-10-30 10:51 ` [PATCH 5/9] ASoC: Intel: modularize driver probe and remove Vinod Koul
@ 2014-10-30 10:51 ` Vinod Koul
2014-10-30 10:51 ` [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file Vinod Koul
` (2 subsequent siblings)
8 siblings, 0 replies; 25+ messages in thread
From: Vinod Koul @ 2014-10-30 10:51 UTC (permalink / raw)
To: alsa-devel; +Cc: Vinod Koul, broonie, subhransu.s.prusty, lgirdwood
From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Move the PCI bar and resource initialization to a separate routine
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/intel/sst/sst.c | 158 ++++++++++++++++++++++++--------------------
1 files changed, 86 insertions(+), 72 deletions(-)
diff --git a/sound/soc/intel/sst/sst.c b/sound/soc/intel/sst/sst.c
index e621922..ad16101 100644
--- a/sound/soc/intel/sst/sst.c
+++ b/sound/soc/intel/sst/sst.c
@@ -332,114 +332,132 @@ void sst_context_cleanup(struct intel_sst_drv *ctx)
ctx = NULL;
}
-/*
-* intel_sst_probe - PCI probe function
-*
-* @pci: PCI device structure
-* @pci_id: PCI device ID structure
-*
-*/
-static int intel_sst_probe(struct pci_dev *pci,
- const struct pci_device_id *pci_id)
+void sst_configure_runtime_pm(struct intel_sst_drv *ctx)
{
- int ret = 0;
- struct intel_sst_drv *sst_drv_ctx;
- struct sst_platform_info *sst_pdata = pci->dev.platform_data;
- int ddr_base;
-
- dev_dbg(&pci->dev, "Probe for DID %x\n", pci->device);
-
- ret = sst_alloc_drv_context(&sst_drv_ctx, &pci->dev, pci->device);
- if (ret < 0)
- return ret;
-
- sst_drv_ctx->pdata = sst_pdata;
-
- ret = sst_context_init(sst_drv_ctx);
- if (ret < 0)
- goto do_free_drv_ctx;
-
+ pm_runtime_set_autosuspend_delay(ctx->dev, SST_SUSPEND_DELAY);
+ pm_runtime_use_autosuspend(ctx->dev);
+ pm_runtime_allow(ctx->dev);
+ pm_runtime_put_noidle(ctx->dev);
+}
- /* Init the device */
- ret = pcim_enable_device(pci);
- if (ret) {
- dev_err(sst_drv_ctx->dev,
- "device can't be enabled. Returned err: %d\n", ret);
- goto do_free_mem;
- }
- sst_drv_ctx->pci = pci_dev_get(pci);
+static int sst_platform_get_resources(struct intel_sst_drv *ctx)
+{
+ int ddr_base, ret = 0;
+ struct pci_dev *pci = ctx->pci;
ret = pci_request_regions(pci, SST_DRV_NAME);
if (ret)
- goto do_free_mem;
+ return ret;
/* map registers */
/* DDR base */
- if (sst_drv_ctx->dev_id == SST_MRFLD_PCI_ID) {
- sst_drv_ctx->ddr_base = pci_resource_start(pci, 0);
+ if (ctx->dev_id == SST_MRFLD_PCI_ID) {
+ ctx->ddr_base = pci_resource_start(pci, 0);
/* check that the relocated IMR base matches with FW Binary */
- ddr_base = relocate_imr_addr_mrfld(sst_drv_ctx->ddr_base);
- if (!sst_drv_ctx->pdata->lib_info) {
- dev_err(sst_drv_ctx->dev, "lib_info pointer NULL\n");
+ ddr_base = relocate_imr_addr_mrfld(ctx->ddr_base);
+ if (!ctx->pdata->lib_info) {
+ dev_err(ctx->dev, "lib_info pointer NULL\n");
ret = -EINVAL;
goto do_release_regions;
}
- if (ddr_base != sst_drv_ctx->pdata->lib_info->mod_base) {
- dev_err(sst_drv_ctx->dev,
+ if (ddr_base != ctx->pdata->lib_info->mod_base) {
+ dev_err(ctx->dev,
"FW LSP DDR BASE does not match with IFWI\n");
ret = -EINVAL;
goto do_release_regions;
}
- sst_drv_ctx->ddr_end = pci_resource_end(pci, 0);
+ ctx->ddr_end = pci_resource_end(pci, 0);
- sst_drv_ctx->ddr = pcim_iomap(pci, 0,
+ ctx->ddr = pcim_iomap(pci, 0,
pci_resource_len(pci, 0));
- if (!sst_drv_ctx->ddr) {
+ if (!ctx->ddr) {
ret = -EINVAL;
goto do_release_regions;
}
- dev_dbg(sst_drv_ctx->dev, "sst: DDR Ptr %p\n", sst_drv_ctx->ddr);
+ dev_dbg(ctx->dev, "sst: DDR Ptr %p\n", ctx->ddr);
} else {
- sst_drv_ctx->ddr = NULL;
+ ctx->ddr = NULL;
}
-
/* SHIM */
- sst_drv_ctx->shim_phy_add = pci_resource_start(pci, 1);
- sst_drv_ctx->shim = pcim_iomap(pci, 1, pci_resource_len(pci, 1));
- if (!sst_drv_ctx->shim) {
+ ctx->shim_phy_add = pci_resource_start(pci, 1);
+ ctx->shim = pcim_iomap(pci, 1, pci_resource_len(pci, 1));
+ if (!ctx->shim) {
ret = -EINVAL;
goto do_release_regions;
}
- dev_dbg(sst_drv_ctx->dev, "SST Shim Ptr %p\n", sst_drv_ctx->shim);
+ dev_dbg(ctx->dev, "SST Shim Ptr %p\n", ctx->shim);
/* Shared SRAM */
- sst_drv_ctx->mailbox_add = pci_resource_start(pci, 2);
- sst_drv_ctx->mailbox = pcim_iomap(pci, 2, pci_resource_len(pci, 2));
- if (!sst_drv_ctx->mailbox) {
+ ctx->mailbox_add = pci_resource_start(pci, 2);
+ ctx->mailbox = pcim_iomap(pci, 2, pci_resource_len(pci, 2));
+ if (!ctx->mailbox) {
ret = -EINVAL;
goto do_release_regions;
}
- dev_dbg(sst_drv_ctx->dev, "SRAM Ptr %p\n", sst_drv_ctx->mailbox);
+ dev_dbg(ctx->dev, "SRAM Ptr %p\n", ctx->mailbox);
/* IRAM */
- sst_drv_ctx->iram_end = pci_resource_end(pci, 3);
- sst_drv_ctx->iram_base = pci_resource_start(pci, 3);
- sst_drv_ctx->iram = pcim_iomap(pci, 3, pci_resource_len(pci, 3));
- if (!sst_drv_ctx->iram) {
+ ctx->iram_end = pci_resource_end(pci, 3);
+ ctx->iram_base = pci_resource_start(pci, 3);
+ ctx->iram = pcim_iomap(pci, 3, pci_resource_len(pci, 3));
+ if (!ctx->iram) {
ret = -EINVAL;
goto do_release_regions;
}
- dev_dbg(sst_drv_ctx->dev, "IRAM Ptr %p\n", sst_drv_ctx->iram);
+ dev_dbg(ctx->dev, "IRAM Ptr %p\n", ctx->iram);
/* DRAM */
- sst_drv_ctx->dram_end = pci_resource_end(pci, 4);
- sst_drv_ctx->dram_base = pci_resource_start(pci, 4);
- sst_drv_ctx->dram = pcim_iomap(pci, 4, pci_resource_len(pci, 4));
- if (!sst_drv_ctx->dram) {
+ ctx->dram_end = pci_resource_end(pci, 4);
+ ctx->dram_base = pci_resource_start(pci, 4);
+ ctx->dram = pcim_iomap(pci, 4, pci_resource_len(pci, 4));
+ if (!ctx->dram) {
ret = -EINVAL;
goto do_release_regions;
}
- dev_dbg(sst_drv_ctx->dev, "DRAM Ptr %p\n", sst_drv_ctx->dram);
+ dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram);
+do_release_regions:
+ pci_release_regions(pci);
+ return 0;
+}
+/*
+* intel_sst_probe - PCI probe function
+*
+* @pci: PCI device structure
+* @pci_id: PCI device ID structure
+*
+*/
+static int intel_sst_probe(struct pci_dev *pci,
+ const struct pci_device_id *pci_id)
+{
+ int ret = 0;
+ struct intel_sst_drv *sst_drv_ctx;
+ struct sst_platform_info *sst_pdata = pci->dev.platform_data;
+
+ dev_dbg(&pci->dev, "Probe for DID %x\n", pci->device);
+
+ ret = sst_alloc_drv_context(&sst_drv_ctx, &pci->dev, pci->device);
+ if (ret < 0)
+ return ret;
+
+ sst_drv_ctx->pdata = sst_pdata;
+ sst_drv_ctx->irq_num = pci->irq;
+
+ ret = sst_context_init(sst_drv_ctx);
+ if (ret < 0)
+ goto do_free_drv_ctx;
+
+
+ /* Init the device */
+ ret = pcim_enable_device(pci);
+ if (ret) {
+ dev_err(sst_drv_ctx->dev,
+ "device can't be enabled. Returned err: %d\n", ret);
+ goto do_destroy_wq;
+ }
+ sst_drv_ctx->pci = pci_dev_get(pci);
+ ret = sst_platform_get_resources(sst_drv_ctx);
+ if (ret < 0)
+ goto do_destroy_wq;
sst_set_fw_state_locked(sst_drv_ctx, SST_RESET);
snprintf(sst_drv_ctx->firmware_name, sizeof(sst_drv_ctx->firmware_name),
@@ -457,20 +475,16 @@ static int intel_sst_probe(struct pci_dev *pci,
goto do_release_regions;
}
- sst_drv_ctx->irq_num = pci->irq;
pci_set_drvdata(pci, sst_drv_ctx);
- pm_runtime_set_autosuspend_delay(sst_drv_ctx->dev, SST_SUSPEND_DELAY);
- pm_runtime_use_autosuspend(sst_drv_ctx->dev);
- pm_runtime_allow(sst_drv_ctx->dev);
- pm_runtime_put_noidle(sst_drv_ctx->dev);
+ sst_configure_runtime_pm(sst_drv_ctx);
sst_register(sst_drv_ctx->dev);
return ret;
do_release_regions:
pci_release_regions(pci);
-do_free_mem:
+do_destroy_wq:
destroy_workqueue(sst_drv_ctx->post_msg_wq);
do_free_drv_ctx:
dev_err(sst_drv_ctx->dev, "Probe failed with %d\n", ret);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file
2014-10-30 10:51 [PATCH 0/9] ASoC: Intel: more modulartion of init and add ACPI Vinod Koul
` (5 preceding siblings ...)
2014-10-30 10:51 ` [PATCH 6/9] ASoC: Intel: more probe modularization for sst Vinod Koul
@ 2014-10-30 10:51 ` Vinod Koul
2014-10-30 15:03 ` Takashi Iwai
2014-10-30 10:51 ` [PATCH 8/9] ASoC: Intel: add shim save context and restore routines Vinod Koul
2014-10-30 10:51 ` [PATCH 9/9] ASoC: Intel: Add ACPI driver for SST Vinod Koul
8 siblings, 1 reply; 25+ messages in thread
From: Vinod Koul @ 2014-10-30 10:51 UTC (permalink / raw)
To: alsa-devel; +Cc: Vinod Koul, broonie, subhransu.s.prusty, lgirdwood
From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
This allow the sst.c to be common across PCI and APCI usages
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Author: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
---
sound/soc/intel/Kconfig | 4 +
sound/soc/intel/sst/Makefile | 4 +
sound/soc/intel/sst/sst.c | 200 +------------------------------------
sound/soc/intel/sst/sst.h | 6 +
sound/soc/intel/sst/sst_pci.c | 225 +++++++++++++++++++++++++++++++++++++++++
5 files changed, 240 insertions(+), 199 deletions(-)
create mode 100644 sound/soc/intel/sst/sst_pci.c
diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig
index 2a3af88..cbc987e 100644
--- a/sound/soc/intel/Kconfig
+++ b/sound/soc/intel/Kconfig
@@ -4,6 +4,7 @@ config SND_MFLD_MACHINE
select SND_SOC_SN95031
select SND_SST_MFLD_PLATFORM
select SND_SST_IPC
+ select SND_SST_IPC_PCI
help
This adds support for ASoC machine driver for Intel(R) MID Medfield platform
used as alsa device in audio substem in Intel(R) MID devices
@@ -16,6 +17,9 @@ config SND_SST_MFLD_PLATFORM
config SND_SST_IPC
tristate
+config SND_SST_IPC_PCI
+ bool
+
config SND_SOC_INTEL_SST
tristate "ASoC support for Intel(R) Smart Sound Technology"
select SND_SOC_INTEL_SST_ACPI if ACPI
diff --git a/sound/soc/intel/sst/Makefile b/sound/soc/intel/sst/Makefile
index 4d0e79b..b3fbccd 100644
--- a/sound/soc/intel/sst/Makefile
+++ b/sound/soc/intel/sst/Makefile
@@ -1,3 +1,7 @@
snd-intel-sst-objs := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
+ifneq ($(CONFIG_SND_SST_IPC_PCI),)
+snd-intel-sst-objs += sst_pci.o
+endif
+
obj-$(CONFIG_SND_SST_IPC) += snd-intel-sst.o
diff --git a/sound/soc/intel/sst/sst.c b/sound/soc/intel/sst/sst.c
index ad16101..97c737a 100644
--- a/sound/soc/intel/sst/sst.c
+++ b/sound/soc/intel/sst/sst.c
@@ -20,30 +20,19 @@
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#include <linux/module.h>
-#include <linux/pci.h>
#include <linux/fs.h>
#include <linux/interrupt.h>
#include <linux/firmware.h>
#include <linux/pm_runtime.h>
#include <linux/pm_qos.h>
#include <linux/async.h>
-#include <linux/delay.h>
-#include <linux/acpi.h>
#include <sound/core.h>
-#include <sound/pcm.h>
#include <sound/soc.h>
-#include <sound/compress_driver.h>
-#include <asm/intel-mid.h>
#include <asm/platform_sst_audio.h>
#include "../sst-mfld-platform.h"
#include "sst.h"
#include "../sst-dsp.h"
-MODULE_AUTHOR("Vinod Koul <vinod.koul@intel.com>");
-MODULE_AUTHOR("Harsha Priya <priya.harsha@intel.com>");
-MODULE_DESCRIPTION("Intel (R) SST(R) Audio Engine Driver");
-MODULE_LICENSE("GPL v2");
-
static inline bool sst_is_process_reply(u32 msg_id)
{
return ((msg_id & PROCESS_MSG) ? true : false);
@@ -340,174 +329,7 @@ void sst_configure_runtime_pm(struct intel_sst_drv *ctx)
pm_runtime_put_noidle(ctx->dev);
}
-static int sst_platform_get_resources(struct intel_sst_drv *ctx)
-{
- int ddr_base, ret = 0;
- struct pci_dev *pci = ctx->pci;
- ret = pci_request_regions(pci, SST_DRV_NAME);
- if (ret)
- return ret;
-
- /* map registers */
- /* DDR base */
- if (ctx->dev_id == SST_MRFLD_PCI_ID) {
- ctx->ddr_base = pci_resource_start(pci, 0);
- /* check that the relocated IMR base matches with FW Binary */
- ddr_base = relocate_imr_addr_mrfld(ctx->ddr_base);
- if (!ctx->pdata->lib_info) {
- dev_err(ctx->dev, "lib_info pointer NULL\n");
- ret = -EINVAL;
- goto do_release_regions;
- }
- if (ddr_base != ctx->pdata->lib_info->mod_base) {
- dev_err(ctx->dev,
- "FW LSP DDR BASE does not match with IFWI\n");
- ret = -EINVAL;
- goto do_release_regions;
- }
- ctx->ddr_end = pci_resource_end(pci, 0);
-
- ctx->ddr = pcim_iomap(pci, 0,
- pci_resource_len(pci, 0));
- if (!ctx->ddr) {
- ret = -EINVAL;
- goto do_release_regions;
- }
- dev_dbg(ctx->dev, "sst: DDR Ptr %p\n", ctx->ddr);
- } else {
- ctx->ddr = NULL;
- }
- /* SHIM */
- ctx->shim_phy_add = pci_resource_start(pci, 1);
- ctx->shim = pcim_iomap(pci, 1, pci_resource_len(pci, 1));
- if (!ctx->shim) {
- ret = -EINVAL;
- goto do_release_regions;
- }
- dev_dbg(ctx->dev, "SST Shim Ptr %p\n", ctx->shim);
-
- /* Shared SRAM */
- ctx->mailbox_add = pci_resource_start(pci, 2);
- ctx->mailbox = pcim_iomap(pci, 2, pci_resource_len(pci, 2));
- if (!ctx->mailbox) {
- ret = -EINVAL;
- goto do_release_regions;
- }
- dev_dbg(ctx->dev, "SRAM Ptr %p\n", ctx->mailbox);
-
- /* IRAM */
- ctx->iram_end = pci_resource_end(pci, 3);
- ctx->iram_base = pci_resource_start(pci, 3);
- ctx->iram = pcim_iomap(pci, 3, pci_resource_len(pci, 3));
- if (!ctx->iram) {
- ret = -EINVAL;
- goto do_release_regions;
- }
- dev_dbg(ctx->dev, "IRAM Ptr %p\n", ctx->iram);
-
- /* DRAM */
- ctx->dram_end = pci_resource_end(pci, 4);
- ctx->dram_base = pci_resource_start(pci, 4);
- ctx->dram = pcim_iomap(pci, 4, pci_resource_len(pci, 4));
- if (!ctx->dram) {
- ret = -EINVAL;
- goto do_release_regions;
- }
- dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram);
-do_release_regions:
- pci_release_regions(pci);
- return 0;
-}
-/*
-* intel_sst_probe - PCI probe function
-*
-* @pci: PCI device structure
-* @pci_id: PCI device ID structure
-*
-*/
-static int intel_sst_probe(struct pci_dev *pci,
- const struct pci_device_id *pci_id)
-{
- int ret = 0;
- struct intel_sst_drv *sst_drv_ctx;
- struct sst_platform_info *sst_pdata = pci->dev.platform_data;
-
- dev_dbg(&pci->dev, "Probe for DID %x\n", pci->device);
-
- ret = sst_alloc_drv_context(&sst_drv_ctx, &pci->dev, pci->device);
- if (ret < 0)
- return ret;
-
- sst_drv_ctx->pdata = sst_pdata;
- sst_drv_ctx->irq_num = pci->irq;
-
- ret = sst_context_init(sst_drv_ctx);
- if (ret < 0)
- goto do_free_drv_ctx;
-
-
- /* Init the device */
- ret = pcim_enable_device(pci);
- if (ret) {
- dev_err(sst_drv_ctx->dev,
- "device can't be enabled. Returned err: %d\n", ret);
- goto do_destroy_wq;
- }
- sst_drv_ctx->pci = pci_dev_get(pci);
-
- ret = sst_platform_get_resources(sst_drv_ctx);
- if (ret < 0)
- goto do_destroy_wq;
-
- sst_set_fw_state_locked(sst_drv_ctx, SST_RESET);
- snprintf(sst_drv_ctx->firmware_name, sizeof(sst_drv_ctx->firmware_name),
- "%s%04x%s", "fw_sst_",
- sst_drv_ctx->dev_id, ".bin");
- dev_dbg(sst_drv_ctx->dev,
- "Requesting FW %s now...\n", sst_drv_ctx->firmware_name);
- ret = request_firmware_nowait(THIS_MODULE, 1,
- sst_drv_ctx->firmware_name, sst_drv_ctx->dev,
- GFP_KERNEL, sst_drv_ctx, sst_firmware_load_cb);
-
- if (ret) {
- dev_err(sst_drv_ctx->dev,
- "Firmware load failed with error: %d\n", ret);
- goto do_release_regions;
- }
-
-
- pci_set_drvdata(pci, sst_drv_ctx);
- sst_configure_runtime_pm(sst_drv_ctx);
- sst_register(sst_drv_ctx->dev);
-
- return ret;
-
-do_release_regions:
- pci_release_regions(pci);
-do_destroy_wq:
- destroy_workqueue(sst_drv_ctx->post_msg_wq);
-do_free_drv_ctx:
- dev_err(sst_drv_ctx->dev, "Probe failed with %d\n", ret);
- return ret;
-}
-
-/**
-* intel_sst_remove - PCI remove function
-*
-* @pci: PCI device structure
-*
-* This function is called by OS when a device is unloaded
-* This frees the interrupt etc
-*/
-static void intel_sst_remove(struct pci_dev *pci)
-{
- struct intel_sst_drv *sst_drv_ctx = pci_get_drvdata(pci);
- sst_context_cleanup(sst_drv_ctx);
- pci_dev_put(sst_drv_ctx->pci);
- pci_release_regions(pci);
- pci_set_drvdata(pci, NULL);
-}
static int intel_sst_runtime_suspend(struct device *dev)
{
@@ -550,27 +372,7 @@ static int intel_sst_runtime_resume(struct device *dev)
return ret;
}
-static const struct dev_pm_ops intel_sst_pm = {
+const struct dev_pm_ops intel_sst_pm = {
.runtime_suspend = intel_sst_runtime_suspend,
.runtime_resume = intel_sst_runtime_resume,
};
-
-/*PCI Routines*/
-static struct pci_device_id intel_sst_ids[] = {
- { PCI_VDEVICE(INTEL, SST_MRFLD_PCI_ID), 0},
- { 0, }
-};
-
-static struct pci_driver sst_driver = {
- .name = SST_DRV_NAME,
- .id_table = intel_sst_ids,
- .probe = intel_sst_probe,
- .remove = intel_sst_remove,
-#ifdef CONFIG_PM
- .driver = {
- .pm = &intel_sst_pm,
- },
-#endif
-};
-
-module_pci_driver(sst_driver);
diff --git a/sound/soc/intel/sst/sst.h b/sound/soc/intel/sst/sst.h
index b65b9c0..3ee555e 100644
--- a/sound/soc/intel/sst/sst.h
+++ b/sound/soc/intel/sst/sst.h
@@ -40,6 +40,7 @@
#define MRFLD_FW_FEATURE_BASE_OFFSET 0x4
#define MRFLD_FW_BSS_RESET_BIT 0
+extern const struct dev_pm_ops intel_sst_pm;
enum sst_states {
SST_FW_LOADING = 1,
SST_FW_RUNNING,
@@ -537,4 +538,9 @@ void sst_fill_header_dsp(struct ipc_dsp_hdr *dsp, int msg,
int sst_register(struct device *);
int sst_unregister(struct device *);
+int sst_alloc_drv_context(struct intel_sst_drv **ctx,
+ struct device *dev, unsigned int dev_id);
+int sst_context_init(struct intel_sst_drv *ctx);
+void sst_context_cleanup(struct intel_sst_drv *ctx);
+void sst_configure_runtime_pm(struct intel_sst_drv *ctx);
#endif
diff --git a/sound/soc/intel/sst/sst_pci.c b/sound/soc/intel/sst/sst_pci.c
new file mode 100644
index 0000000..c7eb28b
--- /dev/null
+++ b/sound/soc/intel/sst/sst_pci.c
@@ -0,0 +1,225 @@
+/*
+ * sst_pci.c - SST (LPE) driver init file for pci enumeration.
+ *
+ * Copyright (C) 2008-14 Intel Corp
+ * Authors: Vinod Koul <vinod.koul@intel.com>
+ * Harsha Priya <priya.harsha@intel.com>
+ * Dharageswari R <dharageswari.r@intel.com>
+ * KP Jeeja <jeeja.kp@intel.com>
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/fs.h>
+#include <linux/firmware.h>
+#include <linux/pm_runtime.h>
+#include <sound/core.h>
+#include <sound/soc.h>
+#include <asm/platform_sst_audio.h>
+#include "../sst-mfld-platform.h"
+#include "sst.h"
+
+static int sst_platform_get_resources(struct intel_sst_drv *ctx)
+{
+ int ddr_base, ret = 0;
+ struct pci_dev *pci = ctx->pci;
+
+ ret = pci_request_regions(pci, SST_DRV_NAME);
+ if (ret)
+ return ret;
+
+ /* map registers */
+ /* DDR base */
+ if (ctx->dev_id == SST_MRFLD_PCI_ID) {
+ ctx->ddr_base = pci_resource_start(pci, 0);
+ /* check that the relocated IMR base matches with FW Binary */
+ ddr_base = relocate_imr_addr_mrfld(ctx->ddr_base);
+ if (!ctx->pdata->lib_info) {
+ dev_err(ctx->dev, "lib_info pointer NULL\n");
+ ret = -EINVAL;
+ goto do_release_regions;
+ }
+ if (ddr_base != ctx->pdata->lib_info->mod_base) {
+ dev_err(ctx->dev,
+ "FW LSP DDR BASE does not match with IFWI\n");
+ ret = -EINVAL;
+ goto do_release_regions;
+ }
+ ctx->ddr_end = pci_resource_end(pci, 0);
+
+ ctx->ddr = pcim_iomap(pci, 0,
+ pci_resource_len(pci, 0));
+ if (!ctx->ddr) {
+ ret = -EINVAL;
+ goto do_release_regions;
+ }
+ dev_dbg(ctx->dev, "sst: DDR Ptr %p\n", ctx->ddr);
+ } else {
+ ctx->ddr = NULL;
+ }
+ /* SHIM */
+ ctx->shim_phy_add = pci_resource_start(pci, 1);
+ ctx->shim = pcim_iomap(pci, 1, pci_resource_len(pci, 1));
+ if (!ctx->shim) {
+ ret = -EINVAL;
+ goto do_release_regions;
+ }
+ dev_dbg(ctx->dev, "SST Shim Ptr %p\n", ctx->shim);
+
+ /* Shared SRAM */
+ ctx->mailbox_add = pci_resource_start(pci, 2);
+ ctx->mailbox = pcim_iomap(pci, 2, pci_resource_len(pci, 2));
+ if (!ctx->mailbox) {
+ ret = -EINVAL;
+ goto do_release_regions;
+ }
+ dev_dbg(ctx->dev, "SRAM Ptr %p\n", ctx->mailbox);
+
+ /* IRAM */
+ ctx->iram_end = pci_resource_end(pci, 3);
+ ctx->iram_base = pci_resource_start(pci, 3);
+ ctx->iram = pcim_iomap(pci, 3, pci_resource_len(pci, 3));
+ if (!ctx->iram) {
+ ret = -EINVAL;
+ goto do_release_regions;
+ }
+ dev_dbg(ctx->dev, "IRAM Ptr %p\n", ctx->iram);
+
+ /* DRAM */
+ ctx->dram_end = pci_resource_end(pci, 4);
+ ctx->dram_base = pci_resource_start(pci, 4);
+ ctx->dram = pcim_iomap(pci, 4, pci_resource_len(pci, 4));
+ if (!ctx->dram) {
+ ret = -EINVAL;
+ goto do_release_regions;
+ }
+ dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram);
+do_release_regions:
+ pci_release_regions(pci);
+ return 0;
+}
+
+/*
+ * intel_sst_probe - PCI probe function
+ *
+ * @pci: PCI device structure
+ * @pci_id: PCI device ID structure
+ *
+ */
+static int intel_sst_probe(struct pci_dev *pci,
+ const struct pci_device_id *pci_id)
+{
+ int ret = 0;
+ struct intel_sst_drv *sst_drv_ctx;
+ struct sst_platform_info *sst_pdata = pci->dev.platform_data;
+
+ dev_dbg(&pci->dev, "Probe for DID %x\n", pci->device);
+ ret = sst_alloc_drv_context(&sst_drv_ctx, &pci->dev, pci->device);
+ if (ret < 0)
+ return ret;
+
+ sst_drv_ctx->pdata = sst_pdata;
+ sst_drv_ctx->irq_num = pci->irq;
+ ret = sst_context_init(sst_drv_ctx);
+ if (ret < 0)
+ goto do_free_drv_ctx;
+
+ /* Init the device */
+ ret = pcim_enable_device(pci);
+ if (ret) {
+ dev_err(sst_drv_ctx->dev,
+ "device can't be enabled. Returned err: %d\n", ret);
+ goto do_destroy_wq;
+ }
+ sst_drv_ctx->pci = pci_dev_get(pci);
+ ret = sst_platform_get_resources(sst_drv_ctx);
+ if (ret < 0)
+ goto do_destroy_wq;
+
+ sst_set_fw_state_locked(sst_drv_ctx, SST_RESET);
+ snprintf(sst_drv_ctx->firmware_name, sizeof(sst_drv_ctx->firmware_name),
+ "%s%04x%s", "fw_sst_",
+ sst_drv_ctx->dev_id, ".bin");
+ dev_dbg(sst_drv_ctx->dev,
+ "Requesting FW %s now...\n", sst_drv_ctx->firmware_name);
+ ret = request_firmware_nowait(THIS_MODULE, 1,
+ sst_drv_ctx->firmware_name, sst_drv_ctx->dev,
+ GFP_KERNEL, sst_drv_ctx, sst_firmware_load_cb);
+
+ if (ret) {
+ dev_err(sst_drv_ctx->dev,
+ "Firmware load failed with error: %d\n", ret);
+ goto do_release_regions;
+ }
+
+ pci_set_drvdata(pci, sst_drv_ctx);
+ sst_configure_runtime_pm(sst_drv_ctx);
+ sst_register(sst_drv_ctx->dev);
+
+ return ret;
+
+do_release_regions:
+ pci_release_regions(pci);
+do_destroy_wq:
+ destroy_workqueue(sst_drv_ctx->post_msg_wq);
+do_free_drv_ctx:
+ dev_err(sst_drv_ctx->dev, "Probe failed with %d\n", ret);
+ return ret;
+}
+
+/**
+ * intel_sst_remove - PCI remove function
+ *
+ * @pci: PCI device structure
+ *
+ * This function is called by OS when a device is unloaded
+ * This frees the interrupt etc
+ */
+static void intel_sst_remove(struct pci_dev *pci)
+{
+ struct intel_sst_drv *sst_drv_ctx = pci_get_drvdata(pci);
+
+ sst_context_cleanup(sst_drv_ctx);
+ pci_dev_put(sst_drv_ctx->pci);
+ pci_release_regions(pci);
+ pci_set_drvdata(pci, NULL);
+}
+
+/* PCI Routines */
+static struct pci_device_id intel_sst_ids[] = {
+ { PCI_VDEVICE(INTEL, SST_MRFLD_PCI_ID), 0},
+ { 0, }
+};
+
+static struct pci_driver sst_driver = {
+ .name = SST_DRV_NAME,
+ .id_table = intel_sst_ids,
+ .probe = intel_sst_probe,
+ .remove = intel_sst_remove,
+#ifdef CONFIG_PM
+ .driver = {
+ .pm = &intel_sst_pm,
+ },
+#endif
+};
+
+module_pci_driver(sst_driver);
+
+MODULE_DESCRIPTION("Intel (R) SST(R) Audio Engine PCI Driver");
+MODULE_AUTHOR("Vinod Koul <vinod.koul@intel.com>");
+MODULE_AUTHOR("Harsha Priya <priya.harsha@intel.com>");
+MODULE_AUTHOR("Dharageswari R <dharageswari.r@intel.com>");
+MODULE_AUTHOR("KP Jeeja <jeeja.kp@intel.com>");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("sst");
--
1.7.0.4
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 8/9] ASoC: Intel: add shim save context and restore routines
2014-10-30 10:51 [PATCH 0/9] ASoC: Intel: more modulartion of init and add ACPI Vinod Koul
` (6 preceding siblings ...)
2014-10-30 10:51 ` [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file Vinod Koul
@ 2014-10-30 10:51 ` Vinod Koul
2014-10-31 16:58 ` Mark Brown
2014-10-30 10:51 ` [PATCH 9/9] ASoC: Intel: Add ACPI driver for SST Vinod Koul
8 siblings, 1 reply; 25+ messages in thread
From: Vinod Koul @ 2014-10-30 10:51 UTC (permalink / raw)
To: alsa-devel; +Cc: Vinod Koul, broonie, subhransu.s.prusty, lgirdwood
From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Some ACPI platform require the driver to save the shim register content and
restore them after resume, so add the routines for these
The APCI patch will use these routines
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/intel/sst/sst.c | 42 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/sound/soc/intel/sst/sst.c b/sound/soc/intel/sst/sst.c
index 97c737a..82346a0 100644
--- a/sound/soc/intel/sst/sst.c
+++ b/sound/soc/intel/sst/sst.c
@@ -329,7 +329,49 @@ void sst_configure_runtime_pm(struct intel_sst_drv *ctx)
pm_runtime_put_noidle(ctx->dev);
}
+inline void sst_save_shim64(struct intel_sst_drv *ctx,
+ void __iomem *shim,
+ struct sst_shim_regs64 *shim_regs)
+{
+ unsigned long irq_flags;
+
+ spin_lock_irqsave(&ctx->ipc_spin_lock, irq_flags);
+
+ shim_regs->csr = sst_shim_read64(shim, SST_CSR),
+ shim_regs->pisr = sst_shim_read64(shim, SST_PISR),
+ shim_regs->pimr = sst_shim_read64(shim, SST_PIMR),
+ shim_regs->isrx = sst_shim_read64(shim, SST_ISRX),
+ shim_regs->isrd = sst_shim_read64(shim, SST_ISRD),
+ shim_regs->imrx = sst_shim_read64(shim, SST_IMRX),
+ shim_regs->imrd = sst_shim_read64(shim, SST_IMRD),
+ shim_regs->ipcx = sst_shim_read64(shim, ctx->ipc_reg.ipcx),
+ shim_regs->ipcd = sst_shim_read64(shim, ctx->ipc_reg.ipcd),
+ shim_regs->isrsc = sst_shim_read64(shim, SST_ISRSC),
+ shim_regs->isrlpesc = sst_shim_read64(shim, SST_ISRLPESC),
+ shim_regs->imrsc = sst_shim_read64(shim, SST_IMRSC),
+ shim_regs->imrlpesc = sst_shim_read64(shim, SST_IMRLPESC),
+ shim_regs->ipcsc = sst_shim_read64(shim, SST_IPCSC),
+ shim_regs->ipclpesc = sst_shim_read64(shim, SST_IPCLPESC),
+ shim_regs->clkctl = sst_shim_read64(shim, SST_CLKCTL),
+ shim_regs->csr2 = sst_shim_read64(shim, SST_CSR2);
+
+ spin_unlock_irqrestore(&ctx->ipc_spin_lock, irq_flags);
+}
+static inline void sst_restore_shim64(struct intel_sst_drv *ctx,
+ void __iomem *shim,
+ struct sst_shim_regs64 *shim_regs)
+{
+ unsigned long irq_flags;
+
+ /*
+ * we only need to restore IMRX for this case, rest will be
+ * initialize by FW or driver when firmware is loaded
+ */
+ spin_lock_irqsave(&ctx->ipc_spin_lock, irq_flags);
+ sst_shim_write64(shim, SST_IMRX, shim_regs->imrx),
+ spin_unlock_irqrestore(&ctx->ipc_spin_lock, irq_flags);
+}
static int intel_sst_runtime_suspend(struct device *dev)
{
--
1.7.0.4
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 9/9] ASoC: Intel: Add ACPI driver for SST
2014-10-30 10:51 [PATCH 0/9] ASoC: Intel: more modulartion of init and add ACPI Vinod Koul
` (7 preceding siblings ...)
2014-10-30 10:51 ` [PATCH 8/9] ASoC: Intel: add shim save context and restore routines Vinod Koul
@ 2014-10-30 10:51 ` Vinod Koul
8 siblings, 0 replies; 25+ messages in thread
From: Vinod Koul @ 2014-10-30 10:51 UTC (permalink / raw)
To: alsa-devel; +Cc: Vinod Koul, broonie, subhransu.s.prusty, lgirdwood
From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
This add support for ACPI platform and adds the BYT device ID to the
supported machines
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/intel/Kconfig | 3 +
sound/soc/intel/sst/Makefile | 4 +
sound/soc/intel/sst/sst.c | 19 ++
sound/soc/intel/sst/sst.h | 1 +
sound/soc/intel/sst/sst_acpi.c | 387 ++++++++++++++++++++++++++++++++++++++++
sound/soc/intel/sst/sst_pvt.c | 2 +
6 files changed, 416 insertions(+), 0 deletions(-)
create mode 100644 sound/soc/intel/sst/sst_acpi.c
diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig
index cbc987e..df489ea 100644
--- a/sound/soc/intel/Kconfig
+++ b/sound/soc/intel/Kconfig
@@ -20,6 +20,9 @@ config SND_SST_IPC
config SND_SST_IPC_PCI
bool
+config SND_SST_IPC_ACPI
+ bool
+
config SND_SOC_INTEL_SST
tristate "ASoC support for Intel(R) Smart Sound Technology"
select SND_SOC_INTEL_SST_ACPI if ACPI
diff --git a/sound/soc/intel/sst/Makefile b/sound/soc/intel/sst/Makefile
index b3fbccd..79accb5 100644
--- a/sound/soc/intel/sst/Makefile
+++ b/sound/soc/intel/sst/Makefile
@@ -4,4 +4,8 @@ ifneq ($(CONFIG_SND_SST_IPC_PCI),)
snd-intel-sst-objs += sst_pci.o
endif
+ifneq ($(CONFIG_SND_SST_IPC_ACPI),)
+snd-intel-sst-objs += sst_acpi.o
+endif
+
obj-$(CONFIG_SND_SST_IPC) += snd-intel-sst.o
diff --git a/sound/soc/intel/sst/sst.c b/sound/soc/intel/sst/sst.c
index 82346a0..5434c23 100644
--- a/sound/soc/intel/sst/sst.c
+++ b/sound/soc/intel/sst/sst.c
@@ -176,6 +176,7 @@ int sst_driver_ops(struct intel_sst_drv *sst)
switch (sst->dev_id) {
case SST_MRFLD_PCI_ID:
+ case SST_BYT_ACPI_ID:
sst->tstamp = SST_TIME_STAMP_MRFLD;
sst->ops = &mrfld_ops;
return 0;
@@ -306,7 +307,11 @@ do_free_mem:
void sst_context_cleanup(struct intel_sst_drv *ctx)
{
pm_runtime_get_noresume(ctx->dev);
+#if IS_ENABLED(CONFIG_ACPI)
+ pm_runtime_disable(ctx->dev);
+#else
pm_runtime_forbid(ctx->dev);
+#endif
sst_unregister(ctx->dev);
sst_set_fw_state_locked(ctx, SST_SHUTDOWN);
flush_scheduled_work();
@@ -325,8 +330,18 @@ void sst_configure_runtime_pm(struct intel_sst_drv *ctx)
{
pm_runtime_set_autosuspend_delay(ctx->dev, SST_SUSPEND_DELAY);
pm_runtime_use_autosuspend(ctx->dev);
+#if IS_ENABLED(CONFIG_ACPI)
+ /*
+ * For acpi devices, the actual physical device state is
+ * initially active. So change the state to active before
+ * enabling the pm
+ */
+ pm_runtime_set_active(ctx->dev);
+ pm_runtime_enable(ctx->dev);
+#else
pm_runtime_allow(ctx->dev);
pm_runtime_put_noidle(ctx->dev);
+#endif
}
inline void sst_save_shim64(struct intel_sst_drv *ctx,
@@ -393,6 +408,10 @@ static int intel_sst_runtime_suspend(struct device *dev)
synchronize_irq(ctx->irq_num);
flush_workqueue(ctx->post_msg_wq);
+ /* save the shim registers because PMC doesn't save state */
+ if (ctx->dev_id == SST_BYT_ACPI_ID)
+ sst_save_shim64(ctx, ctx->shim, ctx->shim_regs64);
+
return ret;
}
diff --git a/sound/soc/intel/sst/sst.h b/sound/soc/intel/sst/sst.h
index 3ee555e..80630e5 100644
--- a/sound/soc/intel/sst/sst.h
+++ b/sound/soc/intel/sst/sst.h
@@ -29,6 +29,7 @@
/* driver names */
#define SST_DRV_NAME "intel_sst_driver"
#define SST_MRFLD_PCI_ID 0x119A
+#define SST_BYT_ACPI_ID 0x80860F28
#define SST_SUSPEND_DELAY 2000
#define FW_CONTEXT_MEM (64*1024)
diff --git a/sound/soc/intel/sst/sst_acpi.c b/sound/soc/intel/sst/sst_acpi.c
new file mode 100644
index 0000000..0d87e05
--- /dev/null
+++ b/sound/soc/intel/sst/sst_acpi.c
@@ -0,0 +1,387 @@
+/*
+ * sst_acpi.c - SST (LPE) driver init file for ACPI enumeration.
+ *
+ * Copyright (c) 2013, Intel Corporation.
+ *
+ * Authors: Ramesh Babu K V <Ramesh.Babu@intel.com>
+ * Authors: Omair Mohammed Abdullah <omair.m.abdullah@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ *
+ */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/module.h>
+#include <linux/fs.h>
+#include <linux/interrupt.h>
+#include <linux/slab.h>
+#include <linux/io.h>
+#include <linux/miscdevice.h>
+#include <linux/platform_device.h>
+#include <linux/firmware.h>
+#include <linux/pm_runtime.h>
+#include <linux/pm_qos.h>
+#include <linux/acpi.h>
+#include <asm/platform_sst_audio.h>
+#include <sound/core.h>
+#include <sound/soc.h>
+#include <sound/compress_driver.h>
+#include <acpi/acbuffer.h>
+#include <acpi/platform/acenv.h>
+#include <acpi/platform/aclinux.h>
+#include <acpi/actypes.h>
+#include <acpi/acpi_bus.h>
+#include "../sst-mfld-platform.h"
+#include "../sst-dsp.h"
+#include "sst.h"
+
+struct sst_machines {
+ char codec_id[32];
+ char board[32];
+ char machine[32];
+ void (*machine_quirk)(void);
+ char firmware[32];
+ struct sst_platform_info *pdata;
+
+};
+
+/* LPE viewpoint addresses */
+#define SST_BYT_IRAM_PHY_START 0xff2c0000
+#define SST_BYT_IRAM_PHY_END 0xff2d4000
+#define SST_BYT_DRAM_PHY_START 0xff300000
+#define SST_BYT_DRAM_PHY_END 0xff320000
+#define SST_BYT_IMR_VIRT_START 0xc0000000 /* virtual addr in LPE */
+#define SST_BYT_IMR_VIRT_END 0xc01fffff
+#define SST_BYT_SHIM_PHY_ADDR 0xff340000
+#define SST_BYT_MBOX_PHY_ADDR 0xff344000
+#define SST_BYT_DMA0_PHY_ADDR 0xff298000
+#define SST_BYT_DMA1_PHY_ADDR 0xff29c000
+#define SST_BYT_SSP0_PHY_ADDR 0xff2a0000
+#define SST_BYT_SSP2_PHY_ADDR 0xff2a2000
+
+#define BYT_FW_MOD_TABLE_OFFSET 0x80000
+#define BYT_FW_MOD_TABLE_SIZE 0x100
+#define BYT_FW_MOD_OFFSET (BYT_FW_MOD_TABLE_OFFSET + BYT_FW_MOD_TABLE_SIZE)
+
+static const struct sst_info byt_fwparse_info = {
+ .use_elf = false,
+ .max_streams = 25,
+ .iram_start = SST_BYT_IRAM_PHY_START,
+ .iram_end = SST_BYT_IRAM_PHY_END,
+ .iram_use = true,
+ .dram_start = SST_BYT_DRAM_PHY_START,
+ .dram_end = SST_BYT_DRAM_PHY_END,
+ .dram_use = true,
+ .imr_start = SST_BYT_IMR_VIRT_START,
+ .imr_end = SST_BYT_IMR_VIRT_END,
+ .imr_use = true,
+ .mailbox_start = SST_BYT_MBOX_PHY_ADDR,
+ .num_probes = 0,
+ .lpe_viewpt_rqd = true,
+};
+
+static const struct sst_ipc_info byt_ipc_info = {
+ .ipc_offset = 0,
+ .mbox_recv_off = 0x400,
+};
+
+static const struct sst_lib_dnld_info byt_lib_dnld_info = {
+ .mod_base = SST_BYT_IMR_VIRT_START,
+ .mod_end = SST_BYT_IMR_VIRT_END,
+ .mod_table_offset = BYT_FW_MOD_TABLE_OFFSET,
+ .mod_table_size = BYT_FW_MOD_TABLE_SIZE,
+ .mod_ddr_dnld = false,
+};
+
+static const struct sst_res_info byt_rvp_res_info = {
+ .shim_offset = 0x140000,
+ .shim_size = 0x000100,
+ .shim_phy_addr = SST_BYT_SHIM_PHY_ADDR,
+ .ssp0_offset = 0xa0000,
+ .ssp0_size = 0x1000,
+ .dma0_offset = 0x98000,
+ .dma0_size = 0x4000,
+ .dma1_offset = 0x9c000,
+ .dma1_size = 0x4000,
+ .iram_offset = 0x0c0000,
+ .iram_size = 0x14000,
+ .dram_offset = 0x100000,
+ .dram_size = 0x28000,
+ .mbox_offset = 0x144000,
+ .mbox_size = 0x1000,
+ .acpi_lpe_res_index = 0,
+ .acpi_ddr_index = 2,
+ .acpi_ipc_irq_index = 5,
+};
+
+struct sst_platform_info byt_rvp_platform_data = {
+ .probe_data = &byt_fwparse_info,
+ .ipc_info = &byt_ipc_info,
+ .lib_info = &byt_lib_dnld_info,
+ .res_info = &byt_rvp_res_info,
+ .platform = "sst-mfld-platform",
+};
+
+#if IS_ENABLED(CONFIG_ACPI)
+static int sst_platform_get_resources(struct intel_sst_drv *ctx)
+{
+ struct resource *rsrc;
+ struct platform_device *pdev = to_platform_device(ctx->dev);
+
+ /* All ACPI resource request here */
+ /* Get Shim addr */
+ rsrc = platform_get_resource(pdev, IORESOURCE_MEM,
+ ctx->pdata->res_info->acpi_lpe_res_index);
+ if (!rsrc) {
+ dev_err(ctx->dev, "Invalid SHIM base from IFWI");
+ return -EIO;
+ }
+ dev_info(ctx->dev, "LPE base: %#x size:%#x", (unsigned int) rsrc->start,
+ (unsigned int)resource_size(rsrc));
+
+ ctx->iram_base = rsrc->start + ctx->pdata->res_info->iram_offset;
+ ctx->iram_end = ctx->iram_base + ctx->pdata->res_info->iram_size - 1;
+ dev_info(ctx->dev, "IRAM base: %#x", ctx->iram_base);
+ ctx->iram = devm_ioremap_nocache(ctx->dev, ctx->iram_base,
+ ctx->pdata->res_info->iram_size);
+ if (!ctx->iram) {
+ dev_err(ctx->dev, "unable to map IRAM");
+ return -EIO;
+ }
+
+ ctx->dram_base = rsrc->start + ctx->pdata->res_info->dram_offset;
+ ctx->dram_end = ctx->dram_base + ctx->pdata->res_info->dram_size - 1;
+ dev_info(ctx->dev, "DRAM base: %#x", ctx->dram_base);
+ ctx->dram = devm_ioremap_nocache(ctx->dev, ctx->dram_base,
+ ctx->pdata->res_info->dram_size);
+ if (!ctx->dram) {
+ dev_err(ctx->dev, "unable to map DRAM");
+ return -EIO;
+ }
+
+ ctx->shim_phy_add = rsrc->start + ctx->pdata->res_info->shim_offset;
+ dev_info(ctx->dev, "SHIM base: %#x", ctx->shim_phy_add);
+ ctx->shim = devm_ioremap_nocache(ctx->dev, ctx->shim_phy_add,
+ ctx->pdata->res_info->shim_size);
+ if (!ctx->shim) {
+ dev_err(ctx->dev, "unable to map SHIM");
+ return -EIO;
+ }
+
+ /* reassign physical address to LPE viewpoint address */
+ ctx->shim_phy_add = ctx->pdata->res_info->shim_phy_addr;
+
+ /* Get mailbox addr */
+ ctx->mailbox_add = rsrc->start + ctx->pdata->res_info->mbox_offset;
+ dev_info(ctx->dev, "Mailbox base: %#x", ctx->mailbox_add);
+ ctx->mailbox = devm_ioremap_nocache(ctx->dev, ctx->mailbox_add,
+ ctx->pdata->res_info->mbox_size);
+ if (!ctx->mailbox) {
+ dev_err(ctx->dev, "unable to map mailbox");
+ return -EIO;
+ }
+
+ /* reassign physical address to LPE viewpoint address */
+ ctx->mailbox_add = ctx->info.mailbox_start;
+
+ rsrc = platform_get_resource(pdev, IORESOURCE_MEM,
+ ctx->pdata->res_info->acpi_ddr_index);
+ if (!rsrc) {
+ dev_err(ctx->dev, "Invalid DDR base from IFWI");
+ return -EIO;
+ }
+ ctx->ddr_base = rsrc->start;
+ ctx->ddr_end = rsrc->end;
+ dev_info(ctx->dev, "DDR base: %#x", ctx->ddr_base);
+ ctx->ddr = devm_ioremap_nocache(ctx->dev, ctx->ddr_base,
+ resource_size(rsrc));
+ if (!ctx->ddr) {
+ dev_err(ctx->dev, "unable to map DDR");
+ return -EIO;
+ }
+
+ /* Find the IRQ */
+ ctx->irq_num = platform_get_irq(pdev,
+ ctx->pdata->res_info->acpi_ipc_irq_index);
+ return 0;
+}
+
+static acpi_status sst_acpi_mach_match(acpi_handle handle, u32 level,
+ void *context, void **ret)
+{
+ *(bool *)context = true;
+ return AE_OK;
+}
+
+static struct sst_machines *sst_acpi_find_machine(
+ struct sst_machines *machines)
+{
+ struct sst_machines *mach;
+ bool found = false;
+
+ for (mach = machines; mach->codec_id; mach++)
+ if (ACPI_SUCCESS(acpi_get_devices(mach->codec_id,
+ sst_acpi_mach_match,
+ &found, NULL)) && found)
+ return mach;
+
+ return NULL;
+}
+
+int sst_acpi_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ int ret = 0;
+ struct intel_sst_drv *ctx;
+ const struct acpi_device_id *id;
+ struct sst_machines *mach;
+ struct platform_device *mdev;
+ struct platform_device *plat_dev;
+ unsigned int dev_id;
+
+ id = acpi_match_device(dev->driver->acpi_match_table, dev);
+ if (!id)
+ return -ENODEV;
+ dev_dbg(dev, "for %s", id->id);
+
+ mach = (struct sst_machines *)id->driver_data;
+ mach = sst_acpi_find_machine(mach);
+ if (mach == NULL) {
+ dev_err(dev, "No matching machine driver found\n");
+ return -ENODEV;
+ }
+
+ ret = kstrtouint(id->id, 16, &dev_id);
+ if (ret < 0) {
+ dev_err(dev, "Unique device id conversion error: %d\n", ret);
+ return ret;
+ }
+
+ dev_dbg(dev, "ACPI device id: %x\n", dev_id);
+
+ plat_dev = platform_device_register_data(dev, mach->pdata->platform, -1, NULL, 0);
+ if (plat_dev == NULL) {
+ dev_err(dev, "Failed to create machine device: %s\n", mach->pdata->platform);
+ return -ENODEV;
+ }
+
+ /* Create platform device for sst machine driver */
+ mdev = platform_device_register_data(dev, mach->machine, -1, NULL, 0);
+ if (mdev == NULL) {
+ dev_err(dev, "Failed to create machine device: %s\n", mach->machine);
+ return -ENODEV;
+ }
+
+ ret = sst_alloc_drv_context(&ctx, dev, dev_id);
+ if (ret < 0)
+ return ret;
+
+ /* Fill sst platform data */
+ ctx->pdata = mach->pdata;
+ strcpy(ctx->firmware_name, mach->firmware);
+
+ ret = sst_platform_get_resources(ctx);
+ if (ret)
+ return ret;
+
+ ret = sst_context_init(ctx);
+ if (ret < 0)
+ goto free_sst;
+
+ /* need to save shim registers in BYT */
+ ctx->shim_regs64 = devm_kzalloc(ctx->dev, sizeof(*ctx->shim_regs64),
+ GFP_KERNEL);
+ if (!ctx->shim_regs64)
+ return -ENOMEM;
+
+ sst_set_fw_state_locked(ctx, SST_RESET);
+
+ ret = request_firmware_nowait(THIS_MODULE, true, mach->firmware,
+ dev, GFP_KERNEL, ctx, sst_firmware_load_cb);
+ if (ret) {
+ dev_err(ctx->dev, "Firmware download failed:%d\n", ret);
+ goto do_sst_cleanup;
+ }
+
+ sst_configure_runtime_pm(ctx);
+ sst_register(dev);
+ sst_save_shim64(ctx, ctx->shim, ctx->shim_regs64);
+ platform_set_drvdata(pdev, ctx);
+ return ret;
+
+do_sst_cleanup:
+ destroy_workqueue(ctx->post_msg_wq);
+free_sst:
+ platform_set_drvdata(pdev, NULL);
+ dev_err(ctx->dev, "failed with %d\n", ret);
+ return ret;
+}
+
+/**
+* intel_sst_remove - remove function
+*
+* @pdev: platform device structure
+*
+* This function is called by OS when a device is unloaded
+* This frees the interrupt etc
+*/
+int sst_acpi_remove(struct platform_device *pdev)
+{
+ struct intel_sst_drv *ctx;
+
+ ctx = platform_get_drvdata(pdev);
+ sst_context_cleanup(ctx);
+ platform_set_drvdata(pdev, NULL);
+ return 0;
+}
+
+#else
+int sst_acpi_probe(struct platform_device *pdev)
+{
+ return -EINVAL;
+}
+
+int sst_acpi_remove(struct platform_device *pdev)
+{
+ return -EINVAL;
+}
+#endif
+
+static struct sst_machines sst_acpi_bytcr[] = {
+ {"10EC5640", "T100", "bytt100_rt5640", NULL, "fw_sst_0f28.bin",
+ &byt_rvp_platform_data },
+ {},
+};
+
+static const struct acpi_device_id sst_acpi_ids[] = {
+ { "80860F28", (unsigned long)&sst_acpi_bytcr},
+ { },
+};
+
+static struct platform_driver sst_acpi_driver = {
+ .driver = {
+ .name = "intel_sst_acpi",
+ .owner = THIS_MODULE,
+ .acpi_match_table = ACPI_PTR(sst_acpi_ids),
+ .pm = &intel_sst_pm,
+ },
+ .probe = sst_acpi_probe,
+ .remove = sst_acpi_remove,
+};
+
+module_platform_driver(sst_acpi_driver);
+
+MODULE_DESCRIPTION("Intel (R) SST(R) Audio Engine ACPI Driver");
+MODULE_AUTHOR("Ramesh Babu K V");
+MODULE_AUTHOR("Omair Mohammed Abdullah");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("sst");
diff --git a/sound/soc/intel/sst/sst_pvt.c b/sound/soc/intel/sst/sst_pvt.c
index 1c2e081..e8efdd0 100644
--- a/sound/soc/intel/sst/sst_pvt.c
+++ b/sound/soc/intel/sst/sst_pvt.c
@@ -117,6 +117,7 @@ unsigned long long read_shim_data(struct intel_sst_drv *sst, int addr)
switch (sst->dev_id) {
case SST_MRFLD_PCI_ID:
+ case SST_BYT_ACPI_ID:
val = sst_shim_read64(sst->shim, addr);
break;
}
@@ -128,6 +129,7 @@ void write_shim_data(struct intel_sst_drv *sst, int addr,
{
switch (sst->dev_id) {
case SST_MRFLD_PCI_ID:
+ case SST_BYT_ACPI_ID:
sst_shim_write64(sst->shim, addr, (u64) data);
break;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file
2014-10-30 15:03 ` Takashi Iwai
@ 2014-10-30 14:34 ` Vinod Koul
2014-10-30 15:27 ` Takashi Iwai
0 siblings, 1 reply; 25+ messages in thread
From: Vinod Koul @ 2014-10-30 14:34 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, broonie, subhransu.s.prusty, lgirdwood
On Thu, Oct 30, 2014 at 04:03:59PM +0100, Takashi Iwai wrote:
> At Thu, 30 Oct 2014 16:21:50 +0530,
> Vinod Koul wrote:
> >
> > From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> >
> > This allow the sst.c to be common across PCI and APCI usages
> >
> > Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> > Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> >
> > Author: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> > ---
> > sound/soc/intel/Kconfig | 4 +
> > sound/soc/intel/sst/Makefile | 4 +
> > sound/soc/intel/sst/sst.c | 200 +------------------------------------
> > sound/soc/intel/sst/sst.h | 6 +
> > sound/soc/intel/sst/sst_pci.c | 225 +++++++++++++++++++++++++++++++++++++++++
> > 5 files changed, 240 insertions(+), 199 deletions(-)
> > create mode 100644 sound/soc/intel/sst/sst_pci.c
> >
> > diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig
> > index 2a3af88..cbc987e 100644
> > --- a/sound/soc/intel/Kconfig
> > +++ b/sound/soc/intel/Kconfig
> > @@ -4,6 +4,7 @@ config SND_MFLD_MACHINE
> > select SND_SOC_SN95031
> > select SND_SST_MFLD_PLATFORM
> > select SND_SST_IPC
> > + select SND_SST_IPC_PCI
> > help
> > This adds support for ASoC machine driver for Intel(R) MID Medfield platform
> > used as alsa device in audio substem in Intel(R) MID devices
> > @@ -16,6 +17,9 @@ config SND_SST_MFLD_PLATFORM
> > config SND_SST_IPC
> > tristate
> >
> > +config SND_SST_IPC_PCI
> > + bool
> > +
> > config SND_SOC_INTEL_SST
> > tristate "ASoC support for Intel(R) Smart Sound Technology"
> > select SND_SOC_INTEL_SST_ACPI if ACPI
> > diff --git a/sound/soc/intel/sst/Makefile b/sound/soc/intel/sst/Makefile
> > index 4d0e79b..b3fbccd 100644
> > --- a/sound/soc/intel/sst/Makefile
> > +++ b/sound/soc/intel/sst/Makefile
> > @@ -1,3 +1,7 @@
> > snd-intel-sst-objs := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
> >
> > +ifneq ($(CONFIG_SND_SST_IPC_PCI),)
> > +snd-intel-sst-objs += sst_pci.o
> > +endif
>
> The standard way is something like
>
> snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
> snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
>
> But, when looking at the later patch, you try to build ACPI stuff into
> snd-intel-sst, too, and both are implemented as exclusive. This
> doesn't work well in general.
The hardware, firmware so the driver is pretty same. So either it gets probed
as PCI device is SFI platforms and as APCI device on ACPI ones.
Since the probe method is the only one differing, the machine will select
either PCI or ACPI. That one would get compiled in.
Am okay to change if we have better method which works for both
--
~Vinod
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file
2014-10-30 10:51 ` [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file Vinod Koul
@ 2014-10-30 15:03 ` Takashi Iwai
2014-10-30 14:34 ` Vinod Koul
0 siblings, 1 reply; 25+ messages in thread
From: Takashi Iwai @ 2014-10-30 15:03 UTC (permalink / raw)
To: Vinod Koul; +Cc: alsa-devel, broonie, subhransu.s.prusty, lgirdwood
At Thu, 30 Oct 2014 16:21:50 +0530,
Vinod Koul wrote:
>
> From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
>
> This allow the sst.c to be common across PCI and APCI usages
>
> Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
>
> Author: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> ---
> sound/soc/intel/Kconfig | 4 +
> sound/soc/intel/sst/Makefile | 4 +
> sound/soc/intel/sst/sst.c | 200 +------------------------------------
> sound/soc/intel/sst/sst.h | 6 +
> sound/soc/intel/sst/sst_pci.c | 225 +++++++++++++++++++++++++++++++++++++++++
> 5 files changed, 240 insertions(+), 199 deletions(-)
> create mode 100644 sound/soc/intel/sst/sst_pci.c
>
> diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig
> index 2a3af88..cbc987e 100644
> --- a/sound/soc/intel/Kconfig
> +++ b/sound/soc/intel/Kconfig
> @@ -4,6 +4,7 @@ config SND_MFLD_MACHINE
> select SND_SOC_SN95031
> select SND_SST_MFLD_PLATFORM
> select SND_SST_IPC
> + select SND_SST_IPC_PCI
> help
> This adds support for ASoC machine driver for Intel(R) MID Medfield platform
> used as alsa device in audio substem in Intel(R) MID devices
> @@ -16,6 +17,9 @@ config SND_SST_MFLD_PLATFORM
> config SND_SST_IPC
> tristate
>
> +config SND_SST_IPC_PCI
> + bool
> +
> config SND_SOC_INTEL_SST
> tristate "ASoC support for Intel(R) Smart Sound Technology"
> select SND_SOC_INTEL_SST_ACPI if ACPI
> diff --git a/sound/soc/intel/sst/Makefile b/sound/soc/intel/sst/Makefile
> index 4d0e79b..b3fbccd 100644
> --- a/sound/soc/intel/sst/Makefile
> +++ b/sound/soc/intel/sst/Makefile
> @@ -1,3 +1,7 @@
> snd-intel-sst-objs := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
>
> +ifneq ($(CONFIG_SND_SST_IPC_PCI),)
> +snd-intel-sst-objs += sst_pci.o
> +endif
The standard way is something like
snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
But, when looking at the later patch, you try to build ACPI stuff into
snd-intel-sst, too, and both are implemented as exclusive. This
doesn't work well in general.
Takashi
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file
2014-10-30 14:34 ` Vinod Koul
@ 2014-10-30 15:27 ` Takashi Iwai
2014-10-30 15:37 ` Vinod Koul
0 siblings, 1 reply; 25+ messages in thread
From: Takashi Iwai @ 2014-10-30 15:27 UTC (permalink / raw)
To: Vinod Koul; +Cc: alsa-devel, broonie, subhransu.s.prusty, lgirdwood
At Thu, 30 Oct 2014 20:04:44 +0530,
Vinod Koul wrote:
>
> On Thu, Oct 30, 2014 at 04:03:59PM +0100, Takashi Iwai wrote:
> > At Thu, 30 Oct 2014 16:21:50 +0530,
> > Vinod Koul wrote:
> > >
> > > From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> > >
> > > This allow the sst.c to be common across PCI and APCI usages
> > >
> > > Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> > > Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> > >
> > > Author: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> > > ---
> > > sound/soc/intel/Kconfig | 4 +
> > > sound/soc/intel/sst/Makefile | 4 +
> > > sound/soc/intel/sst/sst.c | 200 +------------------------------------
> > > sound/soc/intel/sst/sst.h | 6 +
> > > sound/soc/intel/sst/sst_pci.c | 225 +++++++++++++++++++++++++++++++++++++++++
> > > 5 files changed, 240 insertions(+), 199 deletions(-)
> > > create mode 100644 sound/soc/intel/sst/sst_pci.c
> > >
> > > diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig
> > > index 2a3af88..cbc987e 100644
> > > --- a/sound/soc/intel/Kconfig
> > > +++ b/sound/soc/intel/Kconfig
> > > @@ -4,6 +4,7 @@ config SND_MFLD_MACHINE
> > > select SND_SOC_SN95031
> > > select SND_SST_MFLD_PLATFORM
> > > select SND_SST_IPC
> > > + select SND_SST_IPC_PCI
> > > help
> > > This adds support for ASoC machine driver for Intel(R) MID Medfield platform
> > > used as alsa device in audio substem in Intel(R) MID devices
> > > @@ -16,6 +17,9 @@ config SND_SST_MFLD_PLATFORM
> > > config SND_SST_IPC
> > > tristate
> > >
> > > +config SND_SST_IPC_PCI
> > > + bool
> > > +
> > > config SND_SOC_INTEL_SST
> > > tristate "ASoC support for Intel(R) Smart Sound Technology"
> > > select SND_SOC_INTEL_SST_ACPI if ACPI
> > > diff --git a/sound/soc/intel/sst/Makefile b/sound/soc/intel/sst/Makefile
> > > index 4d0e79b..b3fbccd 100644
> > > --- a/sound/soc/intel/sst/Makefile
> > > +++ b/sound/soc/intel/sst/Makefile
> > > @@ -1,3 +1,7 @@
> > > snd-intel-sst-objs := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
> > >
> > > +ifneq ($(CONFIG_SND_SST_IPC_PCI),)
> > > +snd-intel-sst-objs += sst_pci.o
> > > +endif
> >
> > The standard way is something like
> >
> > snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
> > snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
> >
> > But, when looking at the later patch, you try to build ACPI stuff into
> > snd-intel-sst, too, and both are implemented as exclusive. This
> > doesn't work well in general.
> The hardware, firmware so the driver is pretty same. So either it gets probed
> as PCI device is SFI platforms and as APCI device on ACPI ones.
> Since the probe method is the only one differing, the machine will select
> either PCI or ACPI. That one would get compiled in.
... and this exclusion mechanism is missing in your patches.
Your current code doesn't allow to mix them.
> Am okay to change if we have better method which works for both
In general, it's better to provide individual modules for different
interfaces and a common module that is referred by them. The
selective build makes the build tests more difficult and is rather
error-prone.
Takashi
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file
2014-10-30 15:27 ` Takashi Iwai
@ 2014-10-30 15:37 ` Vinod Koul
2014-10-30 16:28 ` Mark Brown
2014-10-30 16:29 ` Takashi Iwai
0 siblings, 2 replies; 25+ messages in thread
From: Vinod Koul @ 2014-10-30 15:37 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, broonie, subhransu.s.prusty, lgirdwood
On Thu, Oct 30, 2014 at 04:27:09PM +0100, Takashi Iwai wrote:
> > > The standard way is something like
> > >
> > > snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
> > > snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
> > >
> > > But, when looking at the later patch, you try to build ACPI stuff into
> > > snd-intel-sst, too, and both are implemented as exclusive. This
> > > doesn't work well in general.
> > The hardware, firmware so the driver is pretty same. So either it gets probed
> > as PCI device is SFI platforms and as APCI device on ACPI ones.
> > Since the probe method is the only one differing, the machine will select
> > either PCI or ACPI. That one would get compiled in.
>
> ... and this exclusion mechanism is missing in your patches.
> Your current code doesn't allow to mix them.
>
> > Am okay to change if we have better method which works for both
>
> In general, it's better to provide individual modules for different
> interfaces and a common module that is referred by them. The
> selective build makes the build tests more difficult and is rather
> error-prone.
Hmmm, that makes me wonder why cant we do (based on your input above)
snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
then either this:
snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
snd-intel-sst-$(CONFIG_SND_SST_IPC_ACPI) += sst_acpi.o
Or:
snd-intel-sst-pci-y += snd-intel-sst.o sst_pci.o
snd-intel-sst-acpi-y += snd-intel-sst.o sst_acpi.o
And the machine will select required ones..
--
~Vinod
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file
2014-10-30 16:29 ` Takashi Iwai
@ 2014-10-30 15:59 ` Vinod Koul
2014-10-30 16:49 ` Takashi Iwai
0 siblings, 1 reply; 25+ messages in thread
From: Vinod Koul @ 2014-10-30 15:59 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, broonie, subhransu.s.prusty, lgirdwood
On Thu, Oct 30, 2014 at 05:29:00PM +0100, Takashi Iwai wrote:
> At Thu, 30 Oct 2014 21:07:19 +0530,
> Vinod Koul wrote:
> >
> > On Thu, Oct 30, 2014 at 04:27:09PM +0100, Takashi Iwai wrote:
> > > > > The standard way is something like
> > > > >
> > > > > snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
> > > > > snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
> > > > >
> > > > > But, when looking at the later patch, you try to build ACPI stuff into
> > > > > snd-intel-sst, too, and both are implemented as exclusive. This
> > > > > doesn't work well in general.
> > > > The hardware, firmware so the driver is pretty same. So either it gets probed
> > > > as PCI device is SFI platforms and as APCI device on ACPI ones.
> > > > Since the probe method is the only one differing, the machine will select
> > > > either PCI or ACPI. That one would get compiled in.
> > >
> > > ... and this exclusion mechanism is missing in your patches.
> > > Your current code doesn't allow to mix them.
> > >
> > > > Am okay to change if we have better method which works for both
> > >
> > > In general, it's better to provide individual modules for different
> > > interfaces and a common module that is referred by them. The
> > > selective build makes the build tests more difficult and is rather
> > > error-prone.
> > Hmmm, that makes me wonder why cant we do (based on your input above)
> >
> > snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
> >
> > then either this:
> > snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
> > snd-intel-sst-$(CONFIG_SND_SST_IPC_ACPI) += sst_acpi.o
>
> This may compile both sst_pci.c and sst_acpi.c into snd-intel-sst
> module, so it doesn't work unless both Kconfigs are really exclusive.
>
> > Or:
> > snd-intel-sst-pci-y += snd-intel-sst.o sst_pci.o
> > snd-intel-sst-acpi-y += snd-intel-sst.o sst_acpi.o
>
> This is wrong in two ways. First off, you can't link a module against
> another module.
>
> Second, this causes the problem when user build one driver as a module
> and another as built-in. Then you'll get the doubly symbols.
oh no, the core is not a module. the PCI and ACPI will be modules and
allowed to be selected.
Can we prevent the module/built-in by making depends. If one is built-in
other cant be module. That way it would be okay
> So, snd-intel-sst.o must be an individual module.
Since only probe and apci/pci resource setup code is different I would still
like to keep the core lib as same and PCI/ACPI as modules.
--
~Vinod
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file
2014-10-30 16:49 ` Takashi Iwai
@ 2014-10-30 16:14 ` Vinod Koul
2014-10-30 17:07 ` Takashi Iwai
0 siblings, 1 reply; 25+ messages in thread
From: Vinod Koul @ 2014-10-30 16:14 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, broonie, subhransu.s.prusty, lgirdwood
On Thu, Oct 30, 2014 at 05:49:39PM +0100, Takashi Iwai wrote:
> At Thu, 30 Oct 2014 21:29:47 +0530,
> Vinod Koul wrote:
> >
> > On Thu, Oct 30, 2014 at 05:29:00PM +0100, Takashi Iwai wrote:
> > > At Thu, 30 Oct 2014 21:07:19 +0530,
> > > Vinod Koul wrote:
> > > >
> > > > On Thu, Oct 30, 2014 at 04:27:09PM +0100, Takashi Iwai wrote:
> > > > > > > The standard way is something like
> > > > > > >
> > > > > > > snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
> > > > > > > snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
> > > > > > >
> > > > > > > But, when looking at the later patch, you try to build ACPI stuff into
> > > > > > > snd-intel-sst, too, and both are implemented as exclusive. This
> > > > > > > doesn't work well in general.
> > > > > > The hardware, firmware so the driver is pretty same. So either it gets probed
> > > > > > as PCI device is SFI platforms and as APCI device on ACPI ones.
> > > > > > Since the probe method is the only one differing, the machine will select
> > > > > > either PCI or ACPI. That one would get compiled in.
> > > > >
> > > > > ... and this exclusion mechanism is missing in your patches.
> > > > > Your current code doesn't allow to mix them.
> > > > >
> > > > > > Am okay to change if we have better method which works for both
> > > > >
> > > > > In general, it's better to provide individual modules for different
> > > > > interfaces and a common module that is referred by them. The
> > > > > selective build makes the build tests more difficult and is rather
> > > > > error-prone.
> > > > Hmmm, that makes me wonder why cant we do (based on your input above)
> > > >
> > > > snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
> > > >
> > > > then either this:
> > > > snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
> > > > snd-intel-sst-$(CONFIG_SND_SST_IPC_ACPI) += sst_acpi.o
> > >
> > > This may compile both sst_pci.c and sst_acpi.c into snd-intel-sst
> > > module, so it doesn't work unless both Kconfigs are really exclusive.
> > >
> > > > Or:
> > > > snd-intel-sst-pci-y += snd-intel-sst.o sst_pci.o
> > > > snd-intel-sst-acpi-y += snd-intel-sst.o sst_acpi.o
> > >
> > > This is wrong in two ways. First off, you can't link a module against
> > > another module.
> > >
> > > Second, this causes the problem when user build one driver as a module
> > > and another as built-in. Then you'll get the doubly symbols.
> > oh no, the core is not a module. the PCI and ACPI will be modules and
> > allowed to be selected.
>
> Then you should have stripped snd- prefix from snd-intel-sst.o.
> snd-prefix is supposed to be used for the modules.
Sure I can do that
so we can have
sst-intel-core-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
and then
snd-intel-sst-pci-y += sst-intel-core.o sst_pci.o
snd-intel-sst-acpi-y += st-intel-core.o sst_acpi.o
> > Can we prevent the module/built-in by making depends. If one is built-in
> > other cant be module. That way it would be okay
>
> As said, this isn't the best. It disallows the compile testing and
> other tests in a single shot. Testing with various Kconfigs is more
> difficult than catching with make allyesconfig (or such).
well both can be compile tested and we will put in symbols about limitation
of having bpth apci and pci as built-in or module.
--
~Vinod
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file
2014-10-30 15:37 ` Vinod Koul
@ 2014-10-30 16:28 ` Mark Brown
2014-10-30 16:29 ` Takashi Iwai
1 sibling, 0 replies; 25+ messages in thread
From: Mark Brown @ 2014-10-30 16:28 UTC (permalink / raw)
To: Vinod Koul; +Cc: Takashi Iwai, alsa-devel, subhransu.s.prusty, lgirdwood
[-- Attachment #1.1: Type: text/plain, Size: 554 bytes --]
On Thu, Oct 30, 2014 at 09:07:19PM +0530, Vinod Koul wrote:
> Hmmm, that makes me wonder why cant we do (based on your input above)
> snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
> then either this:
> snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
> snd-intel-sst-$(CONFIG_SND_SST_IPC_ACPI) += sst_acpi.o
> Or:
> snd-intel-sst-pci-y += snd-intel-sst.o sst_pci.o
> snd-intel-sst-acpi-y += snd-intel-sst.o sst_acpi.o
> And the machine will select required ones..
That's what I would expect to see.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file
2014-10-30 15:37 ` Vinod Koul
2014-10-30 16:28 ` Mark Brown
@ 2014-10-30 16:29 ` Takashi Iwai
2014-10-30 15:59 ` Vinod Koul
1 sibling, 1 reply; 25+ messages in thread
From: Takashi Iwai @ 2014-10-30 16:29 UTC (permalink / raw)
To: Vinod Koul; +Cc: alsa-devel, broonie, subhransu.s.prusty, lgirdwood
At Thu, 30 Oct 2014 21:07:19 +0530,
Vinod Koul wrote:
>
> On Thu, Oct 30, 2014 at 04:27:09PM +0100, Takashi Iwai wrote:
> > > > The standard way is something like
> > > >
> > > > snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
> > > > snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
> > > >
> > > > But, when looking at the later patch, you try to build ACPI stuff into
> > > > snd-intel-sst, too, and both are implemented as exclusive. This
> > > > doesn't work well in general.
> > > The hardware, firmware so the driver is pretty same. So either it gets probed
> > > as PCI device is SFI platforms and as APCI device on ACPI ones.
> > > Since the probe method is the only one differing, the machine will select
> > > either PCI or ACPI. That one would get compiled in.
> >
> > ... and this exclusion mechanism is missing in your patches.
> > Your current code doesn't allow to mix them.
> >
> > > Am okay to change if we have better method which works for both
> >
> > In general, it's better to provide individual modules for different
> > interfaces and a common module that is referred by them. The
> > selective build makes the build tests more difficult and is rather
> > error-prone.
> Hmmm, that makes me wonder why cant we do (based on your input above)
>
> snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
>
> then either this:
> snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
> snd-intel-sst-$(CONFIG_SND_SST_IPC_ACPI) += sst_acpi.o
This may compile both sst_pci.c and sst_acpi.c into snd-intel-sst
module, so it doesn't work unless both Kconfigs are really exclusive.
> Or:
> snd-intel-sst-pci-y += snd-intel-sst.o sst_pci.o
> snd-intel-sst-acpi-y += snd-intel-sst.o sst_acpi.o
This is wrong in two ways. First off, you can't link a module against
another module.
Second, this causes the problem when user build one driver as a module
and another as built-in. Then you'll get the doubly symbols.
So, snd-intel-sst.o must be an individual module.
Takashi
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file
2014-10-30 15:59 ` Vinod Koul
@ 2014-10-30 16:49 ` Takashi Iwai
2014-10-30 16:14 ` Vinod Koul
0 siblings, 1 reply; 25+ messages in thread
From: Takashi Iwai @ 2014-10-30 16:49 UTC (permalink / raw)
To: Vinod Koul; +Cc: alsa-devel, broonie, subhransu.s.prusty, lgirdwood
At Thu, 30 Oct 2014 21:29:47 +0530,
Vinod Koul wrote:
>
> On Thu, Oct 30, 2014 at 05:29:00PM +0100, Takashi Iwai wrote:
> > At Thu, 30 Oct 2014 21:07:19 +0530,
> > Vinod Koul wrote:
> > >
> > > On Thu, Oct 30, 2014 at 04:27:09PM +0100, Takashi Iwai wrote:
> > > > > > The standard way is something like
> > > > > >
> > > > > > snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
> > > > > > snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
> > > > > >
> > > > > > But, when looking at the later patch, you try to build ACPI stuff into
> > > > > > snd-intel-sst, too, and both are implemented as exclusive. This
> > > > > > doesn't work well in general.
> > > > > The hardware, firmware so the driver is pretty same. So either it gets probed
> > > > > as PCI device is SFI platforms and as APCI device on ACPI ones.
> > > > > Since the probe method is the only one differing, the machine will select
> > > > > either PCI or ACPI. That one would get compiled in.
> > > >
> > > > ... and this exclusion mechanism is missing in your patches.
> > > > Your current code doesn't allow to mix them.
> > > >
> > > > > Am okay to change if we have better method which works for both
> > > >
> > > > In general, it's better to provide individual modules for different
> > > > interfaces and a common module that is referred by them. The
> > > > selective build makes the build tests more difficult and is rather
> > > > error-prone.
> > > Hmmm, that makes me wonder why cant we do (based on your input above)
> > >
> > > snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
> > >
> > > then either this:
> > > snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
> > > snd-intel-sst-$(CONFIG_SND_SST_IPC_ACPI) += sst_acpi.o
> >
> > This may compile both sst_pci.c and sst_acpi.c into snd-intel-sst
> > module, so it doesn't work unless both Kconfigs are really exclusive.
> >
> > > Or:
> > > snd-intel-sst-pci-y += snd-intel-sst.o sst_pci.o
> > > snd-intel-sst-acpi-y += snd-intel-sst.o sst_acpi.o
> >
> > This is wrong in two ways. First off, you can't link a module against
> > another module.
> >
> > Second, this causes the problem when user build one driver as a module
> > and another as built-in. Then you'll get the doubly symbols.
> oh no, the core is not a module. the PCI and ACPI will be modules and
> allowed to be selected.
Then you should have stripped snd- prefix from snd-intel-sst.o.
snd-prefix is supposed to be used for the modules.
> Can we prevent the module/built-in by making depends. If one is built-in
> other cant be module. That way it would be okay
As said, this isn't the best. It disallows the compile testing and
other tests in a single shot. Testing with various Kconfigs is more
difficult than catching with make allyesconfig (or such).
Takashi
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file
2014-10-30 16:14 ` Vinod Koul
@ 2014-10-30 17:07 ` Takashi Iwai
2014-10-30 17:31 ` Mark Brown
0 siblings, 1 reply; 25+ messages in thread
From: Takashi Iwai @ 2014-10-30 17:07 UTC (permalink / raw)
To: Vinod Koul; +Cc: alsa-devel, broonie, subhransu.s.prusty, lgirdwood
At Thu, 30 Oct 2014 21:44:28 +0530,
Vinod Koul wrote:
>
> On Thu, Oct 30, 2014 at 05:49:39PM +0100, Takashi Iwai wrote:
> > At Thu, 30 Oct 2014 21:29:47 +0530,
> > Vinod Koul wrote:
> > >
> > > On Thu, Oct 30, 2014 at 05:29:00PM +0100, Takashi Iwai wrote:
> > > > At Thu, 30 Oct 2014 21:07:19 +0530,
> > > > Vinod Koul wrote:
> > > > >
> > > > > On Thu, Oct 30, 2014 at 04:27:09PM +0100, Takashi Iwai wrote:
> > > > > > > > The standard way is something like
> > > > > > > >
> > > > > > > > snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
> > > > > > > > snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
> > > > > > > >
> > > > > > > > But, when looking at the later patch, you try to build ACPI stuff into
> > > > > > > > snd-intel-sst, too, and both are implemented as exclusive. This
> > > > > > > > doesn't work well in general.
> > > > > > > The hardware, firmware so the driver is pretty same. So either it gets probed
> > > > > > > as PCI device is SFI platforms and as APCI device on ACPI ones.
> > > > > > > Since the probe method is the only one differing, the machine will select
> > > > > > > either PCI or ACPI. That one would get compiled in.
> > > > > >
> > > > > > ... and this exclusion mechanism is missing in your patches.
> > > > > > Your current code doesn't allow to mix them.
> > > > > >
> > > > > > > Am okay to change if we have better method which works for both
> > > > > >
> > > > > > In general, it's better to provide individual modules for different
> > > > > > interfaces and a common module that is referred by them. The
> > > > > > selective build makes the build tests more difficult and is rather
> > > > > > error-prone.
> > > > > Hmmm, that makes me wonder why cant we do (based on your input above)
> > > > >
> > > > > snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
> > > > >
> > > > > then either this:
> > > > > snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
> > > > > snd-intel-sst-$(CONFIG_SND_SST_IPC_ACPI) += sst_acpi.o
> > > >
> > > > This may compile both sst_pci.c and sst_acpi.c into snd-intel-sst
> > > > module, so it doesn't work unless both Kconfigs are really exclusive.
> > > >
> > > > > Or:
> > > > > snd-intel-sst-pci-y += snd-intel-sst.o sst_pci.o
> > > > > snd-intel-sst-acpi-y += snd-intel-sst.o sst_acpi.o
> > > >
> > > > This is wrong in two ways. First off, you can't link a module against
> > > > another module.
> > > >
> > > > Second, this causes the problem when user build one driver as a module
> > > > and another as built-in. Then you'll get the doubly symbols.
> > > oh no, the core is not a module. the PCI and ACPI will be modules and
> > > allowed to be selected.
> >
> > Then you should have stripped snd- prefix from snd-intel-sst.o.
> > snd-prefix is supposed to be used for the modules.
> Sure I can do that
>
> so we can have
>
> sst-intel-core-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
>
> and then
>
> snd-intel-sst-pci-y += sst-intel-core.o sst_pci.o
> snd-intel-sst-acpi-y += st-intel-core.o sst_acpi.o
Kbuild doesn't allow this syntax, AFAIK.
> > > Can we prevent the module/built-in by making depends. If one is built-in
> > > other cant be module. That way it would be okay
> >
> > As said, this isn't the best. It disallows the compile testing and
> > other tests in a single shot. Testing with various Kconfigs is more
> > difficult than catching with make allyesconfig (or such).
> well both can be compile tested and we will put in symbols about limitation
> of having bpth apci and pci as built-in or module.
No, the point is that the exclusiveness in Kconfig level gives more
demerits. This makes impossible to build the both codes in a single
shot, which makes also impossible to cover wider build tests, etc.
My concern isn't about the actual operation but about testing.
That is: don't try to side step such a build issue. I bet it'll
strike back later. Better to keep rather the simple and common
approach other drivers take.
Takashi
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file
2014-10-30 17:07 ` Takashi Iwai
@ 2014-10-30 17:31 ` Mark Brown
2014-10-31 5:55 ` Vinod Koul
2014-10-31 17:32 ` Takashi Iwai
0 siblings, 2 replies; 25+ messages in thread
From: Mark Brown @ 2014-10-30 17:31 UTC (permalink / raw)
To: Takashi Iwai; +Cc: Vinod Koul, alsa-devel, subhransu.s.prusty, lgirdwood
[-- Attachment #1.1: Type: text/plain, Size: 1008 bytes --]
On Thu, Oct 30, 2014 at 06:07:00PM +0100, Takashi Iwai wrote:
> Vinod Koul wrote:
> > snd-intel-sst-pci-y += sst-intel-core.o sst_pci.o
> > snd-intel-sst-acpi-y += st-intel-core.o sst_acpi.o
> Kbuild doesn't allow this syntax, AFAIK.
I've not followed the whole discussion but why not just have the core
code as a separate module, this seems like an awful lot of trouble for
something that's normally straightforward...
> > well both can be compile tested and we will put in symbols about limitation
> > of having bpth apci and pci as built-in or module.
> No, the point is that the exclusiveness in Kconfig level gives more
> demerits. This makes impossible to build the both codes in a single
> shot, which makes also impossible to cover wider build tests, etc.
> My concern isn't about the actual operation but about testing.
> That is: don't try to side step such a build issue. I bet it'll
> strike back later. Better to keep rather the simple and common
> approach other drivers take.
Right.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file
2014-10-30 17:31 ` Mark Brown
@ 2014-10-31 5:55 ` Vinod Koul
2014-10-31 17:32 ` Takashi Iwai
1 sibling, 0 replies; 25+ messages in thread
From: Vinod Koul @ 2014-10-31 5:55 UTC (permalink / raw)
To: Mark Brown; +Cc: Takashi Iwai, alsa-devel, subhransu.s.prusty, lgirdwood
[-- Attachment #1.1: Type: text/plain, Size: 1495 bytes --]
On Thu, Oct 30, 2014 at 05:31:12PM +0000, Mark Brown wrote:
> On Thu, Oct 30, 2014 at 06:07:00PM +0100, Takashi Iwai wrote:
> > Vinod Koul wrote:
>
> > > snd-intel-sst-pci-y += sst-intel-core.o sst_pci.o
> > > snd-intel-sst-acpi-y += st-intel-core.o sst_acpi.o
>
> > Kbuild doesn't allow this syntax, AFAIK.
>
> I've not followed the whole discussion but why not just have the core
> code as a separate module, this seems like an awful lot of trouble for
> something that's normally straightforward...
Hmm seems like my attempt to have just two module is fraught with risks. I
will convert core to module which can be linked either by PCI or ACPI.
Thats should clean this out :)
Thanks for all the points
Mark, please drop this patch, the ones before will still be required for
module so pls do review them
Thanks
--
~Vinod
>
> > > well both can be compile tested and we will put in symbols about limitation
> > > of having bpth apci and pci as built-in or module.
>
> > No, the point is that the exclusiveness in Kconfig level gives more
> > demerits. This makes impossible to build the both codes in a single
> > shot, which makes also impossible to cover wider build tests, etc.
> > My concern isn't about the actual operation but about testing.
>
> > That is: don't try to side step such a build issue. I bet it'll
> > strike back later. Better to keep rather the simple and common
> > approach other drivers take.
>
> Right.
--
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 5/9] ASoC: Intel: modularize driver probe and remove
2014-10-30 10:51 ` [PATCH 5/9] ASoC: Intel: modularize driver probe and remove Vinod Koul
@ 2014-10-31 16:46 ` Mark Brown
0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2014-10-31 16:46 UTC (permalink / raw)
To: Vinod Koul; +Cc: alsa-devel, subhransu.s.prusty, lgirdwood
[-- Attachment #1.1: Type: text/plain, Size: 311 bytes --]
On Thu, Oct 30, 2014 at 04:21:48PM +0530, Vinod Koul wrote:
> From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
>
> The driver probe which initializes driver and remove which cleans up can be
> shared with APCI as well, so move them to common init_context and
APCI? :P (same typo in all these)
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 8/9] ASoC: Intel: add shim save context and restore routines
2014-10-30 10:51 ` [PATCH 8/9] ASoC: Intel: add shim save context and restore routines Vinod Koul
@ 2014-10-31 16:58 ` Mark Brown
0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2014-10-31 16:58 UTC (permalink / raw)
To: Vinod Koul; +Cc: alsa-devel, subhransu.s.prusty, lgirdwood
[-- Attachment #1.1: Type: text/plain, Size: 431 bytes --]
On Thu, Oct 30, 2014 at 04:21:51PM +0530, Vinod Koul wrote:
> From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
>
> Some ACPI platform require the driver to save the shim register content and
> restore them after resume, so add the routines for these
> The APCI patch will use these routines
Applied everything up to here - this one doesn't apply, probably due to
some interaction with one of the other serieses.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file
2014-10-30 17:31 ` Mark Brown
2014-10-31 5:55 ` Vinod Koul
@ 2014-10-31 17:32 ` Takashi Iwai
1 sibling, 0 replies; 25+ messages in thread
From: Takashi Iwai @ 2014-10-31 17:32 UTC (permalink / raw)
To: Mark Brown; +Cc: Vinod Koul, alsa-devel, subhransu.s.prusty, lgirdwood
At Thu, 30 Oct 2014 17:31:12 +0000,
Mark Brown wrote:
>
> On Thu, Oct 30, 2014 at 06:07:00PM +0100, Takashi Iwai wrote:
> > Vinod Koul wrote:
>
> > > snd-intel-sst-pci-y += sst-intel-core.o sst_pci.o
> > > snd-intel-sst-acpi-y += st-intel-core.o sst_acpi.o
>
> > Kbuild doesn't allow this syntax, AFAIK.
>
> I've not followed the whole discussion but why not just have the core
> code as a separate module, this seems like an awful lot of trouble for
> something that's normally straightforward...
Yep, that's what I've suggested, too.
(Became so late response as we had (and maybe well have again) a
network problem...)
Takashi
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2014-10-31 17:32 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-30 10:51 [PATCH 0/9] ASoC: Intel: more modulartion of init and add ACPI Vinod Koul
2014-10-30 10:51 ` [PATCH 1/9] ASoC: Intel: mfld-pcm: Fix to Store device context in sst_data Vinod Koul
2014-10-30 10:51 ` [PATCH 2/9] ASoC: Intel: move the driver wq init to a routine Vinod Koul
2014-10-30 10:51 ` [PATCH 3/9] ASoC: Intel: move the lock and wq initialization to routine Vinod Koul
2014-10-30 10:51 ` [PATCH 4/9] ASoC: Intel: move the driver context allocation " Vinod Koul
2014-10-30 10:51 ` [PATCH 5/9] ASoC: Intel: modularize driver probe and remove Vinod Koul
2014-10-31 16:46 ` Mark Brown
2014-10-30 10:51 ` [PATCH 6/9] ASoC: Intel: more probe modularization for sst Vinod Koul
2014-10-30 10:51 ` [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file Vinod Koul
2014-10-30 15:03 ` Takashi Iwai
2014-10-30 14:34 ` Vinod Koul
2014-10-30 15:27 ` Takashi Iwai
2014-10-30 15:37 ` Vinod Koul
2014-10-30 16:28 ` Mark Brown
2014-10-30 16:29 ` Takashi Iwai
2014-10-30 15:59 ` Vinod Koul
2014-10-30 16:49 ` Takashi Iwai
2014-10-30 16:14 ` Vinod Koul
2014-10-30 17:07 ` Takashi Iwai
2014-10-30 17:31 ` Mark Brown
2014-10-31 5:55 ` Vinod Koul
2014-10-31 17:32 ` Takashi Iwai
2014-10-30 10:51 ` [PATCH 8/9] ASoC: Intel: add shim save context and restore routines Vinod Koul
2014-10-31 16:58 ` Mark Brown
2014-10-30 10:51 ` [PATCH 9/9] ASoC: Intel: Add ACPI driver for SST Vinod Koul
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.