media: camss: Use optimal clock frequency rates
authorTodor Tomov <todor.tomov@linaro.org>
Tue, 8 Aug 2017 13:30:17 +0000 (09:30 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sat, 26 Aug 2017 19:31:06 +0000 (15:31 -0400)
commitbbde31047434678f60820c7187ca7b7ed6e1809f
tree53cde1e532dcb02c56d90e8bdc4f101779bd28f8
parent474a53d6454fe3bc3dadabf77dca36896608e6a0
media: camss: Use optimal clock frequency rates

Use standard V4L2 control to get pixel clock rate from a sensor
linked in the media controller pipeline. Then calculate clock
rates on CSIPHY, CSID and VFE to use the lowest possible.

If the currnet pixel clock rate of the sensor cannot be read then
use the highest possible. This case covers also the CSID test
generator usage.

If VFE is already powered on by another pipeline, check that the
current VFE clock rate is high enough for the new pipeline.
If not return busy error code as VFE clock rate cannot be changed
while VFE is running.

Signed-off-by: Todor Tomov <todor.tomov@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/qcom/camss-8x16/camss-csid.c
drivers/media/platform/qcom/camss-8x16/camss-csid.h
drivers/media/platform/qcom/camss-8x16/camss-csiphy.c
drivers/media/platform/qcom/camss-8x16/camss-csiphy.h
drivers/media/platform/qcom/camss-8x16/camss-ispif.c
drivers/media/platform/qcom/camss-8x16/camss-ispif.h
drivers/media/platform/qcom/camss-8x16/camss-vfe.c
drivers/media/platform/qcom/camss-8x16/camss-vfe.h
drivers/media/platform/qcom/camss-8x16/camss.c
drivers/media/platform/qcom/camss-8x16/camss.h