]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00226095-1 MX6 SL: add SPDIF support in EVK
authorGary Zhang <b13634@freescale.com>
Thu, 27 Sep 2012 07:45:41 +0000 (15:45 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:29 +0000 (08:35 +0200)
HDMI AUDIO in evk comes from SPDIF TX, and add SPDIF TX support
to implement HDMI AUDIO feature

Signed-off-by: Gary Zhang <b13634@freescale.com>
arch/arm/mach-mx6/board-mx6sl_common.h
arch/arm/mach-mx6/board-mx6sl_evk.c

index e5ddcd1868c25a7fc1eb9d2988a7d85a0179610a..995e184c6cccbe20bb33418a66d555ee2281f174 100644 (file)
@@ -93,6 +93,9 @@ static iomux_v3_cfg_t mx6sl_brd_pads[] = {
        /* Audio Codec */
        MX6SL_PAD_FEC_RX_ER__GPIO_4_19, /* HEADPHONE_DET */
 
+       /* SPDIF TX */
+       MX6SL_PAD_SD2_DAT4__SPDIF_OUT1,
+
        /* UART1 */
        MX6SL_PAD_UART1_RXD__UART1_RXD,
        MX6SL_PAD_UART1_TXD__UART1_TXD,
index 825217d11b8bc150ca0856b00e3f1628620d34fd..445b12812d6a0cb09b8c4fac3c80b1682d0a556f 100644 (file)
@@ -557,6 +557,24 @@ static int __init imx6q_init_audio(void)
        return 0;
 }
 
+static int spdif_clk_set_rate(struct clk *clk, unsigned long rate)
+{
+       unsigned long rate_actual;
+       rate_actual = clk_round_rate(clk, rate);
+       clk_set_rate(clk, rate_actual);
+       return 0;
+}
+
+static struct mxc_spdif_platform_data mxc_spdif_data = {
+       .spdif_tx               = 1,
+       .spdif_rx               = 0,
+       .spdif_clk_44100        = 1,
+       .spdif_clk_48000        = -1,
+       .spdif_div_44100        = 23,
+       .spdif_clk_set_rate     = spdif_clk_set_rate,
+       .spdif_clk              = NULL,
+};
+
 static struct imxi2c_platform_data mx6_evk_i2c0_data = {
        .bitrate = 100000,
 };
@@ -1299,6 +1317,12 @@ static void __init mx6_evk_init(void)
        imx6sl_add_rngb();
        imx6sl_add_imx_pxp_v4l2();
 
+       mxc_spdif_data.spdif_core_clk = clk_get_sys("mxc_spdif.0", NULL);
+       clk_put(mxc_spdif_data.spdif_core_clk);
+       imx6q_add_spdif(&mxc_spdif_data);
+       imx6q_add_spdif_dai();
+       imx6q_add_spdif_audio_device();
+
        imx6q_add_perfmon(0);
        imx6q_add_perfmon(1);
        imx6q_add_perfmon(2);