Add Main/Aon camera switch support for image sensor
and it's submodule. This change detects the AON support
from image sensor hw information from it's respective
device tree support. Also sensor needs to call csiphy
to do the cpas top level operation in order to program
the register for Main/AON mux operation, so add API
export from csiphy hw for sensor domain to perform
the operation.
CRs-Fixed: 2899541
Change-Id: Ibde3ce86c15cfd7e7f445f6461565f78a668b812
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
Apply the flash at EOF and apply the other devices
at the EPOCH of next frame, then the flash can
cover all the exposure zone of current request.
Add the inject delay for SOF and EOF separate,
then we can use inject delay for more flexible
frame skip control.
CRs-Fixed: 2820683
Change-Id: Ic6a58327a0ae44c54190884ba42ea7926ec7c90e
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
While csiphy is shutdown abnormally, we also need to
program off csiphy hw common register, to avoid the
residual of active csiphy hw cnt during monkey test.
CRs-Fixed: 2861912
Change-Id: I1767c729b205a96e5f298265e65b37150dac03b6
Signed-off-by: chengxue <chengxue@codeaurora.org>
Move sensor enums that are used by user mode
to uapi file for a synchronus operation. Currently,
user mode and kernel maintains two separate
copies of the same structure, so making a
change in these structure is error prone, since
there is no synchronization.
CRs-Fixed: 2894834
Change-Id: I3f413d03d7981ed3c886e684b11421cae7a39fca
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
In current implementation, each driver call wait_for_completion_timeout
and readl_poll_timeout with own timeout values.
In case of slow environments like presil, lot of hacks are needed to
change the timeouts for each driver. It needs multiple code changes
and compilations, thus consuming time.
This commit implements a common interface to call
wait_for_completion_timeout and readl_poll_timeout.
Debug variable is also introduced to
change the timeout value. This will help to change the timeout
without compilations and changes at multiple places.
Change-Id: Iba51e0805a49ed325147a12688c2fe6619bb68e6
CRs-Fixed: 2830502
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
Fix the return code in sensor power up
function for failure case.
CRs-Fixed: 2887698
Change-Id: Ib4df3230d83d02fcd239d872a5bcfa2994d519a3
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Update the 3phase bring up sequence for csiphy2.1.0. Also
add support for the irq status dump.
CRs-Fixed: 2835738
Change-Id: Id2e59ebb902f7cdc843cdfaf23c5b717807cf78b
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
Sometimes, the cpu load is very high, then the devcies
stream on will be delayed, but the CRM watchdog is already
enabled before streaming on, then we will have a chance to
notify SOF freeze issue.
This change pauses the CRM watchdog timer before streaming
on sensor and after stopping ife, when we can detect the
stream on and stream off delay, but don't notify error,
also can detect the real SOF freeze issue.
CRs-Fixed: 2804587
Change-Id: Iccaee837930ea22290b109eff45b05300d844312
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
Update the 2Phase bring up sequence to accomodate different
platforms.
CRs-Fixed: 2835738
Change-Id: I3a58876590f8f6e0ea3d8b651723498494bdf50d
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
Add sensor name in the sensor drivers for better debugging.
CRs-Fixed: 2856300
Change-Id: I97995e2b731dcf05b5cf85d7b023be77d8a21327
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Interrupt context is printing info logs by default which needs
to be print as dbg log. Correcting logging level to achieve this.
CRs-Fixed: 2835738
Change-Id: Ia21a7a4f62c973b173274b363c9a971370d20c36
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
Increase the max supported slot ids to 16 in sensor.
CRs-Fixed: 2871214
Change-Id: I08910f2c34f70333bf25dbb31de5994c3beb7a8f
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Currently for CPHY sensor driver expectes data rate specific
configuration. It can be possible that CPHY driver has the same
configuration among differnt data rates. This change accept this
possibility and return success in case of data specific configutaion
is not found.
CRs-Fixed: 2872304
Change-Id: I358d7f4d82028794ab233311bb1d256f1f0cac5e
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
Update the csiphy2.1.0 programming sequence for the update
on 01/13/2021 in revision 6.
CRs-Fixed: 2856350
Change-Id: Ib1d9f8ea48bdcb333773bb0fbc3a2c14b10105af
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Add debugfs support for csiphy and create a new debugfs
for enable/disable csiphy irqs. Following command can be
used to enable the csiphy0 irqs:
adb shell "echo 0x1 >>
/sys/kernel/debug/camera_csiphy/csiphy0_en_irq_dump".
CRs-Fixed: 2829969
Change-Id: I769c84f0cd0bf048652cf2d186d900e470973b0a
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
All csiphy hw common register need to program on first streamon
from any of csiphy hw in order to reduce the noise interferance
for other csiphy hw.
CRs-Fixed: 2839793
Change-Id: I256307b8b909da4a940be25a3aab60e8a301b6f8
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
Add support for the new version a sensor probe
structure to hold the sensor name information
along with the existing informations.
CRs-Fixed: 2856300
Change-Id: Ib195455fbfe02b8d4035105bc6958d11c2a0faf6
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Currently for i2c burst write half the depth of the queue
is utilized which can cause delay in the overall operation
when data size is large that needs to be operated.
Also currently execute command is being programmed after
every 4 bytes/1 word. CCI hw can execute 12 bytes/3 words
together, so align the execute word with 12bytes/3 words
to reduce the processing for CCI hw and better performance.
CRs-Fixed: 2856297
Change-Id: I77e3ae8f6454037a7a100ae6b911ac37e19aa8b7
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
Kernel 5.10 and up have renamed kzfree to kfree_secure. As such,
we have added a cam_free_clear function to redirect all uses of kzfree
uses to the appropriate function depending on the kernel version the
driver is built against.
CRs-Fixed: 2835738
Change-Id: I72d191c9fb0454a4dbb1392894a909e81fe07caa
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
If statement was incorrectly indented one level too deep.
This causes clang warning to be triggered during compilation.
CRs-Fixed: 2835738
Change-Id: I242b68b134eb5665a5b189d2cc430ecc385f0df3
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
To support external module compilation on Waipio, camera dt-bindings header
files need to be moved out of kernel SI and into the camera-kernel vendor SI.
This is to maintain seperation between the two SI's.
CRs-Fixed: 2835738
Change-Id: I8d63b48b6d406ed7b4a07f3bd4f1721ecd2dd0b0
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
Update the csiphy2.1.0 programming sequence for the update
on 11/19/2020.
CRs-Fixed: 2833124
Change-Id: Ie5c00423bc9dea42996108eeb6722ec975ca065f
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
When multiple frequency slaves running on a same I2C bus,
then there is a chance of overriding I2C bus frequency
even if another I2C operation is running. This could lead
to CCI timeout at driver level. Updated synchronization logic,
to properly update I2C clock frequency, only when no other
I2C operation running.
CRs-Fixed: 2815310
Change-Id: Ia341d7cda118497bf1acea8ea59f7f03124f31c3
Signed-off-by: Anil Kumar Kanakanti <akanakan@codeaurora.org>
When camera module shut down happens reset the
last flush request ID for the new session to
continue as fresh start.
CRs-Fixed: 2822543
Change-Id: Ic5b43d7acaeb7e7b6999c02cbb4654598469638b
Signed-off-by: Sureshnaidu Laveti <lsuresh@codeaurora.org>
- Disable skew calibration by default for CSIPHY.
- When last bits of data are 0, Sensor flips data to static 1 in HS-Trail.
This creates a false calibration header in HS-Trail period depending on
last bits of data.
CRs-Fixed: 2777521
Change-Id: I285f74652cc3c8b74e280e7edfb92eb4661d2692
Signed-off-by: shiwgupt <shiwgupt@codeaurora.org>