From: Mark Brown Date: Sun, 22 Jul 2012 18:26:07 +0000 (+0100) Subject: Merge branches 'regmap-core', 'regmap-irq' and 'regmap-page' into regmap-next X-Git-Tag: MMI-PSA29.97-13-9~16335^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=38e23194e1c95e73819d25a63bcf94fe4709d4c5;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git Merge branches 'regmap-core', 'regmap-irq' and 'regmap-page' into regmap-next Conflicts (trivial context stuff): drivers/base/regmap/regmap.c include/linux/regmap.h --- 38e23194e1c95e73819d25a63bcf94fe4709d4c5 diff --cc drivers/base/regmap/regmap.c index f8a937654af2,0bcda488f11c,d912eb2d19ce..c241ae2f2f10 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@@@ -21,18 -21,6 -22,10 +22,18 @@@@ #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) @@@@ -261,7 -227,6 -293,7 +323,8 @@@@ struct regmap *regmap_init(struct devic { struct regmap *map, **m; int ret = -EINVAL; ++ enum regmap_endian reg_endian, val_endian; ++ int i, j; if (!bus || !config) goto err; diff --cc include/linux/regmap.h index 4191a4281587,58ec0cba0ae6,5f69d4ad3eb1..7f7e00df3adf --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@@@ -92,12 -84,6 -86,9 +94,15 @@@@ enum regmap_endian * @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; @@@@ -123,9 -109,6 -114,40 +128,43 @@@@ 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,