PRM/CM: Add new PRM/CM register bit manipulation functions
authorPaul Walmsley <paul@pwsan.com>
Thu, 3 Apr 2008 22:34:40 +0000 (16:34 -0600)
committerTony Lindgren <tony@atomide.com>
Fri, 4 Apr 2008 10:03:38 +0000 (13:03 +0300)
commitdf8e304e24a94a22766c2c8a9b3de330d1048346
tree1a380537ea983e3c78e782b2783b42e076d70b9d
parentff038038241c20db534046539f44036cf1b4d933
PRM/CM: Add new PRM/CM register bit manipulation functions

This patch implements an idea from Igor Stoppa <igor.stoppa@nokia.com>
from last year.  We use functions to modify PRM/CM register bits,
rather than open-coding those operations.

The patch provides functions that do read + AND + OR + write sequences
on CM and PRM registers: {cm,prm}_rmw_reg_bits(), and
{cm,prm}_rmw_mod_reg_bits().  Several convenience functions are then
implemented on top of those functions for setting and clearing bits:
{cm,prm}_{set,clear}_mod_reg_bits().

These functions don't provide any locking; it is expected that the caller
will handle this.

Thanks to Jouni Högander <jouni.hogander@nokia.com> for catching some
embarrassing errors in earlier versions of this code.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/cm.h
arch/arm/mach-omap2/prm.h