X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=board%2Fkaro%2Ftx6%2Ftx6qdl.c;h=ffd300eb8e40f015a2770f62e23bd4686e3a1b67;hb=34c799e253097efe0f6c791d0039b55c8f0839ac;hp=b4a6fa9390f4e03340ac3335785d270612c03922;hpb=baf66ec0074dcf313c6177eb3ad69a03bb760fe4;p=karo-tx-uboot.git diff --git a/board/karo/tx6/tx6qdl.c b/board/karo/tx6/tx6qdl.c index b4a6fa9390..ffd300eb8e 100644 --- a/board/karo/tx6/tx6qdl.c +++ b/board/karo/tx6/tx6qdl.c @@ -460,10 +460,10 @@ static struct pmic_regs rn5t567_regs[] = { { RN5T567_DC2DAC_SLP, VDD_SOC_VAL_LP, }, { RN5T567_DC3DAC_SLP, VDD_DDR_VAL_LP, }, { RN5T567_DC4DAC_SLP, VDD_HIGH_VAL_LP, }, - { RN5T567_DC1CTL, DCnCTL_DCnEN | DCnMODE_SLP(DCnMODE_PSM), }, - { RN5T567_DC2CTL, DCnCTL_DCnEN | DCnMODE_SLP(DCnMODE_PSM), }, - { RN5T567_DC3CTL, DCnCTL_DCnEN | DCnMODE_SLP(DCnMODE_PSM), }, - { RN5T567_DC4CTL, DCnCTL_DCnEN | DCnMODE_SLP(DCnMODE_PSM), }, + { RN5T567_DC1CTL, DCnCTL_EN | DCnMODE_SLP(MODE_PSM), }, + { RN5T567_DC2CTL, DCnCTL_EN | DCnMODE_SLP(MODE_PSM), }, + { RN5T567_DC3CTL, DCnCTL_EN | DCnMODE_SLP(MODE_PSM), }, + { RN5T567_DC4CTL, DCnCTL_EN | DCnMODE_SLP(MODE_PSM), }, { RN5T567_LDORTC1DAC, VDD_RTC_VAL, }, { RN5T567_LDORTC1_SLOT, 0x0f, ~0x3f, }, { RN5T567_LDO1DAC, VDD_IO_INT_VAL, }, @@ -473,7 +473,7 @@ static struct pmic_regs rn5t567_regs[] = { { RN5T567_LDODIS, 0x1c, ~0x1f, }, { RN5T567_INTPOL, 0, }, { RN5T567_INTEN, 0x3, }, - { RN5T567_IREN, 0xf, }, + { RN5T567_DCIREN, 0xf, }, { RN5T567_EN_GPIR, 0, }, }; #endif @@ -809,8 +809,11 @@ enum { LED_STATE_INIT = -1, LED_STATE_OFF, LED_STATE_ON, + LED_STATE_DISABLED, }; +static int led_state = LED_STATE_INIT; + static inline int calc_blink_rate(void) { if (!tx6_temp_check_enabled) @@ -823,16 +826,20 @@ static inline int calc_blink_rate(void) void show_activity(int arg) { - static int led_state = LED_STATE_INIT; static int blink_rate; static ulong last; + int ret; if (led_state == LED_STATE_INIT) { last = get_timer(0); - gpio_set_value(TX6_LED_GPIO, 1); + ret = gpio_set_value(TX6_LED_GPIO, 1); + if (ret) { + led_state = LED_STATE_DISABLED; + return; + } led_state = LED_STATE_ON; blink_rate = calc_blink_rate(); - } else { + } else if (led_state != LED_STATE_DISABLED) { if (get_timer(last) > blink_rate) { blink_rate = calc_blink_rate(); last = get_timer_masked(); @@ -1296,10 +1303,13 @@ void lcd_ctrl_init(void *lcdbase) panel_info.vl_bpix = LCD_COLOR32; } - p->pixclock = KHZ2PICOS(refresh * - (p->xres + p->left_margin + p->right_margin + p->hsync_len) * - (p->yres + p->upper_margin + p->lower_margin + p->vsync_len) / - 1000); + if (refresh_set || p->pixclock == 0) + p->pixclock = KHZ2PICOS(refresh * + (p->xres + p->left_margin + + p->right_margin + p->hsync_len) * + (p->yres + p->upper_margin + + p->lower_margin + p->vsync_len) / + 1000); debug("Pixel clock set to %lu.%03lu MHz\n", PICOS2KHZ(p->pixclock) / 1000, PICOS2KHZ(p->pixclock) % 1000); @@ -1399,6 +1409,7 @@ static void stk5_board_init(void) printf("Failed to request stk5_gpios: %d\n", ret); return; } + led_state = LED_STATE_INIT; imx_iomux_v3_setup_multiple_pads(stk5_pads, ARRAY_SIZE(stk5_pads)); }