]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/kernel-video.git/blobdiff - drivers/mfd/ab8500-core.c
Merge tag 'mfd-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
[android-sdk/kernel-video.git] / drivers / mfd / ab8500-core.c
index 660a09bf456401cf7f748e5c25c236ad022284bf..e1650badd106da6e3992b219e77fdc35e20ad1c8 100644 (file)
@@ -565,15 +565,10 @@ static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np)
        else
                num_irqs = AB8500_NR_IRQS;
 
-       if (ab8500->irq_base) {
-               ab8500->domain = irq_domain_add_legacy(
-                       NULL, num_irqs, ab8500->irq_base,
-                       0, &ab8500_irq_ops, ab8500);
-       }
-       else {
-               ab8500->domain = irq_domain_add_linear(
-                       np, num_irqs, &ab8500_irq_ops, ab8500);
-       }
+       /* If ->irq_base is zero this will give a linear mapping */
+       ab8500->domain = irq_domain_add_simple(NULL,
+                       num_irqs, ab8500->irq_base,
+                       &ab8500_irq_ops, ab8500);
 
        if (!ab8500->domain) {
                dev_err(ab8500->dev, "Failed to create irqdomain\n");
@@ -591,7 +586,7 @@ int ab8500_suspend(struct ab8500 *ab8500)
                return 0;
 }
 
