Commit Graph

499 Commits

Author SHA1 Message Date
Shadul Shaikh
fe2796ca01 msm: camera: csiphy: Trigger ISP callback on phy clock change
Trigger callback to ISP each time when there is a change
in phy clock so that csid and tfe clock rate can be
updated accordingly. The argument passed in callback api is
the final phy clock rate that is applied.

CRs-Fixed: 2854066

Change-Id: Ia74465e4082e08b4c50338e0eb779f996afa2795
Signed-off-by: shiwgupt <quic_shiwgupt@quicinc.com>
Signed-off-by: shaduls <quic_shaduls@quicinc.com>
(cherry picked from commit 1fd5054f530a16a5bf90901ba4c8bf2025e136dc)
2024-01-17 04:08:22 -08:00
Camera Software Integration
ef21140fd3 Merge "msm: camera: sensor: Duplicate sensor changes" into camera-kernel.lnx.7.0 2023-12-25 19:44:48 -08:00
Camera Software Integration
d073f8c8d6 Merge "msm: camera: cci: Check if cci_info structure pointer is NULL" into camera-kernel.lnx.7.0 2023-12-19 21:56:47 -08:00
Camera Software Integration
3e9d2a6729 Merge "msm: camera: sensor: Add threaded irq support for cci" into camera-kernel.lnx.7.0 2023-12-18 06:53:09 -08:00
Camera Software Integration
080692e6ef Merge "msm: camera: sensor: Reg settings missed while lookahead on qup" into camera-kernel.lnx.7.0 2023-12-18 06:53:04 -08:00
Shravan Nevatia
e309d6fc30 msm: camera: sensor: Duplicate sensor changes
Add support to skip HW operations (power/CCI) for
sensor nodes with "hw-no-ops" property. These nodes are
dummy entries since CSID reads data from a different sensor.

CRs-Fixed: 3150840
Change-Id: I6ceb3f9d2ea4f16abb9d5d2a6b89d5cb1d95c614
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
(cherry picked from commit 3deec40a9a58296f6f43d3cfe15b092e5a16c28b)
2023-12-14 16:58:54 +05:30
Camera Software Integration
a90b42d899 Merge "msm: camera: sensor: Add Trace logs for CCI BURST WRITE" into camera-kernel.lnx.7.0 2023-12-13 02:01:14 -08:00
chengxue
5aa6302ba5 msm: camera: sensor: Reg settings missed while lookahead on qup
While we lookahead and merge the continuous reg settings to
burst, the packed setting len with uint8 data type may happen
overflow if the continuous reg setting count is larger than 255,
then some reg settings missed and lead to some sensor issues,
so modify the data type of len to avoid it.

CRs-Fixed: 3678429
Change-Id: I51a153d2340b84dd874ecd7bef6b3df1356611b0
Signed-off-by: chengxue <quic_chengxue@quicinc.com>
(cherry picked from commit aadcb5e66d37f556c570621e3b15e834601f074b)
2023-12-13 01:58:42 -08:00
Lokesh Kumar Aakulu
8dc1b0cd65 msm: camera: sensor: Add threaded irq support for cci
When CCI drains its payload cmds in QUEUE because
of CPU scheduling delays from SW Driver side then
next successive transaction will endup in NACK ERROR.
To Fix this issue, Updating payload cmds to CCI QUEUE
is moved to Threaded irq so that Scheduling delays can
be minimized and avoid NACK Error.

CRs-Fixed: 3562709
Change-Id: I577a6531d692a4f202651e2dd5d4cf0684259b75
Signed-off-by: Lokesh Kumar Aakulu <quic_lkumar@quicinc.com>
(cherry picked from commit bcdafbc3c3afcbed75c2c469f26d8c483d0430d1)
2023-12-13 01:58:01 -08:00
Camera Software Integration
7cdb3df0f5 Merge "msm: camera: sensor: Add CCI BURST WRITE Support" into camera-kernel.lnx.7.0 2023-12-11 09:08:15 -08:00
Camera Software Integration
192fbd4d41 Merge "msm: camera: csiphy: Update PHY secure CP register for Crow" into camera-kernel.lnx.7.0 2023-12-11 09:07:44 -08:00
Camera Software Integration
85469b7344 Merge "msm: camera: csiphy: Update PHY secure CP register" into camera-kernel.lnx.7.0 2023-12-11 09:07:28 -08:00
Lokesh Kumar Aakulu
8bc2eafe25 msm: camera: sensor: Add Trace logs for CCI BURST WRITE
Add Trace logs for each threshold irq and corresponding
Error cases for BURST WRITE usecases.

