Commit Graph

3149 Commits

Author SHA1 Message Date
Chun Xu
d3a2efac91 misc: tegra-cec: dump read/write buffer for debug
Dump read/write buffer with dev_dbg for debug.

TDS-2199

Change-Id: I1fa3dec9e2ccd78023c464085fd2f6e3f49a87f2
Signed-off-by: Chun Xu <chunx@nvidia.com>
Reviewed-on: http://git-master/r/1485394
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Prafull Suryawanshi <prafulls@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Spencer Sutterlin <ssutterlin@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2025-07-24 10:19:13 +00:00
Nicolin Chen
df4c2972fa misc: tegra_cec: add missing cancel_work_sync()
This patch just adds missing cancel_work_sync()
in the exit path of the probe().

Bug 1887171
Bug 200289389

Change-Id: I7d42ae6d035f87b5ad1b726cbe5274fbd9755f4e
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-on: http://git-master/r/1463243
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2025-07-24 10:19:13 +00:00
Vince Hsu
f3071e5d0d misc: tegra_cec: turn some prints into debug level
To prevent too many bufferred message from flushing out to serial when
we turn on/off display and blocking other high priority task due to
disabled IRQ, we change some prints to debug level to workaround that
problem as a short-term solution. The long-term will be implemented
later.

bug 200205349

Change-Id: I6609844d5c2ee58b2df6a51e9537bb7dd1448995
Signed-off-by: Vince Hsu <vinceh@nvidia.com>
Reviewed-on: http://git-master/r/1326683
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Chun Xu <chunx@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2025-07-24 10:19:13 +00:00
Santosh Reddy Galma
9b22ee78d3 misc: tegra-cec: fix power domains API for cec
use generic APIs tegra_unpowergate_partition() and
tegra_powergate_partition() to unpowergate DISP power
domain needed for CEC without enabling disp clocks so
that display pll clocks are disabled in idle state even
though DISP partition is awake.

Bug 1810989

Change-Id: I37428b9012729a4458724314732f80a571057fd6
Signed-off-by: Santosh Reddy Galma <galmar@nvidia.com>
Reviewed-on: http://git-master/r/1317241
(cherry picked from commit dffb3d3b5fb67cb6920fdbfc72cd3d6c37f0061c)
2025-07-24 10:19:13 +00:00
Chun XU
5eb6b0d864 misc: tegra_cec: add recover IOCTL
Provide error recovery from IOCTL to user space.

Bug 1866338

Change-Id: I705ada6c8d4cb13f1c882993468f467da2908fdf
Signed-off-by: Chun XU <chunx@nvidia.com>
Reviewed-on: http://git-master/r/1300499
(cherry picked from commit a646f4903c8794641432fa838a27ee5584944eb5)
2025-07-24 10:19:13 +00:00
Chun XU
5bf170a0c1 misc: tegra_cec: turn on TV ASAP
Turn on the TV as soon as possible for better user experience
by sending <Text View On> and <ACTIVE SOURCE> CEC commands if
the previous reboot is not recovery. If the previous reboot
reason is recovery, don't send <Text View On> to avoid turning
on TV when there is an auto OTA on-going.

CEC driver uses RESERVED2 logical address as the source address.
Later, the upper layer will send OneTouchPlay command by using
its valid logical address.

Bug 200253563

Change-Id: Iecd759bb50c1f21549f55906e68e3faab905f86b
Signed-off-by: Chun XU <chunx@nvidia.com>
Reviewed-on: http://git-master/r/1277092
(cherry picked from commit 2beab2dcfc4e40712004500df99633d59ae0e70c)
2025-07-24 10:19:13 +00:00
Mikko Perttunen
33ca384a75 misc: tegra-cec: Use per-chip powergate IDs
Powergate identifiers are different on Tegra210 and Tegra186,
so add per-SoC match data to use the correct value on each
SoC.

bug 200257351

