|
@@ -28,6 +28,7 @@
|
|
#include <linux/pci.h>
|
|
#include <linux/pci.h>
|
|
#include <linux/firmware.h>
|
|
#include <linux/firmware.h>
|
|
#include <linux/moduleparam.h>
|
|
#include <linux/moduleparam.h>
|
|
|
|
+#include <linux/math64.h>
|
|
|
|
|
|
#include <sound/core.h>
|
|
#include <sound/core.h>
|
|
#include <sound/control.h>
|
|
#include <sound/control.h>
|
|
@@ -1047,7 +1048,6 @@ static int hdsp_set_interrupt_interval(struct hdsp *s, unsigned int frames)
|
|
static void hdsp_set_dds_value(struct hdsp *hdsp, int rate)
|
|
static void hdsp_set_dds_value(struct hdsp *hdsp, int rate)
|
|
{
|
|
{
|
|
u64 n;
|
|
u64 n;
|
|
- u32 r;
|
|
|
|
|
|
|
|
if (rate >= 112000)
|
|
if (rate >= 112000)
|
|
rate /= 4;
|
|
rate /= 4;
|
|
@@ -1055,7 +1055,7 @@ static void hdsp_set_dds_value(struct hdsp *hdsp, int rate)
|
|
rate /= 2;
|
|
rate /= 2;
|
|
|
|
|
|
n = DDS_NUMERATOR;
|
|
n = DDS_NUMERATOR;
|
|
- div64_32(&n, rate, &r);
|
|
|
|
|
|
+ n = div_u64(n, rate);
|
|
/* n should be less than 2^32 for being written to FREQ register */
|
|
/* n should be less than 2^32 for being written to FREQ register */
|
|
snd_BUG_ON(n >> 32);
|
|
snd_BUG_ON(n >> 32);
|
|
/* HDSP_freqReg and HDSP_resetPointer are the same, so keep the DDS
|
|
/* 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
|
|
static int hdsp_dds_offset(struct hdsp *hdsp)
|
|
static int hdsp_dds_offset(struct hdsp *hdsp)
|
|
{
|
|
{
|
|
u64 n;
|
|
u64 n;
|
|
- u32 r;
|
|
|
|
unsigned int dds_value = hdsp->dds_value;
|
|
unsigned int dds_value = hdsp->dds_value;
|
|
int system_sample_rate = hdsp->system_sample_rate;
|
|
int system_sample_rate = hdsp->system_sample_rate;
|
|
|
|
|
|
@@ -3109,7 +3108,7 @@ static int hdsp_dds_offset(struct hdsp *hdsp)
|
|
* dds_value = n / rate
|
|
* dds_value = n / rate
|
|
* rate = n / dds_value
|
|
* rate = n / dds_value
|
|
*/
|
|
*/
|
|
- div64_32(&n, dds_value, &r);
|
|
|
|
|
|
+ n = div_u64(n, dds_value);
|
|
if (system_sample_rate >= 112000)
|
|
if (system_sample_rate >= 112000)
|
|
n *= 4;
|
|
n *= 4;
|
|
else if (system_sample_rate >= 56000)
|
|
else if (system_sample_rate >= 56000)
|