CRs-Fixed: 3562709
Change-Id: I9e91fc0b9ae0eda20063c8150c8c4694b583355f
Signed-off-by: Lokesh Kumar Aakulu <quic_lkumar@quicinc.com>
(cherry picked from commit 9326d397a2ec90696ce37a5d5966cdc671d657e3)
2023-12-10 06:19:49 -08:00
Lokesh Kumar Aakulu
3efecb742f msm: camera: sensor: Add CCI BURST WRITE Support
Introduce Threshold IRQ and compose dynamically
allocated buffer with CCI BURST WRITE Commands
and finally write to the CCI HW register and
manage Threshold Interrupts in optimized way. So,
that SW Driver latencies will not affect the I2C
BURST WRITE functionality.

CRs-Fixed: 3562709
Change-Id: I5749ba3b61e28d8f2c1075f46f470f5a9c5bd6b5
Signed-off-by: Lokesh Kumar Aakulu <quic_lkumar@quicinc.com>
(cherry picked from commit 1e4f481db9076c766b7300bb65364a13a61247c1)
2023-12-06 08:10:04 -08:00
Shadul Shaikh
24376453b3 msm: camera: csiphy: Update PHY secure CP register for Crow
Update secure CP register bitmask for Crow csiphy-v2.1.2.

CRs-Fixed: 3542076

Change-Id: I02cbb9528661767f0c275b6ad110002ce372591e
Signed-off-by: Shadul Shaikh <quic_shaduls@quicinc.com>
(cherry picked from commit 42c8aa11f18a71c6acd272574e8149d58a5dfd52)
2023-11-28 10:40:37 +05:30
Shadul Shaikh
a6fbca726b msm: camera: sensor: Remove mutex sensitive call in interrupt context
Remove the function call, is getting clock rates with mutex locked
in interrupt context.

CRs-Fixed: 3615675

Change-Id: I838fbd0b211e454de812b7631a1bb8072072ec75
Signed-off-by: Shadul Shaikh <quic_shaduls@quicinc.com>
(cherry picked from commit a42bed83fbfd0dff1940ce7b221ee3370f1e917e)
2023-11-23 14:20:26 +05:30
Shadul Shaikh
9bd3915e24 msm: camera: cci: Check if cci_info structure pointer is NULL
Though cci_ctrl is not NULL its content is handled by user,
who could set cci_info to NULL. A NULL pointer check is placed
before accessing it to avoid any null pointer derefernce.

CRs-Fixed: 3095084

Change-Id: I6f50d4ba38efd9b5c0eb0d14e3d958ff94c11554
Signed-off-by: Rajat Goel <quic_rajgoe@quicinc.com>
Signed-off-by: Shadul Shaikh <quic_shaduls@quicinc.com>
(cherry picked from commit 81c7a070db15aea8a2d7835a68840ac31f4586fb)
2023-11-22 09:29:04 -08:00
Shadul Shaikh
0ab2c977a1 msm: camera: csiphy: Update PHY secure CP register
Update PHY secure CP register bitmask logic for CSIPHY
1.2.3.

CRs-Fixed: 3176306
Change-Id: Ie15767f3bd5d162ba544080e25de8c41c57d4ad4
Signed-off-by: shiwgupt <quic_shiwgupt@quicinc.com>
Signed-off-by: Shadul Shaikh <quic_shaduls@quicinc.com>
(cherry picked from commit e35411f0ea905b01cf45ee6b7ffe74e1a7781df0)
2023-11-22 09:26:42 -08:00
Shravan Nevatia
5e66e1bf36 msm: camera: csiphy: Add support for dummy PHY settings
Add the CSIPHY_DNP_PARAMS macro to specify dummy PHY
settings. These settings will not be applied to HW
and can be used to pad the settings arrays.

CRs-Fixed: 3642100
Change-Id: I42859598996d6190b23111e8ac655bb34e174238
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
(cherry picked from commit b78027078dd6654f96f6d0472ebab09c6e1b088b)
2023-11-21 23:10:55 -08:00
Sourabh Soni
eeb2706049 msm: camera: common: Added missing NULL Checks
This change is returning error for the cases
when platform device misses some data for
device or sub device. Adding Null pointer
checks resolves this issue.

