[PATCH V2 1/4] ASoC: amd: ps: implement api to retrieve acp device config
Implement API to retrieve acp device config and calculate platform device count and dev mask for platform device node creation.
Currently for DMIC configuration, mask and dev count are calculated. Same api will be used to extend support for different ACP device configurations.
Signed-off-by: Vijendar Mukunda Vijendar.Mukunda@amd.com --- v1->v2: - used ACP_DMIC_DEV macro instead of hard coded value - changed is_dmic_dev variable initialization - changed debug level
sound/soc/amd/ps/acp63.h | 7 +++++++ sound/soc/amd/ps/pci-ps.c | 37 +++++++++++++++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/sound/soc/amd/ps/acp63.h b/sound/soc/amd/ps/acp63.h index 5e7f9c1c1b0e..b015e845e5fa 100644 --- a/sound/soc/amd/ps/acp63.h +++ b/sound/soc/amd/ps/acp63.h @@ -54,6 +54,11 @@ /* time in ms for runtime suspend delay */ #define ACP_SUSPEND_DELAY_MS 2000
+#define ACP63_DMIC_ADDR 2 +#define ACP63_PDM_MODE_DEVS 3 +#define ACP63_PDM_DEV_MASK 1 +#define ACP_DMIC_DEV 2 + enum acp_config { ACP_CONFIG_0 = 0, ACP_CONFIG_1, @@ -102,4 +107,6 @@ struct acp63_dev_data { struct resource *res; bool acp63_audio_mode; struct platform_device *pdev[ACP63_DEVS]; + u16 pdev_mask; + u16 pdev_count; }; diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index 489f01a20699..9066a625e501 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -132,6 +132,38 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id) return IRQ_NONE; }
+void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) +{ + struct acpi_device *dmic_dev; + const union acpi_object *obj; + bool is_dmic_dev = false; + + dmic_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP63_DMIC_ADDR, 0); + if (dmic_dev) { + if (!acpi_dev_get_property(dmic_dev, "acp-audio-device-type", + ACPI_TYPE_INTEGER, &obj) && + obj->integer.value == ACP_DMIC_DEV) + is_dmic_dev = true; + } + + switch (config) { + case ACP_CONFIG_0: + case ACP_CONFIG_1: + case ACP_CONFIG_2: + case ACP_CONFIG_3: + case ACP_CONFIG_9: + case ACP_CONFIG_15: + dev_dbg(&pci->dev, "Audio Mode %d\n", config); + break; + default: + if (is_dmic_dev) { + acp_data->pdev_mask = ACP63_PDM_DEV_MASK; + acp_data->pdev_count = ACP63_PDM_MODE_DEVS; + } + break; + } +} + static int snd_acp63_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { @@ -183,6 +215,7 @@ static int snd_acp63_probe(struct pci_dev *pci, if (ret) goto release_regions; val = acp63_readl(adata->acp63_base + ACP_PIN_CONFIG); + get_acp63_device_config(val, pci, adata); switch (val) { case ACP_CONFIG_0: case ACP_CONFIG_1: @@ -195,14 +228,14 @@ static int snd_acp63_probe(struct pci_dev *pci, default:
/* Checking DMIC hardware*/ - adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), 0x02, 0); + adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP_DMIC_ADDR, 0);
if (!adev) break;
if (!acpi_dev_get_property(adev, "acp-audio-device-type", ACPI_TYPE_INTEGER, &obj) && - obj->integer.value == 2) { + obj->integer.value == ACP_DMIC_DEV) { adata->res = devm_kzalloc(&pci->dev, sizeof(struct resource), GFP_KERNEL); if (!adata->res) { ret = -ENOMEM;
Refactor platform device creation implementation. Based on platform dev count and pdev mask create platform devices. Use common API to fill platform dev information. Use pdev count variable in remove callback for unregistering platform devices.
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com --- sound/soc/amd/ps/acp63.h | 2 +- sound/soc/amd/ps/pci-ps.c | 168 ++++++++++++++++++++------------------ 2 files changed, 89 insertions(+), 81 deletions(-)
diff --git a/sound/soc/amd/ps/acp63.h b/sound/soc/amd/ps/acp63.h index b015e845e5fa..8f024cb309c9 100644 --- a/sound/soc/amd/ps/acp63.h +++ b/sound/soc/amd/ps/acp63.h @@ -11,7 +11,6 @@ #define ACP63_REG_START 0x1240000 #define ACP63_REG_END 0x1250200 #define ACP63_DEVS 3 -#define ACP63_PDM_MODE 1
#define ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK 0x00010001 #define ACP_PGFSM_CNTL_POWER_ON_MASK 1 @@ -109,4 +108,5 @@ struct acp63_dev_data { struct platform_device *pdev[ACP63_DEVS]; u16 pdev_mask; u16 pdev_count; + u16 pdm_dev_index; }; diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index 9066a625e501..3033185ea39c 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -164,17 +164,86 @@ void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_d } }
+void acp63_fill_platform_dev_info(struct platform_device_info *pdevinfo, struct device *parent, + struct fwnode_handle *fw_node, char *name, unsigned int id, + const struct resource *res, unsigned int num_res, + const void *data, size_t size_data) +{ + pdevinfo->name = name; + pdevinfo->id = id; + pdevinfo->parent = parent; + pdevinfo->num_res = num_res; + pdevinfo->res = res; + pdevinfo->data = data; + pdevinfo->size_data = size_data; + pdevinfo->fwnode = fw_node; +} + +static int create_acp63_platform_devs(struct pci_dev *pci, struct acp63_dev_data *adata, u32 addr) +{ + struct platform_device_info pdevinfo[ACP63_DEVS]; + struct device *parent; + int index; + int ret; + + parent = &pci->dev; + dev_dbg(&pci->dev, + "%s pdev_mask:0x%x pdev_count:0x%x\n", __func__, adata->pdev_mask, + adata->pdev_count); + if (adata->pdev_mask) { + adata->res = devm_kzalloc(&pci->dev, sizeof(struct resource), GFP_KERNEL); + if (!adata->res) { + ret = -ENOMEM; + goto de_init; + } + adata->res->flags = IORESOURCE_MEM; + adata->res->start = addr; + adata->res->end = addr + (ACP63_REG_END - ACP63_REG_START); + memset(&pdevinfo, 0, sizeof(pdevinfo)); + } + + switch (adata->pdev_mask) { + case ACP63_PDM_DEV_MASK: + adata->pdm_dev_index = 0; + acp63_fill_platform_dev_info(&pdevinfo[0], parent, NULL, "acp_ps_pdm_dma", + 0, adata->res, 1, NULL, 0); + acp63_fill_platform_dev_info(&pdevinfo[1], parent, NULL, "dmic-codec", + 0, NULL, 0, NULL, 0); + acp63_fill_platform_dev_info(&pdevinfo[2], parent, NULL, "acp_ps_mach", + 0, NULL, 0, NULL, 0); + break; + default: + dev_dbg(&pci->dev, "No PDM devices found\n"); + goto de_init; + } + + for (index = 0; index < adata->pdev_count; index++) { + adata->pdev[index] = platform_device_register_full(&pdevinfo[index]); + if (IS_ERR(adata->pdev[index])) { + dev_err(&pci->dev, + "cannot register %s device\n", pdevinfo[index].name); + ret = PTR_ERR(adata->pdev[index]); + goto unregister_devs; + } + } + return 0; +unregister_devs: + for (--index; index >= 0; index--) + platform_device_unregister(adata->pdev[index]); +de_init: + if (acp63_deinit(adata->acp63_base, &pci->dev)) + dev_err(&pci->dev, "ACP de-init failed\n"); + return ret; +} + static int snd_acp63_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { struct acp63_dev_data *adata; - struct platform_device_info pdevinfo[ACP63_DEVS]; - int index, ret; - int val = 0x00; - struct acpi_device *adev; - const union acpi_object *obj; u32 addr; - unsigned int irqflags; + u32 irqflags; + int val; + int ret;
irqflags = IRQF_SHARED; /* Pink Sardine device check */ @@ -216,82 +285,23 @@ static int snd_acp63_probe(struct pci_dev *pci, goto release_regions; val = acp63_readl(adata->acp63_base + ACP_PIN_CONFIG); get_acp63_device_config(val, pci, adata); - switch (val) { - case ACP_CONFIG_0: - case ACP_CONFIG_1: - case ACP_CONFIG_2: - case ACP_CONFIG_3: - case ACP_CONFIG_9: - case ACP_CONFIG_15: - dev_info(&pci->dev, "Audio Mode %d\n", val); - break; - default: - - /* Checking DMIC hardware*/ - adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP_DMIC_ADDR, 0); - - if (!adev) - break; - - if (!acpi_dev_get_property(adev, "acp-audio-device-type", - ACPI_TYPE_INTEGER, &obj) && - obj->integer.value == ACP_DMIC_DEV) { - adata->res = devm_kzalloc(&pci->dev, sizeof(struct resource), GFP_KERNEL); - if (!adata->res) { - ret = -ENOMEM; - goto de_init; - } - - adata->res->name = "acp_iomem"; - adata->res->flags = IORESOURCE_MEM; - adata->res->start = addr; - adata->res->end = addr + (ACP63_REG_END - ACP63_REG_START); - adata->acp63_audio_mode = ACP63_PDM_MODE; - - memset(&pdevinfo, 0, sizeof(pdevinfo)); - pdevinfo[0].name = "acp_ps_pdm_dma"; - pdevinfo[0].id = 0; - pdevinfo[0].parent = &pci->dev; - pdevinfo[0].num_res = 1; - pdevinfo[0].res = adata->res; - - pdevinfo[1].name = "dmic-codec"; - pdevinfo[1].id = 0; - pdevinfo[1].parent = &pci->dev; - - pdevinfo[2].name = "acp_ps_mach"; - pdevinfo[2].id = 0; - pdevinfo[2].parent = &pci->dev; - - for (index = 0; index < ACP63_DEVS; index++) { - adata->pdev[index] = - platform_device_register_full(&pdevinfo[index]); - - if (IS_ERR(adata->pdev[index])) { - dev_err(&pci->dev, - "cannot register %s device\n", - pdevinfo[index].name); - ret = PTR_ERR(adata->pdev[index]); - goto unregister_devs; - } - ret = devm_request_irq(&pci->dev, pci->irq, acp63_irq_handler, - irqflags, "ACP_PCI_IRQ", adata); - if (ret) { - dev_err(&pci->dev, "ACP PCI IRQ request failed\n"); - goto unregister_devs; - } - } - } - break; + ret = create_acp63_platform_devs(pci, adata, addr); + if (ret < 0) { + dev_err(&pci->dev, "ACP platform devices creation failed\n"); + goto de_init; + } + ret = devm_request_irq(&pci->dev, pci->irq, acp63_irq_handler, + irqflags, "ACP_PCI_IRQ", adata); + if (ret) { + dev_err(&pci->dev, "ACP PCI IRQ request failed\n"); + goto de_init; } + pm_runtime_set_autosuspend_delay(&pci->dev, ACP_SUSPEND_DELAY_MS); pm_runtime_use_autosuspend(&pci->dev); pm_runtime_put_noidle(&pci->dev); pm_runtime_allow(&pci->dev); return 0; -unregister_devs: - for (--index; index >= 0; index--) - platform_device_unregister(adata->pdev[index]); de_init: if (acp63_deinit(adata->acp63_base, &pci->dev)) dev_err(&pci->dev, "ACP de-init failed\n"); @@ -338,10 +348,8 @@ static void snd_acp63_remove(struct pci_dev *pci) int ret, index;
adata = pci_get_drvdata(pci); - if (adata->acp63_audio_mode == ACP63_PDM_MODE) { - for (index = 0; index < ACP63_DEVS; index++) - platform_device_unregister(adata->pdev[index]); - } + for (index = 0; index < adata->pdev_count; index++) + platform_device_unregister(adata->pdev[index]); ret = acp63_deinit(adata->acp63_base, &pci->dev); if (ret) dev_err(&pci->dev, "ACP de-init failed\n");
Instead of using hard coded index value for platform device index, retrieve the device index based on platform devices created. In PDM config case, ACP PCI driver retrieves dev index from pdm_dev_index variable. This will avoid overhead when multiple endpoint combinations support is added later. platform device index will vary based on audio endpoint configuration.
Signed-off-by: Vijendar Mukunda Vijendar.Mukunda@amd.com --- sound/soc/amd/ps/pci-ps.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index 3033185ea39c..b3628fbfdafd 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -116,6 +116,7 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id) struct acp63_dev_data *adata; struct pdm_dev_data *ps_pdm_data; u32 val; + u16 pdev_index;
adata = dev_id; if (!adata) @@ -123,7 +124,8 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id)
val = acp63_readl(adata->acp63_base + ACP_EXTERNAL_INTR_STAT); if (val & BIT(PDM_DMA_STAT)) { - ps_pdm_data = dev_get_drvdata(&adata->pdev[0]->dev); + pdev_index = adata->pdm_dev_index; + ps_pdm_data = dev_get_drvdata(&adata->pdev[pdev_index]->dev); acp63_writel(BIT(PDM_DMA_STAT), adata->acp63_base + ACP_EXTERNAL_INTR_STAT); if (ps_pdm_data->capture_stream) snd_pcm_period_elapsed(ps_pdm_data->capture_stream);
Move irq handler registration prior to platform device creation logic. This will avoid irq handling missing scenario when platform device raise interrrupts during it's probe sequence.
Signed-off-by: Vijendar Mukunda Vijendar.Mukunda@amd.com --- sound/soc/amd/ps/pci-ps.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index b3628fbfdafd..4ec03e576376 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -285,6 +285,12 @@ static int snd_acp63_probe(struct pci_dev *pci, ret = acp63_init(adata->acp63_base, &pci->dev); if (ret) goto release_regions; + ret = devm_request_irq(&pci->dev, pci->irq, acp63_irq_handler, + irqflags, "ACP_PCI_IRQ", adata); + if (ret) { + dev_err(&pci->dev, "ACP PCI IRQ request failed\n"); + goto de_init; + } val = acp63_readl(adata->acp63_base + ACP_PIN_CONFIG); get_acp63_device_config(val, pci, adata); ret = create_acp63_platform_devs(pci, adata, addr); @@ -292,13 +298,6 @@ static int snd_acp63_probe(struct pci_dev *pci, dev_err(&pci->dev, "ACP platform devices creation failed\n"); goto de_init; } - ret = devm_request_irq(&pci->dev, pci->irq, acp63_irq_handler, - irqflags, "ACP_PCI_IRQ", adata); - if (ret) { - dev_err(&pci->dev, "ACP PCI IRQ request failed\n"); - goto de_init; - } - pm_runtime_set_autosuspend_delay(&pci->dev, ACP_SUSPEND_DELAY_MS); pm_runtime_use_autosuspend(&pci->dev); pm_runtime_put_noidle(&pci->dev);
On 21/12/22 16:56, Vijendar Mukunda wrote:
Implement API to retrieve acp device config and calculate platform device count and dev mask for platform device node creation.
Currently for DMIC configuration, mask and dev count are calculated. Same api will be used to extend support for different ACP device configurations.
By mistake, patch series was sent as V2 instead of V1.
Signed-off-by: Vijendar Mukunda Vijendar.Mukunda@amd.com
v1->v2: - used ACP_DMIC_DEV macro instead of hard coded value - changed is_dmic_dev variable initialization - changed debug level
sound/soc/amd/ps/acp63.h | 7 +++++++ sound/soc/amd/ps/pci-ps.c | 37 +++++++++++++++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/sound/soc/amd/ps/acp63.h b/sound/soc/amd/ps/acp63.h index 5e7f9c1c1b0e..b015e845e5fa 100644 --- a/sound/soc/amd/ps/acp63.h +++ b/sound/soc/amd/ps/acp63.h @@ -54,6 +54,11 @@ /* time in ms for runtime suspend delay */ #define ACP_SUSPEND_DELAY_MS 2000
+#define ACP63_DMIC_ADDR 2 +#define ACP63_PDM_MODE_DEVS 3 +#define ACP63_PDM_DEV_MASK 1 +#define ACP_DMIC_DEV 2
enum acp_config { ACP_CONFIG_0 = 0, ACP_CONFIG_1, @@ -102,4 +107,6 @@ struct acp63_dev_data { struct resource *res; bool acp63_audio_mode; struct platform_device *pdev[ACP63_DEVS];
- u16 pdev_mask;
- u16 pdev_count;
}; diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index 489f01a20699..9066a625e501 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -132,6 +132,38 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id) return IRQ_NONE; }
+void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) +{
- struct acpi_device *dmic_dev;
- const union acpi_object *obj;
- bool is_dmic_dev = false;
- dmic_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP63_DMIC_ADDR, 0);
- if (dmic_dev) {
if (!acpi_dev_get_property(dmic_dev, "acp-audio-device-type",
ACPI_TYPE_INTEGER, &obj) &&
obj->integer.value == ACP_DMIC_DEV)
is_dmic_dev = true;
- }
- switch (config) {
- case ACP_CONFIG_0:
- case ACP_CONFIG_1:
- case ACP_CONFIG_2:
- case ACP_CONFIG_3:
- case ACP_CONFIG_9:
- case ACP_CONFIG_15:
dev_dbg(&pci->dev, "Audio Mode %d\n", config);
break;
- default:
if (is_dmic_dev) {
acp_data->pdev_mask = ACP63_PDM_DEV_MASK;
acp_data->pdev_count = ACP63_PDM_MODE_DEVS;
}
break;
- }
+}
static int snd_acp63_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { @@ -183,6 +215,7 @@ static int snd_acp63_probe(struct pci_dev *pci, if (ret) goto release_regions; val = acp63_readl(adata->acp63_base + ACP_PIN_CONFIG);
- get_acp63_device_config(val, pci, adata); switch (val) { case ACP_CONFIG_0: case ACP_CONFIG_1:
@@ -195,14 +228,14 @@ static int snd_acp63_probe(struct pci_dev *pci, default:
/* Checking DMIC hardware*/
adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), 0x02, 0);
adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP_DMIC_ADDR, 0);
if (!adev) break;
if (!acpi_dev_get_property(adev, "acp-audio-device-type", ACPI_TYPE_INTEGER, &obj) &&
obj->integer.value == 2) {
obj->integer.value == ACP_DMIC_DEV) { adata->res = devm_kzalloc(&pci->dev, sizeof(struct resource), GFP_KERNEL); if (!adata->res) { ret = -ENOMEM;
Hi Vijendar,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on broonie-sound/for-next] [also build test WARNING on linus/master next-20221220] [cannot apply to v6.1] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Vijendar-Mukunda/ASoC-amd-ps-... base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next patch link: https://lore.kernel.org/r/20221221112611.1373278-1-Vijendar.Mukunda%40amd.co... patch subject: [PATCH V2 1/4] ASoC: amd: ps: implement api to retrieve acp device config config: x86_64-randconfig-a015-20221219 compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/a47d6a455ff7716688a8c7efaae89f... git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Vijendar-Mukunda/ASoC-amd-ps-implement-api-to-retrieve-acp-device-config/20221221-192703 git checkout a47d6a455ff7716688a8c7efaae89f07cebf118d # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash sound/soc/amd/ps/
If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot lkp@intel.com
All warnings (new ones prefixed by >>):
sound/soc/amd/ps/pci-ps.c:135:6: warning: no previous prototype for function 'get_acp63_device_config' [-Wmissing-prototypes]
void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) ^ sound/soc/amd/ps/pci-ps.c:135:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) ^ static sound/soc/amd/ps/pci-ps.c:231:60: error: use of undeclared identifier 'ACP_DMIC_ADDR' adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP_DMIC_ADDR, 0); ^ 1 warning and 1 error generated.
vim +/get_acp63_device_config +135 sound/soc/amd/ps/pci-ps.c
134
135 void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data)
136 { 137 struct acpi_device *dmic_dev; 138 const union acpi_object *obj; 139 bool is_dmic_dev = false; 140 141 dmic_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP63_DMIC_ADDR, 0); 142 if (dmic_dev) { 143 if (!acpi_dev_get_property(dmic_dev, "acp-audio-device-type", 144 ACPI_TYPE_INTEGER, &obj) && 145 obj->integer.value == ACP_DMIC_DEV) 146 is_dmic_dev = true; 147 } 148 149 switch (config) { 150 case ACP_CONFIG_0: 151 case ACP_CONFIG_1: 152 case ACP_CONFIG_2: 153 case ACP_CONFIG_3: 154 case ACP_CONFIG_9: 155 case ACP_CONFIG_15: 156 dev_dbg(&pci->dev, "Audio Mode %d\n", config); 157 break; 158 default: 159 if (is_dmic_dev) { 160 acp_data->pdev_mask = ACP63_PDM_DEV_MASK; 161 acp_data->pdev_count = ACP63_PDM_MODE_DEVS; 162 } 163 break; 164 } 165 } 166
On 21/12/22 22:10, kernel test robot wrote:
Hi Vijendar,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on broonie-sound/for-next] [also build test WARNING on linus/master next-20221220] [cannot apply to v6.1] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit-scm.co...]
url: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com... base: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel... for-next patch link: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kerne... patch subject: [PATCH V2 1/4] ASoC: amd: ps: implement api to retrieve acp device config config: x86_64-randconfig-a015-20221219 compiler: clang version 14.0.6 (https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com... f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): wget https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.github... -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com... git remote add linux-review https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com... git fetch --no-tags linux-review Vijendar-Mukunda/ASoC-amd-ps-implement-api-to-retrieve-acp-device-config/20221221-192703 git checkout a47d6a455ff7716688a8c7efaae89f07cebf118d # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash sound/soc/amd/ps/
If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot lkp@intel.com
All warnings (new ones prefixed by >>):
sound/soc/amd/ps/pci-ps.c:135:6: warning: no previous prototype for function 'get_acp63_device_config' [-Wmissing-prototypes]
void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) ^ sound/soc/amd/ps/pci-ps.c:135:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) ^ static sound/soc/amd/ps/pci-ps.c:231:60: error: use of undeclared identifier 'ACP_DMIC_ADDR' adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP_DMIC_ADDR, 0); ^ 1 warning and 1 error generated.
will fix it and respin the patch series.
vim +/get_acp63_device_config +135 sound/soc/amd/ps/pci-ps.c
134
135 void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data)
136 { 137 struct acpi_device *dmic_dev; 138 const union acpi_object *obj; 139 bool is_dmic_dev = false; 140 141 dmic_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP63_DMIC_ADDR, 0); 142 if (dmic_dev) { 143 if (!acpi_dev_get_property(dmic_dev, "acp-audio-device-type", 144 ACPI_TYPE_INTEGER, &obj) && 145 obj->integer.value == ACP_DMIC_DEV) 146 is_dmic_dev = true; 147 } 148 149 switch (config) { 150 case ACP_CONFIG_0: 151 case ACP_CONFIG_1: 152 case ACP_CONFIG_2: 153 case ACP_CONFIG_3: 154 case ACP_CONFIG_9: 155 case ACP_CONFIG_15: 156 dev_dbg(&pci->dev, "Audio Mode %d\n", config); 157 break; 158 default: 159 if (is_dmic_dev) { 160 acp_data->pdev_mask = ACP63_PDM_DEV_MASK; 161 acp_data->pdev_count = ACP63_PDM_MODE_DEVS; 162 } 163 break; 164 } 165 } 166
Hi Vijendar,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on broonie-sound/for-next] [also build test WARNING on linus/master next-20221220] [cannot apply to v6.1] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Vijendar-Mukunda/ASoC-amd-ps-... base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next patch link: https://lore.kernel.org/r/20221221112611.1373278-1-Vijendar.Mukunda%40amd.co... patch subject: [PATCH V2 1/4] ASoC: amd: ps: implement api to retrieve acp device config config: i386-allyesconfig compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 reproduce (this is a W=1 build): # https://github.com/intel-lab-lkp/linux/commit/a47d6a455ff7716688a8c7efaae89f... git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Vijendar-Mukunda/ASoC-amd-ps-implement-api-to-retrieve-acp-device-config/20221221-192703 git checkout a47d6a455ff7716688a8c7efaae89f07cebf118d # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=i386 olddefconfig make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash sound/soc/amd/ps/
If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot lkp@intel.com
All warnings (new ones prefixed by >>):
sound/soc/amd/ps/pci-ps.c:135:6: warning: no previous prototype for 'get_acp63_device_config' [-Wmissing-prototypes]
135 | void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) | ^~~~~~~~~~~~~~~~~~~~~~~ sound/soc/amd/ps/pci-ps.c: In function 'snd_acp63_probe': sound/soc/amd/ps/pci-ps.c:231:74: error: 'ACP_DMIC_ADDR' undeclared (first use in this function); did you mean 'ACP63_DMIC_ADDR'? 231 | adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP_DMIC_ADDR, 0); | ^~~~~~~~~~~~~ | ACP63_DMIC_ADDR sound/soc/amd/ps/pci-ps.c:231:74: note: each undeclared identifier is reported only once for each function it appears in
vim +/get_acp63_device_config +135 sound/soc/amd/ps/pci-ps.c
134
135 void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data)
136 { 137 struct acpi_device *dmic_dev; 138 const union acpi_object *obj; 139 bool is_dmic_dev = false; 140 141 dmic_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP63_DMIC_ADDR, 0); 142 if (dmic_dev) { 143 if (!acpi_dev_get_property(dmic_dev, "acp-audio-device-type", 144 ACPI_TYPE_INTEGER, &obj) && 145 obj->integer.value == ACP_DMIC_DEV) 146 is_dmic_dev = true; 147 } 148 149 switch (config) { 150 case ACP_CONFIG_0: 151 case ACP_CONFIG_1: 152 case ACP_CONFIG_2: 153 case ACP_CONFIG_3: 154 case ACP_CONFIG_9: 155 case ACP_CONFIG_15: 156 dev_dbg(&pci->dev, "Audio Mode %d\n", config); 157 break; 158 default: 159 if (is_dmic_dev) { 160 acp_data->pdev_mask = ACP63_PDM_DEV_MASK; 161 acp_data->pdev_count = ACP63_PDM_MODE_DEVS; 162 } 163 break; 164 } 165 } 166
On 21/12/22 23:10, kernel test robot wrote:
Hi Vijendar,
Thank you for the patch! Perhaps something to improve:
Issue is already fixed and updated patch series as V2 version. Because of version mismatch , test robot picked older patch series.
-- Vijendar
[auto build test WARNING on broonie-sound/for-next] [also build test WARNING on linus/master next-20221220] [cannot apply to v6.1] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit-scm.co...]
url: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com... base: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel... for-next patch link: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kerne... patch subject: [PATCH V2 1/4] ASoC: amd: ps: implement api to retrieve acp device config config: i386-allyesconfig compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 reproduce (this is a W=1 build): # https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com... git remote add linux-review https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com... git fetch --no-tags linux-review Vijendar-Mukunda/ASoC-amd-ps-implement-api-to-retrieve-acp-device-config/20221221-192703 git checkout a47d6a455ff7716688a8c7efaae89f07cebf118d # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=i386 olddefconfig make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash sound/soc/amd/ps/
If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot lkp@intel.com
All warnings (new ones prefixed by >>):
sound/soc/amd/ps/pci-ps.c:135:6: warning: no previous prototype for 'get_acp63_device_config' [-Wmissing-prototypes]
135 | void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data) | ^~~~~~~~~~~~~~~~~~~~~~~
sound/soc/amd/ps/pci-ps.c: In function 'snd_acp63_probe': sound/soc/amd/ps/pci-ps.c:231:74: error: 'ACP_DMIC_ADDR' undeclared (first use in this function); did you mean 'ACP63_DMIC_ADDR'? 231 | adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP_DMIC_ADDR, 0); | ^~~~~~~~~~~~~ | ACP63_DMIC_ADDR sound/soc/amd/ps/pci-ps.c:231:74: note: each undeclared identifier is reported only once for each function it appears in
vim +/get_acp63_device_config +135 sound/soc/amd/ps/pci-ps.c
134
135 void get_acp63_device_config(u32 config, struct pci_dev *pci, struct acp63_dev_data *acp_data)
136 { 137 struct acpi_device *dmic_dev; 138 const union acpi_object *obj; 139 bool is_dmic_dev = false; 140 141 dmic_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP63_DMIC_ADDR, 0); 142 if (dmic_dev) { 143 if (!acpi_dev_get_property(dmic_dev, "acp-audio-device-type", 144 ACPI_TYPE_INTEGER, &obj) && 145 obj->integer.value == ACP_DMIC_DEV) 146 is_dmic_dev = true; 147 } 148 149 switch (config) { 150 case ACP_CONFIG_0: 151 case ACP_CONFIG_1: 152 case ACP_CONFIG_2: 153 case ACP_CONFIG_3: 154 case ACP_CONFIG_9: 155 case ACP_CONFIG_15: 156 dev_dbg(&pci->dev, "Audio Mode %d\n", config); 157 break; 158 default: 159 if (is_dmic_dev) { 160 acp_data->pdev_mask = ACP63_PDM_DEV_MASK; 161 acp_data->pdev_count = ACP63_PDM_MODE_DEVS; 162 } 163 break; 164 } 165 } 166
participants (3)
-
kernel test robot
-
Mukunda,Vijendar
-
Vijendar Mukunda