[PATCH] ASoC: mediatek: Turn AFE on/off in runtime resume/suspend

2015-12-21 Thread Koro Chen
AFE is actually allowed to be turn on before configuration of DAIs since each DAI has its own enabling control. Turn on/off AFE in runtime resume/suspend to avoid AFE being shut down when closing a DAI while other DAIs are still active. Signed-off-by: Koro Chen --- sound/soc/mediatek/mtk-afe

[RFC PATCH] ASoC: dpcm: Apply symmetry for DPCM

2015-12-10 Thread Koro Chen
support it. soc_pcm_params_symmetry() will return error and the second stream stops. This patch adds soc_pcm_apply_symmetry() for FE, BE, and codec DAIs in DPCM path that was skipped in soc_pcm_open(). Signed-off-by: PC Liao Signed-off-by: Koro Chen --- sound/soc/soc-pcm.c | 57

Re: [alsa-devel] [PATCH] ASoC: mediatek: Use current HW pointer for pointer callback

2015-12-03 Thread Koro Chen
On Thu, 2015-12-03 at 12:07 +0100, Takashi Iwai wrote: > On Thu, 03 Dec 2015 12:01:58 +0100, > Mark Brown wrote: > > > > On Thu, Dec 03, 2015 at 10:41:38AM +0100, Takashi Iwai wrote: > > > > > While reading this patch, I wondered how regmap can be used safely in > > > an irq-disabled context. Ma

[PATCH] ASoC: mediatek: Use current HW pointer for pointer callback

2015-12-02 Thread Koro Chen
r and also hw_ptr in struct mtk_afe_memif used to record that, and let pointer callback reports current HW pointer instead. Signed-off-by: Koro Chen --- sound/soc/mediatek/mtk-afe-common.h |1 - sound/soc/mediatek/mtk-afe-pcm.c| 22 +++--- 2 files changed, 11 inserti

[PATCH] ASoC: mediatek: Move 22M/24M clock control into I2S ops

2015-11-09 Thread Koro Chen
22M/24M clocks are only required for I2S, so move the control to I2S DAI ops. Signed-off-by: Koro Chen --- sound/soc/mediatek/mtk-afe-pcm.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sound/soc/mediatek/mtk-afe-pcm.c b/sound/soc/mediatek/mtk-afe-pcm.c

[PATCH] ASoC: dpcm: Make BE prepare possible in suspend state

2015-10-27 Thread Koro Chen
her suspend comes, a NULL pointer dereference will happen in snd_pcm_suspend() when accessing BE substream's runtime. Signed-off-by: Koro Chen --- sound/soc/soc-pcm.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index

Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components

2015-10-15 Thread Koro Chen
On Thu, 2015-10-15 at 15:26 +0200, Lars-Peter Clausen wrote: > On 10/15/2015 02:10 PM, Mark Brown wrote: > > On Wed, Oct 14, 2015 at 11:00:01AM +0200, Lars-Peter Clausen wrote: > > > >> It was never intended that it is possible to bind a component to multiple > >> cards. That it was possible was a

Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components

2015-10-15 Thread Koro Chen
On Thu, 2015-10-15 at 13:10 +0100, Mark Brown wrote: > On Wed, Oct 14, 2015 at 11:00:01AM +0200, Lars-Peter Clausen wrote: > > > It was never intended that it is possible to bind a component to multiple > > cards. That it was possible was a bug that was overlooked and some people > > tried to do i

Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components

2015-10-13 Thread Koro Chen
On Tue, 2015-10-13 at 16:42 +0200, Lars-Peter Clausen wrote: > On 10/13/2015 04:18 PM, Koro Chen wrote: > > On Tue, 2015-10-13 at 15:44 +0200, Lars-Peter Clausen wrote: > >> On 10/13/2015 03:37 PM, Koro Chen wrote: > >>> The patch "ASoC: Prevent components

Re: [alsa-devel] [RFC PATCH] ASoC: Modify check condition of multiple bindings of components

2015-10-13 Thread Koro Chen
On Tue, 2015-10-13 at 15:44 +0200, Lars-Peter Clausen wrote: > On 10/13/2015 03:37 PM, Koro Chen wrote: > > The patch "ASoC: Prevent components from being bound to multiple cards" > > adds check to prevent multiple cards from using the same component. > > However,

