|
@@ -685,9 +685,10 @@ static snd_pcm_uframes_t snd_ice1712_playback_pointer(struct snd_pcm_substream *
|
|
if (!(snd_ice1712_read(ice, ICE1712_IREG_PBK_CTRL) & 1))
|
|
if (!(snd_ice1712_read(ice, ICE1712_IREG_PBK_CTRL) & 1))
|
|
return 0;
|
|
return 0;
|
|
ptr = runtime->buffer_size - inw(ice->ddma_port + 4);
|
|
ptr = runtime->buffer_size - inw(ice->ddma_port + 4);
|
|
|
|
+ ptr = bytes_to_frames(substream->runtime, ptr);
|
|
if (ptr == runtime->buffer_size)
|
|
if (ptr == runtime->buffer_size)
|
|
ptr = 0;
|
|
ptr = 0;
|
|
- return bytes_to_frames(substream->runtime, ptr);
|
|
|
|
|
|
+ return ptr;
|
|
}
|
|
}
|
|
|
|
|
|
static snd_pcm_uframes_t snd_ice1712_playback_ds_pointer(struct snd_pcm_substream *substream)
|
|
static snd_pcm_uframes_t snd_ice1712_playback_ds_pointer(struct snd_pcm_substream *substream)
|
|
@@ -704,9 +705,10 @@ static snd_pcm_uframes_t snd_ice1712_playback_ds_pointer(struct snd_pcm_substrea
|
|
addr = ICE1712_DSC_ADDR0;
|
|
addr = ICE1712_DSC_ADDR0;
|
|
ptr = snd_ice1712_ds_read(ice, substream->number * 2, addr) -
|
|
ptr = snd_ice1712_ds_read(ice, substream->number * 2, addr) -
|
|
ice->playback_con_virt_addr[substream->number];
|
|
ice->playback_con_virt_addr[substream->number];
|
|
|
|
+ ptr = bytes_to_frames(substream->runtime, ptr);
|
|
if (ptr == substream->runtime->buffer_size)
|
|
if (ptr == substream->runtime->buffer_size)
|
|
ptr = 0;
|
|
ptr = 0;
|
|
- return bytes_to_frames(substream->runtime, ptr);
|
|
|
|
|
|
+ return ptr;
|
|
}
|
|
}
|
|
|
|
|
|
static snd_pcm_uframes_t snd_ice1712_capture_pointer(struct snd_pcm_substream *substream)
|
|
static snd_pcm_uframes_t snd_ice1712_capture_pointer(struct snd_pcm_substream *substream)
|
|
@@ -717,9 +719,10 @@ static snd_pcm_uframes_t snd_ice1712_capture_pointer(struct snd_pcm_substream *s
|
|
if (!(snd_ice1712_read(ice, ICE1712_IREG_CAP_CTRL) & 1))
|
|
if (!(snd_ice1712_read(ice, ICE1712_IREG_CAP_CTRL) & 1))
|
|
return 0;
|
|
return 0;
|
|
ptr = inl(ICEREG(ice, CONCAP_ADDR)) - ice->capture_con_virt_addr;
|
|
ptr = inl(ICEREG(ice, CONCAP_ADDR)) - ice->capture_con_virt_addr;
|
|
|
|
+ ptr = bytes_to_frames(substream->runtime, ptr);
|
|
if (ptr == substream->runtime->buffer_size)
|
|
if (ptr == substream->runtime->buffer_size)
|
|
ptr = 0;
|
|
ptr = 0;
|
|
- return bytes_to_frames(substream->runtime, ptr);
|
|
|
|
|
|
+ return ptr;
|
|
}
|
|
}
|
|
|
|
|
|
static const struct snd_pcm_hardware snd_ice1712_playback = {
|
|
static const struct snd_pcm_hardware snd_ice1712_playback = {
|
|
@@ -1116,9 +1119,10 @@ static snd_pcm_uframes_t snd_ice1712_playback_pro_pointer(struct snd_pcm_substre
|
|
if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_PLAYBACK_START))
|
|
if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_PLAYBACK_START))
|
|
return 0;
|
|
return 0;
|
|
ptr = ice->playback_pro_size - (inw(ICEMT(ice, PLAYBACK_SIZE)) << 2);
|
|
ptr = ice->playback_pro_size - (inw(ICEMT(ice, PLAYBACK_SIZE)) << 2);
|
|
|
|
+ ptr = bytes_to_frames(substream->runtime, ptr);
|
|
if (ptr == substream->runtime->buffer_size)
|
|
if (ptr == substream->runtime->buffer_size)
|
|
ptr = 0;
|
|
ptr = 0;
|
|
- return bytes_to_frames(substream->runtime, ptr);
|
|
|
|
|
|
+ return ptr;
|
|
}
|
|
}
|
|
|
|
|
|
static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(struct snd_pcm_substream *substream)
|
|
static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(struct snd_pcm_substream *substream)
|
|
@@ -1129,9 +1133,10 @@ static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(struct snd_pcm_substrea
|
|
if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_CAPTURE_START_SHADOW))
|
|
if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_CAPTURE_START_SHADOW))
|
|
return 0;
|
|
return 0;
|
|
ptr = ice->capture_pro_size - (inw(ICEMT(ice, CAPTURE_SIZE)) << 2);
|
|
ptr = ice->capture_pro_size - (inw(ICEMT(ice, CAPTURE_SIZE)) << 2);
|
|
|
|
+ ptr = bytes_to_frames(substream->runtime, ptr);
|
|
if (ptr == substream->runtime->buffer_size)
|
|
if (ptr == substream->runtime->buffer_size)
|
|
ptr = 0;
|
|
ptr = 0;
|
|
- return bytes_to_frames(substream->runtime, ptr);
|
|
|
|
|
|
+ return ptr;
|
|
}
|
|
}
|
|
|
|
|
|
static const struct snd_pcm_hardware snd_ice1712_playback_pro = {
|
|
static const struct snd_pcm_hardware snd_ice1712_playback_pro = {
|