diff options
Diffstat (limited to 'drivers/mfd/ab8500-core.c')
| -rw-r--r-- | drivers/mfd/ab8500-core.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index 387705e494b9..1e9173804ede 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c | |||
| @@ -92,6 +92,8 @@ | |||
| 92 | #define AB8500_REV_REG 0x80 | 92 | #define AB8500_REV_REG 0x80 |
| 93 | #define AB8500_SWITCH_OFF_STATUS 0x00 | 93 | #define AB8500_SWITCH_OFF_STATUS 0x00 |
| 94 | 94 | ||
| 95 | #define AB8500_TURN_ON_STATUS 0x00 | ||
| 96 | |||
| 95 | /* | 97 | /* |
| 96 | * Map interrupt numbers to the LATCH and MASK register offsets, Interrupt | 98 | * Map interrupt numbers to the LATCH and MASK register offsets, Interrupt |
| 97 | * numbers are indexed into this array with (num / 8). | 99 | * numbers are indexed into this array with (num / 8). |
| @@ -293,6 +295,7 @@ static struct irq_chip ab8500_irq_chip = { | |||
| 293 | .irq_bus_lock = ab8500_irq_lock, | 295 | .irq_bus_lock = ab8500_irq_lock, |
| 294 | .irq_bus_sync_unlock = ab8500_irq_sync_unlock, | 296 | .irq_bus_sync_unlock = ab8500_irq_sync_unlock, |
| 295 | .irq_mask = ab8500_irq_mask, | 297 | .irq_mask = ab8500_irq_mask, |
| 298 | .irq_disable = ab8500_irq_mask, | ||
| 296 | .irq_unmask = ab8500_irq_unmask, | 299 | .irq_unmask = ab8500_irq_unmask, |
| 297 | }; | 300 | }; |
| 298 | 301 | ||
| @@ -811,12 +814,40 @@ static ssize_t show_switch_off_status(struct device *dev, | |||
| 811 | return sprintf(buf, "%#x\n", value); | 814 | return sprintf(buf, "%#x\n", value); |
| 812 | } | 815 | } |
| 813 | 816 | ||
| 817 | /* | ||
| 818 | * ab8500 has turned on due to (TURN_ON_STATUS): | ||
| 819 | * 0x01 PORnVbat | ||
| 820 | * 0x02 PonKey1dbF | ||
| 821 | * 0x04 PonKey2dbF | ||
| 822 | * 0x08 RTCAlarm | ||
| 823 | * 0x10 MainChDet | ||
| 824 | * 0x20 VbusDet | ||
| 825 | * 0x40 UsbIDDetect | ||
| 826 | * 0x80 Reserved | ||
| 827 | */ | ||
| 828 | static ssize_t show_turn_on_status(struct device *dev, | ||
| 829 | struct device_attribute *attr, char *buf) | ||
| 830 | { | ||
| 831 | int ret; | ||
| 832 | u8 value; | ||
| 833 | struct ab8500 *ab8500; | ||
| 834 | |||
| 835 | ab8500 = dev_get_drvdata(dev); | ||
| 836 | ret = get_register_interruptible(ab8500, AB8500_SYS_CTRL1_BLOCK, | ||
| 837 | AB8500_TURN_ON_STATUS, &value); | ||
| 838 | if (ret < 0) | ||
| 839 | return ret; | ||
| 840 | return sprintf(buf, "%#x\n", value); | ||
| 841 | } | ||
| 842 | |||
| 814 | static DEVICE_ATTR(chip_id, S_IRUGO, show_chip_id, NULL); | 843 | static DEVICE_ATTR(chip_id, S_IRUGO, show_chip_id, NULL); |
| 815 | static DEVICE_ATTR(switch_off_status, S_IRUGO, show_switch_off_status, NULL); | 844 | static DEVICE_ATTR(switch_off_status, S_IRUGO, show_switch_off_status, NULL); |
| 845 | static DEVICE_ATTR(turn_on_status, S_IRUGO, show_turn_on_status, NULL); | ||
| 816 | 846 | ||
| 817 | static struct attribute *ab8500_sysfs_entries[] = { | 847 | static struct attribute *ab8500_sysfs_entries[] = { |
| 818 | &dev_attr_chip_id.attr, | 848 | &dev_attr_chip_id.attr, |
| 819 | &dev_attr_switch_off_status.attr, | 849 | &dev_attr_switch_off_status.attr, |
| 850 | &dev_attr_turn_on_status.attr, | ||
| 820 | NULL, | 851 | NULL, |
| 821 | }; | 852 | }; |
| 822 | 853 | ||
| @@ -843,11 +874,11 @@ int __devinit ab8500_init(struct ab8500 *ab8500) | |||
| 843 | return ret; | 874 | return ret; |
| 844 | 875 | ||
| 845 | switch (value) { | 876 | switch (value) { |
| 846 | case AB8500_CUTEARLY: | ||
| 847 | case AB8500_CUT1P0: | 877 | case AB8500_CUT1P0: |
| 848 | case AB8500_CUT1P1: | 878 | case AB8500_CUT1P1: |
| 849 | case AB8500_CUT2P0: | 879 | case AB8500_CUT2P0: |
| 850 | case AB8500_CUT3P0: | 880 | case AB8500_CUT3P0: |
| 881 | case AB8500_CUT3P3: | ||
| 851 | dev_info(ab8500->dev, "detected chip, revision: %#x\n", value); | 882 | dev_info(ab8500->dev, "detected chip, revision: %#x\n", value); |
| 852 | break; | 883 | break; |
| 853 | default: | 884 | default: |