[RFC PATCH] ASoC: Modify check condition of multiple bindings of components

2015-10-13 Thread Koro Chen
ster_platform() or snd_soc_register_codec(). Signed-off-by: Koro Chen --- sound/soc/soc-core.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 42575b0..eca169a 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1

Re: [PATCH] ASoC: mediatek: Increase periods_min in capture

2015-09-23 Thread Koro Chen
On Wed, 2015-09-23 at 09:12 -0700, Mark Brown wrote: > On Wed, Sep 23, 2015 at 06:03:19PM +0800, Koro Chen wrote: > > Any suggestion for this patch? > > > > On Mon, 2015-09-14 at 14:51 +0800, Koro Chen wrote: > > > In capture, there is chance that hw_ptr reported at

Re: [PATCH] ASoC: mediatek: Increase periods_min in capture

2015-09-23 Thread Koro Chen
Any suggestion for this patch? On Mon, 2015-09-14 at 14:51 +0800, Koro Chen wrote: > In capture, there is chance that hw_ptr reported at IRQ is > a little smaller than period_size due to internal AFE buffer. > In the case of ping-pong buffer: > > |x

[PATCH] ASoC: mediatek: Increase periods_min in capture

2015-09-13 Thread Koro Chen
not be read since its size is smaller than avail_min (which is period_size by default), and read thread continues to sleep. If the next hw_ptr is just a little larger than buffer_size, overrun occurs. One more period can hold the possible unread buffer. Signed-off-by: Koro Chen --- sound/

[PATCH] ASoC: mediatek: Remove AIF widgets for backend DAIs

2015-08-17 Thread Koro Chen
"ASoC: dapm: Add new widgets to the end of the widget list") the first created widget (by snd_soc_dapm_new_controls) is used, not the 2nd created one (by snd_soc_dapm_new_dai_widgets), so audio path is broken. Signed-off-by: Koro Chen --- sound/soc/mediatek/mtk-afe-pcm.c | 11 ---

[PATCH] ASoC: mediatek: Add suspend/resume callbacks

2015-07-22 Thread Koro Chen
are defined in a backup list array. Signed-off-by: Koro Chen --- sound/soc/mediatek/mtk-afe-common.h | 8 sound/soc/mediatek/mtk-afe-pcm.c| 77 + 2 files changed, 77 insertions(+), 8 deletions(-) diff --git a/sound/soc/mediatek/mtk-afe-common.h b

[PATCH v2 1/2] ASoC: rt5645: Fix missing free_irq

2015-07-16 Thread Koro Chen
The driver does not free irq when snd_soc_register_codec returns error. It does not return error when request irq failed, either. Add return when request irq failed, and free_irq if snd_soc_register_codec failed. Signed-off-by: Koro Chen --- Change since v1: - use free_irq instead of

[PATCH v2 2/2] ASoC: rt5645: Add regulator support

2015-07-16 Thread Koro Chen
This adds basic regulator support for rt5645. Signed-off-by: Koro Chen --- Change since v1: - none --- sound/soc/codecs/rt5645.c | 61 --- sound/soc/codecs/rt5645.h | 26 2 files changed, 58 insertions(+), 29 deletions(-) diff

Re: [PATCH v2] arm64: dts: mt8173: Add afe device node

2015-07-13 Thread Koro Chen
On Thu, 2015-07-09 at 18:45 +0800, Daniel Kurtz wrote: > On Thu, Jul 9, 2015 at 11:32 AM, Koro Chen wrote: > > This adds afe (audio front end) device node to the MT8173 dtsi file. > > > > Signed-off-by: Koro Chen > > Reviewed-by: Daniel Kurtz > > I believe

Re: [PATCH 2/2] ASoC: Drop owner assignment from platform_driver

2015-07-12 Thread Koro Chen
On Fri, 2015-07-10 at 14:30 +0900, Krzysztof Kozlowski wrote: > platform_driver does not need to set an owner because > platform_driver_register() will set it. > > Signed-off-by: Krzysztof Kozlowski > Acked-by: Koro Chen Thank you! -- To unsubscribe from this list

