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