Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319703
b: refs/heads/master
c: b04c530
h: refs/heads/master
i:
  319701: ca60a65
  319699: 3842996
  319695: ab059aa
v: v3
  • Loading branch information
Jonas Aaberg authored and Samuel Ortiz committed Jul 8, 2012
1 parent 64e58b7 commit 10faa12
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5261e101198e7ef31a60d3aa97815a49c8b8fa20
refs/heads/master: b04c530c78464a02963adeed6b6e458535d7cd8f
24 changes: 23 additions & 1 deletion trunk/drivers/mfd/ab8500-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,15 @@ static struct attribute_group ab9540_attr_group = {

static int __devinit ab8500_probe(struct platform_device *pdev)
{
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(&pdev->dev);
const struct platform_device_id *platid = platform_get_device_id(pdev);
enum ab8500_version version = AB8500_VERSION_UNDEFINED;
Expand Down Expand Up @@ -1327,7 +1336,20 @@ static int __devinit ab8500_probe(struct platform_device *pdev)
AB8500_SWITCH_OFF_STATUS, &value);
if (ret < 0)
return ret;
dev_info(ab8500->dev, "switch off status: %#x\n", 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)
printk(KERN_CONT " \"%s\"",
switch_off_status[i]);
value = value >> 1;

}
printk(KERN_CONT "\n");
} else {
printk(KERN_CONT " None\n");
}

if (plat && plat->init)
plat->init(ab8500);
Expand Down

0 comments on commit 10faa12

Please sign in to comment.