Re: [PATCH 1/2] ASoC: rt5645: Fix missing free_irq

2015-07-10 Thread Koro Chen
On Thu, 2015-07-09 at 12:10 +0100, Mark Brown wrote: > On Thu, Jul 09, 2015 at 09:48:13AM +0800, Koro Chen wrote: > > > Do you think I should use devm_request_threaded_irq(), and change > > free_irq to devm_free_irq in remove? Or I should keep the original > > request_thre

[PATCH v2] arm64: dts: mt8173: Add afe device node

2015-07-08 Thread Koro Chen
This adds afe (audio front end) device node to the MT8173 dtsi file. Signed-off-by: Koro Chen --- This patch is based on Matthias's tree: https://github.com/mbgg/linux-mediatek branch: v4.2-next/arm64 Changes since v1: - change node name to afe: audio-controller@1122 --- arch/arm64

[PATCH] ASoC: mediatek: Use platform_of_node for machine drivers

2015-07-08 Thread Koro Chen
This replaces the platform_name in snd_soc_dai_link by device tree node. Signed-off-by: Koro Chen --- .../devicetree/bindings/sound/mt8173-max98090.txt | 2 ++ .../bindings/sound/mt8173-rt5650-rt5676.txt | 2 ++ sound/soc/mediatek/mt8173-max98090.c | 17

Re: [PATCH 1/2] ASoC: rt5645: Fix missing free_irq

2015-07-08 Thread Koro Chen
On Wed, 2015-07-08 at 12:14 +0100, Mark Brown wrote: > On Wed, Jul 08, 2015 at 04:25:50PM +0800, Koro Chen wrote: > > > The driver does not free irq if snd_soc_register_codec fails. > > It does not return error when request irq failed, either. > > Fix this by using d

[PATCH 2/2] ASoC: rt5645: Add regulator support

2015-07-08 Thread Koro Chen
This adds basic regulator support for rt5645. Signed-off-by: Koro Chen --- sound/soc/codecs/rt5645.c | 71 +++ sound/soc/codecs/rt5645.h | 26 - 2 files changed, 66 insertions(+), 31 deletions(-) diff --git a/sound/soc/codecs/rt5645.c

[PATCH 1/2] ASoC: rt5645: Fix missing free_irq

2015-07-08 Thread Koro Chen
The driver does not free irq if snd_soc_register_codec fails. It does not return error when request irq failed, either. Fix this by using devm_request_threaded_irq(), and returns when error. Signed-off-by: Koro Chen --- sound/soc/codecs/rt5645.c | 15 --- 1 file changed, 8

Re: [PATCH] arm64: dts: mt8173: Add afe device node

2015-07-07 Thread Koro Chen
On Tue, 2015-07-07 at 09:46 +0200, Matthias Brugger wrote: > On Monday, July 06, 2015 09:02:38 PM Daniel Kurtz wrote: > > On Mon, Jul 6, 2015 at 2:52 PM, Koro Chen wrote: > > > This adds afe (audio front end) device node to the MT8173 dtsi file. > > > > > > Th

[PATCH] arm64: dts: mt8173: Add afe device node

2015-07-06 Thread Koro Chen
This adds afe (audio front end) device node to the MT8173 dtsi file. This patch is based on Matthias's tree: https://github.com/mbgg/linux-mediatek branch: v4.2-next/arm64 Signed-off-by: Koro Chen --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 32 1

[PATCH] ASoC: dpcm: Add checks of playback/capture before dpcm_get_be

2015-07-05 Thread Koro Chen
tion does not match the stream type. Signed-off-by: Koro Chen --- sound/soc/soc-pcm.c | 5 + 1 file changed, 5 insertions(+) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 256b9c9..a6d3313 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1306,7 +1306,12

[PATCH] ASoC: mediatek: Fix unbalanced calls to runtime suspend/resume

2015-06-23 Thread Koro Chen
This adds call to runtime suspend in dev remove. It fixs the problem that suspend is not called in the case of CONFIG_PM=n. It also fixs build warning when CONFIG_PM=n. Signed-off-by: Koro Chen --- sound/soc/mediatek/mtk-afe-pcm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc

[PATCH v2 0/3] ASoC: Mediatek: Add support for MT8173 SOC

