bif-framework.txt 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. Introduction
  2. ============
  3. BIF (Battery Interface) is a MIPI (Mobile Industry Processor Interface)
  4. Alliance specification for a serial interface between a host device and a
  5. battery pack. It provides a means to handle smart battery packs which can
  6. communicate over BIF as well as low cost battery packs which provide no
  7. serial communication interface.
  8. The BIF bus supports 1 master and up to 256 slaves. It supports data rates
  9. up to 250 kbps. The master is in charge of initiating all bus
  10. communications. Slaves may only respond asynchronously when they need to
  11. signal the master that they have an interrupt pending and when the bus is
  12. configured for interrupt mode.
  13. The BIF framework consists of a core into which BIF controller drivers
  14. register. At runtime, consumers are notified of various events (e.g. battery
  15. insertion and battery removal) via a notifier. Various framework functions are
  16. available for consumers to read and write slave registers as well as to send
  17. arbitrary BIF commands on the bus.
  18. Hardware description
  19. ====================
  20. The BIF bus is a 1-wire wired-or interface. The bus signal is referred to as
  21. the battery communication line (BCL). The BCL is pulled high by a resistor on
  22. the host side and is driven low when the master or one of the slaves is
  23. communicating. Additionally, there is a pull down resistor in the battery
  24. pack which is used to identify whether or not the battery pack has BIF slaves.
  25. Battery removal detection is achieved by comparing the analog voltage of the BCL
  26. when idle to the host side reference voltage. If these voltages are within a
  27. certain threshold, then a battery pack is not present.
  28. Slaves are addressed on the BIF bus using an 8-bit device address (DEV_ADR).
  29. Notably, it is possible for no slaves to have defined DEV_ADR. In this case,
  30. slave addressing is achieved via the always present unique ID (UID). The UID
  31. of a slave is 80 bits long and guaranteed to be globally unique. A UID search
  32. algorithm can be followed in order determine the UID of all slaves on the bus.
  33. BIF slaves come in two varieties: primary and secondary. A single primary
  34. slave may be present on the battery pack and a single primary slave may be
  35. present on the host. A battery pack primary slave has DEV_ADR=0x01. The
  36. DEV_ADR of a host primary slave is set by the manufacturer. A given primary
  37. slave contains a list of the UIDs of all secondary slaves in the same
  38. subsystem. This provides a fast mechanism to determine the address of all
  39. slaves without having to resort to the lengthy UID search algorithm.
  40. Each slave has a 64 kB address space. Part of this address space consists of
  41. generic DDB L1 and L2 data structures at known addresses. This allows for
  42. runtime discovery of supported battery properties and functions of a given
  43. smart battery pack.
  44. System Diagram:
  45. +-------------------------------+ +---------------------------------+
  46. | Host | | Smart Battery Pack |
  47. | | | |
  48. | Vbat-<+>-------<+>----------------------------+ |
  49. | | | | |
  50. | +--------------+ | | +--------------+ | |
  51. | | Master BIF<+>-+---------<+>--BCL--<+>------+-<+>BIF Primary | | |
  52. | | | | | | | | Slave | | |
  53. | +--------------+ | | | | +--------------+ | |
  54. | | | | | | |
  55. | + - - - - - - -+ | | | | + - - - - - - -+ | |
  56. | | Primary BIF<+>-+ | | +-<+>BIF Secondary| | |
  57. | | Slave | | | | | | Slave | | |
  58. | +- - - - - - - + | | | | +-- - - - - - -+ | |
  59. | | | | | | |
  60. | + - - - - - - -+ | | | | + - - - - - - -+ | |
  61. | |Secondary BIF<+>-+ | | +-<+>BIF Secondary| | |
  62. | |Slave | | | | | | Slave | | |
  63. | +- - - - - - - + | | | | +-- - - - - - -+ | |
  64. | / | | / | |
  65. | Vref \ Rpu | | Rid \ ---- |
  66. | ___ / | | / Battery -- |
  67. | | \ | | \ Cell ---- |
  68. | +-------+ | | | -- |
  69. | | | | | |
  70. | GND-<+>-------<+>------+---------------------+ |
  71. | | | |
  72. +-------------------------------+ +---------------------------------+
  73. An overview of BIF is available at:
  74. http://mipi.org/specifications/battery-interface
  75. Software description
  76. ====================
  77. A given BIF hardware interface driver registers as a BIF controller in the
  78. BIF framework during its probe function. The controller specifies a set of
  79. callback functions which are used by the BIF framework to initiate bus
  80. transactions (e.g. register read, register write, wait for slave interrupt)
  81. and to configure the bus. The framework exposes a small API to controllers
  82. which is used to notify the framework about asynchronous events such as
  83. battery pack insertion/removal and slave interrupts.
  84. A given BIF consumer is linked to a BIF controller by specifying a property
  85. in the consumer's device tree node which takes as its value the phandle of
  86. the BIF controller's device tree node.
  87. A consumer driver calls a get function during its probe function with its
  88. device pointer in order to get a handle to the BIF controller if it has probed.
  89. If it hasn't, then ERR_PTR(-EPROBE_DEFER) is returned. The controller handle
  90. can be used directly by the consumer to issue raw bus transactions if needed.
  91. The controller handle can then be used to query which slaves are currently
  92. present on the bus, if any. Handles to these slaves may be used by a consumer
  93. driver in high level framework APIs such as register read and register write
  94. which are slave oriented. All BIF framework API functions are synchronous,
  95. blocking, and can sleep.
  96. Consumer drivers may also register a notifier function which is called when
  97. certain bus activities occur such as battery pack insertion and removal.
  98. Additionally, consumer drivers may register a notifier function which is called
  99. when a specified slave interrupt fires.
  100. The framework maintains several linked-lists. One list contains all controllers
  101. that have been registered. A second list contains all slaves that have been
  102. seen since the system booted as well as a flag to indicate if they are currently
  103. present or not. This scheme is used to avoid issues with slave handles existing
  104. after a slave is removed and also so that function and object values do not have
  105. to be searched when a slave is reinserted in the system since slaves are
  106. globally unique and these features are read-only. Two further lists are
  107. maintained inside slave device structures which contain BIF functions and
  108. objects found in the slave. API functions are provided so that consumers can
  109. find functions supported by slaves.
  110. Design
  111. ======
  112. Design Goals:
  113. One major goal of the BIF framework is to provide a uniform API for BIF
  114. consumers to communicate with battery packs. This ensures that consumers are
  115. unaffected by changes in the controller driver which actually interfaces with
  116. the BCL at a hardware level.
  117. Another goal of the framework is to ensure the BIF bus can be shared between
  118. multiple consumers in a simple and functionally correct way. Locking is used
  119. inside of the framework to provide mutual exclusion on the bus.
  120. The framework also exposes features that almost all consumers will need, such
  121. as BIF slave identification and BIF function enumeration within a given slave.
  122. The framework allows consumers to issue very specific bus commands which may
  123. not be used within high level APIs. This provides maximum flexibility so
  124. that consumers can make use of manufacturer defined bus commands which cannot be
  125. handled in a generic fashion.
  126. Design Trade-offs:
  127. The choice to not treat BIF like a traditional Linux bus was made because
  128. there is nothing within BIF that naturally maps to a device on the bus for a
  129. driver to manage. Slave devices would be a good candidate except that
  130. consumers will not be managing slaves so much as functions exposed within
  131. slaves. Bus matching could then instead be made at a BIF slave function
  132. level. Unfortunately, the BIF specification allows for manufacturer specific
  133. features to reside at any non-defined addresses. Additionally, consumers may
  134. wish only to read and make policy decisions based on BIF non-volatile memory
  135. (NVM) objects read out of memory. Thus, there are use-cases that require
  136. consumers to utilize the bus without having a particular function to match to.
  137. Another trade-off was the choice to use custom interrupt handling functions
  138. instead of the Linux interrupt framework. This choice was made because there is
  139. no obvious way to handle IRQ chip registration given the dynamic nature of BIF
  140. slaves (i.e. slaves may come and go at runtime if battery packs are swapped).
  141. Software layering:
  142. BIF controller drivers register a set of callback functions with the BIF
  143. framework which implement various BIF transaction primitives. These
  144. callbacks ensure that tight timing constraints are met such as when receiving
  145. a bus query response immediately after issuing a command. Such actions
  146. cannot be carried out at the framework level as timing requirements are on
  147. the order of 32 us when using the maximum data rate.
  148. The BIF framework provides easy access to standard BIF features such as
  149. slave, functions, and interrupts. The framework also ensures mutual exclusion
  150. between different BIF consumers.
  151. BIF consumer drivers make use of the API exposed by the framework in order
  152. utilize functionality found on smart battery packs. One example of a
  153. consumer driver is a temperature monitoring driver which reads the
  154. temperature reported by the BIF temperature function on a BIF slave and
  155. reports it to the Linux thermal framework.
  156. Power Management
  157. ================
  158. The framework does not perform any special actions during system suspend and
  159. resume. Controller drivers may choose to enter low power states during
  160. suspend if they wish as long as it does not affect the logical state of the
  161. bus.
  162. SMP/multi-core
  163. ==============
  164. Various linked lists are maintained inside of the framework which are
  165. protected by mutexes. Mutex locks are also used during transactions at a bus
  166. level in order to ensure mutual exclusion between consumers of the bus.
  167. Performance
  168. ===========
  169. The BIF bus is inherently slow. Consumers should expect transactions to take
  170. a long time to execute. Consumers are responsible for blocking suspend if
  171. their transactions must be completed before the system enters suspend.
  172. Interface - BIF Consumer API
  173. ============================
  174. BIF framework structs, enums, and functions used by BIF consumers are defined in
  175. include/linux/bif/consumer.h
  176. Detailed descriptions of the BIF framework functions can be found in:
  177. drivers/bif/bif-core.c
  178. Get/put handle for a BIF controller:
  179. ------------------------------------
  180. struct bif_ctrl *bif_ctrl_get(struct device *consumer_dev);
  181. void bif_ctrl_put(struct bif_ctrl *ctrl);
  182. int bif_ctrl_count(void);
  183. struct bif_ctrl *bif_ctrl_get_by_id(unsigned int id);
  184. The function bif_ctrl_get() is intended to be the primary way to get a consumer
  185. BIF controller handle. It relies upon the consumer device specifying a
  186. "qcom,bif-ctrl" property in its device tree node which points to the phandle of
  187. the BIF controller it wishes to use.
  188. A secondary mechanism is also provided for drivers without device tree support.
  189. bif_ctrl_count() returns the number of BIF controllers currently registered.
  190. bif_ctrl_get_by_id() returns a handle to the id'th controller enumerated in
  191. registration order.
  192. Get/put handle for a BIF slave:
  193. -------------------------------
  194. int bif_slave_match_count(struct bif_ctrl *ctrl,
  195. const struct bif_match_criteria *match_criteria);
  196. struct bif_slave *bif_slave_match_get(struct bif_ctrl *ctrl,
  197. unsigned int id, const struct bif_match_criteria *match_criteria);
  198. void bif_slave_put(struct bif_slave *slave);
  199. A consumer finds a slave attached to a given BIF controller by specifying a set
  200. of matching criteria. The criteria can include such quantities as manufacturer
  201. ID, product ID, function type or function version. It is possible that multiple
  202. slaves will match the criteria. bif_slave_match_count() returns how many slaves
  203. match the specified criteria. bif_slave_match_get() returns the id'th slave
  204. which matches the criteria in an arbitrary, but fixed order (for a constant set
  205. of slaves). Consumer drivers need to be able to handle the case of multiple
  206. slaves matching the criteria.
  207. Additionally, if a battery pack is inserted or removed, then the output of
  208. bif_slave_match_count() and bif_slave_match_get() could change. A consumer
  209. driver can register to receive notification of battery pack insertion and
  210. removal using the bif_ctrl_notifier_register() function listed below.
  211. Check if slave handle is still meaningful:
  212. ------------------------------------------
  213. int bif_slave_is_present(struct bif_slave *slave);
  214. If a battery pack is removed, then the handles for its slaves will no longer be
  215. meaningful. All transactions using a handle for a slave that isn't present will
  216. fail. The function bif_slave_is_present() allows a consumer to determine if
  217. a given slave is still physically present in the system.
  218. Get access to the controller handle present in a slave handle:
  219. --------------------------------------------------------------
  220. struct bif_ctrl *bif_get_ctrl_handle(struct bif_slave *slave);
  221. This function is useful if a consumer wishes to only store a slave handle but
  222. also has need to call bus oriented BIF framework functions.
  223. Get version and register offset of a BIF function if it is present in a slave:
  224. ------------------------------------------------------------------------------
  225. int bif_slave_find_function(struct bif_slave *slave, u8 function, u8 *version,
  226. u16 *function_pointer);
  227. This function is used by consumers who wish to support given BIF functions
  228. (e.g. temperature measurement, authentication, etc.) found inside of slaves.
  229. Receive notification upon battery insertion and removal:
  230. --------------------------------------------------------
  231. int bif_ctrl_notifier_register(struct bif_ctrl *ctrl,
  232. struct notifier_block *nb);
  233. int bif_ctrl_notifier_unregister(struct bif_ctrl *ctrl,
  234. struct notifier_block *nb);
  235. Read or write BIF slave registers:
  236. ----------------------------------
  237. int bif_slave_read(struct bif_slave *slave, u16 addr, u8 *buf, int len);
  238. int bif_slave_write(struct bif_slave *slave, u16 addr, u8 *buf, int len);
  239. BIF slave non-volatile memory manipulation:
  240. -------------------------------------------
  241. int bif_slave_nvm_raw_read(struct bif_slave *slave, u16 offset, u8 *buf,
  242. int len);
  243. int bif_slave_nvm_raw_write(struct bif_slave *slave, u16 offset, u8 *buf,
  244. int len);
  245. Raw NVM writing may be needed in order to intialize the NVM BIF object list.
  246. However, its use can be dangerous as it can overwrite existing objects in the
  247. list and make the list unparsable.
  248. BIF object search in slave non-volatile memory:
  249. -----------------------------------------------
  250. int bif_object_match_count(struct bif_slave *slave,
  251. const struct bif_obj_match_criteria *match_criteria);
  252. struct bif_object *bif_object_match_get(struct bif_slave *slave,
  253. unsigned int id, const struct bif_obj_match_criteria *match_criteria);
  254. void bif_object_put(struct bif_object *object);
  255. bif_object_match_count() and bif_object_match_get() can be used together in
  256. order to retrieve the set of BIF objects within a slave which match certain
  257. criteria. bif_object_put() is used to free the memory allocated by
  258. bif_object_match_get().
  259. BIF object manipulation in slave non-volatile memory:
  260. -----------------------------------------------------
  261. int bif_object_write(struct bif_slave *slave, u8 type, u8 version, u16
  262. manufacturer_id, const u8 *data, int data_len);
  263. int bif_object_overwrite(struct bif_slave *slave,
  264. struct bif_object *object, u8 type, u8 version,
  265. u16 manufacturer_id, const u8 *data, int data_len);
  266. int bif_object_delete(struct bif_slave *slave, const struct bif_object *object);
  267. bif_object_write() can be used to write a new BIF data object into the NVM of
  268. a given slave. The new object is added to the end of the NVM object list.
  269. bif_object_overwrite() can be used to overwrite an existing BIF data object
  270. in the NVM of a slave. The new object data must be the same size as the
  271. existing object data. bif_object_delete() can be used to delete a object from
  272. the NVM object list and shift all of the objects after it in order to fill the
  273. deleted object's space.
  274. Get or set the BIF bus state or period:
  275. ---------------------------------------
  276. int bif_ctrl_get_bus_state(struct bif_ctrl *ctrl);
  277. int bif_ctrl_set_bus_state(struct bif_ctrl *ctrl, enum bif_bus_state state);
  278. int bif_ctrl_get_bus_period(struct bif_ctrl *ctrl);
  279. int bif_ctrl_set_bus_period(struct bif_ctrl *ctrl, int period_ns);
  280. Bus states include: active for communication, active waiting for interrupt,
  281. standby, and power down. The MIPI-BIF specification defines the allowed range
  282. of bus periods as 2000 ns to 153000 ns. Individual controllers may further
  283. restrict the range of allowed periods. When bif_ctrl_set_bus_period() is called
  284. the first supported period that greater than or equal to the specified period
  285. will be set.
  286. Measure battery pack resistance:
  287. --------------------------------
  288. int bif_ctrl_measure_rid(struct bif_ctrl *ctrl);
  289. This function returns an estimate of the battery pack resistance in ohms. If
  290. no battery pack is connected, then the output of this function is undefined.
  291. Utilize BIF slave tasks and interrupts:
  292. ---------------------------------------
  293. int bif_request_irq(struct bif_slave *slave, unsigned int task,
  294. struct notifier_block *nb);
  295. int bif_free_irq(struct bif_slave *slave, unsigned int task,
  296. struct notifier_block *nb);
  297. int bif_trigger_task(struct bif_slave *slave, unsigned int task);
  298. int bif_task_is_busy(struct bif_slave *slave, unsigned int task);
  299. int bif_enable_auto_task(struct bif_slave *slave, unsigned int task);
  300. int bif_disable_auto_task(struct bif_slave *slave, unsigned int task);
  301. A consumer can request a slave interrupt and specify a notifier to call when the
  302. interrupt is triggered. Once the interrupt is requested the consumer will need
  303. to call bif_trigger_task() in order to start the task associated with the
  304. interrupt (both are identified by the same index). Polling for task completion
  305. is also supported via the bif_task_is_busy() function. Auto task triggered can
  306. be enabled and disabled for a given task using bif_enable_auto_task() and
  307. bif_disable_auto_task() respectively.
  308. Raw BIF bus transactions:
  309. -------------------------
  310. void bif_ctrl_bus_lock(struct bif_ctrl *ctrl);
  311. void bif_ctrl_bus_unlock(struct bif_ctrl *ctrl);
  312. int bif_ctrl_raw_transaction(struct bif_ctrl *ctrl, int transaction, u8 data);
  313. int bif_ctrl_raw_transaction_read(struct bif_ctrl *ctrl, int transaction,
  314. u8 data, int *response);
  315. int bif_ctrl_raw_transaction_query(struct bif_ctrl *ctrl, int transaction,
  316. u8 data, bool *query_response);
  317. int bif_slave_is_selected(struct bif_slave *slave);
  318. int bif_slave_select(struct bif_slave *slave);
  319. The function bif_ctrl_bus_lock() locks the BIF bus for exclusive use by the
  320. consumer. No other transactions will be allowed on the bus including those
  321. that would arise from battery insertion/removal or slave interrupt reception.
  322. This lock is primarily intended to be used along with the raw transaction
  323. functions. These functions allow a consumer to issue any BIF transaction
  324. including manufacturer specific bus commands not handled by the BIF framework.
  325. While performing raw transactions, features normally performed transparently by
  326. the core, such as device selection, are not available. The functions
  327. bif_slave_select() and bif_slave_is_selected() can be used to fill in this gap
  328. so that raw transactions are performed on the desired slave.
  329. Notify the BIF core that a battery has been inserted or removed:
  330. ----------------------------------------------------------------
  331. int bif_ctrl_signal_battery_changed(struct bif_ctrl *ctrl);
  332. This function should only be called on systems where the BIF controller driver
  333. is architecturally unable to detect battery insertion and removal on its own.
  334. Perform BIF object CRC using CRC-CCITT algorithm:
  335. -------------------------------------------------
  336. u16 bif_crc_ccitt(const u8 *buffer, int len);
  337. Interface - BIF Controller API
  338. ==============================
  339. BIF framework structs and functions used by BIF controllers are defined in:
  340. include/linux/bif/driver.h
  341. Ops found in struct bif_ctrl_ops:
  342. ---------------------------------
  343. int (*bus_transaction) (struct bif_ctrl_dev *bdev, int transaction, u8 data);
  344. int (*bus_transaction_query) (struct bif_ctrl_dev *bdev, int transaction,
  345. u8 data, bool *query_response);
  346. int (*bus_transaction_read) (struct bif_ctrl_dev *bdev, int transaction,
  347. u8 data, int *response);
  348. int (*read_slave_registers) (struct bif_ctrl_dev *bdev, u16 addr,
  349. u8 *data, int len);
  350. int (*write_slave_registers) (struct bif_ctrl_dev *bdev, u16 addr,
  351. const u8 *data, int len);
  352. int (*get_bus_period) (struct bif_ctrl_dev *bdev);
  353. int (*set_bus_period) (struct bif_ctrl_dev *bdev, int period_ns);
  354. int (*get_battery_presence) (struct bif_ctrl_dev *bdev);
  355. int (*get_battery_rid) (struct bif_ctrl_dev *bdev);
  356. int (*get_bus_state) (struct bif_ctrl_dev *bdev);
  357. int (*set_bus_state) (struct bif_ctrl_dev *bdev, int state);
  358. A BIF controller driver registers a set of call back functions which instantiate
  359. these ops. The BIF framework then calls these functions based on internal and
  360. consumer needs.
  361. The ops bus_transaction(), bus_transaction_query(), and bus_transaction_read()
  362. carry out the controller hardware specific actions to perform BIF transactions
  363. on the BIF bus. These transactions result in no slave response, a pulse in
  364. response, or a word in response respectively. The ops read_slave_registers()
  365. and write_slave_registers() internally must perform all transactions necessary
  366. to read and write to BIF slave registers. These ops exist so that burst reads
  367. and writes can take place since these activities have very tight timing
  368. constraints that the BIF core cannot handle.
  369. The ops get_bus_period() and set_bus_period() return the current bus clock base
  370. period in nanoseconds and change the period to a new value respectively. The
  371. ops get_bus_state() and set_bus_state() allow for monitoring and controlling the
  372. bus state (i.e. active for communication, active waiting for interrupt, standby,
  373. or power down). The op get_battery_presence() returns if any battery pack
  374. (smart or low cost) is currently connected to the BCL. The op get_battery_rid()
  375. returns a best estimate of the Rid battery pack pull down ID resistance in ohms
  376. which can be used to determine if the battery pack is smart or low cost.
  377. Register/unregister a BIF controller:
  378. -------------------------------------
  379. struct bif_ctrl_dev *bif_ctrl_register(struct bif_ctrl_desc *bif_desc,
  380. struct device *dev, void *driver_data, struct device_node *of_node);
  381. void bif_ctrl_unregister(struct bif_ctrl_dev *bdev);
  382. Notify the BIF framework that a battery has been inserted or removed:
  383. ---------------------------------------------------------------------
  384. int bif_ctrl_notify_battery_changed(struct bif_ctrl_dev *bdev);
  385. The BIF core will then call the get_battery_presence() op internally to
  386. determine if the event is an insertion or removal.
  387. Notify the BIF framework that a slave interrupt has been received:
  388. ------------------------------------------------------------------
  389. int bif_ctrl_notify_slave_irq(struct bif_ctrl_dev *bdev);
  390. Upon receiving this call, the BIF core interrogates each slave to determine
  391. which slaves have pending interrupts. It then iterates through all interrupts
  392. on those slaves clearing all pending interrupts and notifying any consumers
  393. waiting for the interrupts.
  394. Get BIF controller private data:
  395. --------------------------------
  396. void *bdev_get_drvdata(struct bif_ctrl_dev *bdev);
  397. Config options
  398. ==============
  399. CONFIG_BIF - Enables BIF framework support.
  400. User space utilities
  401. ====================
  402. No user space interface is provided in the BIF framework. Therefore, user
  403. space will not be able to directly use it.
  404. To do
  405. =====
  406. It is conceivable that the BIF framework should take some action during
  407. system suspend and resume. However, it is not clear exactly what should be
  408. done given that the BCL would still need to be active in order to detect
  409. battery removal while suspended.
  410. sysfs nodes could be added which describe slaves as well as functions and
  411. objects within the slaves. However these nodes would be read-only and would
  412. really only be useful for descriptive as opposed to control purposes.
  413. The exact time at which slave searching, function enumeration, and object
  414. loading takes place could be optimized in order to improve performance to
  415. some degree. It could also be made configurable at a controller level if
  416. needed.