CRs-Fixed: 3608850
Change-Id: If8fc3fc7c93bb2b95087674165dca8c1c13d54f6
Signed-off-by: Sourabh Soni <quic_soursoni@quicinc.com>
2023-10-14 17:54:09 +05:30
mingpan
0c04a30b66 msm: camera: common: Fix possible OOB reads and writes operation
We need to check if the packet is valid before using it.

CRs-Fixed: 3605421
Change-Id: Ide4e005ba46690c1cac02cb77a2d9aaa497b15df
Signed-off-by: mingpan <quic_mingpan@quicinc.com>
(cherry picked from commit 0156c0475a4c6c042eb84fcfbc14b3e837e0cb4c)
2023-10-06 15:26:34 +05:30
Shravan Nevatia
6bbdc6d2ec msm: camera: sensor: Add subdev data ptr NULL checks
Add NULL checks for the private device data ptr
returned by v4l2_get_subdevdata for sensor/CCI/PHY/flash
subdevs.

CRs-Fixed: 3605325
Change-Id: I146857a944988655f75327046bebd9b87154939b
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
(cherry picked from commit 8eaa13f96deb4d940c25cb6043a06f0b7235966a)
2023-10-06 15:25:29 +05:30
Camera Software Integration
19ca7a73f9 Merge "msm: camera: memmgr: Add missing calls of put buf to avoid leak" into camera-kernel.lnx.7.0 2023-10-04 03:06:41 -07:00
Camera Software Integration
083ac0c2f4 Merge "msm: camera: sensor: Add PHY support for cliffs" into camera-kernel.lnx.7.0 2023-10-04 00:50:06 -07:00
Depeng Shao
c0c785043e msm: camera: cci: Remove some dead code
This change removes some dead checking code for
lock function.

CRs-Fixed: 3612969
Change-Id: I8f43ab6021ed6122d37d14b06f4dac1f7e48e6c8
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
(cherry picked from commit eea20d5fb340d847ec8ec50554b4334cd964ce47)
2023-09-26 23:54:57 +05:30
Shravan Nevatia
0101ba0568 msm: camera: sensor: Always stream-off at flush in standby mode
Issue:
- In standby mode, aux sensor is streamed-off at flush only if
stream-off command has already been received.
- If flush happens before stream-off command, the sensor is never
streamed off. This causes the next config command to fail.

Fix:
In standby mode, stream off sensor at flush regardless of the
stream-off status.

CRs-Fixed: 3537642
Change-Id: I15956d51dae4a30cdcabbe9d0ed59857c028218e
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
(cherry picked from commit d5c922710cea5c19a9bcabda946842ba47d920a5)
2023-09-26 23:54:25 +05:30
Vikram Sharma
ec8012559c msm: camera: memmgr: Add missing calls of put buf to avoid leak
This change add missing calls to put cpu buf in few scenarios.

CRs-Fixed: 3578162
Change-Id: Iab6aa0324b5072390b38df296c7acee00f5102a1
Signed-off-by: Vikram Sharma <quic_vikramsa@quicinc.com>
2023-09-26 05:49:27 -07:00
Shravan Nevatia
855f371ebb msm: camera: sensor: Add PHY support for cliffs
Add PHY driver support for cliffs (PHY version 2.2.1).

CRs-Fixed: 3618770
Change-Id: I0cec1b62e827a6c0413ec9f79612507eaaa62724
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
2023-09-22 01:42:51 -07:00
Shravan Nevatia
ed308a3020 msm: camera: sensor: Fix mutex handling in TPG driver
Issue:
TPG driver doesn't release the device mutex when the stop/
configure commands fail.

Fix:
Release the mutex everytime it's acquired in TPG driver.

Change-Id: I8414c73b89e1e69b60682d860ec1d97d6a7a8dbc
CRs-Fixed: 3594995
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
(cherry picked from commit 7b9602e996781f36a79c514780d1f776f5dfda8a)
2023-09-18 09:30:52 +05:30
Depeng Shao
133370a30c msm: camera: cci: Don't validate queue for lock and unlock cmd
We already reserve the space for unlock cmd during loading the
data to CCI queue, so we don't need to validate the queue before
loading unlock cmd to the queue.