2015-06-15 Thread Koro Chen
This adds basic support for the Mediatek AFE (Audio Front End) unit of MT8173. This patch is based on Linux 4.1-rc1 and Sascha's SCPSYS power patch [1]. The AFE unit comprises several memory interfaces that communicate with CPU, a multi input multi output digital audio interconnect, and several

[PATCH v2 1/3] ASoC: mediatek: Add AFE platform driver

2015-06-15 Thread Koro Chen
This is the DPCM based platform driver of AFE (Audio Front End) unit. Signed-off-by: Sascha Hauer Signed-off-by: Koro Chen --- .../devicetree/bindings/sound/mtk-afe-pcm.txt | 45 + sound/soc/Kconfig |1 + sound/soc/Makefile

[PATCH v2 2/3] ASoC: mediatek: Add machine driver for MAX98090 codec

2015-06-15 Thread Koro Chen
This is the DPCM based machine driver with MAX98090 Signed-off-by: Koro Chen --- .../devicetree/bindings/sound/mt8173-max98090.txt | 13 ++ sound/soc/mediatek/Kconfig | 10 + sound/soc/mediatek/Makefile| 2 + sound/soc/mediatek/mt8173

[PATCH v2 3/3] ASoC: mediatek: Add machine driver for rt5650 rt5676 codec

2015-06-15 Thread Koro Chen
This is the DPCM based machine driver with rt5650 and rt5676 Signed-off-by: Nicolas Boichat Signed-off-by: Koro Chen --- .../bindings/sound/mt8173-rt5650-rt5676.txt| 13 + sound/soc/mediatek/Kconfig | 11 + sound/soc/mediatek/Makefile

Re: [PATCH 2/3] ASoC: mediatek: Add machine driver for MAX98090 codec

2015-06-14 Thread Koro Chen
On Fri, 2015-06-12 at 14:13 +0100, Mark Brown wrote: > On Wed, Jun 10, 2015 at 10:24:35PM +0800, Koro Chen wrote: > > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/sound/mt8173-max98090.txt > > @@ -0,0 +1,17 @@ > > +MT8173 with MAX98090 CODEC

Re: [PATCH 1/3] ASoC: mediatek: Add AFE platform driver

2015-06-14 Thread Koro Chen
On Fri, 2015-06-12 at 14:06 +0100, Mark Brown wrote: > On Wed, Jun 10, 2015 at 10:24:34PM +0800, Koro Chen wrote: > > This is the DPCM based platform driver of AFE (Audio Front End) unit. > > > > Signed-off-by: Koro Chen > > Signed-off-by: Sascha Hauer > > Your

Re: [alsa-devel] [PATCH 1/3] ASoC: mediatek: Add AFE platform driver

2015-06-12 Thread Koro Chen
On Fri, 2015-06-12 at 09:37 +0200, Paul Bolle wrote: > On Fri, 2015-06-12 at 09:55 +0800, Koro Chen wrote: > > On Thu, 2015-06-11 at 09:03 +0200, Paul Bolle wrote: > > > (What does negating a bool twice do?) > > > > > Because bool actually can be unsigne

Re: [alsa-devel] [PATCH 1/3] ASoC: mediatek: Add AFE platform driver

2015-06-11 Thread Koro Chen
On Thu, 2015-06-11 at 09:03 +0200, Paul Bolle wrote: > On Wed, 2015-06-10 at 22:24 +0800, Koro Chen wrote: > > --- /dev/null > > +++ b/sound/soc/mediatek/Kconfig > > > +config SND_SOC_MEDIATEK > > + bool "ASoC support for Mediatek chip" >

[PATCH 3/3] ASoC: mediatek: Add machine driver for rt5650 rt5676 codec

2015-06-10 Thread Koro Chen
This is the DPCM based machine driver with rt5650 and rt5676 Signed-off-by: Koro Chen Signed-off-by: Nicolas Boichat --- .../bindings/sound/mt8173-rt5650-rt5676.txt| 15 ++ sound/soc/mediatek/Kconfig | 12 + sound/soc/mediatek/Makefile

[PATCH 2/3] ASoC: mediatek: Add machine driver for MAX98090 codec

