Merge remote-tracking branches 'regmap/topic/lockdep' and 'regmap/topic/seq-delay...
authorMark Brown <broonie@kernel.org>
Fri, 4 Sep 2015 16:22:10 +0000 (17:22 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 4 Sep 2015 16:22:10 +0000 (17:22 +0100)
1  2  3 
drivers/base/regmap/internal.h
drivers/base/regmap/regmap-i2c.c
drivers/base/regmap/regmap.c
drivers/mfd/arizona-core.c
include/linux/regmap.h
sound/soc/codecs/rt5645.c

index fc554e357c5dd57758501836579de3218d8bc170,b2b2849fc6d3b34d1294a02ef009a10af86d49de,873ddf91c9d3ec742ceb1c3a9959ac322adc16db..cc557886ab2377a550c1ae529b6ecee23380161f
@@@@ -136,13 -136,11 -136,11 +136,13 @@@@ struct regmap 
        /* if set, the HW registers are known to match map->reg_defaults */
        bool no_sync_defaults;
   
--      struct reg_default *patch;
++      struct reg_sequence *patch;
        int patch_regs;
   
 --     /* if set, converts bulk rw to single rw */
 --     bool use_single_rw;
 ++     /* if set, converts bulk read to single read */
 ++     bool use_single_read;
 ++     /* if set, converts bulk read to single read */
 ++     bool use_single_write;
        /* if set, the device supports multi write mode */
        bool can_multi_write;
   
Simple merge
index 4dd571f9d4c2de42122fbf521ce1654acf3f95dc,53ba9d9e17d1b7090eb04628a6008e69d92fede5,b3a5aa5cd580c0d1dd67ffe89df915e9e7ec7f7c..afaf56200674a29517678af763bc9a084659224b
@@@@ -1824,10 -1724,10 -1741,10 +1809,10 @@@@ EXPORT_SYMBOL_GPL(regmap_bulk_write)
    *
    * the (register,newvalue) pairs in regs have not been formatted, but
    * they are all in the same page and have been changed to being page
 -- * relative. The page register has been written if that was neccessary.
 ++ * relative. The page register has been written if that was necessary.
    */
   static int _regmap_raw_multi_reg_write(struct regmap *map,
--                                     const struct reg_default *regs,
++                                     const struct reg_sequence *regs,
                                       size_t num_regs)
   {
        int ret;
Simple merge
index e0fb86bfaafd7b3868f09ddcff7618ef74f8186d,ee032eca630d4930b5553dec484ea6f7564fab83,5a7cf2136c81fd9ec5a97f5c819b705febf96fbf..8fc0bfd8edc4434fc79fda8591323d6be41f0645
@@@@ -327,49 -323,184 -336,47 +342,186 @@@@ struct regmap_bus 
        u8 read_flag_mask;
        enum regmap_endian reg_format_endian_default;
        enum regmap_endian val_format_endian_default;
 ++     size_t max_raw_read;
 ++     size_t max_raw_write;
   };
   
- -struct regmap *regmap_init(struct device *dev,
- -                        const struct regmap_bus *bus,
- -                        void *bus_context,
- -                        const struct regmap_config *config);
+ +/*
+ + * __regmap_init functions.
+ + *
+ + * These functions take a lock key and name parameter, and should not be called
+ + * directly. Instead, use the regmap_init macros that generate a key and name
+ + * for each call.
+ + */
+ +struct regmap *__regmap_init(struct device *dev,
+ +                          const struct regmap_bus *bus,
+ +                          void *bus_context,
+ +                          const struct regmap_config *config,
+ +                          struct lock_class_key *lock_key,
+ +                          const char *lock_name);
+ +struct regmap *__regmap_init_i2c(struct i2c_client *i2c,
+ +                              const struct regmap_config *config,
+ +                              struct lock_class_key *lock_key,
+ +                              const char *lock_name);
+ +struct regmap *__regmap_init_spi(struct spi_device *dev,
+ +                              const struct regmap_config *config,
+ +                              struct lock_class_key *lock_key,
+ +                              const char *lock_name);
+ +struct regmap *__regmap_init_spmi_base(struct spmi_device *dev,
+ +                                    const struct regmap_config *config,
+ +                                    struct lock_class_key *lock_key,
+ +                                    const char *lock_name);
+ +struct regmap *__regmap_init_spmi_ext(struct spmi_device *dev,
+ +                                   const struct regmap_config *config,
+ +                                   struct lock_class_key *lock_key,
+ +                                   const char *lock_name);
+ +struct regmap *__regmap_init_mmio_clk(struct device *dev, const char *clk_id,
+ +                                   void __iomem *regs,
+ +                                   const struct regmap_config *config,
+ +                                   struct lock_class_key *lock_key,
+ +                                   const char *lock_name);
+ +struct regmap *__regmap_init_ac97(struct snd_ac97 *ac97,
+ +                               const struct regmap_config *config,
+ +                               struct lock_class_key *lock_key,
+ +                               const char *lock_name);
+ +
+ +struct regmap *__devm_regmap_init(struct device *dev,
+ +                               const struct regmap_bus *bus,
+ +                               void *bus_context,
+ +                               const struct regmap_config *config,
+ +                               struct lock_class_key *lock_key,
+ +                               const char *lock_name);
+ +struct regmap *__devm_regmap_init_i2c(struct i2c_client *i2c,
+ +                                   const struct regmap_config *config,
+ +                                   struct lock_class_key *lock_key,
+ +                                   const char *lock_name);
+ +struct regmap *__devm_regmap_init_spi(struct spi_device *dev,
+ +                                   const struct regmap_config *config,
+ +                                   struct lock_class_key *lock_key,
+ +                                   const char *lock_name);
+ +struct regmap *__devm_regmap_init_spmi_base(struct spmi_device *dev,
+ +                                         const struct regmap_config *config,
+ +                                         struct lock_class_key *lock_key,
+ +                                         const char *lock_name);
+ +struct regmap *__devm_regmap_init_spmi_ext(struct spmi_device *dev,
+ +                                        const struct regmap_config *config,
+ +                                        struct lock_class_key *lock_key,
+ +                                        const char *lock_name);
+ +struct regmap *__devm_regmap_init_mmio_clk(struct device *dev,
+ +                                        const char *clk_id,
+ +                                        void __iomem *regs,
+ +                                        const struct regmap_config *config,
+ +                                        struct lock_class_key *lock_key,
+ +                                        const char *lock_name);
+ +struct regmap *__devm_regmap_init_ac97(struct snd_ac97 *ac97,
+ +                                    const struct regmap_config *config,
+ +                                    struct lock_class_key *lock_key,
+ +                                    const char *lock_name);
+ +
+ +/*
+ + * Wrapper for regmap_init macros to include a unique lockdep key and name
+ + * for each call. No-op if CONFIG_LOCKDEP is not set.
+ + *
+ + * @fn: Real function to call (in the form __[*_]regmap_init[_*])
+ + * @name: Config variable name (#config in the calling macro)
+ + **/
+ +#ifdef CONFIG_LOCKDEP
+ +#define __regmap_lockdep_wrapper(fn, name, ...)                              \
+ +(                                                                    \
+ +     ({                                                              \
+ +             static struct lock_class_key _key;                      \
+ +             fn(__VA_ARGS__, &_key,                                  \
+ +                     KBUILD_BASENAME ":"                             \
+ +                     __stringify(__LINE__) ":"                       \
+ +                     "(" name ")->lock");                            \
+ +     })                                                              \
+ +)
+ +#else
+ +#define __regmap_lockdep_wrapper(fn, name, ...) fn(__VA_ARGS__, NULL, NULL)
+ +#endif
+ +
+ +/**
+ + * regmap_init(): Initialise register map
+ + *
+ + * @dev: Device that will be interacted with
+ + * @bus: Bus-specific callbacks to use with device
+ + * @bus_context: Data passed to bus-specific callbacks
+ + * @config: Configuration for register map
+ + *
+ + * The return value will be an ERR_PTR() on error or a valid pointer to
+ + * a struct regmap.  This function should generally not be called
+ + * directly, it should be called by bus-specific init functions.
+ + */
+ +#define regmap_init(dev, bus, bus_context, config)                   \
+ +     __regmap_lockdep_wrapper(__regmap_init, #config,                \
+ +                             dev, bus, bus_context, config)
   int regmap_attach_dev(struct device *dev, struct regmap *map,
- -                              const struct regmap_config *config);
- -struct regmap *regmap_init_i2c(struct i2c_client *i2c,
- -                            const struct regmap_config *config);
- -struct regmap *regmap_init_spi(struct spi_device *dev,
- -                            const struct regmap_config *config);
- -struct regmap *regmap_init_spmi_base(struct spmi_device *dev,
- -                                  const struct regmap_config *config);
- -struct regmap *regmap_init_spmi_ext(struct spmi_device *dev,
- -                                 const struct regmap_config *config);
- -struct regmap *regmap_init_mmio_clk(struct device *dev, const char *clk_id,
- -                                 void __iomem *regs,
- -                                 const struct regmap_config *config);
- -struct regmap *regmap_init_ac97(struct snd_ac97 *ac97,
- -                             const struct regmap_config *config);
- -
- -struct regmap *devm_regmap_init(struct device *dev,
- -                             const struct regmap_bus *bus,
- -                             void *bus_context,
- -                             const struct regmap_config *config);
- -struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c,
- -                                 const struct regmap_config *config);
- -struct regmap *devm_regmap_init_spi(struct spi_device *dev,
- -                                 const struct regmap_config *config);
- -struct regmap *devm_regmap_init_spmi_base(struct spmi_device *dev,
- -                                       const struct regmap_config *config);
- -struct regmap *devm_regmap_init_spmi_ext(struct spmi_device *dev,
- -                                      const struct regmap_config *config);
- -struct regmap *devm_regmap_init_mmio_clk(struct device *dev, const char *clk_id,
- -                                      void __iomem *regs,
- -                                      const struct regmap_config *config);
- -struct regmap *devm_regmap_init_ac97(struct snd_ac97 *ac97,
- -                                  const struct regmap_config *config);
+ +                   const struct regmap_config *config);
   