Change-Id: I81b938386ab9cbaec735baac44ee74fccf39731c
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/1297136
(cherry picked from commit 5438b348e036c31dcf9db0d1364fa6c6ac053428)
2025-07-24 10:19:13 +00:00
Spencer Sutterlin
d272c5fea6 misc: tegra_cec: fix cec_logical_addr_store print
Bug 1637415

Change-Id: Ib165165b67f5ea3723914270215de06df48f6591
Signed-off-by: Spencer Sutterlin <ssutterlin@nvidia.com>
Reviewed-on: http://git-master/r/679245
(cherry picked from commit e9eef85a417a85461d0e7c018fcec2f2838254c2)
2025-07-24 10:19:13 +00:00
Chun XU
0859614c3d misc: tegra-cec: add /sys/devices/platform symlink
Create a symlink for tegra_cec if it is not under platform bus or
it has been created with different name.

Bug 200214224
Bug 200185815
Bug 1764073

Change-Id: Ib2f89db016982ca916894c37e47bbdf177fb617e
Signed-off-by: Chun XU <chunx@nvidia.com>
Reviewed-on: http://git-master/r/1175137
(cherry picked from commit 506e6370d234c4770afb22372ef1955faa7822cf)
2025-07-24 10:19:13 +00:00
Chun XU
3a1bf5d02f misc: tegra-cec: tegra_nvdisp_powergate_partition
Use tegra_nvdisp_unpowergate_partition/tegra_nvdisp_powergate_partition
in Tegra CEC driver to control DISA power domain.

Bug 200214236
Bug 200214232
Bug 200185815

Change-Id: Ib860570f901278e9211b5262fddf8c63a700c5f9
Signed-off-by: Chun XU <chunx@nvidia.com>
Reviewed-on: http://git-master/r/1176912
(cherry picked from commit 8e9f75ac1dadf04a8f89a74dac3e67cd1a06f886)
2025-07-24 10:19:13 +00:00
Ankit Pashiney
1cd95da9b1 misc: Tegra CEC Support
Bug 1258710

Change-Id: Ie449d4b8a28388087b601a0332eb065488a32009
Signed-off-by: Ankit Pashiney <apashiney@nvidia.com>
Reviewed-on: http://git-master/r/215363
(cherry picked from commit e156fdeb84a7f750b602c746489538f5b29837cd)
Reviewed-on: http://git-master/r/1164171
(cherry picked from commit 64c30ff47c90f4dbf659570e9aaeea1270b9f756)
2025-07-24 10:19:13 +00:00
Chun XU
aae6e6e3d3 misc: tegra-cec: enable DISA temporarily in init
Unpowergate DISA power domain if it is powergated during CEC driver initialization.

Bug 200175747

Change-Id: I8b3d879fe0c33eaef74c1b4d3b549559c4977e4d
Signed-off-by: Chun XU <chunx@nvidia.com>
Reviewed-on: http://git-master/r/1142593
Reviewed-on: http://git-master/r/1164149
(cherry picked from commit c341176715597fe8268b20b291bcef07bb429500)
2025-07-24 10:19:13 +00:00
Mitch Luban
d29a9f4d3c drivers: cec: add T186 support for cec
Bug 200148417

Change-Id: I4a57303097c0687c903f284504df10930924f1ae
Signed-off-by: Mitch Luban <mluban@nvidia.com>
Reviewed-on: http://git-master/r/840657
Reviewed-on: http://git-master/r/1164148
(cherry picked from commit be0d9f8be8a19525c2e4794d08f0932bc53128ee)
2025-07-24 10:19:13 +00:00
Xia Yang
5fe3445d16 misc: tegra-cec: Short-circuit init on suspend
Bug 1591149

Initialization of cec engine is slow.
Short-circuit the init in event of suspend.

Change-Id: Ibfbd6f36883a7bf45fdb5137120b041a52f42086
Signed-off-by: Xia Yang <xiay@nvidia.com>
Reviewed-on: http://git-master/r/714423
(cherry picked from commit d5f4a6602678c87e8caa5032e43f2415c314d800)
Reviewed-on: http://git-master/r/716496
Reviewed-on: http://git-master/r/1164147
(cherry picked from commit 82a640a1ea11e850f769b78b5d0c531731b1ffd8)
2025-07-24 10:19:13 +00:00
Toby Butzon
c851db09e1 misc: tegra_cec: enable input filtering
Bug 1605426

