|
@@ -925,6 +925,9 @@ EXPORT_SYMBOL(i2c_add_adapter);
|
|
* or otherwise built in to the system's mainboard, and where i2c_board_info
|
|
* or otherwise built in to the system's mainboard, and where i2c_board_info
|
|
* is used to properly configure I2C devices.
|
|
* is used to properly configure I2C devices.
|
|
*
|
|
*
|
|
|
|
+ * If the requested bus number is set to -1, then this function will behave
|
|
|
|
+ * identically to i2c_add_adapter, and will dynamically assign a bus number.
|
|
|
|
+ *
|
|
* If no devices have pre-been declared for this bus, then be sure to
|
|
* If no devices have pre-been declared for this bus, then be sure to
|
|
* register the adapter before any dynamically allocated ones. Otherwise
|
|
* register the adapter before any dynamically allocated ones. Otherwise
|
|
* the required bus ID may not be available.
|
|
* the required bus ID may not be available.
|
|
@@ -940,6 +943,8 @@ int i2c_add_numbered_adapter(struct i2c_adapter *adap)
|
|
int id;
|
|
int id;
|
|
int status;
|
|
int status;
|
|
|
|
|
|
|
|
+ if (adap->nr == -1) /* -1 means dynamically assign bus id */
|
|
|
|
+ return i2c_add_adapter(adap);
|
|
if (adap->nr & ~MAX_ID_MASK)
|
|
if (adap->nr & ~MAX_ID_MASK)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|