CRs-Fixed: 3603432
Change-Id: Ie1acee0c09446d5a60a0f80e1393800600306412
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
(cherry picked from commit f9ca5a4b9a0b5a6dfec4d8881d0e183068596bf9)
2023-09-18 09:29:52 +05:30
Yulei Yao
0b8ef446fb msm: camera: sensor: Fix delay pass issue in I2C sequential write
When I2C sequential write is applied, first register's delay parameter
is used instead of the last one in the sequential queue.

CRs-Fixed: 3566036
External Impact: No.

Change-Id: I0aa6480d7b577fdb697bc28b61aed428d5cae8fb
Signed-off-by: Yulei Yao <quic_yuleiy@quicinc.com>
(cherry picked from commit e2ebd508d879607b2dadb1d223c1ad7338989bf2)
2023-09-11 22:35:32 +05:30
Depeng Shao
38a96f694c msm: camera: cci: Fix some cci stability issues
This change moves the set parameter under lock
context to make sure all the cmds are atomic.
This change also move the unlock at the end
of writing data, then we don't need to get
inflight word count and write back to execute
word count to fix underflow issue.

CRs-Fixed: 3589051
Change-Id: I1c16a204e41e6af22a23e9249c82f541e7e6e21a
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
(cherry picked from commit dda071b3e2e76a2d698a40c8829da0627bd80da2)
2023-08-26 02:58:12 -07:00
Ridhi Mukesh shah
277c1f983b msm: camera: sensor: Remove delay in camera sensor driver
Removed the 20ms delay in the camera sensor driver during sensor probe.

Change-Id: I9a51c3d0b15d6c77196d00b9bfbf6a8dc76d63be
CRs-Fixed: 3244380
Signed-off-by: ridhshah <quic_ridhshah@quicinc.com>
2023-08-10 17:13:26 -07:00
Wang Kan
7d852cc75c msm: camera: csiphy: Add support for SM8750
This change adds bring up sequence header and
driver support for SM8750.

CRs-Fixed: 3557518
Change-Id: I6daddb5bca67032a5bfd3bc30bbd3d076f8599a4
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-07-18 17:36:12 -07:00
Atiya Kailany
2bb45ffd4c msm: camera: common: Fixing memory leak issues
This change removes some dead code and fixes memory leak
issues and mismatched labels.

CRs-Fixed: 3394193
Change-Id: Ieb6f0d56cddc58be4caea6f0aece63a793a08c07
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
2023-07-13 17:36:44 -07:00
Wang Kan
e7ef91e5cc msm: camera: csiphy: Update CSIPHY header for SM8650
This change updates CSIPHY header for SM8650.
Modify some register values for short channel
from 80Msps to 1Gsps.

CRs-Fixed: 3557454
Change-Id: I0fee8747baec55c6712d4a803bfc421320b57626
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-07-13 17:36:27 -07:00
Wang Kan
4ae361e5f6 msm: camera: csiphy: Remove duplicate register settings
Remove data rate settings from common register array.
This change is to avoid re-programming same registers,
with different values.

CRs-Fixed: 3554020
Change-Id: Ia397f669ba97c73a73c3a31fb80b5c233cdb5dd5
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-07-13 17:36:21 -07:00
zhaocao
aefe177f6d msm: camera: sensor: support streamon/streamoff can be updated
Remove restriction that we can only configure streamon/streamoff
from cslpacket once. streamoff packets should not be rejected
when last request to flush.

Change-Id: I0691540f01181fa9f2d6a216537d5f55256d8815
CRs-Fixed: 3524017
Signed-off-by: zhaocao <quic_zhaocao@quicinc.com>
2023-07-13 17:36:13 -07:00
Depeng Shao
bd7f01665c msm: camera: reqmgr: Enhance the injecting delay
This change updates the injecting delay logic to
support different delay value, e.g. 0,1,2. It also
support multi EOF applied devices in case multi
devices need to be applied at EOF.

CRs-Fixed: 3521003
Change-Id: I929d4211674a1376125dd5f8e55950da9ab3ed6b
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
2023-07-12 18:36:20 -07:00
Atiya Kailany
57f43538c7 msm: camera: utils: Add support for LowSVS_D1
Currently, lowest clk voting level supported is LowSVS, this
change will add support to a lower voting level, LowSVS_D1.

