Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, patches.audio@intel.com,
	liam.r.girdwood@linux.intel.com,
	Vinod Koul <vinod.koul@intel.com>,
	broonie@kernel.org, Jeeja KP <jeeja.kp@intel.com>
Subject: [RFC 1/7] ASoC: hda: Add skl dsp init and registering with SST IPC lib
Date: Sun, 19 Apr 2015 02:27:27 +0530	[thread overview]
Message-ID: <1429390653-8194-2-git-send-email-vinod.koul@intel.com> (raw)
In-Reply-To: <1429390653-8194-1-git-send-email-vinod.koul@intel.com>

From: Jeeja KP <jeeja.kp@intel.com>

This will be used by the controller to register/unregister
with the SST IPC lib if processing pipe caps is supported

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 include/sound/soc-hda-sst-dsp.h |    3 ++
 sound/soc/hda/Kconfig           |    1 +
 sound/soc/hda/Makefile          |    2 +-
 sound/soc/hda/hda_skl.h         |   16 ++--------
 sound/soc/hda/hda_soc_dsp.c     |   62 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 70 insertions(+), 14 deletions(-)
 create mode 100644 sound/soc/hda/hda_soc_dsp.c

diff --git a/include/sound/soc-hda-sst-dsp.h b/include/sound/soc-hda-sst-dsp.h
index 9adeb49cf126..a85f95be13c1 100644
--- a/include/sound/soc-hda-sst-dsp.h
+++ b/include/sound/soc-hda-sst-dsp.h
@@ -263,4 +263,7 @@ int ssth_cl_dma_prepare(struct ssth_lib *ctx);
 void ssth_process_cl_dma(struct work_struct *work);
 void ssth_cldma_int_disable(struct ssth_lib *ctx);
 
+int ssth_skl_init(struct device *dev, void __iomem *mmio_base, int irq,
+		struct ssth_dsp_loader_ops dsp_ops, struct ssth_lib **dsp);
+void ssth_skl_cleanup(struct device *dev, struct ssth_lib *ctx);
 #endif /*__HDA_SST_DSP_H__*/
diff --git a/sound/soc/hda/Kconfig b/sound/soc/hda/Kconfig
index 841ea5276fe3..445fa9842127 100644
--- a/sound/soc/hda/Kconfig
+++ b/sound/soc/hda/Kconfig
@@ -29,6 +29,7 @@ config SND_SOC_HDA_SKL
 
 config SND_SOC_I2S_SKL_MACH
         tristate "SOC Machine Audio driver for SKL Onboard I2S"
+	 select SND_HDA_DSP_LOADER
         select SND_SOC_HDA_SKL
         select SND_SOC_RT286
         select SND_SOC_HDMI
diff --git a/sound/soc/hda/Makefile b/sound/soc/hda/Makefile
index d318d4acb8a7..2be667dc0724 100644
--- a/sound/soc/hda/Makefile
+++ b/sound/soc/hda/Makefile
@@ -1,4 +1,4 @@
-snd-soc-hda-skl-objs := hda_skl.o hda_skl_pcm.o
+snd-soc-hda-skl-objs := hda_skl.o hda_skl_pcm.o hda_soc_dsp.o
 
 obj-$(CONFIG_SND_SOC_HDA_SKL) += snd-soc-hda-skl.o
 
diff --git a/sound/soc/hda/hda_skl.h b/sound/soc/hda/hda_skl.h
index 0cc2ac69a9ab..914ea05da6aa 100644
--- a/sound/soc/hda/hda_skl.h
+++ b/sound/soc/hda/hda_skl.h
@@ -1,15 +1,3 @@
-/*
- *  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; either version 2 of the License, or (at your option)
- *  any later version.
- *
- *  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.
- */
-
 #ifndef __SOUND_SOC_HDA_SKL_H
 #define __SOUND_SOC_HDA_SKL_H
 
@@ -22,13 +10,15 @@
 
 struct hda_soc_bus {
 	struct hdac_bus chip;
+	struct device *dev;
 	struct pci_dev *pci;
 
 	unsigned int init_failed:1; /* delayed init failed */
 	unsigned int msi:1;
+	struct ssth_lib *dsp; /* ssth lib ctx */
 };
 
