mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-27 23:20:26 +09:00
test: spi: Add sandbox_spi_get_{speed, mode} interface
Introduce sandbox_spi_get_{speed, mode} public interface to retrieve the sandbox spi bus internal state. They are meant to be used in sandbox spi testcases. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
2da1800456
commit
add685fb6d
@ -202,6 +202,22 @@ void sandbox_set_allow_beep(struct udevice *dev, bool allow);
|
|||||||
*/
|
*/
|
||||||
int sandbox_get_beep_frequency(struct udevice *dev);
|
int sandbox_get_beep_frequency(struct udevice *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sandbox_spi_get_speed() - Get current speed setting of a sandbox spi bus
|
||||||
|
*
|
||||||
|
* @dev: Device to check
|
||||||
|
* @return current bus speed
|
||||||
|
*/
|
||||||
|
uint sandbox_spi_get_speed(struct udevice *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sandbox_spi_get_mode() - Get current mode setting of a sandbox spi bus
|
||||||
|
*
|
||||||
|
* @dev: Device to check
|
||||||
|
* @return current mode
|
||||||
|
*/
|
||||||
|
uint sandbox_spi_get_mode(struct udevice *dev);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sandbox_get_pch_spi_protect() - Get the PCI SPI protection status
|
* sandbox_get_pch_spi_protect() - Get the PCI SPI protection status
|
||||||
*
|
*
|
||||||
|
@ -52,6 +52,20 @@ __weak int sandbox_spi_get_emul(struct sandbox_state *state,
|
|||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint sandbox_spi_get_speed(struct udevice *dev)
|
||||||
|
{
|
||||||
|
struct sandbox_spi_priv *priv = dev_get_priv(dev);
|
||||||
|
|
||||||
|
return priv->speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint sandbox_spi_get_mode(struct udevice *dev)
|
||||||
|
{
|
||||||
|
struct sandbox_spi_priv *priv = dev_get_priv(dev);
|
||||||
|
|
||||||
|
return priv->mode;
|
||||||
|
}
|
||||||
|
|
||||||
static int sandbox_spi_xfer(struct udevice *slave, unsigned int bitlen,
|
static int sandbox_spi_xfer(struct udevice *slave, unsigned int bitlen,
|
||||||
const void *dout, void *din, unsigned long flags)
|
const void *dout, void *din, unsigned long flags)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user