From 9d4d9008303d1b8350c05ab7cd132d9fac3baf26 Mon Sep 17 00:00:00 2001 From: Wang Panzhenzhuan Date: Mon, 2 Sep 2019 16:29:21 +0800 Subject: [PATCH] media: i2c: gc2145/gc0312: fix compile error on kernel-4.19 Change-Id: Ib9c4b6b078289d7ef884a8b0fc4ebe6526bd109f Signed-off-by: Wang Panzhenzhuan Signed-off-by: Hu Kejun --- drivers/media/i2c/Kconfig | 22 ++++++++++++++++++++++ drivers/media/i2c/Makefile | 2 ++ drivers/media/i2c/gc0312.c | 4 ++-- drivers/media/i2c/gc2145.c | 4 ++-- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig index d517a8624bf5..e103f9392be6 100644 --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig @@ -965,6 +965,28 @@ config VIDEO_S5C73M3 This is a V4L2 sensor driver for Samsung S5C73M3 8 Mpixel camera. +config VIDEO_GC0312 + tristate "GalaxyCore GC0312 sensor support" + depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API + depends on MEDIA_CAMERA_SUPPORT + select V4L2_FWNODE + help + Support for the GalaxyCore GC0312 sensor. + + To compile this driver as a module, choose M here: the + module will be called gc0312. + +config VIDEO_GC2145 + tristate "GalaxyCore GC2145 sensor support" + depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API + depends on MEDIA_CAMERA_SUPPORT + select V4L2_FWNODE + help + Support for the GalaxyCore GC2145 sensor. + + To compile this driver as a module, choose M here: the + module will be called gc2145. + comment "Flash devices" config VIDEO_ADP1653 diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile index 13367758a1de..8d1adc0919ff 100644 --- a/drivers/media/i2c/Makefile +++ b/drivers/media/i2c/Makefile @@ -109,5 +109,7 @@ obj-$(CONFIG_VIDEO_OV2659) += ov2659.o obj-$(CONFIG_VIDEO_TC358743) += tc358743.o obj-$(CONFIG_VIDEO_IMX258) += imx258.o obj-$(CONFIG_VIDEO_IMX274) += imx274.o +obj-$(CONFIG_VIDEO_GC0312) += gc0312.o +obj-$(CONFIG_VIDEO_GC2145) += gc2145.o obj-$(CONFIG_SDR_MAX2175) += max2175.o diff --git a/drivers/media/i2c/gc0312.c b/drivers/media/i2c/gc0312.c index 898ec3b3088a..ee266fc53a60 100644 --- a/drivers/media/i2c/gc0312.c +++ b/drivers/media/i2c/gc0312.c @@ -1034,8 +1034,8 @@ static int gc0312_probe(struct i2c_client *client, #if defined(CONFIG_MEDIA_CONTROLLER) gc0312->pad.flags = MEDIA_PAD_FL_SOURCE; - sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR; - ret = media_entity_init(&sd->entity, 1, &gc0312->pad, 0); + sd->entity.function = MEDIA_ENT_F_CAM_SENSOR; + ret = media_entity_pads_init(&sd->entity, 1, &gc0312->pad); if (ret < 0) { v4l2_ctrl_handler_free(&gc0312->ctrls); return ret; diff --git a/drivers/media/i2c/gc2145.c b/drivers/media/i2c/gc2145.c index 4948fcbe9292..cf3e0c726ac7 100644 --- a/drivers/media/i2c/gc2145.c +++ b/drivers/media/i2c/gc2145.c @@ -2480,8 +2480,8 @@ static int gc2145_probe(struct i2c_client *client, #if defined(CONFIG_MEDIA_CONTROLLER) gc2145->pad.flags = MEDIA_PAD_FL_SOURCE; - sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR; - ret = media_entity_init(&sd->entity, 1, &gc2145->pad, 0); + sd->entity.function = MEDIA_ENT_F_CAM_SENSOR; + ret = media_entity_pads_init(&sd->entity, 1, &gc2145->pad); if (ret < 0) { v4l2_ctrl_handler_free(&gc2145->ctrls); return ret;