Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: i2c-smbus: Move i2c_setup_smbus_alert from i2c-smbus to i2c-core-smbus

In preparation to adding of_i2c_setup_smbus_alert() move
i2c_setup_smbus_alert() to core module. of_i2c_setup_smbus_alert()
will call i2c_setup_smbus_alert() and this avoid module dependecy issues.

Signed-off-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

authored by

Phil Reid and committed by
Wolfram Sang
3c0a60be 9b9f2b8b

+33 -32
+33
drivers/i2c/i2c-core-smbus.c
··· 17 17 #include <linux/device.h> 18 18 #include <linux/err.h> 19 19 #include <linux/i2c.h> 20 + #include <linux/i2c-smbus.h> 20 21 21 22 #define CREATE_TRACE_POINTS 22 23 #include <trace/events/smbus.h> ··· 593 592 return i; 594 593 } 595 594 EXPORT_SYMBOL(i2c_smbus_read_i2c_block_data_or_emulated); 595 + 596 + /** 597 + * i2c_setup_smbus_alert - Setup SMBus alert support 598 + * @adapter: the target adapter 599 + * @setup: setup data for the SMBus alert handler 600 + * Context: can sleep 601 + * 602 + * Setup handling of the SMBus alert protocol on a given I2C bus segment. 603 + * 604 + * Handling can be done either through our IRQ handler, or by the 605 + * adapter (from its handler, periodic polling, or whatever). 606 + * 607 + * NOTE that if we manage the IRQ, we *MUST* know if it's level or 608 + * edge triggered in order to hand it to the workqueue correctly. 609 + * If triggering the alert seems to wedge the system, you probably 610 + * should have said it's level triggered. 611 + * 612 + * This returns the ara client, which should be saved for later use with 613 + * i2c_handle_smbus_alert() and ultimately i2c_unregister_device(); or NULL 614 + * to indicate an error. 615 + */ 616 + struct i2c_client *i2c_setup_smbus_alert(struct i2c_adapter *adapter, 617 + struct i2c_smbus_alert_setup *setup) 618 + { 619 + struct i2c_board_info ara_board_info = { 620 + I2C_BOARD_INFO("smbus_alert", 0x0c), 621 + .platform_data = setup, 622 + }; 623 + 624 + return i2c_new_device(adapter, &ara_board_info); 625 + } 626 + EXPORT_SYMBOL_GPL(i2c_setup_smbus_alert);
-32
drivers/i2c/i2c-smbus.c
··· 183 183 }; 184 184 185 185 /** 186 - * i2c_setup_smbus_alert - Setup SMBus alert support 187 - * @adapter: the target adapter 188 - * @setup: setup data for the SMBus alert handler 189 - * Context: can sleep 190 - * 191 - * Setup handling of the SMBus alert protocol on a given I2C bus segment. 192 - * 193 - * Handling can be done either through our IRQ handler, or by the 194 - * adapter (from its handler, periodic polling, or whatever). 195 - * 196 - * NOTE that if we manage the IRQ, we *MUST* know if it's level or 197 - * edge triggered in order to hand it to the workqueue correctly. 198 - * If triggering the alert seems to wedge the system, you probably 199 - * should have said it's level triggered. 200 - * 201 - * This returns the ara client, which should be saved for later use with 202 - * i2c_handle_smbus_alert() and ultimately i2c_unregister_device(); or NULL 203 - * to indicate an error. 204 - */ 205 - struct i2c_client *i2c_setup_smbus_alert(struct i2c_adapter *adapter, 206 - struct i2c_smbus_alert_setup *setup) 207 - { 208 - struct i2c_board_info ara_board_info = { 209 - I2C_BOARD_INFO("smbus_alert", 0x0c), 210 - .platform_data = setup, 211 - }; 212 - 213 - return i2c_new_device(adapter, &ara_board_info); 214 - } 215 - EXPORT_SYMBOL_GPL(i2c_setup_smbus_alert); 216 - 217 - /** 218 186 * i2c_handle_smbus_alert - Handle an SMBus alert 219 187 * @ara: the ARA client on the relevant adapter 220 188 * Context: can't sleep