Commit Graph

5 Commits

Author SHA1 Message Date
Jon Hunter
f521823831 thermal: tegra-oc-event: Fix build for Linux v6.13
When compiling the tegra-oc-event driver with Linux v6.13 the build
fails with the following error:

 drivers/thermal/tegra234-oc-event.c:127:48: error: missing braces around
  initialiser [-Werror=missing-braces]
  127 | static const struct attribute_group oc1_data = {
      |                                                ^

The 'NULL' initialiser is not needed in the above structure because it
is not any array. Fix the build for Linux v6.13 by removing the NULL
initialisers from the appropriate structure declarations.

Bug 4991705

Change-Id: I2ddb99a316aa0124e9a4c1850ba1ea87d16abcbc
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261689
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Yi-Wei Wang <yiweiw@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:11 +00:00
Jon Hunter
f01227d4ea drivers: Drop inline from driver remove wrapper
The driver remove function is a function pointer and therefore, it does
not make sense to define the function as an 'inline'. Update the
coccinelle script and drivers to remove the inline statement.

Bug 4749580

Change-Id: Ia03691b75c4edffe609f27468b911a92a5ddbd68
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233980
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:08 +00:00
Jon Hunter
951b2423a8 drivers: Fix platform_driver remove for Linux v6.11
In Linux v6.11, the 'platform_driver' structure 'remove' callback was
updated to return void instead of 'int'. Update all the impacted drivers
as necessary to fix this.

Bug 4749580

Change-Id: I3bb5c549777f7ccad0e3f870373fdd25726ad7ed
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3182878
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-08-11 17:20:34 -07:00
Jon Hunter
6fa354a3b2 thermal: tegra-oc-event: Fix warning
Building the tegra-oc-event driver generates the following warning ...

 drivers/thermal/tegra234-oc-event.c:180:31: warning: assignment discards
 ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   180 |         tegra234_oc->soc_data = match->data;                                                                                                                                                                                                |                               ^

Fix this by correcting the type for the soc_data structure member.

Bug 4190030

Change-Id: I8879186dfbf247eea57266281f489d57c9675292
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2934695
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Yi-Wei Wang <yiweiw@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-12 19:11:48 -07:00
Yi-Wei Wang
b270392b4f drivers: thermal: Add Tegra234 OC event driver
SOC_THERM is the primary hardware component of Tegra on-die thermal
management strategies. SOC_THERM includes the function of
externally-signaled event detection (SOC_THERM_edp) which centralizes
a few mechanisms for detecting and responding to externally signaled
electrical events, such as overcurrent events, undervoltage events, and
so on. These are known as "OC alarms" because they often indicate an
overcurrent event.

The Jetson Module's on-board power monitor INA3221 is configured to
trigger CPU/GPU hardware clock throttling via Tegra234 SOCTHERM_OC when
the Module input current exceeds the preprogrammed overcurrent threshold
to keep Module power consumption within the TDP power budget.

CPU/GPU performance may drop when hardware clock throttling occurs.
To allow the user to infer whether the performance degradation is
related to the overcurrent event, the Tegra234 OC event driver is
implemented which sends a Message ReQuest (MRQ) to the BPMP firmware to
provide information regarding the overcurrent enable state and the event
count to userspace via the hwmon sysfs interface.

Bug 3571683

Signed-off-by: Yi-Wei Wang <yiweiw@nvidia.com>
Change-Id: I6cc3579944efc92916189f097ccfed2ccba26051
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2862007
Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-17 07:03:26 -07:00