Change-Id: I7fdfd3eee37f91f016fcbfe573d761f551560dde
Signed-off-by: Toby Butzon <tbutzon@nvidia.com>
Reviewed-on: http://git-master/r/682207
(cherry picked from commit fb8396c2f5cc02e72dae45d9421d17565b607921)
Reviewed-on: http://git-master/r/708747
(cherry picked from commit 1c18321a0e97b6fd2568b418ea353f6716b5a2e4)
2025-07-24 10:19:13 +00:00
Spencer Sutterlin
86a00ac63f misc: tegra_cec: fix sparse warning
Fix sparse warning by adding static keyword to functions

Bug 200032218

Change-Id: I0fe65173eb0295f5b981fa44f381683efe9a980b
Signed-off-by: Spencer Sutterlin <ssutterlin@nvidia.com>
Reviewed-on: http://git-master/r/592290
Reviewed-on: http://git-master/r/1164145
(cherry picked from commit 74cfb080d07bc8e5758dfb83c4ce7507f16e4c9a)
2025-07-24 10:19:13 +00:00
Xia Yang
920e9769c6 misc: tegra_cec: add DT matching entry
Auxdata still have to be provided in of_platform_populate()
during early boot device detection to get the device correctly
named as "tegra_cec".  Failing to do so will result in device
probe failure as of_device_make_bus_id() will name the device
as "[phys_base].tegra_cec" and cause clock assignment failure.

Bug 200013561

Change-Id: Ib0f898f89146cba7f02cffb768c6a2eb558400ce
Signed-off-by: Xia Yang <xiay@nvidia.com>
Reviewed-on: http://git-master/r/433871
Reviewed-on: http://git-master/r/1164144
(cherry picked from commit 43402b18ee6def21d7d55420f5acd22403e86f1d)
2025-07-24 10:19:12 +00:00
Xia Yang
bffe74f98f tegra: cec: Driver rework
Change write() to work per frame.
Change write() to return -1 on error and set up errno

write() API:
-Userspace is responsible for re-transmission.
-Read from user-space byte by byte, each byte representing
 a block, up to 16 bytes as specified by HDMI standard.
-Return 0 on success transmission, -1 otherwise, with errno
 setup as follows:
  EIO - TX_REGISTER_UNDERRUN, should not happen, otherwise
      driver is have serious timing issue.
  ECOMM - BUS arbitration failure or anomaly BUS activity.
      Transmission is abandoned.
  ECONNRESET - For broadcast message only, someone on the BUS
      asserted NAK during transmission.
  EHOSTUNREACH - For direct message only, message was not ACK'd.
      (Required by logical address allocation)
  EMSGSIZE - Message size > 16 bit.
  EFAULT - Page fault accessing message buffer.
  EINTR - call interrupted by singal.

read() API is unchanged, works per packet with no error report.

Change-Id: Iabdd92b5658dd63c7b500a7ec88d79a64c8c0a43
Signed-off-by: Xia Yang <xiay@nvidia.com>
Reviewed-on: http://git-master/r/304664
(cherry picked from commit 6ab7a446c4a3e8e4970ceec5a3c715453a24e4a5)
Signed-off-by: Xia Yang <xiay@nvidia.com>
Reviewed-on: http://git-master/r/347779
Reviewed-on: http://git-master/r/1164143
(cherry picked from commit 67a6c2d3cfbeeca5cb5ed57aae53f34d07decd4f)
2025-07-24 10:19:12 +00:00
Ankita Garg
063d7fb0cd misc: cec: Add sysfs node to set logical addr
Sysfs node takes string of decimal representation of logical address
Logical address must be in bit-map form, e.g., "0x10" for address 4

Bug 1395893

