[PATCH v1 3/5] spi: Added way to check for pm support for flash devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Device drivers can check if the master controller driver has to support
flash pm. The controller driver indicates this using flash_pm_supported()
spi master interface.

Signed-off-by: Kamal Dasu <kdasu.kdev@xxxxxxxxx>
---
 include/linux/spi/spi.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 75c6bd0..b5fbc1b 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -539,6 +539,7 @@ struct spi_master {
 	int (*spi_flash_read)(struct  spi_device *spi,
 			      struct spi_flash_read_message *msg);
 	bool (*flash_read_supported)(struct spi_device *spi);
+	bool (*flash_pm_supported)(struct spi_device *spi);
 
 	/*
 	 * These hooks are for drivers that use a generic implementation
@@ -1185,6 +1186,13 @@ static inline bool spi_flash_read_supported(struct spi_device *spi)
 	       spi->master->flash_read_supported(spi));
 }
 
+/* SPI core interface to indicate flash pm support */
+static inline bool spi_flash_pm_supported(struct spi_device *spi)
+{
+	return (spi->master->flash_pm_supported &&
+		spi->master->flash_pm_supported(spi));
+}
+
 int spi_flash_read(struct spi_device *spi,
 		   struct spi_flash_read_message *msg);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux