summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/kernel_ver.h
diff options
context:
space:
mode:
authorRui Miguel Silva <rui.silva@linaro.org>2016-02-02 14:23:16 +0000
committerGreg Kroah-Hartman <gregkh@google.com>2016-02-05 16:50:20 -0800
commit0273038df61349868d368dd9254eb629425a3378 (patch)
treebe087359de04e60161becd5b176b3b3b7fb5c26e /drivers/staging/greybus/kernel_ver.h
parent9d4bb6c9183f1283158bbb00ebf65ec4cf18ee33 (diff)
greybus: spi: add device_type field to device config
Add device_type field in device config operation to get the type of device and try to expose less the kernel internal over greybus. This include the spidev, spi-nor will fetch the correct nor id over jede and a modalias that will have the previous behavior (name will set the driver to be loaded). As at it, fix a trivial error path and return immediately. Tested: using gbsim and confirming that a spidev and mtd device were created. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/kernel_ver.h')
-rw-r--r--drivers/staging/greybus/kernel_ver.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/staging/greybus/kernel_ver.h b/drivers/staging/greybus/kernel_ver.h
index 1f8d6a1bb6da..18bf8dff0f86 100644
--- a/drivers/staging/greybus/kernel_ver.h
+++ b/drivers/staging/greybus/kernel_ver.h
@@ -305,4 +305,12 @@ static inline bool led_sysfs_is_disabled(struct led_classdev *led_cdev)
#define PSY_HAVE_PUT
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+#define SPI_DEV_MODALIAS "spidev"
+#define SPI_NOR_MODALIAS "spi-nor"
+#else
+#define SPI_DEV_MODALIAS "spidev"
+#define SPI_NOR_MODALIAS "m25p80"
+#endif
+
#endif /* __GREYBUS_KERNEL_VER_H */