aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Wallin <mattias.wallin@stericsson.com>2012-09-28 03:34:24 -0400
committerLee Jones <lee.jones@linaro.org>2013-03-06 23:29:00 -0500
commitabee26cdb685fa47d3d17ec9cf39f6149ce67083 (patch)
tree27dffb6d68473910866adbf1685be565bb62fdcf
parent127629d74efff202372fbd6097e607fcb2c8a7af (diff)
mfd: ab8500-core: Show turn on status at boot
Several states can be detected when a device is initially turned on. This patch displays these states in the log. If none of the states are true, then we report that too. Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/mfd/ab8500-core.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 141572c6c392..a4120edbccf2 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -1542,6 +1542,15 @@ static int ab8500_probe(struct platform_device *pdev)
1542 "Battery level lower than power on reset threshold", 1542 "Battery level lower than power on reset threshold",
1543 "Power on key 1 pressed longer than 10 seconds", 1543 "Power on key 1 pressed longer than 10 seconds",
1544 "DB8500 thermal shutdown"}; 1544 "DB8500 thermal shutdown"};
1545 static char *turn_on_status[] = {
1546 "Battery rising (Vbat)",
1547 "Power On Key 1 dbF",
1548 "Power On Key 2 dbF",
1549 "RTC Alarm",
1550 "Main Charger Detect",
1551 "Vbus Detect (USB)",
1552 "USB ID Detect",
1553 "UART Factory Mode Detect"};
1545 struct ab8500_platform_data *plat = dev_get_platdata(&pdev->dev); 1554 struct ab8500_platform_data *plat = dev_get_platdata(&pdev->dev);
1546 const struct platform_device_id *platid = platform_get_device_id(pdev); 1555 const struct platform_device_id *platid = platform_get_device_id(pdev);
1547 enum ab8500_version version = AB8500_VERSION_UNDEFINED; 1556 enum ab8500_version version = AB8500_VERSION_UNDEFINED;
@@ -1655,9 +1664,26 @@ static int ab8500_probe(struct platform_device *pdev)
1655 } else { 1664 } else {
1656 printk(KERN_CONT " None\n"); 1665 printk(KERN_CONT " None\n");
1657 } 1666 }
1667 ret = get_register_interruptible(ab8500, AB8500_SYS_CTRL1_BLOCK,
1668 AB8500_TURN_ON_STATUS, &value);
1669 if (ret < 0)
1670 return ret;
1671 dev_info(ab8500->dev, "turn on reason(s) (%#x): ", value);
1672
1673 if (value) {
1674 for (i = 0; i < ARRAY_SIZE(turn_on_status); i++) {
1675 if (value & 1)
1676 printk("\"%s\" ", turn_on_status[i]);
1677 value = value >> 1;
1678 }
1679 printk("\n");
1680 } else {
1681 printk("None\n");
1682 }
1658 1683
1659 if (plat && plat->init) 1684 if (plat && plat->init)
1660 plat->init(ab8500); 1685 plat->init(ab8500);
1686
1661 if (is_ab9540(ab8500)) { 1687 if (is_ab9540(ab8500)) {
1662 ret = get_register_interruptible(ab8500, AB8500_CHARGER, 1688 ret = get_register_interruptible(ab8500, AB8500_CHARGER,
1663 AB8500_CH_USBCH_STAT1_REG, &value); 1689 AB8500_CH_USBCH_STAT1_REG, &value);