From patchwork Tue Nov 13 19:46:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 151007 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4816255ljp; Tue, 13 Nov 2018 11:46:48 -0800 (PST) X-Google-Smtp-Source: AJdET5dExanQ2DhtxayxCdrmvpBsW62QRI4Xfpue06bW9Nu7Yzbv1WXAh2LfVmIJeWGwCBQvko/c X-Received: by 2002:adf:8444:: with SMTP id 62-v6mr5914798wrf.251.1542138408299; Tue, 13 Nov 2018 11:46:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542138408; cv=none; d=google.com; s=arc-20160816; b=Zzw2NqMcf6LTIMlGZ4UAfHuafFh+J4gWh8KtKQFIkWCS/s8PGOTrRmnS+EuFR2x6pH SMQzS3cMmJ6L2214qFULFSYYtC7n0yLx3xM7WIczbERY3QF/Gb7pad6ofbKEinLzTN9+ aVWxN8FQV3lzB7gZ4j0BWXXXDwc89HgNcd7JHcFjlZa6YQxwgwbTohI01jfZnXtjaq6w D/PvoZh8f6stRUfABqtB032v1xhhWxNUW//6y545/Ej4OHoZMrT+Y5pyF93hAS/NvXrx PQMlGkKHqYWERGmoLwSFiME0VBk7M6yQi9gDgUh6QQj+4T7C1/PLRuYx5WiEa7EzLkSv FoFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to; bh=2tNdfRPBl3DPVF4H9Pbu43n0/xouI+6nkRVe6lOEkNU=; b=fBNjWLaoIAD+TR0P3ggBCoj+bWClxAwqwIAGGWLSeHOeN2OLW9bRX9tkFfXC5PzeDk 4HtvuEe4IwrxKLMsIdtAuduOSsJJ2oEOQYttiP2xEdsR2L7LHnKdN6QXF4xvrEE0mAsu aTAYt1cccDDOepAl2CC/El/Fz9YHCI/E+lgf+FsBGXPlAOXRIYTxqHZKCpdt+dI+5SKR HK3sWXWEN2XBcZd9JXj7mF+Uwxb0g+NVuT2iGtNV8s/XKS93Lz3q+yBOAUsVOXMGRbBG MrwcA6uY1DYDvnf1kqEMjHAnVo6WWyCytt+Jiazhnl+Wo62GZmmjbXY+eYDruSv0A1h3 bA6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=qxs2mA3N; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id p17-v6si765952wrq.87.2018.11.13.11.46.48; Tue, 13 Nov 2018 11:46:48 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=qxs2mA3N; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6018C267AEE; Tue, 13 Nov 2018 20:46:47 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id D0C2A267B11; Tue, 13 Nov 2018 20:46:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 1AFF8267AEE for ; Tue, 13 Nov 2018 20:46:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=xFCthqY/1Dt1xoY36lubkQKTDyB2VDn5yZYgMEdPMeE=; b=qxs2mA3Nn4GN umoRJEZ9EU0wHNEf9JRQbYLsPya2g8+qFrxFCREP9zO6Ec0/z3Lzaqbnu8RT22dKMZ+kmJAC5J+ED 60GdJUjPxCKJVrIMQ/YCQ4cv1z4KfZiV1TCwOhyVmA6gIWGdQwqyKw6qU4x671emP6En8Lh8JhsO8 JTnAk=; Received: from [64.114.255.97] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gMee1-0002WX-11; Tue, 13 Nov 2018 19:46:41 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 64A18440078; Tue, 13 Nov 2018 19:46:30 +0000 (GMT) From: Mark Brown To: Maruthi Srinivas Bayyavarapu In-Reply-To: <1542000903-19020-3-git-send-email-Vijendar.Mukunda@amd.com> Message-Id: <20181113194630.64A18440078@finisterre.ee.mobilebroadband> Date: Tue, 13 Nov 2018 19:46:30 +0000 (GMT) Cc: , alsa-devel@alsa-project.org, Maruthi Bayyavarapu , Liam Girdwood , open list , Takashi Iwai , Sanju R Mehta , Alexander.Deucher@amd.com, Mark Brown , Vijendar Mukunda , Vishnuvardhanrao.Ravulapati@amd.com Subject: [alsa-devel] Applied "ASoC: AMD: add ACP3.0 PCI driver" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: AMD: add ACP3.0 PCI driver has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From e30d9128def6ca0715a89b9a3133a94521dc0b51 Mon Sep 17 00:00:00 2001 From: Maruthi Srinivas Bayyavarapu Date: Mon, 12 Nov 2018 11:04:53 +0530 Subject: [PATCH] ASoC: AMD: add ACP3.0 PCI driver ACP 3.0 is a PCI audio device. This patch adds PCI driver to bind to this device and get PCI resources. Signed-off-by: Maruthi Bayyavarapu Signed-off-by: Sanju R Mehta Tested-by: Ravulapati Vishnu vardhan Rao Signed-off-by: Vijendar Mukunda Signed-off-by: Mark Brown --- sound/soc/amd/raven/acp3x.h | 13 +++++ sound/soc/amd/raven/pci-acp3x.c | 97 +++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 sound/soc/amd/raven/acp3x.h create mode 100644 sound/soc/amd/raven/pci-acp3x.c -- 2.19.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/amd/raven/acp3x.h b/sound/soc/amd/raven/acp3x.h new file mode 100644 index 000000000000..e9b4df0c6726 --- /dev/null +++ b/sound/soc/amd/raven/acp3x.h @@ -0,0 +1,13 @@ +#include "chip_offset_byte.h" + +#define ACP3x_PHY_BASE_ADDRESS 0x1240000 + +static inline u32 rv_readl(void __iomem *base_addr) +{ + return readl(base_addr - ACP3x_PHY_BASE_ADDRESS); +} + +static inline void rv_writel(u32 val, void __iomem *base_addr) +{ + writel(val, base_addr - ACP3x_PHY_BASE_ADDRESS); +} diff --git a/sound/soc/amd/raven/pci-acp3x.c b/sound/soc/amd/raven/pci-acp3x.c new file mode 100644 index 000000000000..27588ed066c9 --- /dev/null +++ b/sound/soc/amd/raven/pci-acp3x.c @@ -0,0 +1,97 @@ +/* + * AMD ALSA SoC PCM Driver + * + * Copyright 2016 Advanced Micro Devices, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include +#include +#include + +#include "acp3x.h" + +struct acp3x_dev_data { + void __iomem *acp3x_base; +}; + +static int snd_acp3x_probe(struct pci_dev *pci, + const struct pci_device_id *pci_id) +{ + int ret; + u32 addr; + struct acp3x_dev_data *adata; + + if (pci_enable_device(pci)) { + dev_err(&pci->dev, "pci_enable_device failed\n"); + return -ENODEV; + } + + ret = pci_request_regions(pci, "AMD ACP3x audio"); + if (ret < 0) { + dev_err(&pci->dev, "pci_request_regions failed\n"); + goto disable_pci; + } + + adata = devm_kzalloc(&pci->dev, sizeof(struct acp3x_dev_data), + GFP_KERNEL); + if (!adata) { + ret = -ENOMEM; + goto release_regions; + } + + addr = pci_resource_start(pci, 0); + adata->acp3x_base = ioremap(addr, pci_resource_len(pci, 0)); + if (!adata->acp3x_base) { + ret = -ENOMEM; + goto release_regions; + } + pci_set_master(pci); + pci_set_drvdata(pci, adata); + return 0; + +release_regions: + pci_release_regions(pci); +disable_pci: + pci_disable_device(pci); + + return ret; +} + +static void snd_acp3x_remove(struct pci_dev *pci) +{ + struct acp3x_dev_data *adata = pci_get_drvdata(pci); + + iounmap(adata->acp3x_base); + pci_release_regions(pci); + pci_disable_device(pci); +} + +static const struct pci_device_id snd_acp3x_ids[] = { + { PCI_DEVICE(PCI_VENDOR_ID_AMD, 0x15e2), + .class = PCI_CLASS_MULTIMEDIA_OTHER << 8, + .class_mask = 0xffffff }, + { 0, }, +}; +MODULE_DEVICE_TABLE(pci, snd_acp3x_ids); + +static struct pci_driver acp3x_driver = { + .name = KBUILD_MODNAME, + .id_table = snd_acp3x_ids, + .probe = snd_acp3x_probe, + .remove = snd_acp3x_remove, +}; + +module_pci_driver(acp3x_driver); + +MODULE_AUTHOR("Maruthi.Bayyavarapu@amd.com"); +MODULE_DESCRIPTION("AMD ACP3x PCI driver"); +MODULE_LICENSE("GPL v2");