@@ -1072,6 +1072,16 @@ static struct attribute_group ab9540_attr_group = {
int __devinit ab8500_init(struct ab8500 *ab8500, enum ab8500_version version)
{
+ static char *switch_off_status[] = {
+ "Swoff bit programming",
+ "Thermal protection activation",
+ "Vbat lower then BattOk falling threshold",
+ "Watchdog expired",
+ "Non presence of 32kHz clock",
+ "Battery level lower than power on reset threshold",
+ "Power on key 1 pressed longer than 10 seconds",
+ "DB8500 thermal shutdown"};
+
struct ab8500_platform_data *plat = dev_get_platdata(ab8500->dev);
int ret;
int i;
@@ -1139,7 +1149,21 @@ int __devinit ab8500_init(struct ab8500 *ab8500, enum ab8500_version version)
AB8500_SWITCH_OFF_STATUS, &value);
if (ret < 0)
return ret;
- dev_info(ab8500->dev, "switch off status: %#x", value);
+ dev_info(ab8500->dev, "switch off cause(s) (%#x): ", value);
+
+ if (value) {
+ for (i = 0; i < ARRAY_SIZE(switch_off_status); i++) {
+ if (value & 1)
+ dev_info(ab8500->dev,
+ "\"\t%s\" ", switch_off_status[i]);
+ value = value >> 1;
+
+ }
+ printk("\n");
+ } else {
+ printk("None\n");
+ }
+
if (plat && plat->init)
plat->init(ab8500);