timecounter: provide a helper function to shift the time.
[cascardo/linux.git] / include / linux / timecounter.h
index 146f07a..af3dfa4 100644 (file)
@@ -78,6 +78,15 @@ static inline u64 cyclecounter_cyc2ns(const struct cyclecounter *cc,
        return ret;
 }
 
+/**
+ * timecounter_adjtime - Shifts the time of the clock.
+ * @delta:     Desired change in nanoseconds.
+ */
+static inline void timecounter_adjtime(struct timecounter *tc, s64 delta)
+{
+       tc->nsec += delta;
+}
+
 /**
  * timecounter_init - initialize a time counter
  * @tc:                        Pointer to time counter which is to be initialized/reset