Change-Id: I899fe80e1ebcc9957ac6efe3c4f6d07873b2a8db
Signed-off-by: Ankita Garg <ankitag@nvidia.com>
Signed-off-by: Xia Yang <xiay@nvidia.com>
Reviewed-on: http://git-master/r/303968
(cherry picked from commit ff2b08c0dc1d6ff3c1d7cac012cdccfa17c6399c)
Signed-off-by: Xia Yang <xiay@nvidia.com>
Reviewed-on: http://git-master/r/346043
Reviewed-on: http://git-master/r/1164142
(cherry picked from commit 706ba72c2cb9f05450a10110d70f2462b52046d2)
2025-07-24 10:19:12 +00:00
Xia Yang
a315f05381 misc: cec: Fix bug potentially cause system hang
Remove wait_event_interruptible() from interrupt context
Change init_done to be atomic_t and reset as early as possible

Bug 1395893

Change-Id: Ib0cf423a3405293000b0c0d9aa105da5bba22e53
Signed-off-by: Xia Yang <xiay@nvidia.com>
Reviewed-on: http://git-master/r/304631
(cherry picked from commit ef034436a3c8aaf7a9ce5dd9ebaf8dc90dbcce4b)
Signed-off-by: Xia Yang <xiay@nvidia.com>
Reviewed-on: http://git-master/r/346042
Reviewed-on: http://git-master/r/1164141
(cherry picked from commit 76e681f957b27323227c9990679631636084b6ae)
2025-07-24 10:19:12 +00:00
Deepak Nibade
36917e3988 misc: cec: cancel workqueue in suspend
cancel the workqueue in suspend method before turning
  off the clock

Bug 1360341

Change-Id: I126da686a6ba0c5eec55b67df1e9f962ce16fc48
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/280159
(cherry picked from commit 7cc6da6e41c7889f7ed8da7833d293b3b884bc0e)
Signed-off-by: Xia Yang <xiay@nvidia.com>
Reviewed-on: http://git-master/r/346041
Reviewed-on: http://git-master/r/1164140
(cherry picked from commit e57647e7daacd5a3c22016cbe3f01ddb800d702c)
2025-07-24 10:19:12 +00:00
Shridhar Rasal
263ddf4b05 misc: cec: add wait_event for CEC ops
Add wait_event to make sure that CEC functions
do not execute until CEC init completes

Bug 1283088

Change-Id: I1d26360326338f549a14cbf109a24c2935ebe472
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/232566
(cherry picked from commit 6e94e976c1e2121d81d19018b79a97d353b11d70)
Signed-off-by: Xia Yang <xiay@nvidia.com>
Reviewed-on: http://git-master/r/346039
Reviewed-on: http://git-master/r/1164139
(cherry picked from commit 794145e9f8c16c7e36119f3652dd185cf12eb5dc)
2025-07-24 10:19:12 +00:00
Shridhar Rasal
e5c9fb04ed misc: cec: add worker handler for resume
HDMI CEC needs 1 sec delay for reset hardware in resume
Adding work handler for CEC init

Bug 1283088

Change-Id: I4498584ec93c1a5eefddfad9966cb5a1e7776e6e
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/228332
(cherry picked from commit 596245cee4b2c239843c2f920d83c21721af2ffb)
Signed-off-by: Xia Yang <xiay@nvidia.com>
Reviewed-on: http://git-master/r/346038
Reviewed-on: http://git-master/r/1164138
(cherry picked from commit f62afdb0cb72a087442db6ed450b52925d20f9b6)
2025-07-24 10:19:12 +00:00
Ankita Garg
3df8f3cbbd misc: tegra-cec: Updates for T124
In T124, the RX_REGISTER_FULL interrupt is cleared
by reading the RX_REGISTER instead of writing to the
INT_STAT register as before.

Bug 1364229

Change-Id: Ib080a48910304553b0752a3ede55ab0d7653dd77
Signed-off-by: Ankita Garg <ankitag@nvidia.com>
Reviewed-on: http://git-master/r/275982
Reviewed-on: http://git-master/r/1164137
(cherry picked from commit b890e7f50d3d032fc3ede4c4935fdf2c4501f063)
2025-07-24 10:19:12 +00:00
Benjamin Lu
e915b41b5b misc: cec: fix warnings
tegra_cec.c: fix warnings as compilation fails after enabling warning as
errors flag

