ARM: tegra: Initialize VENC refcount
Terje Bergstrom [Wed, 20 Nov 2013 06:08:52 +0000 (08:08 +0200)]
Initialize VENC refcount to 1 if power domain is already on. This
prevents an underflow of refcount when the driver power gates VENC
at probe.

Bug 1400020

Change-Id: Icf3721d3270eb8d97cf8dfb70710a5dab9555e57
signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/334061
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: Pablo Ceballos <pceballos@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>

arch/arm/mach-tegra/powergate-t12x.c

index 9e90e6d..bbcd808 100644 (file)
@@ -736,5 +736,8 @@ static struct powergate_ops tegra12x_powergate_ops = {
 
 struct powergate_ops *tegra12x_powergate_init_chip_support(void)
 {
+       if (tegra_powergate_is_powered(TEGRA_POWERGATE_VENC))
+               atomic_set(&ref_count_venc, 1);
+
        return &tegra12x_powergate_ops;
 }