Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'regmap-v4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap

Pull regmap updates from Mark Brown:
"This has been a very busy release for regmap, not just in cleaning up
the mess we got ourselves into with the endianness handling but also
in other areas too:

- Fixes for the endianness handling so that we now explicitly default
to little endian (the code used to do this by accident). This
fixes handling of explictly specified endianness on big endian
systems.

- Optimisation of the implementation of register striding.

- A refectoring of the _update_bits() code to reduce duplication.

- Fixes and enhancements for the interrupt implementation which make
it easier to use in a wider range of systems"

* tag 'regmap-v4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: (28 commits)
regmap: irq: add devm apis for regmap_{add,del}_irq_chip
regmap: replace regmap_write_bits()
regmap: irq: Enable irq retriggering for nested irqs
regmap: add regmap_fields_force_xxx() macros
regmap: add regmap_field_force_xxx() macros
regmap: merge regmap_fields_update_bits() into macro
regmap: merge regmap_fields_write() into macro
regmap: add regmap_fields_update_bits_base()
regmap: merge regmap_field_update_bits() into macro
regmap: merge regmap_field_write() into macro
regmap: add regmap_field_update_bits_base()
regmap: merge regmap_update_bits_check_async() into macro
regmap: merge regmap_update_bits_check() into macro
regmap: merge regmap_update_bits_async() into macro
regmap: merge regmap_update_bits() into macro
regmap: add regmap_update_bits_base()
regcache: flat: Introduce register strider order
regcache: Introduce the index parsing API by stride order
regmap: core: Introduce register stride order
regmap: irq: add devm apis for regmap_{add,del}_irq_chip
...

