]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/mfd/ab8500-core.c
mfd: db8500-prcmu: Supply the pdata_size attribute for db8500-thermal
[mirror_ubuntu-bionic-kernel.git] / drivers / mfd / ab8500-core.c
index f276352cc9ef3d2d5493f983f01d8257c6f42726..1183e6d6f5839d0094f71aa8c4a9de62f5a4d8eb 100644 (file)
@@ -458,22 +458,23 @@ static void update_latch_offset(u8 *offset, int i)
 static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500,
                                        int latch_offset, u8 latch_val)
 {
-       int int_bit = __ffs(latch_val);
-       int line, i;
+       int int_bit, line, i;
 
-       do {
-               int_bit = __ffs(latch_val);
+       for (i = 0; i < ab8500->mask_size; i++)
+               if (ab8500->irq_reg_offset[i] == latch_offset)
+                       break;
 
-               for (i = 0; i < ab8500->mask_size; i++)
-                       if (ab8500->irq_reg_offset[i] == latch_offset)
-                               break;
+       if (i >= ab8500->mask_size) {
+               dev_err(ab8500->dev, "Register offset 0x%2x not declared\n",
+                               latch_offset);
+               return -ENXIO;
+       }
 
-               if (i >= ab8500->mask_size) {
-                       dev_err(ab8500->dev, "Register offset 0x%2x not declared\n",
-                                       latch_offset);
-                       return -ENXIO;
-               }
+       /* ignore masked out interrupts */
+       latch_val &= ~ab8500->mask[i];
 
+       while (latch_val) {
+               int_bit = __ffs(latch_val);
                line = (i << 3) + int_bit;
                latch_val &= ~(1 << int_bit);
 
@@ -491,7 +492,7 @@ static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500,
                        line += 1;
 
                handle_nested_irq(ab8500->irq_base + line);
-       } while (latch_val);
+       }
 
        return 0;
 }
@@ -866,6 +867,15 @@ static struct resource ab8500_chargalg_resources[] = {};
 
 #ifdef CONFIG_DEBUG_FS
 static struct resource ab8500_debug_resources[] = {
+       {
+               .name   = "IRQ_AB8500",
+               /*
+                * Number will be filled in. NOTE: this is deliberately
+                * not flagged as an IRQ in ordet to avoid remapping using
+                * the irqdomain in the MFD core, so that this IRQ passes
+                * unremapped to the debug code.
+                */
+       },
        {
                .name   = "IRQ_FIRST",
                .start  = AB8500_INT_MAIN_EXT_CH_NOT_OK,
@@ -1096,7 +1106,7 @@ static struct mfd_cell ab8500_devs[] = {
                .of_compatible = "stericsson,ab8500-denc",
        },
        {
-               .name = "ab8500-gpio",
+               .name = "pinctrl-ab8500",
                .of_compatible = "stericsson,ab8500-gpio",
        },
        {
@@ -1107,6 +1117,7 @@ static struct mfd_cell ab8500_devs[] = {
        },
        {
                .name = "ab8500-usb",
+               .of_compatible = "stericsson,ab8500-usb",
                .num_resources = ARRAY_SIZE(ab8500_usb_resources),
                .resources = ab8500_usb_resources,
        },
@@ -1232,7 +1243,7 @@ static struct mfd_cell ab8505_devs[] = {
                .name = "ab8500-leds",
        },
        {
-               .name = "ab8500-gpio",
+               .name = "pinctrl-ab8505",
        },
        {
                .name = "ab8500-usb",
@@ -1300,7 +1311,7 @@ static struct mfd_cell ab8540_devs[] = {
                .resources = ab8500_temp_resources,
        },
        {
-               .name = "ab8500-gpio",
+               .name = "pinctrl-ab8540",
        },
        {
                .name = "ab8540-usb",
@@ -1710,6 +1721,12 @@ static int ab8500_probe(struct platform_device *pdev)
        if (ret)
                return ret;
 
+#if CONFIG_DEBUG_FS
+       /* Pass to debugfs */
+       ab8500_debug_resources[0].start = ab8500->irq;
+       ab8500_debug_resources[0].end = ab8500->irq;
+#endif
+
        if (is_ab9540(ab8500))
                ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs,
                                ARRAY_SIZE(ab9540_devs), NULL,