diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-05-19 10:35:38 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-05-20 14:51:29 +0200 |
commit | 1d6e5c3040c1a2b561dddc235233ef6b176a97b8 (patch) | |
tree | 0b79c90a886a219996de74e55fe47fef146cbf2a /drivers/staging | |
parent | media: atomisp: keep the ISP powered on when setting it (diff) | |
download | wireguard-linux-1d6e5c3040c1a2b561dddc235233ef6b176a97b8.tar.xz wireguard-linux-1d6e5c3040c1a2b561dddc235233ef6b176a97b8.zip |
media: atomisp: change the code to properly wait for sensor
The sensor should finish its init before atomisp driver, as
otherwise the atomisp driver won't be able to talk with it.
So, we need to turn atomisp_gmin_platform into a module
again, for it to not depend on atomisp driver to finish
probing, and add some delay at atomisp to let the sensor
driver to finish probing.
Yeah, this is hacky. The real solution here would be to use
the async framework, but for now, our goal is to make the
driver to work. So, let's postpone such change to be done
later.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/media/atomisp/Makefile | 2 | ||||
-rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 3 | ||||
-rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 26 |
3 files changed, 20 insertions, 11 deletions
diff --git a/drivers/staging/media/atomisp/Makefile b/drivers/staging/media/atomisp/Makefile index 30b3168c4358..eedecd49bbf4 100644 --- a/drivers/staging/media/atomisp/Makefile +++ b/drivers/staging/media/atomisp/Makefile @@ -3,6 +3,7 @@ # obj-$(CONFIG_INTEL_ATOMISP) += i2c/ obj-$(CONFIG_VIDEO_ATOMISP) += atomisp.o +obj-$(CONFIG_VIDEO_ATOMISP) += pci/atomisp_gmin_platform.o # While on staging, keep debug enabled DEFINES += -DDEBUG @@ -23,7 +24,6 @@ atomisp-objs += \ pci/atomisp_subdev.o \ pci/atomisp_tpg.o \ pci/atomisp_v4l2.o \ - pci/atomisp_gmin_platform.o \ pci/sh_css_firmware.o \ pci/sh_css_host_data.o \ pci/sh_css_hrt.o \ diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c index 9e9dc9a564c5..b096b7d30463 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c @@ -1076,3 +1076,6 @@ static void isp_pm_cap_fixup(struct pci_dev *dev) dev->pm_cap = 0; } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0f38, isp_pm_cap_fixup); + +MODULE_DESCRIPTION("Ancillary routines for binding ACPI devices"); +MODULE_LICENSE("GPL"); diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c index 4395ca0e3e11..592c41bb5166 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c @@ -1083,6 +1083,22 @@ static int atomisp_subdev_probe(struct atomisp_device *isp) return 0; } + /* FIXME: should return -EPROBE_DEFER if not all subdevs were probed */ + for (count = 0; count < SUBDEV_WAIT_TIMEOUT_MAX_COUNT; count++) { + int camera_count = 0; + for (subdevs = pdata->subdevs; subdevs->type; ++subdevs) { + if (subdevs->type == RAW_CAMERA || + subdevs->type == SOC_CAMERA) + camera_count ++; + } + if (camera_count) + break; + msleep(SUBDEV_WAIT_TIMEOUT); + count++; + } + /* Wait more time to give more time for subdev init code to finish */ + msleep(5 * SUBDEV_WAIT_TIMEOUT); + /* FIXME: should, instead, use I2C probe */ for (subdevs = pdata->subdevs; subdevs->type; ++subdevs) { @@ -1192,16 +1208,6 @@ static int atomisp_subdev_probe(struct atomisp_device *isp) } } - /* FIXME: should return -EPROBE_DEFER if not all subdevs were probed */ - for (count = 0; count < SUBDEV_WAIT_TIMEOUT_MAX_COUNT; count++) { - if (isp->input_cnt) - break; - msleep(SUBDEV_WAIT_TIMEOUT); - count++; - } - /* Wait more time to give more time for subdev init code */ - msleep(5 * SUBDEV_WAIT_TIMEOUT); - /* * HACK: Currently VCM belongs to primary sensor only, but correct * approach must be to acquire from platform code which sensor |