From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: "Mukunda,Vijendar" <vijendar.mukunda@amd.com>,
Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, Basavaraj.Hiregoudar@amd.com,
Sunil-kumar.Dommati@amd.com, Mastan.Katragadda@amd.com,
Arungopal.kondaveeti@amd.com, Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Syed Saba Kareem <Syed.SabaKareem@amd.com>,
Mario Limonciello <mario.limonciello@amd.com>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/9] ASoC: amd: ps: create platform devices based on acp config
Date: Wed, 17 May 2023 08:40:37 -0500 [thread overview]
Message-ID: <a36ec243-feaa-d886-0fe8-bfb07472a89f@linux.intel.com> (raw)
In-Reply-To: <c9afc5b7-b07d-1ef5-7c76-f592577f833a@amd.com>
On 5/17/23 03:38, Mukunda,Vijendar wrote:
> On 16/05/23 20:02, Pierre-Louis Bossart wrote:
>>
>> On 5/16/23 05:35, Vijendar Mukunda wrote:
>>> Create platform devices for Soundwire Manager instances and
>>> PDM controller based on ACP pin config selection
>>> and ACPI fw handle for pink sardine platform.
>>>
>>> Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
>>> ---
>>> sound/soc/amd/ps/acp63.h | 43 ++++++-
>>> sound/soc/amd/ps/pci-ps.c | 250 ++++++++++++++++++++++++++++++++++++--
>>> 2 files changed, 280 insertions(+), 13 deletions(-)
>>>
>>> diff --git a/sound/soc/amd/ps/acp63.h b/sound/soc/amd/ps/acp63.h
>>> index 2f94448102d0..f27f71116598 100644
>>> --- a/sound/soc/amd/ps/acp63.h
>>> +++ b/sound/soc/amd/ps/acp63.h
>>> @@ -10,7 +10,7 @@
>>> #define ACP_DEVICE_ID 0x15E2
>>> #define ACP63_REG_START 0x1240000
>>> #define ACP63_REG_END 0x1250200
>>> -#define ACP63_DEVS 3
>>> +#define ACP63_DEVS 5
>>>
>>> #define ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK 0x00010001
>>> #define ACP_PGFSM_CNTL_POWER_ON_MASK 1
>>> @@ -55,8 +55,14 @@
>>>
>>> #define ACP63_DMIC_ADDR 2
>>> #define ACP63_PDM_MODE_DEVS 3
>>> -#define ACP63_PDM_DEV_MASK 1
>>> #define ACP_DMIC_DEV 2
>>> +#define ACP63_SDW0_MODE_DEVS 2
>>> +#define ACP63_SDW0_SDW1_MODE_DEVS 3
>>> +#define ACP63_SDW0_PDM_MODE_DEVS 4
>>> +#define ACP63_SDW0_SDW1_PDM_MODE_DEVS 5
>>> +#define ACP63_DMIC_ADDR 2
>>> +#define ACP63_SDW_ADDR 5
>>> +#define AMD_SDW_MAX_MANAGERS 2
>>>
>>> /* time in ms for acp timeout */
>>> #define ACP_TIMEOUT 500
>>> @@ -80,6 +86,12 @@ enum acp_config {
>>> ACP_CONFIG_15,
>>> };
>>>
>>> +enum acp_pdev_mask {
>>> + ACP63_PDM_DEV_MASK = 1,
>>> + ACP63_SDW_DEV_MASK,
>>> + ACP63_SDW_PDM_DEV_MASK,
>>> +};
>> a comment or kernel-doc wouldn't hurt to explain the difference between
>> ACP63_PDM_DEV_MASK and ACP63_SDW_PDM_DEV_MASK, the meaning of the 'SDW"
>> prefix is far from obvious.
> Above enum's are listed to know the platform device masks.
> For example - if ACP63_PDM_DEV_MASK is set, then ACP PCI driver
> will create platform device for PDM controller.
>
> If ACP63_SDW_DEV_MASK is set, ACP PCI driver will create platform device
> nodes for soundwire manager instances based on instance count retrieved
> by scanning the SoundWire Controller.
>
> If ACP63_SDW_PDM_DEV_MASK is set, ACP PCI driver will create platform device
> nodes for PDM controller and SoundWire manager instances.
>
> We will add comment for the same.
Ah ok, I completely missed that you could have PDM, SoundWire or
PDM+SoundWire configurations. I was reading this with SoundWire blinders
and thought you wanted to have PDM over SoundWire or something.
>>> - dev_dbg(&pci->dev, "No PDM devices found\n");
>>> + dev_dbg(&pci->dev, "No PDM or Soundwire manager devices found\n");
>> what does this mean? I find this debug adds more confusion.
> Currently, we are trying to create platform devices for PDM controller and SoundWire
> Manager instances based on ACP pin config and ACPI _ADDR fields scan under ACP PCI device
> scope.
> Earlier We have added support for ACP PDM controller.
> ACP PIN config supports different audio configurations other than PDM and SoundWire
> based audio endpoints.
>
> If there is no pdev_mask set, it refers to default switch case.
> This dev_dbg statement to notify that no PDM and Soundwire manager devices found
> from ACPI scan.
>
> This patch adds support for platform device creation logic for Soundwire manager instances &
> PDM controller combinations based on ACP PIN Config and ACPI _ADDR field scan.
>
> Possible combination of platform device nodes:
>
> 1) ACP PDM Controller, dmic-codec, machine driver platform device node
> 2) ACP PDM Controller , dmic-codec, SW0 manager instance, platform device for SoundWire DMA driver
> 3) SW0, SW1 SoundWire manager instances, platform device for SoundWire DMA driver
> 3) ACP PDM Controller, dmic-codec, SDW0, SDW1 manager instances, platform device for SoundWire DMA driver
right, you really want this in the commit message so that reviewers
understand the various configurations upfront. Trying to
reverse-engineer the code induces migraines ;-)
next prev parent reply other threads:[~2023-05-17 14:13 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-16 10:35 [PATCH 0/9] ASoC: amd: ps: add soundwire support Vijendar Mukunda
2023-05-16 10:35 ` [PATCH 1/9] ASoC: amd: ps: create platform devices based on acp config Vijendar Mukunda
2023-05-16 14:32 ` Pierre-Louis Bossart
2023-05-17 8:38 ` Mukunda,Vijendar
2023-05-17 13:40 ` Pierre-Louis Bossart [this message]
2023-05-16 10:35 ` [PATCH 2/9] ASoC: amd: ps: handle soundwire interrupts in acp pci driver Vijendar Mukunda
2023-05-16 14:39 ` Pierre-Louis Bossart
2023-05-17 7:18 ` Mukunda,Vijendar
2023-05-17 13:36 ` Pierre-Louis Bossart
2023-05-16 10:35 ` [PATCH 3/9] ASoC: amd: ps: add soundwire dma driver Vijendar Mukunda
2023-05-16 14:40 ` Pierre-Louis Bossart
2023-05-16 16:50 ` Limonciello, Mario
2023-05-17 6:29 ` Mukunda,Vijendar
2023-05-16 10:35 ` [PATCH 4/9] ASoC: amd: ps: add soundwire dma driver dma ops Vijendar Mukunda
2023-05-16 10:35 ` [PATCH 5/9] ASoC: amd: ps: add support for Soundwire DMA interrupts Vijendar Mukunda
2023-05-16 10:35 ` [PATCH 6/9] ASoC: amd: ps: add pm ops support for soundwire dma driver Vijendar Mukunda
2023-05-16 10:35 ` [PATCH 7/9] ASoC: amd: ps: enable SoundWire dma driver build Vijendar Mukunda
2023-05-17 16:17 ` kernel test robot
2023-05-18 5:01 ` Mukunda,Vijendar
2023-05-16 10:35 ` [PATCH 8/9] ASoC: amd: update comments in Kconfig file Vijendar Mukunda
2023-05-16 10:35 ` [PATCH 9/9] ASoC: amd: ps: Add soundwire specific checks in pci driver in pm ops Vijendar Mukunda
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=a36ec243-feaa-d886-0fe8-bfb07472a89f@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=Arungopal.kondaveeti@amd.com \
--cc=Basavaraj.Hiregoudar@amd.com \
--cc=Mastan.Katragadda@amd.com \
--cc=Sunil-kumar.Dommati@amd.com \
--cc=Syed.SabaKareem@amd.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=vijendar.mukunda@amd.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).