#include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/pm.h>
+#include <linux/mfd/core.h>
 
 #include <asm/io.h>
 #include <asm/olpc.h>
 static int __devinit olpc_xo1_probe(struct platform_device *pdev)
 {
        struct resource *res;
+       int err;
 
        /* don't run on non-XOs */
        if (!machine_is_olpc())
                return -ENODEV;
 
+       err = mfd_shared_cell_enable(pdev);
+       if (err)
+               return err;
+
        res = platform_get_resource(pdev, IORESOURCE_IO, 0);
        if (!res) {
                dev_err(&pdev->dev, "can't fetch device resource info\n");
                return -EIO;
        }
-
-       if (!request_region(res->start, resource_size(res), DRV_NAME)) {
-               dev_err(&pdev->dev, "can't request region\n");
-               return -EIO;
-       }
-
-       if (strcmp(pdev->name, "cs5535-pms") == 0)
+       if (strcmp(pdev->name, "olpc-xo1-pms") == 0)
                pms_base = res->start;
-       else if (strcmp(pdev->name, "cs5535-acpi") == 0)
+       else if (strcmp(pdev->name, "olpc-xo1-ac-acpi") == 0)
                acpi_base = res->start;
 
        /* If we have both addresses, we can override the poweroff hook */
 
 static int __devexit olpc_xo1_remove(struct platform_device *pdev)
 {
-       struct resource *r;
-
-       r = platform_get_resource(pdev, IORESOURCE_IO, 0);
-       release_region(r->start, resource_size(r));
+       mfd_shared_cell_disable(pdev);
 
-       if (strcmp(pdev->name, "cs5535-pms") == 0)
+       if (strcmp(pdev->name, "olpc-xo1-pms") == 0)
                pms_base = 0;
-       else if (strcmp(pdev->name, "cs5535-acpi") == 0)
+       else if (strcmp(pdev->name, "olpc-xo1-acpi") == 0)
                acpi_base = 0;
 
        pm_power_off = NULL;
 
 static struct platform_driver cs5535_pms_drv = {
        .driver = {
-               .name = "cs5535-pms",
+               .name = "olpc-xo1-pms",
                .owner = THIS_MODULE,
        },
        .probe = olpc_xo1_probe,
 
 static struct platform_driver cs5535_acpi_drv = {
        .driver = {
-               .name = "cs5535-acpi",
+               .name = "olpc-xo1-acpi",
                .owner = THIS_MODULE,
        },
        .probe = olpc_xo1_probe,
 {
        int r;
 
-       r = platform_driver_register(&cs5535_pms_drv);
+       r = mfd_shared_platform_driver_register(&cs5535_pms_drv, "cs5535-pms");
        if (r)
                return r;
 
-       r = platform_driver_register(&cs5535_acpi_drv);
+       r = mfd_shared_platform_driver_register(&cs5535_acpi_drv,
+                       "cs5535-acpi");
        if (r)
-               platform_driver_unregister(&cs5535_pms_drv);
+               mfd_shared_platform_driver_unregister(&cs5535_pms_drv);
 
        return r;
 }
 
 static void __exit olpc_xo1_exit(void)
 {
-       platform_driver_unregister(&cs5535_acpi_drv);
-       platform_driver_unregister(&cs5535_pms_drv);
+       mfd_shared_platform_driver_unregister(&cs5535_acpi_drv);
+       mfd_shared_platform_driver_unregister(&cs5535_pms_drv);
 }
 
 MODULE_AUTHOR("Daniel Drake <dsd@laptop.org>");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:olpc-xo1");
+MODULE_ALIAS("platform:cs5535-pms");
 
 module_init(olpc_xo1_init);
 module_exit(olpc_xo1_exit);
 
        NR_BARS,
 };
 
+static int cs5535_mfd_res_enable(struct platform_device *pdev)
+{
+       struct resource *res;
+
+       res = platform_get_resource(pdev, IORESOURCE_IO, 0);
+       if (!res) {
+               dev_err(&pdev->dev, "can't fetch device resource info\n");
+               return -EIO;
+       }
+
+       if (!request_region(res->start, resource_size(res), DRV_NAME)) {
+               dev_err(&pdev->dev, "can't request region\n");
+               return -EIO;
+       }
+
+       return 0;
+}
+
+static int cs5535_mfd_res_disable(struct platform_device *pdev)
+{
+       struct resource *res;
+       res = platform_get_resource(pdev, IORESOURCE_IO, 0);
+       if (!res) {
+               dev_err(&pdev->dev, "can't fetch device resource info\n");
+               return -EIO;
+       }
+
+       release_region(res->start, resource_size(res));
+       return 0;
+}
+
 static __devinitdata struct resource cs5535_mfd_resources[NR_BARS];
 
 static __devinitdata struct mfd_cell cs5535_mfd_cells[] = {
                .name = "cs5535-pms",
                .num_resources = 1,
                .resources = &cs5535_mfd_resources[PMS_BAR],
+
+               .enable = cs5535_mfd_res_enable,
+               .disable = cs5535_mfd_res_disable,
        },
        {
                .id = ACPI_BAR,
                .name = "cs5535-acpi",
                .num_resources = 1,
                .resources = &cs5535_mfd_resources[ACPI_BAR],
+
+               .enable = cs5535_mfd_res_enable,
+               .disable = cs5535_mfd_res_disable,
        },
 };