return aml_chipinfo.audbuf_gate_rm;
}
+#ifdef CONFIG_AMLOGIC_SND_SPLIT_MODE
static bool is_split_fully_support(void)
{
return aml_chipinfo.split_complete;
}
+#endif
static bool is_spdif_pao_support(void)
{
void audio_set_958outbuf(u32 addr, u32 size, int flag)
{
#ifdef CONFIG_AMLOGIC_SND_SPLIT_MODE
- aml_aiu_write(AIU_MEM_IEC958_START_PTR, addr & 0xffffff00);
- aml_aiu_write(AIU_MEM_IEC958_RD_PTR, addr & 0xffffff00);
+ aml_aiu_write(AIU_MEM_IEC958_START_PTR, addr & 0xffffffff);
+ aml_aiu_write(AIU_MEM_IEC958_RD_PTR, addr & 0xffffffff);
#else
aml_aiu_write(AIU_MEM_IEC958_START_PTR, addr & 0xffffffc0);
aml_aiu_write(AIU_MEM_IEC958_RD_PTR, addr & 0xffffffc0);
/* this is for 16bit 2 channel */
#ifdef CONFIG_AMLOGIC_SND_SPLIT_MODE
aml_aiu_write(AIU_MEM_IEC958_END_PTR,
- (addr & 0xffffff00) +
- (size & 0xffffff00) - 256);
+ (addr & 0xffffffff) +
+ (size & 0xffffffff) - 1);
#else
aml_aiu_write(AIU_MEM_IEC958_END_PTR,
(addr & 0xffffffc0) +
/* this is for RAW mode */
#ifdef CONFIG_AMLOGIC_SND_SPLIT_MODE
aml_aiu_write(AIU_MEM_IEC958_END_PTR,
- (addr & 0xffffff00) +
- (size & 0xffffff00) - 256);
+ (addr & 0xffffffff) +
+ (size & 0xffffffff) - 1);
#else
aml_aiu_write(AIU_MEM_IEC958_END_PTR,
(addr & 0xffffffc0) +
struct aml_runtime_data *prtd = runtime->private_data;
struct snd_dma_buffer *buffer = &substream->dma_buffer;
struct aml_audio_buffer *tmp_buf = buffer->private_data;
- void *ubuf = tmp_buf->buffer_start;
struct audio_stream *s = &prtd->s;
struct device *dev = substream->pcm->card->dev;
#ifndef CONFIG_AMLOGIC_SND_SPLIT_MODE
+ void *ubuf = tmp_buf->buffer_start;
int i = 0, j = 0;
int align = runtime->channels * 32;
int cached_len = tmp_buf->cached_len;
char *cache_buffer_bytes = tmp_buf->cache_buffer_bytes;
#endif
-
n = frames_to_bytes(runtime, count);
if (n > tmp_buf->buffer_size) {
dev_err(dev, "FATAL_ERR:UserData/%d > buffer_size/%d\n",
n, tmp_buf->buffer_size);
return -EFAULT;
}
+
+#ifndef CONFIG_AMLOGIC_SND_SPLIT_MODE
res = copy_from_user(ubuf, buf, n);
if (res)
return -EFAULT;
-#ifndef CONFIG_AMLOGIC_SND_SPLIT_MODE
/*mask align byte(64 or 256)*/
if ((cached_len != 0 || (n % align) != 0)) {
int byte_size = n;
if (access_ok(VERIFY_READ, buf, frames_to_bytes(runtime, count))) {
#ifdef CONFIG_AMLOGIC_SND_SPLIT_MODE
- memcpy(hwbuf, ubuf, n);
+ res = copy_from_user(hwbuf, buf, n);
+ if (res)
+ return -EFAULT;
#else
if (runtime->format == SNDRV_PCM_FORMAT_S16_LE) {
int16_t *tfrom, *to;