• Paul Walmsley's avatar
    PRM/CM: Add new PRM/CM register bit manipulation functions · df8e304e
    Paul Walmsley authored
    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: default avatarPaul Walmsley <paul@pwsan.com>
    Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
    df8e304e
cm.h 4.64 KB