CRs-Fixed: 3480799
Change-Id: Ibdfe9d1d05aa45439a537cebe828cceea83f39d4
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
2023-07-07 16:06:34 -07:00
Vijay Kumar Tumati
db988fcff4 msm: camera: csiphy: Refine MINK API usage for secure camera
Use MINK API for all the targets that support domain ID and
use legacy API for all other targets. In addition, use a
target based macro to not compile the MINK API for the
older targets where those APIs are not defined.

Change-Id: I0d8f05df6ca8126db1e3ad8456fe78aa77a33ebf
CRs-Fixed: 3529425
Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
2023-07-07 16:06:10 -07:00
Wang Kan
9603b9ffba msm: camera: csiphy: Change csiphy datarate default channel from std to short
This change changes csiphy datarate default channel from std to short.

CRs-Fixed: 3534590
Change-Id: I52cb37fc89c770795fc1fbec57c91eeb6ab379f7
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-07-05 17:51:32 -07:00
Wang Kan
033efcbed0 msm: camera: ois: Fix stop ois logic
When ois get stop op code and the state is not in start,
we need return directly and don't set state to config.
This change also adds ctrl mutex init when ois i2c
component bind.

CRs-Fixed: 3520698
Change-Id: I0041f9aa3af250d449f7b757791ef684fa1b385f
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-06-26 14:03:56 -07:00
Wang Kan
512fb4a19b msm: camera: csiphy: Add support for long and short channel
Config different channel settings according to the flag
including short and standard channel.

CRs-Fixed: 3441333
Change-Id: I90ae6f941debcd63ecad1e24363997c19bad59ca
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-06-26 14:03:49 -07:00
illa lakshmi soujanya
1c59934ed7 msm: camera: sensor: Add changes to prevent unmap buffers
The function cam_mem_mgr_release can unmap buffers when in use.
This change with cam_mem_put_cpu_buf prevents unmaping the buffers in use.

CRs-Fixed: 3489559
Change-Id: I3a0d7ee0d3e86a2a315bc44e15ca298e71d62ffd
Signed-off-by: illa lakshmi soujanya <quic_illa@quicinc.com>
2023-06-21 15:06:41 -07:00
Atiya Kailany
de76f19956 msm: camera: utils: Add support for cesta hw client voting through mmrm
This change will allow clients voting through mmrm to use the new mmrm
api and vote according to their drv_type. This change affects
registering, unregistering and setting the clk rate to sw and
hw clients.

CRs-Fixed: 3385745
Change-Id: I11f76a0de3ba0d8d969093725d4c528afef51373
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
2023-06-21 15:06:34 -07:00
Vijay Kumar Tumati
16be1306ef msm: camera: csiphy: Handle process shutdown during secure camera
Use SCM 7 call during the process shutdown. This is to
workaround a race condition between the close of camera FD
and the invoke driver FD that leads to a device crash.
Additionally, keep the Domain ID clocks on only during
protect or unprotect operations.

CRs-Fixed: 3509086
Change-Id: Ic091aa737df10bb2b41190c2f850c31fd17af9b2
Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
2023-05-31 17:06:31 -07:00
Wang Kan
56e0bcc8ee msm: camera: common: Fix isp log errs and format errs
Fix isp log errs and format errs.

CRs-Fixed: 3499636
Change-Id: Ieb5b81b95dea440b1da17cb5bc9be86f75b7c4f6
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-05-26 18:36:22 -07:00
Depeng Shao
16652c1360 msm: camera: sensor: Add process evt interface for i2c sensor
This change adds process_evt interface for i2c sensor driver.

CRs-Fixed: 3482079
Change-Id: Id3007497dd48f44f38b25f2b287afc1c685d01e7
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
2023-05-26 18:36:17 -07:00
Depeng Shao
a219b9f118 msm: camera: sensor: Check the result of i2c transfer
The i2c transfer interface returns the num of message is
processed if there is no issue, this change checks if the
result of i2c transfer is same with the num of message,
the return value is assigned as 0 if they are same.

CRs-Fixed: 3495774
Change-Id: I408038120ac2371f1ed031daa364c2e2563e3606
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
2023-05-22 17:06:08 -07:00