Commit Graph

480 Commits

Author SHA1 Message Date
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
zhuo
a6ef23e7e5 msm: camera: utils: Add support bypass clock/regulator/icc wrapper
Sometimes need to avoid access clock/regulator/icc api, this change
add support bypass clock/regulator/icc wrapper through enable
some debugfs parameters and devicetree.

CRs-Fixed: 3445248
Change-Id: I0546975bf063625b39b771c776813e7dbff84e06
Signed-off-by: zhuo <quic_zhuo@quicinc.com>
2023-05-20 10:06:32 -07:00
Atiya Kailany
51b81257c0 msm: camera: common: Removing dead code
Removing some unused variables after assignment

CRs-Fixed: 3394193
Change-Id: Ifb554da9f974036a19670e8c247ec5ae424c6091
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
2023-05-12 19:06:50 -07:00
Ridhi Shah
36c4820960 msm: camera: sensor: change sequential wr to burst wr
Change sequential to burst write in write calls for  i2c and i3c.

CRs-Fixed: 3418153
Change-Id: I4b10b1b62e1075225867561297bddaaac2797a2d
Signed-off-by: Ridhi Shah <quic_ridhshah@quicinc.com>
2023-05-09 21:06:17 -07:00
Depeng Shao
a9df7dfa5c msm: camera: csiphy: Enhance the start dev log for csiphy
Enhance the start dev log for csiphy.

CRs-Fixed: 3482293
Change-Id: I8887affedb0d7937e4105585e531c654eaa634ff
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
2023-05-01 19:38:22 -07:00
Rishab Garg
3be797a964 msm: camera: sensor: Add dynamic Switch support in TPG
- Add support for Dynamic mode switch.
- Request store and apply from waiting queue.
- Add support for reapply request from active queue.
- Handling TPG interrupt.

CRs-Fixed: 3403974
Change-Id: I5dfe146b30631a94059f72d482610e04ba8e4e2c
Signed-off-by: Rishab Garg <quic_rishabg@quicinc.com>
2023-04-27 18:06:15 -07:00
Lokesh Kumar Aakulu
b31f12eb3d msm: camera: csiphy: Add CLK params for Skew debug
Add CLK params in debug data.

CRs-Fixed: 3448060
Change-Id: I45cf7875745088c1e01a9791520614c09fe40f14
Signed-off-by: Lokesh Kumar Aakulu <quic_lkumar@quicinc.com>
2023-04-24 15:06:17 -07:00
Atiya Kailany
a5e1ad91b4 msm: camera: common: Fixing memory leak issues and removing dead code
Fixed null pointer dereference, addressed memroy management issues and
removed unused variabels

CRs-Fixed: 3394193
Change-Id: I477d4b8ea781b20b5b2a66331bebb384e1c703c5
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
2023-04-18 23:15:18 -07:00
Soumen Ghosh
f52a91ab7e msm: camera: csiphy: Guarding the cpas start and cpas stop sequence
We are seeing cam warning "cpas gdsc clk is on" and qchannel handshake
is failing on next power on. This will happen if some client want to
tunr on camnoc axi clk before turning off the gdsc clk in previous run.

CRs-Fixed: 3417264
Change-Id: I6927998cb47b7555e22c3d57b4c2f526adf62f34
Signed-off-by: Soumen Ghosh <quic_soumeng@quicinc.com>
2023-04-13 18:36:08 -07:00
Lokesh Kumar Aakulu
9f559bfc82 msm: camera: sensor: Add get sync and put sync for i2c QUP
Add get_sync and put_sync for I2C transaction

CRs-Fixed: 3452259
Change-Id: I1f17cf4795c826fa016163b66291e0ca6f60a69d
Signed-off-by: Lokesh Kumar Aakulu <quic_lkumar@quicinc.com>
2023-04-11 22:06:06 -07:00
Li Sha Lim
8e7b72d937 msm: camera: sensor: debugfs utility for i2c/cci
This change adds support to read/write any sensor
devices that are on i2c, whether using cci or qup.
The debugfs file is mounted on i2c subdir under
camera root directory in debugfs.

Given that these devices are not always turned on,
and that this power on/off sequence is controlled
by userspace, this change displays all available
i2c devices, and their power states.

The user then can read/write to those devices which
are turned on, according to the following:

Usage:
  - echo (anything or empty string) > i2c-rw
  - cat i2c-rw then displays usage, and states of devices
  - echo (proper r/w format) > i2c-rw
  - cat i2c-rw displays output/error
Note that cat output is not persistent, it gets cleared
after displaying once.

