karo: tx6: pmic: print PMIC name in boot messages
authorLothar Waßmann <LW@KARO-electronics.de>
Tue, 26 Apr 2016 13:16:57 +0000 (15:16 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 26 Apr 2016 13:16:57 +0000 (15:16 +0200)
board/karo/tx6/pmic.c

index 6e5b84c..3e4acda 100644 (file)
 static struct {
        uchar addr;
        pmic_setup_func *init;
+       const char *name;
 } i2c_addrs[] = {
 #ifdef CONFIG_LTC3676
-       { 0x3c, ltc3676_pmic_setup, },
+       { 0x3c, ltc3676_pmic_setup, "LTC3676", },
 #endif
 #ifdef CONFIG_RN5T618
-       { 0x32, rn5t618_pmic_setup, },
+       { 0x32, rn5t618_pmic_setup, "RN5T618", },
 #endif
 #ifdef CONFIG_RN5T567
-       { 0x33, rn5t567_pmic_setup, },
+       { 0x33, rn5t567_pmic_setup, "RN5T567", },
 #endif
 };
 
@@ -40,6 +41,8 @@ int tx6_pmic_init(int addr, struct pmic_regs *regs, size_t num_regs)
        int ret = -ENODEV;
        int i;
 
+       printf("PMIC: ");
+
        debug("Probing for I2C dev 0x%02x\n", addr);
        for (i = 0; i < ARRAY_SIZE(i2c_addrs); i++) {
                u8 i2c_addr = i2c_addrs[i].addr;
@@ -55,5 +58,6 @@ int tx6_pmic_init(int addr, struct pmic_regs *regs, size_t num_regs)
                        break;
                }
        }
+       printf("%s\n", i == ARRAY_SIZE(i2c_addrs) ? "N/A" : i2c_addrs[i].name);
        return ret;
 }