--- Begin Message ---
- To: Vinod Koul <vkoul@xxxxxxxxxx>
- Subject: Re: [PATCH V6 2/8] soundwire: amd: Add support for AMD Manager driver
- From: "Mukunda,Vijendar" <vijendar.mukunda@xxxxxxx>
- Date: Fri, 17 Mar 2023 19:34:18 +0530
- Cc: alsa-devel@xxxxxxxxxxxxxxxx, pierre-louis.bossart@xxxxxxxxxxxxxxx, Basavaraj.Hiregoudar@xxxxxxx, Sunil-kumar.Dommati@xxxxxxx, Mario.Limonciello@xxxxxxx, amadeuszx.slawinski@xxxxxxxxxxxxxxx, Mastan.Katragadda@xxxxxxx, Arungopal.kondaveeti@xxxxxxx, claudiu.beznea@xxxxxxxxxxxxx, Bard Liao <yung-chuan.liao@xxxxxxxxxxxxxxx>, Sanyog Kale <sanyog.r.kale@xxxxxxxxx>, open list <linux-kernel@xxxxxxxxxxxxxxx>
- In-reply-to: <ZBRsX7W4l1HyT44y@matsya>
- References: <20230307133135.545952-1-Vijendar.Mukunda@amd.com> <20230307133135.545952-3-Vijendar.Mukunda@amd.com> <ZBGTDXJvVjVuUkiZ@matsya> <7a7f5d93-d6ec-5ad1-9927-7ac4b6d9a643@amd.com> <ZBRsX7W4l1HyT44y@matsya>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0
On 17/03/23 19:04, Vinod Koul wrote:
> On 16-03-23, 19:28, Mukunda,Vijendar wrote:
>> On 15/03/23 15:12, Vinod Koul wrote:
>>> On 07-03-23, 19:01, Vijendar Mukunda wrote:
>>>> +/**
>>>> + * struct amd_sdw_manager - amd manager driver context
>>>> + * @bus: bus handle
>>>> + * @dev: linux device
>>>> + * @mmio: SoundWire registers mmio base
>>>> + * @acp_mmio: acp registers mmio base
>>>> + * @reg_mask: register mask structure per manager instance
>>>> + * @probe_work: SoundWire manager probe workqueue
>>>> + * @acp_sdw_lock: mutex to protect acp share register access
>>>> + * @num_din_ports: number of input ports
>>>> + * @num_dout_ports: number of output ports
>>>> + * @cols_index: Column index in frame shape
>>>> + * @rows_index: Rows index in frame shape
>>>> + * @instance: SoundWire manager instance
>>>> + * @quirks: SoundWire manager quirks
>>>> + * @wake_en_mask: wake enable mask per SoundWire manager
>>>> + * @power_mode_mask: flag interprets amd SoundWire manager power mode
>>>> + */
>>>> +struct amd_sdw_manager {
>>>> + struct sdw_bus bus;
>>>> + struct device *dev;
>>>> +
>>>> + void __iomem *mmio;
>>>> + void __iomem *acp_mmio;
>>>> +
>>>> + struct sdw_manager_reg_mask *reg_mask;
>>>> + struct work_struct probe_work;
>>>> + /* mutex to protect acp common register access */
>>>> + struct mutex *acp_sdw_lock;
>>>> +
>>>> + int num_din_ports;
>>>> + int num_dout_ports;
>>>> +
>>>> + int cols_index;
>>>> + int rows_index;
>>>> +
>>>> + u32 instance;
>>>> + u32 quirks;
>>>> + u32 wake_en_mask;
>>>> + u32 power_mode_mask;
>>>> +};
>>> Does the manager need to be exposed to rest of kernel or users of this
>>> driver, is so why?
>> Currently, amd_manager structure being used in ACP PCI driver
>> (parent driver) and Soundwire DMA driver.
>>
>> In ACP PCI driver, IRQ handler we will use amd_manager structure to
>> schedule workqueue based on soundwire manager instance.
>> In Soundwire DMA driver, we need to retrieve amd_manager instance.
>> As per our design, we have fixed mapping. We need to use same set of
>> DMA registers based on CPU DAI ID.
>> i.e if AUDIO0 TX port is selected in amd_manager driver
>> then we need to use AUDIO0 TX registers for DMA programming.
>> we have included comments for describing mapping in amd_manager.h
>> file.
> Sorry not sure I follow, can you elaborate which members of above struct
> are used by PCI driver?
ACP PCI driver uses "amd_sdw_irq_thread" structure member which was added
in below patch.
https://www.spinics.net/lists/alsa-devel/msg155118.html
amd_manager structure "instance" member will be used by ACP Soundwire DMA driver.
>
--- End Message ---