Skip to content

Commit

Permalink
add alsa driver
Browse files Browse the repository at this point in the history
Signed-off-by: gh-sxp <[email protected]>
  • Loading branch information
gh-sxp authored and RevySR committed Nov 13, 2024
1 parent 15dc6b4 commit e8c0e44
Show file tree
Hide file tree
Showing 23 changed files with 6,255 additions and 1 deletion.
8 changes: 8 additions & 0 deletions arch/riscv/boot/dts/canaan/k230-canmv.dts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
device_type = "memory";
reg = <0x0 0x0 0x0 0x20000000>;
};

sound {
status = "okay";
compatible = "canaan,k230-audio-inno";
canaan,model = "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 @@ -518,6 +518,43 @@
clock-names = "vpu";
};

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

i2s: i2s@0x9140f000 {
status = "okay";
compatible = "canaan,snps,designware-i2s";
// 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 = "canaan,k230-inno-codec";
reg = <0x0 0x9140e000 0x0 0x1000>;
clocks = <&codec_adc_mclk>,<&codec_dac_mclk>;
clock-names = "adc", "dac";
};

gpu: gpu@90800000 {
compatible = "verisilicon,gc8000ul";
reg = <0x0 0x90800000 0x0 0x1000>;
Expand Down
11 changes: 11 additions & 0 deletions arch/riscv/configs/k230_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -303,3 +303,14 @@ CONFIG_CFG80211_WEXT=y
CONFIG_MAC80211=y
CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_SOC=y
# CONFIG_SND_DESIGNWARE_I2S=y
# CONFIG_SND_DESIGNWARE_PCM=y
CONFIG_CANAAN_SND_DESIGNWARE_I2S=y
CONFIG_CANAAN_SND_DESIGNWARE_PCM=y
CONFIG_SND_SOC_K230_INNO=y
CONFIG_SND_SOC_CANAAN_K230_INNO=y
CONFIG_SND_SOC_CANAAN_K230_AUDIO=y
CONFIG_K230_PERIDMA=y
13 changes: 12 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,17 @@ 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.The DMA
provides high performance block data movement between Host memory
and the DMA subsystem. These direct memory transfers can be both in
the Host to Peripherals and Peripherals to Host transfers.

# 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 e8c0e44

Please sign in to comment.