mfd: ab8500-core: Add device tree support for AB8505
[linux-2.6-microblaze.git] / drivers / mfd / db8500-prcmu.c
index 57ac58b..26d967a 100644 (file)
@@ -3060,30 +3060,44 @@ static const struct mfd_cell db8500_prcmu_devs[] = {
 static int db8500_prcmu_register_ab8500(struct device *parent)
 {
        struct device_node *np;
-       struct resource ab8500_resource;
+       struct resource ab850x_resource;
        const struct mfd_cell ab8500_cell = {
                .name = "ab8500-core",
                .of_compatible = "stericsson,ab8500",
                .id = AB8500_VERSION_AB8500,
-               .resources = &ab8500_resource,
+               .resources = &ab850x_resource,
                .num_resources = 1,
        };
+       const struct mfd_cell ab8505_cell = {
+               .name = "ab8505-core",
+               .of_compatible = "stericsson,ab8505",
+               .id = AB8500_VERSION_AB8505,
+               .resources = &ab850x_resource,
+               .num_resources = 1,
+       };
+       const struct mfd_cell *ab850x_cell;
 
        if (!parent->of_node)
                return -ENODEV;
 
        /* Look up the device node, sneak the IRQ out of it */
        for_each_child_of_node(parent->of_node, np) {
-               if (of_device_is_compatible(np, ab8500_cell.of_compatible))
+               if (of_device_is_compatible(np, ab8500_cell.of_compatible)) {
+                       ab850x_cell = &ab8500_cell;
                        break;
+               }
+               if (of_device_is_compatible(np, ab8505_cell.of_compatible)) {
+                       ab850x_cell = &ab8505_cell;
+                       break;
+               }
        }
        if (!np) {
-               dev_info(parent, "could not find AB8500 node in the device tree\n");
+               dev_info(parent, "could not find AB850X node in the device tree\n");
                return -ENODEV;
        }
-       of_irq_to_resource_table(np, &ab8500_resource, 1);
+       of_irq_to_resource_table(np, &ab850x_resource, 1);
 
-       return mfd_add_devices(parent, 0, &ab8500_cell, 1, NULL, 0, NULL);
+       return mfd_add_devices(parent, 0, ab850x_cell, 1, NULL, 0, NULL);
 }
 
 /**