- -bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
+ +/**
+ + * regmap_init_i2c(): Initialise register map
+ + *
+ + * @i2c: Device that will be interacted with
+ + * @config: Configuration for register map
+ + *
+ + * The return value will be an ERR_PTR() on error or a valid pointer to
+ + * a struct regmap.
+ + */
+ +#define regmap_init_i2c(i2c, config)                                 \
+ +     __regmap_lockdep_wrapper(__regmap_init_i2c, #config,            \
+ +                             i2c, config)
+ +
+ +/**
+ + * regmap_init_spi(): Initialise register map
+ + *
+ + * @spi: Device that will be interacted with
+ + * @config: Configuration for register map
+ + *
+ + * The return value will be an ERR_PTR() on error or a valid pointer to
+ + * a struct regmap.
+ + */
+ +#define regmap_init_spi(dev, config)                                 \
+ +     __regmap_lockdep_wrapper(__regmap_init_spi, #config,            \
+ +                             dev, config)
+ +
+ +/**
+ + * regmap_init_spmi_base(): Create regmap for the Base register space
+ + * @sdev:    SPMI device that will be interacted with
+ + * @config:  Configuration for register map
+ + *
+ + * The return value will be an ERR_PTR() on error or a valid pointer to
+ + * a struct regmap.
+ + */
+ +#define regmap_init_spmi_base(dev, config)                           \
+ +     __regmap_lockdep_wrapper(__regmap_init_spmi_base, #config,      \
+ +                             dev, config)
+ +
+ +/**
+ + * regmap_init_spmi_ext(): Create regmap for Ext register space
+ + * @sdev:    Device that will be interacted with
+ + * @config:  Configuration for register map
+ + *
+ + * The return value will be an ERR_PTR() on error or a valid pointer to
+ + * a struct regmap.
+ + */
+ +#define regmap_init_spmi_ext(dev, config)                            \
+ +     __regmap_lockdep_wrapper(__regmap_init_spmi_ext, #config,       \
+ +                             dev, config)
+ +
+ +/**
+ + * regmap_init_mmio_clk(): Initialise register map with register clock
+ + *
+ + * @dev: Device that will be interacted with
+ + * @clk_id: register clock consumer ID
+ + * @regs: Pointer to memory-mapped IO region
+ + * @config: Configuration for register map
+ + *
+ + * The return value will be an ERR_PTR() on error or a valid pointer to
+ + * a struct regmap.
+ + */
+ +#define regmap_init_mmio_clk(dev, clk_id, regs, config)                      \
+ +     __regmap_lockdep_wrapper(__regmap_init_mmio_clk, #config,       \
+ +                             dev, clk_id, regs, config)
   
   /**
    * regmap_init_mmio(): Initialise register map
Simple merge