]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/karo/tx6/tx6qdl.c
karo: tx6: fix duplicate const error
[karo-tx-uboot.git] / board / karo / tx6 / tx6qdl.c
index 87ff82bb892b750f3a3cd9c14797fa064f220598..930bed82aee184e71a244ae2780b71677a2d92bf 100644 (file)
@@ -82,7 +82,7 @@ char __csf_data[0] __attribute__((section(".__csf_data")));
                                             PAD_CTL_DSE_40ohm |        \
                                             PAD_CTL_SRE_SLOW)
 
-static const iomux_v3_cfg_t const tx6qdl_pads[] = {
+static const iomux_v3_cfg_t tx6qdl_pads[] = {
        /* RESET_OUT */
        MX6_PAD_GPIO_17__GPIO7_IO12 | TX6_DEFAULT_PAD_CTRL,
 
@@ -117,7 +117,7 @@ static const iomux_v3_cfg_t const tx6qdl_pads[] = {
        MX6_PAD_SD3_DAT4__GPIO7_IO01 | TX6_DEFAULT_PAD_CTRL, /* PHY INT */
 };
 
-static const iomux_v3_cfg_t const tx6qdl_fec_pads[] = {
+static const iomux_v3_cfg_t tx6qdl_fec_pads[] = {
        /* FEC functions */
        MX6_PAD_ENET_MDC__ENET_MDC | TX6_FEC_PAD_CTRL,
        MX6_PAD_ENET_MDIO__ENET_MDIO | TX6_FEC_PAD_CTRL,
@@ -134,7 +134,7 @@ static const iomux_v3_cfg_t const tx6qdl_fec_pads[] = {
        MX6_PAD_ENET_TXD0__ENET_TX_DATA0 | TX6_FEC_PAD_CTRL,
 };
 
-static const iomux_v3_cfg_t const tx6_i2c_gpio_pads[] = {
+static const iomux_v3_cfg_t tx6_i2c_gpio_pads[] = {
        /* internal I2C */
        MX6_PAD_EIM_D28__GPIO3_IO28 | MUX_CFG_SION |
        TX6_GPIO_PAD_CTRL,
@@ -142,13 +142,13 @@ static const iomux_v3_cfg_t const tx6_i2c_gpio_pads[] = {
        TX6_GPIO_PAD_CTRL,
 };
 
-static const iomux_v3_cfg_t const tx6_i2c_pads[] = {
+static const iomux_v3_cfg_t tx6_i2c_pads[] = {
        /* internal I2C */
        MX6_PAD_EIM_D28__I2C1_SDA | TX6_I2C_PAD_CTRL,
        MX6_PAD_EIM_D21__I2C1_SCL | TX6_I2C_PAD_CTRL,
 };
 
-static const struct gpio const tx6qdl_gpios[] = {
+static const struct gpio tx6qdl_gpios[] = {
        /* These two entries are used to forcefully reinitialize the I2C bus */
        { TX6_I2C1_SCL_GPIO, GPIOFLAG_INPUT, "I2C1 SCL", },
        { TX6_I2C1_SDA_GPIO, GPIOFLAG_INPUT, "I2C1 SDA", },
@@ -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();
@@ -1402,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));
 }