Commit Graph

87 Commits

Author SHA1 Message Date
Vishal Verma
1435a8a68b msm: camera: sensor: Dump phy registers on error
Dump csiphy registers on following fatal errors:
1. lane overflow error
2. unbounded frame error
3. SOT ans EOT reception error
4. stream underflow error
These errors irqs are set at csid end, Currently there is no
interface to send message from one subdevice to other if the subdev is
not a real time device. This change adds an interface to notify the
no real time subdev.

CRs-Fixed: 2696744
Change-Id: I522167d1639ac298bc739a8a5a380a01356f0776
Signed-off-by: Vishal Verma <vishverm@codeaurora.org>
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
2020-06-12 12:24:12 -07:00
Jigarkumar Zala
279dfebf8c msm: camera: common: Fixes the exit module code flow
Fixes exit call flow as a part of rmmod.

CRs-Fixed: 2675526
Change-Id: I47111a737cb06d9bb3d0a417a471c5c9fb545999
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-06-09 12:08:22 -07:00
Camera Software Integration
f480c039c7 Merge "msm: camera: common: Merge camera-kernel.3.1 changes in camera-kernel.4.0" into camera-kernel.lnx.4.0 2020-06-04 15:22:48 -07:00
Camera Software Integration
c4d16b525c Merge "msm: camera: cci: Correct logging for better debug" into camera-kernel.lnx.4.0 2020-06-03 12:39:24 -07:00
Trishansh Bhardwaj
172d34b6f7 msm: camera: common: Merge camera-kernel.3.1 changes in camera-kernel.4.0
msm: camera: tfe: Fix variable initialization issues
msm: camera: isp: Dual tfe event check with proper hw idx
msm: camera: smmu: Add support for non-contiguous mermory region
msm: camera: smmu: Use iommu best match algo for camera
msm: camera: ope: Optimize allocation of IO configuration
msm: camera: ope: Fix for KW Issues
msm: camera: ope: Add support for stripe level height configuration
msm: camera: tfe: Enable the delay line clc
msm: camera: ope: Fix false alarm for OPE HW timeout
msm: camera: tfe: Support register dump per request
msm: camera: ope: Increase max number of stripes
msm: camera: ope: Change packer and unpacker format in case NV12
msm: camera: tfe: Add packet code get command for tfe
msm: camera: ope: Trigger recovery in case of violation on write bus
msm: camera: ope: Protect ope hw reset with mutex
msm: camera: ope: Add a check for valid request in cdm callback
msm: camera: ope: Remove the BW & clock vote in release context
msm: camera: ope: Reduce OPE BUS memory
msm: camera: ope: Fix return value for ope acquire
msm: camera: ope: Fix false alarm for OPE request timeout
msm: camera: ope: Avoid deadlock during recovery after HW hang
msm: camera: tfe: tfe debug enhancement
msm: camera: cdm: Fix irq_data value in case of inline irq
msm: camera: flash: Switch off flash on provider crash
msm: camera: ope: Initialize ope hw mutex structure
msm: camera: cdm: Flush all available FIFOs during reset
msm: camera: cpas: Add mandatory bw option for axi ports clocks
msm: camera: ope: Use vzalloc to allocate the write bus ctx structure
msm: camera: ope: Fix handling of init hw failure
msm: camera: tfe: Enable per frame register dump for rdi only context
msm: camera: cdm: Protect cdm core status bits with mutex
msm: camera: cdm: correct the error check in cmd submit irq
msm: camera: ope: Fix unclock access during HW reset
msm: camera: ope: Program frame level settings after idle event
msm: camera: ope: Delay releasing of resources for last context
msm: camera: isp: Increase default SOF freeze timeout
msm: camera: smmu: Add map and unmap monitor
msm: camera: isp: Add trace events across ISP
msm: camera: smmu: Profile time taken for map, unmap
msm: camera: ope: Start context timer on receiving new request
msm: camera: tfe: Reduce stack size during set axi bw
msm: camera: cdm: Check for HW state before dumping registers
msm: camera: ope: Reduce stack footprint during acquire
msm: camera: tfe: Disable clock if tfe2 is not supported
msm: camera: cdm: Avoid cdm pause incase of BL submit
msm: camera: tfe: Optimize CSID IRQ logging
msm: camera: ope: Move request id validity check outside of lock
msm: camera: tfe: Correct the tfe hw manager dump logic
msm: camera: ope: Synchronize flush and submit BLs
msm: camera: cdm: Protect cdm reset status
msm: camera: cdm: Handle cdm deinit sequence properly
msm: camera: tfe: Reduce reset timeout to 100ms
msm: camera: ope: Fix hang detection
msm: camera: ope: Make non-fatal logs as debug and info logs
msm: camera: tfe: set overflow pending bit to zero after HW reset
msm: camera: ope: Do not disable CDM during error handling
msm: camera: ope: Add support for OPE Replay
msm: camera: ope: Stop OPE in case of init failure
msm: camera: ope: Synchronize process cmd and flush request
msm: camera: cdm: Fix CDM IRQ handling
msm: camera: tfe: LDAR dump for TFE
msm: camera: ope: Fix the length check for debug buffer
msm: camera: cdm: Fix CDM reset logic
msm: camera: ope: Dump debug registers in case of HW hang
msm: camera: tfe: Support the RDI bus port for line based mode
msm: camera: cdm: Handle out of order reset done events
msm: camera: ope: Consider other contexts during timeout
msm: camera: ope: Put GenIRQ in last stripe BL
msm: camera: tfe: Process the rdi interrupts for rdi only resource
msm: camera: jpeg: Check the HW state before accessing register
msm: camera: csiphy: Update csiphy power-up sequence for lito v2
msm: camera: cdm: Secure freeing of request lists using locks
msm: camera: cpas: Add support for Scuba camnoc
msm: camera: csiphy: Clear secure phy flags on release
msm: camera: tfe: validate the tfe bw num paths
msm: camera: ope: Reorder the reset order in ope acquire
msm: camera: ope: Dump debug registers in case of reset failure
msm: camera: ope: Add logic to detect hang in CDM
msm: camera: isp: Increase max count of cfg to support more init packets
msm: camera: core: Fix cpas axi clk rate overflow.

