/* packet config */
if ((vic != HDMI1080P_24_3D_FP) && (vic != HDMI720P_50_3D_FP) &&
(vic != HDMI720P_60_3D_FP)) {
writel(0x0000f321, HDMI_PACKET_CONFIG);
writel(0x0000000f, HDMI_PACKET_CONFIG + 4);
} else {
writel(0x00005321, HDMI_PACKET_CONFIG);
writel(0x0000000f, HDMI_PACKET_CONFIG + 4);
}
writel(0x08000000, HDMI_UNKNOWN); /* set input sync enable */
if (audio_enable)
writeb(0xc0, HDMI_VIDEO_CTRL + 3); /* hdmi mode + hdmi audio */
else
writeb(0x80, HDMI_VIDEO_CTRL + 3); /* hdmi/dvi mode */
writel(0x80000000, HDMI_CTRL); /* start hdmi controller */
if (audio_enable)
writeb(0xc0, HDMI_VIDEO_CTRL + 3); /* hdmi mode + hdmi audio */
else
writeb(0x80, HDMI_VIDEO_CTRL + 3); /* hdmi/dvi mode */
writel(0x80000000, HDMI_CTRL); /* start hdmi controller */
/* hdmi pll setting */
if ((vic == HDMI1440_480I) || (vic == HDMI1440_576I)) {
clk_div = hdmi_clk / video_timing[vic_tab].PCLK;
clk_div /= 2;
} else {
clk_div = hdmi_clk / video_timing[vic_tab].PCLK;
}
clk_div &= 0x0f;
writel((1 << 31) + (1 << 30) + (1 << 29) + (3 << 27) + (0 << 26) +
(1 << 25) + (0 << 24) + (0 << 23) + (4 << 20) + (7 << 17) +
(15 << 12) + (7 << 8) + (clk_div << 4) + (8 << 0),
HDMI_TX_DRIVER + 8);
/* tx driver setting */
writel(0xfe800000, HDMI_TX_DRIVER); /* txen enable */
上述文件中为什么有两段if-else的代码是重复的?用意何在?
|