nuttx/drivers/timers
dongjiuzhu1 314cccf166 drivers/timers/ptp: support ptp clock dummy driver
This patch adds a dummy PTP clock driver implementation that provides
a software-based PTP clock for testing and development purposes.

Key changes include:

1. Dummy PTP clock driver implementation:
   - Added drivers/timers/ptp_clock_dummy.c
   - Provides software-based PTP clock using system monotonic clock
   - Implements all required lower-half driver operations

2. Lower-half driver operations:
   - adjfine: Frequency adjustment (stores adjustment value)
   - adjtime: Time offset adjustment (applies delta to base time)
   - gettime: Returns current PTP clock time
   - settime: Sets PTP clock time
   - getcaps: Reports clock capabilities (1 billion PPB max adjustment)
   - getcrosststamp: Provides system/device cross-timestamp

3. Driver initialization:
   - Added ptp_clock_dummy_init() in drivers/drivers_initialize.c
   - Auto-registration under CONFIG_PTP_CLOCK_DUMMY configuration
   - Creates /dev/ptp0 character device node

4. Build system integration:
   - Added CONFIG_PTP_CLOCK_DUMMY Kconfig option (depends on PTP_CLOCK)
   - Updated CMakeLists.txt and Make.defs
   - Added include/nuttx/timers/ptp_clock_dummy.h header

5. Implementation details:
   - Uses clock_gettime(CLOCK_MONOTONIC) as time base
   - Tracks time offset and frequency adjustment internally
   - Suitable for testing PTP clock applications without hardware

This dummy driver enables development and testing of PTP clock applications
on platforms without dedicated PTP hardware support.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 10:22:09 -03:00
..
arch_alarm.c sched: Simplify the timer_start/cancel in sched_timerexpiration. 2025-12-26 11:51:38 +08:00
arch_rtc.c rtc_time:set zero rtc_time struct 2025-12-19 01:58:44 +01:00
arch_timer.c arch: Flag all definitions of up_perf_* functions with CONFIG_ARCH_HAVE_PERF_EVENTS 2025-06-06 17:31:10 +08:00
capture.c Update capture.c 2025-08-12 20:21:14 +08:00
CMakeLists.txt drivers/timers/ptp: support ptp clock dummy driver 2025-12-30 10:22:09 -03:00
cs2100-cp.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
ds3231.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
ds3231.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
goldfish_timer.c driver/timers: Simplify Goldfish timer driver. 2025-11-24 19:43:07 +08:00
Kconfig drivers/timers/ptp: support ptp clock dummy driver 2025-12-30 10:22:09 -03:00
Make.defs drivers/timers/ptp: support ptp clock dummy driver 2025-12-30 10:22:09 -03:00
mcp794xx.c sched/sleep: replace all Signal-based sleep implement to Scheduled sleep 2025-10-17 14:05:02 +08:00
mcp794xx.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
oneshot.c drivers/timers: Fix oneshot callback arg. 2025-11-24 19:43:07 +08:00
pcf85263.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
pcf85263.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
pl031.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
ptp_clock.c drivers/timers/ptp: support ptp clock driver model 2025-12-30 10:22:09 -03:00
ptp_clock_dummy.c drivers/timers/ptp: support ptp clock dummy driver 2025-12-30 10:22:09 -03:00
pwm.c drivers: unify Private Types banners 2025-05-28 10:17:15 +08:00
rpmsg_rtc.c rtc_time:set zero rtc_time struct 2025-12-19 01:58:44 +01:00
rtc.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
rx8010.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
rx8010.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
timer.c drivers: unify Private Types banners 2025-05-28 10:17:15 +08:00
watchdog.c timers/oneshot: Remove all callback and args. 2025-11-18 13:02:29 +01:00