ALSA: usb-audio: add support for Akai MPD16
[safe/jmp/linux-2.6] / drivers / regulator / ab3100.c
index 49aeee8..7de9509 100644 (file)
@@ -81,7 +81,7 @@ static const u8 ab3100_reg_init_order[AB3100_NUM_REGULATORS+2] = {
 #define LDO_C_VOLTAGE 2650000
 #define LDO_D_VOLTAGE 2650000
 
-static const int const ldo_e_buck_typ_voltages[] = {
+static const int ldo_e_buck_typ_voltages[] = {
        1800000,
        1400000,
        1300000,
@@ -91,7 +91,7 @@ static const int const ldo_e_buck_typ_voltages[] = {
        900000,
 };
 
-static const int const ldo_f_typ_voltages[] = {
+static const int ldo_f_typ_voltages[] = {
        1800000,
        1400000,
        1300000,
@@ -102,21 +102,21 @@ static const int const ldo_f_typ_voltages[] = {
        2650000,
 };
 
-static const int const ldo_g_typ_voltages[] = {
+static const int ldo_g_typ_voltages[] = {
        2850000,
        2750000,
        1800000,
        1500000,
 };
 
-static const int const ldo_h_typ_voltages[] = {
+static const int ldo_h_typ_voltages[] = {
        2750000,
        1800000,
        1500000,
        1200000,
 };
 
-static const int const ldo_k_typ_voltages[] = {
+static const int ldo_k_typ_voltages[] = {
        2750000,
        1800000,
 };
@@ -241,24 +241,12 @@ static int ab3100_disable_regulator(struct regulator_dev *reg)
         * LDO D is a special regulator. When it is disabled, the entire
         * system is shut down. So this is handled specially.
         */
+       pr_info("Called ab3100_disable_regulator\n");
        if (abreg->regreg == AB3100_LDO_D) {
-               int i;
-
                dev_info(&reg->dev, "disabling LDO D - shut down system\n");
-               /*
-                * Set regulators to default values, ignore any errors,
-                * we're going DOWN
-                */
-               for (i = 0; i < ARRAY_SIZE(ab3100_reg_init_order); i++) {
-                       (void) ab3100_set_register_interruptible(abreg->ab3100,
-                                       ab3100_reg_init_order[i],
-                                       abreg->plfdata->reg_initvals[i]);
-               }
-
                /* Setting LDO D to 0x00 cuts the power to the SoC */
                return ab3100_set_register_interruptible(abreg->ab3100,
                                                         AB3100_LDO_D, 0x00U);
-
        }
 
        /*
@@ -573,7 +561,7 @@ ab3100_regulator_desc[AB3100_NUM_REGULATORS] = {
  * for all the different regulators.
  */
 
-static int __init ab3100_regulators_probe(struct platform_device *pdev)
+static int __devinit ab3100_regulators_probe(struct platform_device *pdev)
 {
        struct ab3100_platform_data *plfdata = pdev->dev.platform_data;
        struct ab3100 *ab3100 = platform_get_drvdata(pdev);
@@ -607,13 +595,6 @@ static int __init ab3100_regulators_probe(struct platform_device *pdev)
                }
        }
 
-       if (err) {
-               dev_err(&pdev->dev,
-                       "LDO D regulator initialization failed with error %d\n",
-                       err);
-               return err;
-       }
-
        /* Register the regulators */
        for (i = 0; i < AB3100_NUM_REGULATORS; i++) {
                struct ab3100_regulator *reg = &ab3100_regulators[i];
@@ -660,7 +641,7 @@ static int __init ab3100_regulators_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int __exit ab3100_regulators_remove(struct platform_device *pdev)
+static int __devexit ab3100_regulators_remove(struct platform_device *pdev)
 {
        int i;
 
@@ -678,7 +659,7 @@ static struct platform_driver ab3100_regulators_driver = {
                .owner = THIS_MODULE,
        },
        .probe = ab3100_regulators_probe,
-       .remove = __exit_p(ab3100_regulators_remove),
+       .remove = __devexit_p(ab3100_regulators_remove),
 };
 
 static __init int ab3100_regulators_init(void)
@@ -688,7 +669,7 @@ static __init int ab3100_regulators_init(void)
 
 static __exit void ab3100_regulators_exit(void)
 {
-       platform_driver_register(&ab3100_regulators_driver);
+       platform_driver_unregister(&ab3100_regulators_driver);
 }
 
 subsys_initcall(ab3100_regulators_init);