Bug 1258710

Change-Id: Iecd3051d482f5a7488c9f95f6124ad39371f0bd9
Signed-off-by: Benjamin Lu <benjaminl@nvidia.com>
Reviewed-on: http://git-master/r/1164136
(cherry picked from commit 8112e3cd46d11eca51e95cc2fed66d2f7946553a)
2025-07-24 10:19:12 +00:00
Ankit Pashiney
d4553bafd5 misc: tegra-cec: Initial CEC Driver for T3x platform
READ API:
	read API ignores count and will always return 16 bit data.
	read API expects user to supply it with min of 16 bits data
	it returns CEC packet in following format
	bit 0-7: data
	bit 8: EOM
	bit 9: ACK

WRITE API:
	write API ignores count and will always accept 32 bit data.
	write API expects user to supply it with min of 32 bits data
	it accepts CEC packet supllied in following format
	bit 0-7: data
	bit 8: EOM
	bit 12: Address mode, 0 = Direct, 1 = Broadcast
	bit 16: Generate Start bit, 0 = Disable, 1 = Enable
	bit 17: Retry frame, 0 = Disable, 1 = Enable

	Logical address is set to 4, as of now there is no mechanism to change this
	address from userspace.

Driver is disabled by default in Kconfig

Bug 200198493

Change-Id: Ia3835cec0bb717e63dabca5c5fcb1236847bf492
Reviewed-on: http://git-master/r/1164135
(cherry picked from commit 955ec819872e66c4732b38cd74c7ff3a302d95f2)
Signed-off-by: Chun XU <chunx@nvidia.com>
2025-07-24 10:19:12 +00:00
Nagaraj P N
9db0daab99 hv-vse: update err handling function
update err handling function to return -EINVAL in case of
unrecognized error code.

Bug 5015473

Change-Id: I0aa07721541bf59cb4e8cd8554e545196251e38f
Signed-off-by: Nagaraj P N <nagarajp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3273654
(cherry picked from commit 3ac33a52485efc09054815b6824f43930de5c900)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3276070
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:12 +00:00
Shubhi Garg
fc807ba71e Revert "rtc: fix year calculation in max77851 pmic rtc"
This reverts commit b60b757d9c.

Reason for revert:
rtc_valid_tm api checks year range if it is > 70. While
max77851 RTC_YEAR register provides range from 0 to 199,
add +100 always to fall under valid range.

This fixes rtc read time issue from sysfs.
root@jetson:/home/nvidia# cat /sys/class/rtc/rtc1/time
cat: /sys/class/rtc/rtc1/time: Invalid argument

Bug 4911320

Change-Id: I70b5495bb11f9b0b6dd80e19e626ccdb8d3ac6f6
Signed-off-by: Shubhi Garg <shgarg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3273546
Reviewed-by: Evan Wei <evwei@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2025-07-24 10:19:12 +00:00
Srishti Goel
eeb5d6e7a2 pci: epf: Correct deviceid in DMA test app
Correct device ID in the DMA test app to 0x22D7

Bug 4938994

Change-Id: Ibf8d5bc0a7bc6cc299fd92daa8fcc1bb4e2e116d
Signed-off-by: Srishti Goel <srgoel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3275919
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:12 +00:00
Srishti Goel
c7ac599207 misc: Corrected PCIe DMA test app deviceid
Corrected DMA test app deviceid to 0x22D7 and 0x229B

Bug 4938994

Change-Id: I080e7b452e8e3928d87c762855926f11c985e76c
Signed-off-by: Srishti Goel <srgoel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3275918
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:12 +00:00
Rakibul Hassan
6087c01f5d nvidia-oot: camera: isp: track stats syncpt
This change corrects the logic for tracking stats syncpoint
threshold.

