Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
regcache.c File Reference
#include <linux/slab.h>
#include <linux/export.h>
#include <linux/device.h>
#include <trace/events/regmap.h>
#include <linux/bsearch.h>
#include <linux/sort.h>
#include "internal.h"

Go to the source code of this file.

Functions

int regcache_init (struct regmap *map, const struct regmap_config *config)
 
void regcache_exit (struct regmap *map)
 
int regcache_read (struct regmap *map, unsigned int reg, unsigned int *value)
 
int regcache_write (struct regmap *map, unsigned int reg, unsigned int value)
 
int regcache_sync (struct regmap *map)
 
 EXPORT_SYMBOL_GPL (regcache_sync)
 
int regcache_sync_region (struct regmap *map, unsigned int min, unsigned int max)
 
 EXPORT_SYMBOL_GPL (regcache_sync_region)
 
void regcache_cache_only (struct regmap *map, bool enable)
 
 EXPORT_SYMBOL_GPL (regcache_cache_only)
 
void regcache_mark_dirty (struct regmap *map)
 
 EXPORT_SYMBOL_GPL (regcache_mark_dirty)
 
void regcache_cache_bypass (struct regmap *map, bool enable)
 
 EXPORT_SYMBOL_GPL (regcache_cache_bypass)
 
bool regcache_set_val (void *base, unsigned int idx, unsigned int val, unsigned int word_size)
 
unsigned int regcache_get_val (const void *base, unsigned int idx, unsigned int word_size)
 
int regcache_lookup_reg (struct regmap *map, unsigned int reg)
 

Function Documentation

EXPORT_SYMBOL_GPL ( regcache_sync  )
EXPORT_SYMBOL_GPL ( regcache_sync_region  )
EXPORT_SYMBOL_GPL ( regcache_cache_only  )
EXPORT_SYMBOL_GPL ( regcache_mark_dirty  )
EXPORT_SYMBOL_GPL ( regcache_cache_bypass  )
void regcache_cache_bypass ( struct regmap map,
bool  enable 
)

regcache_cache_bypass: Put a register map into cache bypass mode

: map to configure : flag if changes should not be written to the hardware

When a register map is marked with the cache bypass option, writes to the register map API will only update the hardware and not the the cache directly. This is useful when syncing the cache back to the hardware.

Definition at line 409 of file regcache.c.

void regcache_cache_only ( struct regmap map,
bool  enable 
)

regcache_cache_only: Put a register map into cache only mode

: map to configure : flag if changes should be written to the hardware

When a register map is marked as cache only writes to the register map API will only update the register cache, they will not cause any hardware changes. This is useful for allowing portions of drivers to act as though the device were functioning as normal when it is disabled for power saving reasons.

Definition at line 371 of file regcache.c.

void regcache_exit ( struct regmap map)

Definition at line 176 of file regcache.c.

unsigned int regcache_get_val ( const void base,
unsigned int  idx,
unsigned int  word_size 
)

Definition at line 450 of file regcache.c.

int regcache_init ( struct regmap map,
const struct regmap_config *  config 
)

Definition at line 95 of file regcache.c.

int regcache_lookup_reg ( struct regmap map,
unsigned int  reg 
)

Definition at line 484 of file regcache.c.

void regcache_mark_dirty ( struct regmap map)

regcache_mark_dirty: Mark the register cache as dirty

: map to mark

Mark the register cache as dirty, for example due to the device having been powered down for suspend. If the cache is not marked as dirty then the cache sync will be suppressed.

Definition at line 390 of file regcache.c.

int regcache_read ( struct regmap map,
unsigned int  reg,
unsigned int value 
)

regcache_read: Fetch the value of a given register from the cache.

: map to configure. : The register index. : The value to be returned.

Return a negative value on failure, 0 on success.

Definition at line 203 of file regcache.c.

bool regcache_set_val ( void base,
unsigned int  idx,
unsigned int  val,
unsigned int  word_size 
)

Definition at line 419 of file regcache.c.

int regcache_sync ( struct regmap map)

regcache_sync: Sync the register cache with the hardware.

: map to configure.

Any registers that should not be synced should be marked as volatile. In general drivers can choose not to use the provided syncing functionality if they so require.

Return a negative value on failure, 0 on success.

Definition at line 262 of file regcache.c.

int regcache_sync_region ( struct regmap map,
unsigned int  min,
unsigned int  max 
)

regcache_sync_region: Sync part of the register cache with the hardware.

: map to sync. : first register to sync : last register to sync

Write all non-default register values in the specified region to the hardware.

Return a negative value on failure, 0 on success.

Definition at line 325 of file regcache.c.

int regcache_write ( struct regmap map,
unsigned int  reg,
unsigned int  value 
)

regcache_write: Set the value of a given register in the cache.

: map to configure. : The register index. : The new register value.

Return a negative value on failure, 0 on success.

Definition at line 234 of file regcache.c.