CRs-Fixed: 2668666
Change-Id: I882ca4bd117bebc7d1c62bc82299d69d7b5c9388
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
2020-06-03 11:48:47 +05:30
Jigar Agrawal
cb7abacaf6 msm: camera: cci: Correct logging for better debug
Correct and Update logs for better debugging purpose.

CRs-Fixed: 2686717
Change-Id: I2f7720e32aaf44764e6341813bb35c1717125a67
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-05-29 11:38:09 -07:00
Jigarkumar Zala
a4f5f1e512 msm: camera: flash: Add flash off operation in shutdown
There is high chances, when camera server crash flash may not have
flash off request scheduled with CRM. In case of torch on, followed
by shutdown sequence, if flash off request is not scheduled, flash
remains turned on. This change adds flash off operation, in case
of shutdown.

CRs-Fixed: 2691916
Change-Id: I472f2b204b93d0cdc3d8a1f14fff29ab479e4588
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-05-28 16:47:41 -07:00
Jigarkumar Zala
a1f635192b msm: camera: cci: Correct the check and return code
Update the master status data type, as it expects the negative value
and do the operation accordingly. Also, correct the return code and
update the validation check.

CRs-Fixed: 2686717
Change-Id: I8ecae74de2995a08e532a7f0ef078d48d45a928e
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-05-21 13:35:04 -07:00
Camera Software Integration
beb3ea37bb Merge "msm: camera: common: Remove extra CAM_INFO logs" into camera-kernel.lnx.4.0 2020-05-07 20:31:15 -07:00
Camera Software Integration
15f0a07e50 Merge "msm: camera: sync: Fix kbuild config checks for synx driver" into camera-kernel.lnx.4.0 2020-05-07 20:30:46 -07:00
Anil Kumar Kanakanti
538accf58e msm: camera: sensor: Turn off the flash while flushing
Turn off the flash while flushing if the flushed request is
flash off and removed flush request ID validation in flush_all
scenario.

CRs-Fixed: 2667472
Change-Id: Iaf123f2f56117d7b7d1ef6d2291b0cde8c232d44
Signed-off-by: Anil Kumar Kanakanti <akanakan@codeaurora.org>
2020-05-04 09:56:10 -07:00
Camera Software Integration
4cccdd446e Merge "msm: camera: csiphy: Fixed CSID overflow errors" into camera-kernel.lnx.4.0 2020-05-01 16:47:13 -07:00
Karthik Jayakumar
655736ee0b msm: camera: common: Remove extra CAM_INFO logs
Changes extraneous CAM_INFO logs into CAM_DBG logs in order to help
de-clutter serial boot logs.

CRs-Fixed: 2669269
Change-Id: I7589bd64363aa122c46e1193c68bbf49d78a4a9a
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2020-04-30 09:37:40 -07:00
ANIL KUMAR KANAKANTI
a5c3abfd09 msm: camera: csiphy: Fixed CSID overflow errors
Fix: Updated PHY settings as per latest PHY HPG to
avoid possible CSID overflow errors.

