[ifxmips] add .32 patches
[openwrt/svn-archive/archive.git] / target / linux / ifxmips / files-2.6.32 / arch / mips / ifxmips / common / pmu.c
1 #include <linux/kernel.h>
2 #include <linux/module.h>
3 #include <linux/version.h>
4
5 #include <ifxmips.h>
6
7 void
8 ifxmips_pmu_enable(unsigned int module)
9 {
10 int err = 1000000;
11
12 ifxmips_w32(ifxmips_r32(IFXMIPS_PMU_PWDCR) & ~module, IFXMIPS_PMU_PWDCR);
13 while (--err && (ifxmips_r32(IFXMIPS_PMU_PWDSR) & module));
14
15 if (!err)
16 panic("activating PMU module failed!");
17 }
18 EXPORT_SYMBOL(ifxmips_pmu_enable);
19
20 void
21 ifxmips_pmu_disable(unsigned int module)
22 {
23 ifxmips_w32(ifxmips_r32(IFXMIPS_PMU_PWDCR) | module, IFXMIPS_PMU_PWDCR);
24 }
25 EXPORT_SYMBOL(ifxmips_pmu_disable);