Ignore:
Timestamp:
Jan 24, 2021, 8:40:08 AM (5 years ago)
Author:
Paul Smedley
Message:

Update regmap & regcache to 5.10.10 kernel code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-next/include/linux/regmap.h

    r625 r652  
     1/* SPDX-License-Identifier: GPL-2.0-only */
    12#ifndef __LINUX_REGMAP_H
    23#define __LINUX_REGMAP_H
     
    89 *
    910 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
    10  *
    11  * This program is free software; you can redistribute it and/or modify
    12  * it under the terms of the GNU General Public License version 2 as
    13  * published by the Free Software Foundation.
    14  */
    15 /* from 4.19.163 */
     11 */
     12
     13/* from 5.10.10 */
    1614
    1715#include <linux/list.h>
     
    2220//#include <linux/bug.h>
    2321#include <linux/lockdep.h>
     22//#include <linux/iopoll.h>
     23#include <linux/fwnode.h>
    2424
    2525struct module;
    2626struct clk;
    2727struct device;
     28struct device_node;
    2829struct i2c_client;
     30struct i3c_device;
    2931struct irq_domain;
    3032struct slim_device;
     
    7577};
    7678
    77 #define regmap_update_bits(map, reg, mask, val) \
    78         regmap_update_bits_base(map, reg, mask, val, NULL, false, false)
    79 #define regmap_update_bits_async(map, reg, mask, val)\
    80         regmap_update_bits_base(map, reg, mask, val, NULL, true, false)
    81 #define regmap_update_bits_check(map, reg, mask, val, change)\
    82         regmap_update_bits_base(map, reg, mask, val, change, false, false)
    83 #define regmap_update_bits_check_async(map, reg, mask, val, change)\
    84         regmap_update_bits_base(map, reg, mask, val, change, true, false)
    85 
    86 #define regmap_write_bits(map, reg, mask, val) \
    87         regmap_update_bits_base(map, reg, mask, val, NULL, false, true)
    88 
    89 #define regmap_field_write(field, val) \
    90         regmap_field_update_bits_base(field, ~0, val, NULL, false, false)
    91 #define regmap_field_force_write(field, val) \
    92         regmap_field_update_bits_base(field, ~0, val, NULL, false, true)
    93 #define regmap_field_update_bits(field, mask, val)\
    94         regmap_field_update_bits_base(field, mask, val, NULL, false, false)
    95 #define regmap_field_force_update_bits(field, mask, val) \
    96         regmap_field_update_bits_base(field, mask, val, NULL, false, true)
    97 
    98 #define regmap_fields_write(field, id, val) \
    99         regmap_fields_update_bits_base(field, id, ~0, val, NULL, false, false)
    100 #define regmap_fields_force_write(field, id, val) \
    101         regmap_fields_update_bits_base(field, id, ~0, val, NULL, false, true)
    102 #define regmap_fields_update_bits(field, id, mask, val)\
    103         regmap_fields_update_bits_base(field, id, mask, val, NULL, false, false)
    104 #define regmap_fields_force_update_bits(field, id, mask, val) \
    105         regmap_fields_update_bits_base(field, id, mask, val, NULL, false, true)
     79#define REG_SEQ(_reg, _def, _delay_us) {                \
     80                                .reg = _reg,            \
     81                                .def = _def,            \
     82                                .delay_us = _delay_us,  \
     83                                }
     84#define REG_SEQ0(_reg, _def)    REG_SEQ(_reg, _def, 0)
    10685
    10786/**
     
    11493 * @sleep_us: Maximum time to sleep between reads in us (0
    11594 *            tight-loops).  Should be less than ~20ms since usleep_range
    116  *            is used (see Documentation/timers/timers-howto.txt).
     95 *            is used (see Documentation/timers/timers-howto.rst).
    11796 * @timeout_us: Timeout in us, 0 means never timeout
    11897 *
     
    126105#define regmap_read_poll_timeout(map, addr, val, cond, sleep_us, timeout_us) \
    127106({ \
     107        int __ret, __tmp; \
     108        __tmp = read_poll_timeout(regmap_read, __ret, __ret || (cond), \
     109                        sleep_us, timeout_us, false, (map), (addr), &(val)); \
     110        __ret ?: __tmp; \
     111})
     112
     113/**
     114 * regmap_read_poll_timeout_atomic - Poll until a condition is met or a timeout occurs
     115 *
     116 * @map: Regmap to read from
     117 * @addr: Address to poll
     118 * @val: Unsigned integer variable to read the value into
     119 * @cond: Break condition (usually involving @val)
     120 * @delay_us: Time to udelay between reads in us (0 tight-loops).
     121 *            Should be less than ~10us since udelay is used
     122 *            (see Documentation/timers/timers-howto.rst).
     123 * @timeout_us: Timeout in us, 0 means never timeout
     124 *
     125 * Returns 0 on success and -ETIMEDOUT upon a timeout or the regmap_read
     126 * error return value in case of a error read. In the two former cases,
     127 * the last read value at @addr is stored in @val.
     128 *
     129 * This is modelled after the readx_poll_timeout_atomic macros in linux/iopoll.h.
     130 *
     131 * Note: In general regmap cannot be used in atomic context. If you want to use
     132 * this macro then first setup your regmap for atomic use (flat or no cache
     133 * and MMIO regmap).
     134 */
     135#define regmap_read_poll_timeout_atomic(map, addr, val, cond, delay_us, timeout_us) \
     136({ \
    128137        u64 __timeout_us = (timeout_us); \
    129         unsigned long __sleep_us = (sleep_us); \
     138        unsigned long __delay_us = (delay_us); \
    130139        ktime_t __timeout = ktime_add_us(ktime_get(), __timeout_us); \
    131140        int __ret; \
    132         might_sleep_if(__sleep_us); \
    133141        for (;;) { \
    134142                __ret = regmap_read((map), (addr), &(val)); \
     
    142150                        break; \
    143151                } \
    144                 if (__sleep_us) \
    145                         usleep_range((__sleep_us >> 2) + 1, __sleep_us); \
     152                if (__delay_us) \
     153                        udelay(__delay_us); \
    146154        } \
    147155        __ret ?: ((cond) ? 0 : -ETIMEDOUT); \
     
    156164 * @sleep_us: Maximum time to sleep between reads in us (0
    157165 *            tight-loops).  Should be less than ~20ms since usleep_range
    158  *            is used (see Documentation/timers/timers-howto.txt).
     166 *            is used (see Documentation/timers/timers-howto.rst).
    159167 * @timeout_us: Timeout in us, 0 means never timeout
    160168 *
     
    168176#define regmap_field_read_poll_timeout(field, val, cond, sleep_us, timeout_us) \
    169177({ \
    170         u64 __timeout_us = (timeout_us); \
    171         unsigned long __sleep_us = (sleep_us); \
    172         ktime_t timeout = ktime_add_us(ktime_get(), __timeout_us); \
    173         int pollret; \
    174         might_sleep_if(__sleep_us); \
    175         for (;;) { \
    176                 pollret = regmap_field_read((field), &(val)); \
    177                 if (pollret) \
    178                         break; \
    179                 if (cond) \
    180                         break; \
    181                 if (__timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \
    182                         pollret = regmap_field_read((field), &(val)); \
    183                         break; \
    184                 } \
    185                 if (__sleep_us) \
    186                         usleep_range((__sleep_us >> 2) + 1, __sleep_us); \
    187         } \
    188         pollret ?: ((cond) ? 0 : -ETIMEDOUT); \
     178        int __ret, __tmp; \
     179        __tmp = read_poll_timeout(regmap_field_read, __ret, __ret || (cond), \
     180                        sleep_us, timeout_us, false, (field), &(val)); \
     181        __ret ?: __tmp; \
    189182})
    190183
     
    271264 *                check is performed on such table (a register is precious if
    272265 *                it belongs to one of the ranges specified by precious_table).
     266 * @writeable_noinc_reg: Optional callback returning true if the register
     267 *                      supports multiple write operations without incrementing
     268 *                      the register number. If this field is NULL but
     269 *                      wr_noinc_table (see below) is not, the check is
     270 *                      performed on such table (a register is no increment
     271 *                      writeable if it belongs to one of the ranges specified
     272 *                      by wr_noinc_table).
    273273 * @readable_noinc_reg: Optional callback returning true if the register
    274274 *                      supports multiple read operations without incrementing
     
    279279 *                      by rd_noinc_table).
    280280 * @disable_locking: This regmap is either protected by external means or
    281  *                   is guaranteed not be be accessed from multiple threads.
     281 *                   is guaranteed not to be accessed from multiple threads.
    282282 *                   Don't use any locking mechanisms.
    283283 * @lock:         Optional lock callback (overrides regmap's default lock
     
    305305 * @volatile_table: As above, for volatile registers.
    306306 * @precious_table: As above, for precious registers.
     307 * @wr_noinc_table: As above, for no increment writeable registers.
    307308 * @rd_noinc_table: As above, for no increment readable registers.
    308309 * @reg_defaults: Power on reset values for registers (for use with
     
    318319 * @zero_flag_mask: If set, read_flag_mask and write_flag_mask are used even
    319320 *                   if they are both empty.
    320  * @use_single_rw: If set, converts the bulk read and write operations into
    321  *                  a series of single read and write operations. This is useful
    322  *                  for device that does not support bulk read and write.
     321 * @use_single_read: If set, converts the bulk read operation into a series of
     322 *                   single read operations. This is useful for a device that
     323 *                   does not support  bulk read.
     324 * @use_single_write: If set, converts the bulk write operation into a series of
     325 *                    single write operations. This is useful for a device that
     326 *                    does not support bulk write.
    323327 * @can_multi_write: If set, the device supports the multi write mode of bulk
    324328 *                   write operations, if clear multi write requests will be
     
    342346 * @hwlock_mode: The hardware spinlock mode, should be HWLOCK_IRQSTATE,
    343347 *               HWLOCK_IRQ or 0.
     348 * @can_sleep: Optional, specifies whether regmap operations can sleep.
    344349 */
    345350struct regmap_config {
     
    355360        bool (*volatile_reg)(struct device *dev, unsigned int reg);
    356361        bool (*precious_reg)(struct device *dev, unsigned int reg);
     362        bool (*writeable_noinc_reg)(struct device *dev, unsigned int reg);
    357363        bool (*readable_noinc_reg)(struct device *dev, unsigned int reg);
    358364
     
    372378        const struct regmap_access_table *volatile_table;
    373379        const struct regmap_access_table *precious_table;
     380        const struct regmap_access_table *wr_noinc_table;
    374381        const struct regmap_access_table *rd_noinc_table;
    375382        const struct reg_default *reg_defaults;
     
    396403        unsigned int hwlock_id;
    397404        unsigned int hwlock_mode;
     405
     406        bool can_sleep;
    398407};
    399408
     
    408417 *
    409418 * @selector_reg: Register with selector field.
    410  * @selector_mask: Bit shift for selector value.
    411  * @selector_shift: Bit mask for selector value.
     419 * @selector_mask: Bit mask for selector value.
     420 * @selector_shift: Bit shift for selector value.
    412421 *
    413422 * @window_start: Address of first (lowest) register in data window.
     
    565574                                 struct lock_class_key *lock_key,
    566575                                 const char *lock_name);
     576struct regmap *__regmap_init_spi_avmm(struct spi_device *spi,
     577                                      const struct regmap_config *config,
     578                                      struct lock_class_key *lock_key,
     579                                      const char *lock_name);
    567580
    568581struct regmap *__devm_regmap_init(struct device *dev,
     
    614627                                 struct lock_class_key *lock_key,
    615628                                 const char *lock_name);
     629struct regmap *__devm_regmap_init_i3c(struct i3c_device *i3c,
     630                                 const struct regmap_config *config,
     631                                 struct lock_class_key *lock_key,
     632                                 const char *lock_name);
     633struct regmap *__devm_regmap_init_spi_avmm(struct spi_device *spi,
     634                                           const struct regmap_config *config,
     635                                           struct lock_class_key *lock_key,
     636                                           const char *lock_name);
    616637/*
    617638 * Wrapper for regmap_init macros to include a unique lockdep key and name
     
    800821                                sdw, config)
    801822
     823/**
     824 * regmap_init_spi_avmm() - Initialize register map for Intel SPI Slave
     825 * to AVMM Bus Bridge
     826 *
     827 * @spi: Device that will be interacted with
     828 * @config: Configuration for register map
     829 *
     830 * The return value will be an ERR_PTR() on error or a valid pointer
     831 * to a struct regmap.
     832 */
     833#define regmap_init_spi_avmm(spi, config)                                       \
     834        __regmap_lockdep_wrapper(__regmap_init_spi_avmm, #config,               \
     835                                 spi, config)
    802836
    803837/**
     
    9721006        __regmap_lockdep_wrapper(__devm_regmap_init_slimbus, #config,   \
    9731007                                slimbus, config)
     1008
     1009/**
     1010 * devm_regmap_init_i3c() - Initialise managed register map
     1011 *
     1012 * @i3c: Device that will be interacted with
     1013 * @config: Configuration for register map
     1014 *
     1015 * The return value will be an ERR_PTR() on error or a valid pointer
     1016 * to a struct regmap.  The regmap will be automatically freed by the
     1017 * device management code.
     1018 */
     1019#define devm_regmap_init_i3c(i3c, config)                               \
     1020        __regmap_lockdep_wrapper(__devm_regmap_init_i3c, #config,       \
     1021                                i3c, config)
     1022
     1023/**
     1024 * devm_regmap_init_spi_avmm() - Initialize register map for Intel SPI Slave
     1025 * to AVMM Bus Bridge
     1026 *
     1027 * @spi: Device that will be interacted with
     1028 * @config: Configuration for register map
     1029 *
     1030 * The return value will be an ERR_PTR() on error or a valid pointer
     1031 * to a struct regmap.  The map will be automatically freed by the
     1032 * device management code.
     1033 */
     1034#define devm_regmap_init_spi_avmm(spi, config)                          \
     1035        __regmap_lockdep_wrapper(__devm_regmap_init_spi_avmm, #config,  \
     1036                                 spi, config)
     1037
    9741038int regmap_mmio_attach_clk(struct regmap *map, struct clk *clk);
    9751039void regmap_mmio_detach_clk(struct regmap *map);
     
    9821046int regmap_write_async(struct regmap *map, unsigned int reg, unsigned int val);
    9831047int regmap_raw_write(struct regmap *map, unsigned int reg,
     1048                     const void *val, size_t val_len);
     1049int regmap_noinc_write(struct regmap *map, unsigned int reg,
    9841050                     const void *val, size_t val_len);
    9851051int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val,
     
    10021068                            unsigned int mask, unsigned int val,
    10031069                            bool *change, bool async, bool force);
     1070
     1071static inline int regmap_update_bits(struct regmap *map, unsigned int reg,
     1072                                     unsigned int mask, unsigned int val)
     1073{
     1074        return regmap_update_bits_base(map, reg, mask, val, NULL, false, false);
     1075}
     1076
     1077static inline int regmap_update_bits_async(struct regmap *map, unsigned int reg,
     1078                                           unsigned int mask, unsigned int val)
     1079{
     1080        return regmap_update_bits_base(map, reg, mask, val, NULL, true, false);
     1081}
     1082
     1083static inline int regmap_update_bits_check(struct regmap *map, unsigned int reg,
     1084                                           unsigned int mask, unsigned int val,
     1085                                           bool *change)
     1086{
     1087        return regmap_update_bits_base(map, reg, mask, val,
     1088                                       change, false, false);
     1089}
     1090
     1091static inline int
     1092regmap_update_bits_check_async(struct regmap *map, unsigned int reg,
     1093                               unsigned int mask, unsigned int val,
     1094                               bool *change)
     1095{
     1096        return regmap_update_bits_base(map, reg, mask, val,
     1097                                       change, true, false);
     1098}
     1099
     1100static inline int regmap_write_bits(struct regmap *map, unsigned int reg,
     1101                                    unsigned int mask, unsigned int val)
     1102{
     1103        return regmap_update_bits_base(map, reg, mask, val, NULL, false, true);
     1104}
     1105
    10041106int regmap_get_val_bytes(struct regmap *map);
    10051107int regmap_get_max_register(struct regmap *map);
     
    10371139                          unsigned int nranges);
    10381140
     1141static inline int regmap_set_bits(struct regmap *map,
     1142                                  unsigned int reg, unsigned int bits)
     1143{
     1144        return regmap_update_bits_base(map, reg, bits, bits,
     1145                                       NULL, false, false);
     1146}
     1147
     1148static inline int regmap_clear_bits(struct regmap *map,
     1149                                    unsigned int reg, unsigned int bits)
     1150{
     1151        return regmap_update_bits_base(map, reg, bits, 0, NULL, false, false);
     1152}
     1153
     1154int regmap_test_bits(struct regmap *map, unsigned int reg, unsigned int bits);
     1155
    10391156/**
    10401157 * struct reg_field - Description of an register field
     
    10601177                                }
    10611178
     1179#define REG_FIELD_ID(_reg, _lsb, _msb, _size, _offset) {        \
     1180                                .reg = _reg,                    \
     1181                                .lsb = _lsb,                    \
     1182                                .msb = _msb,                    \
     1183                                .id_size = _size,               \
     1184                                .id_offset = _offset,           \
     1185                                }
     1186
    10621187struct regmap_field *regmap_field_alloc(struct regmap *regmap,
    10631188                struct reg_field reg_field);
     
    10671192                struct regmap *regmap, struct reg_field reg_field);
    10681193void devm_regmap_field_free(struct device *dev, struct regmap_field *field);
     1194
     1195int regmap_field_bulk_alloc(struct regmap *regmap,
     1196                             struct regmap_field **rm_field,
     1197                             struct reg_field *reg_field,
     1198                             int num_fields);
     1199void regmap_field_bulk_free(struct regmap_field *field);
     1200int devm_regmap_field_bulk_alloc(struct device *dev, struct regmap *regmap,
     1201                                 struct regmap_field **field,
     1202                                 struct reg_field *reg_field, int num_fields);
     1203void devm_regmap_field_bulk_free(struct device *dev,
     1204                                 struct regmap_field *field);
    10691205
    10701206int regmap_field_read(struct regmap_field *field, unsigned int *val);
     
    10781214                                   bool *change, bool async, bool force);
    10791215
     1216static inline int regmap_field_write(struct regmap_field *field,
     1217                                     unsigned int val)
     1218{
     1219        return regmap_field_update_bits_base(field, ~0, val,
     1220                                             NULL, false, false);
     1221}
     1222
     1223static inline int regmap_field_force_write(struct regmap_field *field,
     1224                                           unsigned int val)
     1225{
     1226        return regmap_field_update_bits_base(field, ~0, val, NULL, false, true);
     1227}
     1228
     1229static inline int regmap_field_update_bits(struct regmap_field *field,
     1230                                           unsigned int mask, unsigned int val)
     1231{
     1232        return regmap_field_update_bits_base(field, mask, val,
     1233                                             NULL, false, false);
     1234}
     1235
     1236static inline int
     1237regmap_field_force_update_bits(struct regmap_field *field,
     1238                               unsigned int mask, unsigned int val)
     1239{
     1240        return regmap_field_update_bits_base(field, mask, val,
     1241                                             NULL, false, true);
     1242}
     1243
     1244static inline int regmap_fields_write(struct regmap_field *field,
     1245                                      unsigned int id, unsigned int val)
     1246{
     1247        return regmap_fields_update_bits_base(field, id, ~0, val,
     1248                                              NULL, false, false);
     1249}
     1250
     1251static inline int regmap_fields_force_write(struct regmap_field *field,
     1252                                            unsigned int id, unsigned int val)
     1253{
     1254        return regmap_fields_update_bits_base(field, id, ~0, val,
     1255                                              NULL, false, true);
     1256}
     1257
     1258static inline int
     1259regmap_fields_update_bits(struct regmap_field *field, unsigned int id,
     1260                          unsigned int mask, unsigned int val)
     1261{
     1262        return regmap_fields_update_bits_base(field, id, mask, val,
     1263                                              NULL, false, false);
     1264}
     1265
     1266static inline int
     1267regmap_fields_force_update_bits(struct regmap_field *field, unsigned int id,
     1268                                unsigned int mask, unsigned int val)
     1269{
     1270        return regmap_fields_update_bits_base(field, id, mask, val,
     1271                                              NULL, false, true);
     1272}
     1273
     1274/**
     1275 * struct regmap_irq_type - IRQ type definitions.
     1276 *
     1277 * @type_reg_offset: Offset register for the irq type setting.
     1278 * @type_rising_val: Register value to configure RISING type irq.
     1279 * @type_falling_val: Register value to configure FALLING type irq.
     1280 * @type_level_low_val: Register value to configure LEVEL_LOW type irq.
     1281 * @type_level_high_val: Register value to configure LEVEL_HIGH type irq.
     1282 * @types_supported: logical OR of IRQ_TYPE_* flags indicating supported types.
     1283 */
     1284struct regmap_irq_type {
     1285        unsigned int type_reg_offset;
     1286        unsigned int type_reg_mask;
     1287        unsigned int type_rising_val;
     1288        unsigned int type_falling_val;
     1289        unsigned int type_level_low_val;
     1290        unsigned int type_level_high_val;
     1291        unsigned int types_supported;
     1292};
     1293
    10801294/**
    10811295 * struct regmap_irq - Description of an IRQ for the generic regmap irq_chip.
     
    10831297 * @reg_offset: Offset of the status/mask register within the bank
    10841298 * @mask:       Mask used to flag/control the register.
    1085  * @type_reg_offset: Offset register for the irq type setting.
    1086  * @type_rising_mask: Mask bit to configure RISING type irq.
    1087  * @type_falling_mask: Mask bit to configure FALLING type irq.
     1299 * @type:       IRQ trigger type setting details if supported.
    10881300 */
    10891301struct regmap_irq {
    10901302        unsigned int reg_offset;
    10911303        unsigned int mask;
    1092         unsigned int type_reg_offset;
    1093         unsigned int type_rising_mask;
    1094         unsigned int type_falling_mask;
     1304        struct regmap_irq_type type;
    10951305};
    10961306
     
    10981308        [_irq] = { .reg_offset = (_off), .mask = (_mask) }
    10991309
     1310#define REGMAP_IRQ_REG_LINE(_id, _reg_bits) \
     1311        [_id] = {                               \
     1312                .mask = BIT((_id) % (_reg_bits)),       \
     1313                .reg_offset = (_id) / (_reg_bits),      \
     1314        }
     1315
     1316#define REGMAP_IRQ_MAIN_REG_OFFSET(arr)                         \
     1317        { .num_regs = ARRAY_SIZE((arr)), .offset = &(arr)[0] }
     1318
     1319struct regmap_irq_sub_irq_map {
     1320        unsigned int num_regs;
     1321        unsigned int *offset;
     1322};
     1323
    11001324/**
    11011325 * struct regmap_irq_chip - Description of a generic regmap irq_chip.
    11021326 *
    11031327 * @name:        Descriptive name for IRQ controller.
     1328 *
     1329 * @main_status: Base main status register address. For chips which have
     1330 *               interrupts arranged in separate sub-irq blocks with own IRQ
     1331 *               registers and which have a main IRQ registers indicating
     1332 *               sub-irq blocks with unhandled interrupts. For such chips fill
     1333 *               sub-irq register information in status_base, mask_base and
     1334 *               ack_base.
     1335 * @num_main_status_bits: Should be given to chips where number of meaningfull
     1336 *                        main status bits differs from num_regs.
     1337 * @sub_reg_offsets: arrays of mappings from main register bits to sub irq
     1338 *                   registers. First item in array describes the registers
     1339 *                   for first main status bit. Second array for second bit etc.
     1340 *                   Offset is given as sub register status offset to
     1341 *                   status_base. Should contain num_regs arrays.
     1342 *                   Can be provided for chips with more complex mapping than
     1343 *                   1.st bit to 1.st sub-reg, 2.nd bit to 2.nd sub-reg, ...
     1344 * @num_main_regs: Number of 'main status' irq registers for chips which have
     1345 *                 main_status set.
    11041346 *
    11051347 * @status_base: Base status register address.
     
    11171359 * @use_ack:     Use @ack register even if it is zero.
    11181360 * @ack_invert:  Inverted ack register: cleared bits for ack.
     1361 * @clear_ack:  Use this to set 1 and 0 or vice-versa to clear interrupts.
    11191362 * @wake_invert: Inverted wake register: cleared bits are wake enabled.
    11201363 * @type_invert: Invert the type flags.
     1364 * @type_in_mask: Use the mask registers for controlling irq type. For
     1365 *                interrupts defining type_rising/falling_mask use mask_base
     1366 *                for edge configuration and never update bits in type_base.
     1367 * @clear_on_unmask: For chips with interrupts cleared on read: read the status
     1368 *                   registers before unmasking interrupts to clear any bits
     1369 *                   set when they were masked.
    11211370 * @runtime_pm:  Hold a runtime PM lock on the device when accessing it.
    11221371 *
     
    11421391        const char *name;
    11431392
     1393        unsigned int main_status;
     1394        unsigned int num_main_status_bits;
     1395        struct regmap_irq_sub_irq_map *sub_reg_offsets;
     1396        int num_main_regs;
     1397
    11441398        unsigned int status_base;
    11451399        unsigned int mask_base;
     
    11541408        bool use_ack:1;
    11551409        bool ack_invert:1;
     1410        bool clear_ack:1;
    11561411        bool wake_invert:1;
    11571412        bool runtime_pm:1;
    11581413        bool type_invert:1;
     1414        bool type_in_mask:1;
     1415        bool clear_on_unmask:1;
    11591416
    11601417        int num_regs;
     
    11761433                        int irq_base, const struct regmap_irq_chip *chip,
    11771434                        struct regmap_irq_chip_data **data);
     1435int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
     1436                               struct regmap *map, int irq,
     1437                               int irq_flags, int irq_base,
     1438                               const struct regmap_irq_chip *chip,
     1439                               struct regmap_irq_chip_data **data);
    11781440void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data);
    11791441
     
    11821444                             const struct regmap_irq_chip *chip,
    11831445                             struct regmap_irq_chip_data **data);
     1446int devm_regmap_add_irq_chip_fwnode(struct device *dev,
     1447                                    struct fwnode_handle *fwnode,
     1448                                    struct regmap *map, int irq,
     1449                                    int irq_flags, int irq_base,
     1450                                    const struct regmap_irq_chip *chip,
     1451                                    struct regmap_irq_chip_data **data);
    11841452void devm_regmap_del_irq_chip(struct device *dev, int irq,
    11851453                              struct regmap_irq_chip_data *data);
     
    12261494}
    12271495
     1496static inline int regmap_noinc_write(struct regmap *map, unsigned int reg,
     1497                                    const void *val, size_t val_len)
     1498{
     1499        WARN_ONCE(1, "regmap API is disabled");
     1500        return -EINVAL;
     1501}
     1502
    12281503static inline int regmap_bulk_write(struct regmap *map, unsigned int reg,
    12291504                                    const void *val, size_t val_count)
     
    12641539                                          unsigned int mask, unsigned int val,
    12651540                                          bool *change, bool async, bool force)
     1541{
     1542        WARN_ONCE(1, "regmap API is disabled");
     1543        return -EINVAL;
     1544}
     1545
     1546static inline int regmap_set_bits(struct regmap *map,
     1547                                  unsigned int reg, unsigned int bits)
     1548{
     1549        WARN_ONCE(1, "regmap API is disabled");
     1550        return -EINVAL;
     1551}
     1552
     1553static inline int regmap_clear_bits(struct regmap *map,
     1554                                    unsigned int reg, unsigned int bits)
     1555{
     1556        WARN_ONCE(1, "regmap API is disabled");
     1557        return -EINVAL;
     1558}
     1559
     1560static inline int regmap_test_bits(struct regmap *map,
     1561                                   unsigned int reg, unsigned int bits)
    12661562{
    12671563        WARN_ONCE(1, "regmap API is disabled");
     
    12861582}
    12871583
     1584static inline int regmap_update_bits(struct regmap *map, unsigned int reg,
     1585                                     unsigned int mask, unsigned int val)
     1586{
     1587        WARN_ONCE(1, "regmap API is disabled");
     1588        return -EINVAL;
     1589}
     1590
     1591static inline int regmap_update_bits_async(struct regmap *map, unsigned int reg,
     1592                                           unsigned int mask, unsigned int val)
     1593{
     1594        WARN_ONCE(1, "regmap API is disabled");
     1595        return -EINVAL;
     1596}
     1597
     1598static inline int regmap_update_bits_check(struct regmap *map, unsigned int reg,
     1599                                           unsigned int mask, unsigned int val,
     1600                                           bool *change)
     1601{
     1602        WARN_ONCE(1, "regmap API is disabled");
     1603        return -EINVAL;
     1604}
     1605
     1606static inline int
     1607regmap_update_bits_check_async(struct regmap *map, unsigned int reg,
     1608                               unsigned int mask, unsigned int val,
     1609                               bool *change)
     1610{
     1611        WARN_ONCE(1, "regmap API is disabled");
     1612        return -EINVAL;
     1613}
     1614
     1615static inline int regmap_write_bits(struct regmap *map, unsigned int reg,
     1616                                    unsigned int mask, unsigned int val)
     1617{
     1618        WARN_ONCE(1, "regmap API is disabled");
     1619        return -EINVAL;
     1620}
     1621
     1622static inline int regmap_field_write(struct regmap_field *field,
     1623                                     unsigned int val)
     1624{
     1625        WARN_ONCE(1, "regmap API is disabled");
     1626        return -EINVAL;
     1627}
     1628
     1629static inline int regmap_field_force_write(struct regmap_field *field,
     1630                                           unsigned int val)
     1631{
     1632        WARN_ONCE(1, "regmap API is disabled");
     1633        return -EINVAL;
     1634}
     1635
     1636static inline int regmap_field_update_bits(struct regmap_field *field,
     1637                                           unsigned int mask, unsigned int val)
     1638{
     1639        WARN_ONCE(1, "regmap API is disabled");
     1640        return -EINVAL;
     1641}
     1642
     1643static inline int
     1644regmap_field_force_update_bits(struct regmap_field *field,
     1645                               unsigned int mask, unsigned int val)
     1646{
     1647        WARN_ONCE(1, "regmap API is disabled");
     1648        return -EINVAL;
     1649}
     1650
     1651static inline int regmap_fields_write(struct regmap_field *field,
     1652                                      unsigned int id, unsigned int val)
     1653{
     1654        WARN_ONCE(1, "regmap API is disabled");
     1655        return -EINVAL;
     1656}
     1657
     1658static inline int regmap_fields_force_write(struct regmap_field *field,
     1659                                            unsigned int id, unsigned int val)
     1660{
     1661        WARN_ONCE(1, "regmap API is disabled");
     1662        return -EINVAL;
     1663}
     1664
     1665static inline int
     1666regmap_fields_update_bits(struct regmap_field *field, unsigned int id,
     1667                          unsigned int mask, unsigned int val)
     1668{
     1669        WARN_ONCE(1, "regmap API is disabled");
     1670        return -EINVAL;
     1671}
     1672
     1673static inline int
     1674regmap_fields_force_update_bits(struct regmap_field *field, unsigned int id,
     1675                                unsigned int mask, unsigned int val)
     1676{
     1677        WARN_ONCE(1, "regmap API is disabled");
     1678        return -EINVAL;
     1679}
     1680
    12881681static inline int regmap_get_val_bytes(struct regmap *map)
    12891682{
Note: See TracChangeset for help on using the changeset viewer.