hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/spi/spi-loopback-test.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * linux/drivers/spi/spi-loopback-test.c
34 *
....@@ -6,16 +7,6 @@
67 * Loopback test driver to test several typical spi_message conditions
78 * that a spi_master driver may encounter
89 * this can also get used for regression testing
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or
13
- * (at your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU General Public License for more details.
1910 */
2011
2112 #include <linux/delay.h>
....@@ -307,12 +298,18 @@
307298 {
308299 .tx_buf = TX(0),
309300 .rx_buf = RX(0),
310
- .delay_usecs = 1000,
301
+ .delay = {
302
+ .value = 1000,
303
+ .unit = SPI_DELAY_UNIT_USECS,
304
+ },
311305 },
312306 {
313307 .tx_buf = TX(0),
314308 .rx_buf = RX(0),
315
- .delay_usecs = 1000,
309
+ .delay = {
310
+ .value = 1000,
311
+ .unit = SPI_DELAY_UNIT_USECS,
312
+ },
316313 },
317314 },
318315 },
....@@ -546,7 +543,7 @@
546543 unsigned long long nbits = (unsigned long long)BITS_PER_BYTE *
547544 xfer->len;
548545
549
- delay_usecs += xfer->delay_usecs;
546
+ delay_usecs += xfer->delay.value;
550547 if (!xfer->speed_hz)
551548 continue;
552549 estimated_time += div_u64(nbits * NSEC_PER_SEC, xfer->speed_hz);
....@@ -888,10 +885,10 @@
888885 /**
889886 * spi_test_execute_msg - default implementation to run a test
890887 *
891
- * spi: @spi_device on which to run the @spi_message
892
- * test: the test to execute, which already contains @msg
893
- * tx: the tx buffer allocated for the test sequence
894
- * rx: the rx buffer allocated for the test sequence
888
+ * @spi: @spi_device on which to run the @spi_message
889
+ * @test: the test to execute, which already contains @msg
890
+ * @tx: the tx buffer allocated for the test sequence
891
+ * @rx: the rx buffer allocated for the test sequence
895892 *
896893 * Returns: error code of spi_sync as well as basic error checking
897894 */
....@@ -960,10 +957,10 @@
960957 * including all the relevant iterations on:
961958 * length and buffer alignment
962959 *
963
- * spi: the spi_device to send the messages to
964
- * test: the test which we need to execute
965
- * tx: the tx buffer allocated for the test sequence
966
- * rx: the rx buffer allocated for the test sequence
960
+ * @spi: the spi_device to send the messages to
961
+ * @test: the test which we need to execute
962
+ * @tx: the tx buffer allocated for the test sequence
963
+ * @rx: the rx buffer allocated for the test sequence
967964 *
968965 * Returns: status code of spi_sync or other failures
969966 */