summaryrefslogtreecommitdiff
path: root/include/media/v4l2-common.h
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel@collabora.com>2019-08-15 13:48:02 -0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-08-26 10:49:12 -0300
commit7c795df5f344482c2ab8c52ebc1d94302d2b9082 (patch)
tree64c52564f84b8a4e964bd780d1f03c89bd11a626 /include/media/v4l2-common.h
parentff35213fda9e2c6ba38979229b42d49dafc6e7d9 (diff)
media: v4l2-core: move spi helpers out of v4l2-common.c
Separate the spi helpers to v4l2-spi.c, in order to get rid of the ifdefery. No functional changes intended, this is just a cosmetic change to organize the code better. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'include/media/v4l2-common.h')
-rw-r--r--include/media/v4l2-common.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 6b319d0d73ad..a1c5288caa6a 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -216,11 +216,10 @@ const unsigned short *v4l2_i2c_tuner_addrs(enum v4l2_i2c_tuner_type type);
/* ------------------------------------------------------------------------- */
/* SPI Helper functions */
-#if defined(CONFIG_SPI)
#include <linux/spi/spi.h>
-struct spi_device;
+#if defined(CONFIG_SPI)
/**
* v4l2_spi_new_subdev - Load an spi module and return an initialized
@@ -246,6 +245,21 @@ struct v4l2_subdev *v4l2_spi_new_subdev(struct v4l2_device *v4l2_dev,
*/
void v4l2_spi_subdev_init(struct v4l2_subdev *sd, struct spi_device *spi,
const struct v4l2_subdev_ops *ops);
+
+#else
+
+static inline struct v4l2_subdev *
+v4l2_spi_new_subdev(struct v4l2_device *v4l2_dev,
+ struct spi_master *master, struct spi_board_info *info)
+{
+ return NULL;
+}
+
+static inline void
+v4l2_spi_subdev_init(struct v4l2_subdev *sd, struct spi_device *spi,
+ const struct v4l2_subdev_ops *ops)
+{}
+
#endif
/* ------------------------------------------------------------------------- */