alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Rohit Kumar <rohitkr@codeaurora.org>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	agross@kernel.org, bjorn.andersson@linaro.org,
	lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org,
	plai@codeaurora.org, bgoswami@codeaurora.org, perex@perex.cz,
	tiwai@suse.com, linux-arm-msm@vger.kernel.org,
	alsa-devel@alsa-project.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/8] ASoC: qcom: lpass: Use regmap_field for i2sctl and dmactl registers
Date: Thu, 9 Jul 2020 15:44:59 +0530	[thread overview]
Message-ID: <4c5cb96c-9423-67a5-0da6-ee7cf9b1ea32@codeaurora.org> (raw)
In-Reply-To: <ac634d4d-527a-7262-2744-203c04ee0982@linaro.org>


On 7/9/2020 3:36 PM, Srinivas Kandagatla wrote:
>
>
> On 09/07/2020 10:57, Rohit Kumar wrote:
>> Thanks Srini for reviewing.
>>
>> On 7/9/2020 2:56 PM, Srinivas Kandagatla wrote:
>>>
>>>
>>> On 08/07/2020 06:08, Rohit kumar wrote:
>>>> I2SCTL and DMACTL registers has different bits alignment for newer
>>>> LPASS variants of SC7180 soc. Use REG_FIELD_ID() to define the
>>>> reg_fields in platform specific file and removed shifts and mask
>>>> macros for such registers from header file.
>>>>
>>>> Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
>>>
>>> Thanks Rohit for doing this, this looks much better now!
>>> I have few minor comments..
>>>
>>>> ---
>>>>   sound/soc/qcom/lpass-apq8016.c   |  24 ++++++
>>>>   sound/soc/qcom/lpass-cpu.c       | 163 
>>>> +++++++++++++++++++++++----------------
>>>>   sound/soc/qcom/lpass-ipq806x.c   |  24 ++++++
>>>>   sound/soc/qcom/lpass-lpaif-reg.h | 157 
>>>> +++++++++++++++++++------------------
>>>>   sound/soc/qcom/lpass-platform.c  | 151 
>>>> +++++++++++++++++++++++++++---------
>>>>   sound/soc/qcom/lpass.h           |  53 +++++++++++++
>>>>   6 files changed, 398 insertions(+), 174 deletions(-)
>>>>
>>>
>>> index f0c7e93..f358d12 100644
>>>> --- a/sound/soc/qcom/lpass-cpu.c
>>>> +++ b/sound/soc/qcom/lpass-cpu.c
>>>> @@ -29,6 +29,32 @@
>>>>   #define LPASS_CPU_I2S_SD0_1_2_MASK    GENMASK(2, 0)
>>>>   #define LPASS_CPU_I2S_SD0_1_2_3_MASK    GENMASK(3, 0)
>>>
>>>
>>>>   }
>>>>   -static int lpass_cpu_daiops_hw_free(struct snd_pcm_substream 
>>>> *substream,
>>>> -        struct snd_soc_dai *dai)
>>>> -{
>>>> -    struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
>>>> -    int ret;
>>>> -
>>>> -    ret = regmap_write(drvdata->lpaif_map,
>>>> -               LPAIF_I2SCTL_REG(drvdata->variant, dai->driver->id),
>>>> -               0);
>>>> -    if (ret)
>>>> -        dev_err(dai->dev, "error writing to i2sctl reg: %d\n", ret);
>>>> -
>>>> -    return ret;
>>>> -}
>>>
>>> Any particular reason why this function remove
>>
>> This was causing issue in playback/capture concurrency. It sets 
>> I2SCTL register value to 0
>>
>> when usecase ends. However, playback/capture specific bits are 
>> already cleared during trigger() stop
>>
>> function. So, this is not needed.
>
> This should be sent as separate fix with fixes tag!
Ok. Will create separate patch with fixes tag and post.
>
>>
>>
>>>
>>>> diff --git a/sound/soc/qcom/lpass-lpaif-reg.h 
>>>> b/sound/soc/qcom/lpass-lpaif-reg.h
>>>> index 72a3e2f..5258e60 100644
>>>> --- a/sound/soc/qcom/lpass-lpaif-reg.h
>>>> +++ b/sound/soc/qcom/lpass-lpaif-reg.h
>>>> @@ -12,15 +12,12 @@
>>> ...
>>>>   #endif /* __LPASS_LPAIF_REG_H__ */
>>>> diff --git a/sound/soc/qcom/lpass-platform.c 
>>>> b/sound/soc/qcom/lpass-platform.c
>>>> index 34f7fd1..445ca193 100644
>>>> --- a/sound/soc/qcom/lpass-platform.c
>>>> +++ b/sound/soc/qcom/lpass-platform.c
>>>> @@ -50,6 +50,53 @@ static const struct snd_pcm_hardware 
>>>> lpass_platform_pcm_hardware = {
>>>>       .fifo_size        =    0,
>>>>   };
>>> ...
>>>>   static int lpass_platform_pcmops_open(struct snd_soc_component 
>>>> *component,
>>>>                         struct snd_pcm_substream *substream)
>>>>   {
>>>> @@ -59,9 +106,9 @@ static int lpass_platform_pcmops_open(struct 
>>>> snd_soc_component *component,
>>>>       struct lpass_data *drvdata = 
>>>> snd_soc_component_get_drvdata(component);
>>>>       struct lpass_variant *v = drvdata->variant;
>>>>       int ret, dma_ch, dir = substream->stream;
>>>> -    struct lpass_pcm_data *data;
>>>> +    struct lpass_pcm_data *data = NULL;
>>>>   -    data = devm_kzalloc(soc_runtime->dev, sizeof(*data), 
>>>> GFP_KERNEL);
>>>> +    data = kzalloc(sizeof(*data), GFP_KERNEL);
>>>
>>> Does this change belong in this patch?
>>
>>
>> As part of this change, I fixed memory leak too by adding kfree() in 
>> close()
>>
>> However, this was causing issue as memory was allocated using 
>> devm_kzalloc().
>>
>> Should I move it to different patch?
>
> That would be the right thing to do, can also add fixes tag!


Sure, Will do that in next spin.

>
>
>>
>>>
>>>>       if (!data)
>>>>           return -ENOMEM;
>>>>   @@ -111,13 +158,13 @@ static int 
>>>> lpass_platform_pcmops_close(struct snd_soc_component *component,
>>>>       struct snd_pcm_runtime *runtime = substream->runtime;
>>>>       struct lpass_data *drvdata = 
>>>> snd_soc_component_get_drvdata(component);
>>>>       struct lpass_variant *v = drvdata->variant;
>
>>>
>>> Above two along with rddma members can be removed, these become 
>>> redundant after adding regmap field!
>>>
>> wrdma_channels is used in alloc_dma_channel() to get the channel id.
>>
>> Also, both are used for other DMA registers such as LPAIF_RDMABASE_REG,
>>
>> LPAIF_RDMABUFF_REG, LPAIF_RDMACURR_REG, etc.
>>
> Ah I see we are still using this in lpass_cpu_regmap_writeable!
> ignore my previous comments about removing them!
>
> --srini

-- 
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member
of the Code Aurora Forum, hosted by the Linux Foundation.


  reply	other threads:[~2020-07-09 10:16 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-08  5:08 [PATCH v3 0/8] ASoC: qcom: Add support for SC7180 lpass variant Rohit kumar
2020-07-08  5:08 ` [PATCH v3 1/8] ASoC: qcom: Add common array to initialize soc based core clocks Rohit kumar
2020-07-09  9:26   ` Srinivas Kandagatla
2020-07-08  5:08 ` [PATCH v3 2/8] ASoC: qcom: lpass-cpu: Move ahbix clk to platform specific function Rohit kumar
2020-07-09  9:26   ` Srinivas Kandagatla
2020-07-08  5:08 ` [PATCH v3 3/8] ASoC: qcom: lpass: Use regmap_field for i2sctl and dmactl registers Rohit kumar
2020-07-09  9:26   ` Srinivas Kandagatla
2020-07-09  9:57     ` Rohit Kumar
2020-07-09 10:06       ` Srinivas Kandagatla
2020-07-09 10:14         ` Rohit Kumar [this message]
2020-07-08  5:08 ` [PATCH v3 4/8] include: dt-bindings: sound: Add sc7180-lpass bindings header Rohit kumar
2020-07-08 14:45   ` Mark Brown
2020-07-09 10:06     ` Rohit Kumar
2020-07-08  5:08 ` [PATCH v3 5/8] ASoC: qcom: lpass-platform: Replace card->dev with component->dev Rohit kumar
2020-07-08 16:50   ` Mark Brown
2020-07-09  3:46     ` Rohit Kumar
2020-07-09  9:26   ` Srinivas Kandagatla
2020-07-08  5:08 ` [PATCH v3 6/8] dt-bindings: sound: lpass-cpu: Add sc7180 lpass cpu node Rohit kumar
2020-07-09  9:27   ` Srinivas Kandagatla
2020-07-09 10:01     ` Rohit Kumar
2020-07-09 10:08       ` Srinivas Kandagatla
2020-07-09 10:12         ` Rohit Kumar
2020-07-09 10:14           ` Srinivas Kandagatla
2020-07-09 10:34           ` Mark Brown
2020-07-08  5:08 ` [PATCH v3 7/8] ASoC: qcom: lpass-sc7180: Add platform driver for lpass audio Rohit kumar
2020-07-09  9:27   ` Srinivas Kandagatla
2020-07-08  5:08 ` [PATCH v3 8/8] dt-bindings: sound: lpass-cpu: Move to yaml format Rohit kumar
2020-07-13 22:53   ` Rob Herring
2020-07-22 10:44     ` Rohit Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4c5cb96c-9423-67a5-0da6-ee7cf9b1ea32@codeaurora.org \
    --to=rohitkr@codeaurora.org \
    --cc=agross@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bgoswami@codeaurora.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=plai@codeaurora.org \
    --cc=robh+dt@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).