You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
ALSA: pcm: add support get audio boot time during suspend on Rockchip platform with NO_GKI
Some products need to ensure that their audio PTS are correct after waking up from sleep, and need to use the boottime interface to maintain normal time counting during sleep. Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> Change-Id: I92a91e27ab9dee2787efb1a1119f070e51d9473a
This commit is contained in:
@@ -1253,6 +1253,11 @@ static inline void snd_pcm_gettime(struct snd_pcm_runtime *runtime,
|
||||
case SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW:
|
||||
ktime_get_raw_ts64(tv);
|
||||
break;
|
||||
#if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI)
|
||||
case SNDRV_PCM_TSTAMP_TYPE_BOOTTIME:
|
||||
ktime_get_boottime_ts64(tv);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
ktime_get_real_ts64(tv);
|
||||
break;
|
||||
|
||||
@@ -606,7 +606,12 @@ enum {
|
||||
SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */
|
||||
SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */
|
||||
SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW, /* monotonic_raw (no NTP) */
|
||||
#if defined(__KERNEL__) && defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI)
|
||||
SNDRV_PCM_TSTAMP_TYPE_BOOTTIME, /* boot time during suspend */
|
||||
SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_BOOTTIME,
|
||||
#else
|
||||
SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
|
||||
#endif
|
||||
};
|
||||
|
||||
/* channel positions */
|
||||
|
||||
Reference in New Issue
Block a user