2015-06-10 Thread Koro Chen
This is the DPCM based machine driver with MAX98090 Signed-off-by: Koro Chen --- .../devicetree/bindings/sound/mt8173-max98090.txt | 17 ++ sound/soc/mediatek/Kconfig | 11 + sound/soc/mediatek/Makefile| 2 + sound/soc/mediatek/mt8173

[PATCH 1/3] ASoC: mediatek: Add AFE platform driver

2015-06-10 Thread Koro Chen
This is the DPCM based platform driver of AFE (Audio Front End) unit. Signed-off-by: Koro Chen Signed-off-by: Sascha Hauer --- .../devicetree/bindings/sound/mtk-afe-pcm.txt | 45 + sound/soc/Kconfig |1 + sound/soc/Makefile

[PATCH 0/3] ASoC: Mediatek: Add support for MT8173 SoC

2015-06-10 Thread Koro Chen
This adds basic support for the Mediatek AFE (Audio Front End) unit for MT8173. This patch is based on Linux 4.1-rc1 and Sascha's SCPSYS power patch [1]. The AFE unit comprises several memory interfaces that communicate with CPU, a multi input multi output digital audio interconnect, and several e

[RFC PATCH] ALSA: pcm: Modify double acknowledged interrupts check condition

2015-05-13 Thread Koro Chen
: Koro Chen --- sound/core/pcm_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index ac6b33f..7d45645 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -339,7 +339,7 @@ static int snd_pcm_update_hw_ptr0(struct

[PATCH] ASoC: dapm: Modify widget stream name according to prefix

2015-05-10 Thread Koro Chen
hould also add prefix for stream name Signed-off-by: Koro Chen --- sound/soc/soc-dapm.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index defe0f0..158204d 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c

Re: [RESEND RFC PATCH 1/3] ASoC: mediatek: Add binding support for AFE driver

2015-05-03 Thread Koro Chen
On Thu, 2015-04-30 at 21:12 +0100, Mark Brown wrote: > On Wed, Apr 22, 2015 at 11:17:20AM +0800, Koro Chen wrote: > > > If using DPCM, it seems the most suitable FE DAIs will be memif, and > > external interface like I2S should be BE DAIs. Do you think it is > > suitabl

Re: [RESEND RFC PATCH 1/3] ASoC: mediatek: Add binding support for AFE driver

2015-04-21 Thread Koro Chen
On Mon, 2015-04-20 at 21:48 +0100, Mark Brown wrote: > On Mon, Apr 20, 2015 at 06:37:47AM +0200, Sascha Hauer wrote: > > On Sat, Apr 18, 2015 at 06:34:07PM +0100, Mark Brown wrote: > > > On Fri, Apr 10, 2015 at 04:14:07PM +0800, Koro Chen wrote: > > > > > +Each e

Re: [RESEND RFC PATCH 1/3] ASoC: mediatek: Add binding support for AFE driver

2015-04-21 Thread Koro Chen
r 10, 2015 at 04:14:07PM +0800, Koro Chen wrote: > > > > > > > +Each external interface (called "IO" in this driver) is presented as > > > > > a > > > > > +DAI to ASoC. An IO must be connected via the interconnect to a memif. > &g

Re: [RESEND RFC PATCH 3/3] ASoC: mediatek: Add AFE platform driver

2015-04-20 Thread Koro Chen
On Mon, 2015-04-20 at 21:55 +0100, Mark Brown wrote: > On Mon, Apr 20, 2015 at 02:22:24PM +0800, Koro Chen wrote: > > On Sat, 2015-04-18 at 18:51 +0100, Mark Brown wrote: > > > On Fri, Apr 10, 2015 at 04:14:09PM +0800, Koro Chen wrote: > > > > Ah, so the SRAM is d

Re: [RESEND RFC PATCH 3/3] ASoC: mediatek: Add AFE platform driver

2015-04-19 Thread Koro Chen
On Sat, 2015-04-18 at 18:51 +0100, Mark Brown wrote: > On Fri, Apr 10, 2015 at 04:14:09PM +0800, Koro Chen wrote: > > > + if (memif->use_sram) { > > + struct snd_dma_buffer *dma_buf = &substream->dma_buffer; > > + int