x86: irq: Support flags for acpi_gpe
[platform/kernel/u-boot.git] / include / spi.h
index 5cc6d6e..98ba9e7 100644 (file)
@@ -13,8 +13,8 @@
 #include <linux/bitops.h>
 
 /* SPI mode flags */
-#define SPI_CPHA       BIT(0)                  /* clock phase */
-#define SPI_CPOL       BIT(1)                  /* clock polarity */
+#define SPI_CPHA       BIT(0)  /* clock phase (1 = SPI_CLOCK_PHASE_SECOND) */
+#define SPI_CPOL       BIT(1)  /* clock polarity (1 = SPI_POLARITY_HIGH) */
 #define SPI_MODE_0     (0|0)                   /* (original MicroWire) */
 #define SPI_MODE_1     (0|SPI_CPHA)
 #define SPI_MODE_2     (SPI_CPOL|0)
@@ -39,7 +39,6 @@
 
 #define SPI_DEFAULT_WORDLEN    8
 
-#ifdef CONFIG_DM_SPI
 /* TODO(sjg@chromium.org): Remove this and use max_hz from struct spi_slave */
 struct dm_spi_bus {
        uint max_hz;
@@ -65,8 +64,6 @@ struct dm_spi_slave_platdata {
        uint mode;
 };
 
-#endif /* CONFIG_DM_SPI */
-
 /**
  * enum spi_clock_phase - indicates  the clock phase to use for SPI (CPHA)
  *
@@ -131,7 +128,7 @@ enum spi_polarity {
  * @flags:             Indication of SPI flags.
  */
 struct spi_slave {
-#ifdef CONFIG_DM_SPI
+#if CONFIG_IS_ENABLED(DM_SPI)
        struct udevice *dev;    /* struct spi_slave is dev->parentdata */
        uint max_hz;
        uint speed;
@@ -317,7 +314,12 @@ void spi_flash_copy_mmap(void *data, void *offset, size_t len);
  */
 int spi_cs_is_valid(unsigned int bus, unsigned int cs);
 
-#ifndef CONFIG_DM_SPI
+/*
+ * These names are used in several drivers and these declarations will be
+ * removed soon as part of the SPI DM migration. Drop them if driver model is
+ * enabled for SPI.
+ */
+#if !CONFIG_IS_ENABLED(DM_SPI)
 /**
  * Activate a SPI chipselect.
  * This function is provided by the board code when using a driver
@@ -335,6 +337,7 @@ void spi_cs_activate(struct spi_slave *slave);
  * select to the device identified by "slave".
  */
 void spi_cs_deactivate(struct spi_slave *slave);
+#endif
 
 /**
  * Set transfer speed.
@@ -343,7 +346,6 @@ void spi_cs_deactivate(struct spi_slave *slave);
  * @hz:                The transfer speed
  */
 void spi_set_speed(struct spi_slave *slave, uint hz);
-#endif
 
 /**
  * Write 8 bits, then read 8 bits.
@@ -367,8 +369,6 @@ static inline int spi_w8r8(struct spi_slave *slave, unsigned char byte)
        return ret < 0 ? ret : din[1];
 }
 
-#ifdef CONFIG_DM_SPI
-
 /**
  * struct spi_cs_info - Information about a bus chip select
  *
@@ -717,6 +717,5 @@ int dm_spi_get_mmap(struct udevice *dev, ulong *map_basep, uint *map_sizep,
 /* Access the operations for a SPI device */
 #define spi_get_ops(dev)       ((struct dm_spi_ops *)(dev)->driver->ops)
 #define spi_emul_get_ops(dev)  ((struct dm_spi_emul_ops *)(dev)->driver->ops)
-#endif /* CONFIG_DM_SPI */
 
 #endif /* _SPI_H_ */