In UMD, IspNg sets flag stats_aidx_flag per stats block enabled.
In RCE, this is copied over to the task descriptor as
stats_action_mask.
In Falcon, this mask is used to determine how many times the
stats syncpoint shall be incremented.

This change fixes the logic in isp_capture_request to have the
threshold be based on the same flag from IspNg, by reading it
from the program buffer.

Bug 4990722

Change-Id: I8991a2282e522d4e611e877b6be115dab27ebb63
Signed-off-by: Rakibul Hassan <rakibulh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3265594
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Shiva Dubey <sdubey@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Jagadeesh Kinni <jkinni@nvidia.com>
2025-07-24 10:19:12 +00:00
Manikanta Maddireddy
1f56aa1d73 PCI: tegra264: Add IO BAR support
PCI supports IO BAR with 32-bit address, however XAL HW module provide
a way to use 64-bit MMIO address as a CPU address and a 32-bit PCI
address for IO BAR. Program 64-bit MMIO address in XAL registers,
when sending the TLP over the bus, XAL truncates it to 32-bit address.

Bug 4883004

Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Change-Id: Idf2fdfa9d345ae7d0630d4ab9b1074422a9f68f4
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3256977
Reviewed-by: Ankit Patel (SW-TEGRA) <anpatel@nvidia.com>
Tested-by: Ankit Patel (SW-TEGRA) <anpatel@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
Rakibul Hassan
300d4852fb nvidia-oot: camera: vi: pass va of allocated desc
Bug 5014165

Change-Id: I25b967efa560cc648db378d752f33afb2ba167ca
Signed-off-by: Rakibul Hassan <rakibulh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3272844
Tested-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Nithin Varghese <nvarghese@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2025-07-24 10:19:12 +00:00
amitabhd
8e20f0d104 host1x_emu: Fix Host1x_EMU devnode permission
Set R/W permission for group and others.

Bug 5019709

Change-Id: Ia007623c891a10669ba92ab4de1d50a1d4f7ce9f
Signed-off-by: amitabhd <amitabhd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3271151
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Leslin Varghese <lvarghese@nvidia.com>
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
Mohit Ingale
f6ea9a46d2 tegra: fsync: Fix fsync driver for thor
we can't use just one edge register for active and inactive
edge, with 1ns tsc clock width and only 28 bits for edge offset
register, we need to split the active tsc ticks between 2 edge
registers.

Jira CAMERASW-30089

Change-Id: I290b2c131ead9e89832445b0a4ee35e9f48e27c5
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3270199
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Ian Kaszubski <ikaszubski@nvidia.com>
Reviewed-by: Jagadeesh Kinni <jkinni@nvidia.com>
Reviewed-by: Shiva Dubey <sdubey@nvidia.com>
2025-07-24 10:19:12 +00:00
Evgeny Kornev
c4d1462fd6 tracing: Fix ftrace for ISP trace events
Fix ISP trace events due to 64 bit TS cahnges

Jira CAMERASW-30345

Change-Id: I33aa9325603ec939979e11964224bf3f113a0adb
Signed-off-by: Evgeny Kornev <ekornev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3266979
Reviewed-by: Jukka Kaartinen <jkaartinen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: Sudhir Vyas <svyas@nvidia.com>
2025-07-24 10:19:12 +00:00
snchen
05549d41ff camera: add SBGGR12 color format
Add SBGGR12 color format to support bayer bggr12

bug 4575548

