ASoC: Intel: Add KeemBay ASoC driver
Subsystems (4)
v2 cover ASoC: Intel: Add KeemBay ASoC driver
The below series of patches support the KeemBay ASoC driver.
It enabled the tlv320aic3204 machine driver and the platform driver initialize the i2s to capture and playback the pcm data on the ARM. The i2s is running in polling mode.
There is no DSP in the KeemBay SoC. Users are rely on the Gstreamer plugin to perform some Audio preprocessing.
Change History:
v2:
- Corrected I2S naming for DT binding.
v1:
- Initial version.
Sia Jee Heng (4):
ASoC: Intel: Add KeemBay platform driver
ASoC: Intel: Boards: Add KeemBay machine driver
ASoC: Intel: Add makefiles and kconfig changes for KeemBay
dt-bindings: sound: Add documentation for KeemBay sound card and i2s
.../bindings/sound/intel,keembay-i2s.yaml | 57 ++ .../bindings/sound/intel,keembay-sound-card.yaml | 30 + sound/soc/intel/Kconfig | 7 + sound/soc/intel/Makefile | 1 + sound/soc/intel/boards/Kconfig | 15 + sound/soc/intel/boards/Makefile | 4 + sound/soc/intel/boards/kmb_tlv3204.c | 144 ++++ sound/soc/intel/keembay/Makefile | 4 + sound/soc/intel/keembay/kmb_platform.c | 746 +++++++++++++++++++++ sound/soc/intel/keembay/kmb_platform.h | 145 ++++ 10 files changed, 1153 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/intel,keembay-i2s.yaml create mode 100644 Documentation/devicetree/bindings/sound/intel,keembay-sound-card.yaml create mode 100644 sound/soc/intel/boards/kmb_tlv3204.c create mode 100644 sound/soc/intel/keembay/Makefile create mode 100644 sound/soc/intel/keembay/kmb_platform.c create mode 100644 sound/soc/intel/keembay/kmb_platform.h
Signature · 1 line
1.9.1
PATCH v2 1/4 ASoC: Intel: Add KeemBay platform driver
Add KeemBay ASoC platform driver which initialize the i2s controller and uses i2s to capture and transmit pcm data to external codec. The i2s is running in polling mode.
--- sound/soc/intel/keembay/Makefile | 4 + sound/soc/intel/keembay/kmb_platform.c | 746 +++++++++++++++++++++++++++++++++ sound/soc/intel/keembay/kmb_platform.h | 145 +++++++ 3 files changed, 895 insertions(+) create mode 100644 sound/soc/intel/keembay/Makefile create mode 100644 sound/soc/intel/keembay/kmb_platform.c create mode 100644 sound/soc/intel/keembay/kmb_platform.h
sound/soc/intel/keembay/Makefile new file +4 -0
@@ -0,0 +1,4 @@ +snd-soc-kmb_platform-objs := \ + kmb_platform.o + +obj-$(CONFIG_SND_SOC_INTEL_KEEMBAY) += snd-soc-kmb_platform.o
sound/soc/intel/keembay/kmb_platform.c new file +746 -0
746 lines not on this page · raw message
sound/soc/intel/keembay/kmb_platform.h new file +145 -0
145 lines not on this page · raw message
Signature · 1 line
1.9.1
Mark Brown
maintainerRe: [PATCH v2 1/4] ASoC: Intel: Add KeemBay platform driver
sound/soc/intel/keembay/kmb_platform.c line 5
Quoted 7 lines · Sia Jee Heng
+++
b/sound/soc/intel/keembay/kmb_platform.csound/soc/intel/keembay/kmb_platform.c new file +5
-0@@ -0,0 +1,746 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* +* Intel KeemBay Platform driver +* +* Copyright (C) 2020 Intel Corporation.
Please keep the entire header C++ style so things look more consistent.
sound/soc/intel/keembay/kmb_platform.c line 182
Quoted 1 line
sound/soc/intel/keembay/kmb_platform.c new file +1
-0+static void pcm_operation (struct kmb_i2s_info *kmb_i2s,bool playback)
Please namespace this function, it looks like a core ALSA call. It'd probably be better to namespace a bunch of the other functions called i2s_ as well.
Quoted 4 lines
sound/soc/intel/keembay/kmb_platform.c new file +4
-0+static inline void i2s_irq_trigger (struct kmb_i2s_info *kmb_i2s,u32 stream, +int chan_nr,bool trigger) +{ +u32 i, irq;
sound/soc/intel/keembay/kmb_platform.c line 177
Quoted 10 lines
sound/soc/intel/keembay/kmb_platform.c new file +10
-0+u32 flag; + +if (stream ==SNDRV_PCM_STREAM_PLAYBACK ) + flag =TX_INT_FLAG ; +else + flag =RX_INT_FLAG ; + +for (i =0 ; i < chan_nr /2 ; i++) { + irq =readl (kmb_i2s->i2s_base +IMR (i)); + irq = trigger ? irq & ~flag : irq | flag;
Please write this as a normal if statement to improve legibility.
Quoted 4 lines
sound/soc/intel/keembay/kmb_platform.c new file +4
-0+static int kmb_configure_dai_by_dt (struct kmb_i2s_info *kmb_i2s, +struct snd_soc_dai_driver *kmb_i2s_dai) +{ +u32 comp1 =readl (kmb_i2s->i2s_base +I2S_COMP_PARAM_1 );
sound/soc/intel/keembay/kmb_platform.c line 602
Quoted 10 lines
sound/soc/intel/keembay/kmb_platform.c new file +10
-0+ +if (COMP1_TX_ENABLED (comp1)) + kmb_i2s->capability |=DWC_I2S_PLAY ; + +if (COMP1_RX_ENABLED (comp1)) + kmb_i2s->capability |=DWC_I2S_RECORD ; + +return kmb_configure_dai (kmb_i2s, kmb_i2s_dai, +I2S_SAMPLE_RATES ); +}
This isn't actually reading the DT?
sound/soc/intel/keembay/kmb_platform.c line 607
Quoted 4 lines
sound/soc/intel/keembay/kmb_platform.c new file +4
-0+static void kmb_disable_clk (void *data) +{ +clk_disable_unprepare (data); +}
This function doesn't seem to be adding anything?
sound/soc/intel/keembay/kmb_platform.c line 672
Quoted 9 lines
sound/soc/intel/keembay/kmb_platform.c new file +9
-0+ ret =of_property_read_string (dev->of_node,"mode" , &i2s_mode); +if (ret <0 ) { +dev_err (dev,"Couldn't find the entry\n" ); +return -EINVAL ; + } + +dev_dbg (kmb_i2s->dev,"Mode = %s" , i2s_mode); + + ret =match_string (i2s_mode_name,ARRAY_SIZE (i2s_mode_name), i2s_mode);
This property isn't defined in the DT binding and should be configured by the machine driver through a set_fmt() operation anyway.
RE: [PATCH v2 1/4] ASoC: Intel: Add KeemBay platform driver
-----Original Message-----
From: Mark Brown <[email protected]>
Sent: Tuesday, May 19, 2020 1:07 AM
To: Sia, Jee Heng <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2 1/4] ASoC: Intel: Add KeemBay platform driver
sound/soc/intel/keembay/kmb_platform.c line 5
Quoted 7 lines · Sia Jee Heng
+++
b/sound/soc/intel/keembay/kmb_platform.csound/soc/intel/keembay/kmb_platform.c new file +5
-0@@ -0,0 +1,746 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* +* Intel KeemBay Platform driver +* +* Copyright (C) 2020 Intel Corporation.
Please keep the entire header C++ style so things look more consistent. [>>] Will below format meet the C++ style?
[>>] // SPDX-License-Identifier: GPL-2.0-only
[>>] // Copyright (C) 2020 Intel Corporation.
[>>] /*
[>>] * Intel KeemBay Platform driver
[>>] */
Review line 7
Quoted 2 lines
(quoted diff) +2
-0+static void pcm_operation(struct kmb_i2s_info *kmb_i2s, bool +playback)
Please namespace this function, it looks like a core ALSA call. It'd probably be better to namespace a bunch of the other functions called i2s_ as well. [>>] OK
Quoted 4 lines
sound/soc/intel/keembay/kmb_platform.c new file +4
-0+static inline void i2s_irq_trigger (struct kmb_i2s_info *kmb_i2s,u32 stream, +int chan_nr,bool trigger) +{ +u32 i, irq;
sound/soc/intel/keembay/kmb_platform.c line 177
Quoted 10 lines
sound/soc/intel/keembay/kmb_platform.c new file +10
-0+u32 flag; + +if (stream ==SNDRV_PCM_STREAM_PLAYBACK ) + flag =TX_INT_FLAG ; +else + flag =RX_INT_FLAG ; + +for (i =0 ; i < chan_nr /2 ; i++) { + irq =readl (kmb_i2s->i2s_base +IMR (i)); + irq = trigger ? irq & ~flag : irq | flag;
Please write this as a normal if statement to improve legibility. [>>] OK
sound/soc/intel/keembay/kmb_platform.c line 602
Quoted 13 lines
sound/soc/intel/keembay/kmb_platform.c new file +13
-0+static int kmb_configure_dai_by_dt (struct kmb_i2s_info *kmb_i2s, +struct snd_soc_dai_driver *kmb_i2s_dai) { +u32 comp1 =readl (kmb_i2s->i2s_base +I2S_COMP_PARAM_1 ); + +if (COMP1_TX_ENABLED (comp1)) + kmb_i2s->capability |=DWC_I2S_PLAY ; + +if (COMP1_RX_ENABLED (comp1)) + kmb_i2s->capability |=DWC_I2S_RECORD ; + +return kmb_configure_dai (kmb_i2s, kmb_i2s_dai, +I2S_SAMPLE_RATES ); +}
This isn't actually reading the DT?
sound/soc/intel/keembay/kmb_platform.c line 607
Quoted 3 lines
sound/soc/intel/keembay/kmb_platform.c new file +3
-0+static void kmb_disable_clk (void *data) { +clk_disable_unprepare (data); +}
This function doesn't seem to be adding anything? [>>] It intends to disable the clock during error return.
sound/soc/intel/keembay/kmb_platform.c
Quoted 10 lines
sound/soc/intel/keembay/kmb_platform.c new file +10
-0+ ret =of_property_read_string (dev->of_node,"mode" , &i2s_mode); +if (ret <0 ) { +dev_err (dev,"Couldn't find the entry\n" ); +return -EINVAL ; + } + +dev_dbg (kmb_i2s->dev,"Mode = %s" , i2s_mode); + + ret =match_string (i2s_mode_name,ARRAY_SIZE (i2s_mode_name), +i2s_mode);
This property isn't defined in the DT binding and should be configured by the machine driver through a set_fmt() operation anyway.
Mark Brown
maintainerRe: [PATCH v2 1/4] ASoC: Intel: Add KeemBay platform driver
Quoted 17 lines · Jee Heng
sound/soc/intel/keembay/kmb_platform.c line 5
Quoted 7 lines · Sia Jee Heng
+++
b/sound/soc/intel/keembay/kmb_platform.csound/soc/intel/keembay/kmb_platform.c new file +5
-0@@ -0,0 +1,746 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* +* Intel KeemBay Platform driver +* +* Copyright (C) 2020 Intel Corporation. Please keep the entire header C++ style so things look more consistent. [>>] Will below format meet the C++ style?
[>>] // SPDX-License-Identifier: GPL-2.0-only
[>>] // Copyright (C) 2020 Intel Corporation.
[>>] /*
[>>] * Intel KeemBay Platform driver
[>>] */
The *entire* comment please.
PATCH v2 2/4 ASoC: Intel: Boards: Add KeemBay machine driver
In reply to Sia Jee HengAdd KeemBay machine driver which glues the tlv320aic3204 codec driver and kmb_platform driver to form the asoc sound driver.
--- sound/soc/intel/boards/kmb_tlv3204.c | 144 +++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 sound/soc/intel/boards/kmb_tlv3204.c
sound/soc/intel/boards/kmb_tlv3204.c new file +144 -0
@@ -0,0 +1,144 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* KeemBay ASOC Machine driver +* +* Copyright (C) 2020 Intel Corporation. +* +*/ + +#include <linux/module.h> +#include <sound/dmaengine_pcm.h> +#include <sound/soc.h> +#include "../../codecs/tlv320aic32x4.h" + +static unsigned int channels[] = { +2 , +}; + +static struct snd_pcm_hw_constraint_list constraints_ch = { + .count =ARRAY_SIZE (channels), + .list = channels, +}; + +static unsigned int rates[] = { +16000 , +48000 , +}; + +static struct snd_pcm_hw_constraint_list constraints_rates = { + .count =ARRAY_SIZE (rates), + .list = rates, +}; + +static int kmb_mach_hw_params (struct snd_pcm_substream *substream, +struct snd_pcm_hw_params *params) +{ +struct snd_soc_pcm_runtime *rtd = substream->private_data; +struct snd_soc_dai *codec_dai =asoc_rtd_to_codec (rtd,0 ); +int ret; +unsigned int sysclk; + +/* As per codec datasheet Sysclk = 256 * fs */ + sysclk =12288000 ; + +/* set the codec system clock */ + ret =snd_soc_dai_set_sysclk (codec_dai,1 , sysclk,SND_SOC_CLOCK_IN ); +if (ret <0 ) +dev_err (rtd->dev,"snd_soc_dai_set_sysclk err = %d\n" , ret); + +return ret; +} + +static int kmb_mach_dai_link_startup (struct snd_pcm_substream *substream) +{ +struct snd_pcm_runtime *str_runtime; + + str_runtime = substream->runtime; + +snd_pcm_hw_constraint_list (str_runtime,0 , +SNDRV_PCM_HW_PARAM_CHANNELS , + &constraints_ch); + +snd_pcm_hw_constraint_list (str_runtime,0 , +SNDRV_PCM_HW_PARAM_RATE , + &constraints_rates); + +return 0 ; +} + +static const struct snd_soc_ops kmb_mach_dai_link_ops = { + .startup = kmb_mach_dai_link_startup, + .hw_params = kmb_mach_hw_params, +}; + +static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = { +SND_SOC_DAPM_MIC ("External Mic" ,NULL ), +SND_SOC_DAPM_HP ("Headphone" ,NULL ), +}; + +static const struct snd_soc_dapm_route aic32x4_dapm_routes[] = { + {"Headphone" ,NULL ,"HPL" }, + {"Headphone" ,NULL ,"HPR" }, + {"IN3_R" ,NULL ,"External Mic" }, + {"IN3_L" ,NULL ,"External Mic" }, +}; + +/* Linking platform to the codec-drivers */ +SND_SOC_DAILINK_DEFS (link1, +DAILINK_COMP_ARRAY (COMP_CPU ("20140000.i2s" )), +DAILINK_COMP_ARRAY (COMP_CODEC ("tlv320aic32x4.2-0018" , +"tlv320aic32x4-hifi" )), +DAILINK_COMP_ARRAY (COMP_PLATFORM ("20140000.i2s" ))); + +/* kmb digital audio interface glue */ +static struct snd_soc_dai_link kmb_mach_dais[] = { + { + .name ="tlv320aic32x4" , + .stream_name ="TLV320AIC32X4" , + .ops = &kmb_mach_dai_link_ops, + .dai_fmt =SND_SOC_DAIFMT_I2S | +SND_SOC_DAIFMT_NB_NF | +SND_SOC_DAIFMT_CBS_CFS , +SND_SOC_DAILINK_REG (link1), + }, +}; + +/* kmb audio machine driver */ +static struct snd_soc_card kmb_mach = { + .name ="kmb_audio_card" , + .dai_link = kmb_mach_dais, + .num_links =ARRAY_SIZE (kmb_mach_dais), + .dapm_routes = aic32x4_dapm_routes, + .num_dapm_routes =ARRAY_SIZE (aic32x4_dapm_routes), + .dapm_widgets = aic32x4_dapm_widgets, + .num_dapm_widgets =ARRAY_SIZE (aic32x4_dapm_widgets), + .fully_routed = true, +}; + +static int kmb_mach_audio_probe (struct platform_device *pdev) +{ + kmb_mach.dev = &pdev->dev; + +return devm_snd_soc_register_card (&pdev->dev, &kmb_mach); +} + +static const struct of_device_id kmb_mach_of_match[] = { + { .compatible ="intel,kmb-snd-asoc" , }, + {} +}; + +static struct platform_driver kmb_mach_audio = { + .probe = kmb_mach_audio_probe, + .driver = { + .name ="kmb_tlv3204" , + .of_match_table = kmb_mach_of_match, + }, +}; + +module_platform_driver(kmb_mach_audio) + +/* Module information */ +MODULE_DESCRIPTION("Intel Audio tlv3204 machine driver for KeemBay"); +MODULE_AUTHOR ("Sia Jee Heng <[email protected]>" ); +MODULE_AUTHOR ("Sit, Michael Wei Hong <[email protected]>" ); +MODULE_LICENSE ("GPL v2" ); +MODULE_ALIAS ("platform:kmb_tlv3204" );
Signature · 1 line
1.9.1
Mark Brown
maintainerRe: [PATCH v2 2/4] ASoC: Intel: Boards: Add KeemBay machine driver
Quoted 2 lines · Sia Jee Heng
Add KeemBay machine driver which glues the tlv320aic3204 codec driver and
kmb_platformdriver to form the asoc sound driver.
Why do you need a custom machine driver for this, as this is a DT based platform and I'm not seeing anything complex or unusual in the code you should be able to use audio-graph-card (or simple-card but the former is more modern and should be preferred for new systems).
If this is required the DT binding should be documented.
RE: [PATCH v2 2/4] ASoC: Intel: Boards: Add KeemBay machine driver
Thanks but will deep dive into the graph card. Will get back to you shortly.
Thanks
Regards
Jee Heng
-----Original Message-----
From: Mark Brown <[email protected]>
Sent: Tuesday, May 19, 2020 1:10 AM
To: Sia, Jee Heng <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2 2/4] ASoC: Intel: Boards: Add KeemBay machine driver
Quoted 2 lines · Sia Jee Heng
Add KeemBay machine driver which glues the tlv320aic3204 codec driver and
kmb_platformdriver to form the asoc sound driver.
Why do you need a custom machine driver for this, as this is a DT based platform and I'm not seeing anything complex or unusual in the code you should be able to use audio-graph-card (or simple-card but the former is more modern and should be preferred for new systems).
If this is required the DT binding should be documented.
RE: [PATCH v2 2/4] ASoC: Intel: Boards: Add KeemBay machine driver
In reply to Mark BrownShall move on with the graph card and shall submit the changes.
-----Original Message-----
From: Mark Brown <[email protected]>
Sent: Tuesday, May 19, 2020 1:10 AM
To: Sia, Jee Heng <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2 2/4] ASoC: Intel: Boards: Add KeemBay machine driver
Quoted 2 lines · Sia Jee Heng
Add KeemBay machine driver which glues the tlv320aic3204 codec driver and
kmb_platformdriver to form the asoc sound driver.
Why do you need a custom machine driver for this, as this is a DT based platform and I'm not seeing anything complex or unusual in the code you should be able to use audio-graph-card (or simple-card but the former is more modern and should be preferred for new systems).
If this is required the DT binding should be documented.
PATCH v2 3/4 ASoC: Intel: Add makefiles and kconfig changes for KeemBay
In reply to Sia Jee HengAdd makefile and kconfig changes for KeemBay tlv320aic3204 machine driver and kmb_platform driver.
--- sound/soc/intel/Kconfig | 7 +++++++ sound/soc/intel/Makefile | 1 + sound/soc/intel/boards/Kconfig | 15 +++++++++++++++ sound/soc/intel/boards/Makefile | 4 ++++ 4 files changed, 27 insertions(+)
sound/soc/intel/Kconfig +7 -0
@@ -244,6 +244,13 @@ config SND_SOC_ACPI_INTEL_MATCH endif ## SND_SOC_INTEL_SST_TOPLEVEL || SND_SOC_SOF_INTEL_TOPLEVEL +config SND_SOC_INTEL_KEEMBAY + tristate "Keembay Platforms" + depends on OF && (ARM64 || COMPILE_TEST) + depends on COMMON_CLK + help + If you have a Intel Keembay platform then enable this option + by saying Y or m. # ASoC codec drivers source "sound/soc/intel/boards/Kconfig"
sound/soc/intel/Makefile +1 -0
@@ -7,6 +7,7 @@ obj-$(CONFIG_SND_SOC_INTEL_HASWELL) += haswell/ obj-$(CONFIG_SND_SOC_INTEL_BAYTRAIL) += baytrail/ obj-$(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM) += atom/ obj-$(CONFIG_SND_SOC_INTEL_SKYLAKE) += skylake/ +obj-$(CONFIG_SND_SOC_INTEL_KEEMBAY) += keembay/ # Machine support obj-$(CONFIG_SND_SOC) += boards/
sound/soc/intel/boards/Kconfig +15 -0
@@ -549,3 +549,18 @@ endif endif ## SND_SOC_INTEL_MACH + +if SND_SOC_INTEL_KEEMBAY + +config SND_SOC_INTEL_KEEMBAY_TLV320AIC3204_MACH + tristate "Keembay with TLV320AIC3204 codec" + depends on ARM64 || COMPILE_TEST + depends on I2C + select SND_SOC_TLV320AIC32X4 + select SND_SOC_TLV320AIC32X4_I2C + help + This adds support for ASoC machine driver for Intel Keembay platforms + with TLV320AIC3204 codec. + Say Y if you have such a device. + If unsure select "N". +endif ## SND_SOC_INTEL_KEEMBAY
sound/soc/intel/boards/Makefile +4 -0
@@ -69,3 +69,7 @@ obj-$(CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH) += snd-soc-skl_nau88l25_ss obj-$(CONFIG_SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH) += snd-soc-skl_hda_dsp.o obj-$(CONFIG_SND_SOC_INTEL_SOF_DA7219_MAX98373_MACH) += snd-soc-sof_da7219_max98373.o obj-$(CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH) += snd-soc-sof-sdw.o + +# Intel KeemBay Machine +snd-soc-keembay_tlv3204-objs := kmb_tlv3204.o +obj-$(CONFIG_SND_SOC_INTEL_KEEMBAY_TLV320AIC3204_MACH) += snd-soc-keembay_tlv3204.o
Signature · 1 line
1.9.1
PATCH v2 4/4 dt-bindings: sound: Add documentation for KeemBay sound card and i2s
In reply to Sia Jee HengDocument Intel KeemBay sound card and i2s DT bindings.
--- .../bindings/sound/intel,keembay-i2s.yaml | 57 ++++++++++++++++++++++ .../bindings/sound/intel,keembay-sound-card.yaml | 30 ++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/intel,keembay-i2s.yaml create mode 100644 Documentation/devicetree/bindings/sound/intel,keembay-sound-card.yaml
Documentation/devicetree/bindings/sound/intel,keembay-i2s.yaml new file +57 -0
@@ -0,0 +1,57 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2020 Intel Corporation +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/intel,keembay-i2s.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Intel KeemBay I2S Device Tree Bindings + +maintainers: + - Sia, Jee Heng <[email protected]> + +description: | + Intel KeemBay I2S + +properties: + compatible: + enum: + - intel,keembay-i2s + + reg: + items: + - description: Should contain registers location and length + + reg-names: + items: + - const: i2s-regs + - const: i2s_gen_cfg + - const: i2s_gen_cfg_count + + interrupts: + maxItems: 1 + + clocks: + items: + - description: Bus Clock + - description: Module Clock + + clock-names: + items: + - const: osc + - const: apb_clk + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/interrupt-controller/irq.h> + #define KEEM_BAY_PSS_AUX_I2S3 + #define KEEM_BAY_PSS_I2S3 + i2s@20140000 { + compatible = "intel,keembay-i2s"; + reg = <0x0 0x20140000 0x0 0x200 0x0 0x202a00a4 0x0 0x4 0x0 0x202a00c0 0x0 0x4>; + reg-names = "i2s-regs", "i2s_gen_cfg", "i2s_gen_cfg_count"; + interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; + clock-names = "osc", "apb_clk"; + clocks = <&scmi_clk KEEM_BAY_PSS_AUX_I2S3>, <&scmi_clk KEEM_BAY_PSS_I2S3>; + };
Documentation/devicetree/bindings/sound/intel,keembay-sound-card.yaml new file +30 -0
@@ -0,0 +1,30 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2020 Intel Corporation +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/intel,keembay-sound-card.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Intel KeemBay Sound Card + +maintainers: + - Sia, Jee Heng <[email protected]> + +description: | + Intel KeemBay Sound Card DT Binding + +properties: + compatible: + enum: + - intel,kmb-snd-asoc + + intel,pcm-audio: + $ref: /schemas/types.yaml#/definitions/phandle + description: phandle of the i2s + +examples: + - | + sound { + compatible = "intel,kmb-snd-asoc"; + intel,pcm-audio = <&i2s3>; + };
Signature · 1 line
1.9.1
Quoted 7 lines · Sia Jee Heng
The below series of patches support the KeemBay ASoC driver.
It enabled the tlv320aic3204 machine driver and the platform driver initialize the i2s to capture and playback the pcm data on the ARM. The i2s is running in polling mode.There is no DSP in the KeemBay SoC. Users are rely on the Gstreamer plugin to perform some Audio preprocessing.
This patch series matches what was reviewed internally at Intel by Andy Shevchenko, Cezary and I, so for patches 1..3:
Note that my review is mostly high-level, I don't personally have any knowledge or detailed information on this IP and architecture.
Quoted 32 lines
Change History:
v2:
- Corrected I2S naming for DT binding.v1:
- Initial version.Sia Jee Heng (4):
ASoC: Intel: Add KeemBay platform driver
ASoC: Intel: Boards: Add KeemBay machine driver
ASoC: Intel: Add makefiles and kconfig changes for KeemBay
dt-bindings: sound: Add documentation for KeemBay sound card and i2s.../bindings/sound/intel,keembay-i2s.yaml | 57 ++ .../bindings/sound/intel,keembay-sound-card.yaml | 30 + sound/soc/intel/Kconfig | 7 + sound/soc/intel/Makefile | 1 + sound/soc/intel/boards/Kconfig | 15 + sound/soc/intel/boards/Makefile | 4 + sound/soc/intel/boards/kmb_tlv3204.c | 144 ++++ sound/soc/intel/keembay/Makefile | 4 + sound/soc/intel/keembay/kmb_platform.c | 746 +++++++++++++++++++++ sound/soc/intel/keembay/kmb_platform.h | 145 ++++ 10 files changed, 1153 insertions(+)create mode 100644
Documentation/devicetree/bindings/sound/intel,keembay-i2s.yamlcreate mode 100644Documentation/devicetree/bindings/sound/intel,keembay-sound-card.yamlcreate mode 100644sound/soc/intel/boards/kmb_tlv3204.c
create mode 100644sound/soc/intel/keembay/Makefile
create mode 100644sound/soc/intel/keembay/kmb_platform.c
create mode 100644sound/soc/intel/keembay/kmb_platform.h