CRs-Fixed: 2567045
Change-Id: I7a508cb8ef31b642b2afbeb1adb1508b1d8ee205
Signed-off-by: ANIL KUMAR KANAKANTI <akanakan@codeaurora.org>
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-04-30 10:30:10 +05:30
Jigarkumar Zala
49dfccf260 msm: camera: csiphy: Remove unnecessary delay from reset sequence
Lane enable register reset is not required any delay to reflect the
change. This change removes the unnecesaary delay from lane_enable
register. Also, adding 1us of delay between back to back write in
SW reset register along with condition based refelction of delay.

CRs-Fixed: 2671221
Change-Id: I010570045a97fc1489a84d22ebd39df6f6f14f0a
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-04-28 13:22:16 -07:00
Jigarkumar Zala
43e3ea9bf3 msm: camera: csiphy: Update bringUp sequence
Update 2phase and 3phase bring up sequence for different
data rate to reflect latest hpg change.

CRs-Fixed: 2671221
Change-Id: Idd7445a523486a5fb4ec5d43bcf8987c54c089b0
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-04-28 13:20:03 -07:00
Karthik Jayakumar
28be26b740 msm: camera: sync: Fix kbuild config checks for synx driver
External configs should be checked by using IS_REACHABLE/IS_ENABLED
macro's to check if the config option is set for the build target.

CRs-Fixed: 2584631
Change-Id: I07a0d95391a83a2264f826e2935d67686d295317
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2020-04-22 10:43:31 -07:00
Anil Kumar Kanakanti
eb919ee4dc msm: camera: csiphy: Secure cam usecase not working
Secure CP control register always assume that it contains 7 bit
mask for each PHY. But this register format is different based on
target. Update secure CP control bitmask generation logic for each
PHY index based on phy_version.
So we have below 3 combinations to handle at SW.
1.Old Titan Targets : 7 bits for each PHY.
2.PHY 1_2_1 : for 4 pHYS 7 bits and for
remaining 2 PHYs 8 bits are reserved.
3.Mimas (PHY 2_0_1): 8 bits for each PHY.

CRs-Fixed: 2624698
Change-Id: Iac4c3c718fc96a51592e07b45458fb045c52366d
Signed-off-by: Anil Kumar Kanakanti <akanakan@codeaurora.org>
2020-04-12 22:24:38 -07:00
Jigarkumar Zala
438fc6a877 msm: camera: common: Enabling EOF support for flash
New usecase for flash driver requires to be trigger at EOF.
This change adds the new operation code support in flash
driver along with EOF enable support in crm and across
other drivers. Also to improve the performance, this change
adds the logic to dynamically update the subscribe event to
CRM, so that CRM can enqueue EOF events when Flash or any other
device add the request for EOF.

CRs-Fixed: 2633194
Change-Id: I2f68ac7fc6a4699debd39b64319728cdf17bbcfa
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-03-20 11:02:03 -07:00
Camera Software Integration
57345c972a Merge "msm: camera: cci: Add hardware index in dumps" into camera-kernel.lnx.4.0 2020-03-19 15:30:51 -07:00
Camera Software Integration
64c7aa1d84 Merge "msm: camera: eeprom: Correct EEPROM Read return" into camera-kernel.lnx.4.0 2020-03-16 16:38:39 -07:00
Shankar Ravi
624a05a102 msm: camera: eeprom: Correct EEPROM Read return
EEPROM Read using QUP I2C returns the number of bytes
read from the EEPROM, While CCI/SPI returns zero value.
Return Error only when if the value is less than zero.

CRs-Fixed: 2617882
External Impact: No
Change-Id: I9a9674366c10de4efce779f75dd36b293838c47b
Signed-off-by: Shankar Ravi <rshankar@codeaurora.org>
2020-03-12 11:10:15 -07:00
Depeng Shao
d500bda747 msm: camera: sensor: Turn off the flash while flushing
Turn off the flash while flushing if the flushed request
turns off the flash.

CRs-Fixed: 2576732
Change-Id: I546fc6b6ee79f492af905d163515eb19eed78f41
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2020-03-12 11:07:59 -07:00
Haritha Chintalapati
3d02c7f405 Merge "msm: camera: sensor: Update maximum supported camera id" into camera-kernel.lnx.4.0 2020-03-03 14:20:43 -08:00
Haritha Chintalapati
bcc4402eed Merge "msm: camera: sensor: Update I2C read/write size" into camera-kernel.lnx.4.0 2020-03-03 14:20:31 -08:00
Camera Software Integration
695e073072 Merge "msm: camera: common: Fix failures in v4l2 unregister during error" into camera-kernel.lnx.4.0 2020-03-02 15:05:39 -08:00
Karthik Jayakumar
a6a80b5c2b msm: camera: sensor: Update I2C read/write size
Update I2C read and write capability to 10kb.