Change-Id: Ic59b6bc33e67da7f94e2a6805a18971423036e74
Signed-off-by: snchen <snchen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3173804
(cherry picked from commit f2d3ec994c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3196011
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Dane Liu <danel@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:12 +00:00
chandra
9dc7f5a20f nvscic2c-pcie: Fix MISRA rule 10.3 violations
Fix total 62 violations of rule 10.3

JIRA NVIPC-3121

Change-Id: I1eae97bdbd8e1b41363469a42c66c23e8899603f
Signed-off-by: cyeddu <cyeddu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3250504
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
chandra
414c0b4cf7 nvscic2c-pcie: Fix MISRA rule 10.4 violations
Fix total 65 violations of rule 10.4

JIRA NVIPC-3121

Change-Id: I5a1bead886683cbe3ec4b0e68531ee6e2a149175
Signed-off-by: cyeddu <cyeddu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3246908
Reviewed-by: Janardhan Reddy AnnapuReddy <jreddya@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Janardhan Reddy AnnapuReddy <jreddya@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
283315b000 DCE-KMD: Rename dce-os-device.h
- Rename dce-os-device to dce-linux-device

- dce-os-device.h header is specific to OS and is only intended
  to be internally used within OS. Similarly all it's exposed
  functions are OS specific only.

- Therefore instead of having a common name for all OSs for this
  header file, make this header internal by including linux
  name to it's naming convention.

- Similary rename dce_os_device struct to dce_linux_device and
  also rename corresponding functions from this header.

JIRA TDS-16126

Change-Id: I74e2deb17f49065d242bd80d50c5a849b3dfa3a1
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3256403
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
71f130a999 DCE-KMD: Address admin buffer sync access issue
- I2b8a24f9044bc08e10e5ff8cbf0c3f51fa53ff53 change introduced
  an issue of concurrent accesses of admin message buffer
  by different admin channel clients.

- This change will fix this issue by adding set of buffers per admin
  channel client.

- When a admin channel client wants to use a buffer it will
  have to request using it's client ID.
  Buffer will be granted only if at least one buffer for that client
  is not in use.

- Admin channel clients must release the buffer once done with the
  usage so that it's available for other accesses by the same client.

- Do we need a mutex to protect this array?
    1) There's no issue if different clients are trying to get/put
       buffers concurrently since each query will operate on
       separate per client array.
    2) We've an assumption that none of the clients will be active
       during init. This is also documented as part of function
       documentation.
    3) Will we ever have a usecase where a same client does
       get/put concurrently?
    4) Is it possible for a client to be active during de-init?

- If answer to 3 or 4 is yes then we still need a mutex to protect
  the buffers.
    - Currently we've assumed that there woudn't be concurrent
      operations during init/deinit and on same client so
      we're not introducing any mutex.

JIRA TDS-16126

Change-Id: I2ab640dc7c8ee6dedc9179dbb726368c3cb7d65f
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3249307
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
0becc78306 DCE-KMD: Add helper macro to check non NULL
- This is a follow-up CL to address a comment in
  I885348a09eaac6e4362c89b59880fbd32d77d3b5

- This change will add a  helper macro, DCE_WARN_ON_NOT_NULL(x),
  to print a warning message if the input param is not NULL.
    - Added to dce.h

JIRA TDS-16126

Change-Id: I9b2c4ea89fa1682d18c20f68b14ab7696917f261
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3251828
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
46895eb9cd DCE-KMD: Make certain util functions static
- This is a follow-up CL to address comment from
  I42bfe95aa81823dc077ae0964eb6288a1f25fc17

- Certain utils functions are used in single files so make
  them static and move to files in which they are used.

- Rename these from dce_os*() to dce_().

- Delete dce_get_fw_phy_addr() as it's unused.

JIRA TDS-16126

Change-Id: I6049ae1d381ac9c18acbcd3b2584d4d8ab3f2dc0
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3248435
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
7813dddaff DCE-KMD: FSM: Rename init/deinit functions
- This is a follow-up CL to address comments for
  I19e10bb890a4ab6d011df4380ab3a6d5fe92c696

- Rename init/deinit functions to indicate that they are not
  thread safe.

- Also add this note to function documentations.

JIRA TDS-16126

Change-Id: Ic9d1e19a28ef940cb7fbcdc9c923fb61446e0463
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3248426
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
48cb79c312 DCE-KMD: Rename dce-worker.c/.h
- dce-worker.c has os specific implementations.

- Therefore rename it to dce-os-worker.c/.h.

- Also rename functions accordingly.

JIRA TDS-16126

