};
&i2s0 {
+ /* sdi: 0: from io, 1: from acodec */
+ sdi_source = <1>;
status = "okay";
-};
-
-&i2s1 {
- status = "disabled";
-};
-
-&rockchip_audio {
- dais {
- dai0 {
- audio-codec = <&codec>;
- i2s-controller = <&i2s0>;
- format = "i2s";
- //continuous-clock;
- //bitclock-inversion;
- //frame-inversion;
- //bitclock-master;
- //frame-master;
- };
- dai1 {
- audio-codec = <&codec>;
- i2s-controller = <&i2s0>;
- format = "i2s";
- //continuous-clock;
- //bitclock-inversion;
- //frame-inversion;
- //bitclock-master;
- //frame-master;
- };
- };
};
\ No newline at end of file
status = "disabled";
};
- i2s0: i2s@10220000 {
+ i2s0: i2s0@10220000 {
compatible = "rockchip-i2s";
reg = <0x10220000 0x1000>;
i2s-id = <0>;
status = "disabled";
};
- i2s1: i2s@10200000 {
+ i2s1: i2s1@10200000 {
compatible = "rockchip-i2s";
reg = <0x10200000 0x1000>;
i2s-id = <1>;
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
+#include <linux/rockchip/cpu.h>
+#include <linux/rockchip/cru.h>
+#include <linux/rockchip/grf.h>
#include <linux/slab.h>
#include <asm/dma.h>
#include <sound/core.h>
goto err;
}
+ if (soc_is_rk3126b()) {
+ int sdi_src = 0;
+
+ /* rk3126b has no i2s1 controller(i2s_8ch) */
+ if (1 == pdev->id) {
+ pr_info("rk3126b has no i2s1 controller\n");
+ ret = -ENODEV;
+ goto err;
+ }
+
+ ret = of_property_read_u32(node, "sdi_source",
+ &sdi_src);
+ if (ret < 0)
+ sdi_src = 0;
+
+ if (1 == sdi_src) {
+ int val;
+
+ /*GRF_SOC_CON*/
+ val = readl_relaxed(RK_GRF_VIRT + 0x0140);
+ val = val | 0x04000400;
+ writel_relaxed(val, RK_GRF_VIRT + 0x0140);
+ }
+ }
+
if(pdev->id >= MAX_I2S) {
dev_err(&pdev->dev, "id %d out of range\n", pdev->id);
ret = -ENOMEM;
#include <linux/device.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
+#include <linux/rockchip/cpu.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
static int rockchip_rk312x_audio_probe(struct platform_device *pdev)
{
int ret;
+
struct snd_soc_card *card = &rockchip_rk312x_snd_card;
card->dev = &pdev->dev;
return ret;
}
+ /* rk3126b workaround remap cpu dai node */
+ if (soc_is_rk3126b()) {
+ int i;
+ struct device_node *cpu_dai_node;
+
+ cpu_dai_node = of_find_node_by_name(NULL, "i2s0");
+
+ for (i = 0; i < card->num_links; i++) {
+ card->dai_link[i].cpu_of_node = cpu_dai_node;
+ card->dai_link[i].platform_of_node = cpu_dai_node;
+ }
+ }
+
ret = snd_soc_register_card(card);
if (ret)
DBG("%s() register card failed:%d\n", __func__, ret);