@@ -162,6 +162,11 @@ struct spi_cs_control {
162
162
*
163
163
* @note Only cs_hold and lock_on can be changed between consecutive
164
164
* transceive call. Rest of the attributes are not meant to be tweaked.
165
+ *
166
+ * @warning Most drivers use pointer comparison to determine whether a
167
+ * passed configuration is different from one used in a previous
168
+ * transaction. Changes to fields in the structure may not be
169
+ * detected.
165
170
*/
166
171
struct spi_config {
167
172
uint32_t frequency ;
@@ -244,6 +249,8 @@ __subsystem struct spi_driver_api {
244
249
*
245
250
* @param dev Pointer to the device structure for the driver instance
246
251
* @param config Pointer to a valid spi_config structure instance.
252
+ * Pointer-comparison may be used to detect changes from
253
+ * previous operations.
247
254
* @param tx_bufs Buffer array where data to be sent originates from,
248
255
* or NULL if none.
249
256
* @param rx_bufs Buffer array where data to be read will be written to,
@@ -276,6 +283,8 @@ static inline int z_impl_spi_transceive(struct device *dev,
276
283
*
277
284
* @param dev Pointer to the device structure for the driver instance
278
285
* @param config Pointer to a valid spi_config structure instance.
286
+ * Pointer-comparison may be used to detect changes from
287
+ * previous operations.
279
288
* @param rx_bufs Buffer array where data to be read will be written to.
280
289
*
281
290
* @retval 0 If successful, negative errno code otherwise.
@@ -296,6 +305,8 @@ static inline int spi_read(struct device *dev,
296
305
*
297
306
* @param dev Pointer to the device structure for the driver instance
298
307
* @param config Pointer to a valid spi_config structure instance.
308
+ * Pointer-comparison may be used to detect changes from
309
+ * previous operations.
299
310
* @param tx_bufs Buffer array where data to be sent originates from.
300
311
*
301
312
* @retval 0 If successful, negative errno code otherwise.
@@ -316,6 +327,8 @@ static inline int spi_write(struct device *dev,
316
327
*
317
328
* @param dev Pointer to the device structure for the driver instance
318
329
* @param config Pointer to a valid spi_config structure instance.
330
+ * Pointer-comparison may be used to detect changes from
331
+ * previous operations.
319
332
* @param tx_bufs Buffer array where data to be sent originates from,
320
333
* or NULL if none.
321
334
* @param rx_bufs Buffer array where data to be read will be written to,
@@ -358,6 +371,8 @@ static inline int spi_transceive_async(struct device *dev,
358
371
*
359
372
* @param dev Pointer to the device structure for the driver instance
360
373
* @param config Pointer to a valid spi_config structure instance.
374
+ * Pointer-comparison may be used to detect changes from
375
+ * previous operations.
361
376
* @param rx_bufs Buffer array where data to be read will be written to.
362
377
* @param async A pointer to a valid and ready to be signaled
363
378
* struct k_poll_signal. (Note: if NULL this function will not
@@ -383,6 +398,8 @@ static inline int spi_read_async(struct device *dev,
383
398
*
384
399
* @param dev Pointer to the device structure for the driver instance
385
400
* @param config Pointer to a valid spi_config structure instance.
401
+ * Pointer-comparison may be used to detect changes from
402
+ * previous operations.
386
403
* @param tx_bufs Buffer array where data to be sent originates from.
387
404
* @param async A pointer to a valid and ready to be signaled
388
405
* struct k_poll_signal. (Note: if NULL this function will not
@@ -413,6 +430,8 @@ static inline int spi_write_async(struct device *dev,
413
430
*
414
431
* @param dev Pointer to the device structure for the driver instance
415
432
* @param config Pointer to a valid spi_config structure instance.
433
+ * Pointer-comparison may be used to detect changes from
434
+ * previous operations.
416
435
*/
417
436
__syscall int spi_release (struct device * dev ,
418
437
const struct spi_config * config );
0 commit comments