/** * t1042rdb_set_monitor_port: switch the output to a different monitor port
*/ staticvoid t1042rdb_set_monitor_port(enum fsl_diu_monitor_port port)
{ void __iomem *cpld_base;
cpld_base = of_iomap(cpld_node, 0); if (!cpld_base) {
pr_err("%s: Could not map cpld registers\n", __func__); gotoexit;
}
switch (port) { case FSL_DIU_PORT_DVI: /* Enable the DVI(HDMI) port, disable the DFP and * the backlight
*/
clrbits8(cpld_base + CPLD_DIUCSR, CPLD_DIUCSR_DVIEN); break; case FSL_DIU_PORT_LVDS: /* * LVDS also needs backlight enabled, otherwise the display * will be blank.
*/ /* Enable the DFP port, disable the DVI*/
setbits8(cpld_base + CPLD_DIUCSR, 0x01 << 8);
setbits8(cpld_base + CPLD_DIUCSR, 0x01 << 4);
setbits8(cpld_base + CPLD_DIUCSR, CPLD_DIUCSR_BACKLIGHT); break; default:
pr_err("%s: Unsupported monitor port %i\n", __func__, port);
}
scfg_np = of_find_compatible_node(NULL, NULL, "fsl,t1040-scfg"); if (!scfg_np) {
pr_err("%s: Missing scfg node. Can not display video.\n",
__func__); return;
}
scfg = of_iomap(scfg_np, 0);
of_node_put(scfg_np); if (!scfg) {
pr_err("%s: Could not map device. Can not display video.\n",
__func__); return;
}
/* Convert pixclock into frequency */
temp = 1000000000000ULL;
do_div(temp, pixclock);
freq = temp;
/* * 'pxclk' is the ratio of the platform clock to the pixel clock. * This number is programmed into the PIXCLKCR register, and the valid * range of values is 2-255.
*/
pxclk = DIV_ROUND_CLOSEST(fsl_get_sys_freq(), freq);
pxclk = clamp_t(u32, pxclk, 2, 255);
/* Disable the pixel clock, and set it to non-inverted and no delay */
clrbits32(scfg + CCSR_SCFG_PIXCLKCR,
PIXCLKCR_PXCKEN | PIXCLKCR_PXCKDLY | PIXCLKCR_PXCLK_MASK);
/* Enable the clock and set the pxclk */
setbits32(scfg + CCSR_SCFG_PIXCLKCR, PIXCLKCR_PXCKEN | (pxclk << 16));
iounmap(scfg);
}
/** * t1042rdb_valid_monitor_port: set the monitor port for sysfs
*/ staticenum fsl_diu_monitor_port
t1042rdb_valid_monitor_port(enum fsl_diu_monitor_port port)
{ switch (port) { case FSL_DIU_PORT_DVI: case FSL_DIU_PORT_LVDS: return port; default: return FSL_DIU_PORT_DVI; /* Dual-link LVDS is not supported */
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.