summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2019-06-03 04:25:32 -0400
committerWolfram Sang <wsa@the-dreams.de>2019-06-14 17:24:33 -0400
commitd68222d4d6647611be5a32c80a53a145e7c80ce9 (patch)
tree924ad7301c74696147c60153ec2ecb35bbdb0e3e
parente1714daad7cf8fe4d6dd91adcfbbdd0604b0210d (diff)
i2c: headers: always have a named variable in arguments
Much better to read and understand. Naming for i2c_adapter is not consistent (yet), so use the name which is also used in core code. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r--include/linux/i2c.h39
1 files changed, 20 insertions, 19 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 6bd199cfe61f..14e04fb4f46f 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -40,7 +40,8 @@ struct i2c_device_identity;
40union i2c_smbus_data; 40union i2c_smbus_data;
41struct i2c_board_info; 41struct i2c_board_info;
42enum i2c_slave_event; 42enum i2c_slave_event;
43typedef int (*i2c_slave_cb_t)(struct i2c_client *, enum i2c_slave_event, u8 *); 43typedef int (*i2c_slave_cb_t)(struct i2c_client *client,
44 enum i2c_slave_event event, u8 *val);
44 45
45struct module; 46struct module;
46struct property_entry; 47struct property_entry;
@@ -257,16 +258,16 @@ struct i2c_driver {
257 unsigned int class; 258 unsigned int class;
258 259
259 /* Standard driver model interfaces */ 260 /* Standard driver model interfaces */
260 int (*probe)(struct i2c_client *, const struct i2c_device_id *); 261 int (*probe)(struct i2c_client *client, const struct i2c_device_id *id);
261 int (*remove)(struct i2c_client *); 262 int (*remove)(struct i2c_client *client);
262 263
263 /* New driver model interface to aid the seamless removal of the 264 /* New driver model interface to aid the seamless removal of the
264 * current probe()'s, more commonly unused than used second parameter. 265 * current probe()'s, more commonly unused than used second parameter.
265 */ 266 */
266 int (*probe_new)(struct i2c_client *); 267 int (*probe_new)(struct i2c_client *client);
267 268
268 /* driver model interfaces that don't relate to enumeration */ 269 /* driver model interfaces that don't relate to enumeration */
269 void (*shutdown)(struct i2c_client *); 270 void (*shutdown)(struct i2c_client *client);
270 271
271 /* Alert callback, for example for the SMBus alert protocol. 272 /* Alert callback, for example for the SMBus alert protocol.
272 * The format and meaning of the data value depends on the protocol. 273 * The format and meaning of the data value depends on the protocol.
@@ -275,7 +276,7 @@ struct i2c_driver {
275 * For the SMBus Host Notify protocol, the data corresponds to the 276 * For the SMBus Host Notify protocol, the data corresponds to the
276 * 16-bit payload data reported by the slave device acting as master. 277 * 16-bit payload data reported by the slave device acting as master.
277 */ 278 */
278 void (*alert)(struct i2c_client *, enum i2c_alert_protocol protocol, 279 void (*alert)(struct i2c_client *client, enum i2c_alert_protocol protocol,
279 unsigned int data); 280 unsigned int data);
280 281
281 /* a ioctl like command that can be used to perform specific functions 282 /* a ioctl like command that can be used to perform specific functions
@@ -287,7 +288,7 @@ struct i2c_driver {
287 const struct i2c_device_id *id_table; 288 const struct i2c_device_id *id_table;
288 289
289 /* Device detection callback for automatic device creation */ 290 /* Device detection callback for automatic device creation */
290 int (*detect)(struct i2c_client *, struct i2c_board_info *); 291 int (*detect)(struct i2c_client *client, struct i2c_board_info *info);
291 const unsigned short *address_list; 292 const unsigned short *address_list;
292 struct list_head clients; 293 struct list_head clients;
293 294
@@ -447,10 +448,10 @@ extern struct i2c_client *
447i2c_new_probed_device(struct i2c_adapter *adap, 448i2c_new_probed_device(struct i2c_adapter *adap,
448 struct i2c_board_info *info, 449 struct i2c_board_info *info,
449 unsigned short const *addr_list, 450 unsigned short const *addr_list,
450 int (*probe)(struct i2c_adapter *, unsigned short addr)); 451 int (*probe)(struct i2c_adapter *adap, unsigned short addr));
451 452
452/* Common custom probe functions */ 453/* Common custom probe functions */
453extern int i2c_probe_func_quick_read(struct i2c_adapter *, unsigned short addr); 454extern int i2c_probe_func_quick_read(struct i2c_adapter *adap, unsigned short addr);
454 455
455/* For devices that use several addresses, use i2c_new_dummy() to make 456/* For devices that use several addresses, use i2c_new_dummy() to make
456 * client handles for the extra addresses. 457 * client handles for the extra addresses.
@@ -466,7 +467,7 @@ i2c_new_secondary_device(struct i2c_client *client,
466 const char *name, 467 const char *name,
467 u16 default_addr); 468 u16 default_addr);
468 469
469extern void i2c_unregister_device(struct i2c_client *); 470extern void i2c_unregister_device(struct i2c_client *client);
470#endif /* I2C */ 471#endif /* I2C */
471 472
472/* Mainboard arch_initcall() code should register all its I2C devices. 473/* Mainboard arch_initcall() code should register all its I2C devices.
@@ -551,9 +552,9 @@ struct i2c_algorithm {
551 * The main operations are wrapped by i2c_lock_bus and i2c_unlock_bus. 552 * The main operations are wrapped by i2c_lock_bus and i2c_unlock_bus.
552 */ 553 */
553struct i2c_lock_operations { 554struct i2c_lock_operations {
554 void (*lock_bus)(struct i2c_adapter *, unsigned int flags); 555 void (*lock_bus)(struct i2c_adapter *adapter, unsigned int flags);
555 int (*trylock_bus)(struct i2c_adapter *, unsigned int flags); 556 int (*trylock_bus)(struct i2c_adapter *adapter, unsigned int flags);
556 void (*unlock_bus)(struct i2c_adapter *, unsigned int flags); 557 void (*unlock_bus)(struct i2c_adapter *adapter, unsigned int flags);
557}; 558};
558 559
559/** 560/**
@@ -726,7 +727,7 @@ i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter)
726 return NULL; 727 return NULL;
727} 728}
728 729
729int i2c_for_each_dev(void *data, int (*fn)(struct device *, void *)); 730int i2c_for_each_dev(void *data, int (*fn)(struct device *dev, void *data));
730 731
731/* Adapter locking functions, exported for shared pin cases */ 732/* Adapter locking functions, exported for shared pin cases */
732#define I2C_LOCK_ROOT_ADAPTER BIT(0) 733#define I2C_LOCK_ROOT_ADAPTER BIT(0)
@@ -832,12 +833,12 @@ static inline void i2c_mark_adapter_resumed(struct i2c_adapter *adap)
832/* administration... 833/* administration...
833 */ 834 */
834#if IS_ENABLED(CONFIG_I2C) 835#if IS_ENABLED(CONFIG_I2C)
835extern int i2c_add_adapter(struct i2c_adapter *); 836extern int i2c_add_adapter(struct i2c_adapter *adap);
836extern void i2c_del_adapter(struct i2c_adapter *); 837extern void i2c_del_adapter(struct i2c_adapter *adap);
837extern int i2c_add_numbered_adapter(struct i2c_adapter *); 838extern int i2c_add_numbered_adapter(struct i2c_adapter *adap);
838 839
839extern int i2c_register_driver(struct module *, struct i2c_driver *); 840extern int i2c_register_driver(struct module *owner, struct i2c_driver *driver);
840extern void i2c_del_driver(struct i2c_driver *); 841extern void i2c_del_driver(struct i2c_driver *driver);
841 842
842/* use a define to avoid include chaining to get THIS_MODULE */ 843/* use a define to avoid include chaining to get THIS_MODULE */
843#define i2c_add_driver(driver) \ 844#define i2c_add_driver(driver) \