dts/bindings: Add a dedicated frame format property on SPI device

Most of the time SPI devices use TI's frame format. But some may use
Motorola's. This is already taken care of in the SPI API and now it will
be possible to select the right format from DTS. Like:

    ...
    frame-format = <SPI_FRAME_FORMAT_MOTOROLA>;
    ...

This is only meant to be used for devices supporting both formats (so
the format is not hard-coded in the driver) and selected by hardware
configuration or else.  Which, in such case, it will need to use
DT_INST_PROP(<instance number>, frame-format) macro call to retrieve
the property value. Others can fully ignore it.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2021-11-11 08:00:00 +01:00 committed by Carles Cufí
commit 1c1a2ccdbd
3 changed files with 30 additions and 16 deletions

View file

@ -117,22 +117,6 @@ extern "C" {
#define SPI_CS_ACTIVE_HIGH BIT(14)
/** @} */
/**
* @name SPI Frame Format
* @{
*
* 2 frame formats are exposed: Motorola and TI.
* The main difference is the behavior of the CS line. In Motorala it stays
* active the whole transfer. In TI, it's active only one serial clock period
* prior to actually make the transfer, it is thus inactive during the transfer,
* which ends when the clocks ends as well.
* By default, as it is the most commonly used, the Motorola frame format
* will prevail.
*/
#define SPI_FRAME_FORMAT_MOTOROLA (0U << 15)
#define SPI_FRAME_FORMAT_TI (1U << 15)
/** @} */
/**
* @name SPI MISO lines (if @kconfig{CONFIG_SPI_EXTENDED_MODES} is enabled)
* @{

View file

@ -24,6 +24,22 @@
#define SPI_HALF_DUPLEX (1U << 11)
/** @} */
/**
* @name SPI Frame Format
* @{
*
* 2 frame formats are exposed: Motorola and TI.
* The main difference is the behavior of the CS line. In Motorala it stays
* active the whole transfer. In TI, it's active only one serial clock period
* prior to actually make the transfer, it is thus inactive during the transfer,
* which ends when the clocks ends as well.
* By default, as it is the most commonly used, the Motorola frame format
* will prevail.
*/
#define SPI_FRAME_FORMAT_MOTOROLA (0U << 15)
#define SPI_FRAME_FORMAT_TI (1U << 15)
/** @} */
/**
* @}
*/