summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/linux/i2c.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index bc2b19ad9357..200cf13b00f6 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -655,7 +655,7 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
}
/**
- * module_i2c_driver() - Helper macro for registering a I2C driver
+ * module_i2c_driver() - Helper macro for registering a modular I2C driver
* @__i2c_driver: i2c_driver struct
*
* Helper macro for I2C drivers which do not do anything special in module
@@ -666,6 +666,17 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
module_driver(__i2c_driver, i2c_add_driver, \
i2c_del_driver)
+/**
+ * builtin_i2c_driver() - Helper macro for registering a builtin I2C driver
+ * @__i2c_driver: i2c_driver struct
+ *
+ * Helper macro for I2C drivers which do not do anything special in their
+ * init. This eliminates a lot of boilerplate. Each driver may only
+ * use this macro once, and calling it replaces device_initcall().
+ */
+#define builtin_i2c_driver(__i2c_driver) \
+ builtin_driver(__i2c_driver, i2c_add_driver)
+
#endif /* I2C */
#if IS_ENABLED(CONFIG_OF)