imx_enable_hdmi_phy();
}
-static int detect_i2c(struct display_info_t const *dev)
+static int detect_lvds(struct display_info_t const *dev)
{
+ /* only the following boards support LVDS connectors */
+ switch (board_type) {
+ case GW52xx:
+ case GW53xx:
+ case GW54xx:
+ case GW560x:
+ case GW5905:
+ case GW5909:
+ break;
+ default:
+ return 0;
+ }
+
return i2c_set_bus_num(dev->bus) == 0 &&
i2c_probe(dev->addr) == 0;
}
static void enable_lvds(struct display_info_t const *dev)
{
- struct iomuxc *iomux = (struct iomuxc *)
- IOMUXC_BASE_ADDR;
+ struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
/* set CH0 data width to 24bit (IOMUXC_GPR2:5 0=18bit, 1=24bit) */
u32 reg = readl(&iomux->gpr[2]);
reg |= IOMUXC_GPR2_DATA_WIDTH_CH0_24BIT;
writel(reg, &iomux->gpr[2]);
- /* Enable Backlight */
- gpio_request(IMX_GPIO_NR(1, 10), "bklt_gpio");
- gpio_direction_output(IMX_GPIO_NR(1, 10), 0);
+ /* Configure GPIO */
+ switch (board_type) {
+ case GW52xx:
+ case GW53xx:
+ case GW54xx:
+ if (!strncmp(dev->mode.name, "Hannstar", 8)) {
+ SETUP_IOMUX_PAD(PAD_SD2_CLK__GPIO1_IO10 | DIO_PAD_CFG);
+ gpio_request(IMX_GPIO_NR(1, 10), "cabc");
+ gpio_direction_output(IMX_GPIO_NR(1, 10), 0);
+ } else if (!strncmp(dev->mode.name, "DLC", 3)) {
+ SETUP_IOMUX_PAD(PAD_SD2_CLK__GPIO1_IO10 | DIO_PAD_CFG);
+ gpio_request(IMX_GPIO_NR(1, 10), "touch_rst#");
+ gpio_direction_output(IMX_GPIO_NR(1, 10), 1);
+ }
+ break;
+ default:
+ break;
+ }
+
+ /* Configure backlight */
gpio_request(IMX_GPIO_NR(1, 18), "bklt_en");
SETUP_IOMUX_PAD(PAD_SD1_CMD__GPIO1_IO18 | DIO_PAD_CFG);
gpio_direction_output(IMX_GPIO_NR(1, 18), 1);
.bus = 2,
.addr = 0x4,
.pixfmt = IPU_PIX_FMT_LVDS666,
- .detect = detect_i2c,
+ .detect = detect_lvds,
.enable = enable_lvds,
.mode = {
.name = "Hannstar-XGA",
/* DLC700JMG-T-4 */
.bus = 2,
.addr = 0x38,
- .detect = NULL,
+ .detect = detect_lvds,
.enable = enable_lvds,
.pixfmt = IPU_PIX_FMT_LVDS666,
.mode = {
.vmode = FB_VMODE_NONINTERLACED
} }, {
/* DLC0700XDP21LF-C-1 */
- .bus = 0,
- .addr = 0,
- .detect = NULL,
+ .bus = 2,
+ .addr = 0x38,
+ .detect = detect_lvds,
.enable = enable_lvds,
.pixfmt = IPU_PIX_FMT_LVDS666,
.mode = {
/* DLC800FIG-T-3 */
.bus = 2,
.addr = 0x14,
- .detect = NULL,
+ .detect = detect_lvds,
.enable = enable_lvds,
.pixfmt = IPU_PIX_FMT_LVDS666,
.mode = {
} }, {
.bus = 2,
.addr = 0x5d,
- .detect = detect_i2c,
+ .detect = detect_lvds,
.enable = enable_lvds,
.pixfmt = IPU_PIX_FMT_LVDS666,
.mode = {
| (IOMUXC_GPR3_MUX_SRC_IPU1_DI0
<<IOMUXC_GPR3_LVDS0_MUX_CTL_OFFSET);
writel(reg, &iomux->gpr[3]);
-
- /* LVDS Backlight GPIO on LVDS connector - output low */
- SETUP_IOMUX_PAD(PAD_SD2_CLK__GPIO1_IO10 | DIO_PAD_CFG);
- gpio_direction_output(IMX_GPIO_NR(1, 10), 0);
}
#endif /* CONFIG_VIDEO_IPUV3 */