Qualcomm's lpass-hdmi ASoC driver to support audio over dp port
Subsystems (5)
v3 cover Qualcomm's lpass-hdmi ASoC driver to support audio over dp port
These patches are to support audio over DP port on Qualcomm's SC7180 LPASS Asoc. It includes machine driver, cpu driver, platform driver updates for HDMI path support, device tree documention, lpass variant structure optimization and configuration changes. These patches depends on the DP patch series
https://patchwork.kernel.org/project/dri-devel/list/?series=332029
Changes Since v2:
-- Audio buffer size(i.e. LPASS_PLATFORM_BUFFER_SIZE) in lpass-platform.c increased.
V Sujith Kumar Reddy (5):
ASoC: Add sc7180-lpass binding header hdmi define
ASoC: dt-bindings: Add dt binding for lpass hdmi
ASoC: qcom: Add support for lpass hdmi driver
ASoC: qcom: Add support for audio over DP
ASoC: qcom: Optimise lpass variant structure
.../devicetree/bindings/sound/qcom,lpass-cpu.yaml | 51 +- include/dt-bindings/sound/sc7180-lpass.h | 1 + sound/soc/qcom/Kconfig | 5 + sound/soc/qcom/Makefile | 2 + sound/soc/qcom/lpass-apq8016.c | 25 +- sound/soc/qcom/lpass-cpu.c | 92 ++- sound/soc/qcom/lpass-hdmi.c | 685 +++++++++++++++++++++ sound/soc/qcom/lpass-hdmi.h | 129 ++++ sound/soc/qcom/lpass-ipq806x.c | 25 +- sound/soc/qcom/lpass-lpaif-reg.h | 51 +- sound/soc/qcom/lpass-platform.c | 287 +++++++-- sound/soc/qcom/lpass-sc7180.c | 147 ++++- sound/soc/qcom/lpass.h | 123 +++- 13 files changed, 1472 insertions(+), 151 deletions(-) create mode 100644 sound/soc/qcom/lpass-hdmi.c create mode 100644 sound/soc/qcom/lpass-hdmi.h
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
PATCH v3 1/5 ASoC: Add sc7180-lpass binding header hdmi define
From: V Sujith Kumar Reddy <[email protected]>
Add header defining hdmi dai-id for SC7180 lpass soc in dt bindings.
--- include/dt-bindings/sound/sc7180-lpass.h | 1 + 1 file changed, 1 insertion(+)
include/dt-bindings/sound/sc7180-lpass.h +1 -0
@@ -4,6 +4,7 @@#define MI2S_PRIMARY 0#define MI2S_SECONDARY 1 +#define HDMI 2#define LPASS_MCLK0 0
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
PATCH v3 2/5 ASoC: dt-bindings: Add dt binding for lpass hdmi
In reply to Srinivasa Rao MandadapuFrom: V Sujith Kumar Reddy <[email protected]>
Adds bindings for lpass hdmi interface
which can support audio path over dp.
--- .../devicetree/bindings/sound/qcom,lpass-cpu.yaml | 51 ++++++++++++++++++++-- 1 file changed, 47 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml +47 -4
@@ -22,6 +22,7 @@ properties: - qcom,lpass-cpu - qcom,apq8016-lpass-cpu - qcom,sc7180-lpass-cpu + - qcom,sc7180-lpass-hdmi reg: maxItems: 1
@@ -60,10 +61,12 @@ properties: const: 0 patternProperties: - "(^mi2s-[0-9a-f]$|mi2s)": + "^dai@[0-9a-f]$": type: object - description: Required properties for each DAI - + description: | + LPASS CPU dai node for each I2S device. Bindings of each node + depends on the specific driver providing the functionality and + properties. properties: reg: maxItems: 1
@@ -145,6 +148,22 @@ allOf: - iommus - power-domains + - if: + properties: + compatible: + contains: + const: qcom,sc7180-lpass-hdmi + then: + properties: + clock-names: + items: + - const: pcnoc-sway-clk + - const: audio-core + - const: pcnoc-mport-clk + required: + - iommus + - power-domains + examples: - | #include <dt-bindings/sound/sc7180-lpass.h>
@@ -178,12 +197,36 @@ examples: #address-cells = <1>; #size-cells = <0>; /* Optional to set different MI2S SD lines */ - mi2s-primary@0 { + dai@mi2s-primary { reg = <MI2S_PRIMARY>; qcom,playback-sd-lines = <1>; qcom,capture-sd-lines = <0>; }; }; + + lpassh@62d87000 { + compatible = "qcom,sc7180-lpass-hdmi"; + + reg = <0 0x62d87000 0 0x68000>; + + iommus = <&apps_smmu 0x1032 0>; + + power-domains = <&lpass_hm 0>; + + clocks = <&gcc 131>, + <&lpasscc 6>, + <&lpasscc 10>; + + clock-names = "pcnoc-sway-clk", "audio-core", + "pcnoc-mport-clk"; + + #sound-dai-cells = <1>; + + #address-cells = <1>; + #size-cells = <0>; + + interrupts = <0 268 1>; + }; }; ...
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
Re: [PATCH v3 2/5] ASoC: dt-bindings: Add dt binding for lpass hdmi
Quoted 16 lines · Srinivasa Rao Mandadapu
From: V Sujith Kumar Reddy <[email protected]>
Adds bindings for lpass hdmi interface
which can support audio path over dp.Signed-off-by Srinivasa Rao <[email protected]>Signed-off-by V Sujith Kumar Reddy <[email protected]>--- .../devicetree/bindings/sound/qcom,lpass-cpu.yaml | 51 ++++++++++++++++++++-- 1 file changed, 47 insertions(+), 4 deletions(-)Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml +0
-0
Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml properties: · line 25
Quoted 4 lines
Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml +1
-0@@ -22,6 +22,7 @@ properties: - qcom,lpass-cpu - qcom,apq8016-lpass-cpu - qcom,sc7180-lpass-cpu + - qcom,sc7180-lpass-hdmi
Why do we need a new compatible per interface, IMO, you should just use the existing compatible. Or please explain the reasons why we need this?
Quoted 81 lines
Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml +46
-4reg: maxItems: 1@@ -60,10 +61,12 @@ properties: const: 0 patternProperties: - "(^mi2s-[0-9a-f]$|mi2s)": + "^dai@[0-9a-f]$": type: object - description: Required properties for each DAI - + description: | + LPASS CPU dai node for each I2S device. Bindings of each node + depends on the specific driver providing the functionality and + properties. properties: reg: maxItems: 1@@ -145,6 +148,22 @@ allOf: - iommus - power-domains + - if: + properties: + compatible: + contains: + const: qcom,sc7180-lpass-hdmi + then: + properties: + clock-names: + items: + - const: pcnoc-sway-clk + - const: audio-core + - const: pcnoc-mport-clk + required: + - iommus + - power-domains + examples: - | #include <dt-bindings/sound/sc7180-lpass.h>@@ -178,12 +197,36 @@ examples: #address-cells = <1>; #size-cells = <0>; /* Optional to set different MI2S SD lines */ - mi2s-primary@0 { + dai@mi2s-primary { reg = <MI2S_PRIMARY>; qcom,playback-sd-lines = <1>; qcom,capture-sd-lines = <0>; }; }; + + lpassh@62d87000 { + compatible = "qcom,sc7180-lpass-hdmi"; + + reg = <0 0x62d87000 0 0x68000>; + + iommus = <&apps_smmu 0x1032 0>; + + power-domains = <&lpass_hm 0>; + + clocks = <&gcc 131>, + <&lpasscc 6>, + <&lpasscc 10>; + + clock-names = "pcnoc-sway-clk", "audio-core", + "pcnoc-mport-clk"; + + #sound-dai-cells = <1>; + + #address-cells = <1>; + #size-cells = <0>; + + interrupts = <0 268 1>; + }; };
Re: [PATCH v3 2/5] ASoC: dt-bindings: Add dt binding for lpass hdmi
Thanks Srinivas For Review!!!
Quoted 15 lines · Srinivas Kandagatla
Quoted 12 lines · Srinivasa Rao Mandadapu
From: V Sujith Kumar Reddy <[email protected]>
Adds bindings for lpass hdmi interface
which can support audio path over dp.Signed-off-by Srinivasa Rao <[email protected]>Signed-off-by V Sujith Kumar Reddy <[email protected]>---
.../devicetree/bindings/sound/qcom,lpass-cpu.yaml | 51
++++++++++++++++++++--1 file changed, 47 insertions(+), 4 deletions(-)
Quoted 12 lines
Quoted 9 lines
Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml +0
-0@@ -22,6 +22,7 @@ properties:- qcom,lpass-cpu
- qcom,apq8016-lpass-cpu
- qcom,sc7180-lpass-cpu
+ - qcom,sc7180-lpass-hdmiWhy do we need a new compatible per interface, IMO, you should just use the existing compatible. Or please explain the reasons why we need this?
Two compatible strings are used because iommu's are different for I2S and HDMI.
Quoted 78 lines
Quoted 78 lines
reg:
maxItems: 1Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml +0
-0@@ -60,10 +61,12 @@ properties:const: 0
patternProperties:
- "(^mi2s-[0-9a-f]$|mi2s)":
+ "^dai@[0-9a-f]$":
type: object
- description: Required properties for each DAI
-
+ description: |
+ LPASS CPU dai node for each I2S device. Bindings of each node + depends on the specific driver providing the functionality and + properties.
properties:
reg:
maxItems: 1Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml +0
-0@@ -145,6 +148,22 @@ allOf:- iommus
- power-domains
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: qcom,sc7180-lpass-hdmi
+ then:
+ properties:
+ clock-names:
+ items:
+ - const: pcnoc-sway-clk
+ - const: audio-core
+ - const: pcnoc-mport-clk
+ required:
+ - iommus
+ - power-domains
+
examples:
- |
#include <dt-bindings/sound/sc7180-lpass.h>Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml +25
-1@@ -178,12 +197,36 @@ examples: #address-cells = <1>; #size-cells = <0>; /* Optional to set different MI2S SD lines */ - mi2s-primary@0 { + dai@mi2s-primary { reg = <MI2S_PRIMARY>; qcom,playback-sd-lines = <1>; qcom,capture-sd-lines = <0>; }; }; + + lpassh@62d87000 { + compatible = "qcom,sc7180-lpass-hdmi"; + + reg = <0 0x62d87000 0 0x68000>; + + iommus = <&apps_smmu 0x1032 0>; + + power-domains = <&lpass_hm 0>; + + clocks = <&gcc 131>, + <&lpasscc 6>, + <&lpasscc 10>; + + clock-names = "pcnoc-sway-clk", "audio-core", + "pcnoc-mport-clk"; + + #sound-dai-cells = <1>; + + #address-cells = <1>; + #size-cells = <0>; + + interrupts = <0 268 1>; + }; };
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
Re: [PATCH v3 2/5] ASoC: dt-bindings: Add dt binding for lpass hdmi
In reply to Srinivas KandagatlaThanks Srinivas For Review!!!
Quoted 15 lines · Srinivas Kandagatla
Quoted 12 lines · Srinivasa Rao Mandadapu
From: V Sujith Kumar Reddy <[email protected]>
Adds bindings for lpass hdmi interface
which can support audio path over dp.Signed-off-by Srinivasa Rao <[email protected]>Signed-off-by V Sujith Kumar Reddy <[email protected]>---
.../devicetree/bindings/sound/qcom,lpass-cpu.yaml | 51
++++++++++++++++++++--1 file changed, 47 insertions(+), 4 deletions(-)
Quoted 12 lines
Quoted 9 lines
Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml +0
-0@@ -22,6 +22,7 @@ properties:- qcom,lpass-cpu
- qcom,apq8016-lpass-cpu
- qcom,sc7180-lpass-cpu
+ - qcom,sc7180-lpass-hdmiWhy do we need a new compatible per interface, IMO, you should just use the existing compatible. Or please explain the reasons why we need this?
Two compatible strings are used because iommu's are different for I2S and HDMI.
Quoted 78 lines
Quoted 78 lines
reg:
maxItems: 1Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml +0
-0@@ -60,10 +61,12 @@ properties:const: 0
patternProperties:
- "(^mi2s-[0-9a-f]$|mi2s)":
+ "^dai@[0-9a-f]$":
type: object
- description: Required properties for each DAI
-
+ description: |
+ LPASS CPU dai node for each I2S device. Bindings of each node + depends on the specific driver providing the functionality and + properties.
properties:
reg:
maxItems: 1Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml +0
-0@@ -145,6 +148,22 @@ allOf:- iommus
- power-domains
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: qcom,sc7180-lpass-hdmi
+ then:
+ properties:
+ clock-names:
+ items:
+ - const: pcnoc-sway-clk
+ - const: audio-core
+ - const: pcnoc-mport-clk
+ required:
+ - iommus
+ - power-domains
+
examples:
- |
#include <dt-bindings/sound/sc7180-lpass.h>Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml +25
-1@@ -178,12 +197,36 @@ examples: #address-cells = <1>; #size-cells = <0>; /* Optional to set different MI2S SD lines */ - mi2s-primary@0 { + dai@mi2s-primary { reg = <MI2S_PRIMARY>; qcom,playback-sd-lines = <1>; qcom,capture-sd-lines = <0>; }; }; + + lpassh@62d87000 { + compatible = "qcom,sc7180-lpass-hdmi"; + + reg = <0 0x62d87000 0 0x68000>; + + iommus = <&apps_smmu 0x1032 0>; + + power-domains = <&lpass_hm 0>; + + clocks = <&gcc 131>, + <&lpasscc 6>, + <&lpasscc 10>; + + clock-names = "pcnoc-sway-clk", "audio-core", + "pcnoc-mport-clk"; + + #sound-dai-cells = <1>; + + #address-cells = <1>; + #size-cells = <0>; + + interrupts = <0 268 1>; + }; };
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
PATCH v3 3/5 ASoC: qcom: Add support for lpass hdmi driver
In reply to Srinivasa Rao MandadapuFrom: V Sujith Kumar Reddy <[email protected]>
Upadate lpass cpu and platform driver to support audio over dp. Also add lpass-hdmi.c and lpass-hdmi.h.
--- sound/soc/qcom/Kconfig | 5 + sound/soc/qcom/Makefile | 2 + sound/soc/qcom/lpass-apq8016.c | 1 + sound/soc/qcom/lpass-cpu.c | 64 ++-- sound/soc/qcom/lpass-hdmi.c | 684 +++++++++++++++++++++++++++++++++++++++ sound/soc/qcom/lpass-hdmi.h | 129 ++++++++ sound/soc/qcom/lpass-ipq806x.c | 1 + sound/soc/qcom/lpass-lpaif-reg.h | 48 ++- sound/soc/qcom/lpass-platform.c | 287 ++++++++++++---- sound/soc/qcom/lpass.h | 88 ++++- 10 files changed, 1225 insertions(+), 84 deletions(-) create mode 100644 sound/soc/qcom/lpass-hdmi.c create mode 100644 sound/soc/qcom/lpass-hdmi.h
sound/soc/qcom/Kconfig +5 -0
@@ -12,6 +12,10 @@ config SND_SOC_LPASS_CPU tristate select REGMAP_MMIO +config SND_SOC_LPASS_HDMI + tristate + select REGMAP_MMIO + config SND_SOC_LPASS_PLATFORM tristate select REGMAP_MMIO
@@ -30,6 +34,7 @@ config SND_SOC_LPASS_SC7180 tristate select SND_SOC_LPASS_CPU select SND_SOC_LPASS_PLATFORM + select SND_SOC_LPASS_HDMI config SND_SOC_STORM tristate "ASoC I2S support for Storm boards"
sound/soc/qcom/Makefile +2 -0
@@ -1,12 +1,14 @@ # SPDX-License-Identifier: GPL-2.0 # Platform snd-soc-lpass-cpu-objs := lpass-cpu.o +snd-soc-lpass-hdmi-objs := lpass-hdmi.o snd-soc-lpass-platform-objs := lpass-platform.o snd-soc-lpass-ipq806x-objs := lpass-ipq806x.o snd-soc-lpass-apq8016-objs := lpass-apq8016.o snd-soc-lpass-sc7180-objs := lpass-sc7180.o obj-$(CONFIG_SND_SOC_LPASS_CPU) += snd-soc-lpass-cpu.o +obj-$(CONFIG_SND_SOC_LPASS_HDMI) += snd-soc-lpass-hdmi.o obj-$(CONFIG_SND_SOC_LPASS_PLATFORM) += snd-soc-lpass-platform.o obj-$(CONFIG_SND_SOC_LPASS_IPQ806X) += snd-soc-lpass-ipq806x.o obj-$(CONFIG_SND_SOC_LPASS_APQ8016) += snd-soc-lpass-apq8016.o
sound/soc/qcom/lpass-apq8016.c +1 -0
@@ -289,6 +289,7 @@ static struct lpass_variant apq8016_data = { .exit = apq8016_lpass_exit, .alloc_dma_channel = apq8016_lpass_alloc_dma_channel, .free_dma_channel = apq8016_lpass_free_dma_channel, + .id = I2S_INTERFACE, };static const struct of_device_id apq8016_lpass_cpu_device_id[] = {
sound/soc/qcom/lpass-cpu.c +46 -18
95 lines not on this page · raw message
sound/soc/qcom/lpass-hdmi.c new file +684 -0
684 lines not on this page · raw message
sound/soc/qcom/lpass-hdmi.h new file +129 -0
129 lines not on this page · raw message
sound/soc/qcom/lpass-ipq806x.c +1 -0
@@ -159,6 +159,7 @@ static struct lpass_variant ipq806x_data = { .exit = ipq806x_lpass_exit, .alloc_dma_channel = ipq806x_lpass_alloc_dma_channel, .free_dma_channel = ipq806x_lpass_free_dma_channel, + .id = I2S_INTERFACE, };static const struct of_device_id ipq806x_lpass_cpu_device_id[] = {
sound/soc/qcom/lpass-lpaif-reg.h +45 -3
69 lines not on this page · raw message
sound/soc/qcom/lpass-platform.c +225 -62
431 lines not on this page · raw message
sound/soc/qcom/lpass.h +87 -1
134 lines not on this page · raw message
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
Re: [PATCH v3 3/5] ASoC: qcom: Add support for lpass hdmi driver
Quoting Srinivasa Rao Mandadapu (2020-08-30 23:39:22)
Quoted 7 lines
sound/soc/qcom/lpass-hdmi.c new file +1
-0@@ -0,0 +1,684 @@ +// SPDX-License-Identifier: GPL-2.0-only
[...]
Quoted 4 lines
sound/soc/qcom/lpass-hdmi.c new file +4
-0+ +static int lpass_hdmi_daiops_hw_params (struct snd_pcm_substream *substream, +struct snd_pcm_hw_params *params,struct snd_soc_dai *dai) +{
[...]
sound/soc/qcom/lpass-hdmi.c line 258
Quoted 8 lines
sound/soc/qcom/lpass-hdmi.c new file +8
-0+ data_format =LPASS_DATA_FORMAT_LINEAR ; + ch_sts_buf0 = (((data_format <<LPASS_DATA_FORMAT_SHIFT ) &LPASS_DATA_FORMAT_MASK ) + | ((sampling_freq <<LPASS_FREQ_BIT_SHIFT ) &LPASS_FREQ_BIT_MASK )); + ch_sts_buf1 = (word_length) &LPASS_WORDLENGTH_MASK ; + + ret =regmap_field_write (drvdata->tx_ctl->soft_reset,LPASS_TX_CTL_RESET ); +if (ret) { + dev_err(dai->dev, "%s error writing to softreset enable : %d\n",
All of these strings bloat the kernel image. Can we just return ret instead and if something goes wrong we can use a debug patch to figure out which register write failed? Would a register write even fail to begin with?
Quoted 19 lines
sound/soc/qcom/lpass-hdmi.c new file +19
-0+ __func__, ret); +return ret; + } + + ret =regmap_field_write (drvdata->tx_ctl->soft_reset,LPASS_TX_CTL_CLEAR ); +if (ret) { +dev_err (dai->dev,"%s error writing to softreset disable : %d\n" , + __func__, ret); +return ret; + } + + ret =regmap_field_write (drvdata->legacy->legacy_en, +LPASS_HDMITX_LEGACY_DISABLE ); +if (ret) { +dev_err (dai->dev,"%s error writing to legacy_en field : %d\n" , + __func__, ret); +return ret; + } +
[...]
Quoted 12 lines
#define
LPAIF_DMACTL_REG(v, chan, dir)__LPAIF_DMA_REG(v, chan, dir, CTL)#defineLPAIF_DMABASE_REG(v, chan, dir)__LPAIF_DMA_REG(v, chan, dir, BASE)sound/soc/qcom/lpass-platform.c +1
-1@@ -553,7 +702,21 @@ static irqreturn_t lpass_platform_lpaif_irq(int irq, void *data)/* Handle per channel interrupts */ for (chan =0 ; chan <LPASS_MAX_DMA_CHANNELS ; chan++) { -if (irqs &LPAIF_IRQ_ALL (chan) && drvdata->substream[chan]) { +switch (v->id) {
sound/soc/qcom/lpass-platform.c static irqreturn_t lpass_platform_lpaif_irq(int irq, void *data) · line 715
Quoted 10 lines
sound/soc/qcom/lpass-platform.c +10
-0+case HDMI_INTERFACE : + val =LPAIF_IRQ_HDMI_REQ_ON_PRELOAD (chan) | +LPAIF_IRQ_HDMI_METADONE | +LPAIF_IRQ_HDMI_SDEEP_AUD_DIS (chan); +break ; +case I2S_INTERFACE : + val =0 ; +break ; +default : +pr_err ("%s: invalid %d interface\n" , __func__, v->id);
Any reason we can't use dev_err() here?
Quoted 12 lines
sound/soc/qcom/lpass-platform.c +4
-1+return -EINVAL ; + } +if (irqs & (LPAIF_IRQ_ALL (chan) | val) + && drvdata->substream[chan]) { rv =lpass_dma_interrupt_handler ( drvdata->substream[chan], drvdata, chan, irqs);@@ -644,15 +807,15 @@ int asoc_qcom_lpass_platform_register(struct platform_device *pdev)/* ensure audio hardware is disabled */ ret = regmap_write(drvdata->lpaif_map, -LPAIF_IRQEN_REG (v,LPAIF_IRQ_PORT_HOST ),0 );
sound/soc/qcom/lpass-platform.c int asoc_qcom_lpass_platform_register(struct platform_device *pdev) · line 817
Quoted 10 lines
sound/soc/qcom/lpass-platform.c +2
-2+ IRQ_EN(v, LPAIF_IRQ_PORT_HOST), 0);if (ret) {dev_err (&pdev->dev,"error writing to irqen reg: %d\n" , ret);return ret; } ret = devm_request_irq(&pdev->dev, drvdata->lpaif_irq, - lpass_platform_lpaif_irq,IRQF_TRIGGER_RISING , -"lpass-irq-lpaif" , drvdata); + lpass_platform_lpaif_irq, IRQF_TRIGGER_RISING,
Can we use the irq flags from the firmware, i.e. whatever the DT or ACPI tables say?
Quoted 4 lines
sound/soc/qcom/lpass-platform.c +1
-0+ pdev->name, drvdata);if (ret) {dev_err (&pdev->dev,"irq request failed: %d\n" , ret);return ret;
Re: [PATCH v3 3/5] ASoC: qcom: Add support for lpass hdmi driver
Thanks Stephen for your time for review!!!
Quoted 22 lines · Stephen Boyd
Quoting Srinivasa Rao Mandadapu (2020-08-30 23:39:22)
Quoted 7 lines
sound/soc/qcom/lpass-hdmi.c new file +1
-0@@ -0,0 +1,684 @@ +// SPDX-License-Identifier: GPL-2.0-only [...]
Quoted 4 lines
sound/soc/qcom/lpass-hdmi.c new file +4
-0+ +static int lpass_hdmi_daiops_hw_params (struct snd_pcm_substream *substream, +struct snd_pcm_hw_params *params,struct snd_soc_dai *dai) +{[...]
sound/soc/qcom/lpass-hdmi.c line 258
Quoted 8 lines
sound/soc/qcom/lpass-hdmi.c new file +8
-0+ data_format =LPASS_DATA_FORMAT_LINEAR ; + ch_sts_buf0 = (((data_format <<LPASS_DATA_FORMAT_SHIFT ) &LPASS_DATA_FORMAT_MASK ) + | ((sampling_freq <<LPASS_FREQ_BIT_SHIFT ) &LPASS_FREQ_BIT_MASK )); + ch_sts_buf1 = (word_length) &LPASS_WORDLENGTH_MASK ; + + ret =regmap_field_write (drvdata->tx_ctl->soft_reset,LPASS_TX_CTL_RESET ); +if (ret) { + dev_err(dai->dev, "%s error writing to softreset enable : %d\n",
Quoted 4 lines
All of these strings bloat the kernel image. Can we just return ret instead and if something goes wrong we can use a debug patch to figure out which register write failed? Would a register write even fail to begin with?
Will remove wherever possible.
Quoted 29 lines
Quoted 20 lines
sound/soc/qcom/lpass-hdmi.c new file +19
-0+ __func__, ret); +return ret; + } + + ret =regmap_field_write (drvdata->tx_ctl->soft_reset,LPASS_TX_CTL_CLEAR ); +if (ret) { +dev_err (dai->dev,"%s error writing to softreset disable : %d\n" , + __func__, ret); +return ret; + } + + ret =regmap_field_write (drvdata->legacy->legacy_en, +LPASS_HDMITX_LEGACY_DISABLE ); +if (ret) { +dev_err (dai->dev,"%s error writing to legacy_en field : %d\n" , + __func__, ret); +return ret; + } +[...]
Quoted 8 lines
#define
LPAIF_DMACTL_REG(v, chan, dir)__LPAIF_DMA_REG(v, chan, dir, CTL)#defineLPAIF_DMABASE_REG(v, chan, dir)__LPAIF_DMA_REG(v, chan, dir, BASE)sound/soc/qcom/lpass-platform.c +0
-0@@ -553,7 +702,21 @@ static irqreturn_t lpass_platform_lpaif_irq(int irq, void *data)
Quoted 15 lines
Quoted 4 lines
sound/soc/qcom/lpass-platform.c +1
-1/* Handle per channel interrupts */ for (chan =0 ; chan <LPASS_MAX_DMA_CHANNELS ; chan++) { -if (irqs &LPAIF_IRQ_ALL (chan) && drvdata->substream[chan]) { +switch (v->id) {sound/soc/qcom/lpass-platform.c static irqreturn_t lpass_platform_lpaif_irq(int irq, void *data) · line 715
Quoted 10 lines
sound/soc/qcom/lpass-platform.c +10
-0+case HDMI_INTERFACE : + val =LPAIF_IRQ_HDMI_REQ_ON_PRELOAD (chan) | +LPAIF_IRQ_HDMI_METADONE | +LPAIF_IRQ_HDMI_SDEEP_AUD_DIS (chan); +break ; +case I2S_INTERFACE : + val =0 ; +break ; +default : +pr_err ("%s: invalid %d interface\n" , __func__, v->id);Any reason we can't use
dev_err()here?
It's interrupt handler. Here dev variable is not available.
So we shall remove print as per your previous comment or keep as it is.
Quoted 19 lines
Quoted 19 lines
sound/soc/qcom/lpass-platform.c +5
-1+return -EINVAL ; + } +if (irqs & (LPAIF_IRQ_ALL (chan) | val) + && drvdata->substream[chan]) { rv =lpass_dma_interrupt_handler ( drvdata->substream[chan], drvdata, chan, irqs);@@ -644,15 +807,15 @@ int asoc_qcom_lpass_platform_register(struct platform_device *pdev)/* ensure audio hardware is disabled */ ret =regmap_write (drvdata->lpaif_map, -LPAIF_IRQEN_REG (v,LPAIF_IRQ_PORT_HOST ),0 ); +IRQ_EN (v,LPAIF_IRQ_PORT_HOST ),0 );if (ret) {dev_err (&pdev->dev,"error writing to irqen reg: %d\n" , ret);return ret; }
Quoted 6 lines
sound/soc/qcom/lpass-platform.c int asoc_qcom_lpass_platform_register(struct platform_device *pdev) · line 817
Quoted 4 lines
sound/soc/qcom/lpass-platform.c +1
-2ret = devm_request_irq(&pdev->dev, drvdata->lpaif_irq, - lpass_platform_lpaif_irq,IRQF_TRIGGER_RISING , -"lpass-irq-lpaif" , drvdata); + lpass_platform_lpaif_irq, IRQF_TRIGGER_RISING,Can we use the irq flags from the firmware, i.e. whatever the DT or ACPI tables say?
okay.
Quoted 5 lines
Quoted 5 lines
sound/soc/qcom/lpass-platform.c +1
-0+ pdev->name, drvdata);if (ret) {dev_err (&pdev->dev,"irq request failed: %d\n" , ret);return ret;
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
Re: [PATCH v3 3/5] ASoC: qcom: Add support for lpass hdmi driver
In reply to Srinivasa Rao MandadapuQuoted 69 lines · Srinivasa Rao Mandadapu
From: V Sujith Kumar Reddy <[email protected]>
Upadate lpass cpu and platform driver to support audio over dp. Also add
lpass-hdmi.candlpass-hdmi.h.Signed-off-by Srinivasa Rao <[email protected]>Signed-off-by V Sujith Kumar Reddy <[email protected]>--- sound/soc/qcom/Kconfig | 5 + sound/soc/qcom/Makefile | 2 + sound/soc/qcom/lpass-apq8016.c | 1 + sound/soc/qcom/lpass-cpu.c | 64 ++-- sound/soc/qcom/lpass-hdmi.c | 684 +++++++++++++++++++++++++++++++++++++++ sound/soc/qcom/lpass-hdmi.h | 129 ++++++++ sound/soc/qcom/lpass-ipq806x.c | 1 + sound/soc/qcom/lpass-lpaif-reg.h | 48 ++- sound/soc/qcom/lpass-platform.c | 287 ++++++++++++---- sound/soc/qcom/lpass.h | 88 ++++- 10 files changed, 1225 insertions(+), 84 deletions(-)create mode 100644
sound/soc/qcom/lpass-hdmi.c
create mode 100644sound/soc/qcom/lpass-hdmi.hsound/soc/qcom/Kconfig +5
-0@@ -12,6 +12,10 @@ config SND_SOC_LPASS_CPU tristate select REGMAP_MMIO +config SND_SOC_LPASS_HDMI + tristate + select REGMAP_MMIO + config SND_SOC_LPASS_PLATFORM tristate select REGMAP_MMIO@@ -30,6 +34,7 @@ config SND_SOC_LPASS_SC7180 tristate select SND_SOC_LPASS_CPU select SND_SOC_LPASS_PLATFORM + select SND_SOC_LPASS_HDMI config SND_SOC_STORM tristate "ASoC I2S support for Storm boards"sound/soc/qcom/Makefile +2
-0@@ -1,12 +1,14 @@ # SPDX-License-Identifier: GPL-2.0 # Platform snd-soc-lpass-cpu-objs := lpass-cpu.o +snd-soc-lpass-hdmi-objs := lpass-hdmi.o snd-soc-lpass-platform-objs := lpass-platform.o snd-soc-lpass-ipq806x-objs := lpass-ipq806x.o snd-soc-lpass-apq8016-objs := lpass-apq8016.o snd-soc-lpass-sc7180-objs := lpass-sc7180.o obj-$(CONFIG_SND_SOC_LPASS_CPU) += snd-soc-lpass-cpu.o +obj-$(CONFIG_SND_SOC_LPASS_HDMI) += snd-soc-lpass-hdmi.o obj-$(CONFIG_SND_SOC_LPASS_PLATFORM) += snd-soc-lpass-platform.o obj-$(CONFIG_SND_SOC_LPASS_IPQ806X) += snd-soc-lpass-ipq806x.o obj-$(CONFIG_SND_SOC_LPASS_APQ8016) += snd-soc-lpass-apq8016.osound/soc/qcom/lpass-apq8016.c +0
-0
sound/soc/qcom/lpass-apq8016.c static struct lpass_variant apq8016_data = { · line 292
Quoted 4 lines
sound/soc/qcom/lpass-apq8016.c +1
-0@@ -289,6 +289,7 @@ static struct lpass_variant apq8016_data = { .exit = apq8016_lpass_exit, .alloc_dma_channel = apq8016_lpass_alloc_dma_channel, .free_dma_channel = apq8016_lpass_free_dma_channel, + .id = I2S_INTERFACE,
Before going into detail review, I see real issue in the overall approach here to add new interface to exiting lpass!!
Intention of struct lpass_variant is to address differences between SoCs or different lpass versions. But you should not duplicate this and use it for addressing differences between each lpass interfaces!
All the dai related register offsets should still go in to this structure and driver should be able to know which dai its talking to based on snd_soc_dai_driver id and select correct register offset.
Also on the other note, can you please split the patch if possible so that it will be easy for review. Specially I would like to see header file changes specific to adding new interface to be separate then followed by the actual interface implementation and then the user.
I also see some unrelated changes like changing buffer sizes, which should go into different patch!
--srini
Re: [PATCH v3 3/5] ASoC: qcom: Add support for lpass hdmi driver
Thanks Srinivas For Review!!!
Quoted 77 lines · Srinivas Kandagatla
Quoted 67 lines · Srinivasa Rao Mandadapu
From: V Sujith Kumar Reddy <[email protected]>
Upadate lpass cpu and platform driver to support audio over dp. Also add
lpass-hdmi.candlpass-hdmi.h.Signed-off-by Srinivasa Rao <[email protected]>Signed-off-by V Sujith Kumar Reddy <[email protected]>---
sound/soc/qcom/Kconfig | 5 + sound/soc/qcom/Makefile | 2 + sound/soc/qcom/lpass-apq8016.c | 1 + sound/soc/qcom/lpass-cpu.c | 64 ++-- sound/soc/qcom/lpass-hdmi.c | 684
+++++++++++++++++++++++++++++++++++++++
sound/soc/qcom/lpass-hdmi.h | 129 ++++++++ sound/soc/qcom/lpass-ipq806x.c | 1 +sound/soc/qcom/lpass-lpaif-reg.h| 48 ++- sound/soc/qcom/lpass-platform.c | 287 ++++++++++++---- sound/soc/qcom/lpass.h | 88 ++++-10 files changed, 1225 insertions(+), 84 deletions(-)create mode 100644
sound/soc/qcom/lpass-hdmi.c
create mode 100644sound/soc/qcom/lpass-hdmi.hsound/soc/qcom/Kconfig +0
-0@@ -12,6 +12,10 @@ config SND_SOC_LPASS_CPUtristate
selectREGMAP_MMIO
+configSND_SOC_LPASS_HDMI
+ tristate
+ selectREGMAP_MMIO
+
configSND_SOC_LPASS_PLATFORM
tristate
selectREGMAP_MMIOsound/soc/qcom/Kconfig +0
-0@@ -30,6 +34,7 @@ config SND_SOC_LPASS_SC7180tristate
selectSND_SOC_LPASS_CPU
selectSND_SOC_LPASS_PLATFORM
+ selectSND_SOC_LPASS_HDMI
configSND_SOC_STORM
tristate "ASoC I2S support for Storm boards"sound/soc/qcom/Makefile +0
-0@@ -1,12 +1,14 @@ # SPDX-License-Identifier: GPL-2.0 # Platformsnd-soc-lpass-cpu-objs := lpass-cpu.o +snd-soc-lpass-hdmi-objs := lpass-hdmi.o snd-soc-lpass-platform-objs := lpass-platform.o snd-soc-lpass-ipq806x-objs := lpass-ipq806x.o snd-soc-lpass-apq8016-objs := lpass-apq8016.o snd-soc-lpass-sc7180-objs := lpass-sc7180.o obj-$(CONFIG_SND_SOC_LPASS_CPU) += snd-soc-lpass-cpu.o +obj-$(CONFIG_SND_SOC_LPASS_HDMI) += snd-soc-lpass-hdmi.o obj-$(CONFIG_SND_SOC_LPASS_PLATFORM) += snd-soc-lpass-platform.o obj-$(CONFIG_SND_SOC_LPASS_IPQ806X) += snd-soc-lpass-ipq806x.o obj-$(CONFIG_SND_SOC_LPASS_APQ8016) += snd-soc-lpass-apq8016.o
sound/soc/qcom/lpass-apq8016.c +0
-0sound/soc/qcom/lpass-apq8016.c static struct lpass_variant apq8016_data = { · line 292
Quoted 4 lines
sound/soc/qcom/lpass-apq8016.c +1
-0@@ -289,6 +289,7 @@ static struct lpass_variant apq8016_data = { .exit = apq8016_lpass_exit, .alloc_dma_channel = apq8016_lpass_alloc_dma_channel, .free_dma_channel = apq8016_lpass_free_dma_channel, + .id = I2S_INTERFACE,Before going into detail review, I see real issue in the overall approach here to add new interface to exiting lpass!!
Quoted 3 lines
Intention of struct
lpass_variantis to address differences between SoCs or different lpass versions. But you should not duplicate this and use it for addressing differences between each lpass interfaces! All the dai related register offsets should still go in to this structure and driver should be able to know which dai its talking to based onsnd_soc_dai_driverid and select correct register offset.
Do You suggest to use separate structure like struct lpass_hdmi_interface in lpass_data?
Quoted 1 line
Also on the other note, can you please split the patch if possible so that it will be easy for review. Specially I would like to see header file changes specific to adding new interface to be separate then followed by the actual interface implementation and then the user.
Okay, will split the patch.
Quoted 2 lines
I also see some unrelated changes like changing buffer sizes, which should go into different patch!
Okay we will separate the patch.
Quoted 2 lines
--srini
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
A message that is not in the archive (sent off-list or not yet received): 0101017458d94c82-96bbcff0-018e-4f5d-8273-7869c3599d32-000000@us-west-2.amazonses.com
Re: [PATCH v3 3/5] ASoC: qcom: Add support for lpass hdmi driver
Quoted 7 lines · Srinivasa Rao Mandadapu
Quoted 6 lines
Before going into detail review, I see real issue in the overall approach here to add new interface to exiting lpass!!
Intention of struct
lpass_variantis to address differences between SoCs or different lpass versions. But you should not duplicate this and use it for addressing differences between each lpass interfaces! All the dai related register offsets should still go in to this structure and driver should be able to know which dai its talking to based onsnd_soc_dai_driverid and select correct register offset.Do You suggest to use separate structure like struct
lpass_hdmi_interfaceinlpass_data?
No, you should just put every thing lpass_variant as you did but no "id" thing in that.
--srini
Re: [PATCH v3 3/5] ASoC: qcom: Add support for lpass hdmi driver
Thanks for your reply Srinivas!!!
Quoted 4 lines · Srinivas Kandagatla
Quoted 1 line · Srinivasa Rao Mandadapu
Quoted 1 line
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Before going into detail review, I see real issue in the overall approach here to add new interface to exiting lpass!!
Intention of struct
lpass_variantis to address differences between SoCs or different lpass versions. But you should not duplicate this and use it for addressing differences between each lpass interfaces! All the dai related register offsets should still go in to this structure and driver should be able to know which dai its talking to based onsnd_soc_dai_driverid and select correct register offset.Do You suggest to use separate structure like struct
lpass_hdmi_interfaceinlpass_data?No, you should just put every thing
lpass_variantas you did but no "id" thing in that.
Okay. will change accordingly.
Quoted 2 lines
--srini
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
Re: [PATCH v3 3/5] ASoC: qcom: Add support for lpass hdmi driver
In reply to Srinivas KandagatlaThanks for your reply Srinivas!!!
Quoted 4 lines · Srinivas Kandagatla
Quoted 1 line · Srinivasa Rao Mandadapu
Quoted 1 line
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Before going into detail review, I see real issue in the overall approach here to add new interface to exiting lpass!!
Intention of struct
lpass_variantis to address differences between SoCs or different lpass versions. But you should not duplicate this and use it for addressing differences between each lpass interfaces! All the dai related register offsets should still go in to this structure and driver should be able to know which dai its talking to based onsnd_soc_dai_driverid and select correct register offset.Do You suggest to use separate structure like struct
lpass_hdmi_interfaceinlpass_data?No, you should just put every thing
lpass_variantas you did but no "id" thing in that.
Okay. will change accordingly.
Quoted 2 lines
--srini
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
Re: [PATCH v3 3/5] ASoC: qcom: Add support for lpass hdmi driver
In reply to Srinivas KandagatlaThanks Srinivas For Review!!!
Quoted 77 lines · Srinivas Kandagatla
Quoted 67 lines · Srinivasa Rao Mandadapu
From: V Sujith Kumar Reddy <[email protected]>
Upadate lpass cpu and platform driver to support audio over dp. Also add
lpass-hdmi.candlpass-hdmi.h.Signed-off-by Srinivasa Rao <[email protected]>Signed-off-by V Sujith Kumar Reddy <[email protected]>---
sound/soc/qcom/Kconfig | 5 + sound/soc/qcom/Makefile | 2 + sound/soc/qcom/lpass-apq8016.c | 1 + sound/soc/qcom/lpass-cpu.c | 64 ++-- sound/soc/qcom/lpass-hdmi.c | 684
+++++++++++++++++++++++++++++++++++++++
sound/soc/qcom/lpass-hdmi.h | 129 ++++++++ sound/soc/qcom/lpass-ipq806x.c | 1 +sound/soc/qcom/lpass-lpaif-reg.h| 48 ++- sound/soc/qcom/lpass-platform.c | 287 ++++++++++++---- sound/soc/qcom/lpass.h | 88 ++++-10 files changed, 1225 insertions(+), 84 deletions(-)create mode 100644
sound/soc/qcom/lpass-hdmi.c
create mode 100644sound/soc/qcom/lpass-hdmi.hsound/soc/qcom/Kconfig +0
-0@@ -12,6 +12,10 @@ config SND_SOC_LPASS_CPUtristate
selectREGMAP_MMIO
+configSND_SOC_LPASS_HDMI
+ tristate
+ selectREGMAP_MMIO
+
configSND_SOC_LPASS_PLATFORM
tristate
selectREGMAP_MMIOsound/soc/qcom/Kconfig +0
-0@@ -30,6 +34,7 @@ config SND_SOC_LPASS_SC7180tristate
selectSND_SOC_LPASS_CPU
selectSND_SOC_LPASS_PLATFORM
+ selectSND_SOC_LPASS_HDMI
configSND_SOC_STORM
tristate "ASoC I2S support for Storm boards"sound/soc/qcom/Makefile +0
-0@@ -1,12 +1,14 @@ # SPDX-License-Identifier: GPL-2.0 # Platformsnd-soc-lpass-cpu-objs := lpass-cpu.o +snd-soc-lpass-hdmi-objs := lpass-hdmi.o snd-soc-lpass-platform-objs := lpass-platform.o snd-soc-lpass-ipq806x-objs := lpass-ipq806x.o snd-soc-lpass-apq8016-objs := lpass-apq8016.o snd-soc-lpass-sc7180-objs := lpass-sc7180.o obj-$(CONFIG_SND_SOC_LPASS_CPU) += snd-soc-lpass-cpu.o +obj-$(CONFIG_SND_SOC_LPASS_HDMI) += snd-soc-lpass-hdmi.o obj-$(CONFIG_SND_SOC_LPASS_PLATFORM) += snd-soc-lpass-platform.o obj-$(CONFIG_SND_SOC_LPASS_IPQ806X) += snd-soc-lpass-ipq806x.o obj-$(CONFIG_SND_SOC_LPASS_APQ8016) += snd-soc-lpass-apq8016.o
sound/soc/qcom/lpass-apq8016.c +0
-0sound/soc/qcom/lpass-apq8016.c static struct lpass_variant apq8016_data = { · line 292
Quoted 4 lines
sound/soc/qcom/lpass-apq8016.c +1
-0@@ -289,6 +289,7 @@ static struct lpass_variant apq8016_data = { .exit = apq8016_lpass_exit, .alloc_dma_channel = apq8016_lpass_alloc_dma_channel, .free_dma_channel = apq8016_lpass_free_dma_channel, + .id = I2S_INTERFACE,Before going into detail review, I see real issue in the overall approach here to add new interface to exiting lpass!!
Quoted 3 lines
Intention of struct
lpass_variantis to address differences between SoCs or different lpass versions. But you should not duplicate this and use it for addressing differences between each lpass interfaces! All the dai related register offsets should still go in to this structure and driver should be able to know which dai its talking to based onsnd_soc_dai_driverid and select correct register offset.
Do You suggest to use separate structure like struct lpass_hdmi_interface in lpass_data?
Quoted 1 line
Also on the other note, can you please split the patch if possible so that it will be easy for review. Specially I would like to see header file changes specific to adding new interface to be separate then followed by the actual interface implementation and then the user.
Okay, will split the patch.
Quoted 2 lines
I also see some unrelated changes like changing buffer sizes, which should go into different patch!
Okay we will separate the patch.
Quoted 2 lines
--srini
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
PATCH v3 4/5 ASoC: qcom: Add support for audio over DP
In reply to Srinivasa Rao MandadapuFrom: V Sujith Kumar Reddy <[email protected]>
Add support for audio playback over DP in lpass sc7180 platform driver. Add lpass_variant structure for hdmi data configuaration.
--- sound/soc/qcom/lpass-sc7180.c | 121 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 120 insertions(+), 1 deletion(-)
sound/soc/qcom/lpass-sc7180.c +120 -1
@@ -62,6 +62,24 @@ static struct snd_soc_dai_driver sc7180_lpass_cpu_dai_driver[] = { }, }; +static struct snd_soc_dai_driver sc7180_lpass_cpu_hdmi_dai_driver[] = { + [0 ] = { + .id =HDMI , + .name ="Hdmi" , + .playback = { + .stream_name ="Hdmi Playback" , + .formats =SNDRV_PCM_FMTBIT_S24_3LE | +SNDRV_PCM_FMTBIT_S24_LE , + .rates =SNDRV_PCM_RATE_48000 , + .rate_min =48000 , + .rate_max =48000 , + .channels_min =2 , + .channels_max =2 , + }, + .ops = &asoc_qcom_lpass_hdmi_dai_ops, + }, +}; +static int sc7180_lpass_alloc_dma_channel (struct lpass_data *drvdata,int direction) {
@@ -88,13 +106,37 @@ static int sc7180_lpass_alloc_dma_channel(struct lpass_data *drvdata,return chan; } +static int sc7180_lpass_alloc_hdmi_dma_channel (struct lpass_data *drvdata, +int direction) +{ +struct lpass_variant *v = drvdata->variant; +int chan =0 ; + +if (direction ==SNDRV_PCM_STREAM_PLAYBACK ) { + chan =find_first_zero_bit (&drvdata->dma_ch_bit_map, + v->rdma_channels); + +if (chan >= v->rdma_channels) +return -EBUSY ; + } +set_bit (chan, &drvdata->dma_ch_bit_map); + +return chan; +}static int sc7180_lpass_free_dma_channel (struct lpass_data *drvdata,int chan) {clear_bit (chan, &drvdata->dma_ch_bit_map);return 0 ; } +static int sc7180_lpass_free_hdmi_dma_channel (struct lpass_data *drvdata,int chan) +{ +clear_bit (chan, &drvdata->dma_ch_bit_map); + +return 0 ; +} +static int sc7180_lpass_init (struct platform_device *pdev) {
@@ -190,15 +232,92 @@ static struct lpass_variant sc7180_data = {"mi2s-bit-clk0" ,"mi2s-bit-clk1" , }, + .id = I2S_INTERFACE, .init = sc7180_lpass_init, .exit = sc7180_lpass_exit, .alloc_dma_channel = sc7180_lpass_alloc_dma_channel, .free_dma_channel = sc7180_lpass_free_dma_channel, }; +static struct lpass_variant sc7180_hdmi_data = { + .hdmi_tx_ctl_addr =0x1000 , + .hdmi_legacy_addr =0x1008 , + .hdmi_vbit_addr =0x610c0 , + .hdmi_ch_lsb_addr =0x61048 , + .hdmi_ch_msb_addr =0x6104c , + .ch_stride =0x8 , + .hdmi_parity_addr =0x61034 , + .hdmi_dmactl_addr =0x61038 , + .hdmi_dma_stride =0x4 , + .hdmi_DP_addr =0x610c8 , + .hdmi_sstream_addr =0x6101c , + .irq_reg_base =0x63000 , + .irq_ports =1 , + .rdma_reg_base =0x64000 , + .rdma_reg_stride =0x1000 , + .rdma_channels =4 , + + .rdma_dyncclk =REG_FIELD_ID (0x64000 ,14 ,14 ,4 ,0x1000 ), + .rdma_bursten =REG_FIELD_ID (0x64000 ,13 ,13 ,4 ,0x1000 ), + .rdma_burst8 =REG_FIELD_ID (0x64000 ,15 ,15 ,4 ,0x1000 ), + .rdma_burst16 =REG_FIELD_ID (0x64000 ,16 ,16 ,4 ,0x1000 ), + .rdma_dynburst =REG_FIELD_ID (0x64000 ,18 ,18 ,4 ,0x1000 ), + .rdma_wpscnt =REG_FIELD_ID (0x64000 ,10 ,12 ,4 ,0x1000 ), + .rdma_fifowm =REG_FIELD_ID (0x64000 ,1 ,5 ,4 ,0x1000 ), + .rdma_enable =REG_FIELD_ID (0x64000 ,0 ,0 ,4 ,0x1000 ), + + .sstream_en =REG_FIELD (0x6101c ,0 ,0 ), + .dma_sel =REG_FIELD (0x6101c ,1 ,2 ), + .auto_bbit_en =REG_FIELD (0x6101c ,3 ,3 ), + .layout =REG_FIELD (0x6101c ,4 ,4 ), + .layout_sp =REG_FIELD (0x6101c ,5 ,8 ), + .set_sp_on_en =REG_FIELD (0x6101c ,10 ,10 ), + .dp_audio =REG_FIELD (0x6101c ,11 ,11 ), + .dp_staffing_en =REG_FIELD (0x6101c ,12 ,12 ), + .dp_sp_b_hw_en =REG_FIELD (0x6101c ,13 ,13 ), + + .mute =REG_FIELD (0x610c8 ,0 ,0 ), + .as_sdp_cc =REG_FIELD (0x610c8 ,1 ,3 ), + .as_sdp_ct =REG_FIELD (0x610c8 ,4 ,7 ), + .aif_db4 =REG_FIELD (0x610c8 ,8 ,15 ), + .frequency =REG_FIELD (0x610c8 ,16 ,21 ), + .mst_index =REG_FIELD (0x610c8 ,28 ,29 ), + .dptx_index =REG_FIELD (0x610c8 ,30 ,31 ), + + .soft_reset =REG_FIELD (0x1000 ,31 ,31 ), + .force_reset =REG_FIELD (0x1000 ,30 ,30 ), + + .use_hw_chs =REG_FIELD (0x61038 ,0 ,0 ), + .use_hw_usr =REG_FIELD (0x61038 ,1 ,1 ), + .hw_chs_sel =REG_FIELD (0x61038 ,2 ,4 ), + .hw_usr_sel =REG_FIELD (0x61038 ,5 ,6 ), + + .replace_vbit =REG_FIELD (0x610c0 ,0 ,0 ), + .vbit_stream =REG_FIELD (0x610c0 ,1 ,1 ), + + .legacy_en =REG_FIELD (0x1008 ,0 ,0 ), + .calc_en =REG_FIELD (0x61034 ,0 ,0 ), + .lsb_bits =REG_FIELD (0x61048 ,0 ,31 ), + .msb_bits =REG_FIELD (0x6104c ,0 ,31 ), + + .clk_name = (const char *[]) { +"pcnoc-sway-clk" , +"audio-core" , +"pcnoc-mport-clk" , + }, + .num_clks =3 , + .id =HDMI_INTERFACE , + .dai_driver = sc7180_lpass_cpu_hdmi_dai_driver, + .num_dai =ARRAY_SIZE (sc7180_lpass_cpu_hdmi_dai_driver), + .init = sc7180_lpass_init, + .exit = sc7180_lpass_exit, + .alloc_dma_channel = sc7180_lpass_alloc_hdmi_dma_channel, + .free_dma_channel = sc7180_lpass_free_hdmi_dma_channel, + +};static const struct of_device_id sc7180_lpass_cpu_device_id[] = { {.compatible ="qcom,sc7180-lpass-cpu" , .data = &sc7180_data}, - {} + {.compatible ="qcom,sc7180-lpass-hdmi" , .data = &sc7180_hdmi_data} }; static struct platform_driver sc7180_lpass_cpu_platform_driver = {
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
Re: [PATCH v3 4/5] ASoC: qcom: Add support for audio over DP
Quoting Srinivasa Rao Mandadapu (2020-08-30 23:39:23)
Quoted 6 lines
sound/soc/qcom/lpass-sc7180.c +0
-0@@ -190,15 +232,92 @@ static struct lpass_variant sc7180_data = { "mi2s-bit-clk0",
sound/soc/qcom/lpass-sc7180.c static struct lpass_variant sc7180_data = { · line 242
Quoted 10 lines
sound/soc/qcom/lpass-sc7180.c +2
-0"mi2s-bit-clk1" , }, + .id = I2S_INTERFACE, .init = sc7180_lpass_init, .exit = sc7180_lpass_exit, .alloc_dma_channel = sc7180_lpass_alloc_dma_channel, .free_dma_channel = sc7180_lpass_free_dma_channel, }; +static struct lpass_variant sc7180_hdmi_data = {
Can this be const?
Quoted 65 lines
sound/soc/qcom/lpass-sc7180.c +65
-0+ .hdmi_tx_ctl_addr = 0x1000, + .hdmi_legacy_addr = 0x1008, + .hdmi_vbit_addr = 0x610c0, + .hdmi_ch_lsb_addr = 0x61048, + .hdmi_ch_msb_addr = 0x6104c, + .ch_stride = 0x8, + .hdmi_parity_addr = 0x61034, + .hdmi_dmactl_addr = 0x61038, + .hdmi_dma_stride = 0x4, + .hdmi_DP_addr = 0x610c8, + .hdmi_sstream_addr = 0x6101c, + .irq_reg_base = 0x63000, + .irq_ports = 1, + .rdma_reg_base = 0x64000, + .rdma_reg_stride = 0x1000, + .rdma_channels = 4, + + .rdma_dyncclk = REG_FIELD_ID(0x64000, 14, 14, 4, 0x1000), + .rdma_bursten = REG_FIELD_ID(0x64000, 13, 13, 4, 0x1000), + .rdma_burst8 = REG_FIELD_ID(0x64000, 15, 15, 4, 0x1000), + .rdma_burst16 = REG_FIELD_ID(0x64000, 16, 16, 4, 0x1000), + .rdma_dynburst = REG_FIELD_ID(0x64000, 18, 18, 4, 0x1000), + .rdma_wpscnt = REG_FIELD_ID(0x64000, 10, 12, 4, 0x1000), + .rdma_fifowm = REG_FIELD_ID(0x64000, 1, 5, 4, 0x1000), + .rdma_enable = REG_FIELD_ID(0x64000, 0, 0, 4, 0x1000), + + .sstream_en = REG_FIELD(0x6101c, 0, 0), + .dma_sel = REG_FIELD(0x6101c, 1, 2), + .auto_bbit_en = REG_FIELD(0x6101c, 3, 3), + .layout = REG_FIELD(0x6101c, 4, 4), + .layout_sp = REG_FIELD(0x6101c, 5, 8), + .set_sp_on_en = REG_FIELD(0x6101c, 10, 10), + .dp_audio = REG_FIELD(0x6101c, 11, 11), + .dp_staffing_en = REG_FIELD(0x6101c, 12, 12), + .dp_sp_b_hw_en = REG_FIELD(0x6101c, 13, 13), + + .mute = REG_FIELD(0x610c8, 0, 0), + .as_sdp_cc = REG_FIELD(0x610c8, 1, 3), + .as_sdp_ct = REG_FIELD(0x610c8, 4, 7), + .aif_db4 = REG_FIELD(0x610c8, 8, 15), + .frequency = REG_FIELD(0x610c8, 16, 21), + .mst_index = REG_FIELD(0x610c8, 28, 29), + .dptx_index = REG_FIELD(0x610c8, 30, 31), + + .soft_reset = REG_FIELD(0x1000, 31, 31), + .force_reset = REG_FIELD(0x1000, 30, 30), + + .use_hw_chs = REG_FIELD(0x61038, 0, 0), + .use_hw_usr = REG_FIELD(0x61038, 1, 1), + .hw_chs_sel = REG_FIELD(0x61038, 2, 4), + .hw_usr_sel = REG_FIELD(0x61038, 5, 6), + + .replace_vbit = REG_FIELD(0x610c0, 0, 0), + .vbit_stream = REG_FIELD(0x610c0, 1, 1), + + .legacy_en = REG_FIELD(0x1008, 0, 0), + .calc_en = REG_FIELD(0x61034, 0, 0), + .lsb_bits = REG_FIELD(0x61048, 0, 31), + .msb_bits = REG_FIELD(0x6104c, 0, 31), + + .clk_name = (const char *[]) { +"pcnoc-sway-clk" , +"audio-core" , +"pcnoc-mport-clk" , + },
sound/soc/qcom/lpass-sc7180.c static struct lpass_variant sc7180_data = { · line 317
Quoted 10 lines
sound/soc/qcom/lpass-sc7180.c +10
-0+ .num_clks = 3, + .id = HDMI_INTERFACE, + .dai_driver = sc7180_lpass_cpu_hdmi_dai_driver, + .num_dai = ARRAY_SIZE(sc7180_lpass_cpu_hdmi_dai_driver), + .init = sc7180_lpass_init, + .exit = sc7180_lpass_exit, + .alloc_dma_channel = sc7180_lpass_alloc_hdmi_dma_channel, + .free_dma_channel = sc7180_lpass_free_hdmi_dma_channel, + +};
Add a newline here?
sound/soc/qcom/lpass-sc7180.c static struct lpass_variant sc7180_data = { · line 320
Quoted 4 lines
sound/soc/qcom/lpass-sc7180.c +1
-1static const struct of_device_id sc7180_lpass_cpu_device_id[] = { {.compatible ="qcom,sc7180-lpass-cpu" , .data = &sc7180_data}, - {} + {.compatible ="qcom,sc7180-lpass-hdmi" , .data = &sc7180_hdmi_data}
This most likely needs to keep the sentinel around so that a match can be made or stop if nothing is found.
Quoted 2 lines
sound/soc/qcom/lpass-sc7180.c +0
-0};
Re: [PATCH v3 4/5] ASoC: qcom: Add support for audio over DP
Thanks Stephen, for your time for review!!!
Quoted 16 lines · Stephen Boyd
Quoting Srinivasa Rao Mandadapu (2020-08-30 23:39:23)
Quoted 15 lines
sound/soc/qcom/lpass-sc7180.c +1
-0@@ -190,15 +232,92 @@ static struct lpass_variant sc7180_data = { "mi2s-bit-clk0", "mi2s-bit-clk1", }, + .id = I2S_INTERFACE, .init = sc7180_lpass_init, .exit = sc7180_lpass_exit, .alloc_dma_channel = sc7180_lpass_alloc_dma_channel, .free_dma_channel = sc7180_lpass_free_dma_channel, };
Quoted 2 lines
sound/soc/qcom/lpass-sc7180.c static struct lpass_variant sc7180_data = { · line 242
Quoted 1 line
sound/soc/qcom/lpass-sc7180.c +1
-0+static struct lpass_variant sc7180_hdmi_data = {Can this be const?
Yes this can be constant. will change in next patch.
Quoted 69 lines
Quoted 69 lines
sound/soc/qcom/lpass-sc7180.c +68
-0+ .hdmi_tx_ctl_addr = 0x1000, + .hdmi_legacy_addr = 0x1008, + .hdmi_vbit_addr = 0x610c0, + .hdmi_ch_lsb_addr = 0x61048, + .hdmi_ch_msb_addr = 0x6104c, + .ch_stride = 0x8, + .hdmi_parity_addr = 0x61034, + .hdmi_dmactl_addr = 0x61038, + .hdmi_dma_stride = 0x4, + .hdmi_DP_addr = 0x610c8, + .hdmi_sstream_addr = 0x6101c, + .irq_reg_base = 0x63000, + .irq_ports = 1, + .rdma_reg_base = 0x64000, + .rdma_reg_stride = 0x1000, + .rdma_channels = 4, + + .rdma_dyncclk = REG_FIELD_ID(0x64000, 14, 14, 4, 0x1000), + .rdma_bursten = REG_FIELD_ID(0x64000, 13, 13, 4, 0x1000), + .rdma_burst8 = REG_FIELD_ID(0x64000, 15, 15, 4, 0x1000), + .rdma_burst16 = REG_FIELD_ID(0x64000, 16, 16, 4, 0x1000), + .rdma_dynburst = REG_FIELD_ID(0x64000, 18, 18, 4, 0x1000), + .rdma_wpscnt = REG_FIELD_ID(0x64000, 10, 12, 4, 0x1000), + .rdma_fifowm = REG_FIELD_ID(0x64000, 1, 5, 4, 0x1000), + .rdma_enable = REG_FIELD_ID(0x64000, 0, 0, 4, 0x1000), + + .sstream_en = REG_FIELD(0x6101c, 0, 0), + .dma_sel = REG_FIELD(0x6101c, 1, 2), + .auto_bbit_en = REG_FIELD(0x6101c, 3, 3), + .layout = REG_FIELD(0x6101c, 4, 4), + .layout_sp = REG_FIELD(0x6101c, 5, 8), + .set_sp_on_en = REG_FIELD(0x6101c, 10, 10), + .dp_audio = REG_FIELD(0x6101c, 11, 11), + .dp_staffing_en = REG_FIELD(0x6101c, 12, 12), + .dp_sp_b_hw_en = REG_FIELD(0x6101c, 13, 13), + + .mute = REG_FIELD(0x610c8, 0, 0), + .as_sdp_cc = REG_FIELD(0x610c8, 1, 3), + .as_sdp_ct = REG_FIELD(0x610c8, 4, 7), + .aif_db4 = REG_FIELD(0x610c8, 8, 15), + .frequency = REG_FIELD(0x610c8, 16, 21), + .mst_index = REG_FIELD(0x610c8, 28, 29), + .dptx_index = REG_FIELD(0x610c8, 30, 31), + + .soft_reset = REG_FIELD(0x1000, 31, 31), + .force_reset = REG_FIELD(0x1000, 30, 30), + + .use_hw_chs = REG_FIELD(0x61038, 0, 0), + .use_hw_usr = REG_FIELD(0x61038, 1, 1), + .hw_chs_sel = REG_FIELD(0x61038, 2, 4), + .hw_usr_sel = REG_FIELD(0x61038, 5, 6), + + .replace_vbit = REG_FIELD(0x610c0, 0, 0), + .vbit_stream = REG_FIELD(0x610c0, 1, 1), + + .legacy_en = REG_FIELD(0x1008, 0, 0), + .calc_en = REG_FIELD(0x61034, 0, 0), + .lsb_bits = REG_FIELD(0x61048, 0, 31), + .msb_bits = REG_FIELD(0x6104c, 0, 31), + + .clk_name = (const char *[]) { +"pcnoc-sway-clk" , +"audio-core" , +"pcnoc-mport-clk" , + }, + .num_clks = 3, + .id = HDMI_INTERFACE, + .dai_driver = sc7180_lpass_cpu_hdmi_dai_driver,
Quoted 8 lines
sound/soc/qcom/lpass-sc7180.c static struct lpass_variant sc7180_data = { · line 317
Quoted 7 lines
sound/soc/qcom/lpass-sc7180.c +7
-0+ .num_dai = ARRAY_SIZE(sc7180_lpass_cpu_hdmi_dai_driver), + .init = sc7180_lpass_init, + .exit = sc7180_lpass_exit, + .alloc_dma_channel = sc7180_lpass_alloc_hdmi_dma_channel, + .free_dma_channel = sc7180_lpass_free_hdmi_dma_channel, + +};Add a newline here?
okay
Quoted 7 lines
sound/soc/qcom/lpass-sc7180.c static struct lpass_variant sc7180_data = { · line 320
Quoted 5 lines
sound/soc/qcom/lpass-sc7180.c +1
-1static const struct of_device_id sc7180_lpass_cpu_device_id[] = { {.compatible ="qcom,sc7180-lpass-cpu" , .data = &sc7180_data}, - {} + {.compatible ="qcom,sc7180-lpass-hdmi" , .data = &sc7180_hdmi_data}This most likely needs to keep the sentinel around so that a match can be made or stop if nothing is found.
okay..
Quoted 3 lines
Quoted 3 lines
sound/soc/qcom/lpass-sc7180.c +0
-0};
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
PATCH v3 5/5 ASoC: qcom: Optimise lpass variant structure
In reply to Srinivasa Rao MandadapuFrom: V Sujith Kumar Reddy <[email protected]>
lpass variant structure in audio driver has I2S and HDMI register fields, which are used exclusively. To optimize memory, replace with union to select either I2S or HDMI register fields.
--- sound/soc/qcom/lpass-apq8016.c | 24 ++++----- sound/soc/qcom/lpass-cpu.c | 28 +++++----- sound/soc/qcom/lpass-hdmi.c | 57 ++++++++++---------- sound/soc/qcom/lpass-hdmi.h | 24 ++++----- sound/soc/qcom/lpass-ipq806x.c | 24 ++++----- sound/soc/qcom/lpass-lpaif-reg.h | 3 +- sound/soc/qcom/lpass-sc7180.c | 114 +++++++++++++++++++-------------------- sound/soc/qcom/lpass.h | 109 ++++++++++++++++++++----------------- 8 files changed, 200 insertions(+), 183 deletions(-)
sound/soc/qcom/lpass-apq8016.c +12 -12
@@ -228,9 +228,9 @@ static int apq8016_lpass_exit(struct platform_device *pdev)static struct lpass_variant apq8016_data = { - .i2sctrl_reg_base =0x1000 , - .i2sctrl_reg_stride =0x1000 , - .i2s_ports =4 , + .intf.i2s_intf.i2sctrl_reg_base =0x1000 , + .intf.i2s_intf.i2sctrl_reg_stride =0x1000 , + .intf.i2s_intf.i2s_ports =4 , .irq_reg_base =0x6000 , .irq_reg_stride =0x1000 , .irq_ports =3 ,
@@ -242,15 +242,15 @@ static struct lpass_variant apq8016_data = { .wrdma_reg_stride = 0x1000, .wrdma_channel_start = 5, .wrdma_channels = 2, - .loopback = REG_FIELD_ID(0x1000, 15, 15, 4, 0x1000), - .spken = REG_FIELD_ID(0x1000, 14, 14, 4, 0x1000), - .spkmode = REG_FIELD_ID(0x1000, 10, 13, 4, 0x1000), - .spkmono = REG_FIELD_ID(0x1000, 9, 9, 4, 0x1000), - .micen = REG_FIELD_ID(0x1000, 8, 8, 4, 0x1000), - .micmode = REG_FIELD_ID(0x1000, 4, 7, 4, 0x1000), - .micmono = REG_FIELD_ID(0x1000, 3, 3, 4, 0x1000), - .wssrc = REG_FIELD_ID(0x1000, 2, 2, 4, 0x1000), - .bitwidth = REG_FIELD_ID(0x1000, 0, 0, 4, 0x1000), + .intf.i2s_intf.loopback = REG_FIELD_ID(0x1000, 15, 15, 4, 0x1000), + .intf.i2s_intf.spken = REG_FIELD_ID(0x1000, 14, 14, 4, 0x1000), + .intf.i2s_intf.spkmode = REG_FIELD_ID(0x1000, 10, 13, 4, 0x1000), + .intf.i2s_intf.spkmono = REG_FIELD_ID(0x1000, 9, 9, 4, 0x1000), + .intf.i2s_intf.micen = REG_FIELD_ID(0x1000, 8, 8, 4, 0x1000), + .intf.i2s_intf.micmode = REG_FIELD_ID(0x1000, 4, 7, 4, 0x1000), + .intf.i2s_intf.micmono = REG_FIELD_ID(0x1000, 3, 3, 4, 0x1000), + .intf.i2s_intf.wssrc = REG_FIELD_ID(0x1000, 2, 2, 4, 0x1000), + .intf.i2s_intf.bitwidth = REG_FIELD_ID(0x1000, 0, 0, 4, 0x1000), .rdma_dyncclk = REG_FIELD_ID(0x8400, 12, 12, 2, 0x1000), .rdma_bursten = REG_FIELD_ID(0x8400, 11, 11, 2, 0x1000),
sound/soc/qcom/lpass-cpu.c +15 -13
@@ -34,16 +34,17 @@ static int lpass_cpu_init_i2sctl_bitfields(struct device *dev, {struct lpass_data *drvdata =dev_get_drvdata (dev);struct lpass_variant *v = drvdata->variant; - - i2sctl->loopback =devm_regmap_field_alloc (dev, map, v->loopback); - i2sctl->spken =devm_regmap_field_alloc (dev, map, v->spken); - i2sctl->spkmode =devm_regmap_field_alloc (dev, map, v->spkmode); - i2sctl->spkmono =devm_regmap_field_alloc (dev, map, v->spkmono); - i2sctl->micen =devm_regmap_field_alloc (dev, map, v->micen); - i2sctl->micmode =devm_regmap_field_alloc (dev, map, v->micmode); - i2sctl->micmono =devm_regmap_field_alloc (dev, map, v->micmono); - i2sctl->wssrc =devm_regmap_field_alloc (dev, map, v->wssrc); - i2sctl->bitwidth =devm_regmap_field_alloc (dev, map, v->bitwidth); +struct lpass_i2s_rsrc *irsrc = &v->intf.i2s_intf; + + i2sctl->loopback =devm_regmap_field_alloc (dev, map, irsrc->loopback); + i2sctl->spken =devm_regmap_field_alloc (dev, map, irsrc->spken); + i2sctl->spkmode =devm_regmap_field_alloc (dev, map, irsrc->spkmode); + i2sctl->spkmono =devm_regmap_field_alloc (dev, map, irsrc->spkmono); + i2sctl->micen =devm_regmap_field_alloc (dev, map, irsrc->micen); + i2sctl->micmode =devm_regmap_field_alloc (dev, map, irsrc->micmode); + i2sctl->micmono =devm_regmap_field_alloc (dev, map, irsrc->micmono); + i2sctl->wssrc =devm_regmap_field_alloc (dev, map, irsrc->wssrc); + i2sctl->bitwidth =devm_regmap_field_alloc (dev, map, irsrc->bitwidth); if (IS_ERR(i2sctl->loopback) || IS_ERR(i2sctl->spken) || IS_ERR(i2sctl->spkmode) || IS_ERR(i2sctl->spkmono) ||
@@ -363,9 +364,10 @@ static bool lpass_cpu_regmap_writeable(struct device *dev, unsigned int reg) {struct lpass_data *drvdata =dev_get_drvdata (dev);struct lpass_variant *v = drvdata->variant; +struct lpass_i2s_rsrc *irsrc = &v->intf.i2s_intf;int i; -for (i =0 ; i < v->i2s_ports; ++i) +for (i =0 ; i < irsrc->i2s_ports; ++i)if (reg ==LPAIF_I2SCTL_REG (v, i))return true;
@@ -405,9 +407,10 @@ static bool lpass_cpu_regmap_readable(struct device *dev, unsigned int reg) {struct lpass_data *drvdata =dev_get_drvdata (dev);struct lpass_variant *v = drvdata->variant; +struct lpass_i2s_rsrc *irsrc = &v->intf.i2s_intf;int i; -for (i =0 ; i < v->i2s_ports; ++i) +for (i =0 ; i < irsrc->i2s_ports; ++i)if (reg ==LPAIF_I2SCTL_REG (v, i))return true;
@@ -584,7 +587,6 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev) PTR_ERR((void const __force *)drvdata->lpaif));return PTR_ERR ((void const __force *)drvdata->lpaif); } -if (variant->id ==I2S_INTERFACE ) { lpass_cpu_regmap_config.max_register = LPAIF_WRDMAPER_REG(variant, variant->wrdma_channels +
sound/soc/qcom/lpass-hdmi.c +29 -28
136 lines not on this page · raw message
sound/soc/qcom/lpass-hdmi.h +12 -12
@@ -49,27 +49,27 @@#define LPASS_HDMI_TX_CTL_ADDR (v) \ - (v->hdmi_tx_ctl_addr) + (v->intf.hdmi_intf.hdmi_tx_ctl_addr)#define LPASS_HDMI_TX_LEGACY_ADDR (v) \ - (v->hdmi_legacy_addr) + (v->intf.hdmi_intf.hdmi_legacy_addr)#define LPASS_HDMI_TX_VBIT_CTL_ADDR (v) \ - (v->hdmi_vbit_addr) + (v->intf.hdmi_intf.hdmi_vbit_addr)#define LPASS_HDMI_TX_CH_LSB_ADDR (v, port) \ - (v->hdmi_ch_lsb_addr + \ - v->ch_stride * (port)) + (v->intf.hdmi_intf.hdmi_ch_lsb_addr + \ + v->intf.hdmi_intf.ch_stride * (port))#define LPASS_HDMI_TX_CH_MSB_ADDR (v, port) \ - (v->hdmi_ch_msb_addr + \ - v->ch_stride * (port)) + (v->intf.hdmi_intf.hdmi_ch_msb_addr + \ + v->intf.hdmi_intf.ch_stride * (port))#define LPASS_HDMI_TX_DMA_ADDR (v, port) \ - (v->hdmi_dmactl_addr + \ - v->hdmi_dma_stride * (port)) + (v->intf.hdmi_intf.hdmi_dmactl_addr + \ + v->intf.hdmi_intf.hdmi_dma_stride * (port))#define LPASS_HDMI_TX_PARITY_ADDR (v) \ - (v->hdmi_parity_addr) + (v->intf.hdmi_intf.hdmi_parity_addr)#define LPASS_HDMI_TX_DP_ADDR (v) \ - (v->hdmi_DP_addr) + (v->intf.hdmi_intf.hdmi_DP_addr)#define LPASS_HDMI_TX_SSTREAM_ADDR (v) \ - (v->hdmi_sstream_addr) + (v->intf.hdmi_intf.hdmi_sstream_addr)struct lpass_sstream_ctl {struct regmap_field *sstream_en;
sound/soc/qcom/lpass-ipq806x.c +12 -12
@@ -110,9 +110,9 @@ static int ipq806x_lpass_free_dma_channel(struct lpass_data *drvdata, int chan) }static struct lpass_variant ipq806x_data = { - .i2sctrl_reg_base =0x0010 , - .i2sctrl_reg_stride =0x04 , - .i2s_ports =5 , + .intf.i2s_intf.i2sctrl_reg_base =0x0010 , + .intf.i2s_intf.i2sctrl_reg_stride =0x04 , + .intf.i2s_intf.i2s_ports =5 , .irq_reg_base =0x3000 , .irq_reg_stride =0x1000 , .irq_ports =3 ,
@@ -123,15 +123,15 @@ static struct lpass_variant ipq806x_data = { .wrdma_reg_stride = 0x1000, .wrdma_channel_start = 5, .wrdma_channels = 4, - .loopback = REG_FIELD_ID(0x0010, 15, 15, 5, 0x4), - .spken = REG_FIELD_ID(0x0010, 14, 14, 5, 0x4), - .spkmode = REG_FIELD_ID(0x0010, 10, 13, 5, 0x4), - .spkmono = REG_FIELD_ID(0x0010, 9, 9, 5, 0x4), - .micen = REG_FIELD_ID(0x0010, 8, 8, 5, 0x4), - .micmode = REG_FIELD_ID(0x0010, 4, 7, 5, 0x4), - .micmono = REG_FIELD_ID(0x0010, 3, 3, 5, 0x4), - .wssrc = REG_FIELD_ID(0x0010, 2, 2, 5, 0x4), - .bitwidth = REG_FIELD_ID(0x0010, 0, 0, 5, 0x4), + .intf.i2s_intf.loopback = REG_FIELD_ID(0x0010, 15, 15, 5, 0x4), + .intf.i2s_intf.spken = REG_FIELD_ID(0x0010, 14, 14, 5, 0x4), + .intf.i2s_intf.spkmode = REG_FIELD_ID(0x0010, 10, 13, 5, 0x4), + .intf.i2s_intf.spkmono = REG_FIELD_ID(0x0010, 9, 9, 5, 0x4), + .intf.i2s_intf.micen = REG_FIELD_ID(0x0010, 8, 8, 5, 0x4), + .intf.i2s_intf.micmode = REG_FIELD_ID(0x0010, 4, 7, 5, 0x4), + .intf.i2s_intf.micmono = REG_FIELD_ID(0x0010, 3, 3, 5, 0x4), + .intf.i2s_intf.wssrc = REG_FIELD_ID(0x0010, 2, 2, 5, 0x4), + .intf.i2s_intf.bitwidth = REG_FIELD_ID(0x0010, 0, 0, 5, 0x4), .rdma_dyncclk = REG_FIELD_ID(0x6000, 12, 12, 4, 0x1000), .rdma_bursten = REG_FIELD_ID(0x6000, 11, 11, 4, 0x1000),
sound/soc/qcom/lpass-lpaif-reg.h +2 -1
@@ -9,7 +9,8 @@/* LPAIF I2S */ #define LPAIF_I2SCTL_REG_ADDR (v, addr, port) \ - (v->i2sctrl_reg_base + (addr) + v->i2sctrl_reg_stride * (port)) + (v->intf.i2s_intf.i2sctrl_reg_base + (addr) + \ + v->intf.i2s_intf.i2sctrl_reg_stride * (port))#define LPAIF_I2SCTL_REG (v, port) LPAIF_I2SCTL_REG_ADDR(v, 0x0, (port))
sound/soc/qcom/lpass-sc7180.c +57 -57
142 lines not on this page · raw message
sound/soc/qcom/lpass.h +61 -48
133 lines not on this page · raw message
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.