-/* to pass dai dma data */
+/*to pass dai dma data */
 struct soc_hda_dma_params {
 	u32 format;
 	u8 stream_tag;
diff --git a/sound/soc/hda/hda_soc_dsp.c b/sound/soc/hda/hda_soc_dsp.c
new file mode 100644
index 000000000000..3fa033ecaa90
--- /dev/null
+++ b/sound/soc/hda/hda_soc_dsp.c
@@ -0,0 +1,62 @@
+/*
+ *  hda_soc_dsp.c - HDA DSP interface for FW registration, Pipe and Module
+ *  configurations
+ *
+ *  Copyright (C) 2015 Intel Corp
+ *  Author:Rafal Redzimski <rafal.f.redzimski@intel.com>
+ *	   Jeeja KP <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/slab.h>
+#include <linux/pci.h>
+#include <sound/core.h>
+#include <sound/pcm_params.h>
+#include <sound/pcm.h>
+#include <sound/soc-hda-sst-dsp.h>
+#include <sound/soc-hda-sst-ipc.h>
+#include "hda_skl.h"
+
+int ssth_dsp_register(struct hda_soc_bus *schip)
+{
+	void __iomem *mmio_base;
+	int irq = schip->chip.irq;
+	int ret = 0;
+	struct ssth_dsp_loader_ops loader_ops;
+
+	/*TODO assign dsp loader ops */
+
+	/*TODO enable ppcap interrupt */
+	/*read the BAR of the ADSP MMIO */
+	mmio_base = pci_ioremap_bar(schip->pci, 4);
+	if (mmio_base == NULL) {
+		dev_err(schip->dev, "ioremap error\n");
+		return -ENXIO;
+	}
+
+	ret = ssth_skl_init(schip->dev, mmio_base, irq,
+			loader_ops, &schip->dsp);
+
+	dev_dbg(schip->dev, "dsp registeration status=%d\n", ret);
+	return ret;
+}
+
+void ssth_dsp_unregister(struct hda_soc_bus *schip)
+{
+	/*TODO disbale ppcap interrupt */
+	ssth_skl_cleanup(schip->dev, schip->dsp);
+	if (schip->dsp->mmio_base)
+		iounmap(schip->dsp->mmio_base);
+}
-- 
1.7.9.5

  reply	other threads:[~2015-04-18 21:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-18 20:57 [RFC 0/7] ASoC: hda - ASoC DSP widget event handlers Vinod Koul
2015-04-18 20:57 ` Vinod Koul [this message]
2015-04-24 17:36   ` [RFC 1/7] ASoC: hda: Add skl dsp init and registering with SST IPC lib Mark Brown
2015-04-26 13:53     ` Vinod Koul
2015-04-18 20:57 ` [RFC 2/7] ASoC: hda: add helper to configure module params Vinod Koul
2015-04-24 17:38   ` Mark Brown
2015-04-26 14:06     ` Vinod Koul
2015-04-18 20:57 ` [RFC 3/7] ASoC: hda: add FW module init/bind IPC Vinod Koul
2015-04-18 20:57 ` [RFC 4/7] ASoC: hda: add FW pipe create/delete/set_pipe_state IPC Vinod Koul
2015-04-18 20:57 ` [RFC 5/7] ASOC: hda: add DSP platfrom controls widget event handlers Vinod Koul
2015-04-24 17:51   ` Mark Brown
2015-04-26 14:14     ` Vinod Koul
2015-04-18 20:57 ` [RFC 6/7] ASoC: hda: Add support for SSP register settings Vinod Koul
2015-04-24 17:55   ` Mark Brown
2015-04-26 14:18     ` Vinod Koul
2015-04-27 14:15       ` Mark Brown
2015-04-29 23:45         ` Pierre-Louis Bossart
2015-04-29 23:50           ` Pierre-Louis Bossart
2015-04-30  4:39             ` Vinod Koul
2015-04-30 14:36               ` Mark Brown
2015-04-30 15:55                 ` Pierre-Louis Bossart
2015-04-18 20:57 ` [RFC 7/7] ASoC: hda: Apply dai params_fixup for DSP widgets Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1429390653-8194-2-git-send-email-vinod.koul@intel.com \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jeeja.kp@intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=patches.audio@intel.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox