spi: Add function callback to get configuration of SPI bus

Add a new callback to spi_ctrlr structure - get_config - to obtain
configuration of SPI bus from the controller driver. Also, move common
config definitions from acpi_device.h to spi-generic.h

BUG=chrome-os-partner:59832
BRANCH=None
TEST=Compiles successfully

Change-Id: I412c8c70167d18058a32041c2310bc1c884043ce
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://review.coreboot.org/18337
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
This commit is contained in:
Furquan Shaikh
2017-01-08 13:32:30 -08:00
committed by Furquan Shaikh
parent c76e9982b2
commit 3e01b633d6
3 changed files with 53 additions and 17 deletions

View File

@@ -18,6 +18,7 @@
#include <device/i2c.h>
#include <stdint.h>
#include <spi-generic.h>
#define ACPI_DESCRIPTOR_LARGE (1 << 7)
#define ACPI_DESCRIPTOR_INTERRUPT (ACPI_DESCRIPTOR_LARGE | 9)
@@ -216,23 +217,6 @@ void acpi_device_write_i2c(const struct acpi_i2c *i2c);
* ACPI SPI Bus
*/
enum spi_clock_phase {
SPI_CLOCK_PHASE_FIRST,
SPI_CLOCK_PHASE_SECOND
};
/* SPI Flags bit 0 */
enum spi_wire_mode {
SPI_4_WIRE_MODE,
SPI_3_WIRE_MODE
};
/* SPI Flags bit 1 */
enum spi_polarity {
SPI_POLARITY_LOW,
SPI_POLARITY_HIGH
};
struct acpi_spi {
/* Device selection */
uint16_t device_select;