From patchwork Mon Apr 3 07:16:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 78383 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2118487vqo; Mon, 3 Apr 2023 00:25:23 -0700 (PDT) X-Google-Smtp-Source: AKy350Z+B1FHm2lfH6cJzheKlE6PTyYm6YjB/C6r+a/GBx9uNbURV2IHXCkAiOk+MFY8tucQfVVr X-Received: by 2002:a17:903:5c5:b0:1a2:626b:ba1d with SMTP id kf5-20020a17090305c500b001a2626bba1dmr16422211plb.39.1680506722796; Mon, 03 Apr 2023 00:25:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680506722; cv=pass; d=google.com; s=arc-20160816; b=I/pW5JdEMBXgKlZT09jRsmEQoI9VCFU4JSHDJj1DjOJK6GP/TZR+N/9sCJryCdf7Fy 82IRz/FlEbQp4C0aIRFP8BU1ZS5v1IY3pMrQ3jMQrcDMft1WGmpyqONKYTZdvdUgIQSK xjWGcsJY0eYu7wbc01z3dJ3JvUgOaFI8mEupaYYFNUmuuvHaK/MjydS6dk3PRczRdnOE u3tpaObLK9UxctjUwbk748tgUuyMdFOo6ZKnKEga1X6pN5Clde2mmTUZLl2U9a8Mc85D 0cH+l/ZzZK8wN700/qLX99cz91rN4R6X6OaHmUM13K1+BIDaJDvGoKZHJj20uR6jtYaO KaTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=8n/53dGixqmTf7EBH7T0wScMI5OtjUU7wS6fFwxFPYE=; b=sq4uo32FQp15v+UICrB60kMaZO+/BPKl4u+DEzp0Vj30uwIr12IMf687uQ2lIyWNdV TC8NUvCI8OD4fjB2YZlxkEl2o6BwiybmVqJETKWLieLO5u7O/1n8THCYOyt/hH5+49B3 tpTnPJg8svpUhTK/pIgZf3S4EXbbQ3tXOo3keUeGWGe3mxiWmZ2fPrcP7ciN3DCn3Kcz DgU2yAa3jyuTgCwtqz4xr5goT/r3qBTy2wIqrZqTa+ZaO5FhaPE4+YLlqyz5iq1FJWV0 9jpLdjdQG6V2sW7EWfNog647tUCkiIM2up4X3JhG4RykXwH0qI5gQhphR0TeBDZ5jcZm ToIA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="bNc/eP21"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u37-20020a634725000000b0050c164c8e99si7181349pga.436.2023.04.03.00.25.09; Mon, 03 Apr 2023 00:25:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="bNc/eP21"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231618AbjDCHNt (ORCPT + 99 others); Mon, 3 Apr 2023 03:13:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231329AbjDCHN1 (ORCPT ); Mon, 3 Apr 2023 03:13:27 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2061.outbound.protection.outlook.com [40.107.220.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8DB9CC1B for ; Mon, 3 Apr 2023 00:13:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MmMqEwrluihVwR+n1fvlixp6o3f6MuUP0ZBzHU7p5KnEI0B1SBv9pRyTmOVLHZt3Ta6l9Uz7SaTrzRLEut7lMM5CopD/WZNufBUzCP2FdbkVkCI1VWp0Aocu283tpM8jczTT8dDF7Oofdt5/PPK8e0Tk7BpbXWHW1VZ/3yjC76YjxbtxVPIYz95QYgeBgyVxDC/xikpmCxJeby0qiraKeCOoeYCsvwPwb5u8KzvW2fsLlrT6iyH4El9i73XKV+0ZDIGzDy804Ue6OxI9dcZVGu+ySCGiqdgUOTY/XrBdnHkUhjr29cMDZ0kA7VM4juypz35S8upQ7bgVfCNWyXTW8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8n/53dGixqmTf7EBH7T0wScMI5OtjUU7wS6fFwxFPYE=; b=GFdDfWUYRZLV/w6iiQx/2U5O2c4NX+1KCnQnSKYhRk6HD9C9MkL111ECl/qN1gVQIt3jCLx622h8j9FzhEPH0abik1yzWCmQHTUeKcv0TAmwXKXoTAC56NslwwktP/Z6PIRwNO/cTvwIlxGoUXrZG4biB1wgXNnGi8FfXdV9L+vEIcicJOrFLDgK6M6gh/JDCiSvR/+p0tInW+SG7hO9hcrJTWGOVlL4qCw6MjD9drnN/yzLMfHp7YGdNoyQpgS4XiXI/S8WO4fECh23SfmzmWRUxgW8C02DiUB5As7nahfAG9bCgGxdZF2TILipmGUJTv1mq4S8azRRrqmWrbTXuQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8n/53dGixqmTf7EBH7T0wScMI5OtjUU7wS6fFwxFPYE=; b=bNc/eP21yulsZfkb4iGujmDgUAXjPh9sglMza7eGfyS0Wz92J1rtQkZZwpIgwU6IZpiJqTUftyk3fHetYuZnJWa17PJkxvfPhcU6meatZ/E9TRx0qWd0bX767gLhO4Qr4gApXhByLNvehruxEVfybdwdq3PFnKcOfq0o/K6yeQQ= Received: from MW4PR03CA0143.namprd03.prod.outlook.com (2603:10b6:303:8c::28) by MN2PR12MB4343.namprd12.prod.outlook.com (2603:10b6:208:26f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.33; Mon, 3 Apr 2023 07:13:19 +0000 Received: from CO1NAM11FT036.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8c:cafe::cd) by MW4PR03CA0143.outlook.office365.com (2603:10b6:303:8c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.20 via Frontend Transport; Mon, 3 Apr 2023 07:13:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT036.mail.protection.outlook.com (10.13.174.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6277.16 via Frontend Transport; Mon, 3 Apr 2023 07:13:19 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 3 Apr 2023 02:13:17 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 3 Apr 2023 02:13:13 -0500 From: Vijendar Mukunda To: CC: , , , Vijendar Mukunda , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , "Bard Liao" , Ranjani Sridharan , Kai Vehmanen , Daniel Baluta , Jaroslav Kysela , Takashi Iwai , "Ajit Kumar Pandey" , Rander Wang , "V sujith kumar Reddy" , Zheng Bin , "moderated list:SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS" , open list Subject: [PATCH 1/6] ASoC: SOF: amd: remove unused code Date: Mon, 3 Apr 2023 12:46:41 +0530 Message-ID: <20230403071651.919027-1-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT036:EE_|MN2PR12MB4343:EE_ X-MS-Office365-Filtering-Correlation-Id: 65a52ce6-16a6-4c62-cc45-08db3412e704 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Lusrul71Vey2OEtv9RLtKtGlf98I9JP17VvLKdogXbOEiewPlbq0GfB4uud0Px7J1yoF/ScHS1NgY2bCYo4rdImLBqIpj6SNoSQeU/5qc8vH2C8PhGu6iE9EgAPTLSBcOUio+fWQU78ZFgy7QOQx2/VuM841+xlMcGxYM1Hf5702BA0hBKguGhJIll12i78cwy+8fNm1WW4RSG1tDuaPgdxweAf5qfh77C+I/lFqndKPIhhOYmEFFKtv6KQrmzU5U2FbUMqs2SG6529KClIbIiDnEZZa7vSb8zx4rQz72mm7ray/0RBxjcLbOrQmzvV1efP9YuGEw54vhIKrK27uLRqmmrv6s13F0ZvBcah95o383HhWfnz8thRcUHHPQy6F3FLjot9kuCKclwIjuge+Ugy/DIJSHOsyuv5MJijGgjNvLnsl7Cq65GMMy1LMoEuISq0oi7bXvwrW3JTOjRLa9Ju6nOHWVM+1CfCEjmpXLzbZjK7yfHRNzCMZsCF9P+E+f7TUghgopr3V++tSMgftO1znivzlphaVF/L2Ov1BrVhH2Wri64APvi+LIW6kh+djXuNpBmy4M6vKbgYdQIZV5+YHmJWsKrukaDhR33qTUnFBi8vywOjPAx7Nlg2uNuVWELQo1Tjr2TSJDo15EYZTk44yp/+t+vTv7Im+dMHlC6r5L3AUale7ZxBOtZ5FLBGiI9/Mog3iBwwqno2Uy0kosN0U/ZpZv7yYipXsM3SKcOg= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(136003)(39860400002)(396003)(451199021)(40470700004)(46966006)(36840700001)(86362001)(36756003)(82310400005)(2906002)(40480700001)(2616005)(7696005)(336012)(426003)(83380400001)(186003)(47076005)(26005)(1076003)(6666004)(6916009)(4326008)(36860700001)(70586007)(8676002)(70206006)(40460700003)(41300700001)(81166007)(82740400003)(5660300002)(356005)(7416002)(316002)(54906003)(478600001)(8936002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2023 07:13:19.1401 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 65a52ce6-16a6-4c62-cc45-08db3412e704 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT036.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4343 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762139017010055140?= X-GMAIL-MSGID: =?utf-8?q?1762139017010055140?= During initial SOF driver bring up on AMD platforms, only DMIC support was added. As of today, we have a complete SOF solution for I2S endpoints along with DMIC endpoint. This code is no longer required. Remove unused code from RMB and RN platform ACP PCI driver. Signed-off-by: Vijendar Mukunda --- sound/soc/sof/amd/pci-rmb.c | 70 +------------------------------------ sound/soc/sof/amd/pci-rn.c | 70 +------------------------------------ 2 files changed, 2 insertions(+), 138 deletions(-) diff --git a/sound/soc/sof/amd/pci-rmb.c b/sound/soc/sof/amd/pci-rmb.c index 4e1de462b431..d0a56e8f09c0 100644 --- a/sound/soc/sof/amd/pci-rmb.c +++ b/sound/soc/sof/amd/pci-rmb.c @@ -27,22 +27,6 @@ #define ACP6x_REG_END 0x125C000 static struct platform_device *dmic_dev; -static struct platform_device *pdev; - -static const struct resource rembrandt_res[] = { - { - .start = 0, - .end = ACP6x_REG_END - ACP6x_REG_START, - .name = "acp_mem", - .flags = IORESOURCE_MEM, - }, - { - .start = 0, - .end = 0, - .name = "acp_dai_irq", - .flags = IORESOURCE_IRQ, - }, -}; static const struct sof_amd_acp_desc rembrandt_chip_info = { .rev = 6, @@ -83,11 +67,8 @@ static const struct sof_dev_desc rembrandt_desc = { static int acp_pci_rmb_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { - struct platform_device_info pdevinfo; struct device *dev = &pci->dev; - const struct resource *res_i2s; - struct resource *res; - unsigned int flag, i, addr; + unsigned int flag; int ret; flag = snd_amd_acp_find_config(pci); @@ -104,53 +85,6 @@ static int acp_pci_rmb_probe(struct pci_dev *pci, const struct pci_device_id *pc sof_pci_remove(pci); return PTR_ERR(dmic_dev); } - - /* Register platform device only if flag set to FLAG_AMD_SOF_ONLY_DMIC */ - if (flag != FLAG_AMD_SOF_ONLY_DMIC) - return 0; - - addr = pci_resource_start(pci, 0); - res = devm_kzalloc(&pci->dev, sizeof(struct resource) * ARRAY_SIZE(rembrandt_res), - GFP_KERNEL); - if (!res) { - platform_device_unregister(dmic_dev); - sof_pci_remove(pci); - return -ENOMEM; - } - - res_i2s = rembrandt_res; - for (i = 0; i < ARRAY_SIZE(rembrandt_res); i++, res_i2s++) { - res[i].name = res_i2s->name; - res[i].flags = res_i2s->flags; - res[i].start = addr + res_i2s->start; - res[i].end = addr + res_i2s->end; - if (res_i2s->flags == IORESOURCE_IRQ) { - res[i].start = pci->irq; - res[i].end = res[i].start; - } - } - - memset(&pdevinfo, 0, sizeof(pdevinfo)); - - /* - * We have common PCI driver probe for ACP device but we have to support I2S without SOF - * for some distributions. Register platform device that will be used to support non dsp - * ACP's audio ends points on some machines. - */ - pdevinfo.name = "acp_asoc_rembrandt"; - pdevinfo.id = 0; - pdevinfo.parent = &pci->dev; - pdevinfo.num_res = ARRAY_SIZE(rembrandt_res); - pdevinfo.res = &res[0]; - - pdev = platform_device_register_full(&pdevinfo); - if (IS_ERR(pdev)) { - dev_err(&pci->dev, "cannot register %s device\n", pdevinfo.name); - platform_device_unregister(dmic_dev); - sof_pci_remove(pci); - ret = PTR_ERR(pdev); - } - return ret; }; @@ -158,8 +92,6 @@ static void acp_pci_rmb_remove(struct pci_dev *pci) { if (dmic_dev) platform_device_unregister(dmic_dev); - if (pdev) - platform_device_unregister(pdev); sof_pci_remove(pci); } diff --git a/sound/soc/sof/amd/pci-rn.c b/sound/soc/sof/amd/pci-rn.c index fca40b261671..faab4c33a24d 100644 --- a/sound/soc/sof/amd/pci-rn.c +++ b/sound/soc/sof/amd/pci-rn.c @@ -27,22 +27,6 @@ #define ACP3x_REG_END 0x125C000 static struct platform_device *dmic_dev; -static struct platform_device *pdev; - -static const struct resource renoir_res[] = { - { - .start = 0, - .end = ACP3x_REG_END - ACP3x_REG_START, - .name = "acp_mem", - .flags = IORESOURCE_MEM, - }, - { - .start = 0, - .end = 0, - .name = "acp_dai_irq", - .flags = IORESOURCE_IRQ, - }, -}; static const struct sof_amd_acp_desc renoir_chip_info = { .rev = 3, @@ -83,11 +67,8 @@ static const struct sof_dev_desc renoir_desc = { static int acp_pci_rn_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { - struct platform_device_info pdevinfo; struct device *dev = &pci->dev; - const struct resource *res_i2s; - struct resource *res; - unsigned int flag, i, addr; + unsigned int flag; int ret; flag = snd_amd_acp_find_config(pci); @@ -104,53 +85,6 @@ static int acp_pci_rn_probe(struct pci_dev *pci, const struct pci_device_id *pci sof_pci_remove(pci); return PTR_ERR(dmic_dev); } - - /* Register platform device only if flag set to FLAG_AMD_SOF_ONLY_DMIC */ - if (flag != FLAG_AMD_SOF_ONLY_DMIC) - return 0; - - addr = pci_resource_start(pci, 0); - res = devm_kzalloc(&pci->dev, sizeof(struct resource) * ARRAY_SIZE(renoir_res), GFP_KERNEL); - if (!res) { - sof_pci_remove(pci); - platform_device_unregister(dmic_dev); - return -ENOMEM; - } - - res_i2s = renoir_res; - for (i = 0; i < ARRAY_SIZE(renoir_res); i++, res_i2s++) { - res[i].name = res_i2s->name; - res[i].flags = res_i2s->flags; - res[i].start = addr + res_i2s->start; - res[i].end = addr + res_i2s->end; - if (res_i2s->flags == IORESOURCE_IRQ) { - res[i].start = pci->irq; - res[i].end = res[i].start; - } - } - - memset(&pdevinfo, 0, sizeof(pdevinfo)); - - /* - * We have common PCI driver probe for ACP device but we have to support I2S without SOF - * for some distributions. Register platform device that will be used to support non dsp - * ACP's audio ends points on some machines. - */ - - pdevinfo.name = "acp_asoc_renoir"; - pdevinfo.id = 0; - pdevinfo.parent = &pci->dev; - pdevinfo.num_res = ARRAY_SIZE(renoir_res); - pdevinfo.res = &res[0]; - - pdev = platform_device_register_full(&pdevinfo); - if (IS_ERR(pdev)) { - dev_err(&pci->dev, "cannot register %s device\n", pdevinfo.name); - sof_pci_remove(pci); - platform_device_unregister(dmic_dev); - ret = PTR_ERR(pdev); - } - return ret; }; @@ -158,8 +92,6 @@ static void acp_pci_rn_remove(struct pci_dev *pci) { if (dmic_dev) platform_device_unregister(dmic_dev); - if (pdev) - platform_device_unregister(pdev); return sof_pci_remove(pci); } From patchwork Mon Apr 3 07:16:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 78382 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2116786vqo; Mon, 3 Apr 2023 00:20:47 -0700 (PDT) X-Google-Smtp-Source: AKy350afuPWDsTXHby8wdv/Mb07fTlGha93oKXe34PKiA7VZVK023ndYmwBM/qVUJgmSUjchR6GO X-Received: by 2002:a62:18c4:0:b0:619:53de:8880 with SMTP id 187-20020a6218c4000000b0061953de8880mr32268437pfy.16.1680506447592; Mon, 03 Apr 2023 00:20:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680506447; cv=pass; d=google.com; s=arc-20160816; b=swWFHGqGk3rNvLQORPo4wxMYchV0JHzJkW2TWgWeOQVZbLshHxNijo1lyNOZAYaQTe C+1xVdzmQeEjV2Bnb9vCkwHhiuYF8DLZoSUTYVijlSxdD2mTALtrUQEn2PBDi6fuuGFI f1nZU0bZL99cvAuK1g/PX8Km7xqp3cH/9p/TvrVcQcSTWZ6aURcxBVMacziBOrDlccy9 Ro3o7CHEW7OUWAhSC/m36G2GkfYW+VrYQs8mcy5AAtqh/kFcTaGFi3VNFzui7ajFuyIU A3ZWLDISzGNKgE28sw76MG3U7eyu7q0i4R3rm11QO4L6x5tYmDX0XZmK66sOyUi2bbSu qg+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=a8K0kPBo0TooEDURIhzOjlCFAL/SHOUXCK2CdNyCA6Y=; b=Jg6W4NOlnxdrYBwcDiAXMourUAIpCrXhf7E3xRSWBh5ax8beWrq0ivVmCgmRDbOTcV Rudw8k2ne/lAA16m72c7GnwL6vFRNFsx1r0pfo5jqCdsld1T8YiGagWpVyI+PccCWzCC 1D5NS2nfdNu/G/VWLV7APcQtlrolYcA3DVfxd27dppLhNxuevbsdC88MaAk2be0cbUmD pWfEDTyfVP6rHN6T0WqY6Fcvgru7Cc+TWCWp7x2YLQixEVx9yFF43EpebJYTX48HoCOa 4uAWCxAacfGCYlQNx4+xupNSHIP2N478yXZrWEWScRgN4+Mha+tOmaUKF1pcNKEcl/9a H++Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=NvTVDFiq; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e22-20020a63e016000000b0050f53eec0adsi7381454pgh.616.2023.04.03.00.20.08; Mon, 03 Apr 2023 00:20:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=NvTVDFiq; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231727AbjDCHOC (ORCPT + 99 others); Mon, 3 Apr 2023 03:14:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231530AbjDCHNg (ORCPT ); Mon, 3 Apr 2023 03:13:36 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2045.outbound.protection.outlook.com [40.107.244.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0CF383E0 for ; Mon, 3 Apr 2023 00:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EatI6ZKJk6jvgAazpQDfJoknxZZlhrXOqCB/O9SgAa+CnSujLwTwG2If0XrEW9x1qE7vPBh6eaG7wwYF+P12pp55vzfj3vBl89A70grCRzjRsmtYWXt6BMRaHkW1NyeNWm2FjzJ0rOfyn0wAV6IFtQPkPvtc5xKrbbuA1r4XBWg0M5LkNhyLfN9/jX6s57V6tailGBuGBqdOzgQM9fd3/hiVXXWwVVWbgDXzYYvPWXvEUA8aco3Axmjn1HhTbHkhLHObbGP9sNrCQGCnoJ6SAnIsFpvFAjIxZvR+PimPu38Z3vaTX3baYJux7RlD92wTbxhRkxVRbeqoPZYz8Q3QXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=a8K0kPBo0TooEDURIhzOjlCFAL/SHOUXCK2CdNyCA6Y=; b=hMZepzat4YoMvnkIM7bSkFWXEzCSvqX8ksu3kXZBN0q6TPOsggKLVUQDAzMm/qr4O8P/gA+080GBHc5GmKNxeo40pAeSp42m8Ab70wxfTv1++lELsfjtB7WUoYX90jpDfIt2V4sHdZWFmD4LQDJwkzndHrwEN0kXqOY7YlWhl/PNAUBeP4FYyfBBCkreLpmVEGbSpB0KbKuATy9oD5qIorzzIm7U8VNfEFJ5ICggfxoDoeLt0WOcSQ38/ZSyrTYIoe5GjHtayW2sYD2APSFFhc2fK96eRFUMp82guU1yZtgiLRINq3UgkoVai3z4PTWTJyfnIii5/L/AT+jOs4Hudw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a8K0kPBo0TooEDURIhzOjlCFAL/SHOUXCK2CdNyCA6Y=; b=NvTVDFiqt++/kgEGuNHOnmFwq06pCFZr6FAr3hQXSotTrQs4OTNh9XuPl8GqCW/roDuZTVmbA9scLZt3jjdRp1gse+ZW5poXAJUWbfFep/aDhiECUhR6jPiPyrt4NNlsJ1701I+IzmuMQOgGQrE72jLXr7ByzLlGOsy4ie0W4iM= Received: from MW4PR04CA0320.namprd04.prod.outlook.com (2603:10b6:303:82::25) by CH2PR12MB4214.namprd12.prod.outlook.com (2603:10b6:610:aa::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.33; Mon, 3 Apr 2023 07:13:32 +0000 Received: from CO1NAM11FT063.eop-nam11.prod.protection.outlook.com (2603:10b6:303:82:cafe::28) by MW4PR04CA0320.outlook.office365.com (2603:10b6:303:82::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.22 via Frontend Transport; Mon, 3 Apr 2023 07:13:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT063.mail.protection.outlook.com (10.13.175.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6277.14 via Frontend Transport; Mon, 3 Apr 2023 07:13:31 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 3 Apr 2023 02:13:29 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 3 Apr 2023 02:13:29 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 3 Apr 2023 02:13:25 -0500 From: Vijendar Mukunda To: CC: , , , Vijendar Mukunda , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , "Bard Liao" , Ranjani Sridharan , Kai Vehmanen , Daniel Baluta , Jaroslav Kysela , Takashi Iwai , "V sujith kumar Reddy" , Ajit Kumar Pandey , "moderated list:SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS" , open list Subject: [PATCH 2/6] ASoC: SOF: amd: remove acp_dai_probe() function Date: Mon, 3 Apr 2023 12:46:42 +0530 Message-ID: <20230403071651.919027-2-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403071651.919027-1-Vijendar.Mukunda@amd.com> References: <20230403071651.919027-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT063:EE_|CH2PR12MB4214:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c8edd95-836a-40d4-9ce5-08db3412ee84 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Bh5Efio6CEkkC+S9C05gYEYWGCjH7jNBgabN8UzJdZB3vgxSoKXT73Vki0M6U9tgmyhCuo2DCojZObnkYv1tE3LyjGBYfI65fZG7fXnu5ZIJcEv3MrhvBPERf1UNVfNqjgzFRbtV3MLAktX4Y4pMWxCw+5gZMUuNBXvH142bdnMfUutkE3sqYMHb3pbBqhG3HN2gE8sM4FgCczl+m0y9aPNqo75Gdq4x9GcebHyYhWEcREhIhHizte7o3NkjsWf7YyziNFu+LF63LsXwyuBaKPvHGAZYaPLXoez8SWA/pCJJYXQ8rs2xwvSNnCECQJu5BfUzsbtCf/IShIlf3+ZgTSdoLX65bncRK/KFFLzATHuPXyeuELdq5MhNgP+tpBp+VZymbg1DwO8BdxTU0lsvWea2DbPgeoctzCgpMkiquny7BSki/ILBHnXL4Vb74zf1sACV3u/Ku2ElADIxCeUAlpoeV+9TsBxPbBgfaM96/fGXJRRtS7+tlpRN191EihVg9AL+x5Q40U7XzxggGXpzkXbi6YeY0A18AO9aYg++LYqyYUsim9JJyQGr2ctfPD4TOsTFdGzIxKPiVNBalY93MP4q2YDjXVLqTHOoTlO9U2C+wuDLMq3fzJBKnhUfiJj5KwDJ8uJtH1mC1P8UmFVbjyZ1RHVzafbJqtOIHe9BX0GPq7Hz87RybAbIkc5VFzLSnFzpe+CLI+PZlGSAigEDK+ndO1v73+2IqM/zo10mduQ= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(376002)(346002)(136003)(451199021)(46966006)(40470700004)(36840700001)(7416002)(41300700001)(4326008)(82740400003)(82310400005)(8936002)(81166007)(6916009)(26005)(356005)(316002)(5660300002)(86362001)(54906003)(70206006)(70586007)(8676002)(36860700001)(478600001)(2906002)(47076005)(83380400001)(336012)(426003)(7696005)(40460700003)(2616005)(186003)(40480700001)(36756003)(6666004)(1076003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2023 07:13:31.7375 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8c8edd95-836a-40d4-9ce5-08db3412ee84 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT063.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4214 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762138728678988889?= X-GMAIL-MSGID: =?utf-8?q?1762138728678988889?= ACP SOF driver supports different audio configurations. Explicit condition check for I2S configuration will break other audio endpoint configurations. acp_dai_probe() function is not required as we have machine select logic to select the exact machine. Remove acp_dai_probe() from existing AMD PCI driver code base. Signed-off-by: Vijendar Mukunda --- sound/soc/sof/amd/acp-common.c | 16 ---------------- sound/soc/sof/amd/acp.h | 1 - sound/soc/sof/amd/rembrandt.c | 4 ---- sound/soc/sof/amd/renoir.c | 3 --- 4 files changed, 24 deletions(-) diff --git a/sound/soc/sof/amd/acp-common.c b/sound/soc/sof/amd/acp-common.c index 8ce4c8956933..df36b411a12e 100644 --- a/sound/soc/sof/amd/acp-common.c +++ b/sound/soc/sof/amd/acp-common.c @@ -18,22 +18,6 @@ #include "acp-dsp-offset.h" #include -int acp_dai_probe(struct snd_soc_dai *dai) -{ - struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(dai->component); - const struct sof_amd_acp_desc *desc = get_chip_info(sdev->pdata); - unsigned int val; - - val = snd_sof_dsp_read(sdev, ACP_DSP_BAR, desc->i2s_pin_config_offset); - if (val != desc->i2s_mode) { - dev_err(sdev->dev, "I2S Mode is not supported (I2S_PIN_CONFIG: %#x)\n", val); - return -EINVAL; - } - - return 0; -} -EXPORT_SYMBOL_NS(acp_dai_probe, SND_SOC_SOF_AMD_COMMON); - /** * amd_sof_ipc_dump() - This function is called when IPC tx times out. * @sdev: SOF device. diff --git a/sound/soc/sof/amd/acp.h b/sound/soc/sof/amd/acp.h index acad57947616..d7fc24917b3c 100644 --- a/sound/soc/sof/amd/acp.h +++ b/sound/soc/sof/amd/acp.h @@ -248,7 +248,6 @@ int sof_renoir_ops_init(struct snd_sof_dev *sdev); extern struct snd_sof_dsp_ops sof_rembrandt_ops; int sof_rembrandt_ops_init(struct snd_sof_dev *sdev); -int acp_dai_probe(struct snd_soc_dai *dai); struct snd_soc_acpi_mach *amd_sof_machine_select(struct snd_sof_dev *sdev); /* Machine configuration */ int snd_amd_acp_find_config(struct pci_dev *pci); diff --git a/sound/soc/sof/amd/rembrandt.c b/sound/soc/sof/amd/rembrandt.c index 5288ab882fc9..f1d1ba57ab3a 100644 --- a/sound/soc/sof/amd/rembrandt.c +++ b/sound/soc/sof/amd/rembrandt.c @@ -48,7 +48,6 @@ static struct snd_soc_dai_driver rembrandt_sof_dai[] = { .rate_min = 8000, .rate_max = 48000, }, - .probe = &acp_dai_probe, }, [I2S_BT_INSTANCE] = { @@ -73,7 +72,6 @@ static struct snd_soc_dai_driver rembrandt_sof_dai[] = { .rate_min = 8000, .rate_max = 48000, }, - .probe = &acp_dai_probe, }, [I2S_SP_INSTANCE] = { @@ -98,7 +96,6 @@ static struct snd_soc_dai_driver rembrandt_sof_dai[] = { .rate_min = 8000, .rate_max = 48000, }, - .probe = &acp_dai_probe, }, [PDM_DMIC_INSTANCE] = { @@ -126,7 +123,6 @@ static struct snd_soc_dai_driver rembrandt_sof_dai[] = { .rate_min = 8000, .rate_max = 96000, }, - .probe = &acp_dai_probe, }, }; diff --git a/sound/soc/sof/amd/renoir.c b/sound/soc/sof/amd/renoir.c index adade2e3d3be..47b863f6258c 100644 --- a/sound/soc/sof/amd/renoir.c +++ b/sound/soc/sof/amd/renoir.c @@ -47,7 +47,6 @@ static struct snd_soc_dai_driver renoir_sof_dai[] = { .rate_min = 8000, .rate_max = 48000, }, - .probe = &acp_dai_probe, }, [I2S_SP_INSTANCE] = { @@ -72,7 +71,6 @@ static struct snd_soc_dai_driver renoir_sof_dai[] = { .rate_min = 8000, .rate_max = 48000, }, - .probe = &acp_dai_probe, }, [PDM_DMIC_INSTANCE] = { @@ -100,7 +98,6 @@ static struct snd_soc_dai_driver renoir_sof_dai[] = { .rate_min = 8000, .rate_max = 96000, }, - .probe = &acp_dai_probe, }, }; From patchwork Mon Apr 3 07:16:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 78384 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2118770vqo; Mon, 3 Apr 2023 00:26:09 -0700 (PDT) X-Google-Smtp-Source: AKy350YjXY6LJjG+/2xn9ThLYibkh22eTjiwNKbJCdSFKMnG8tzvUtiuXNPyVfmKn7wb6GW3JIz/ X-Received: by 2002:aa7:c703:0:b0:4fa:b302:84d4 with SMTP id i3-20020aa7c703000000b004fab30284d4mr35485405edq.13.1680506769050; Mon, 03 Apr 2023 00:26:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680506769; cv=pass; d=google.com; s=arc-20160816; b=W/yZDWt5s1aGXxxqbHmymZWwY/xnJvS/jDwLsax62+yU2YpCaSSp6TNZbUnrwg8F7L uWIOPQAM/5/CIO+FRAOWH/uwQltFc5v+FpWzhHjvksBHbHtyAp+ReZNFwL+ATMwZE6Ie cLK8COTf2c6GcgqPHxDh6V3jdtbKHAoIv/Umyw3N0DpEEPCzVXn39+hiIYF7l9u4HNrs BuZsQyVaUX2AJqvxbZoXJ5w2QdiqiMFgZYVt907SjzaXHcYgQz5pzjO/BBTER5QLYITM LUZUuAXdq64uj3BbNULM6cgoL/lGmZOUuyaR5AzFAsDhjuEqSlZgSsrvvu0UotNksELq qSLQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LYOQUaRANHm3nHfpODC+EOHWLnrfIxGi+XUDviy7VX4=; b=TD6mN3o/IPc6dtDbP8cgg99wgzirCKFKZF1qBptXhSQGkNGVBrrwxW3u8jjycfnTCQ 77++ohHj40gYpck6fouedpTHRt+6m+RjeRuBzg5FPiqZahcFVK/vGHf4zt8pcuFkgtER inmcrvDWunvRPyJ1HmW6XrqZUhry01vkvxeXtivsHScoLKAxsm06isDIHAeyFrRaCDTf ripmjVxe2Wci1JaIuZ0gSE57IVJqQo93nj7RMzfWjoef548yLPKNCOOLM8WtNgpsSaI5 hBzXwNkpbiRdyKM1OwDdx9DrQ1C0jrPn+t7VB/6wckvkn2UbdeskUDxU3d288zMNbfGE qYlA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=tz0p4Jyd; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e18-20020a50fb92000000b004bba31f3e01si6870512edq.65.2023.04.03.00.25.45; Mon, 03 Apr 2023 00:26:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=tz0p4Jyd; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231706AbjDCHOj (ORCPT + 99 others); Mon, 3 Apr 2023 03:14:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231700AbjDCHOX (ORCPT ); Mon, 3 Apr 2023 03:14:23 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2068.outbound.protection.outlook.com [40.107.244.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E22EDBD1 for ; Mon, 3 Apr 2023 00:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ShSk7m/69omrko/AJThzaTB/y5GXp7nn7x3vvfepWMPS5LaICvCVsxEddIl5slgt9wfdaTcP+/XDnLGPxPkUNGYwul4LJtGupOO37UTXfHFOY8qXHh81jiKQ/0CyyfvZvXqQRTPHrDvsyNfxYMcdtT0v+sMA406wd8qgdlYGn4g4tqOMY4rnoSGMNb2MEkoyvjRg8gElrK8h300YuKZYiYsTbCSFUkqpOnrMDIAQkfCO48T3QxoCUjzM7xHw/TQhKVJkiQqu8CYV4nsIX4mrcQOaR+m6jaIZsyfJahknrdnlA2IeE7y1ffYfCJUufG0pMAXLwNafG+chp3c+RXh/wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LYOQUaRANHm3nHfpODC+EOHWLnrfIxGi+XUDviy7VX4=; b=EGri17jFEW47d9w0yTa/zEqI9zWjaCo0GATw4NEXyc0jj4ZSv/MjJqUPyIvp76w8xsob4DztnYmVklrccc3E13tghq93jgwdlogp/YzPYQ6Cfapacif4nw59khMUdmwc++QYGgtLrIAK15v2zZVhGfknqqJOmKXsJeKAu2MyxlzZbD1au2HCTTPG9BfCM42Z5RqFBFHp4p/YbbnWsIFmlbuvdvsAjREVX597WsXTJXdFWPFIw10zspYu6mm96dKz/LBfbbozs3bFo6d3ePmf/lNJ3AI5OqVaFNrSVWevsp75Y04LsjE6rd+XK1DlD6wHvOM3322SCfyOjw0Jqc+5Bw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LYOQUaRANHm3nHfpODC+EOHWLnrfIxGi+XUDviy7VX4=; b=tz0p4Jydj8JFFjs58U4JmDJJhbQTr7mFBZClaz/FKbHKuXsRXCV5wAa0CnmoASziQQuLuQ2tHh8VGkF7i5rvYo8hzqNChes8MIpW4/tGi3jDNJnSKmkKiIQHBDg5/Aax9ehRkt9wUU79sSXqXMwCJNlRo5clsTaspzYdh+KxlJc= Received: from MW4PR04CA0319.namprd04.prod.outlook.com (2603:10b6:303:82::24) by DS0PR12MB7925.namprd12.prod.outlook.com (2603:10b6:8:14b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.30; Mon, 3 Apr 2023 07:14:10 +0000 Received: from CO1NAM11FT020.eop-nam11.prod.protection.outlook.com (2603:10b6:303:82:cafe::77) by MW4PR04CA0319.outlook.office365.com (2603:10b6:303:82::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.22 via Frontend Transport; Mon, 3 Apr 2023 07:14:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT020.mail.protection.outlook.com (10.13.174.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6277.16 via Frontend Transport; Mon, 3 Apr 2023 07:14:10 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 3 Apr 2023 02:14:04 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 3 Apr 2023 02:13:39 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 3 Apr 2023 02:13:34 -0500 From: Vijendar Mukunda To: CC: , , , Vijendar Mukunda , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , "Bard Liao" , Ranjani Sridharan , Kai Vehmanen , Daniel Baluta , Jaroslav Kysela , Takashi Iwai , "V sujith kumar Reddy" , Ajit Kumar Pandey , Rander Wang , Zheng Bin , "moderated list:SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS" , open list Subject: [PATCH 3/6] ASoC: SOF: amd: remove unused variables Date: Mon, 3 Apr 2023 12:46:43 +0530 Message-ID: <20230403071651.919027-3-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403071651.919027-1-Vijendar.Mukunda@amd.com> References: <20230403071651.919027-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT020:EE_|DS0PR12MB7925:EE_ X-MS-Office365-Filtering-Correlation-Id: fde34700-27ca-4fd3-f3fd-08db34130578 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bWIkpO0fBzlzPA/Cfs9a2INgS5rIy0LjY523NGhPvqsgXwOciWkge5WuyGSspBBcXfe9QFE3AFGrc6rNm8nfUmoyjh/Swkyb3ZmKAcX0gkX3ukavTTX0PBBVDwiYz4btXX9dY10Cl+VKsbqR5NGD8GtpS4N62sjwA5hT/56rxHHwaF7REoQXacdbZaleoeZ9e+Q2ZjuQyFtJLESB80hP/Lz7LxRcDwiT6+pOeVXrSvCyV0fdjzEuAfMxVuaskagode2fD8Qh/pEoTw9QC+n6cH7+bDVJ2oGgPXJAHP1vcJlDUGyQrsmqX0BNBaizl+uzKLPMQRnSjs7wY1uSsMKmAbTpJkvThhiA1So4MHkVuSit0elXsNZF1w3pEdQvFC7CaEeAbx6Odoi+zXOjGT/r+mO71qThdO4hzQyCY/1TQYR8haxtLfQVG3EA9R0heyrn+nYKiMQSwYPuz3YmtxZUxAuI1nfP8M86UTdx9BvaD0sb5rJL4TL6ZRMeZDmLcs22JbBEp5ER2teJYf6FNqcY4o+qanQ/DM5HOAieAR6k8+AnadMWnFzkUbKr9i7hAAjRFt2T38whqX9CI+aLknpWR8IxzI2YY4EDJa/HqGX5oke3UdM0WS+VTJ8jhNVgEcrc5Da17hbROPZOwY3V92I9RR+kt8jGndqoXIfix+eliWfDl2QvZxJ6i8uSOrDKI3riy4l9LGujfi+LMJfqRuUL704ubNSQjBQ/TwNlhH46J7E= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(346002)(376002)(451199021)(46966006)(36840700001)(40470700004)(86362001)(82310400005)(2906002)(36756003)(40480700001)(2616005)(7696005)(336012)(83380400001)(426003)(186003)(47076005)(1076003)(26005)(6666004)(8676002)(4326008)(6916009)(70586007)(36860700001)(478600001)(70206006)(40460700003)(41300700001)(81166007)(82740400003)(5660300002)(356005)(7416002)(54906003)(316002)(8936002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2023 07:14:10.2330 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fde34700-27ca-4fd3-f3fd-08db34130578 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT020.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7925 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762139065969046700?= X-GMAIL-MSGID: =?utf-8?q?1762139065969046700?= Remove unused variables - i2s_mode, i2s_pin_config_offset from code. Signed-off-by: Vijendar Mukunda --- sound/soc/sof/amd/acp.h | 2 -- sound/soc/sof/amd/pci-rmb.c | 2 -- sound/soc/sof/amd/pci-rn.c | 2 -- 3 files changed, 6 deletions(-) diff --git a/sound/soc/sof/amd/acp.h b/sound/soc/sof/amd/acp.h index d7fc24917b3c..fd04e5ae7303 100644 --- a/sound/soc/sof/amd/acp.h +++ b/sound/soc/sof/amd/acp.h @@ -158,12 +158,10 @@ struct acp_dsp_stream { struct sof_amd_acp_desc { unsigned int rev; unsigned int host_bridge_id; - unsigned int i2s_mode; u32 pgfsm_base; u32 ext_intr_stat; u32 dsp_intr_base; u32 sram_pte_offset; - u32 i2s_pin_config_offset; u32 hw_semaphore_offset; u32 acp_clkmux_sel; u32 fusion_dsp_offset; diff --git a/sound/soc/sof/amd/pci-rmb.c b/sound/soc/sof/amd/pci-rmb.c index d0a56e8f09c0..2b84f95072d3 100644 --- a/sound/soc/sof/amd/pci-rmb.c +++ b/sound/soc/sof/amd/pci-rmb.c @@ -31,12 +31,10 @@ static struct platform_device *dmic_dev; static const struct sof_amd_acp_desc rembrandt_chip_info = { .rev = 6, .host_bridge_id = HOST_BRIDGE_RMB, - .i2s_mode = 0x0a, .pgfsm_base = ACP6X_PGFSM_BASE, .ext_intr_stat = ACP6X_EXT_INTR_STAT, .dsp_intr_base = ACP6X_DSP_SW_INTR_BASE, .sram_pte_offset = ACP6X_SRAM_PTE_OFFSET, - .i2s_pin_config_offset = ACP6X_I2S_PIN_CONFIG, .hw_semaphore_offset = ACP6X_AXI2DAGB_SEM_0, .acp_clkmux_sel = ACP6X_CLKMUX_SEL, .fusion_dsp_offset = ACP6X_DSP_FUSION_RUNSTALL, diff --git a/sound/soc/sof/amd/pci-rn.c b/sound/soc/sof/amd/pci-rn.c index faab4c33a24d..a17b15552a7d 100644 --- a/sound/soc/sof/amd/pci-rn.c +++ b/sound/soc/sof/amd/pci-rn.c @@ -31,12 +31,10 @@ static struct platform_device *dmic_dev; static const struct sof_amd_acp_desc renoir_chip_info = { .rev = 3, .host_bridge_id = HOST_BRIDGE_CZN, - .i2s_mode = 0x04, .pgfsm_base = ACP3X_PGFSM_BASE, .ext_intr_stat = ACP3X_EXT_INTR_STAT, .dsp_intr_base = ACP3X_DSP_SW_INTR_BASE, .sram_pte_offset = ACP3X_SRAM_PTE_OFFSET, - .i2s_pin_config_offset = ACP3X_I2S_PIN_CONFIG, .hw_semaphore_offset = ACP3X_AXI2DAGB_SEM_0, .acp_clkmux_sel = ACP3X_CLKMUX_SEL, }; From patchwork Mon Apr 3 07:16:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 78388 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2125056vqo; Mon, 3 Apr 2023 00:42:42 -0700 (PDT) X-Google-Smtp-Source: AK7set85Eu8K6yts53uwhnHavy7TVddE5xfHWgJoSMRdMXYQ9F8WsffFZyQx3guEpmwUuMbZh6UI X-Received: by 2002:a05:6a20:4d97:b0:da:eb84:fcff with SMTP id gj23-20020a056a204d9700b000daeb84fcffmr31424870pzb.29.1680507762465; Mon, 03 Apr 2023 00:42:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680507762; cv=pass; d=google.com; s=arc-20160816; b=tUA+FQBYbQ+P1cWAFDwqd764xmqnn1rmtRMLT0/nRVMoedA6ofXvh8mW1uQHtfdFw0 YScCQ0nb/muhkNFtuwERwcjl503S5U7rqwnXYdivNTgQBQAUVtU0GwdZa6/4TuIcbxA/ qqJyQ5LZ2eALHjvX/swKzz+Ql2EpDOp1ohpQnFStH4cAJytOg/rkmrf2QQXbs89p9hvE nGzVow+qFvNb0BWibJCbKeI1Uz+e7T/gBTMd0UxzZ5k3qB7QuNAMW4pbCgI4WcbZEN7H IeODosGmZ5aNEKCl77MMg3VmJGT2VFTjLIEwjFgL1TdeHznnc/OlaXCyRQRSrBX4islX MUPg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=g3aDbK43nFYU6lt/JaZU4bsa9TW7L4EFVaCfxSnjk74=; b=Pg+1UbTig14QvxyBfUG166H5ImJ+ABj0ufojUR94pHEhQn1+O43fV3gCidfarz8gJA BvnTFt5y1WrCqOsLq5Mn7C9lJOMtJtTWHzFfJpWW1XlwZHvEis6FtWFikUfFdEt3CHJN Y7H7beNFIdsYIks1ErtJMc7AMgrheU6qMz+NQ7qRwG3hu80wwzE5tenv2rZCsWUs5MxI ydVt9/rM2GMDnhGHwaBFjTkfwbELbwvaDPFYFxiU4jCD+w8hTeCuTCNKX/tU3t1ak0cK +0Vj6XeH+GiF3a5tRYzPP5rwKd2W9kXzvM+RaJ96H8bceOTqm8tUuIY2eDsm2/CT7AOi fuDQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="Q7vxl/Vs"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c26-20020a056a00009a00b0062806504839si7835664pfj.168.2023.04.03.00.42.29; Mon, 03 Apr 2023 00:42:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="Q7vxl/Vs"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231721AbjDCHOv (ORCPT + 99 others); Mon, 3 Apr 2023 03:14:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231617AbjDCHOf (ORCPT ); Mon, 3 Apr 2023 03:14:35 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2069.outbound.protection.outlook.com [40.107.220.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAAFFEF9B for ; Mon, 3 Apr 2023 00:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OLIB4L9zTlmH11qwjFNJWXHCjh3sOeTVeEzuJNiDDDOIv5c8K6Uut3rV1HX1PNrbZrZgOv9Qe8vF+DnrfiBFUprCh2JQ66RkIBNbB+gKz/AuNfgjRA1n8YtJ4QEdrgJop/ONZbEwezUQzbKztcxyf3sUClHKKXUbjxOVsCn5yYVHgllF35TyI4Epidyr0X/pChRhSTIWZ5eyhqbqODlmpmea0db0JGjayAGCPThrBKr8oZKQz1FkS19W2hOWEYVw7t3Rp8KaRM3h+e7shVQ4MFNEaIrPHvr9GUITx8bXacrBHyYZiTC2BRsrRfDOjngd1YZCumdkkNhEQ2V2CU5TRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=g3aDbK43nFYU6lt/JaZU4bsa9TW7L4EFVaCfxSnjk74=; b=jbTM5F3NXf0uPntVyQFYNHGDffHAw+qx9DOe596cf50MHCAE9hyutF84YMqcZUDZDlBGkQRwqhwvv3G33EyYd14DC1TOBEDJ1e1vNaqT91qwcVkZfpW0ldhcDUkYqwnRSGtYSSovlT7KukEoz5w4hth8GzZEkAX5Mh7q/1rHbIsqrp5N3mYKaCk5Lz3tkASEtt3I1ypzP09Ad7FgRSDcRtVF4C668v3ZCqAYmf4HyvumHgklTyDOANYZEKVcLUgPgHu8h+Q0VVer7Fg2kMx/1bw1jSGbX1favj2Q9nQ0epaiYYNB4PPVb0RqEQDGblljaTur4Dk8+PxmnX3pD8iyXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g3aDbK43nFYU6lt/JaZU4bsa9TW7L4EFVaCfxSnjk74=; b=Q7vxl/VstpwkIOQxnXMDZaETh5IDOymFPv9VwcNqrVBT319DBwfEmLJjyJe2I4ld3wyhak03REpnwU4SRKu93v9JiSIoNLXRvL9kHR1S/cdrsTXWIi8V31pFcLiJyO3839HOpaxRjaychhtQkX2e05dp6JoZSGMMrPHZBPjTa2I= Received: from DM6PR03CA0087.namprd03.prod.outlook.com (2603:10b6:5:333::20) by CH0PR12MB8487.namprd12.prod.outlook.com (2603:10b6:610:18c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.30; Mon, 3 Apr 2023 07:14:13 +0000 Received: from DM6NAM11FT017.eop-nam11.prod.protection.outlook.com (2603:10b6:5:333:cafe::86) by DM6PR03CA0087.outlook.office365.com (2603:10b6:5:333::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.20 via Frontend Transport; Mon, 3 Apr 2023 07:14:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT017.mail.protection.outlook.com (10.13.172.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6277.14 via Frontend Transport; Mon, 3 Apr 2023 07:14:12 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 3 Apr 2023 02:14:11 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 3 Apr 2023 00:14:10 -0700 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 3 Apr 2023 02:14:05 -0500 From: Vijendar Mukunda To: CC: , , , Vijendar Mukunda , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , "Bard Liao" , Ranjani Sridharan , Kai Vehmanen , Daniel Baluta , Jaroslav Kysela , Takashi Iwai , "V sujith kumar Reddy" , Ajit Kumar Pandey , Ajye Huang , "moderated list:SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS" , "open list" Subject: [PATCH 4/6] ASoC: SOF: amd: refactor get_chip_info callback Date: Mon, 3 Apr 2023 12:46:44 +0530 Message-ID: <20230403071651.919027-4-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403071651.919027-1-Vijendar.Mukunda@amd.com> References: <20230403071651.919027-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT017:EE_|CH0PR12MB8487:EE_ X-MS-Office365-Filtering-Correlation-Id: 12ad219c-428a-4a8b-7080-08db3413070e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hk5texWbCwz6sGwz/6Odf/Du67wegTewwzSahUmTTIunRUS7M9UG9kzMBmTgIO2VOEQZY2jD1pxSNhRAO98AJKU06Q+uFZdwaS/6h2mJA3bo4wdGRPe2Ohx7Th1J3GQbP2lN1oDRE+WEPIQQvA305pXY29rC1ZbEv0rnL+U0yCyKJ9COF6nG1BCPton+M27iUibmUdPVXFkdD9aVBMLwayBhaHf4IMvxh5fwvXl/hEs2evK+rNUxwEtcLkYue3MNcCX40od7MVBdp5HrdMeRDf/t9+q95ol2sHL36VR7ZkAg74JHPb5B+y+YKdgQNfIWejvIhFI7NRc09BLjCbKyLAxSphO4/+brkjO6tZFGB1k3Nbp4QEIAQSrBxlYVX/1C1wBszaEpalxABeKM/isd87XaPQ/C3Sxgbb3TH8D+zFROoP1HEPJcEpoSjbf4L7AR64K413V0TcQ0aYmP0vxbhreNpfOtNC6wYshK7x/Y6xQRWuc6MSlSrUvq/d4esmEjTxvZE6GOtnUzt5pFcy4BT7YCJ2vtNwLOsjdrOlC7ERkvooSUq9U0L6Pgsg0300d6Ty8bYektOK3q38yOcOVXx9dvrw676jWk9sivSGqsltFhrpSZ2DbolBvNlQ11xLwz37Vh7GR7C3KrmYlAhtMIgZi0iXrL3gmyaATFo0o0+cZEgl2VUKwAHgcJCQQ/QsT4+39j5QQl2jPnITzIXxj20CuVI8sgv2HS6vzSETKkPGk= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(39860400002)(136003)(376002)(451199021)(40470700004)(46966006)(36840700001)(356005)(316002)(8676002)(82310400005)(41300700001)(6916009)(4326008)(70206006)(70586007)(81166007)(5660300002)(7416002)(54906003)(8936002)(82740400003)(478600001)(86362001)(2906002)(7696005)(36860700001)(40460700003)(47076005)(40480700001)(26005)(6666004)(1076003)(186003)(83380400001)(36756003)(426003)(336012)(2616005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2023 07:14:12.9685 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 12ad219c-428a-4a8b-7080-08db3413070e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT017.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB8487 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762140107680813124?= X-GMAIL-MSGID: =?utf-8?q?1762140107680813124?= Move get_chip_info callback to the start of API. This should be first check in probe() call. Signed-off-by: Vijendar Mukunda --- sound/soc/sof/amd/acp.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c index d5ccd4d09278..e8fe324c23d0 100644 --- a/sound/soc/sof/amd/acp.c +++ b/sound/soc/sof/amd/acp.c @@ -470,6 +470,11 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev) unsigned int addr; int ret; + chip = get_chip_info(sdev->pdata); + if (!chip) { + dev_err(sdev->dev, "no such device supported, chip id:%x\n", pci->device); + return -EIO; + } adata = devm_kzalloc(sdev->dev, sizeof(struct acp_dev_data), GFP_KERNEL); if (!adata) @@ -486,13 +491,6 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev) pci_set_master(pci); sdev->pdata->hw_pdata = adata; - - chip = get_chip_info(sdev->pdata); - if (!chip) { - dev_err(sdev->dev, "no such device supported, chip id:%x\n", pci->device); - return -EIO; - } - adata->smn_dev = pci_get_device(PCI_VENDOR_ID_AMD, chip->host_bridge_id, NULL); if (!adata->smn_dev) { dev_err(sdev->dev, "Failed to get host bridge device\n"); From patchwork Mon Apr 3 07:16:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 78392 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2126395vqo; Mon, 3 Apr 2023 00:46:07 -0700 (PDT) X-Google-Smtp-Source: AKy350abZ3/XgvuikdRAbmOllErBfvlzsQPYhSfseOQ8M592bbad1g+espxDRPmLZpzXFEjq70EI X-Received: by 2002:a17:906:d8d0:b0:932:3688:ae81 with SMTP id re16-20020a170906d8d000b009323688ae81mr34368102ejb.9.1680507967727; Mon, 03 Apr 2023 00:46:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680507967; cv=pass; d=google.com; s=arc-20160816; b=eqKFVYKX7B4Br1j03k3lt0w2qSV/IDsQsy0NJesZBfV0rRNaIOoyPgPK/ywL27LZgo 3hCu1AS0S6+YVfmhs22o1MRg5oIvCDqkCbMvrweDXArGU+yyKj046XJHYWkaveFRDCbw 5EpCUFgt4UobNicfRvD1QEZKWLgzK6/CBjm3lnPWZR6xrV50pQ1RdHUlZ8la1aWlTEF7 Ld/nMDDKamttWtsaqAiA65+K1VIPZSpoo9Dpuvd94zry9/MGwsHy9QJafJzmpCyh8gYv 5IUjKvq9JC0DK00SCnSZeT4S5ttcXtizacVHx/cL1j4sCESQypVSLCIMAIKdVZITbPSs 6WPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HxtL+9QCYmdY/CoHEsuSDuu1PdvAG/8SUQvAnigVXro=; b=wqpZ0AergODhE475iMBgo/72IqZSL+ouWe4LflHuAOxZyQgmC4CuNl6kRmv4Z6xgJQ DLHtQzvYqs9AYIP95N2BfA/Mg5o6vt81xjsG5KHAV7Q8e5scPw+XAFXcAGdr3FV+26KY q+Sq+qYsojCC3cxYoAq5dS5IY601UcyX8Iv/4DhshaR82Q7mwAD6fDutNjdsaYk4NU3l jshTuA5SfC1G8tr+q7CrFRRmW78VOpbNe3GyFV8QcnuikfzY7c4LXRVih89Kyg+ZitE5 P+4riDBD/oEttBi3PaLhLRzmDTdIyfutnPjgcrvsE85JdPPiVRNuiMj8/QKU4VImVkaJ MMLw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=2OGGo1xE; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt23-20020a170906f21700b009476a8cb01esi4584318ejb.654.2023.04.03.00.45.44; Mon, 03 Apr 2023 00:46:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=2OGGo1xE; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231697AbjDCHO7 (ORCPT + 99 others); Mon, 3 Apr 2023 03:14:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231671AbjDCHOh (ORCPT ); Mon, 3 Apr 2023 03:14:37 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2044.outbound.protection.outlook.com [40.107.212.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A79BCDD5 for ; Mon, 3 Apr 2023 00:14:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TQTS/qrel6tqWNv4ldUm2bKNtz3InXgpe5lUYNjH/WI39mmNNHA6pnjWbfi+dbR+n/94TZ9xa1OxvubLXcSuAmUDlxpB/+tlgt2lJ7Ocj/RvuRwtkTmC0JqabnOH736rHwgJ6UdAVLrLCWvcR2+W8bzgcHoB2buXM+ttRiIUtPnnhTTrBfrbA3WkPATBRb/jtmJvrOQkzmHJNg44VzM6R1yHvgETYlvjsJLG5CY616NOUDX3g+eKKqvv8TAB4JhhMioB05oWxIJL4CuHt1FldGG4lcignEcVNd6X8q8n7TVv1q4bCeNc591Kms8QMFexb/6InMLyDJ/qFY3Wwjoopw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HxtL+9QCYmdY/CoHEsuSDuu1PdvAG/8SUQvAnigVXro=; b=ii5s6vDfXRoXqXwDRu0ku0DF1gLmP6FBMuji2G9a5qdZAYBpJiv9QRzVSnJTXPNn7wwGYDg34XjzRf58a7ZAHLJVzpvG7sxKfPSQYx2a+4fY1u5v7aklZItA/cr+ZmUGNMEfvabClKjUF3i5M3HU9b9uSTOlvBKrRxHvN0CWmLgjcPI4q199P1ZkJNqeTI5U/Jgq0oSMsVt8ZQBox764zMLMtBzkmY2XPSiBSR+PPaplzTNlyyYwlmcF4XAEIHTmlbwggS6zlp3X1EaDfx0wKm/2FxFn8SKGq8tXmuUf8LhzGEGdMgfQliwLjSFF7hb8EhyfUsBfIN6V4fNj9gbgtg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HxtL+9QCYmdY/CoHEsuSDuu1PdvAG/8SUQvAnigVXro=; b=2OGGo1xEJBZfFbfImU923pXLDUapo5nGDYG4QB+DUKt7QeP6xRKI5VL4GRW+K115KEg0IABFhs6oCm26El2786B3ORsubIU3viBzHpL+Qzm1DLtpDaVxHzVI2dBEVHGbNCFrcYZD0y13uTfcAE6CwiGB6l/MnuuEQ+0+4+jdySE= Received: from DM6PR03CA0001.namprd03.prod.outlook.com (2603:10b6:5:40::14) by DS0PR12MB7631.namprd12.prod.outlook.com (2603:10b6:8:11e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.33; Mon, 3 Apr 2023 07:14:18 +0000 Received: from DM6NAM11FT088.eop-nam11.prod.protection.outlook.com (2603:10b6:5:40:cafe::b8) by DM6PR03CA0001.outlook.office365.com (2603:10b6:5:40::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.20 via Frontend Transport; Mon, 3 Apr 2023 07:14:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT088.mail.protection.outlook.com (10.13.172.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6277.26 via Frontend Transport; Mon, 3 Apr 2023 07:14:17 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 3 Apr 2023 02:14:17 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 3 Apr 2023 02:14:16 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 3 Apr 2023 02:14:12 -0500 From: Vijendar Mukunda To: CC: , , , Vijendar Mukunda , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , "Bard Liao" , Ranjani Sridharan , Kai Vehmanen , Daniel Baluta , Jaroslav Kysela , Takashi Iwai , "V sujith kumar Reddy" , Ajit Kumar Pandey , Ajye Huang , "moderated list:SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS" , "open list" Subject: [PATCH 5/6] ASoC: SOF: amd: refactor error checks in probe call Date: Mon, 3 Apr 2023 12:46:45 +0530 Message-ID: <20230403071651.919027-5-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403071651.919027-1-Vijendar.Mukunda@amd.com> References: <20230403071651.919027-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT088:EE_|DS0PR12MB7631:EE_ X-MS-Office365-Filtering-Correlation-Id: 33f9aaf9-ad0c-4182-d4ca-08db341309dc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QhmEU7nm6A0GC8FYX8uqJOTM36lohhcRvauoQUKJ+FGZjRPLQSAQE95IZOli04R+HuX/h4k1YAPIjcn/rzl0S6ixyH4cHSaYQmbcHaR+9V0QD68FbcAfSjmc1r38OkRLb9PdZuWnbB4ZluwVOf2YqUGImD1NGOjfa3oMp9dDZNhJOc3982PanuPDFL2tD7mv6Ej6fY+3eV3/gfGbyH2flsoEjQtyH1Yyqx6dO2EFdezU1lapEhWxG7zjFicx14C6g8yW5jlrghaSZGRMsVt06oE2VgP5td9KXbANYUbR8z7indqGrx6/JTKI8oYCEQyu6eptOwhdiOjDAunDVXFKxQwE93YbR7WC+073cnBPkHm65Vl4J1HvbDvqpA+kUZpufyAYBppe2gWfJPA0lbIiOV+9Qn8+nlsAlOGnnZMMptVO30f8HOCYm1xZKwu5qytJnUdFuFL13OrBuPdQhUof/SYeL6I04xnwZ2IiebOqKksBfVNTab0d8mT5lo5BkB7dbISOdyFH1XhCtQuKBPFRJTHyUr5pQfhwrr5hRu5mwZillSaTer9SgtS3FOSOQEcXdshLTLr68Ib+AkTipiymci0cZS2pCPw6yplFU20RiB2+Q0D6cptYLo8cpdVqpR84rCOWwXOopnHXkOqBkd0NRxwaPdqa+jWJR2q+6pe0tNpcRsangD5oHsYZxai6nvj0zUusrCrrHRWh8LDx2MxI4+4F04XI/8BVoZNhK3cA3aE= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(39860400002)(136003)(376002)(451199021)(40470700004)(46966006)(36840700001)(356005)(316002)(8676002)(82310400005)(41300700001)(6916009)(4326008)(70206006)(70586007)(81166007)(5660300002)(7416002)(54906003)(8936002)(82740400003)(478600001)(86362001)(2906002)(7696005)(36860700001)(40460700003)(47076005)(40480700001)(26005)(6666004)(1076003)(186003)(83380400001)(36756003)(426003)(336012)(2616005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2023 07:14:17.6766 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 33f9aaf9-ad0c-4182-d4ca-08db341309dc X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT088.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7631 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762140322896189700?= X-GMAIL-MSGID: =?utf-8?q?1762140322896189700?= Refactor error checks code in probe() callback. Signed-off-by: Vijendar Mukunda --- sound/soc/sof/amd/acp.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c index e8fe324c23d0..dbf9ee6d79ed 100644 --- a/sound/soc/sof/amd/acp.c +++ b/sound/soc/sof/amd/acp.c @@ -503,16 +503,12 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev) if (ret < 0) { dev_err(sdev->dev, "failed to register IRQ %d\n", sdev->ipc_irq); - pci_dev_put(adata->smn_dev); - return ret; + goto free_smn_dev; } ret = acp_init(sdev); - if (ret < 0) { - free_irq(sdev->ipc_irq, sdev); - pci_dev_put(adata->smn_dev); - return ret; - } + if (ret < 0) + goto free_ipc_irq; sdev->dsp_box.offset = 0; sdev->dsp_box.size = BOX_SIZE_512; @@ -528,6 +524,12 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev) acp_dsp_stream_init(sdev); return 0; + +free_ipc_irq: + free_irq(sdev->ipc_irq, sdev); +free_smn_dev: + pci_dev_put(adata->smn_dev); + return ret; } EXPORT_SYMBOL_NS(amd_sof_acp_probe, SND_SOC_SOF_AMD_COMMON); From patchwork Mon Apr 3 07:16:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 78393 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2126496vqo; Mon, 3 Apr 2023 00:46:23 -0700 (PDT) X-Google-Smtp-Source: AKy350a2oGL+uS9B3J3emzIaktZ9R2DQpX8EHx+I8MVyBZKa1PWgXk7RtVO1STwaAd2TR99cAkJV X-Received: by 2002:a05:6402:1110:b0:4fb:6357:f393 with SMTP id u16-20020a056402111000b004fb6357f393mr30900314edv.1.1680507983013; Mon, 03 Apr 2023 00:46:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680507983; cv=pass; d=google.com; s=arc-20160816; b=JhX92PIB6J6BkOtkiRU8ZMUeCj6SATdeQNBEBu7GL0hBGbmNH/Q1+oFn9mpLm4D8Q5 gAGd5JgIu91y0rgsLEpzXtjjdFCeE+Hy0ggw881B9eqC2zcgESN2l7dIKqB1NBK3mdkh AEPZdH9lk5D+4R1KsZQo53DLYKzQhL3ycXAYR0FY5z1+03H/e/vCQBe84h4oBn0sB1ub 3f7y8FGdZah30e/HTqzbIndvI4/KetywdlCZuh9lf1Ip5qv3T4WPEvcsxI6g4dRM8hmh 0Rh8ro/SWuT2YGpytqVRK4MtDPOCWs7EYPy98Ae/tP44J4fJ5nbcndvprLnyD2uFHgnQ Ssgw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AU+uHkSU6Exc4JfMFgx7HbIAQ0exW7+oUXuA3dDjqQ8=; b=vTwOpFZPv3RvDAI8vMAk7HeVsdrOrJquo53/vzpfY76zFxem0CY4iu1BIGhBcS5+6N vANCgP0/19ACaOqS9Jtb3s5uNfaZbpZx7m0gkaHo4RRWrDqcXwoTPiDDnqholS1Q5MWO 3FWK/gnqn83x0rqkYatKrf/KS9nrHcFh4ED9Q8o+sl1w1u9OkXR7mr2DC8EeYmU57pn+ 5m1tpiG1ELsZ4xJxNMIdOnwG2bb/mg8Cd9zo14fyQfJv0yX1e5JIoAoOlreEoc2hWzlQ Ioqb0Cu83N9xabpdmq7ZTRfjG3E1uJffc4SG+JslCIW4+Uk/12sdRMPzj2wwmkKePhts avzA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="chs/K78J"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l17-20020aa7cad1000000b004af6aa59012si7531551edt.443.2023.04.03.00.45.59; Mon, 03 Apr 2023 00:46:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="chs/K78J"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231416AbjDCHPD (ORCPT + 99 others); Mon, 3 Apr 2023 03:15:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231701AbjDCHOi (ORCPT ); Mon, 3 Apr 2023 03:14:38 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2087.outbound.protection.outlook.com [40.107.223.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DF6286A2 for ; Mon, 3 Apr 2023 00:14:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V0uSoX3UmqULa66homYFZQOKXcW8tmIpYoEZLHNB4p5bb3TqtZK1SnNqb7XwbgHa6vFkhQOl54UI/7YftMhfBjKpjtE9+WNDZQiYiA2Jg4xLcodgz7sowyo1VGV3waIdA7xDNkIySEZ9YwLYWuxrbNUVadt+ybEyHcMBzPXxakMpSYOepM4t3tEfsaWAIaIagtFUeH7n062geNgp90Yy4ZXrF3pG5EfWahMbcyxPpYWhS312T1wmqjGxT+NS1c8GfKvFMOEDC6Wbw/ysXImuSuG2knysDwLXlu/VtaoBUuMUfqc1Uh1QD+4ORUXWDag+Zh7Jhm+NA6mM/9QKEGC9vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AU+uHkSU6Exc4JfMFgx7HbIAQ0exW7+oUXuA3dDjqQ8=; b=X+NYXOdX2DNh05C4ym4GT0NNBCasJ/m11jE1qfpReOz0Hy5iWYLH13qNYCmYoMriryMVzfxt3o5xZosuCuxt+3+UU182BGECZKoYulHfwn8jCmvBJqwHyWVBjJzlzEyzJiALvGTdh3X/Px2U9nvmN0mHca8ATYJJatAoH35FjJ405YmhJThjsQyKAnwiEoNSpCOqVEsOKHZD+UHEZrCOnCa1RTOSY6Fi6odAKwt9wjY4LHZqQ3ztvd8BA+sJ0HfnI7PwVlhSHbvcWzlFwMGNyK3H6DNOwD8fUh4J31uPZbo08qNhyVU2NhaNUDEaFUPUiENUrRWV3t9evn3IXplZbw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AU+uHkSU6Exc4JfMFgx7HbIAQ0exW7+oUXuA3dDjqQ8=; b=chs/K78JH3/AJL8PLZB4PzV1kOgl5w1pUE/jFyqI182UUYw5eB09XUsuqRXCIj8hvVmHd88ABz8Mba/RImfPx9yG/H13apN1632U0CRG/UcNs0GmiLzSR2kcm1YnmvsC3wau7c5KG07YbXzLwfEkZ1N0gKYhnCDz5KylzIDLF6A= Received: from DM6PR03CA0011.namprd03.prod.outlook.com (2603:10b6:5:40::24) by SN7PR12MB6690.namprd12.prod.outlook.com (2603:10b6:806:272::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.28; Mon, 3 Apr 2023 07:14:28 +0000 Received: from DM6NAM11FT020.eop-nam11.prod.protection.outlook.com (2603:10b6:5:40:cafe::1d) by DM6PR03CA0011.outlook.office365.com (2603:10b6:5:40::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.22 via Frontend Transport; Mon, 3 Apr 2023 07:14:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT020.mail.protection.outlook.com (10.13.172.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6277.14 via Frontend Transport; Mon, 3 Apr 2023 07:14:28 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 3 Apr 2023 02:14:27 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 3 Apr 2023 00:14:27 -0700 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 3 Apr 2023 02:14:22 -0500 From: Vijendar Mukunda To: CC: , , , Vijendar Mukunda , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , "Bard Liao" , Ranjani Sridharan , Kai Vehmanen , Daniel Baluta , Jaroslav Kysela , Takashi Iwai , "V sujith kumar Reddy" , Ajit Kumar Pandey , Ajye Huang , Rander Wang , Zheng Bin , "moderated list:SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS" , open list Subject: [PATCH 6/6] ASoC: SOF: amd: refactor dmic codec platform device creation Date: Mon, 3 Apr 2023 12:46:46 +0530 Message-ID: <20230403071651.919027-6-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403071651.919027-1-Vijendar.Mukunda@amd.com> References: <20230403071651.919027-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT020:EE_|SN7PR12MB6690:EE_ X-MS-Office365-Filtering-Correlation-Id: 1217d979-d76f-4363-a5a9-08db34131040 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XJbCP4e2f4yWcU+jQhBkGwlpV57RbPVrbfVuFqdULVYfAmesC99I3+sLtLv05N5gF/RkKrAYsOoiqXaMrbu4s5nH4/qrdep4QisWAVJr8243FTnZP6fXYnO3rYQKKxertbKW1jmJwbWLVxYLauOXP28ndd7tOPgg/l8zzkAvjQDeXlet1ywB0qlEvIXWNcapDzjOAvRsGF56CrZFbfTUrjhK0Nlar8/K2asn1nQQSBtgImX+vwcR/TKv5lpm0xNVtr/tNkLljxUb0E+0s8G63Pihk82NJU8+4F7ojjyU15LEgbsj1m91ov5YMj8uUW3wBmM/sCtUSPRrNkz4Hk7g2D0mNEvM+TcLNe8CBsp+LFIoD7O0/Kt6cm7W0QxnEjzQTaf9px3nBQqgAV0Nrk1yMKKH4K7YVURjQrRrzzOG0Mmzm3tK3Y6L8U+S0mNqVUVwGBO/Klqt2pwkrEU3fga+Brqd5bDY6H1pS1+vQn9Muw1wzHhZmBTtGxNM4nDCjCHmEr04oQ7ThuOtBJQlzzBc7D7k5I8p3x56F3cYPowMQaNJqU+8f+BlFvfgm/1r7fgvFMS7S+FcYljH+ZqJgJHvBG2+gcEGZxgtCeFoQrEiaK/ZdkkWULKPVGzONhq44g3YfH2JnCFJMismO/DHfLNAte+CevCZXQk8VRME6K0+eaUtLkzLB2PblJtTwWQjaCliFSIOF+UUeJvWWgJoLCnlkULXFqWaTHU0cf5Q3vYqQC0= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(376002)(136003)(346002)(451199021)(40470700004)(36840700001)(46966006)(36860700001)(186003)(83380400001)(336012)(4326008)(6916009)(6666004)(70206006)(1076003)(26005)(7696005)(426003)(2616005)(47076005)(70586007)(478600001)(54906003)(356005)(81166007)(316002)(82740400003)(41300700001)(5660300002)(2906002)(7416002)(8676002)(8936002)(86362001)(82310400005)(36756003)(40480700001)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2023 07:14:28.3971 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1217d979-d76f-4363-a5a9-08db34131040 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT020.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6690 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762140339109016403?= X-GMAIL-MSGID: =?utf-8?q?1762140339109016403?= Under snd_sof_dev device scope, create platform device for dmic codec. Signed-off-by: Vijendar Mukunda --- sound/soc/sof/amd/acp.c | 17 +++++++++++++++-- sound/soc/sof/amd/acp.h | 2 ++ sound/soc/sof/amd/pci-rmb.c | 19 +------------------ sound/soc/sof/amd/pci-rn.c | 19 +------------------ 4 files changed, 19 insertions(+), 38 deletions(-) diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c index dbf9ee6d79ed..2ae76bcd3590 100644 --- a/sound/soc/sof/amd/acp.c +++ b/sound/soc/sof/amd/acp.c @@ -481,11 +481,18 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev) return -ENOMEM; adata->dev = sdev; + adata->dmic_dev = platform_device_register_data(sdev->dev, "dmic-codec", + PLATFORM_DEVID_NONE, NULL, 0); + if (IS_ERR(adata->dmic_dev)) { + dev_err(sdev->dev, "failed to register platform for dmic codec\n"); + return PTR_ERR(adata->dmic_dev); + } addr = pci_resource_start(pci, ACP_DSP_BAR); sdev->bar[ACP_DSP_BAR] = devm_ioremap(sdev->dev, addr, pci_resource_len(pci, ACP_DSP_BAR)); if (!sdev->bar[ACP_DSP_BAR]) { dev_err(sdev->dev, "ioremap error\n"); - return -ENXIO; + ret = -ENXIO; + goto unregister_dev; } pci_set_master(pci); @@ -494,7 +501,8 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev) adata->smn_dev = pci_get_device(PCI_VENDOR_ID_AMD, chip->host_bridge_id, NULL); if (!adata->smn_dev) { dev_err(sdev->dev, "Failed to get host bridge device\n"); - return -ENODEV; + ret = -ENODEV; + goto unregister_dev; } sdev->ipc_irq = pci->irq; @@ -529,6 +537,8 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev) free_irq(sdev->ipc_irq, sdev); free_smn_dev: pci_dev_put(adata->smn_dev); +unregister_dev: + platform_device_unregister(adata->dmic_dev); return ret; } EXPORT_SYMBOL_NS(amd_sof_acp_probe, SND_SOC_SOF_AMD_COMMON); @@ -543,6 +553,9 @@ int amd_sof_acp_remove(struct snd_sof_dev *sdev) if (sdev->ipc_irq) free_irq(sdev->ipc_irq, sdev); + if (adata->dmic_dev) + platform_device_unregister(adata->dmic_dev); + return acp_reset(sdev); } EXPORT_SYMBOL_NS(amd_sof_acp_remove, SND_SOC_SOF_AMD_COMMON); diff --git a/sound/soc/sof/amd/acp.h b/sound/soc/sof/amd/acp.h index fd04e5ae7303..1c535cc6c3a9 100644 --- a/sound/soc/sof/amd/acp.h +++ b/sound/soc/sof/amd/acp.h @@ -170,6 +170,8 @@ struct sof_amd_acp_desc { /* Common device data struct for ACP devices */ struct acp_dev_data { struct snd_sof_dev *dev; + /* DMIC device */ + struct platform_device *dmic_dev; unsigned int fw_bin_size; unsigned int fw_data_bin_size; u32 fw_bin_page_count; diff --git a/sound/soc/sof/amd/pci-rmb.c b/sound/soc/sof/amd/pci-rmb.c index 2b84f95072d3..eaf70ea6e556 100644 --- a/sound/soc/sof/amd/pci-rmb.c +++ b/sound/soc/sof/amd/pci-rmb.c @@ -26,8 +26,6 @@ #define ACP6x_REG_START 0x1240000 #define ACP6x_REG_END 0x125C000 -static struct platform_device *dmic_dev; - static const struct sof_amd_acp_desc rembrandt_chip_info = { .rev = 6, .host_bridge_id = HOST_BRIDGE_RMB, @@ -65,32 +63,17 @@ static const struct sof_dev_desc rembrandt_desc = { static int acp_pci_rmb_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { - struct device *dev = &pci->dev; unsigned int flag; - int ret; flag = snd_amd_acp_find_config(pci); if (flag != FLAG_AMD_SOF && flag != FLAG_AMD_SOF_ONLY_DMIC) return -ENODEV; - ret = sof_pci_probe(pci, pci_id); - if (ret != 0) - return ret; - - dmic_dev = platform_device_register_data(dev, "dmic-codec", PLATFORM_DEVID_NONE, NULL, 0); - if (IS_ERR(dmic_dev)) { - dev_err(dev, "failed to create DMIC device\n"); - sof_pci_remove(pci); - return PTR_ERR(dmic_dev); - } - return ret; + return sof_pci_probe(pci, pci_id); }; static void acp_pci_rmb_remove(struct pci_dev *pci) { - if (dmic_dev) - platform_device_unregister(dmic_dev); - sof_pci_remove(pci); } diff --git a/sound/soc/sof/amd/pci-rn.c b/sound/soc/sof/amd/pci-rn.c index a17b15552a7d..4809cb644152 100644 --- a/sound/soc/sof/amd/pci-rn.c +++ b/sound/soc/sof/amd/pci-rn.c @@ -26,8 +26,6 @@ #define ACP3x_REG_START 0x1240000 #define ACP3x_REG_END 0x125C000 -static struct platform_device *dmic_dev; - static const struct sof_amd_acp_desc renoir_chip_info = { .rev = 3, .host_bridge_id = HOST_BRIDGE_CZN, @@ -65,32 +63,17 @@ static const struct sof_dev_desc renoir_desc = { static int acp_pci_rn_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { - struct device *dev = &pci->dev; unsigned int flag; - int ret; flag = snd_amd_acp_find_config(pci); if (flag != FLAG_AMD_SOF && flag != FLAG_AMD_SOF_ONLY_DMIC) return -ENODEV; - ret = sof_pci_probe(pci, pci_id); - if (ret != 0) - return ret; - - dmic_dev = platform_device_register_data(dev, "dmic-codec", PLATFORM_DEVID_NONE, NULL, 0); - if (IS_ERR(dmic_dev)) { - dev_err(dev, "failed to create DMIC device\n"); - sof_pci_remove(pci); - return PTR_ERR(dmic_dev); - } - return ret; + return sof_pci_probe(pci, pci_id); }; static void acp_pci_rn_remove(struct pci_dev *pci) { - if (dmic_dev) - platform_device_unregister(dmic_dev); - return sof_pci_remove(pci); }