Commit Graph

466 Commits

Author SHA1 Message Date
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
Lokesh Kumar Aakulu
1d7db3ca45 msm: camera: csiphy: Add Support for datarate config per csiphy
Tough sensor data rate is same for multiple camera sensors
still it'll depend up the mounting distance from sensor
to CSIPHY or SOC. Hence update datarate setting based on
CSIPHY instance.

CRs-Fixed: 3420314
Change-Id: Ie098b121394e241f360f9ae775bfd83b6bace15b
Signed-off-by: Lokesh Kumar Aakulu <quic_lkumar@quicinc.com>
2023-03-14 15:06:06 -07:00
Karthik Anantha Ram
c3364a0aa2 msm: camera: sensor: Add OIS FW version check support
Adding infrastructure to check OIS FW version before downloading
OIS FW to avoid downloading the same FW.

CRs-Fixed: 3383153
Change-Id: Ic92b62bfe2277eaba9b417a13201fabeab04383e
Signed-off-by: Yulei Yao <quic_yuleiy@quicinc.com>
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2023-03-08 17:36:06 -08:00
Shivi Mangal
fd62485780 msm: camera: sensor: Handle init for settings command config
This change is to call the tpg_hw_configure_init_settings_v3
function which is responsible for enabling clock and
resetting tpg clock in case of settings command config.

CRs-Fixed: 3406224
Change-Id: I17edb716074a121e12d04735166b3a0209a19359
Signed-off-by: Shivi Mangal <quic_smangal@quicinc.com>
2023-02-24 21:06:08 -08:00
Karthik Dillibabu
c4993c3b77 msm: camera: common: workq delay debug
Added log to print wq_name and callback info to understand
which task is delayed and to aid in debugging.

CRs-Fixed: 3381768
Change-Id: I74f1f5d3312c9163cfbafa4bc15a96c973ef2ba5
Signed-off-by: Karthik Dillibabu <quic_kard@quicinc.com>
2023-02-17 16:36:12 -08:00
Abhilash Mahapatra
3114739e59 msm: camera: cci: Number of CCI masters index validation
Number of CCI masters index validation to avoid
out of bound array indices access.

CRs-Fixed: 3381768
Change-Id: I14d4a111cc5c7dab17d071446cddccd7651389a3
Signed-off-by: Abhilash Mahapatra <quic_abhmah@quicinc.com>
2023-02-14 21:06:33 -08:00
Depeng Shao
305683fb02 msm: camera: sensor: Configuring sensor pd to 1 for hfr usecase
Configuring sensor pd to 1 for hfr usecase, then the setting
of sensor can reflect on next batch.

CRs-Fixed: 3376953
Change-Id: I4a78e087aec0e46f78f40ae8c37f1086125558de
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
2023-02-07 11:36:08 -08:00
Ridhi Shah
5abce6f5c7 msm: camera: sensor: update aon_camera_id to uint32 value
Change aon_camera_id to uint32 to read correct value from dtsi
Since more than one aon cameras are present.

CRs-Fixed: 3355901
Change-Id: I2a7723fa5b4f6c3a9a27d7119bdab2c65c4e620d
Signed-off-by: Ridhi Shah  <quic_ridhshah@quicinc.com>
2023-02-03 22:06:10 -08:00
Vijay Kumar Tumati
bae0381f76 msm: camera: csiphy: Fix misc seccam integration issues
The current secure camera implementation suffers with a few
issues in terms of typecasting, error handling and in
populating the information in the right data structures when
the new SCM API is used on the targets without domain ID support.
In addition, we needed to be explicit in failing to acquire
if dual IFE is required in secure camera use cases as it is
not a supported feature as of now.

CRs-Fixed: 3317248
Change-Id: Idb762158b0ff0e0a0d6d51de4770fc3d9d9072c8
Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
2023-02-01 20:06:12 -08:00
Li Sha Lim
d0db8bb415 msm: camera: csiphy: Integrate mink call for secure camera
Adds support for new mink call to configure secure
camera sessions. This new mink call takes in additional
parameters to support the new domain-id based
security scheme. The additional parameters are in the
form of csid_hw_idx_mask, cdm_hw_idx_mask and
vc_mask. These are in addition to the existing PHY idx
and CPHY/DPHY lanes info.
The introduction of this new mink call deprecates the
existing SCM call used to service secure camera sessions.
What this means is that on all subsequent versions of this
driver, all secure camera sessions will be serviced by this
mink call, which is able to accommodate older and newer targets,
and their programming of different register sets.
This design enables the cam_csiphy_notify_secure_mode
wrapper to remain the same, with the underlying mink call
made in the cam_compat layer, depending on camera driver
version.

CRs-Fixed: 3317248
Change-Id: I05511f4380ce5467b104675c07c9c8faa5318af8
Signed-off-by: Li Sha Lim <quic_lishlim@quicinc.com>
2023-01-30 15:06:09 -08:00
Karthik Anantha Ram
a5b60b58b2 msm: camera: common: Enhance seamless switch support
Mode switch delay is an inherent property of a sensor.
Similarly IFE has a static switch delay of 1. For sensors
with switch delay > 1 need special handling on certain
occasions. It is possible that switch settings was applied
to sensor, and on the next frame if there is a flash inject
delay or a packet delay, sensor & IFE are bound to go out of sync.
To address such cases, IFE will decide if it needs to apply
MUP on a dropped frame or not, along with any corresponding
IQ settings.

CRs-Fixed: 3320774
Change-Id: I355fa0f8b767d44bd3fb87c91b3cbf56fb9c3933
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2023-01-27 15:06:29 -08:00
Wang Kan
fcd14c1b1a msm: camera: csiphy: Update CSIPHY header for SM8650
Update CSIPHY header for SM8650.

CRs-Fixed: 3335789
Change-Id: I79fed4330cd36e2b1464b9d5667678187a163cd1
Signed-off-by: Wang Kan <quic_wkan@quicinc.com>
2023-01-19 17:06:10 -08:00
Depeng Shao
40f354b732 msm: camera: sensor: Removing some dead code
Removing some dead code, the power info and
soc private are never used after assignment.

CRs-Fixed: 3376960
Change-Id: I0038cad043ea53ffd18d711f338e094ff0f919cc
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
2023-01-18 12:36:44 -08:00
Shivi Mangal
3f157fddcd msm: camera: sensor: Clock change for init settings
This change allows the tpg clock configuration to be directly picked
up from the get_tpg_clk_level function.

CRs-Fixed: 3376775.

Change-Id: I9a9ef232fd7f0c79c3f6683dc7838555dd02e3f2
Signed-off-by: Shivi Mangal <quic_smangal@quicinc.com>
2023-01-18 12:36:36 -08:00
Shivi Mangal
953b2ced40 msm: camera: sensor: Add register settings in TPG
This change allows the tpg hw register configurations to be directly
programmed from the tpg xml file. The regsettings array can be configured
with the right configurations for the required mode, if regsettings are
not provided in regsettings array. The settings are derived from the
stream configurations and global configurations.

CRs-Fixed: 3289930.

Change-Id: If44678475986efc0f26c334f5db4f9c59cd6873b
Signed-off-by: Shivi Mangal <quic_smangal@quicinc.com>
2023-01-13 15:36:05 -08:00