#include "internal.h"
++/*
++ * Sometimes for failures during very early init the trace
++ * infrastructure isn't available early enough to be used. For this
++ * sort of problem defining LOG_DEVICE will add printks for basic
++ * register I/O on a specific device.
++ */
++#undef LOG_DEVICE
++
+ static int _regmap_update_bits(struct regmap *map, unsigned int reg,
+ unsigned int mask, unsigned int val,
+ bool *change);
+
bool regmap_writeable(struct regmap *map, unsigned int reg)
{
if (map->max_register && reg > map->max_register)
{
struct regmap *map, **m;
int ret = -EINVAL;
++ enum regmap_endian reg_endian, val_endian;
++ int i, j;
if (!bus || !config)
goto err;
* @reg_defaults_raw: Power on reset values for registers (for use with
* register cache support).
* @num_reg_defaults_raw: Number of elements in reg_defaults_raw.
++ * @reg_format_endian: Endianness for formatted register addresses. If this is
++ * DEFAULT, the @reg_format_endian_default value from the
++ * regmap bus is used.
++ * @val_format_endian: Endianness for formatted register values. If this is
++ * DEFAULT, the @reg_format_endian_default value from the
++ * regmap bus is used.
++ *
++ * @ranges: Array of configuration entries for virtual address ranges.
++ * @num_ranges: Number of range configuration entries.
*/
struct regmap_config {
const char *name;
u8 write_flag_mask;
bool use_single_rw;
+
++ enum regmap_endian reg_format_endian;
++ enum regmap_endian val_format_endian;
+++
++ const struct regmap_range_cfg *ranges;
++ unsigned int n_ranges;
++ };
++
++ /**
++ * Configuration for indirectly accessed or paged registers.
++ * Registers, mapped to this virtual range, are accessed in two steps:
++ * 1. page selector register update;
++ * 2. access through data window registers.
++ *
++ * @range_min: Address of the lowest register address in virtual range.
++ * @range_max: Address of the highest register in virtual range.
++ *
++ * @page_sel_reg: Register with selector field.
++ * @page_sel_mask: Bit shift for selector value.
++ * @page_sel_shift: Bit mask for selector value.
++ *
++ * @window_start: Address of first (lowest) register in data window.
++ * @window_len: Number of registers in data window.
++ */
++ struct regmap_range_cfg {
++ /* Registers of virtual address range */
++ unsigned int range_min;
++ unsigned int range_max;
++
++ /* Page selector for indirect addressing */
++ unsigned int selector_reg;
++ unsigned int selector_mask;
++ int selector_shift;
++
++ /* Data window (per each page) */
++ unsigned int window_start;
++ unsigned int window_len;
};
typedef int (*regmap_hw_write)(void *context, const void *data,