]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
platform: tegra: pmc: add APIs to enable/disable PMC NO_IOPOWER
authorLaxman Dewangan <ldewangan@nvidia.com>
Fri, 5 Jun 2015 11:48:49 +0000 (17:18 +0530)
committerLaxman Dewangan <ldewangan@nvidia.com>
Wed, 10 Jun 2015 03:21:11 +0000 (20:21 -0700)
Add APIs from PMC interface to enable, disable and get status
of PMC _NO_IOPOWER registers.

This register is accessed when IO rails are enabled/disabled
by client.

bug 200112685

Change-Id: Ie5e553c0537db2dddab6fc60de21762200034609
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
(cherry picked from commit e181b4746089717a371395faa551d324f3731ffe)
Reviewed-on: http://git-master/r/754980

drivers/platform/tegra/pmc.c
include/linux/tegra-pmc.h

index e543b09bb51d027639f93f6795d4ef1bfd63c65e..02d3c48ea05478424fa95cb9e949a17b7ae0bf27 100644 (file)
@@ -370,6 +370,30 @@ int tegra_pmc_io_dpd_get_status(int reg, int bit_pos)
 }
 EXPORT_SYMBOL(tegra_pmc_io_dpd_get_status);
 
+void tegra_pmc_iopower_enable(int reg, u32 bit_mask)
+{
+       tegra_pmc_register_update(reg, bit_mask, 0);
+}
+EXPORT_SYMBOL(tegra_pmc_iopower_enable);
+
+void  tegra_pmc_iopower_disable(int reg, u32 bit_mask)
+{
+       tegra_pmc_register_update(reg, bit_mask, bit_mask);
+}
+EXPORT_SYMBOL(tegra_pmc_iopower_disable);
+
+int tegra_pmc_iopower_get_status(int reg, u32 bit_mask)
+{
+       unsigned int no_iopower;
+
+       no_iopower = tegra_pmc_readl(reg);
+       if (no_iopower & bit_mask)
+               return 0;
+       else
+               return 1;
+}
+EXPORT_SYMBOL(tegra_pmc_iopower_get_status);
+
 static int tegra_pmc_get_cpu_powerdomain_id(int cpuid)
 {
        if (cpuid <= 0 || cpuid >= num_possible_cpus())
index f9b0d91edfae636eb8cc990acc35cc685df3528f..ad0ce04bc4bd5771b8b0470a34d8b06f7b381f33 100644 (file)
@@ -45,6 +45,10 @@ extern int tegra_pmc_io_dpd_enable(int reg, int bit_pos);
 extern int tegra_pmc_io_dpd_disable(int reg, int bit_pos);
 extern int tegra_pmc_io_dpd_get_status(int reg, int bit_pos);
 
+extern void tegra_pmc_iopower_enable(int reg, u32 bit_mask);
+extern void tegra_pmc_iopower_disable(int reg, u32 bit_mask);
+extern int tegra_pmc_iopower_get_status(int reg, u32 bit_mask);
+
 extern bool tegra_is_dpd_mode;
 
 struct pmc_pm_data {