2 * arch/arm/mach-tegra/mc.c
4 * Copyright (C) 2010 Google, Inc.
7 * Erik Gilling <konkers@google.com>
9 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and
11 * may be copied, distributed, and modified under those terms.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
21 #include <linux/spinlock.h>
23 #include <mach/iomap.h>
26 static DEFINE_SPINLOCK(tegra_mc_lock);
28 void tegra_mc_set_priority(unsigned long client, unsigned long prio)
30 unsigned long mc_base = IO_TO_VIRT(TEGRA_MC_BASE);
31 unsigned long reg = client >> 8;
32 int field = client & 0xff;
36 spin_lock_irqsave(&tegra_mc_lock, flags);
37 val = readl(mc_base + reg);
38 val &= ~(TEGRA_MC_PRIO_MASK << field);
40 writel(val, mc_base + reg);
41 spin_unlock_irqrestore(&tegra_mc_lock, flags);