-static struct resource __devinitdata ab8500_gpadc_resources[] = {
+static struct resource ab8500_gpadc_resources[] = {
        {
                .name   = "HW_CONV_END",
                .start  = AB8500_INT_GP_HW_ADC_CONV_END,
@@ -606,7 +601,7 @@ static struct resource __devinitdata ab8500_gpadc_resources[] = {
        },
 };
 
-static struct resource __devinitdata ab8500_rtc_resources[] = {
+static struct resource ab8500_rtc_resources[] = {
        {
                .name   = "60S",
                .start  = AB8500_INT_RTC_60S,
@@ -621,7 +616,7 @@ static struct resource __devinitdata ab8500_rtc_resources[] = {
        },
 };
 
-static struct resource __devinitdata ab8500_poweronkey_db_resources[] = {
+static struct resource ab8500_poweronkey_db_resources[] = {
        {
                .name   = "ONKEY_DBF",
                .start  = AB8500_INT_PON_KEY1DB_F,
@@ -636,7 +631,7 @@ static struct resource __devinitdata ab8500_poweronkey_db_resources[] = {
        },
 };
 
-static struct resource __devinitdata ab8500_av_acc_detect_resources[] = {
+static struct resource ab8500_av_acc_detect_resources[] = {
        {
               .name = "ACC_DETECT_1DB_F",
               .start = AB8500_INT_ACC_DETECT_1DB_F,
@@ -675,7 +670,7 @@ static struct resource __devinitdata ab8500_av_acc_detect_resources[] = {
        },
 };
 
-static struct resource __devinitdata ab8500_charger_resources[] = {
+static struct resource ab8500_charger_resources[] = {
        {
                .name = "MAIN_CH_UNPLUG_DET",
                .start = AB8500_INT_MAIN_CH_UNPLUG_DET,
@@ -756,7 +751,7 @@ static struct resource __devinitdata ab8500_charger_resources[] = {
        },
 };
 
-static struct resource __devinitdata ab8500_btemp_resources[] = {
+static struct resource ab8500_btemp_resources[] = {
        {
                .name = "BAT_CTRL_INDB",
                .start = AB8500_INT_BAT_CTRL_INDB,
@@ -789,7 +784,7 @@ static struct resource __devinitdata ab8500_btemp_resources[] = {
        },
 };
 
-static struct resource __devinitdata ab8500_fg_resources[] = {
+static struct resource ab8500_fg_resources[] = {
        {
                .name = "NCONV_ACCU",
                .start = AB8500_INT_CCN_CONV_ACC,
@@ -828,10 +823,10 @@ static struct resource __devinitdata ab8500_fg_resources[] = {
        },
 };
 
-static struct resource __devinitdata ab8500_chargalg_resources[] = {};
+static struct resource ab8500_chargalg_resources[] = {};
 
 #ifdef CONFIG_DEBUG_FS
-static struct resource __devinitdata ab8500_debug_resources[] = {
+static struct resource ab8500_debug_resources[] = {
        {
                .name   = "IRQ_FIRST",
                .start  = AB8500_INT_MAIN_EXT_CH_NOT_OK,
@@ -847,7 +842,7 @@ static struct resource __devinitdata ab8500_debug_resources[] = {
 };
 #endif
 
-static struct resource __devinitdata ab8500_usb_resources[] = {
+static struct resource ab8500_usb_resources[] = {
        {
                .name = "ID_WAKEUP_R",
                .start = AB8500_INT_ID_WAKEUP_R,
@@ -892,7 +887,7 @@ static struct resource __devinitdata ab8500_usb_resources[] = {
        },
 };
 
-static struct resource __devinitdata ab8505_iddet_resources[] = {
+static struct resource ab8505_iddet_resources[] = {
        {
                .name  = "KeyDeglitch",
                .start = AB8505_INT_KEYDEGLITCH,
@@ -925,7 +920,7 @@ static struct resource __devinitdata ab8505_iddet_resources[] = {
        },
 };
 
-static struct resource __devinitdata ab8500_temp_resources[] = {
+static struct resource ab8500_temp_resources[] = {
        {
                .name  = "AB8500_TEMP_WARM",
                .start = AB8500_INT_TEMP_WARM,
@@ -934,7 +929,7 @@ static struct resource __devinitdata ab8500_temp_resources[] = {
        },
 };
 
-static struct mfd_cell __devinitdata abx500_common_devs[] = {
+static struct mfd_cell abx500_common_devs[] = {
 #ifdef CONFIG_DEBUG_FS
        {
                .name = "ab8500-debug",
@@ -1010,30 +1005,50 @@ static struct mfd_cell __devinitdata abx500_common_devs[] = {
        },
 };
 
-static struct mfd_cell __devinitdata ab8500_bm_devs[] = {
+static struct mfd_cell ab8500_bm_devs[] = {
        {
                .name = "ab8500-charger",
+               .of_compatible = "stericsson,ab8500-charger",
                .num_resources = ARRAY_SIZE(ab8500_charger_resources),
                .resources = ab8500_charger_resources,
+#ifndef CONFIG_OF
+               .platform_data = &ab8500_bm_data,
+               .pdata_size = sizeof(ab8500_bm_data),
+#endif
        },
        {
                .name = "ab8500-btemp",
+               .of_compatible = "stericsson,ab8500-btemp",
                .num_resources = ARRAY_SIZE(ab8500_btemp_resources),
                .resources = ab8500_btemp_resources,
+#ifndef CONFIG_OF
+               .platform_data = &ab8500_bm_data,
+               .pdata_size = sizeof(ab8500_bm_data),
+#endif
        },
        {
                .name = "ab8500-fg",
+               .of_compatible = "stericsson,ab8500-fg",
                .num_resources = ARRAY_SIZE(ab8500_fg_resources),
                .resources = ab8500_fg_resources,
+#ifndef CONFIG_OF
+               .platform_data = &ab8500_bm_data,
+               .pdata_size = sizeof(ab8500_bm_data),
+#endif
        },
        {
                .name = "ab8500-chargalg",
+               .of_compatible = "stericsson,ab8500-chargalg",
                .num_resources = ARRAY_SIZE(ab8500_chargalg_resources),
                .resources = ab8500_chargalg_resources,
+#ifndef CONFIG_OF
+               .platform_data = &ab8500_bm_data,
+               .pdata_size = sizeof(ab8500_bm_data),
+#endif
        },
 };
 
-static struct mfd_cell __devinitdata ab8500_devs[] = {
+static struct mfd_cell ab8500_devs[] = {
        {
                .name = "ab8500-gpio",
                .of_compatible = "stericsson,ab8500-gpio",
@@ -1050,7 +1065,7 @@ static struct mfd_cell __devinitdata ab8500_devs[] = {
        },
 };
 
-static struct mfd_cell __devinitdata ab9540_devs[] = {
+static struct mfd_cell ab9540_devs[] = {
        {
                .name = "ab8500-gpio",
        },
@@ -1065,7 +1080,7 @@ static struct mfd_cell __devinitdata ab9540_devs[] = {
 };
 
 /* Device list common to ab9540 and ab8505 */
-static struct mfd_cell __devinitdata ab9540_ab8505_devs[] = {
+static struct mfd_cell ab9540_ab8505_devs[] = {
        {
                .name = "ab-iddet",
                .num_resources = ARRAY_SIZE(ab8505_iddet_resources),
@@ -1216,7 +1231,7 @@ static struct attribute_group ab9540_attr_group = {
        .attrs  = ab9540_sysfs_entries,
 };
 
-static int __devinit ab8500_probe(struct platform_device *pdev)
+static int ab8500_probe(struct platform_device *pdev)
 {
        static char *switch_off_status[] = {
                "Swoff bit programming",
@@ -1427,7 +1442,7 @@ static int __devinit ab8500_probe(struct platform_device *pdev)
        return ret;
 }
 
-static int __devexit ab8500_remove(struct platform_device *pdev)
+static int ab8500_remove(struct platform_device *pdev)
 {
        struct ab8500 *ab8500 = platform_get_drvdata(pdev);
 
@@ -1455,7 +1470,7 @@ static struct platform_driver ab8500_core_driver = {
                .owner = THIS_MODULE,
        },
        .probe  = ab8500_probe,
-       .remove = __devexit_p(ab8500_remove),
+       .remove = ab8500_remove,
        .id_table = ab8500_id,
 };