Skip to content

Commit

Permalink
add alsa driver
Browse files Browse the repository at this point in the history
  • Loading branch information
gh-sxp committed Jul 22, 2024
1 parent bff1a08 commit 623684b
Show file tree
Hide file tree
Showing 21 changed files with 5,261 additions and 1 deletion.
9 changes: 9 additions & 0 deletions arch/riscv/boot/dts/canaan/k230-canmv.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
device_type = "memory";
reg = <0x0 0x0 0x0 0x20000000>;
};

sound {
status = "okay";
compatible = "canaan,k230-audio-inno";
canaan,model = "CANAAN_K230_I2S_INNO";
canaan,k230-i2s-controller = <&i2s>;
canaan,k230-audio-codec = <&inno_codec>;
};

};

&uart0 {
Expand Down
37 changes: 37 additions & 0 deletions arch/riscv/boot/dts/canaan/k230.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,43 @@
status = "okay";
};

pdma: pdma@0x80804000 {
#dma-cells = <4>;
dma-channels = <8>;
dma-requests = <35>;
status = "okay";
compatible = "canaan,k230-pdma";
reg = <0x0 0x80804000 0x0 0x400>;
/*interrupt-parent = <&intc>;*/
interrupts = <203 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&pdma_aclk_gate>;
};

i2s: i2s@0x9140f000 {
status = "okay";
compatible = "snps,designware-i2s";
reg = <0x0 0x9140f000 0x0 0x400>;
dmas = <&pdma 1 0xfff 0 0x14>, <&pdma 1 0xfff 0 0x15>;
dma-names = "tx", "rx";
clocks = <&audio_dev_clk>;
clock-names = "i2sclk";
};

/* audio */
audio: audio@0x9140f400 {
status = "okay";
compatible = "canaan,k230-audio";
reg = <0x0 0x9140f400 0x0 0xc00>;
};

inno_codec:inno_codec@0x9140e000{
status = "okay";
compatible = "k230,inno-codec";
reg = <0x0 0x9140e000 0x0 0x1000>;
clocks = <&codec_adc_mclk>,<&codec_dac_mclk>;
clock-names = "adc", "dac";
};

display: display-subsystem {
compatible = "canaan,display-subsystem";
ports = <&vo_out>;
Expand Down
6 changes: 6 additions & 0 deletions arch/riscv/configs/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,9 @@ CONFIG_MTD_UBI=y
CONFIG_MAILBOX=y
# TH1520 PMIC_WDT
CONFIG_TH1520_PMIC_WATCHDOG=y

CONFIG_SND_DESIGNWARE_I2S=y
CONFIG_K230_PERIDMA=y
CONFIG_SND_SOC_K230_INNO=y
CONFIG_SND_SOC_CANAAN_K230_AUDIO=y
CONFIG_SND_SOC_CANAAN_K230_INNO=y
10 changes: 9 additions & 1 deletion drivers/dma/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ config MOXART_DMA
select DMA_VIRTUAL_CHANNELS
help
Enable support for the MOXA ART SoC DMA controller.

Say Y here if you enabled MMP ADMA, otherwise say N.

config MPC512X_DMA
Expand Down Expand Up @@ -733,6 +733,14 @@ config XILINX_ZYNQMP_DPDMA
driver provides the dmaengine required by the DisplayPort subsystem
display driver.

config K230_PERIDMA
tristate "K230 Periphal DMA support"
depends on ARCH_RV64I
select DMA_ENGINE
select DMA_VIRTUAL_CHANNELS
help
Enable support for the Periphal DMA controller present in the K230 SoC.

# driver files
source "drivers/dma/bestcomm/Kconfig"

Expand Down
1 change: 1 addition & 0 deletions drivers/dma/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ obj-$(CONFIG_XGENE_DMA) += xgene-dma.o
obj-$(CONFIG_ST_FDMA) += st_fdma.o
obj-$(CONFIG_FSL_DPAA2_QDMA) += fsl-dpaa2-qdma/
obj-$(CONFIG_INTEL_LDMA) += lgm/
obj-$(CONFIG_K230_PERIDMA) += k230_peridma.o

obj-y += mediatek/
obj-y += qcom/
Expand Down
Loading

0 comments on commit 623684b

Please sign in to comment.