diff --git a/arch/arm/mach-msm/qdsp6v2/audio_lpa.c b/arch/arm/mach-msm/qdsp6v2/audio_lpa.c index 6253b5b831e..f6dd9fab2c5 100644 --- a/arch/arm/mach-msm/qdsp6v2/audio_lpa.c +++ b/arch/arm/mach-msm/qdsp6v2/audio_lpa.c @@ -2,7 +2,7 @@ * * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation - * Copyright (c) 2009-2012, The Linux Foundation. All rights reserved. + * Copyright (c) 2009-2013, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -744,8 +744,8 @@ static long audio_ioctl(struct file *file, unsigned int cmd, unsigned long arg) pr_debug("%s: AUDIO_GET_STATS cmd\n", __func__); memset(&stats, 0, sizeof(stats)); - timestamp = q6asm_get_session_time(audio->ac); - if (timestamp < 0) { + rc = q6asm_get_session_time(audio->ac, ×tamp); + if (rc < 0) { pr_err("%s: Get Session Time return value =%lld\n", __func__, timestamp); return -EAGAIN; diff --git a/include/sound/q6asm-v2.h b/include/sound/q6asm-v2.h index cf0c4d43b07..ba340f6c64e 100644 --- a/include/sound/q6asm-v2.h +++ b/include/sound/q6asm-v2.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -294,7 +294,7 @@ int q6asm_set_lrgain(struct audio_client *ac, int left_gain, int right_gain); /* Enable Mute/unmute flag */ int q6asm_set_mute(struct audio_client *ac, int muteflag); -uint64_t q6asm_get_session_time(struct audio_client *ac); +int q6asm_get_session_time(struct audio_client *ac, uint64_t *tstamp); /* Client can set the IO mode to either AIO/SIO mode */ int q6asm_set_io_mode(struct audio_client *ac, uint32_t mode); diff --git a/include/sound/q6asm.h b/include/sound/q6asm.h index 579f5e188e9..b5ab2689814 100644 --- a/include/sound/q6asm.h +++ b/include/sound/q6asm.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved. +/* Copyright (c) 2010-2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -320,7 +320,7 @@ int q6asm_set_lrgain(struct audio_client *ac, int left_gain, int right_gain); /* Enable Mute/unmute flag */ int q6asm_set_mute(struct audio_client *ac, int muteflag); -uint64_t q6asm_get_session_time(struct audio_client *ac); +int q6asm_get_session_time(struct audio_client *ac, uint64_t *tstamp); /* Client can set the IO mode to either AIO/SIO mode */ int q6asm_set_io_mode(struct audio_client *ac, uint32_t mode); diff --git a/sound/soc/msm/msm-compr-q6.c b/sound/soc/msm/msm-compr-q6.c index f5086601099..cbadf84da11 100644 --- a/sound/soc/msm/msm-compr-q6.c +++ b/sound/soc/msm/msm-compr-q6.c @@ -1055,11 +1055,10 @@ static int msm_compr_ioctl(struct snd_pcm_substream *substream, pr_debug("SNDRV_COMPRESS_TSTAMP\n"); memset(&tstamp, 0x0, sizeof(struct snd_compr_tstamp)); - timestamp = q6asm_get_session_time(prtd->audio_client); - if (timestamp < 0) { - pr_err("%s: Get Session Time return value =%lld\n", - __func__, timestamp); - return -EAGAIN; + rc = q6asm_get_session_time(prtd->audio_client, ×tamp); + if (rc < 0) { + pr_err("%s: fail to get session tstamp\n", __func__); + return rc; } temp = (timestamp * 2 * runtime->channels); temp = temp * (runtime->rate/1000); diff --git a/sound/soc/msm/msm-pcm-lpa.c b/sound/soc/msm/msm-pcm-lpa.c index 8b009847db2..88c9f4b7627 100644 --- a/sound/soc/msm/msm-pcm-lpa.c +++ b/sound/soc/msm/msm-pcm-lpa.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -561,11 +561,10 @@ static int msm_pcm_ioctl(struct snd_pcm_substream *substream, pr_debug("SNDRV_COMPRESS_TSTAMP\n"); memset(&tstamp, 0x0, sizeof(struct snd_compr_tstamp)); - timestamp = q6asm_get_session_time(prtd->audio_client); - if (timestamp < 0) { - pr_err("%s: Get Session Time return value =%lld\n", - __func__, timestamp); - return -EAGAIN; + rc = q6asm_get_session_time(prtd->audio_client, ×tamp); + if (rc < 0) { + pr_err("%s: fail to get session tstamp\n", __func__); + return rc; } temp = (timestamp * 2 * runtime->channels); temp = temp * (runtime->rate/1000); diff --git a/sound/soc/msm/qdsp6/q6asm.c b/sound/soc/msm/qdsp6/q6asm.c index a0530632fc3..82b21886293 100644 --- a/sound/soc/msm/qdsp6/q6asm.c +++ b/sound/soc/msm/qdsp6/q6asm.c @@ -1,6 +1,5 @@ - /* - * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved. + * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved. * Author: Brian Swetland * * This software is licensed under the terms of the GNU General Public @@ -3651,13 +3650,13 @@ fail_cmd: return -EINVAL; } -uint64_t q6asm_get_session_time(struct audio_client *ac) +int q6asm_get_session_time(struct audio_client *ac, uint64_t *tstamp) { struct apr_hdr hdr; int rc; - if (!ac || ac->apr == NULL) { - pr_err("APR handle NULL\n"); + if (!ac || ac->apr == NULL || tstamp == NULL) { + pr_err("APR handle or tstamp NULL\n"); return -EINVAL; } q6asm_add_hdr(ac, &hdr, sizeof(hdr), FALSE); @@ -3679,7 +3678,9 @@ uint64_t q6asm_get_session_time(struct audio_client *ac) __func__); goto fail_cmd; } - return ac->time_stamp; + + *tstamp = ac->time_stamp; + return 0; fail_cmd: return -EINVAL; diff --git a/sound/soc/msm/qdsp6v2/msm-compr-q6-v2.c b/sound/soc/msm/qdsp6v2/msm-compr-q6-v2.c index 5b7a740b317..68f12e03f2c 100644 --- a/sound/soc/msm/qdsp6v2/msm-compr-q6-v2.c +++ b/sound/soc/msm/qdsp6v2/msm-compr-q6-v2.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -524,8 +524,8 @@ static int msm_compr_ioctl(struct snd_pcm_substream *substream, pr_debug("SNDRV_COMPRESS_TSTAMP\n"); memset(&tstamp, 0x0, sizeof(struct snd_compr_tstamp)); - timestamp = q6asm_get_session_time(prtd->audio_client); - if (timestamp < 0) { + rc = q6asm_get_session_time(prtd->audio_client, ×tamp); + if (rc < 0) { pr_err("%s: Get Session Time return value =%lld\n", __func__, timestamp); return -EAGAIN; diff --git a/sound/soc/msm/qdsp6v2/msm-pcm-lpa-v2.c b/sound/soc/msm/qdsp6v2/msm-pcm-lpa-v2.c index 70dbb6a1dc8..a6c8f16d932 100644 --- a/sound/soc/msm/qdsp6v2/msm-pcm-lpa-v2.c +++ b/sound/soc/msm/qdsp6v2/msm-pcm-lpa-v2.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -502,8 +502,8 @@ static int msm_pcm_ioctl(struct snd_pcm_substream *substream, pr_debug("SNDRV_COMPRESS_TSTAMP\n"); memset(&tstamp, 0x0, sizeof(struct snd_compr_tstamp)); - timestamp = q6asm_get_session_time(prtd->audio_client); - if (timestamp < 0) { + rc = q6asm_get_session_time(prtd->audio_client, ×tamp); + if (rc < 0) { pr_err("%s: Get Session Time return value =%lld\n", __func__, timestamp); return -EAGAIN; diff --git a/sound/soc/msm/qdsp6v2/q6asm.c b/sound/soc/msm/qdsp6v2/q6asm.c index 6d7649063ed..e60691b84f6 100644 --- a/sound/soc/msm/qdsp6v2/q6asm.c +++ b/sound/soc/msm/qdsp6v2/q6asm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. * Author: Brian Swetland * * This software is licensed under the terms of the GNU General Public @@ -3191,13 +3191,13 @@ fail_cmd: return -EINVAL; } -uint64_t q6asm_get_session_time(struct audio_client *ac) +int q6asm_get_session_time(struct audio_client *ac, uint64_t *tstamp) { struct apr_hdr hdr; int rc; - if (!ac || ac->apr == NULL) { - pr_err("APR handle NULL\n"); + if (!ac || ac->apr == NULL || tstamp == NULL) { + pr_err("APR handle NULL or tstamp NULL\n"); return -EINVAL; } q6asm_add_hdr(ac, &hdr, sizeof(hdr), TRUE); @@ -3219,7 +3219,9 @@ uint64_t q6asm_get_session_time(struct audio_client *ac) __func__); goto fail_cmd; } - return ac->time_stamp; + + *tstamp = ac->time_stamp; + return 0; fail_cmd: return -EINVAL;