In Linux v6.16, commit 41cb08555c41 ("treewide, timers: Rename
from_timer() to timer_container_of()") renamed 'from_timer()' to
'timer_container_of()'. Given that this is a macro we can simplfy see if
the macro 'timer_container_of' is defined and if so use this otherwise
fall back to 'from_timer()'. Update the necessary drivers to fix the
build for Linux v6.16.
JIRA LINQPJ14-60
Change-Id: I7f622b5d046a92da2ade755e6a697c1810f61275
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3383387
(cherry picked from commit 320ec84efd492c0c2711c69104fabc30b4f15ecb)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461850
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
cleanup & modularize driver code structure to separate
out HW dependent & independent parts to facilitate adding
support for new SoCs
This patch
- restructure SoC specific code into separate files
- Add function pointers to call HW specific sequences
- adds a common header which is needed by all platforms
- cleans up obsolete code such as memmap of phc regs,
xavier support, etc
- Removes default value assumption for lock_threshold,
pps_freq, sync_trig_interval
Bug 5175333
Change-Id: I106e130fdaa1a166a4a2c9bbaeb3b924af90ab66
Signed-off-by: Sheetal Tigadoli <stigadoli@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3321185
Reviewed-by: Kiran Kumar Bobbu <kbobbu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Add support to select initial operating mode (GPIO or TIMER)
through DT property "nvpps-event-mode-init".
This allows users to specify which mode the driver should
start in rather than always defaulting to GPIO mode if gpios
property is specified in DT.
Key changes:
- Add DT property parsing for initial event mode
- Add validation to ensure selected mode is supported
- If this property is not specified, default mode selection
happens based on if nvpps-gpios property is defined or not
- Add informative debug messages about selected mode
- Add error handling for invalid configurations(eg: init
mode is GPIO but gpios property is not defined). If
validation fails, probe returns error instead of
defaulting to TIMER mode.
bug 5253938
Change-Id: I64c2a6565eeb46d6b07cf266cd4189fba9f0fba3
Signed-off-by: Sheetal Tigadoli <stigadoli@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3352704
(cherry picked from commit 091bb3ff50972e8dc3d7b941d850b4c1457b2a9e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3361726
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Add support for configurable timestamp capture interval
through device tree property 'ts-capture-interval'.
This allows users to tune how frequently timestamps are
to be captured in TIMER mode.
- Add support for device tree property 'ts-capture-interval' (in ms)
- Defaults to 1000ms if property not specified
- Validate interval is within allowed range (100ms - 1000ms)
- Update timer configuration to use configurable capture interval
Bug 5242056
Change-Id: I4a327558576a86650890be4ae7e1ccfa5abe3c1d
Signed-off-by: Sheetal Tigadoli <stigadoli@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3348872
(cherry picked from commit 1317865f5dc042348e1e39b2aa54a7bb6aa1ffdb)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3361722
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
In Linux v6.15, the timer APIs hrtimer_init() and del_timer() have been
removed. The hrtimer_setup() was added in Linux v6.13 to replace
hrtimer_init() and hrtimer_init() have finally been removed. The
functions del_timer()/del_timer_sync() were renamed to
timer_delete()/timer_delete_sync() in Linux v6.15. Use conftest to
detect these changes and update the drivers as necessary.
JIRA LINQPJ14-47
Change-Id: Id3994900384aad4b91155507cda91e04898ab12c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3336168
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
- use TSC lock trigger interval param from dt to optimize
As per HW suggestion we should not trigger sync on every
PPS edge. TSC needs atleast 2 PPS edges to align with the
PTP clock.
- save platform specific register offset during drv init time
instead of checking plat id everytime in monitoring thread
Bug 5042311
Bug 4899241
Bug 5082436
Signed-off-by: Sheetal Tigadoli <stigadoli@nvidia.com>
Change-Id: I22befbc2a52c22ace1a8573b9a34a544ed1ae8f9
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3294329
(cherry picked from commit 209dc26eddd2cd5e9d88ea8c6eb603706cd3c3f0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3292322
Reviewed-by: Amlan Kundu <akundu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
- support use of higher PPS freq in nvpps. The freq value
is read from primary mac interface's "nvidia,pps_op_ctrl"
field and vetted for valid values(0,1,2,4,5 & 8).
- To use higher PPS freq, nvpps needs to update K_INT and
REF_FREQ.INC value and also increase the freq of monitoring
thread.
Bug 5042311
Bug 4899241
Signed-off-by: Sheetal Tigadoli <stigadoli@nvidia.com>
Change-Id: I87e9be5a0ba2156054aea380c730b087d274c223
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3286820
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Vijay Mishra <vijaym@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
In Linux v6.4, the module pointer argument is removed from the
class_create() function. Add a test to the conftest script that checks
if this argument for the class_create() function has been removed and
use the definition created by conftest to select which version of the
function is used.
Bug 4183168
Bug 4221847
Change-Id: I440e4b318001886cd0319bb3499ba33178475e8c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989020
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
The function of_get_named_gpio() was first added for Linux v3.1 and is
still supported for in the latest mainline kernel. Therefore, always use
of_get_named_gpio() and avoid the unnecessary kernel version check.
Bug 4119327
Change-Id: I95e2458fdf00404bf91aa3e31e33dd2911377f48
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2979476
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Remove the module pointer from the class_create() based
on following change in core kernel
======
driver core: class: remove module * from class_create()
The module pointer in class_create() never actually did anything, and it
shouldn't have been requred to be set as a parameter even if it did
something. So just remove it and fix up all callers of the function in
the kernel tree at the same time.
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
=====
Bug 4276500
Change-Id: Ifa0a92a282151ce12dc4a48f4f4b5b9499d3fbd8
Signed-off-by: Shardar Mohammed <smohammed@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2976600
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>