From patchwork Fri Feb 16 07:43:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshu Agrawal X-Patchwork-Id: 10224147 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 88B87602CB for ; Fri, 16 Feb 2018 07:56:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C5CD2934E for ; Fri, 16 Feb 2018 07:56:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 707E029351; Fri, 16 Feb 2018 07:56:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A65352934E for ; Fri, 16 Feb 2018 07:56:55 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 62D2F267DC0; Fri, 16 Feb 2018 08:56:52 +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 AD293267DB6; Fri, 16 Feb 2018 08:56:48 +0100 (CET) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0062.outbound.protection.outlook.com [104.47.37.62]) by alsa0.perex.cz (Postfix) with ESMTP id C7E7B26778B for ; Fri, 16 Feb 2018 08:56:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=RwqWDYLyEHP1XyGbn5q60FgEb4ReAFizZwAkaq8AFTQ=; b=vNNPAf1R4K7rFPecnFxl177EoaiztgnqOLchjXd+KVxsBTnaB/bgjMbYhbolZ76Fn8C0QXU8tDOYvsuV+ew9nIttDf2y3Y8gUorjE1gOO7okgiV6cthghn2zM/9brdzf8tN56HThdqsOajOyNP7mivCbJVXrxb5YXydMaSwcXOQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Akshu.Agrawal@amd.com; Received: from akshu-HP-EliteBook-745-G2.amd.com (202.56.249.162) by BN6PR1201MB0180.namprd12.prod.outlook.com (10.174.115.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.506.18; Fri, 16 Feb 2018 07:56:43 +0000 From: Akshu Agrawal To: broonie@kernel.org, alsa-devel@alsa-project.org Date: Fri, 16 Feb 2018 13:13:29 +0530 Message-Id: <1518767009-15232-2-git-send-email-akshu.agrawal@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1518767009-15232-1-git-send-email-akshu.agrawal@amd.com> References: <1518767009-15232-1-git-send-email-akshu.agrawal@amd.com> MIME-Version: 1.0 X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: MA1PR0101CA0036.INDPRD01.PROD.OUTLOOK.COM (52.134.137.22) To BN6PR1201MB0180.namprd12.prod.outlook.com (10.174.115.12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3f045170-65ab-4424-1aab-08d57512d2c9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:BN6PR1201MB0180; X-Microsoft-Exchange-Diagnostics: 1;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iTuyUIF5CTTYXJEvPISlJTyK/zlBc0nc3ezZGXVsn1n7qot2eWaT/P6yzzfz0jpm6YXq1DCaLt84yqjPRf3/3u2fNlfwsN8wKOrBo3Sx4hUzadi/I/CB65dc/6LPc0SAQtid+bKDF1Ao5Hf9MDG1Ne01/Bmw8FdFSZIz9CesWzibOe9zkDWfnPwrKpp1xRUtZSLQ0GfLXs/4S44WEJJKHHmYTkxiq5iORli8ZK112wRk9F/mLLR2jLtPqi/d4mgB53/LsukiEwzq4X7M9aZgkTtUN7Kzw0sSBMTM7KResL6mPfpfOO8oOcxG6kIHlS0W4uiEKNvgxgGrKwGri4/9XszaYBnuJFCka84M; 4:mitFaClTueI8nBpgFrfj2tJnb5rl2mJ7XnY9Yj8jPPI14iF6DRSvVY+wB55JVTZDGbT28HyJnOR5EXGrRoby5IHDB16pRsJSOFZMLv19qACOGIcyMi5pnHTc1SLC09ODh9n3eBhMOCdCOHho5k7wjj18yM1kmL3wsVY8dmyTsFq1uUcJmFg65ESr0Agims01hMRLSQSPQks3Vn2f91dIDfDX4YT4FwPBHPxFOnTRWwUGdwWMyI9EK38tPZj7lGwWv2SHnxqOjBBiw/owOx6CcinAqqCAodelbpXNNXUFqqsW6PQT52ECQQ2Sg/nkyuEY X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3002001)(3231101)(944501161)(93006095)(93001095)(10201501046)(6055026)(6041288)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:BN6PR1201MB0180; BCL:0; PCL:0; RULEID:; SRVR:BN6PR1201MB0180; X-Forefront-PRVS: 0585417D7B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39380400002)(376002)(366004)(39860400002)(189003)(199004)(53416004)(3846002)(53936002)(7696005)(6116002)(51416003)(36756003)(76176011)(52116002)(97736004)(2906002)(86362001)(386003)(25786009)(66066001)(50466002)(39060400002)(48376002)(316002)(16586007)(8936002)(16526019)(186003)(50226002)(72206003)(7736002)(106356001)(6486002)(47776003)(6666003)(26005)(305945005)(478600001)(81156014)(68736007)(4326008)(81166006)(8676002)(5660300001)(105586002)(2950100002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR1201MB0180; H:akshu-HP-EliteBook-745-G2.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR1201MB0180; 23:G10N8OpbrukFegYDTpDt6PsgHa535mb7Vc5A8tD?= =?us-ascii?Q?kFP4FhijZd0fDWStddqJGqR4UTRaZ/6TWKL6u6ZN70Y51D61D8xnLKR+Em2b?= =?us-ascii?Q?VrYSWs9OVfJCssjs8VWebml87OMAuhJ/yGlqSsoA57AAOwEXbQefUtKjwKgM?= =?us-ascii?Q?9i4jkmtlWrQ6J/Q1zKRp0D8FD8vAktxqYk/mRhjCYk8iJWhD7aPCWRnzfdVu?= =?us-ascii?Q?bIrR2i5wyypVUE3TYrCzmP0AVP0uEMGNbuVvjPoIcFyBA/l/CcrrpYNX4Q2J?= =?us-ascii?Q?iiPFzP0twoFxSQs8rjJmgqn5lqNT3ILMeYENHXC11SsQlGt+HbPEJW39Zp8K?= =?us-ascii?Q?2KvuUMnSO/o+mLL6GQwh4TvMCG8Yj6fVQkXZy/Jj0CEX7iiFib46/ybkzo0E?= =?us-ascii?Q?hWSkIN0fIznkJPRDZOWlRVzN6cg4Hw0CNhqFbp4bNLXsyYybzE2P2CZ0d9gs?= =?us-ascii?Q?NuCmWls/vkcfKOi1K4BJttkdwBCsGuu/9STwS4Mc95e+aG6PqUE9sHoLZW/2?= =?us-ascii?Q?QgpCXVxF5Lar+VnMe40ccKIpwEeWyoCR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CeCqrbAz5f/7nMiNvm/Jsq3T/dbAJaG6mDVbnJNUCj7jClHZu9J/9UjvMSSrtNEPU=; 5:Oq5baA3C44F81M7XVaCjh6PHjQeF5BrCrYuhOJg/Yi1WaIh0O6PGmgClGlKTrMg87t8xEpgtZ/QoxFkzl695pz9tKFb8no7R0kcxUEmR0scNFdU25s+jd0bdLmqLBpLldfgdz2tq/v19jtYGV5C/A/wdBY7wMIS2EhakVSK1Exk=; 24:UriuRPBl9vD8npGQAIJRln8nLX920IspZsqlILuQOOVZAMfMKcpozAtcoCNSdMMsk3uttMGabNq33amj8g+eecWHX5n859n+wJOiO5Bx8a4=; 7:Ni1jm2VTGVBQRzLcW5+PdQ943XUPk6W4/FQO01DDFq0PseUzfBJLbvDSohHdO2trwz4edsOlvrMfxbV3zk54UGyPWeZi2Pwf1MRw0ZYQ+kcnSXAM0ubDXSJnv2TEsQHjE4YJyJx8IjFr7PY7O8NCtieBBJGkUZCYco3p6+XC56mGhodrgj4x9IDBUNhtCCvfO3DJbu1CjZJghXqYwV7+1PAXyz+JJffIP2D7C3jtSm7xCtGtBPnOLnyYGU/vYCr0 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0180; 20:8IRlQasU2RzV4s/f5uDJcyC+DwHVozsC1EyWk4ZQqPLOHuxuXx/ZZERcSQ86C7Y+6EUc0dFwJ5X2ryr4JpKySilM0CaQbwf6R7e6dgf+zdvjT4i47rQpZIj1iPwgKa9NIxMaO9b2xs2yZ6C22XC+73JW2XFkUFVyG8qOflmmEY5Tge/ZCW4da04wGgrVBCwQE47oeWExr2GjB1IghHEgAZe+Qaa7t9/wWkQDml8+V0ejurRyQMJ2qDkx0OroZklb X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2018 07:56:43.2486 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3f045170-65ab-4424-1aab-08d57512d2c9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB0180 Cc: tiwai@suse.de, lgirdwood@gmail.com, akshu.agrawal@amd.com Subject: [alsa-devel] [PATCH 1/1] ASoC: dwc: Use devm_ioremap_shared_resource 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP In the event when resgiters are same, this patch checks shared flag and uses devm_ioremap_shared_resource for mapping. This allows us to have 2 separate cpu dais for playback and capture having same register set. Signed-off-by: Akshu Agrawal Reviewed-by: Alex Deucher --- include/sound/designware_i2s.h | 1 + sound/soc/dwc/dwc-i2s.c | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/include/sound/designware_i2s.h b/include/sound/designware_i2s.h index 830f5ca..a43a3708 100644 --- a/include/sound/designware_i2s.h +++ b/include/sound/designware_i2s.h @@ -56,6 +56,7 @@ struct i2s_platform_data { void *capture_dma_data; bool (*filter)(struct dma_chan *chan, void *slave); int (*i2s_clk_cfg)(struct i2s_clk_config_data *config); + bool shared; }; struct i2s_dma_data { diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c index e27e21f..1e7c285 100644 --- a/sound/soc/dwc/dwc-i2s.c +++ b/sound/soc/dwc/dwc-i2s.c @@ -629,9 +629,21 @@ static int dw_i2s_probe(struct platform_device *pdev) dw_i2s_dai->resume = dw_i2s_resume; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - dev->i2s_base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(dev->i2s_base)) - return PTR_ERR(dev->i2s_base); + /* For devices which use the same registers for playback + * and capture, we would set shared flag for registering + * the second cpu dai. + */ + if (pdata && pdata->shared) { + dev->i2s_base = + devm_ioremap_shared_resource(&pdev->dev, res); + if (IS_ERR(dev->i2s_base)) + return PTR_ERR(dev->i2s_base); + } else { + dev->i2s_base = + devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(dev->i2s_base)) + return PTR_ERR(dev->i2s_base); + } dev->dev = &pdev->dev;