Commit 87beab86 authored by Russell King's avatar Russell King

[ARM] Add lubbock_set_misc_wr()

This provides an atomic method to update the Lubbock board specific
register from various drivers.
parent f827cb0a
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/device.h> #include <linux/device.h>
...@@ -34,6 +35,16 @@ ...@@ -34,6 +35,16 @@
#include "generic.h" #include "generic.h"
void lubbock_set_misc_wr(unsigned int mask, unsigned int set)
{
unsigned long flags;
local_irq_save(flags);
LUB_MISC_WR = (LUB_MISC_WR & ~mask) | (set & mask);
local_irq_restore(flags);
}
EXPORT_SYMBOL(lubbock_set_misc_wr);
static unsigned long lubbock_irq_enabled; static unsigned long lubbock_irq_enabled;
static void lubbock_mask_irq(unsigned int irq) static void lubbock_mask_irq(unsigned int irq)
......
...@@ -35,3 +35,6 @@ ...@@ -35,3 +35,6 @@
#define LUB_IRQ_SET_CLR __LUB_REG(LUBBOCK_FPGA_PHYS + 0x0d0) #define LUB_IRQ_SET_CLR __LUB_REG(LUBBOCK_FPGA_PHYS + 0x0d0)
#define LUB_GP __LUB_REG(LUBBOCK_FPGA_PHYS + 0x100) #define LUB_GP __LUB_REG(LUBBOCK_FPGA_PHYS + 0x100)
#ifndef __ASSEMBLY__
extern void lubbock_set_misc_wr(unsigned int mask, unsigned int set);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment