Lines Matching +full:cs +full:- +full:number
1 // SPDX-License-Identifier: GPL-2.0+
17 /*-----------------------------------------------------------------------
22 # define MAX_SPI_BYTES 32 /* Maximum number of bytes we can handle */
29 static unsigned int cs; variable
35 static int do_spi_xfer(int bus, int cs) in do_spi_xfer() argument
44 snprintf(name, sizeof(name), "generic_%d:%d", bus, cs); in do_spi_xfer()
47 return -ENOMEM; in do_spi_xfer()
48 ret = spi_get_bus_and_cs(bus, cs, 1000000, mode, "spi_generic_drv", in do_spi_xfer()
53 slave = spi_setup_slave(bus, cs, 1000000, mode); in do_spi_xfer()
55 printf("Invalid device %d:%d\n", bus, cs); in do_spi_xfer()
56 return -EINVAL; in do_spi_xfer()
68 ret = -EIO; in do_spi_xfer()
93 * {dev} is the device number for controlling chip select (see TBD)
94 * {num_bits} is the number of bits to send & receive (base 10)
116 cs = simple_strtoul(cp+1, &cp, 10); in do_spi()
118 cs = bus; in do_spi()
129 tmp = *cp - '0'; in do_spi()
131 tmp -= ('A' - '0') - 10; in do_spi()
133 tmp -= ('a' - 'A'); in do_spi()
151 if (do_spi_xfer(bus, cs)) in do_spi()
162 "[<bus>:]<cs>[.<mode>] <bit_len> <dout> - Send and receive bits\n"
163 "<bus> - Identifies the SPI bus\n"
164 "<cs> - Identifies the chip select\n"
165 "<mode> - Identifies the SPI mode to use\n"
166 "<bit_len> - Number of bits to send (base 10)\n"
167 "<dout> - Hexadecimal string that gets sent"