linux-stable/drivers/media/platform/atmel
Eugen Hristev d7f26849ed media: atmel: fix the ispck initialization
The runtime enabling of the ISPCK (internally clocks the pipeline inside
the ISC) has to be done after the pm_runtime for the ISC dev has been
started.

After the commit by Mauro:
the ISC failed to probe with the error:

atmel-sama5d2-isc f0008000.isc: failed to enable ispck: -13
atmel-sama5d2-isc: probe of f0008000.isc failed with error -13

This is because the enabling of the ispck is done too early in the probe,
and the PM runtime returns invalid request.
Thus, moved this clock enabling after pm_runtime_idle is called.

The ISPCK is required only for sama5d2 type of ISC.
Thus, add a bool inside the isc struct that is platform dependent.
For the sama7g5-isc, the enabling of the ISPCK is wrong and does not make
sense. Removed it from the sama7g5 probe. In sama7g5-isc, there is only
one clock, the MCK, which also clocks the internal pipeline of the ISC.

Adapted the clk_prepare and clk_unprepare to request the runtime PM
for both clocks (MCK and ISPCK) in case of sama5d2-isc, and the single
clock (MCK) in case of sama7g5-isc.

Fixes: dd97908ee3 ("media: atmel: properly get pm_runtime")
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-09-30 10:08:00 +02:00
..
atmel-isc-base.c media: atmel: fix the ispck initialization 2021-09-30 10:08:00 +02:00
atmel-isc-regs.h media: atmel: atmel-isc: add microchip-xisc driver 2021-06-08 15:46:31 +02:00
atmel-isc.h media: atmel: fix the ispck initialization 2021-09-30 10:08:00 +02:00
atmel-isi.c media: v4l: async: Rename async nf functions, clean up long lines 2021-09-30 10:07:35 +02:00
atmel-isi.h media: atmel: atmel-isi: add support for mono sensors, GRAY and Y16 2019-12-16 10:16:56 +01:00
atmel-sama5d2-isc.c media: atmel: fix the ispck initialization 2021-09-30 10:08:00 +02:00
atmel-sama7g5-isc.c media: atmel: fix the ispck initialization 2021-09-30 10:08:00 +02:00
Kconfig media: atmel: fix build when ISC=m and XISC=y 2021-07-30 13:01:52 +02:00
Makefile media: atmel: fix build when ISC=m and XISC=y 2021-07-30 13:01:52 +02:00