Add the sandbox_spi_get_wordlen() public interface to retrieve the
internal word length state of the sandbox SPI device.
This is intended for use in sandbox SPI test cases to verify that
the word length is correctly propagated from the SPI uclass to
the driver.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Simon Glass <simon.glass@canonical.com>
*/
uint sandbox_spi_get_mode(struct udevice *dev);
+/**
+ * sandbox_spi_get_wordlen() - Get current wordlen setting of a sandbox spi slave
+ *
+ * @dev: Device to check
+ * Return: current wordlen
+ */
+uint sandbox_spi_get_wordlen(struct udevice *dev);
+
/**
* sandbox_get_pch_spi_protect() - Get the PCI SPI protection status
*
return priv->mode;
}
+uint sandbox_spi_get_wordlen(struct udevice *dev)
+{
+ struct spi_slave *slave = dev_get_parent_priv(dev);
+
+ return slave->wordlen;
+}
+
static int sandbox_spi_set_wordlen(struct udevice *dev, unsigned int wordlen)
{
struct spi_slave *slave = dev_get_parent_priv(dev);