Change-Id: I8e1301659c65cca7c3735f4af1f1a7039409cbbe
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233180
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
7970c223dc DCE-KMD: OS abstraction renaming
- Rename following functions from dce-os-utils.c from
  dce_*() to dce_os_*()
    dce_get_phys_stream_id
    dce_get_dce_stream_id
    dce_get_fw_vm_index
    dce_get_fw_carveout_id
    dce_is_physical_id_valid
    dce_get_fw_dce_addr
    dce_get_fw_phy_addr
    dce_get_fw_name
    dce_thread*
    dce_ipc_init_region_info
    dce_ipc_de_init_region_info

- Move include/dce-thread.h to
  os/linux/include/dce-os-thread.h

JIRA TDS-16126

Change-Id: I42bfe95aa81823dc077ae0964eb6288a1f25fc17
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233170
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
cd31698771 DCE-KMD: dce-ipc.c: Abstract out iosys
- Abstract out iosys_* dependencies for writing/reading to/from
  message header and memcpy to os specific implementation.
    - Add new dce-os-ipc.c

- Cannot add these functions to existing 'dce-os-ivc.h' as
  static inline functions because these functions access
  dce_ipc_channel defined in dce_ipc.h.
    - Cannot include dce_ipc.h to this file as it creates
      a circular dependency.

- Also fix exsisting issue of not defining 'tegra_dce' inside
  dce-ipc.h
    - This is exposed now because we're including dce-ipc.h to
      dce-os-ipc.c which doesn't include any prior headers which
      define tegra_dce.
    - Fix by doing forward define to avoid circular dependency
      with dce.h

- Additionally fix below iosys issues:
1) Change Iabebef33719c38a8aa4db8573a0dd7dd7e5f83f6 introduced
   an issue because NV_TEGRA_IVC_STRUCT_HAS_IOSYS_MAP demands
   different prototypes for below functions:
     - dce_os_ivc_get_next_write_frame()
     - dce_os_ivc_get_next_read_frame()

2) Now since dce_ipc_is_data_available() uses
   dce_os_ivc_get_next_read_frame(), it needs to define
   frame with iosys_map for IOSYS Linux 6.2 usecase. So need
   to creata a OS abstraction for this too.

JIRA TDS-16126

Change-Id: I55594d8e34c3b572129119d1f7240cde76cf37bd
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233117
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
7b46601f2e DCE-KMD: Update DCE OS abstraction - Part 7
Module covered: dce-trace

This is not a functional change. It does the following:
1) Add new os/linux/include/dce-os-trace.h to abstract
   trace event functionality. Define static inline
   wrappers dce_os_trace_*() to corresponding existing
   trace_*() functions.

2) Remove intermediate os header os/include/os-dce-events.h
   and replace all includes directly with <dce-os-trace.h>`

JIRA TDS-16126

Change-Id: I800be4a2b9b51214af4c2531e34dbdd41caccaea
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3229379
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
c0e60a639a DCE-KMD: Update DCE OS abstraction - Part 6
Module covered: dce-workqueue

This is not a functional change. It does the following:
1) Move include/dce-workqueue.h to
   os/linux/include/dce-os-work.h

2) s/dce_work/dce_os_work/g

3) s/dce_init_work/dce_os_work_init/g

4) s/dce_schedule_work/dce_os_work_schedule/g

5) Remove intermediate os header os/include/os-dce-workqueue.h
   and replace all includes directly with <dce-os-work.h>

JIRA TDS-16126

Change-Id: I4d88cf68a187a061fd0c8c084ea074fb9e74d315
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3228552
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
9f31ca7c42 DCE-KMD: Update DCE OS abstraction - Part 5
Modules covered in this CL: dce-os-ivc

This is not a functional CL. It does the following:
1) Move os/include/linux-kmd/os-ivc.h to
   os/linux/include/dce-os-ivc.h

2) s/os_ivc/dce_os_ivc/g

3) Delete old intermediate header os/include/os-ivc.h and include
   <dce-os-ivc.h> directly.

JIRA TDS-16126

Change-Id: Ib6264a39910dbb4a107fd2261005c5e593b4b9b7
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3228545
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
2025-07-24 10:19:12 +00:00