Commit graph

6 commits

Author SHA1 Message Date
Linus Torvalds
c528943593 hte: Changes for v6.7-rc1
The changes for the hte/timestamp subsystem include the following:
 - Improve comments in the translate function
 - Reflect the GPIOLIB API changes during calculation of the GPIO base
 - Improve error handling in Tegra test and provider drivers
 - Improve code to set the line name
 -----BEGIN PGP SIGNATURE-----
 
 iIgEABYIADAWIQT4slW2T0Q/rXAa29f4pUxhzZTZKAUCZTwqPxIcZGlwZW5wQG52
 aWRpYS5jb20ACgkQ+KVMYc2U2SjMGgD/R7vxDtV3Ik+YyYnjGmMPOoB1foNy+XKr
 dJUY/SWKoHwBAOUuDPrj/Mg6aaIst5nZcEOyveWmKck0wb0LRsC9TcsL
 =/8rI
 -----END PGP SIGNATURE-----

Merge tag 'for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pateldipen1984/linux

Pull hte/timestamp updates from Dipen Patel:

 - Improve comments in the translate function

 - Reflect the GPIOLIB API changes during calculation of the GPIO base

 - Improve error handling in Tegra test and provider drivers

 - Improve code to set the line name

* tag 'for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pateldipen1984/linux:
  hte: Use kasprintf() instead of fixed buffer formatting
  hte: tegra: Fix missing error code in tegra_hte_test_probe()
  hte: tegra194: Switch to LATE_SIMPLE_DEV_PM_OPS()
  hte: tegra194: Remove redundant dev_err()
  hte: tegra194: improve the GPIO-related comment
  hte: allow building modules with COMPILE_TEST enabled
  hte: Annotate struct hte_device with __counted_by
2023-10-31 18:32:51 -10:00
Arnd Bergmann
9bc633117d hte: tegra194: add GPIOLIB dependency
The driver started calling into a few interfaces that are part of GPIOLIB and
don't have stub implementations otherwise:

drivers/hte/hte-tegra194.c: In function 'tegra_hte_line_xlate':
drivers/hte/hte-tegra194.c:424:48: error: implicit declaration of function 'gpio_device_get_base'; did you mean 'gpio_device_get_desc'? [-Werror=implicit-function-declaration]
  424 |                 line_id = desc->attr.line_id - gpio_device_get_base(gs->gdev);
      |                                                ^~~~~~~~~~~~~~~~~~~~
      |                                                gpio_device_get_desc

Add a Kconfig dependency to only allow building when this is defined.

Fixes: dc850faa28 ("hte: tegra194: don't access struct gpio_chip")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Dipen Patel <dipenp@nvidia.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2023-10-23 20:07:36 +02:00
Bartosz Golaszewski
63137bee5a hte: allow building modules with COMPILE_TEST enabled
Allow building all HTE modules with COMPILE_TEST Kconfig option enabled.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Dipen Patel <dipenp@nvidia.com>
Signed-off-by: Dipen Patel <dipenp@nvidia.com>
2023-10-03 13:19:58 -07:00
Dipen Patel
9a75a7cd03 hte: Add Tegra HTE test driver
The test driver uses IRQ and GPIO lines to timestamp using HTE
subsystem. The patch also adds compilation support in Kconfig and
Makefile.

Signed-off-by: Dipen Patel <dipenp@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2022-05-04 11:06:14 +02:00
Dipen Patel
09574cca6a hte: Add Tegra194 HTE kernel provider
Tegra194 device has multiple HTE instances also known as GTE (Generic
Hardware Timestamping Engine) which can timestamp subset of SoC lines
and signals. This provider driver focuses on IRQ and GPIO lines and
exposes timestamping ability on those lines to the consumers through
HTE subsystem.

Also, with this patch, added:
- documentation about this provider and its capabilities at
Documentation/hte.
- Compilation support in Makefile and Kconfig

Signed-off-by: Dipen Patel <dipenp@nvidia.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2022-05-04 11:06:13 +02:00
Dipen Patel
31ab09b421 drivers: Add hardware timestamp engine (HTE) subsystem
Some devices can timestamp system lines/signals/Buses in real-time
using the hardware counter or other hardware means which can give
finer granularity and help avoid jitter introduced by software
timestamping. To utilize such functionality, this patchset creates
HTE subsystem where devices can register themselves as providers so
that the consumers devices can request specific line from the
providers. The patch also adds compilation support in Makefile and
menu options in Kconfig.

The provider does following:
- Registers chip with the framework.
- Provides translation hook to convert logical line id.
- Provides enable/disable, request/release callbacks.
- Pushes timestamp data to HTE subsystem.

The consumer does following:
- Initializes line attribute.
- Gets HTE timestamp descriptor.
- Requests timestamp functionality.
- Puts HTE timestamp descriptor.

Signed-off-by: Dipen Patel <dipenp@nvidia.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2022-05-04 11:05:54 +02:00