CRs-Fixed: 2584631
Change-Id: Iffffb18ad79a5492df2ca0aa0f1411ae67cb92cc
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2020-02-28 17:06:52 -08:00
Mukund Madhusudan Atre
0a649b3063 msm: camera: common: Fix failures in v4l2 unregister during error
Missing video unregister was causing list delete corruption.
Also, there were double free errors in Sync and CRM driver. Fix
v4l2 issues by adding the missing unregister calls and changing
release callback to empty, because we are freeing it during
cleanup. Improve logging during bind/unbind to better reflect what
is happening.

CRs-Fixed: 2584631
Change-Id: Idc5db655d22df54e8bdb470d29896e10f6987796
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2020-02-28 16:02:56 -08:00
Karthik Jayakumar
3ba88cc32f msm: camera: sensor: Update maximum supported camera id
Updates maximum number of supported camera id to 9

CRs-Fixed: 2584631
Change-Id: I00a595d784b38030a7996a8da930ecdeaf05835c
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2020-02-28 16:00:52 -08:00
Venkat Chinta
fce521db94 msm: camera: cci: Add hardware index in dumps
This change adds hardware index to register dump.

CRs-Fixed: 2632034
Change-Id: Ibdd96d4f9f7a99c71118950fc0ee0b8aec9a7340
Signed-off-by: Venkat Chinta <vchinta@codeaurora.org>
2020-02-28 11:28:11 -08:00
Mukund Madhusudan Atre
ac6f8eeb6d msm: camera: flash: Add qti flash support in camera
Add support for qti flash along with updated max current DT
property. Remove support for enable/disable regulator as it
is no-op since a long time.

CRs-Fixed: 2584631
Change-Id: I3305e7b6e4d6ef34d90d38f5f25cfa5b8b817f8b
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2020-02-27 14:17:13 -08:00
Mukund Madhusudan Atre
4e5ffd3ce0 msm: camera: cci: Add device managed alloc to balance free in remove
The devm_kfree call in remove is unbalanced without a devm_kzalloc.
Add required kzalloc and free during probe to balance it.

CRs-Fixed: 2584631
Change-Id: I14164405e62036f7918b858d978afe454e4feb4a
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2020-02-16 23:16:11 -08:00
Tony Lijo Jose
37b7384396 msm: camera: csiphy: Update phy sequence for bengal
Toggle reset register  in common and reset programming sequence.

CRs-Fixed: 2615460
Change-Id: Iba17fa3b2014be0bc27236169cf8456a7f8ededd
Signed-off-by: Tony Lijo Jose <tjose@codeaurora.org>
2020-02-12 12:24:00 -08:00
Camera Software Integration
fe0a027a67 Merge "msm: camera: csiphy: Add combo phy settings for csiphy v1.2.2.2" into camera-kernel.lnx.4.0 2020-02-11 13:37:16 -08:00
Camera Software Integration
ba20c111ed Merge "msm: camera: common: Add component helper support in camera" into camera-kernel.lnx.4.0 2020-02-07 15:13:17 -08:00
Mukund Madhusudan Atre
5cb000ee7f msm: camera: common: Add component helper support in camera
Due to the asynchronous nature of platform probes, inter
dependency between drivers needs to be taken care during
kernel boot up. Component helper provides the facility of
adding matching drivers in a list ordered in the way we want
to bind those drivers. The CRM driver acts as component master
to make sure all slave drivers are bound before it returns
from its own bind call. Add support for serializing platform
probes through component framework.

CRs-Fixed: 2584631
Change-Id: I345da1d2b9cccf6021ac6fc899143013b7714ec4
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
2020-02-05 22:58:13 -08:00
Jigarkumar Zala
fdb9ade9a8 msm: camera: sensor: Notify completion in error case
There is no need to wait till timeout in case of NACK or
underflow error irq is raised, so notify thread for rd_done
completion. Also, correct the error mask to catch the NACK
error for Master 1.

