aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorVirupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com>2012-04-17 03:30:14 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-05-01 07:32:46 -0400
commit44f72e53382c9c673fd54c3bab67a6b9a2d4526e (patch)
tree95c31c306d17e00f1c27f3e6a75dc3d77bcd4f81 /drivers/mfd
parentdf3df6469fd1e59284d6b5d4dd9dbe1bd7861040 (diff)
mfd: Add new resources on ab8500 AB8505 and AB9540
The AB8505 and AB9540 has extended support for micro USB resistance detection, used for detecting chargers. Let's register resources for this resource. Let's also split off the separate codec device for AB9540. Signed-off-by: Virupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/ab8500-core.c60
1 files changed, 55 insertions, 5 deletions
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 1f08704f7ae8..ae67612317a8 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -744,6 +744,39 @@ static struct resource __devinitdata ab8500_usb_resources[] = {
744 }, 744 },
745}; 745};
746 746
747static struct resource __devinitdata ab8505_iddet_resources[] = {
748 {
749 .name = "KeyDeglitch",
750 .start = AB8505_INT_KEYDEGLITCH,
751 .end = AB8505_INT_KEYDEGLITCH,
752 .flags = IORESOURCE_IRQ,
753 },
754 {
755 .name = "KP",
756 .start = AB8505_INT_KP,
757 .end = AB8505_INT_KP,
758 .flags = IORESOURCE_IRQ,
759 },
760 {
761 .name = "IKP",
762 .start = AB8505_INT_IKP,
763 .end = AB8505_INT_IKP,
764 .flags = IORESOURCE_IRQ,
765 },
766 {
767 .name = "IKR",
768 .start = AB8505_INT_IKR,
769 .end = AB8505_INT_IKR,
770 .flags = IORESOURCE_IRQ,
771 },
772 {
773 .name = "KeyStuck",
774 .start = AB8505_INT_KEYSTUCK,
775 .end = AB8505_INT_KEYSTUCK,
776 .flags = IORESOURCE_IRQ,
777 },
778};
779
747static struct resource __devinitdata ab8500_temp_resources[] = { 780static struct resource __devinitdata ab8500_temp_resources[] = {
748 { 781 {
749 .name = "AB8500_TEMP_WARM", 782 .name = "AB8500_TEMP_WARM",
@@ -803,10 +836,6 @@ static struct mfd_cell __devinitdata abx500_common_devs[] = {
803 .resources = ab8500_av_acc_detect_resources, 836 .resources = ab8500_av_acc_detect_resources,
804 }, 837 },
805 { 838 {
806 .name = "ab8500-codec",
807 },
808
809 {
810 .name = "ab8500-poweron-key", 839 .name = "ab8500-poweron-key",
811 .num_resources = ARRAY_SIZE(ab8500_poweronkey_db_resources), 840 .num_resources = ARRAY_SIZE(ab8500_poweronkey_db_resources),
812 .resources = ab8500_poweronkey_db_resources, 841 .resources = ab8500_poweronkey_db_resources,
@@ -845,6 +874,9 @@ static struct mfd_cell __devinitdata ab8500_devs[] = {
845 .num_resources = ARRAY_SIZE(ab8500_usb_resources), 874 .num_resources = ARRAY_SIZE(ab8500_usb_resources),
846 .resources = ab8500_usb_resources, 875 .resources = ab8500_usb_resources,
847 }, 876 },
877 {
878 .name = "ab8500-codec",
879 },
848}; 880};
849 881
850static struct mfd_cell __devinitdata ab9540_devs[] = { 882static struct mfd_cell __devinitdata ab9540_devs[] = {
@@ -858,6 +890,18 @@ static struct mfd_cell __devinitdata ab9540_devs[] = {
858 .num_resources = ARRAY_SIZE(ab8500_usb_resources), 890 .num_resources = ARRAY_SIZE(ab8500_usb_resources),
859 .resources = ab8500_usb_resources, 891 .resources = ab8500_usb_resources,
860 }, 892 },
893 {
894 .name = "ab9540-codec",
895 },
896};
897
898/* Device list common to ab9540 and ab8505 */
899static struct mfd_cell __devinitdata ab9540_ab8505_devs[] = {
900 {
901 .name = "ab-iddet",
902 .num_resources = ARRAY_SIZE(ab8505_iddet_resources),
903 .resources = ab8505_iddet_resources,
904 },
861}; 905};
862 906
863static ssize_t show_chip_id(struct device *dev, 907static ssize_t show_chip_id(struct device *dev,
@@ -1125,8 +1169,14 @@ int __devinit ab8500_init(struct ab8500 *ab8500, enum ab8500_version version)
1125 ab8500->irq_base); 1169 ab8500->irq_base);
1126 else 1170 else
1127 ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs, 1171 ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs,
1128 ARRAY_SIZE(ab9540_devs), NULL, 1172 ARRAY_SIZE(ab8500_devs), NULL,
1173 ab8500->irq_base);
1174
1175 if (is_ab9540(ab8500) || is_ab8505(ab8500))
1176 ret = mfd_add_devices(ab8500->dev, 0, ab9540_ab8505_devs,
1177 ARRAY_SIZE(ab9540_ab8505_devs), NULL,
1129 ab8500->irq_base); 1178 ab8500->irq_base);
1179
1130 if (ret) 1180 if (ret)
1131 goto out_freeirq; 1181 goto out_freeirq;
1132 1182