diff options
Diffstat (limited to 'sound/pci/rme9652')
-rw-r--r-- | sound/pci/rme9652/hdsp.c | 11 | ||||
-rw-r--r-- | sound/pci/rme9652/hdspm.c | 4 |
2 files changed, 7 insertions, 8 deletions
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index 314e73531bd1..3da5c029f93b 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/pci.h> | 28 | #include <linux/pci.h> |
29 | #include <linux/firmware.h> | 29 | #include <linux/firmware.h> |
30 | #include <linux/moduleparam.h> | 30 | #include <linux/moduleparam.h> |
31 | #include <linux/math64.h> | ||
31 | 32 | ||
32 | #include <sound/core.h> | 33 | #include <sound/core.h> |
33 | #include <sound/control.h> | 34 | #include <sound/control.h> |
@@ -402,9 +403,9 @@ MODULE_FIRMWARE("digiface_firmware_rev11.bin"); | |||
402 | #define HDSP_DMA_AREA_BYTES ((HDSP_MAX_CHANNELS+1) * HDSP_CHANNEL_BUFFER_BYTES) | 403 | #define HDSP_DMA_AREA_BYTES ((HDSP_MAX_CHANNELS+1) * HDSP_CHANNEL_BUFFER_BYTES) |
403 | #define HDSP_DMA_AREA_KILOBYTES (HDSP_DMA_AREA_BYTES/1024) | 404 | #define HDSP_DMA_AREA_KILOBYTES (HDSP_DMA_AREA_BYTES/1024) |
404 | 405 | ||
405 | /* use hotplug firmeare loader? */ | 406 | /* use hotplug firmware loader? */ |
406 | #if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE) | 407 | #if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE) |
407 | #if !defined(HDSP_USE_HWDEP_LOADER) && !defined(CONFIG_SND_HDSP) | 408 | #if !defined(HDSP_USE_HWDEP_LOADER) |
408 | #define HDSP_FW_LOADER | 409 | #define HDSP_FW_LOADER |
409 | #endif | 410 | #endif |
410 | #endif | 411 | #endif |
@@ -1047,7 +1048,6 @@ static int hdsp_set_interrupt_interval(struct hdsp *s, unsigned int frames) | |||
1047 | static void hdsp_set_dds_value(struct hdsp *hdsp, int rate) | 1048 | static void hdsp_set_dds_value(struct hdsp *hdsp, int rate) |
1048 | { | 1049 | { |
1049 | u64 n; | 1050 | u64 n; |
1050 | u32 r; | ||
1051 | 1051 | ||
1052 | if (rate >= 112000) | 1052 | if (rate >= 112000) |
1053 | rate /= 4; | 1053 | rate /= 4; |
@@ -1055,7 +1055,7 @@ static void hdsp_set_dds_value(struct hdsp *hdsp, int rate) | |||
1055 | rate /= 2; | 1055 | rate /= 2; |
1056 | 1056 | ||
1057 | n = DDS_NUMERATOR; | 1057 | n = DDS_NUMERATOR; |
1058 | div64_32(&n, rate, &r); | 1058 | n = div_u64(n, rate); |
1059 | /* n should be less than 2^32 for being written to FREQ register */ | 1059 | /* n should be less than 2^32 for being written to FREQ register */ |
1060 | snd_BUG_ON(n >> 32); | 1060 | snd_BUG_ON(n >> 32); |
1061 | /* HDSP_freqReg and HDSP_resetPointer are the same, so keep the DDS | 1061 | /* HDSP_freqReg and HDSP_resetPointer are the same, so keep the DDS |
@@ -3097,7 +3097,6 @@ static int snd_hdsp_get_adat_sync_check(struct snd_kcontrol *kcontrol, struct sn | |||
3097 | static int hdsp_dds_offset(struct hdsp *hdsp) | 3097 | static int hdsp_dds_offset(struct hdsp *hdsp) |
3098 | { | 3098 | { |
3099 | u64 n; | 3099 | u64 n; |
3100 | u32 r; | ||
3101 | unsigned int dds_value = hdsp->dds_value; | 3100 | unsigned int dds_value = hdsp->dds_value; |
3102 | int system_sample_rate = hdsp->system_sample_rate; | 3101 | int system_sample_rate = hdsp->system_sample_rate; |
3103 | 3102 | ||
@@ -3109,7 +3108,7 @@ static int hdsp_dds_offset(struct hdsp *hdsp) | |||
3109 | * dds_value = n / rate | 3108 | * dds_value = n / rate |
3110 | * rate = n / dds_value | 3109 | * rate = n / dds_value |
3111 | */ | 3110 | */ |
3112 | div64_32(&n, dds_value, &r); | 3111 | n = div_u64(n, dds_value); |
3113 | if (system_sample_rate >= 112000) | 3112 | if (system_sample_rate >= 112000) |
3114 | n *= 4; | 3113 | n *= 4; |
3115 | else if (system_sample_rate >= 56000) | 3114 | else if (system_sample_rate >= 56000) |
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index bac2dc0c5d85..0dce331a2a3b 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/moduleparam.h> | 29 | #include <linux/moduleparam.h> |
30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
31 | #include <linux/pci.h> | 31 | #include <linux/pci.h> |
32 | #include <linux/math64.h> | ||
32 | #include <asm/io.h> | 33 | #include <asm/io.h> |
33 | 34 | ||
34 | #include <sound/core.h> | 35 | #include <sound/core.h> |
@@ -831,7 +832,6 @@ static int hdspm_set_interrupt_interval(struct hdspm * s, unsigned int frames) | |||
831 | static void hdspm_set_dds_value(struct hdspm *hdspm, int rate) | 832 | static void hdspm_set_dds_value(struct hdspm *hdspm, int rate) |
832 | { | 833 | { |
833 | u64 n; | 834 | u64 n; |
834 | u32 r; | ||
835 | 835 | ||
836 | if (rate >= 112000) | 836 | if (rate >= 112000) |
837 | rate /= 4; | 837 | rate /= 4; |
@@ -844,7 +844,7 @@ static void hdspm_set_dds_value(struct hdspm *hdspm, int rate) | |||
844 | */ | 844 | */ |
845 | /* n = 104857600000000ULL; */ /* = 2^20 * 10^8 */ | 845 | /* n = 104857600000000ULL; */ /* = 2^20 * 10^8 */ |
846 | n = 110100480000000ULL; /* Value checked for AES32 and MADI */ | 846 | n = 110100480000000ULL; /* Value checked for AES32 and MADI */ |
847 | div64_32(&n, rate, &r); | 847 | n = div_u64(n, rate); |
848 | /* n should be less than 2^32 for being written to FREQ register */ | 848 | /* n should be less than 2^32 for being written to FREQ register */ |
849 | snd_BUG_ON(n >> 32); | 849 | snd_BUG_ON(n >> 32); |
850 | hdspm_write(hdspm, HDSPM_freqReg, (u32)n); | 850 | hdspm_write(hdspm, HDSPM_freqReg, (u32)n); |