CRs-Fixed: 2598605
Change-Id: Ib8a16ee119dd81f1384283ac7e9f82d3ac2588bb
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2020-02-05 14:06:00 -08:00
Shravan Nevatia
b68a69b788 msm: camera: csiphy: Add combo phy settings for csiphy v1.2.2.2
As per HPG revision L, there's a difference in the DPHY combo-mode
sequence settings between lito v1 and v2. This change adds a
separate sequence for lito v2, csiphy version 1.2.2.2.

CRs-Fixed: 2591712
Change-Id: Ic535bd2c98f47c33aa689d0e1bfe07d7dac8d9a2
Signed-off-by: Shravan Nevatia <snevatia@codeaurora.org>
2020-02-05 10:50:30 -08:00
Camera Software Integration
d8b3b0fb80 Merge "msm: camera: sensor: Add Init setting retry in case cci is resetting" into camera-kernel.lnx.4.0 2020-02-04 15:18:05 -08:00
Camera Software Integration
139893ac96 Merge "msm: camera: sensor: Fix an operator error" into camera-kernel.lnx.4.0 2020-02-04 15:09:59 -08:00
Camera Software Integration
56a3afaca6 Merge "msm: camera: csiphy: Update common sequence for csiphy v1.2" into camera-kernel.lnx.4.0 2020-02-03 14:08:33 -08:00
Jigarkumar Zala
043c37f2b4 msm: camera: sensor: Add Init setting retry in case cci is resetting
If any subdev is reporting Nack, cci hardware gets into resetting.
During resetting if sensor tries to apply Init setting, it fails.
This change adds retry for INIT setting to reapply after sometime.

CRs-Fixed: 2598605
Change-Id: Iff13014d74abe6aebaec6cd428811de9d865f090
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-01-30 13:43:23 -08:00
Depeng Shao
9303d3ae02 msm: camera: sensor: Fix an operator error
- Fix an operator error in cam_sensor_flush_request

CRs-Fixed: 2591694
Change-Id: I39a8b29f83db55d2a930dd5ccd2b765517e2c1d6
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
2020-01-30 13:32:10 -08:00
Shravan Nevatia
9fdce6ca87 msm: camera: sensor: Add null check for read buffer
Add proper null checks for function arguments,
including read buffer, before dereferencing them.

CRs-Fixed: 2581538
Change-Id: I8c49bbc419e2ac5579341c7dc789da0ed1c4d123
Signed-off-by: Shravan Nevatia <snevatia@codeaurora.org>
2020-01-30 04:57:29 -08:00
Shravan Nevatia
bf16c8a8e5 msm: camera: csiphy: Update common sequence for csiphy v1.2
Add a high-to-low transition in the CTRL0 register
during the common power-up sequence.

CRs-Fixed: 2580437
Change-Id: I66541d3d787fa2f161e5d8e647fb11c8075a1947
Signed-off-by: Shravan Nevatia <snevatia@codeaurora.org>
2020-01-30 03:32:39 -08:00
Tony Lijo Jose
832ac63b18 msm: camera: cci: Correct the queue size for cci version 1.2
Correct the queue size for cci version 1.2 as below,

1. Queue 0 size = 64.
2. Queue 1 size = 16.

CRs-Fixed: 2594541
Change-Id: Ifc9407427fe2bf0996c77dc00c5dfe7e5ba22140
Signed-off-by: Tony Lijo Jose <tjose@codeaurora.org>
2020-01-16 17:45:47 +05:30
Camera Software Integration
c78ecfbf11 Merge "msm: camera: sensor: Add support fo multiple regulator sources" into camera-kernel.lnx.4.0 2020-01-13 20:37:42 -08:00
Jigarkumar Zala
737f25e611 msm: camera: sensor: Add CPHY and DPHY bringup sequence
Add 3phase and 2phase_mission/combo mode sequence for
lahaina target.

CRs-Fixed: 2584631
Change-Id: Id2e207e46544e3f7d361803814eec725d28c3702
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-01-09 16:21:59 -08:00
Jigarkumar Zala
b8d55f649d msm: camera: sensor: Add support fo multiple regulator sources
Currently image sensor need single source of the regulator per
category. Some sensor needs extra analog voltage for the functionality,
which require to draw power from multiple voltage regulator sources.
This change extends supports to add multiple voltage sources for
analog voltage.

CRs-Fixed: 2584631
Change-Id: I2d76cfb0fb971758c0d596ffd543aa3926a8886d
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2020-01-08 09:38:48 -08:00
Elliot Berman
10891f6916 msm: camera: utils: Migrate SCM calls
Migrate secure world calls to qcom scm driver.

CRs-Fixed: 2564857
Change-Id: I8eb7498e4f80ff7ac1e22b7dcd364048e5338746
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
2019-12-04 19:53:56 -08:00