ASoC: Intel: Skylake: Update to SKL driver
Subsystems (3)
cover ASoC: Intel: Skylake: Update to SKL driver
This update bring in new APIs in core and usage of those in SKL driver.
The series is broadly of three parts
- first two are fixes on the driver
- then we add DMA resume capability in HDA core and use it to save restore DMA link values and add DMA resume capability in driver
- lastly, we add support for MISCBDCGE configuration in core and use it while resetting and also for phrase detection per HW recommendation
This should be merged thru ASoC tree due to obvious dependencies. Takashi would need your ack on core patches
Dharageswari.R (1):
ASoC: Intel: Skylake: Use CGCTL.MISCBDCGE for Phrase detection
notification
Jayachandran B (3):
ALSA: hdac: Add MISCBDCGE support
ALSA: hdac: Increase timeout value for link power check
ASoC: Intel: Skylake: fix reset controller sequencing
Jeeja KP (8):
ASoC: Intel: Skylake: Clear stream registers before stream setup
ASoC: Intel: Skylake: Fix to set pipe state to invalid when deleting
ALSA: hdac: Add support for hda DMA Resume capability
ALSA: hdac: couple the hda DMA stream in cleanup
ASoC: Intel: Skylake: enable interrupt as wake source in active
suspend
ASoC: Intel: Skylake: Add DMA resume position in Trigger
resume/suspend
ASoC: Intel: Skylake: Reconfigure Link stream on suspend/resume
ASoC: Intel: Skylake: Add Resume capability in PCM info.
Vinod Koul (2):
ALSA: hdac: add snd_hdac_ext_bus_link_power_up_all
ASoC: Intel: Skylake: manage link power in active suspend
include/sound/hda_register.h | 12 ++++++ include/sound/hdaudio_ext.h | 16 ++++++++ sound/hda/ext/hdac_ext_controller.c | 52 +++++++++++++++++++++++- sound/hda/ext/hdac_ext_stream.c | 72 +++++++++++++++++++++++++++++++++ sound/soc/intel/skylake/skl-messages.c | 2 + sound/soc/intel/skylake/skl-pcm.c | 56 ++++++++++++++++++++----- sound/soc/intel/skylake/skl-sst-cldma.c | 38 ++++++++++------- sound/soc/intel/skylake/skl-sst-ipc.c | 14 +++++++ sound/soc/intel/skylake/skl-sst-ipc.h | 3 ++ sound/soc/intel/skylake/skl.c | 30 ++++++++++++-- 10 files changed, 265 insertions(+), 30 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/14 ASoC: Intel: Skylake: Clear stream registers before stream setup
From: Jeeja KP <[email protected]>
This patch adds clean up routine to clear the stream registers and calls this routine before setting up stream registers.
--- sound/soc/intel/skylake/skl-sst-cldma.c | 38 ++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 15 deletions(-)
sound/soc/intel/skylake/skl-sst-cldma.c +23 -15
@@ -60,6 +60,27 @@ static void skl_cldma_stream_run(struct sst_dsp *ctx, bool enable)dev_err (ctx->dev,"Failed to set Run bit=%d enable=%d\n" , val, enable); } +static void skl_cldma_stream_clear (struct sst_dsp *ctx) +{ +/* make sure Run bit is cleared before setting stream register */ +skl_cldma_stream_run (ctx,0 ); + +sst_dsp_shim_update_bits (ctx,SKL_ADSP_REG_CL_SD_CTL , +CL_SD_CTL_IOCE_MASK ,CL_SD_CTL_IOCE (0 )); +sst_dsp_shim_update_bits (ctx,SKL_ADSP_REG_CL_SD_CTL , +CL_SD_CTL_FEIE_MASK ,CL_SD_CTL_FEIE (0 )); +sst_dsp_shim_update_bits (ctx,SKL_ADSP_REG_CL_SD_CTL , +CL_SD_CTL_DEIE_MASK ,CL_SD_CTL_DEIE (0 )); +sst_dsp_shim_update_bits (ctx,SKL_ADSP_REG_CL_SD_CTL , +CL_SD_CTL_STRM_MASK ,CL_SD_CTL_STRM (0 )); + +sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_BDLPL ,CL_SD_BDLPLBA (0 )); +sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_BDLPU ,0 ); + +sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_CBL ,0 ); +sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_LVI ,0 ); +} +/* Code loader helper APIs */ static void skl_cldma_setup_bdle(struct sst_dsp *ctx, struct snd_dma_buffer *dmab_data,
@@ -95,6 +116,7 @@ static void skl_cldma_setup_controller(struct sst_dsp *ctx, struct snd_dma_buffer *dmab_bdl, unsigned int max_size, u32 count) { +skl_cldma_stream_clear (ctx );sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_BDLPL ,CL_SD_BDLPLBA (dmab_bdl->addr)); sst_dsp_shim_write(ctx, SKL_ADSP_REG_CL_SD_BDLPU,
@@ -137,21 +159,7 @@ static void skl_cldma_cleanup_spb(struct sst_dsp *ctx)static void skl_cldma_cleanup (struct sst_dsp *ctx) {skl_cldma_cleanup_spb (ctx); - -sst_dsp_shim_update_bits (ctx,SKL_ADSP_REG_CL_SD_CTL , -CL_SD_CTL_IOCE_MASK ,CL_SD_CTL_IOCE (0 )); -sst_dsp_shim_update_bits (ctx,SKL_ADSP_REG_CL_SD_CTL , -CL_SD_CTL_FEIE_MASK ,CL_SD_CTL_FEIE (0 )); -sst_dsp_shim_update_bits (ctx,SKL_ADSP_REG_CL_SD_CTL , -CL_SD_CTL_DEIE_MASK ,CL_SD_CTL_DEIE (0 )); -sst_dsp_shim_update_bits (ctx,SKL_ADSP_REG_CL_SD_CTL , -CL_SD_CTL_STRM_MASK ,CL_SD_CTL_STRM (0 )); - -sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_BDLPL ,CL_SD_BDLPLBA (0 )); -sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_BDLPU ,0 ); - -sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_CBL ,0 ); -sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_LVI ,0 ); +skl_cldma_stream_clear (ctx); ctx->dsp_ops.free_dma_buf (ctx->dev, &ctx->cl_dev.dmab_data); ctx->dsp_ops.free_dma_buf (ctx->dev, &ctx->cl_dev.dmab_bdl);
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Clear stream registers before stream setup" to the asoc tree
The patch
ASoC: Intel: Skylake: Clear stream registers before stream setup
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
a4386450bf08cd968bf41ff30a92caf74262c9d6Mon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Fri, 18 Dec 2015 15:11:57 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Clear stream registers before stream
setup
This patch adds clean up routine to clear the stream registers and calls this routine before setting up stream registers.
--- sound/soc/intel/skylake/skl-sst-cldma.c | 38 ++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 15 deletions(-)
sound/soc/intel/skylake/skl-sst-cldma.c +23 -15
@@ -60,6 +60,27 @@ static void skl_cldma_stream_run(struct sst_dsp *ctx, bool enable)dev_err (ctx->dev,"Failed to set Run bit=%d enable=%d\n" , val, enable); } +static void skl_cldma_stream_clear (struct sst_dsp *ctx) +{ +/* make sure Run bit is cleared before setting stream register */ +skl_cldma_stream_run (ctx,0 ); + +sst_dsp_shim_update_bits (ctx,SKL_ADSP_REG_CL_SD_CTL , +CL_SD_CTL_IOCE_MASK ,CL_SD_CTL_IOCE (0 )); +sst_dsp_shim_update_bits (ctx,SKL_ADSP_REG_CL_SD_CTL , +CL_SD_CTL_FEIE_MASK ,CL_SD_CTL_FEIE (0 )); +sst_dsp_shim_update_bits (ctx,SKL_ADSP_REG_CL_SD_CTL , +CL_SD_CTL_DEIE_MASK ,CL_SD_CTL_DEIE (0 )); +sst_dsp_shim_update_bits (ctx,SKL_ADSP_REG_CL_SD_CTL , +CL_SD_CTL_STRM_MASK ,CL_SD_CTL_STRM (0 )); + +sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_BDLPL ,CL_SD_BDLPLBA (0 )); +sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_BDLPU ,0 ); + +sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_CBL ,0 ); +sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_LVI ,0 ); +} +/* Code loader helper APIs */ static void skl_cldma_setup_bdle(struct sst_dsp *ctx, struct snd_dma_buffer *dmab_data,
@@ -95,6 +116,7 @@ static void skl_cldma_setup_controller(struct sst_dsp *ctx, struct snd_dma_buffer *dmab_bdl, unsigned int max_size, u32 count) { +skl_cldma_stream_clear (ctx );sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_BDLPL ,CL_SD_BDLPLBA (dmab_bdl->addr)); sst_dsp_shim_write(ctx, SKL_ADSP_REG_CL_SD_BDLPU,
@@ -137,21 +159,7 @@ static void skl_cldma_cleanup_spb(struct sst_dsp *ctx)static void skl_cldma_cleanup (struct sst_dsp *ctx) {skl_cldma_cleanup_spb (ctx); - -sst_dsp_shim_update_bits (ctx,SKL_ADSP_REG_CL_SD_CTL , -CL_SD_CTL_IOCE_MASK ,CL_SD_CTL_IOCE (0 )); -sst_dsp_shim_update_bits (ctx,SKL_ADSP_REG_CL_SD_CTL , -CL_SD_CTL_FEIE_MASK ,CL_SD_CTL_FEIE (0 )); -sst_dsp_shim_update_bits (ctx,SKL_ADSP_REG_CL_SD_CTL , -CL_SD_CTL_DEIE_MASK ,CL_SD_CTL_DEIE (0 )); -sst_dsp_shim_update_bits (ctx,SKL_ADSP_REG_CL_SD_CTL , -CL_SD_CTL_STRM_MASK ,CL_SD_CTL_STRM (0 )); - -sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_BDLPL ,CL_SD_BDLPLBA (0 )); -sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_BDLPU ,0 ); - -sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_CBL ,0 ); -sst_dsp_shim_write (ctx,SKL_ADSP_REG_CL_SD_LVI ,0 ); +skl_cldma_stream_clear (ctx); ctx->dsp_ops.free_dma_buf (ctx->dev, &ctx->cl_dev.dmab_data); ctx->dsp_ops.free_dma_buf (ctx->dev, &ctx->cl_dev.dmab_bdl);
Signature · 1 line
2.6.2
PATCH 2/14 ASoC: Intel: Skylake: Fix to set pipe state to invalid when deleting
In reply to Vinod KoulFrom: Jeeja KP <[email protected]>
When pipeline is deleted, reset the pipeline state to invalid state.
--- sound/soc/intel/skylake/skl-messages.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/intel/skylake/skl-messages.c +2 -0
@@ -849,6 +849,8 @@ int skl_delete_pipe(struct skl_sst *ctx, struct skl_pipe *pipe) ret =skl_ipc_delete_pipeline (&ctx->ipc, pipe->ppl_id);if (ret <0 )dev_err (ctx->dev,"Failed to delete pipeline\n" ); + + pipe->state =SKL_PIPE_INVALID ; }return ret;
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Fix to set pipe state to invalid when deleting" to the asoc tree
The patch
ASoC: Intel: Skylake: Fix to set pipe state to invalid when deleting
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
d2c7db854ed07548ca7d01118eee67fd6a78a2beMon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Fri, 18 Dec 2015 15:11:58 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Fix to set pipe state to invalid when
deleting
When pipeline is deleted, set the pipeline state to invalid state.
--- sound/soc/intel/skylake/skl-messages.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/intel/skylake/skl-messages.c +2 -0
@@ -849,6 +849,8 @@ int skl_delete_pipe(struct skl_sst *ctx, struct skl_pipe *pipe) ret =skl_ipc_delete_pipeline (&ctx->ipc, pipe->ppl_id);if (ret <0 )dev_err (ctx->dev,"Failed to delete pipeline\n" ); + + pipe->state =SKL_PIPE_INVALID ; }return ret;
Signature · 1 line
2.6.2
PATCH 3/14 ALSA: hdac: Add support for hda DMA Resume capability
In reply to Vinod KoulFrom: Jeeja KP <[email protected]>
Skylake sports new capability of DMA resume, DRSM where we can resume the DMA. This capability is defined by presence of AZX_DRSM_CAP_ID.
If this capability is present, we use this capability. So we add:
snd_hdac_ext_stream_drsm_enable() - DMA resume caps snd_hdac_ext_stream_set_dpibr() - set the DMA position snd_hdac_ext_stream_set_lpib() - set the lpib
--- include/sound/hda_register.h | 9 +++++ include/sound/hdaudio_ext.h | 14 ++++++++ sound/hda/ext/hdac_ext_controller.c | 6 ++++ sound/hda/ext/hdac_ext_stream.c | 71 +++++++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+)
include/sound/hda_register.h +9 -0
@@ -230,6 +230,15 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };#define AZX_MLCTL_SPA (1<<16)#define AZX_MLCTL_CPA 23 + +/* registers for DMA Resume Capability Structure */ +#define AZX_DRSM_CAP_ID 0x5 +#define AZX_REG_DRSM_CTL 0x4 +/* Base used to calculate the iterating register offset */ +#define AZX_DRSM_BASE 0x08 +/* Interval used to calculate the iterating register offset */ +#define AZX_DRSM_INTERVAL 0x08 +/* * helpers to read the stream position */
include/sound/hdaudio_ext.h +14 -0
@@ -12,6 +12,7 @@* @spbcap: SPIB capabilities pointer * @mlcap: MultiLink capabilities pointer * @gtscap: gts capabilities pointer +* @drsmcap: dma resume capabilities pointer * @hlink_list: link list of HDA links */ struct hdac_ext_bus {
@@ -23,6 +24,7 @@ struct hdac_ext_bus {void __iomem *spbcap;void __iomem *mlcap;void __iomem *gtscap; +void __iomem *drsmcap;struct list_head hlink_list; };
@@ -72,6 +74,9 @@ enum hdac_ext_stream_type {* @pplc_addr: processing pipe link stream pointer * @spib_addr: software position in buffers stream pointer * @fifo_addr: software position Max fifos stream pointer +* @dpibr_addr: DMA position in buffer resume pointer +* @dpib: DMA position in buffer +* @lpib: Linear position in buffer * @decoupled: stream host and link is decoupled * @link_locked: link is locked * @link_prepared: link is prepared
@@ -86,6 +91,10 @@ struct hdac_ext_stream {void __iomem *spib_addr;void __iomem *fifo_addr; +void __iomem *dpibr_addr; + +u32 dpib; +u32 lpib; bool decoupled:1; bool link_locked:1;bool link_prepared;
@@ -116,6 +125,11 @@ int snd_hdac_ext_stream_set_spib(struct hdac_ext_bus *ebus, struct hdac_ext_stream *stream, u32 value);int snd_hdac_ext_stream_get_spbmaxfifo (struct hdac_ext_bus *ebus,struct hdac_ext_stream *stream); +void snd_hdac_ext_stream_drsm_enable (struct hdac_ext_bus *ebus, +bool enable,int index); +int snd_hdac_ext_stream_set_dpibr (struct hdac_ext_bus *ebus, +struct hdac_ext_stream *stream,u32 value); +int snd_hdac_ext_stream_set_lpib (struct hdac_ext_stream *stream,u32 value);void snd_hdac_ext_link_stream_start (struct hdac_ext_stream *hstream);void snd_hdac_ext_link_stream_clear (struct hdac_ext_stream *hstream);
sound/hda/ext/hdac_ext_controller.c +6 -0
@@ -77,6 +77,12 @@ int snd_hdac_ext_bus_parse_capabilities(struct hdac_ext_bus *ebus) ebus->spbcap = bus->remap_addr + offset;break ; +case AZX_DRSM_CAP_ID : +/* DMA resume capability found, handler function */ +dev_dbg (bus->dev,"Found DRSM capability\n" ); + ebus->drsmcap = bus->remap_addr + offset; +break ; +default :dev_dbg (bus->dev,"Unknown capability %d\n" , cur_cap);break ;
sound/hda/ext/hdac_ext_stream.c +71 -0
80 lines not on this page · raw message
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ALSA: hdac: Add support for hda DMA Resume capability" to the asoc tree
The patch
ALSA: hdac: Add support for hda DMA Resume capability
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
a9c48f7f5906d02d4ec4aa50b1c20fccbce53eecMon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Fri, 18 Dec 2015 15:11:59 +0530
Subject: [PATCH] ALSA: hdac: Add support for hda DMA Resume capability
Skylake sports new capability of DMA resume, DRSM where we can resume the DMA. This capability is defined by presence of AZX_DRSM_CAP_ID.
If this capability is present, we use this capability. So we add:
snd_hdac_ext_stream_drsm_enable() - DMA resume caps snd_hdac_ext_stream_set_dpibr() - set the DMA position snd_hdac_ext_stream_set_lpib() - set the lpib
--- include/sound/hda_register.h | 9 +++++ include/sound/hdaudio_ext.h | 14 ++++++++ sound/hda/ext/hdac_ext_controller.c | 6 ++++ sound/hda/ext/hdac_ext_stream.c | 71 +++++++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+)
include/sound/hda_register.h +9 -0
@@ -230,6 +230,15 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };#define AZX_MLCTL_SPA (1<<16)#define AZX_MLCTL_CPA 23 + +/* registers for DMA Resume Capability Structure */ +#define AZX_DRSM_CAP_ID 0x5 +#define AZX_REG_DRSM_CTL 0x4 +/* Base used to calculate the iterating register offset */ +#define AZX_DRSM_BASE 0x08 +/* Interval used to calculate the iterating register offset */ +#define AZX_DRSM_INTERVAL 0x08 +/* * helpers to read the stream position */
include/sound/hdaudio_ext.h +14 -0
@@ -12,6 +12,7 @@* @spbcap: SPIB capabilities pointer * @mlcap: MultiLink capabilities pointer * @gtscap: gts capabilities pointer +* @drsmcap: dma resume capabilities pointer * @hlink_list: link list of HDA links */ struct hdac_ext_bus {
@@ -23,6 +24,7 @@ struct hdac_ext_bus {void __iomem *spbcap;void __iomem *mlcap;void __iomem *gtscap; +void __iomem *drsmcap;struct list_head hlink_list; };
@@ -72,6 +74,9 @@ enum hdac_ext_stream_type {* @pplc_addr: processing pipe link stream pointer * @spib_addr: software position in buffers stream pointer * @fifo_addr: software position Max fifos stream pointer +* @dpibr_addr: DMA position in buffer resume pointer +* @dpib: DMA position in buffer +* @lpib: Linear position in buffer * @decoupled: stream host and link is decoupled * @link_locked: link is locked * @link_prepared: link is prepared
@@ -86,6 +91,10 @@ struct hdac_ext_stream {void __iomem *spib_addr;void __iomem *fifo_addr; +void __iomem *dpibr_addr; + +u32 dpib; +u32 lpib; bool decoupled:1; bool link_locked:1;bool link_prepared;
@@ -116,6 +125,11 @@ int snd_hdac_ext_stream_set_spib(struct hdac_ext_bus *ebus, struct hdac_ext_stream *stream, u32 value);int snd_hdac_ext_stream_get_spbmaxfifo (struct hdac_ext_bus *ebus,struct hdac_ext_stream *stream); +void snd_hdac_ext_stream_drsm_enable (struct hdac_ext_bus *ebus, +bool enable,int index); +int snd_hdac_ext_stream_set_dpibr (struct hdac_ext_bus *ebus, +struct hdac_ext_stream *stream,u32 value); +int snd_hdac_ext_stream_set_lpib (struct hdac_ext_stream *stream,u32 value);void snd_hdac_ext_link_stream_start (struct hdac_ext_stream *hstream);void snd_hdac_ext_link_stream_clear (struct hdac_ext_stream *hstream);
sound/hda/ext/hdac_ext_controller.c +6 -0
@@ -77,6 +77,12 @@ int snd_hdac_ext_bus_parse_capabilities(struct hdac_ext_bus *ebus) ebus->spbcap = bus->remap_addr + offset;break ; +case AZX_DRSM_CAP_ID : +/* DMA resume capability found, handler function */ +dev_dbg (bus->dev,"Found DRSM capability\n" ); + ebus->drsmcap = bus->remap_addr + offset; +break ; +default :dev_dbg (bus->dev,"Unknown capability %d\n" , cur_cap);break ;
sound/hda/ext/hdac_ext_stream.c +71 -0
80 lines not on this page · raw message
Signature · 1 line
2.7.0.rc3
PATCH 4/14 ALSA: hdac: couple the hda DMA stream in cleanup
In reply to Vinod KoulFrom: Jeeja KP <[email protected]>
A stream is by default in coupled mode, in DSP operation we move it to decoupled mode. On cleanup HW expects that we leave it back to default state so couple the DMA on cleanup.
--- sound/hda/ext/hdac_ext_stream.c | 1 + 1 file changed, 1 insertion(+)
sound/hda/ext/hdac_ext_stream.c +1 -0
@@ -111,6 +111,7 @@ void snd_hdac_stream_free_all(struct hdac_ext_bus *ebus)while (!list_empty (&bus->stream_list)) { s = list_first_entry(&bus->stream_list, struct hdac_stream, list); stream =stream_to_hdac_ext_stream (s); +snd_hdac_ext_stream_decouple (ebus, stream, false);list_del (&s->list);kfree (stream); }
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ALSA: hdac: couple the hda DMA stream in cleanup" to the asoc tree
The patch
ALSA: hdac: couple the hda DMA stream in cleanup
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
88888155c555487037b894a97a2a4c6a8155cda0Mon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Fri, 18 Dec 2015 15:12:00 +0530
Subject: [PATCH] ALSA: hdac: couple the hda DMA stream in cleanup
A stream is by default in coupled mode, in DSP operation we move it to decoupled mode. On cleanup HW expects that we leave it back to default state so couple the DMA on cleanup.
--- sound/hda/ext/hdac_ext_stream.c | 1 + 1 file changed, 1 insertion(+)
sound/hda/ext/hdac_ext_stream.c +1 -0
@@ -111,6 +111,7 @@ void snd_hdac_stream_free_all(struct hdac_ext_bus *ebus)while (!list_empty (&bus->stream_list)) { s = list_first_entry(&bus->stream_list, struct hdac_stream, list); stream =stream_to_hdac_ext_stream (s); +snd_hdac_ext_stream_decouple (ebus, stream, false);list_del (&s->list);kfree (stream); }
Signature · 1 line
2.7.0.rc3
PATCH 5/14 ALSA: hdac: Add MISCBDCGE support
In reply to Vinod KoulFrom: Jayachandran B <[email protected]>
MISCBDCGE is a new register for Misc Backbone clock gate control which is useful to control while resetting the link and ensuring controller is in required state so add API to control it
--- include/sound/hda_register.h | 3 +++ include/sound/hdaudio_ext.h | 1 + sound/hda/ext/hdac_ext_controller.c | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+)
include/sound/hda_register.h +3 -0
@@ -96,6 +96,9 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };/* PCI space */ #define AZX_PCIREG_TCSEL 0x44 +#define AZX_PCIREG_CGCTL 0x48 +#define AZX_CGCTL_MISCBDCGE_MASK (1 << 6) +/* * other constants */
include/sound/hdaudio_ext.h +1 -0
@@ -152,6 +152,7 @@ void snd_hdac_ext_link_set_stream_id(struct hdac_ext_link *link, int stream);void snd_hdac_ext_link_clear_stream_id (struct hdac_ext_link *link,int stream); +void snd_hdac_ext_bus_enable_miscbdcge (struct device *dev,bool enable);/* update register macro */ #define snd_hdac_updatel (addr, reg, mask, val) \
sound/hda/ext/hdac_ext_controller.c +23 -0
@@ -21,6 +21,7 @@#include <linux/slab.h> #include <sound/hda_register.h> #include <sound/hdaudio_ext.h> +#include <linux/pci.h> /* * maximum HDAC capablities we should parse to avoid endless looping:
@@ -306,3 +307,25 @@ int snd_hdac_ext_bus_link_power_down_all(struct hdac_ext_bus *ebus)return 0 ; }EXPORT_SYMBOL_GPL (snd_hdac_ext_bus_link_power_down_all); + +static void update_pci_dword (struct pci_dev *pci, +unsigned int reg,u32 mask,u32 val) +{ +u32 data; + +pci_read_config_dword (pci, reg, &data); + data &= ~mask; + data |= (val & mask); +pci_write_config_dword (pci, reg, data); +} + +void snd_hdac_ext_bus_enable_miscbdcge (struct device *dev,bool enable) +{ +struct pci_dev *pci =to_pci_dev (dev); +u32 val; + + val = enable ?AZX_CGCTL_MISCBDCGE_MASK :0 ; + +update_pci_dword (pci,AZX_PCIREG_CGCTL ,AZX_CGCTL_MISCBDCGE_MASK , val); +} +EXPORT_SYMBOL_GPL (snd_hdac_ext_bus_enable_miscbdcge);
Signature · 1 line
1.9.1
Re: [PATCH 05/14] ALSA: hdac: Add MISCBDCGE support
Quoted 69 lines · Vinod Koul
From: Jayachandran B <[email protected]>
MISCBDCGE is a new register for Misc Backbone clock gate control which is useful to control while resetting the link and ensuring controller is in required state so add API to control it
Signed-off-by Jayachandran B <[email protected]>Signed-off-by Vinod Koul <[email protected]>--- include/sound/hda_register.h | 3 +++ include/sound/hdaudio_ext.h | 1 + sound/hda/ext/hdac_ext_controller.c | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+)include/sound/hda_register.h +3
-0@@ -96,6 +96,9 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };/* PCI space */ #define AZX_PCIREG_TCSEL 0x44 +#define AZX_PCIREG_CGCTL 0x48 +#define AZX_CGCTL_MISCBDCGE_MASK (1 << 6) +/* * other constants */ include/sound/hdaudio_ext.h +1
-0@@ -152,6 +152,7 @@ void snd_hdac_ext_link_set_stream_id(struct hdac_ext_link *link, int stream);void snd_hdac_ext_link_clear_stream_id (struct hdac_ext_link *link,int stream); +void snd_hdac_ext_bus_enable_miscbdcge (struct device *dev,bool enable);/* update register macro */ #define snd_hdac_updatel (addr, reg, mask, val) \sound/hda/ext/hdac_ext_controller.c +13
-0@@ -21,6 +21,7 @@#include <linux/slab.h> #include <sound/hda_register.h> #include <sound/hdaudio_ext.h> +#include <linux/pci.h> /* * maximum HDAC capablities we should parse to avoid endless looping: @@ -306,3 +307,25 @@ int snd_hdac_ext_bus_link_power_down_all(struct hdac_ext_bus *ebus)return 0 ; }EXPORT_SYMBOL_GPL (snd_hdac_ext_bus_link_power_down_all); + +static void update_pci_dword (struct pci_dev *pci, +unsigned int reg,u32 mask,u32 val) +{ +u32 data; + +pci_read_config_dword (pci, reg, &data); + data &= ~mask; + data |= (val & mask); +pci_write_config_dword (pci, reg, data); +} +
sound/hda/ext/hdac_ext_controller.c int snd_hdac_ext_bus_link_power_down_all(struct hdac_ext_bus *ebus) · line 331
Quoted 10 lines
sound/hda/ext/hdac_ext_controller.c +10
-0+void snd_hdac_ext_bus_enable_miscbdcge (struct device *dev,bool enable) +{ +struct pci_dev *pci =to_pci_dev (dev); +u32 val; + + val = enable ?AZX_CGCTL_MISCBDCGE_MASK :0 ; + +update_pci_dword (pci,AZX_PCIREG_CGCTL ,AZX_CGCTL_MISCBDCGE_MASK , val); +} +EXPORT_SYMBOL_GPL (snd_hdac_ext_bus_enable_miscbdcge);
PCI access doesn't belong in the HDA-core in general. It's over the abstraction level of HD-audio controller.
Takashi
Re: [PATCH 05/14] ALSA: hdac: Add MISCBDCGE support
Quoted 16 lines · Takashi Iwai
Quoted 16 lines
sound/hda/ext/hdac_ext_controller.c +16
-0+static void update_pci_dword (struct pci_dev *pci, +unsigned int reg,u32 mask,u32 val) +{ +u32 data; + +pci_read_config_dword (pci, reg, &data); + data &= ~mask; + data |= (val & mask); +pci_write_config_dword (pci, reg, data); +} + +void snd_hdac_ext_bus_enable_miscbdcge (struct device *dev,bool enable) +{ +struct pci_dev *pci =to_pci_dev (dev); +u32 val; +
Quoted 8 lines
sound/hda/ext/hdac_ext_controller.c int snd_hdac_ext_bus_link_power_down_all(struct hdac_ext_bus *ebus) · line 331
Quoted 5 lines
sound/hda/ext/hdac_ext_controller.c +5
-0+ val = enable ?AZX_CGCTL_MISCBDCGE_MASK :0 ; + +update_pci_dword (pci,AZX_PCIREG_CGCTL ,AZX_CGCTL_MISCBDCGE_MASK , val); +} +EXPORT_SYMBOL_GPL (snd_hdac_ext_bus_enable_miscbdcge);PCI access doesn't belong in the HDA-core in general. It's over the abstraction level of HD-audio controller.
Okay but this is part of HDA controller and I think we might be using this bit so move to core for common usage.
I can move to driver if you feel that is better approach
Signature · 1 line
~Vinod
Re: [PATCH 05/14] ALSA: hdac: Add MISCBDCGE support
Quoted 27 lines · Vinod Koul
Quoted 16 lines · Takashi Iwai
Quoted 16 lines
sound/hda/ext/hdac_ext_controller.c +16
-0+static void update_pci_dword (struct pci_dev *pci, +unsigned int reg,u32 mask,u32 val) +{ +u32 data; + +pci_read_config_dword (pci, reg, &data); + data &= ~mask; + data |= (val & mask); +pci_write_config_dword (pci, reg, data); +} + +void snd_hdac_ext_bus_enable_miscbdcge (struct device *dev,bool enable) +{ +struct pci_dev *pci =to_pci_dev (dev); +u32 val; +Quoted 8 lines
sound/hda/ext/hdac_ext_controller.c int snd_hdac_ext_bus_link_power_down_all(struct hdac_ext_bus *ebus) · line 331
Quoted 5 lines
sound/hda/ext/hdac_ext_controller.c +5
-0+ val = enable ?AZX_CGCTL_MISCBDCGE_MASK :0 ; + +update_pci_dword (pci,AZX_PCIREG_CGCTL ,AZX_CGCTL_MISCBDCGE_MASK , val); +} +EXPORT_SYMBOL_GPL (snd_hdac_ext_bus_enable_miscbdcge);PCI access doesn't belong in the HDA-core in general. It's over the abstraction level of HD-audio controller.
Quoted 2 lines
Okay but this is part of HDA controller and I think we might be using this bit so move to core for common usage.
No, PCI isn't common. Look through sound/hda directory once. sound/hda/* is the place to handle the HD-audio bus itself.
Quoted 1 line
I can move to driver if you feel that is better approach
Yes, it's better.
Takashi
A message that is not in the archive (sent off-list or not yet received): 201512120531.wHapk8nX%[email protected]
Re: [PATCH 05/14] ALSA: hdac: Add MISCBDCGE support
Quoted 15 lines · kbuild test robot
Hi Jayachandran,
[auto build test WARNING on asoc/for-next]
[also build test WARNING on next-20151211]
[cannot apply tosound/for-nextv4.4-rc4]url: https://github.com/0day-ci/linux/commits/Vinod-Koul/ASoC-Intel-Skylake-Update-to-SKL-driver/20151211-145345 base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next config: mn10300-allmodconfig (attached as .config)reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=mn10300
Quoted 5 lines
All warnings (new ones prefixed by >>):
sound/hda/ext/hdac_ext_controller.c: In function 'update_pci_dword':Quoted 1 line
Quoted 1 line
sound/hda/ext/hdac_ext_controller.c:317:7: warning: 'data' is used uninitialized in this function [-Wuninitialized]data &= ~mask;
Thanks, will fix it in v2
Signature · 1 line
~Vinod
PATCH 6/14 ALSA: hdac: Increase timeout value for link power check
In reply to Vinod KoulFrom: Jayachandran B <[email protected]>
HW recommends 180us for worst case values for link power up delay, so change the current delay value from 50 (150us) to 150 (450us)
--- sound/hda/ext/hdac_ext_controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/hda/ext/hdac_ext_controller.c +1 -1
@@ -247,7 +247,7 @@ static int check_hdac_link_power_active(struct hdac_ext_link *link, bool enable)int mask = (1 <<AZX_MLCTL_CPA );udelay (3 ); - timeout =50 ; + timeout =150 ; do { val = readl(link->ml_addr + AZX_REG_ML_LCTL);
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ALSA: hdac: Increase timeout value for link power check" to the asoc tree
The patch
ALSA: hdac: Increase timeout value for link power check
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
cf8fe58b1066cea668e030d0ab61e4b8eef8b219Mon Sep 17 00:00:00 2001
From: Jayachandran B <[email protected]>
Date: Fri, 18 Dec 2015 15:12:01 +0530
Subject: [PATCH] ALSA: hdac: Increase timeout value for link power check
HW recommends 180us for worst case values for link power up delay, so change the current delay value from 50 (150us) to 150 (450us)
--- sound/hda/ext/hdac_ext_controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/hda/ext/hdac_ext_controller.c +1 -1
@@ -246,7 +246,7 @@ static int check_hdac_link_power_active(struct hdac_ext_link *link, bool enable)int mask = (1 <<AZX_MLCTL_CPA );udelay (3 ); - timeout =50 ; + timeout =150 ; do { val = readl(link->ml_addr + AZX_REG_ML_LCTL);
Signature · 1 line
2.7.0.rc3
PATCH 7/14 ALSA: hdac: add snd_hdac_ext_bus_link_power_up_all
In reply to Vinod KoulWe have an API for powering down all links, we need a similar one for powering up links, so add for power up as well
--- include/sound/hdaudio_ext.h | 1 + sound/hda/ext/hdac_ext_controller.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+)
include/sound/hdaudio_ext.h +1 -0
@@ -147,6 +147,7 @@ struct hdac_ext_link {int snd_hdac_ext_bus_link_power_up (struct hdac_ext_link *link);int snd_hdac_ext_bus_link_power_down (struct hdac_ext_link *link); +int snd_hdac_ext_bus_link_power_up_all (struct hdac_ext_bus *ebus);int snd_hdac_ext_bus_link_power_down_all (struct hdac_ext_bus *ebus);void snd_hdac_ext_link_set_stream_id (struct hdac_ext_link *link,int stream);
sound/hda/ext/hdac_ext_controller.c +21 -0
@@ -289,6 +289,27 @@ int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *link)EXPORT_SYMBOL_GPL (snd_hdac_ext_bus_link_power_down);/** +* snd_hdac_ext_bus_link_power_up_all -power up all hda link +* @ebus: HD-audio extended bus +*/ +int snd_hdac_ext_bus_link_power_up_all (struct hdac_ext_bus *ebus) +{ +struct hdac_ext_link *hlink =NULL ; +int ret; + +list_for_each_entry (hlink, &ebus->hlink_list, list) { +snd_hdac_updatel (hlink->ml_addr, +AZX_REG_ML_LCTL ,0 ,AZX_MLCTL_SPA ); + ret =check_hdac_link_power_active (hlink, true); +if (ret <0 ) +return ret; + } + +return 0 ; +} +EXPORT_SYMBOL_GPL (snd_hdac_ext_bus_link_power_up_all); + +/** * snd_hdac_ext_bus_link_power_down_all -power down all hda link * @ebus: HD-audio extended bus */
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ALSA: hdac: add snd_hdac_ext_bus_link_power_up_all" to the asoc tree
The patch
ALSA: hdac: add snd_hdac_ext_bus_link_power_up_all
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
6706a19747eb693ff35ce140f5cbee66dcfec0c4Mon Sep 17 00:00:00 2001
From: Vinod Koul <[email protected]>
Date: Fri, 18 Dec 2015 15:12:02 +0530
Subject: [PATCH] ALSA: hdac: add snd_hdac_ext_bus_link_power_up_all
We have an API for powering down all links, we need a similar one for powering up links, so add for power up as well
--- include/sound/hdaudio_ext.h | 1 + sound/hda/ext/hdac_ext_controller.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+)
include/sound/hdaudio_ext.h +1 -0
@@ -147,6 +147,7 @@ struct hdac_ext_link {int snd_hdac_ext_bus_link_power_up (struct hdac_ext_link *link);int snd_hdac_ext_bus_link_power_down (struct hdac_ext_link *link); +int snd_hdac_ext_bus_link_power_up_all (struct hdac_ext_bus *ebus);int snd_hdac_ext_bus_link_power_down_all (struct hdac_ext_bus *ebus);void snd_hdac_ext_link_set_stream_id (struct hdac_ext_link *link,int stream);
sound/hda/ext/hdac_ext_controller.c +21 -0
@@ -288,6 +288,27 @@ int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *link)EXPORT_SYMBOL_GPL (snd_hdac_ext_bus_link_power_down);/** +* snd_hdac_ext_bus_link_power_up_all -power up all hda link +* @ebus: HD-audio extended bus +*/ +int snd_hdac_ext_bus_link_power_up_all (struct hdac_ext_bus *ebus) +{ +struct hdac_ext_link *hlink =NULL ; +int ret; + +list_for_each_entry (hlink, &ebus->hlink_list, list) { +snd_hdac_updatel (hlink->ml_addr, +AZX_REG_ML_LCTL ,0 ,AZX_MLCTL_SPA ); + ret =check_hdac_link_power_active (hlink, true); +if (ret <0 ) +return ret; + } + +return 0 ; +} +EXPORT_SYMBOL_GPL (snd_hdac_ext_bus_link_power_up_all); + +/** * snd_hdac_ext_bus_link_power_down_all -power down all hda link * @ebus: HD-audio extended bus */
Signature · 1 line
2.7.0.rc3
PATCH 8/14 ASoC: Intel: Skylake: fix reset controller sequencing
In reply to Vinod KoulFrom: Jayachandran B <[email protected]>
HW recommends that we reset with CGCTL.MISCBDCGE disabled, so add that while doing init chip and reset sequence.
--- sound/soc/intel/skylake/skl.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-)
sound/soc/intel/skylake/skl.c +21 -3
@@ -58,6 +58,22 @@ static void skl_init_pci(struct skl *skl)skl_update_pci_byte (skl->pci,AZX_PCIREG_TCSEL ,0x07 ,0 ); } +/* +* While performing reset, controller may not come back properly causing +* issues, so recommendation is to set CGCTL.MISCBDCGE to 0 then do reset +* (init chip) and then again set CGCTL.MISCBDCGE to 1 +*/ +static int skl_init_chip (struct hdac_bus *bus,bool full_reset) +{ +int ret; + +snd_hdac_ext_bus_enable_miscbdcge (bus->dev, false); + ret =snd_hdac_bus_init_chip (bus, full_reset); +snd_hdac_ext_bus_enable_miscbdcge (bus->dev, true); + +return ret; +} +/* called from IRQ */ static void skl_stream_update (struct hdac_bus *bus,struct hdac_stream *hstr) {
@@ -144,7 +160,9 @@ static int _skl_suspend(struct hdac_ext_bus *ebus)return ret;snd_hdac_bus_stop_chip (bus); +snd_hdac_ext_bus_enable_miscbdcge (bus->dev, false);snd_hdac_bus_enter_link_reset (bus); +snd_hdac_ext_bus_enable_miscbdcge (bus->dev, true);return 0 ; }
@@ -155,7 +173,7 @@ static int _skl_resume(struct hdac_ext_bus *ebus)struct hdac_bus *bus =ebus_to_hbus (ebus);skl_init_pci (skl); -snd_hdac_bus_init_chip (bus, true); +skl_init_chip (bus, true);return skl_resume_dsp (skl); }
@@ -379,7 +397,7 @@ static int skl_codec_create(struct hdac_ext_bus *ebus)* back to the sanity state. */ snd_hdac_bus_stop_chip (bus); -snd_hdac_bus_init_chip (bus, true); +skl_init_chip (bus, true); } } }
@@ -489,7 +507,7 @@ static int skl_first_init(struct hdac_ext_bus *ebus)/* initialize chip */ skl_init_pci (skl); -snd_hdac_bus_init_chip (bus, true); +skl_init_chip (bus, true);/* codec detection */ if (!bus->codec_mask) {
Signature · 1 line
1.9.1
PATCH 9/14 ASoC: Intel: Skylake: Use CGCTL.MISCBDCGE for Phrase detection notification
In reply to Vinod KoulFrom: "Dharageswari.R" <[email protected]>
Per HW recommendation, SW shall clear the CGCTL.MISCBDCGE and set it back once data is transferred. So clear this when we get the IPC and track using a driver flag, and set back on closure
--- sound/soc/intel/skylake/skl-pcm.c | 13 +++++++++++++ sound/soc/intel/skylake/skl-sst-ipc.c | 14 ++++++++++++++ sound/soc/intel/skylake/skl-sst-ipc.h | 3 +++ 3 files changed, 30 insertions(+)
sound/soc/intel/skylake/skl-pcm.c +13 -0
@@ -25,6 +25,8 @@#include <sound/soc.h> #include "skl.h" #include "skl-topology.h" +#include "skl-sst-dsp.h" +#include "skl-sst-ipc.h" #define HDA_MONO 1#define HDA_STEREO 2
@@ -272,6 +274,7 @@ static void skl_pcm_close(struct snd_pcm_substream *substream,struct hdac_ext_stream *stream =get_hdac_ext_stream (substream);struct hdac_ext_bus *ebus =dev_get_drvdata (dai->dev);struct skl_dma_params *dma_params =NULL ; +struct skl *skl =ebus_to_skl (ebus);dev_dbg (dai->dev,"%s: %s\n" , __func__, dai->name);
@@ -285,6 +288,16 @@ static void skl_pcm_close(struct snd_pcm_substream *substream,snd_soc_dai_set_dma_data (dai, substream,NULL );skl_set_suspend_active (substream, dai, false); +/* +* check if close is for "Reference Pin" and set back the +* CGCTL.MISCBDCGE if disabled by driver +*/ +if (!strncmp (dai->name,"Reference Pin" ,13 ) && + skl->skl_sst->miscbdcg_disabled) { +snd_hdac_ext_bus_enable_miscbdcge (dai->dev, true); + skl->skl_sst->miscbdcg_disabled = false; + } +kfree (dma_params); }
sound/soc/intel/skylake/skl-sst-ipc.c +14 -0
@@ -18,6 +18,7 @@#include "../common/sst-dsp-priv.h" #include "skl-sst-dsp.h" #include "skl-sst-ipc.h" +#include "sound/hdaudio_ext.h" #define IPC_IXC_STATUS_BITS 24
@@ -322,6 +323,19 @@ static int skl_ipc_process_notification(struct sst_generic_ipc *ipc,wake_up (&skl->boot_wait);break ; +case IPC_GLB_NOTIFY_PHRASE_DETECTED : +dev_dbg (ipc->dev,"***** Phrase Detected **********\n" ); + +/* +* Per HW recomendation, After phrase detection, +* clear the CGCTL.MISCBDCGE. +* +* This will be set back on stream closure +*/ +snd_hdac_ext_bus_enable_miscbdcge (ipc->dev, false); + skl->miscbdcg_disabled = true; +break ; +default :dev_err (ipc->dev,"ipc: Unhandled error msg=%x" , header.primary);
sound/soc/intel/skylake/skl-sst-ipc.h +3 -0
@@ -55,6 +55,9 @@ struct skl_sst {/* IPC messaging */ struct sst_generic_ipc ipc; + +/*Is CGCTL.MISCBDCGE disabled*/ +bool miscbdcg_disabled; };struct skl_ipc_init_instance_msg {
Signature · 1 line
1.9.1
PATCH 10/14 ASoC: Intel: Skylake: manage link power in active suspend
In reply to Vinod KoulWhen device enters active suspend, we should turn off the links as they are not in use. Similarly we need to bring back links when we exit active suspend.
--- sound/soc/intel/skylake/skl.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/intel/skylake/skl.c +2 -0
@@ -194,6 +194,7 @@ static int skl_suspend(struct device *dev)* running, we need to save the state for these and continue */ if (skl->supend_active) { +snd_hdac_ext_bus_link_power_down_all (ebus);pci_save_state (pci);pci_disable_device (pci);return 0 ;
@@ -216,6 +217,7 @@ static int skl_resume(struct device *dev)if (skl->supend_active) {pci_restore_state (pci); ret =pci_enable_device (pci); +snd_hdac_ext_bus_link_power_up_all (ebus); }else { ret =_skl_resume (ebus); }
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: manage link power in active suspend" to the asoc tree
The patch
ASoC: Intel: Skylake: manage link power in active suspend
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
c2e20cd8187cb576362e7c8ecb0b1c51eedb2686Mon Sep 17 00:00:00 2001
From: Vinod Koul <[email protected]>
Date: Fri, 18 Dec 2015 15:12:05 +0530
Subject: [PATCH] ASoC: Intel: Skylake: manage link power in active suspend
When device enters active suspend, we should turn off the links as they are not in use. Similarly we need to bring back links when we exit active suspend.
--- sound/soc/intel/skylake/skl.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/intel/skylake/skl.c +2 -0
@@ -224,6 +224,7 @@ static int skl_suspend(struct device *dev)* running, we need to save the state for these and continue */ if (skl->supend_active) { +snd_hdac_ext_bus_link_power_down_all (ebus);pci_save_state (pci);pci_disable_device (pci);return 0 ;
@@ -246,6 +247,7 @@ static int skl_resume(struct device *dev)if (skl->supend_active) {pci_restore_state (pci); ret =pci_enable_device (pci); +snd_hdac_ext_bus_link_power_up_all (ebus); }else { ret =_skl_resume (ebus); }
Signature · 1 line
2.7.0.rc3
PATCH 11/14 ASoC: Intel: Skylake: enable interrupt as wake source in active suspend
In reply to Vinod KoulFrom: Jeeja KP <[email protected]>
In active suspend, any HDA interrupt should wake the system. When device enters active suspend, we need to enable HDA controller interrupt as wake source. Similarly disable HDA controller interrupt as wake source when exiting active suspend.
--- sound/soc/intel/skylake/skl.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/soc/intel/skylake/skl.c +4 -0
@@ -188,6 +188,7 @@ static int skl_suspend(struct device *dev)struct pci_dev *pci =to_pci_dev (dev);struct hdac_ext_bus *ebus =pci_get_drvdata (pci);struct skl *skl =ebus_to_skl (ebus); +struct hdac_bus *bus =ebus_to_hbus (ebus);/* * Do not suspend if streams which are marked ignore suspend are
@@ -195,6 +196,7 @@ static int skl_suspend(struct device *dev)*/ if (skl->supend_active) {snd_hdac_ext_bus_link_power_down_all (ebus); +enable_irq_wake (bus->irq);pci_save_state (pci);pci_disable_device (pci);return 0 ;
@@ -208,6 +210,7 @@ static int skl_resume(struct device *dev)struct pci_dev *pci =to_pci_dev (dev);struct hdac_ext_bus *ebus =pci_get_drvdata (pci);struct skl *skl =ebus_to_skl (ebus); +struct hdac_bus *bus =ebus_to_hbus (ebus);int ret;/*
@@ -218,6 +221,7 @@ static int skl_resume(struct device *dev)pci_restore_state (pci); ret =pci_enable_device (pci);snd_hdac_ext_bus_link_power_up_all (ebus); +disable_irq_wake (bus->irq); }else { ret =_skl_resume (ebus); }
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: enable interrupt as wake source in active suspend" to the asoc tree
The patch
ASoC: Intel: Skylake: enable interrupt as wake source in active suspend
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
1f4956fd96c98e3fbe9a2818014cf36854398db0Mon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Fri, 18 Dec 2015 15:12:06 +0530
Subject: [PATCH] ASoC: Intel: Skylake: enable interrupt as wake source in
active suspend
In active suspend, any HDA interrupt should wake the system. When device enters active suspend, we need to enable HDA controller interrupt as wake source. Similarly disable HDA controller interrupt as wake source when exiting active suspend.
--- sound/soc/intel/skylake/skl.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/soc/intel/skylake/skl.c +4 -0
@@ -218,6 +218,7 @@ static int skl_suspend(struct device *dev)struct pci_dev *pci =to_pci_dev (dev);struct hdac_ext_bus *ebus =pci_get_drvdata (pci);struct skl *skl =ebus_to_skl (ebus); +struct hdac_bus *bus =ebus_to_hbus (ebus);/* * Do not suspend if streams which are marked ignore suspend are
@@ -225,6 +226,7 @@ static int skl_suspend(struct device *dev)*/ if (skl->supend_active) {snd_hdac_ext_bus_link_power_down_all (ebus); +enable_irq_wake (bus->irq);pci_save_state (pci);pci_disable_device (pci);return 0 ;
@@ -238,6 +240,7 @@ static int skl_resume(struct device *dev)struct pci_dev *pci =to_pci_dev (dev);struct hdac_ext_bus *ebus =pci_get_drvdata (pci);struct skl *skl =ebus_to_skl (ebus); +struct hdac_bus *bus =ebus_to_hbus (ebus);int ret;/*
@@ -248,6 +251,7 @@ static int skl_resume(struct device *dev)pci_restore_state (pci); ret =pci_enable_device (pci);snd_hdac_ext_bus_link_power_up_all (ebus); +disable_irq_wake (bus->irq); }else { ret =_skl_resume (ebus); }
Signature · 1 line
2.7.0.rc3
PATCH 12/14 ASoC: Intel: Skylake: Add DMA resume position in Trigger resume/suspend
In reply to Vinod KoulFrom: Jeeja KP <[email protected]>
Use the DMA resume capability to resume the DMA position when stream is suspended/resumed.
In suspend we save the position and when stream is resumed the stream needs to be started from the position when the stream was suspended using the new DMA resume capabilities
--- sound/soc/intel/skylake/skl-pcm.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
sound/soc/intel/skylake/skl-pcm.c +19 -1
@@ -393,6 +393,15 @@ static int skl_pcm_trigger(struct snd_pcm_substream *substream, int cmd,switch (cmd) {case SNDRV_PCM_TRIGGER_RESUME :skl_pcm_prepare (substream, dai); +/* +* enable DMA Resume enable bit for the stream, set the dpib +* & lpib position to resune before starting the DMA +*/ +snd_hdac_ext_stream_drsm_enable (ebus, true, +hdac_stream (stream)->index); +snd_hdac_ext_stream_set_dpibr (ebus, stream, stream->dpib); +snd_hdac_ext_stream_set_lpib (stream, stream->lpib); +case SNDRV_PCM_TRIGGER_START :case SNDRV_PCM_TRIGGER_PAUSE_RELEASE :/*
@@ -421,8 +430,17 @@ static int skl_pcm_trigger(struct snd_pcm_substream *substream, int cmd,return ret; ret =skl_decoupled_trigger (substream, cmd); -if (cmd ==SNDRV_PCM_TRIGGER_SUSPEND ) +if (cmd ==SNDRV_PCM_TRIGGER_SUSPEND ) { +/* save the dpib and lpib positions */ + stream->dpib =readl (ebus->bus.remap_addr + +AZX_REG_VS_SDXDPIB_XBASE + + (AZX_REG_VS_SDXDPIB_XINTERVAL * +hdac_stream (stream)->index)); + + stream->lpib =snd_hdac_stream_get_pos_lpib ( +hdac_stream (stream));snd_hdac_ext_stream_decouple (ebus, stream, false); + }break ;default :
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Add DMA resume position in Trigger resume/suspend" to the asoc tree
The patch
ASoC: Intel: Skylake: Add DMA resume position in Trigger resume/suspend
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
748a1d5a3fb75e1102320214a8bde347d7b228c3Mon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Fri, 18 Dec 2015 15:12:07 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Add DMA resume position in Trigger
resume/suspend
Use the DMA resume capability to resume the DMA position when stream is suspended/resumed.
In suspend we save the position and when stream is resumed the stream needs to be started from the position when the stream was suspended using the new DMA resume capabilities
--- sound/soc/intel/skylake/skl-pcm.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
sound/soc/intel/skylake/skl-pcm.c +19 -1
@@ -393,6 +393,15 @@ static int skl_pcm_trigger(struct snd_pcm_substream *substream, int cmd,switch (cmd) {case SNDRV_PCM_TRIGGER_RESUME :skl_pcm_prepare (substream, dai); +/* +* enable DMA Resume enable bit for the stream, set the dpib +* & lpib position to resune before starting the DMA +*/ +snd_hdac_ext_stream_drsm_enable (ebus, true, +hdac_stream (stream)->index); +snd_hdac_ext_stream_set_dpibr (ebus, stream, stream->dpib); +snd_hdac_ext_stream_set_lpib (stream, stream->lpib); +case SNDRV_PCM_TRIGGER_START :case SNDRV_PCM_TRIGGER_PAUSE_RELEASE :/*
@@ -421,8 +430,17 @@ static int skl_pcm_trigger(struct snd_pcm_substream *substream, int cmd,return ret; ret =skl_decoupled_trigger (substream, cmd); -if (cmd ==SNDRV_PCM_TRIGGER_SUSPEND ) +if (cmd ==SNDRV_PCM_TRIGGER_SUSPEND ) { +/* save the dpib and lpib positions */ + stream->dpib =readl (ebus->bus.remap_addr + +AZX_REG_VS_SDXDPIB_XBASE + + (AZX_REG_VS_SDXDPIB_XINTERVAL * +hdac_stream (stream)->index)); + + stream->lpib =snd_hdac_stream_get_pos_lpib ( +hdac_stream (stream));snd_hdac_ext_stream_decouple (ebus, stream, false); + }break ;default :
Signature · 1 line
2.7.0.rc3
PATCH 13/14 ASoC: Intel: Skylake: Reconfigure Link stream on suspend/resume
In reply to Vinod KoulFrom: Jeeja KP <[email protected]>
On suspend the link register are lost so we need to reconfigure them in resume. This patch adds the reconfiguration of the link register in trigger resume.
--- sound/soc/intel/skylake/skl-pcm.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
sound/soc/intel/skylake/skl-pcm.c +12 -10
@@ -496,11 +496,6 @@ static int skl_link_pcm_prepare(struct snd_pcm_substream *substream,struct snd_soc_dai *codec_dai = rtd->codec_dai;struct hdac_ext_link *link; -if (link_dev->link_prepared) { -dev_dbg (dai->dev,"already stream is prepared - returning\n" ); -return 0 ; - } - dma_params = (struct skl_dma_params *)snd_soc_dai_get_dma_data (codec_dai, substream);if (dma_params)
@@ -508,14 +503,15 @@ static int skl_link_pcm_prepare(struct snd_pcm_substream *substream,dev_dbg (dai->dev,"stream_tag=%d formatvalue=%d codec_dai_name=%s\n" ,hdac_stream (link_dev)->stream_tag, format_val, codec_dai->name); -snd_hdac_ext_link_stream_reset (link_dev); - -snd_hdac_ext_link_stream_setup (link_dev, format_val); - link =snd_hdac_ext_bus_get_link (ebus, rtd->codec->component.name);if (!link)return -EINVAL ; +snd_hdac_ext_bus_link_power_up (link); +snd_hdac_ext_link_stream_reset (link_dev); + +snd_hdac_ext_link_stream_setup (link_dev, format_val); +snd_hdac_ext_link_set_stream_id (link,hdac_stream (link_dev)->stream_tag); link_dev->link_prepared =1 ;
@@ -527,12 +523,16 @@ static int skl_link_pcm_trigger(struct snd_pcm_substream *substream, {struct hdac_ext_stream *link_dev =snd_soc_dai_get_dma_data (dai, substream); +struct hdac_ext_bus *ebus =get_bus_ctx (substream); +struct hdac_ext_stream *stream =get_hdac_ext_stream (substream);dev_dbg (dai->dev,"In %s cmd=%d\n" , __func__, cmd);switch (cmd) { +case SNDRV_PCM_TRIGGER_RESUME : +skl_link_pcm_prepare (substream, dai);case SNDRV_PCM_TRIGGER_START :case SNDRV_PCM_TRIGGER_PAUSE_RELEASE : -case SNDRV_PCM_TRIGGER_RESUME : +snd_hdac_ext_stream_decouple (ebus, stream, true);snd_hdac_ext_link_stream_start (link_dev);break ;
@@ -540,6 +540,8 @@ static int skl_link_pcm_trigger(struct snd_pcm_substream *substream,case SNDRV_PCM_TRIGGER_SUSPEND :case SNDRV_PCM_TRIGGER_STOP :snd_hdac_ext_link_stream_clear (link_dev); +if (cmd ==SNDRV_PCM_TRIGGER_SUSPEND ) +snd_hdac_ext_stream_decouple (ebus, stream, false);break ;default :
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Reconfigure Link stream on suspend/resume" to the asoc tree
The patch
ASoC: Intel: Skylake: Reconfigure Link stream on suspend/resume
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
920982c93c26a9a94d1e90221953a2ce16e91c0bMon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Fri, 18 Dec 2015 15:12:08 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Reconfigure Link stream on
suspend/resume
On suspend the link register are lost so we need to reconfigure them in resume. This patch adds the reconfiguration of the link register in trigger resume.
--- sound/soc/intel/skylake/skl-pcm.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
sound/soc/intel/skylake/skl-pcm.c +12 -10
@@ -496,11 +496,6 @@ static int skl_link_pcm_prepare(struct snd_pcm_substream *substream,struct snd_soc_dai *codec_dai = rtd->codec_dai;struct hdac_ext_link *link; -if (link_dev->link_prepared) { -dev_dbg (dai->dev,"already stream is prepared - returning\n" ); -return 0 ; - } - dma_params = (struct skl_dma_params *)snd_soc_dai_get_dma_data (codec_dai, substream);if (dma_params)
@@ -508,14 +503,15 @@ static int skl_link_pcm_prepare(struct snd_pcm_substream *substream,dev_dbg (dai->dev,"stream_tag=%d formatvalue=%d codec_dai_name=%s\n" ,hdac_stream (link_dev)->stream_tag, format_val, codec_dai->name); -snd_hdac_ext_link_stream_reset (link_dev); - -snd_hdac_ext_link_stream_setup (link_dev, format_val); - link =snd_hdac_ext_bus_get_link (ebus, rtd->codec->component.name);if (!link)return -EINVAL ; +snd_hdac_ext_bus_link_power_up (link); +snd_hdac_ext_link_stream_reset (link_dev); + +snd_hdac_ext_link_stream_setup (link_dev, format_val); +snd_hdac_ext_link_set_stream_id (link,hdac_stream (link_dev)->stream_tag); link_dev->link_prepared =1 ;
@@ -527,12 +523,16 @@ static int skl_link_pcm_trigger(struct snd_pcm_substream *substream, {struct hdac_ext_stream *link_dev =snd_soc_dai_get_dma_data (dai, substream); +struct hdac_ext_bus *ebus =get_bus_ctx (substream); +struct hdac_ext_stream *stream =get_hdac_ext_stream (substream);dev_dbg (dai->dev,"In %s cmd=%d\n" , __func__, cmd);switch (cmd) { +case SNDRV_PCM_TRIGGER_RESUME : +skl_link_pcm_prepare (substream, dai);case SNDRV_PCM_TRIGGER_START :case SNDRV_PCM_TRIGGER_PAUSE_RELEASE : -case SNDRV_PCM_TRIGGER_RESUME : +snd_hdac_ext_stream_decouple (ebus, stream, true);snd_hdac_ext_link_stream_start (link_dev);break ;
@@ -540,6 +540,8 @@ static int skl_link_pcm_trigger(struct snd_pcm_substream *substream,case SNDRV_PCM_TRIGGER_SUSPEND :case SNDRV_PCM_TRIGGER_STOP :snd_hdac_ext_link_stream_clear (link_dev); +if (cmd ==SNDRV_PCM_TRIGGER_SUSPEND ) +snd_hdac_ext_stream_decouple (ebus, stream, false);break ;default :
Signature · 1 line
2.7.0.rc3
PATCH 14/14 ASoC: Intel: Skylake: Add Resume capability in PCM info.
In reply to Vinod KoulFrom: Jeeja KP <[email protected]>
Now that we can restore back the DMA registers and also the link add this capability in driver for PCM resume
--- sound/soc/intel/skylake/skl-pcm.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/intel/skylake/skl-pcm.c +1 -0
@@ -38,6 +38,7 @@ static struct snd_pcm_hardware azx_pcm_hw = {SNDRV_PCM_INFO_BLOCK_TRANSFER |SNDRV_PCM_INFO_MMAP_VALID |SNDRV_PCM_INFO_PAUSE | +SNDRV_PCM_INFO_RESUME |SNDRV_PCM_INFO_SYNC_START |SNDRV_PCM_INFO_HAS_WALL_CLOCK |/* legacy */ SNDRV_PCM_INFO_HAS_LINK_ATIME |
Signature · 1 line
1.9.1