]> Git Repo - J-linux.git/commitdiff
fsi: Add regmap and refactor sbefifo
authorMark Brown <[email protected]>
Fri, 25 Nov 2022 21:26:29 +0000 (21:26 +0000)
committerMark Brown <[email protected]>
Fri, 25 Nov 2022 21:26:29 +0000 (21:26 +0000)
Merge series from Eddie James <[email protected]>:

The SBEFIFO hardware can now be attached over a new I2C endpoint interface
called the I2C Responder (I2CR). In order to use the existing SBEFIFO
driver, add a regmap driver for the FSI bus and an endpoint driver for the
I2CR. Then, refactor the SBEFIFO and OCC drivers to clean up and use the
new regmap driver or the I2CR interface.

This branch just has the regmap change so it can be shared with the FSI
code.

1  2 
include/linux/regmap.h

diff --combined include/linux/regmap.h
index 3faf5d5dbb26d89eabdfeee63da394ddff6bfc59,e477112fb1c788703ffce7b1f832d92b789aac13..5a56fc55ebd7f59aefa81153d978b66b93ee2eb7
@@@ -24,6 -24,7 +24,7 @@@ struct module
  struct clk;
  struct device;
  struct device_node;
+ struct fsi_device;
  struct i2c_client;
  struct i3c_device;
  struct irq_domain;
@@@ -628,6 -629,10 +629,10 @@@ struct regmap *__regmap_init_spi_avmm(s
                                      const struct regmap_config *config,
                                      struct lock_class_key *lock_key,
                                      const char *lock_name);
+ struct regmap *__regmap_init_fsi(struct fsi_device *fsi_dev,
+                                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,
@@@ -693,6 -698,11 +698,11 @@@ struct regmap *__devm_regmap_init_spi_a
                                           const struct regmap_config *config,
                                           struct lock_class_key *lock_key,
                                           const char *lock_name);
+ struct regmap *__devm_regmap_init_fsi(struct fsi_device *fsi_dev,
+                                     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.
@@@ -919,6 -929,19 +929,19 @@@ bool regmap_ac97_default_volatile(struc
        __regmap_lockdep_wrapper(__regmap_init_spi_avmm, #config,               \
                                 spi, config)
  
+ /**
+  * regmap_init_fsi() - Initialise register map
+  *
+  * @fsi_dev: 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_fsi(fsi_dev, config)                              \
+       __regmap_lockdep_wrapper(__regmap_init_fsi, #config, fsi_dev,   \
+                                config)
  /**
   * devm_regmap_init() - Initialise managed register map
   *
        __regmap_lockdep_wrapper(__devm_regmap_init_spi_avmm, #config,  \
                                 spi, config)
  
+ /**
+  * devm_regmap_init_fsi() - Initialise managed register map
+  *
+  * @fsi_dev: 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.  The regmap will be automatically freed by the
+  * device management code.
+  */
+ #define devm_regmap_init_fsi(fsi_dev, config)                         \
+       __regmap_lockdep_wrapper(__devm_regmap_init_fsi, #config,       \
+                                fsi_dev, config)
  int regmap_mmio_attach_clk(struct regmap *map, struct clk *clk);
  void regmap_mmio_detach_clk(struct regmap *map);
  void regmap_exit(struct regmap *map);
@@@ -1219,7 -1256,6 +1256,7 @@@ static inline int regmap_write_bits(str
  int regmap_get_val_bytes(struct regmap *map);
  int regmap_get_max_register(struct regmap *map);
  int regmap_get_reg_stride(struct regmap *map);
 +bool regmap_might_sleep(struct regmap *map);
  int regmap_async_complete(struct regmap *map);
  bool regmap_can_raw_write(struct regmap *map);
  size_t regmap_get_raw_read_max(struct regmap *map);
@@@ -1906,12 -1942,6 +1943,12 @@@ static inline int regmap_get_reg_stride
        return -EINVAL;
  }
  
 +static inline bool regmap_might_sleep(struct regmap *map)
 +{
 +      WARN_ONCE(1, "regmap API is disabled");
 +      return true;
 +}
 +
  static inline int regcache_sync(struct regmap *map)
  {
        WARN_ONCE(1, "regmap API is disabled");
This page took 0.063669 seconds and 4 git commands to generate.