diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-07-27 11:31:33 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-07-27 11:31:33 +0200 |
commit | 3bc8238588d85101a85c626747fedd7fdc56be53 (patch) | |
tree | 3f4efff8dfe61b6384814e89bb2677f3f62efed6 | |
parent | 5c55535e4918745341656cabe25de757cf2e7b7c (diff) | |
download | alsa-driver-build-unstable-3bc8238588d85101a85c626747fedd7fdc56be53.tar.gz |
Fix build breakage of drivers/pcsp/pcsp.c
hrtimer_resolution was introduced recently in 4.2. Add a workaround
code to fix with the older kernels.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | alsa/drivers/pcsp/pcsp.patch | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/alsa/drivers/pcsp/pcsp.patch b/alsa/drivers/pcsp/pcsp.patch index c4ba65376..d3649b4ad 100644 --- a/alsa/drivers/pcsp/pcsp.patch +++ b/alsa/drivers/pcsp/pcsp.patch @@ -1,11 +1,29 @@ ---- ../../alsa-kernel/drivers/pcsp/pcsp.c 2014-02-24 17:09:07.852752039 +0100 -+++ pcsp.c 2014-02-27 09:40:12.222685368 +0100 +--- ../../alsa-kernel/drivers/pcsp/pcsp.c 2015-07-24 20:09:03.433652027 +0200 ++++ pcsp.c 2015-07-27 11:30:20.121244088 +0200 @@ -1,3 +1,4 @@ +#include "adriver.h" /* * PC-Speaker driver for Linux * -@@ -103,6 +104,9 @@ +@@ -42,8 +43,17 @@ + static int snd_pcsp_create(struct snd_card *card) + { + static struct snd_device_ops ops = { }; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) + unsigned int resolution = hrtimer_resolution; ++#else ++ unsigned int resolution; ++#endif + int err, div, min_div, order; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) ++ struct timespec tp; ++ hrtimer_get_res(CLOCK_MONOTONIC, &tp); ++ resolution = tp.tv_nsec; ++#endif + + if (!nopcm) { + if (resolution > PCSP_MAX_PERIOD_NS) { +@@ -100,6 +110,9 @@ return -EINVAL; hrtimer_init(&pcsp_chip.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); |