1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2011 The Chromium OS Authors.
10 int spi_set_wordlen(struct spi_slave *slave, unsigned int wordlen)
12 if (wordlen == 0 || wordlen > 32) {
13 printf("spi: invalid wordlen %u\n", wordlen);
17 slave->wordlen = wordlen;
22 void *spi_do_alloc_slave(int offset, int size, unsigned int bus,
29 struct spi_slave *slave;
31 memset(ptr, '\0', size);
32 slave = (struct spi_slave *)(ptr + offset);
35 slave->wordlen = SPI_DEFAULT_WORDLEN;