gpu: arm: midgard: r12p0_04rel0: add regulator enable/disable calls
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Thu, 17 Mar 2016 11:02:01 +0000 (12:02 +0100)
committerJoonyoung Shim <jy0922.shim@samsung.com>
Thu, 7 Jul 2016 06:39:38 +0000 (15:39 +0900)
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
[jy0922.shim: apply to midgard r12p0_04rel0 with some modification]

drivers/gpu/arm/midgard/r12p0_04rel0/mali_kbase_core_linux.c

index b331f11..19d4d77 100644 (file)
@@ -3350,6 +3350,13 @@ static int power_control_init(struct platform_device *pdev)
                dev_info(kbdev->dev,
                        "Continuing without Mali regulator control\n");
                /* Allow probe to continue without regulator */
+       } else {
+               err = regulator_enable(kbdev->regulator);
+               if (err < 0) {
+                       dev_err(kbdev->dev, "Failed to enable Mali regulator\n");
+                       regulator_put(kbdev->regulator);
+                       return err;
+               }
        }
 #endif /* LINUX_VERSION_CODE >= 3, 12, 0 */
 
@@ -3397,6 +3404,7 @@ if (kbdev->clock != NULL) {
 
 #ifdef CONFIG_REGULATOR
        if (NULL != kbdev->regulator) {
+               regulator_disable(kbdev->regulator);
                regulator_put(kbdev->regulator);
                kbdev->regulator = NULL;
        }
@@ -3422,6 +3430,7 @@ static void power_control_term(struct kbase_device *kbdev)
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)) && defined(CONFIG_OF) \
                        && defined(CONFIG_REGULATOR)
        if (kbdev->regulator) {
+               regulator_disable(kbdev->regulator);
                regulator_put(kbdev->regulator);
                kbdev->regulator = NULL;
        }