CRs-Fixed: 3385104
Change-Id: I22023e0a8d9a680b5c8578cae2aa253c4c90226f
Signed-off-by: Li Sha Lim <quic_lishlim@quicinc.com>
2023-04-05 17:06:38 -07:00
Lokesh Kumar Aakulu
cd7d12e360 msm: camera: sensor: Lookahead sequential register address
when sequential register address present in register setting,
that can be combined as one I2C msg command and save some
Cycles. This lookahead is enabled by default, if it needs
to be disabled then we need to issue below command.

adb shell "echo 0 > /sys/module/camera/parameters/i2c_lookahead_en"
adb shell "echo 0 > /sys/module/camera/parameters/i3c_lookahead_en".

CRs-Fixed: 3418153
Change-Id: I0a63608316fe745e36a25e5206be6681da6aaa76
Signed-off-by: Lokesh Kumar Aakulu <quic_lkumar@quicinc.com>
2023-04-04 17:06:33 -07:00
illa lakshmi soujanya
8c38f564e3 msm: camera: sensor: Logging Enhancement
Print CCI master-id & hardware-id on probe.
Print CSIPHY rx & timer clock rates once when clocks are enabled
and also prints on error trigger notification.

Change-Id: I4ecb1c7214d7482b157c3c1647e19743e8d90e17
CRs-Fixed: 3432375
Signed-off-by: illa lakshmi soujanya <quic_illa@quicinc.com>
2023-04-04 17:06:09 -07:00
Atiya Kailany
cd228527e7 msm: camera: sensor: Removing dead code
This change removes some unused variables.

CRs-Fixed: 3394193
Change-Id: I5618f8f485b6b3710aad8172bfef6c6da772db82
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
2023-03-23 11:36:26 -07:00
Wang Kan
37f147cf7c msm: camera: csiphy: Update CSIPHY header for SM8650
Update CSIPHY header for SM8650.

CRs-Fixed: 3427898
Change-Id: I76f5ca1c1dcc96651a71c02cb500138008ed8a81
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
Signed-off-by: Lokesh Kumar Aakulu <quic_lkumar@quicinc.com>
2023-03-20 17:36:06 -07:00
Sokchetra Eung
fe2a0160e9 msm: camera: cpas: Modify Client CPAS reg read/write
Remove all instances of cpas camnoc reg read/write by clients.
Move cpas reg base enums to internal cpas file that is only visible
to CPAS usages, and create cpastop reg base macro in CPAS API file.
So, clients can now read and write to cpastop reg only.

CRs-Fixed: 3405131
Change-Id: I1793377a8b6f010bb2c79ac9020cfa3d21e31812
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
2023-03-20 13:46:27 -07:00
Ridhi Shah
c7f95fddce msm: camera: sensor: optimize i2c and i3c table write
Optimize i2c and i3c table write to send all settings to QUP at once.
Previously we called QUP transfer API for every single register write
which caused latency
In current solution we write all settings to a buffer and send entire
buffer to QUP master by calling the transfer API just once.

CRs-Fixed: 3408965
Change-Id: I251360e36a2d304addd083abd5b02fb6ed7f4bbb
Signed-off-by: Ridhi Shah <quic_ridhshah@quicinc.com>
2023-03-17 21:36:05 -07:00
Ridhi Shah
82830d42b4 msm: camera: sensor: update aon_cam_id to uint32 value in csiphy driver
Update the AON cam id value to uint32  for csiphy driver.

CRs-Fixed: 3355901
Change-Id: I6f16cdc22c7dd0affc5e61f39cb783d2d67c39f9
Signed-off-by: Ridhi Shah <quic_ridhshah@quicinc.com>
2023-03-17 21:36:05 -07:00
Sokchetra Eung
740de40e65 msm: camera: utils: Add support for multiple IRQ lines per device
Update SOC util to be able to parse multiple irq names from DT and,
request, enable, disable multiple irq lines per soc.

All IRQ lines per SOC will have the same handler but different data,
so ISR will have their own private data to differentiate source of irq
in the same handling function.

CRs-Fixed: 3395596
Change-Id: Id9ca1cd3ef105d732a82decd7c8078bd29668326
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
2023-03-17 21:36:05 -07:00
Depeng Shao
a039cf068a msm: camera: cci: Move load report cmd in lock context
This change moves load report cmd in lock context,
then all sequence in one queue will be defined as
atomic queue commands without interruption from
the other queue commands.

CRs-Fixed: 3415571
Change-Id: Icda2271b580bd3f462c306ad0f229969a94079f6
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
2023-03-17 21:36:05 -07:00