+441 -388
+7 -4
Documentation/devicetree/bindings/regmap/regmap.txt
··· 5 5 --------------------------------------------------- 6 6 1 BE 'big-endian' 7 7 2 LE 'little-endian' 8 + 3 Native 'native-endian' 8 9 9 10 For one device driver, which will run in different scenarios above 10 11 on different SoCs using the devicetree, we need one way to simplify 11 12 this. 12 13 13 - Required properties: 14 - - {big,little}-endian: these are boolean properties, if absent 15 - meaning that the CPU and the Device are in the same endianness mode, 16 - these properties are for register values and all the buffers only. 14 + Optional properties: 15 + - {big,little,native}-endian: these are boolean properties, if absent 16 + then the implementation will choose a default based on the device 17 + being controlled. These properties are for register values and all 18 + the buffers only. Native endian means that the CPU and device have 19 + the same endianness. 17 20 18 21 Examples: 19 22 Scenario 1 : CPU in LE mode & device in LE mode.
+1 -1
arch/mips/boot/dts/brcm/bcm6328.dtsi
··· 74 74 timer: timer@10000040 { 75 75 compatible = "syscon"; 76 76 reg = <0x10000040 0x2c>; 77 - little-endian; 77 + native-endian; 78 78 }; 79 79 80 80 reboot {
+1 -1
arch/mips/boot/dts/brcm/bcm6368.dtsi
··· 54 54 periph_cntl: syscon@10000000 { 55 55 compatible = "syscon"; 56 56 reg = <0x10000000 0x14>; 57 - little-endian; 57 + native-endian; 58 58 }; 59 59 60 60 reboot: syscon-reboot@10000008 {
+1 -1
arch/mips/boot/dts/brcm/bcm7125.dtsi
··· 98 98 sun_top_ctrl: syscon@404000 { 99 99 compatible = "brcm,bcm7125-sun-top-ctrl", "syscon"; 100 100 reg = <0x404000 0x60c>; 101 - little-endian; 101 + native-endian; 102 102 }; 103 103 104 104 reboot {
+1 -1
arch/mips/boot/dts/brcm/bcm7346.dtsi
··· 118 118 sun_top_ctrl: syscon@404000 { 119 119 compatible = "brcm,bcm7346-sun-top-ctrl", "syscon"; 120 120 reg = <0x404000 0x51c>; 121 - little-endian; 121 + native-endian; 122 122 }; 123 123 124 124 reboot {
+1 -1
arch/mips/boot/dts/brcm/bcm7358.dtsi
··· 112 112 sun_top_ctrl: syscon@404000 { 113 113 compatible = "brcm,bcm7358-sun-top-ctrl", "syscon"; 114 114 reg = <0x404000 0x51c>; 115 - little-endian; 115 + native-endian; 116 116 }; 117 117 118 118 reboot {
+1 -1
arch/mips/boot/dts/brcm/bcm7360.dtsi
··· 112 112 sun_top_ctrl: syscon@404000 { 113 113 compatible = "brcm,bcm7360-sun-top-ctrl", "syscon"; 114 114 reg = <0x404000 0x51c>; 115 - little-endian; 115 + native-endian; 116 116 }; 117 117 118 118 reboot {
+1 -1
arch/mips/boot/dts/brcm/bcm7362.dtsi
··· 118 118 sun_top_ctrl: syscon@404000 { 119 119 compatible = "brcm,bcm7362-sun-top-ctrl", "syscon"; 120 120 reg = <0x404000 0x51c>; 121 - little-endian; 121 + native-endian; 122 122 }; 123 123 124 124 reboot {
+1 -1
arch/mips/boot/dts/brcm/bcm7420.dtsi
··· 99 99 sun_top_ctrl: syscon@404000 { 100 100 compatible = "brcm,bcm7420-sun-top-ctrl", "syscon"; 101 101 reg = <0x404000 0x60c>; 102 - little-endian; 102 + native-endian; 103 103 }; 104 104 105 105 reboot {
+1 -1
arch/mips/boot/dts/brcm/bcm7425.dtsi
··· 100 100 sun_top_ctrl: syscon@404000 { 101 101 compatible = "brcm,bcm7425-sun-top-ctrl", "syscon"; 102 102 reg = <0x404000 0x51c>; 103 - little-endian; 103 + native-endian; 104 104 }; 105 105 106 106 reboot {
+1 -1
arch/mips/boot/dts/brcm/bcm7435.dtsi
··· 114 114 sun_top_ctrl: syscon@404000 { 115 115 compatible = "brcm,bcm7425-sun-top-ctrl", "syscon"; 116 116 reg = <0x404000 0x51c>; 117 - little-endian; 117 + native-endian; 118 118 }; 119 119 120 120 reboot {
+16
drivers/base/regmap/internal.h
··· 110 110 /* number of bits to (left) shift the reg value when formatting*/ 111 111 int reg_shift; 112 112 int reg_stride; 113 + int reg_stride_order; 113 114 114 115 /* regcache specific members */ 115 116 const struct regcache_ops *cache_ops; ··· 262 261 return dev_name(map->dev); 263 262 264 263 return map->name; 264 + } 265 + 266 + static inline unsigned int regmap_get_offset(const struct regmap *map, 267 + unsigned int index) 268 + { 269 + if (map->reg_stride_order >= 0) 270 + return index << map->reg_stride_order; 271 + else 272 + return index * map->reg_stride; 273 + } 274 + 275 + static inline unsigned int regcache_get_index_by_order(const struct regmap *map, 276 + unsigned int reg) 277 + { 278 + return reg >> map->reg_stride_order; 265 279 } 266 280 267 281 #endif
+15 -5
drivers/base/regmap/regcache-flat.c
··· 16 16 17 17 #include "internal.h" 18 18 19 + static inline unsigned int regcache_flat_get_index(const struct regmap *map, 20 + unsigned int reg) 21 + { 22 + return regcache_get_index_by_order(map, reg); 23 + } 24 + 19 25 static int regcache_flat_init(struct regmap *map) 20 26 { 21 27 int i; 22 28 unsigned int *cache; 23 29 24 - map->cache = kcalloc(map->max_register + 1, sizeof(unsigned int), 25 - GFP_KERNEL); 30 + if (!map || map->reg_stride_order < 0) 31 + return -EINVAL; 32 + 33 + map->cache = kcalloc(regcache_flat_get_index(map, map->max_register) 34 + + 1, sizeof(unsigned int), GFP_KERNEL); 26 35 if (!map->cache) 27 36 return -ENOMEM; 28 37 29 38 cache = map->cache; 30 39 31 40 for (i = 0; i < map->num_reg_defaults; i++) 32 - cache[map->reg_defaults[i].reg] = map->reg_defaults[i].def; 41 + cache[regcache_flat_get_index(map, map->reg_defaults[i].reg)] = 42 + map->reg_defaults[i].def; 33 43 34 44 return 0; 35 45 } ··· 57 47 { 58 48 unsigned int *cache = map->cache; 59 49 60 - *value = cache[reg]; 50 + *value = cache[regcache_flat_get_index(map, reg)]; 61 51 62 52 return 0; 63 53 } ··· 67 57 { 68 58 unsigned int *cache = map->cache; 69 59 70 - cache[reg] = value; 60 + cache[regcache_flat_get_index(map, reg)] = value; 71 61 72 62 return 0; 73 63 }
+32 -13
drivers/base/regmap/regcache.c
··· 30 30 int i, j; 31 31 int ret; 32 32 int count; 33 - unsigned int val; 33 + unsigned int reg, val; 34 34 void *tmp_buf; 35 35 36 36 if (!map->num_reg_defaults_raw) ··· 57 57 bool cache_bypass = map->cache_bypass; 58 58 dev_warn(map->dev, "No cache defaults, reading back from HW\n"); 59 59 60 - /* Bypass the cache access till data read from HW*/ 60 + /* Bypass the cache access till data read from HW */ 61 61 map->cache_bypass = true; 62 62 tmp_buf = kmalloc(map->cache_size_raw, GFP_KERNEL); 63 63 if (!tmp_buf) { ··· 65 65 goto err_free; 66 66 } 67 67 ret = regmap_raw_read(map, 0, tmp_buf, 68 - map->num_reg_defaults_raw); 68 + map->cache_size_raw); 69 69 map->cache_bypass = cache_bypass; 70 - if (ret < 0) 71 - goto err_cache_free; 72 - 73 - map->reg_defaults_raw = tmp_buf; 74 - map->cache_free = 1; 70 + if (ret == 0) { 71 + map->reg_defaults_raw = tmp_buf; 72 + map->cache_free = 1; 73 + } else { 74 + kfree(tmp_buf); 75 + } 75 76 } 76 77 77 78 /* fill the reg_defaults */ 78 79 for (i = 0, j = 0; i < map->num_reg_defaults_raw; i++) { 79 - if (regmap_volatile(map, i * map->reg_stride)) 80 + reg = i * map->reg_stride; 81 + 82 + if (!regmap_readable(map, reg)) 80 83 continue; 81 - val = regcache_get_val(map, map->reg_defaults_raw, i); 82 - map->reg_defaults[j].reg = i * map->reg_stride; 84 + 85 + if (regmap_volatile(map, reg)) 86 + continue; 87 + 88 + if (map->reg_defaults_raw) { 89 + val = regcache_get_val(map, map->reg_defaults_raw, i); 90 + } else { 91 + bool cache_bypass = map->cache_bypass; 92 + 93 + map->cache_bypass = true; 94 + ret = regmap_read(map, reg, &val); 95 + map->cache_bypass = cache_bypass; 96 + if (ret != 0) { 97 + dev_err(map->dev, "Failed to read %d: %d\n", 98 + reg, ret); 99 + goto err_free; 100 + } 101 + } 102 + 103 + map->reg_defaults[j].reg = reg; 83 104 map->reg_defaults[j].def = val; 84 105 j++; 85 106 } 86 107 87 108 return 0; 88 109 89 - err_cache_free: 90 - kfree(tmp_buf); 91 110 err_free: 92 111 kfree(map->reg_defaults); 93 112
+104
drivers/base/regmap/regmap-irq.c
··· 379 379 irq_set_chip_data(virq, data); 380 380 irq_set_chip(virq, &data->irq_chip); 381 381 irq_set_nested_thread(virq, 1); 382 + irq_set_parent(virq, data->irq); 382 383 irq_set_noprobe(virq); 383 384 384 385 return 0; ··· 656 655 * 657 656 * @irq: Primary IRQ for the device 658 657 * @d: regmap_irq_chip_data allocated by regmap_add_irq_chip() 658 + * 659 + * This function also dispose all mapped irq on chip. 659 660 */ 660 661 void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *d) 661 662 { 663 + unsigned int virq; 664 + int hwirq; 665 + 662 666 if (!d) 663 667 return; 664 668 665 669 free_irq(irq, d); 670 + 671 + /* Dispose all virtual irq from irq domain before removing it */ 672 + for (hwirq = 0; hwirq < d->chip->num_irqs; hwirq++) { 673 + /* Ignore hwirq if holes in the IRQ list */ 674 + if (!d->chip->irqs[hwirq].mask) 675 + continue; 676 + 677 + /* 678 + * Find the virtual irq of hwirq on chip and if it is 679 + * there then dispose it 680 + */ 681 + virq = irq_find_mapping(d->domain, hwirq); 682 + if (virq) 683 + irq_dispose_mapping(virq); 684 + } 685 + 666 686 irq_domain_remove(d->domain); 667 687 kfree(d->type_buf); 668 688 kfree(d->type_buf_def); ··· 695 673 kfree(d); 696 674 } 697 675 EXPORT_SYMBOL_GPL(regmap_del_irq_chip); 676 + 677 + static void devm_regmap_irq_chip_release(struct device *dev, void *res) 678 + { 679 + struct regmap_irq_chip_data *d = *(struct regmap_irq_chip_data **)res; 680 + 681 + regmap_del_irq_chip(d->irq, d); 682 + } 683 + 684 + static int devm_regmap_irq_chip_match(struct device *dev, void *res, void *data) 685 + 686 + { 687 + struct regmap_irq_chip_data **r = res; 688 + 689 + if (!r || !*r) { 690 + WARN_ON(!r || !*r); 691 + return 0; 692 + } 693 + return *r == data; 694 + } 695 + 696 + /** 697 + * devm_regmap_add_irq_chip(): Resource manager regmap_add_irq_chip() 698 + * 699 + * @dev: The device pointer on which irq_chip belongs to. 700 + * @map: The regmap for the device. 701 + * @irq: The IRQ the device uses to signal interrupts 702 + * @irq_flags: The IRQF_ flags to use for the primary interrupt. 703 + * @chip: Configuration for the interrupt controller. 704 + * @data: Runtime data structure for the controller, allocated on success 705 + * 706 + * Returns 0 on success or an errno on failure. 707 + * 708 + * The regmap_irq_chip data automatically be released when the device is 709 + * unbound. 710 + */ 711 + int devm_regmap_add_irq_chip(struct device *dev, struct regmap *map, int irq, 712 + int irq_flags, int irq_base, 713 + const struct regmap_irq_chip *chip, 714 + struct regmap_irq_chip_data **data) 715 + { 716 + struct regmap_irq_chip_data **ptr, *d; 717 + int ret; 718 + 719 + ptr = devres_alloc(devm_regmap_irq_chip_release, sizeof(*ptr), 720 + GFP_KERNEL); 721 + if (!ptr) 722 + return -ENOMEM; 723 + 724 + ret = regmap_add_irq_chip(map, irq, irq_flags, irq_base, 725 + chip, &d); 726 + if (ret < 0) { 727 + devres_free(ptr); 728 + return ret; 729 + } 730 + 731 + *ptr = d; 732 + devres_add(dev, ptr); 733 + *data = d; 734 + return 0; 735 + } 736 + EXPORT_SYMBOL_GPL(devm_regmap_add_irq_chip); 737 + 738 + /** 739 + * devm_regmap_del_irq_chip(): Resource managed regmap_del_irq_chip() 740 + * 741 + * @dev: Device for which which resource was allocated. 742 + * @irq: Primary IRQ for the device 743 + * @d: regmap_irq_chip_data allocated by regmap_add_irq_chip() 744 + */ 745 + void devm_regmap_del_irq_chip(struct device *dev, int irq, 746 + struct regmap_irq_chip_data *data) 747 + { 748 + int rc; 749 + 750 + WARN_ON(irq != data->irq); 751 + rc = devres_release(dev, devm_regmap_irq_chip_release, 752 + devm_regmap_irq_chip_match, data); 753 + 754 + if (rc != 0) 755 + WARN_ON(rc); 756 + } 757 + EXPORT_SYMBOL_GPL(devm_regmap_del_irq_chip); 698 758 699 759 /** 700 760 * regmap_irq_chip_get_base(): Retrieve interrupt base for a regmap IRQ chip
+141 -122
drivers/base/regmap/regmap-mmio.c
··· 25 25 26 26 struct regmap_mmio_context { 27 27 void __iomem *regs; 28 - unsigned reg_bytes; 29 28 unsigned val_bytes; 30 - unsigned pad_bytes; 31 29 struct clk *clk; 32 - }; 33 30 34 - static inline void regmap_mmio_regsize_check(size_t reg_size) 35 - { 36 - switch (reg_size) { 37 - case 1: 38 - case 2: 39 - case 4: 40 - #ifdef CONFIG_64BIT 41 - case 8: 42 - #endif 43 - break; 44 - default: 45 - BUG(); 46 - } 47 - } 31 + void (*reg_write)(struct regmap_mmio_context *ctx, 32 + unsigned int reg, unsigned int val); 33 + unsigned int (*reg_read)(struct regmap_mmio_context *ctx, 34 + unsigned int reg); 35 + }; 48 36 49 37 static int regmap_mmio_regbits_check(size_t reg_bits) 50 38 { ··· 76 88 return min_stride; 77 89 } 78 90 79 - static inline void regmap_mmio_count_check(size_t count, u32 offset) 91 + static void regmap_mmio_write8(struct regmap_mmio_context *ctx, 92 + unsigned int reg, 93 + unsigned int val) 80 94 { 81 - BUG_ON(count <= offset); 95 + writeb(val, ctx->regs + reg); 82 96 } 83 97 84 - static inline unsigned int 85 - regmap_mmio_get_offset(const void *reg, size_t reg_size) 98 + static void regmap_mmio_write16le(struct regmap_mmio_context *ctx, 99 + unsigned int reg, 100 + unsigned int val) 86 101 { 87 - switch (reg_size) { 88 - case 1: 89 - return *(u8 *)reg; 90 - case 2: 91 - return *(u16 *)reg; 92 - case 4: 93 - return *(u32 *)reg; 102 + writew(val, ctx->regs + reg); 103 + } 104 + 105 + static void regmap_mmio_write16be(struct regmap_mmio_context *ctx, 106 + unsigned int reg, 107 + unsigned int val) 108 + { 109 + iowrite16be(val, ctx->regs + reg); 110 + } 111 + 112 + static void regmap_mmio_write32le(struct regmap_mmio_context *ctx, 113 + unsigned int reg, 114 + unsigned int val) 115 + { 116 + writel(val, ctx->regs + reg); 117 + } 118 + 119 + static void regmap_mmio_write32be(struct regmap_mmio_context *ctx, 120 + unsigned int reg, 121 + unsigned int val) 122 + { 123 + iowrite32be(val, ctx->regs + reg); 124 + } 125 + 94 126 #ifdef CONFIG_64BIT 95 - case 8: 96 - return *(u64 *)reg; 97 - #endif 98 - default: 99 - BUG(); 100 - } 127 + static void regmap_mmio_write64le(struct regmap_mmio_context *ctx, 128 + unsigned int reg, 129 + unsigned int val) 130 + { 131 + writeq(val, ctx->regs + reg); 101 132 } 133 + #endif 102 134 103 - static int regmap_mmio_gather_write(void *context, 104 - const void *reg, size_t reg_size, 105 - const void *val, size_t val_size) 135 + static int regmap_mmio_write(void *context, unsigned int reg, unsigned int val) 106 136 { 107 137 struct regmap_mmio_context *ctx = context; 108 - unsigned int offset; 109 138 int ret; 110 - 111 - regmap_mmio_regsize_check(reg_size); 112 139 113 140 if (!IS_ERR(ctx->clk)) { 114 141 ret = clk_enable(ctx->clk); ··· 131 128 return ret; 132 129 } 133 130 134 - offset = regmap_mmio_get_offset(reg, reg_size); 135 - 136 - while (val_size) { 137 - switch (ctx->val_bytes) { 138 - case 1: 139 - writeb(*(u8 *)val, ctx->regs + offset); 140 - break; 141 - case 2: 142 - writew(*(u16 *)val, ctx->regs + offset); 143 - break; 144 - case 4: 145 - writel(*(u32 *)val, ctx->regs + offset); 146 - break; 147 - #ifdef CONFIG_64BIT 148 - case 8: 149 - writeq(*(u64 *)val, ctx->regs + offset); 150 - break; 151 - #endif 152 - default: 153 - /* Should be caught by regmap_mmio_check_config */ 154 - BUG(); 155 - } 156 - val_size -= ctx->val_bytes; 157 - val += ctx->val_bytes; 158 - offset += ctx->val_bytes; 159 - } 131 + ctx->reg_write(ctx, reg, val); 160 132 161 133 if (!IS_ERR(ctx->clk)) 162 134 clk_disable(ctx->clk); ··· 139 161 return 0; 140 162 } 141 163 142 - static int regmap_mmio_write(void *context, const void *data, size_t count) 164 + static unsigned int regmap_mmio_read8(struct regmap_mmio_context *ctx, 165 + unsigned int reg) 143 166 { 144 - struct regmap_mmio_context *ctx = context; 145 - unsigned int offset = ctx->reg_bytes + ctx->pad_bytes; 146 - 147 - regmap_mmio_count_check(count, offset); 148 - 149 - return regmap_mmio_gather_write(context, data, ctx->reg_bytes, 150 - data + offset, count - offset); 167 + return readb(ctx->regs + reg); 151 168 } 152 169 153 - static int regmap_mmio_read(void *context, 154 - const void *reg, size_t reg_size, 155 - void *val, size_t val_size) 170 + static unsigned int regmap_mmio_read16le(struct regmap_mmio_context *ctx, 171 + unsigned int reg) 172 + { 173 + return readw(ctx->regs + reg); 174 + } 175 + 176 + static unsigned int regmap_mmio_read16be(struct regmap_mmio_context *ctx, 177 + unsigned int reg) 178 + { 179 + return ioread16be(ctx->regs + reg); 180 + } 181 + 182 + static unsigned int regmap_mmio_read32le(struct regmap_mmio_context *ctx, 183 + unsigned int reg) 184 + { 185 + return readl(ctx->regs + reg); 186 + } 187 + 188 + static unsigned int regmap_mmio_read32be(struct regmap_mmio_context *ctx, 189 + unsigned int reg) 190 + { 191 + return ioread32be(ctx->regs + reg); 192 + } 193 + 194 + #ifdef CONFIG_64BIT 195 + static unsigned int regmap_mmio_read64le(struct regmap_mmio_context *ctx, 196 + unsigned int reg) 197 + { 198 + return readq(ctx->regs + reg); 199 + } 200 + #endif 201 + 202 + static int regmap_mmio_read(void *context, unsigned int reg, unsigned int *val) 156 203 { 157 204 struct regmap_mmio_context *ctx = context; 158 - unsigned int offset; 159 205 int ret; 160 - 161 - regmap_mmio_regsize_check(reg_size); 162 206 163 207 if (!IS_ERR(ctx->clk)) { 164 208 ret = clk_enable(ctx->clk); ··· 188 188 return ret; 189 189 } 190 190 191 - offset = regmap_mmio_get_offset(reg, reg_size); 192 - 193 - while (val_size) { 194 - switch (ctx->val_bytes) { 195 - case 1: 196 - *(u8 *)val = readb(ctx->regs + offset); 197 - break; 198 - case 2: 199 - *(u16 *)val = readw(ctx->regs + offset); 200 - break; 201 - case 4: 202 - *(u32 *)val = readl(ctx->regs + offset); 203 - break; 204 - #ifdef CONFIG_64BIT 205 - case 8: 206 - *(u64 *)val = readq(ctx->regs + offset); 207 - break; 208 - #endif 209 - default: 210 - /* Should be caught by regmap_mmio_check_config */ 211 - BUG(); 212 - } 213 - val_size -= ctx->val_bytes; 214 - val += ctx->val_bytes; 215 - offset += ctx->val_bytes; 216 - } 191 + *val = ctx->reg_read(ctx, reg); 217 192 218 193 if (!IS_ERR(ctx->clk)) 219 194 clk_disable(ctx->clk); ··· 207 232 kfree(context); 208 233 } 209 234 210 - static struct regmap_bus regmap_mmio = { 235 + static const struct regmap_bus regmap_mmio = { 211 236 .fast_io = true, 212 - .write = regmap_mmio_write, 213 - .gather_write = regmap_mmio_gather_write, 214 - .read = regmap_mmio_read, 237 + .reg_write = regmap_mmio_write, 238 + .reg_read = regmap_mmio_read, 215 239 .free_context = regmap_mmio_free_context, 216 - .reg_format_endian_default = REGMAP_ENDIAN_NATIVE, 217 - .val_format_endian_default = REGMAP_ENDIAN_NATIVE, 218 240 }; 219 241 220 242 static struct regmap_mmio_context *regmap_mmio_gen_context(struct device *dev, ··· 237 265 if (config->reg_stride < min_stride) 238 266 return ERR_PTR(-EINVAL); 239 267 240 - switch (config->reg_format_endian) { 241 - case REGMAP_ENDIAN_DEFAULT: 242 - case REGMAP_ENDIAN_NATIVE: 243 - break; 244 - default: 245 - return ERR_PTR(-EINVAL); 246 - } 247 - 248 268 ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); 249 269 if (!ctx) 250 270 return ERR_PTR(-ENOMEM); 251 271 252 272 ctx->regs = regs; 253 273 ctx->val_bytes = config->val_bits / 8; 254 - ctx->reg_bytes = config->reg_bits / 8; 255 - ctx->pad_bytes = config->pad_bits / 8; 256 274 ctx->clk = ERR_PTR(-ENODEV); 275 + 276 + switch (config->reg_format_endian) { 277 + case REGMAP_ENDIAN_DEFAULT: 278 + case REGMAP_ENDIAN_LITTLE: 279 + #ifdef __LITTLE_ENDIAN 280 + case REGMAP_ENDIAN_NATIVE: 281 + #endif 282 + switch (config->val_bits) { 283 + case 8: 284 + ctx->reg_read = regmap_mmio_read8; 285 + ctx->reg_write = regmap_mmio_write8; 286 + break; 287 + case 16: 288 + ctx->reg_read = regmap_mmio_read16le; 289 + ctx->reg_write = regmap_mmio_write16le; 290 + break; 291 + case 32: 292 + ctx->reg_read = regmap_mmio_read32le; 293 + ctx->reg_write = regmap_mmio_write32le; 294 + break; 295 + #ifdef CONFIG_64BIT 296 + case 64: 297 + ctx->reg_read = regmap_mmio_read64le; 298 + ctx->reg_write = regmap_mmio_write64le; 299 + break; 300 + #endif 301 + default: 302 + ret = -EINVAL; 303 + goto err_free; 304 + } 305 + break; 306 + case REGMAP_ENDIAN_BIG: 307 + #ifdef __BIG_ENDIAN 308 + case REGMAP_ENDIAN_NATIVE: 309 + #endif 310 + switch (config->val_bits) { 311 + case 8: 312 + ctx->reg_read = regmap_mmio_read8; 313 + ctx->reg_write = regmap_mmio_write8; 314 + break; 315 + case 16: 316 + ctx->reg_read = regmap_mmio_read16be; 317 + ctx->reg_write = regmap_mmio_write16be; 318 + break; 319 + case 32: 320 + ctx->reg_read = regmap_mmio_read32be; 321 + ctx->reg_write = regmap_mmio_write32be; 322 + break; 323 + default: 324 + ret = -EINVAL; 325 + goto err_free; 326 + } 327 + break; 328 + default: 329 + ret = -EINVAL; 330 + goto err_free; 331 + } 257 332 258 333 if (clk_id == NULL) 259 334 return ctx;
+58 -185
drivers/base/regmap/regmap.c
··· 19 19 #include <linux/rbtree.h> 20 20 #include <linux/sched.h> 21 21 #include <linux/delay.h> 22 + #include <linux/log2.h> 22 23 23 24 #define CREATE_TRACE_POINTS 24 25 #include "trace.h" ··· 558 557 endian = REGMAP_ENDIAN_BIG; 559 558 else if (of_property_read_bool(np, "little-endian")) 560 559 endian = REGMAP_ENDIAN_LITTLE; 560 + else if (of_property_read_bool(np, "native-endian")) 561 + endian = REGMAP_ENDIAN_NATIVE; 561 562 562 563 /* If the endianness was specified in DT, use that */ 563 564 if (endian != REGMAP_ENDIAN_DEFAULT) ··· 641 638 map->reg_stride = config->reg_stride; 642 639 else 643 640 map->reg_stride = 1; 641 + if (is_power_of_2(map->reg_stride)) 642 + map->reg_stride_order = ilog2(map->reg_stride); 643 + else 644 + map->reg_stride_order = -1; 644 645 map->use_single_read = config->use_single_rw || !bus || !bus->read; 645 646 map->use_single_write = config->use_single_rw || !bus || !bus->write; 646 647 map->can_multi_write = config->can_multi_write && bus && bus->write; ··· 1315 1308 if (map->writeable_reg) 1316 1309 for (i = 0; i < val_len / map->format.val_bytes; i++) 1317 1310 if (!map->writeable_reg(map->dev, 1318 - reg + (i * map->reg_stride))) 1311 + reg + regmap_get_offset(map, i))) 1319 1312 return -EINVAL; 1320 1313 1321 1314 if (!map->cache_bypass && map->format.parse_val) { ··· 1323 1316 int val_bytes = map->format.val_bytes; 1324 1317 for (i = 0; i < val_len / val_bytes; i++) { 1325 1318 ival = map->format.parse_val(val + (i * val_bytes)); 1326 - ret = regcache_write(map, reg + (i * map->reg_stride), 1319 + ret = regcache_write(map, 1320 + reg + regmap_get_offset(map, i), 1327 1321 ival); 1328 1322 if (ret) { 1329 1323 dev_err(map->dev, ··· 1698 1690 EXPORT_SYMBOL_GPL(regmap_raw_write); 1699 1691 1700 1692 /** 1701 - * regmap_field_write(): Write a value to a single register field 1702 - * 1703 - * @field: Register field to write to 1704 - * @val: Value to be written 1705 - * 1706 - * A value of zero will be returned on success, a negative errno will 1707 - * be returned in error cases. 1708 - */ 1709 - int regmap_field_write(struct regmap_field *field, unsigned int val) 1710 - { 1711 - return regmap_update_bits(field->regmap, field->reg, 1712 - field->mask, val << field->shift); 1713 - } 1714 - EXPORT_SYMBOL_GPL(regmap_field_write); 1715 - 1716 - /** 1717 - * regmap_field_update_bits(): Perform a read/modify/write cycle 1718 - * on the register field 1693 + * regmap_field_update_bits_base(): 1694 + * Perform a read/modify/write cycle on the register field 1695 + * with change, async, force option 1719 1696 * 1720 1697 * @field: Register field to write to 1721 1698 * @mask: Bitmask to change 1722 1699 * @val: Value to be written 1700 + * @change: Boolean indicating if a write was done 1701 + * @async: Boolean indicating asynchronously 1702 + * @force: Boolean indicating use force update 1723 1703 * 1724 1704 * A value of zero will be returned on success, a negative errno will 1725 1705 * be returned in error cases. 1726 1706 */ 1727 - int regmap_field_update_bits(struct regmap_field *field, unsigned int mask, unsigned int val) 1707 + int regmap_field_update_bits_base(struct regmap_field *field, 1708 + unsigned int mask, unsigned int val, 1709 + bool *change, bool async, bool force) 1728 1710 { 1729 1711 mask = (mask << field->shift) & field->mask; 1730 1712 1731 - return regmap_update_bits(field->regmap, field->reg, 1732 - mask, val << field->shift); 1713 + return regmap_update_bits_base(field->regmap, field->reg, 1714 + mask, val << field->shift, 1715 + change, async, force); 1733 1716 } 1734 - EXPORT_SYMBOL_GPL(regmap_field_update_bits); 1717 + EXPORT_SYMBOL_GPL(regmap_field_update_bits_base); 1735 1718 1736 1719 /** 1737 - * regmap_fields_write(): Write a value to a single register field with port ID 1738 - * 1739 - * @field: Register field to write to 1740 - * @id: port ID 1741 - * @val: Value to be written 1742 - * 1743 - * A value of zero will be returned on success, a negative errno will 1744 - * be returned in error cases. 1745 - */ 1746 - int regmap_fields_write(struct regmap_field *field, unsigned int id, 1747 - unsigned int val) 1748 - { 1749 - if (id >= field->id_size) 1750 - return -EINVAL; 1751 - 1752 - return regmap_update_bits(field->regmap, 1753 - field->reg + (field->id_offset * id), 1754 - field->mask, val << field->shift); 1755 - } 1756 - EXPORT_SYMBOL_GPL(regmap_fields_write); 1757 - 1758 - int regmap_fields_force_write(struct regmap_field *field, unsigned int id, 1759 - unsigned int val) 1760 - { 1761 - if (id >= field->id_size) 1762 - return -EINVAL; 1763 - 1764 - return regmap_write_bits(field->regmap, 1765 - field->reg + (field->id_offset * id), 1766 - field->mask, val << field->shift); 1767 - } 1768 - EXPORT_SYMBOL_GPL(regmap_fields_force_write); 1769 - 1770 - /** 1771 - * regmap_fields_update_bits(): Perform a read/modify/write cycle 1772 - * on the register field 1720 + * regmap_fields_update_bits_base(): 1721 + * Perform a read/modify/write cycle on the register field 1722 + * with change, async, force option 1773 1723 * 1774 1724 * @field: Register field to write to 1775 1725 * @id: port ID 1776 1726 * @mask: Bitmask to change 1777 1727 * @val: Value to be written 1728 + * @change: Boolean indicating if a write was done 1729 + * @async: Boolean indicating asynchronously 1730 + * @force: Boolean indicating use force update 1778 1731 * 1779 1732 * A value of zero will be returned on success, a negative errno will 1780 1733 * be returned in error cases. 1781 1734 */ 1782 - int regmap_fields_update_bits(struct regmap_field *field, unsigned int id, 1783 - unsigned int mask, unsigned int val) 1735 + int regmap_fields_update_bits_base(struct regmap_field *field, unsigned int id, 1736 + unsigned int mask, unsigned int val, 1737 + bool *change, bool async, bool force) 1784 1738 { 1785 1739 if (id >= field->id_size) 1786 1740 return -EINVAL; 1787 1741 1788 1742 mask = (mask << field->shift) & field->mask; 1789 1743 1790 - return regmap_update_bits(field->regmap, 1791 - field->reg + (field->id_offset * id), 1792 - mask, val << field->shift); 1744 + return regmap_update_bits_base(field->regmap, 1745 + field->reg + (field->id_offset * id), 1746 + mask, val << field->shift, 1747 + change, async, force); 1793 1748 } 1794 - EXPORT_SYMBOL_GPL(regmap_fields_update_bits); 1749 + EXPORT_SYMBOL_GPL(regmap_fields_update_bits_base); 1795 1750 1796 1751 /* 1797 1752 * regmap_bulk_write(): Write multiple registers to the device ··· 1817 1846 goto out; 1818 1847 } 1819 1848 1820 - ret = _regmap_write(map, reg + (i * map->reg_stride), 1821 - ival); 1849 + ret = _regmap_write(map, 1850 + reg + regmap_get_offset(map, i), 1851 + ival); 1822 1852 if (ret != 0) 1823 1853 goto out; 1824 1854 } ··· 2225 2253 2226 2254 WARN_ON(!map->bus); 2227 2255 2256 + if (!map->bus || !map->bus->read) 2257 + return -EINVAL; 2258 + 2228 2259 range = _regmap_range_lookup(map, reg); 2229 2260 if (range) { 2230 2261 ret = _regmap_select_page(map, &reg, range, ··· 2391 2416 * cost as we expect to hit the cache. 2392 2417 */ 2393 2418 for (i = 0; i < val_count; i++) { 2394 - ret = _regmap_read(map, reg + (i * map->reg_stride), 2419 + ret = _regmap_read(map, reg + regmap_get_offset(map, i), 2395 2420 &v); 2396 2421 if (ret != 0) 2397 2422 goto out; ··· 2543 2568 } else { 2544 2569 for (i = 0; i < val_count; i++) { 2545 2570 unsigned int ival; 2546 - ret = regmap_read(map, reg + (i * map->reg_stride), 2571 + ret = regmap_read(map, reg + regmap_get_offset(map, i), 2547 2572 &ival); 2548 2573 if (ret != 0) 2549 2574 return ret; ··· 2623 2648 } 2624 2649 2625 2650 /** 2626 - * regmap_update_bits: Perform a read/modify/write cycle on the register map 2651 + * regmap_update_bits_base: 2652 + * Perform a read/modify/write cycle on the 2653 + * register map with change, async, force option 2627 2654 * 2628 2655 * @map: Register map to update 2629 2656 * @reg: Register to update 2630 2657 * @mask: Bitmask to change 2631 2658 * @val: New value for bitmask 2659 + * @change: Boolean indicating if a write was done 2660 + * @async: Boolean indicating asynchronously 2661 + * @force: Boolean indicating use force update 2632 2662 * 2633 - * Returns zero for success, a negative number on error. 2634 - */ 2635 - int regmap_update_bits(struct regmap *map, unsigned int reg, 2636 - unsigned int mask, unsigned int val) 2637 - { 2638 - int ret; 2639 - 2640 - map->lock(map->lock_arg); 2641 - ret = _regmap_update_bits(map, reg, mask, val, NULL, false); 2642 - map->unlock(map->lock_arg); 2643 - 2644 - return ret; 2645 - } 2646 - EXPORT_SYMBOL_GPL(regmap_update_bits); 2647 - 2648 - /** 2649 - * regmap_write_bits: Perform a read/modify/write cycle on the register map 2650 - * 2651 - * @map: Register map to update 2652 - * @reg: Register to update 2653 - * @mask: Bitmask to change 2654 - * @val: New value for bitmask 2655 - * 2656 - * Returns zero for success, a negative number on error. 2657 - */ 2658 - int regmap_write_bits(struct regmap *map, unsigned int reg, 2659 - unsigned int mask, unsigned int val) 2660 - { 2661 - int ret; 2662 - 2663 - map->lock(map->lock_arg); 2664 - ret = _regmap_update_bits(map, reg, mask, val, NULL, true); 2665 - map->unlock(map->lock_arg); 2666 - 2667 - return ret; 2668 - } 2669 - EXPORT_SYMBOL_GPL(regmap_write_bits); 2670 - 2671 - /** 2672 - * regmap_update_bits_async: Perform a read/modify/write cycle on the register 2673 - * map asynchronously 2674 - * 2675 - * @map: Register map to update 2676 - * @reg: Register to update 2677 - * @mask: Bitmask to change 2678 - * @val: New value for bitmask 2679 - * 2663 + * if async was true, 2680 2664 * With most buses the read must be done synchronously so this is most 2681 2665 * useful for devices with a cache which do not need to interact with 2682 2666 * the hardware to determine the current register value. 2683 2667 * 2684 2668 * Returns zero for success, a negative number on error. 2685 2669 */ 2686 - int regmap_update_bits_async(struct regmap *map, unsigned int reg, 2687 - unsigned int mask, unsigned int val) 2670 + int regmap_update_bits_base(struct regmap *map, unsigned int reg, 2671 + unsigned int mask, unsigned int val, 2672 + bool *change, bool async, bool force) 2688 2673 { 2689 2674 int ret; 2690 2675 2691 2676 map->lock(map->lock_arg); 2692 2677 2693 - map->async = true; 2678 + map->async = async; 2694 2679 2695 - ret = _regmap_update_bits(map, reg, mask, val, NULL, false); 2680 + ret = _regmap_update_bits(map, reg, mask, val, change, force); 2696 2681 2697 2682 map->async = false; 2698 2683 ··· 2660 2725 2661 2726 return ret; 2662 2727 } 2663 - EXPORT_SYMBOL_GPL(regmap_update_bits_async); 2664 - 2665 - /** 2666 - * regmap_update_bits_check: Perform a read/modify/write cycle on the 2667 - * register map and report if updated 2668 - * 2669 - * @map: Register map to update 2670 - * @reg: Register to update 2671 - * @mask: Bitmask to change 2672 - * @val: New value for bitmask 2673 - * @change: Boolean indicating if a write was done 2674 - * 2675 - * Returns zero for success, a negative number on error. 2676 - */ 2677 - int regmap_update_bits_check(struct regmap *map, unsigned int reg, 2678 - unsigned int mask, unsigned int val, 2679 - bool *change) 2680 - { 2681 - int ret; 2682 - 2683 - map->lock(map->lock_arg); 2684 - ret = _regmap_update_bits(map, reg, mask, val, change, false); 2685 - map->unlock(map->lock_arg); 2686 - return ret; 2687 - } 2688 - EXPORT_SYMBOL_GPL(regmap_update_bits_check); 2689 - 2690 - /** 2691 - * regmap_update_bits_check_async: Perform a read/modify/write cycle on the 2692 - * register map asynchronously and report if 2693 - * updated 2694 - * 2695 - * @map: Register map to update 2696 - * @reg: Register to update 2697 - * @mask: Bitmask to change 2698 - * @val: New value for bitmask 2699 - * @change: Boolean indicating if a write was done 2700 - * 2701 - * With most buses the read must be done synchronously so this is most 2702 - * useful for devices with a cache which do not need to interact with 2703 - * the hardware to determine the current register value. 2704 - * 2705 - * Returns zero for success, a negative number on error. 2706 - */ 2707 - int regmap_update_bits_check_async(struct regmap *map, unsigned int reg, 2708 - unsigned int mask, unsigned int val, 2709 - bool *change) 2710 - { 2711 - int ret; 2712 - 2713 - map->lock(map->lock_arg); 2714 - 2715 - map->async = true; 2716 - 2717 - ret = _regmap_update_bits(map, reg, mask, val, change, false); 2718 - 2719 - map->async = false; 2720 - 2721 - map->unlock(map->lock_arg); 2722 - 2723 - return ret; 2724 - } 2725 - EXPORT_SYMBOL_GPL(regmap_update_bits_check_async); 2728 + EXPORT_SYMBOL_GPL(regmap_update_bits_base); 2726 2729 2727 2730 void regmap_async_complete_cb(struct regmap_async *async, int ret) 2728 2731 {
+58 -49
include/linux/regmap.h
··· 65 65 unsigned int delay_us; 66 66 }; 67 67 68 + #define regmap_update_bits(map, reg, mask, val) \ 69 + regmap_update_bits_base(map, reg, mask, val, NULL, false, false) 70 + #define regmap_update_bits_async(map, reg, mask, val)\ 71 + regmap_update_bits_base(map, reg, mask, val, NULL, true, false) 72 + #define regmap_update_bits_check(map, reg, mask, val, change)\ 73 + regmap_update_bits_base(map, reg, mask, val, change, false, false) 74 + #define regmap_update_bits_check_async(map, reg, mask, val, change)\ 75 + regmap_update_bits_base(map, reg, mask, val, change, true, false) 76 + 77 + #define regmap_write_bits(map, reg, mask, val) \ 78 + regmap_update_bits_base(map, reg, mask, val, NULL, false, true) 79 + 80 + #define regmap_field_write(field, val) \ 81 + regmap_field_update_bits_base(field, ~0, val, NULL, false, false) 82 + #define regmap_field_force_write(field, val) \ 83 + regmap_field_update_bits_base(field, ~0, val, NULL, false, true) 84 + #define regmap_field_update_bits(field, mask, val)\ 85 + regmap_field_update_bits_base(field, mask, val, NULL, false, false) 86 + #define regmap_field_force_update_bits(field, mask, val) \ 87 + regmap_field_update_bits_base(field, mask, val, NULL, false, true) 88 + 89 + #define regmap_fields_write(field, id, val) \ 90 + regmap_fields_update_bits_base(field, id, ~0, val, NULL, false, false) 91 + #define regmap_fields_force_write(field, id, val) \ 92 + regmap_fields_update_bits_base(field, id, ~0, val, NULL, false, true) 93 + #define regmap_fields_update_bits(field, id, mask, val)\ 94 + regmap_fields_update_bits_base(field, id, mask, val, NULL, false, false) 95 + #define regmap_fields_force_update_bits(field, id, mask, val) \ 96 + regmap_fields_update_bits_base(field, id, mask, val, NULL, false, true) 97 + 68 98 #ifdef CONFIG_REGMAP 69 99 70 100 enum regmap_endian { ··· 192 162 * This field is a duplicate of a similar file in 193 163 * 'struct regmap_bus' and serves exact same purpose. 194 164 * Use it only for "no-bus" cases. 195 - * @max_register: Optional, specifies the maximum valid register index. 165 + * @max_register: Optional, specifies the maximum valid register address. 196 166 * @wr_table: Optional, points to a struct regmap_access_table specifying 197 167 * valid ranges for write access. 198 168 * @rd_table: As above, for read access. ··· 721 691 void *val, size_t val_len); 722 692 int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val, 723 693 size_t val_count); 724 - int regmap_update_bits(struct regmap *map, unsigned int reg, 725 - unsigned int mask, unsigned int val); 726 - int regmap_write_bits(struct regmap *map, unsigned int reg, 727 - unsigned int mask, unsigned int val); 728 - int regmap_update_bits_async(struct regmap *map, unsigned int reg, 729 - unsigned int mask, unsigned int val); 730 - int regmap_update_bits_check(struct regmap *map, unsigned int reg, 731 - unsigned int mask, unsigned int val, 732 - bool *change); 733 - int regmap_update_bits_check_async(struct regmap *map, unsigned int reg, 734 - unsigned int mask, unsigned int val, 735 - bool *change); 694 + int regmap_update_bits_base(struct regmap *map, unsigned int reg, 695 + unsigned int mask, unsigned int val, 696 + bool *change, bool async, bool force); 736 697 int regmap_get_val_bytes(struct regmap *map); 737 698 int regmap_get_max_register(struct regmap *map); 738 699 int regmap_get_reg_stride(struct regmap *map); ··· 791 770 void devm_regmap_field_free(struct device *dev, struct regmap_field *field); 792 771 793 772 int regmap_field_read(struct regmap_field *field, unsigned int *val); 794 - int regmap_field_write(struct regmap_field *field, unsigned int val); 795 - int regmap_field_update_bits(struct regmap_field *field, 796 - unsigned int mask, unsigned int val); 797 - 798 - int regmap_fields_write(struct regmap_field *field, unsigned int id, 799 - unsigned int val); 800 - int regmap_fields_force_write(struct regmap_field *field, unsigned int id, 801 - unsigned int val); 773 + int regmap_field_update_bits_base(struct regmap_field *field, 774 + unsigned int mask, unsigned int val, 775 + bool *change, bool async, bool force); 802 776 int regmap_fields_read(struct regmap_field *field, unsigned int id, 803 777 unsigned int *val); 804 - int regmap_fields_update_bits(struct regmap_field *field, unsigned int id, 805 - unsigned int mask, unsigned int val); 778 + int regmap_fields_update_bits_base(struct regmap_field *field, unsigned int id, 779 + unsigned int mask, unsigned int val, 780 + bool *change, bool async, bool force); 806 781 807 782 /** 808 783 * Description of an IRQ for the generic regmap irq_chip. ··· 885 868 int irq_base, const struct regmap_irq_chip *chip, 886 869 struct regmap_irq_chip_data **data); 887 870 void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data); 871 + 872 + int devm_regmap_add_irq_chip(struct device *dev, struct regmap *map, int irq, 873 + int irq_flags, int irq_base, 874 + const struct regmap_irq_chip *chip, 875 + struct regmap_irq_chip_data **data); 876 + void devm_regmap_del_irq_chip(struct device *dev, int irq, 877 + struct regmap_irq_chip_data *data); 878 + 888 879 int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data); 889 880 int regmap_irq_get_virq(struct regmap_irq_chip_data *data, int irq); 890 881 struct irq_domain *regmap_irq_get_domain(struct regmap_irq_chip_data *data); ··· 962 937 return -EINVAL; 963 938 } 964 939 965 - static inline int regmap_update_bits(struct regmap *map, unsigned int reg, 966 - unsigned int mask, unsigned int val) 940 + static inline int regmap_update_bits_base(struct regmap *map, unsigned int reg, 941 + unsigned int mask, unsigned int val, 942 + bool *change, bool async, bool force) 967 943 { 968 944 WARN_ONCE(1, "regmap API is disabled"); 969 945 return -EINVAL; 970 946 } 971 947 972 - static inline int regmap_write_bits(struct regmap *map, unsigned int reg, 973 - unsigned int mask, unsigned int val) 948 + static inline int regmap_field_update_bits_base(struct regmap_field *field, 949 + unsigned int mask, unsigned int val, 950 + bool *change, bool async, bool force) 974 951 { 975 952 WARN_ONCE(1, "regmap API is disabled"); 976 953 return -EINVAL; 977 954 } 978 955 979 - static inline int regmap_update_bits_async(struct regmap *map, 980 - unsigned int reg, 981 - unsigned int mask, unsigned int val) 982 - { 983 - WARN_ONCE(1, "regmap API is disabled"); 984 - return -EINVAL; 985 - } 986 - 987 - static inline int regmap_update_bits_check(struct regmap *map, 988 - unsigned int reg, 989 - unsigned int mask, unsigned int val, 990 - bool *change) 991 - { 992 - WARN_ONCE(1, "regmap API is disabled"); 993 - return -EINVAL; 994 - } 995 - 996 - static inline int regmap_update_bits_check_async(struct regmap *map, 997 - unsigned int reg, 998 - unsigned int mask, 999 - unsigned int val, 1000 - bool *change) 956 + static inline int regmap_fields_update_bits_base(struct regmap_field *field, 957 + unsigned int id, 958 + unsigned int mask, unsigned int val, 959 + bool *change, bool async, bool force) 1001 960 { 1002 961 WARN_ONCE(1, "regmap API is disabled"); 1003 962 return -EINVAL;