Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9520483rwl; Wed, 11 Jan 2023 06:46:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXsOb23EtF8nhxlTt5DtPXhXNjW6gdcEk20XYMi+wmFqKtbNlgCGP/J8pBfQXJj/hTx1yewP X-Received: by 2002:a17:907:d50e:b0:81f:fc05:2ba0 with SMTP id wb14-20020a170907d50e00b0081ffc052ba0mr63742811ejc.2.1673448411701; Wed, 11 Jan 2023 06:46:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673448411; cv=pass; d=google.com; s=arc-20160816; b=uSJnYgYzyyffcXKd8U80DNZ9d5MLKkSLDHmAjfoWkSZXP3eObSUDVLoP6SeMXc/OPH RJSXcqiqLfXn38ZahIifgs+4R0e3EtKyB4l4yz4EU7xnNkOAnqXyZvZi/W/9pGAzXTg7 mJQKfC4uIWiehMHZftm8OyETjQfMdpI293fzfeFIaU28ZJu45lVuRy6fN3TQAPWP3Hph lNr55iPxoETPF3drUzhCpl6uGmnq4vCvJR3GMTHDHD7f0DKroWL5POCaGerfBZQzAP8c ZfNHjT1l9TPwYiGDnst+Gfi3lx6zMrLFp0VMYX7luo/Uv2JzWhzN85vbOlu4Aew0C2mu nU4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=W3UtqeVL92WzzGR6C46DSCZs6jchiRzzc2SbM4bAX50=; b=qdWhh2p6EbhBJHlospj6gIyUOFM4pI2QWJWfilSg2bCkVu0fuoLm7iDbDW/DY2wPgw p2t86+3NKHM0ByEJflp+KOjjCqUtWi471lKzSldO8uKzWZJSd7fxsQmsXyE1VlVUkNo9 AeHXEohdWif9w/LYcnLjfD7fEBbS9s9jdWyAzS73UAFrztOER9dUTn8pxZrps5XTEL6r pq8xw2g0Aewh6vwuN0TNWi0VQVFAyyHnBJc4C/Op7iv+or8pdGWv86+uzOIRdgmrDJ4n b8wSZqDGiAd5PFVUuATmE1EFAdWzcM9NM/B6UBzeKUNliGCuM+aSgLhbMKTunV19yvim AqPQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=EZXVjXkj; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id du1-20020a17090772c100b007c0a8ff3384si14889429ejc.763.2023.01.11.06.46.38; Wed, 11 Jan 2023 06:46:51 -0800 (PST) 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=EZXVjXkj; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=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 S234467AbjAKOGU (ORCPT + 53 others); Wed, 11 Jan 2023 09:06:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235843AbjAKOGD (ORCPT ); Wed, 11 Jan 2023 09:06:03 -0500 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2055.outbound.protection.outlook.com [40.107.102.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 122481868F for ; Wed, 11 Jan 2023 06:06:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kYMefet5K1vRUiGOFOMKwVFKaDkJ4+Rm+UMzkofo3KUBA9ghMWs88/pMGC6ZR9OICtRNZlvPVs9Kp3wrPwgmdTEeTKC68Y7Nlh38AeA70DutcOeIT/m24hp/ft9xN1T7Yn03Bss0HRrzFxeJ1se0XlyrlW99I9JabXynTAxsh6MNWP8w2nzIF+jko8cUmRTh11nq7MdOipDnvQKHNcskORxEBaeoaPjFawWz43CLtfarlgPBkqKSiN7NboNzHT+afmTmPey0ALmJQJueBCLFsJpz8mITQKwOT2m6XS/t5ePioZuxD/xwRfDNX2ROM3NWIyh8v/eY3d0l/5bw+xAq/g== 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=W3UtqeVL92WzzGR6C46DSCZs6jchiRzzc2SbM4bAX50=; b=F/QERlLTl4ki9MZGpKndzDTOaGbBc6wPwvCdyljzHh9NECvX9g5siFn/ZagZchkgB2RevROP2KhFDN9j2h4VJny3PAJbSjJduPcW5edvjuVYwT3EUiYndu8fXJMkIcUlSodPFYzYVVJGpt+fyI+ikx1zG+0NhZnkthEA2swv22ZPtdcF6SsJRbGw6szjpt+bjz0AGG7lBh06aryE8nXmgyKTlk/OV3BY+i3OM5Q4z7Zdo6y/k6BtpID9vAk+AxjR9jlFuyse50h0Q9RzBxQmvoPyijpRGie4/+6nvWtXFih7OM6gDc1puKTNFLUV3t+RUWHNw6USmHwQp18hFGb5AA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=W3UtqeVL92WzzGR6C46DSCZs6jchiRzzc2SbM4bAX50=; b=EZXVjXkj5QPd7pBH/BQTKUHsbpgOuMmULfro6HY9ChIFbDxoI4AmoVK1+Bq1mz3Cb94QscY3LCw+uBxM1zS1vXSQJsjgBmaXfmdglityA8nxZvkvrqhbIAZCcuK2i8+2JInY4S7xdMMaXfdGnRE0zeBsXQPuQ+wKtmrkDYK4H8c= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM6PR12MB4123.namprd12.prod.outlook.com (2603:10b6:5:21f::23) by PH8PR12MB6915.namprd12.prod.outlook.com (2603:10b6:510:1bc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Wed, 11 Jan 2023 14:05:57 +0000 Received: from DM6PR12MB4123.namprd12.prod.outlook.com ([fe80::fc88:7080:445e:6866]) by DM6PR12MB4123.namprd12.prod.outlook.com ([fe80::fc88:7080:445e:6866%5]) with mapi id 15.20.5986.018; Wed, 11 Jan 2023 14:05:57 +0000 Message-ID: <68ab36c0-5514-667f-1ffe-378206aeafff@amd.com> Date: Wed, 11 Jan 2023 19:38:58 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH 08/19] ASoC: amd: ps: add soundwire dma driver dma ops Content-Language: en-US To: Mark Brown Cc: vkoul@kernel.org, alsa-devel@alsa-project.org, Basavaraj.Hiregoudar@amd.com, Sunil-kumar.Dommati@amd.com, Mario.Limonciello@amd.com, Mastan.Katragadda@amd.com, arungopal.kondaveeti@amd.com, Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Syed Saba Kareem , open list References: <20230111090222.2016499-1-Vijendar.Mukunda@amd.com> <20230111090222.2016499-9-Vijendar.Mukunda@amd.com> From: "Mukunda,Vijendar" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN3PR01CA0006.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:95::10) To DM6PR12MB4123.namprd12.prod.outlook.com (2603:10b6:5:21f::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB4123:EE_|PH8PR12MB6915:EE_ X-MS-Office365-Filtering-Correlation-Id: db4dce54-25c9-4152-f36a-08daf3dcf5f8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vlLM4SI/isESv1kELm7vHxAu0nrnhpG/VYz+tnMa5St/rXQMsUofnTXcSmOWcUvghp2Kb813Bq/EU2+SaX+VkGT+Vl/bhAJwqFM9CeNGMkkkRyJjhq9TmVX90UNnJOaV+z1wWv3mfRGo53KkDXNR7j0ZJxa7k1X/gUcM9L8iSThLdBi9ddfk8F+N5q7wQRvTrjXKkK8POR4tocNZu5744rCTlKkw4eObxR4Kva95O9xi6d7Szm2G8/LCyAfj41/SAjqSfmG+FGZFgDNg7AdWpWQhYD4sOwYl8oiE7aaRIDoCSksA+nCBkzMcSbnMvpOgHlJB+ndsF9gX8fOY/3W7TQks5Z0We67G53cQhJlA7mkHdJL/YJL3GfK5QsvYp+udSykuYtVA9klkEwdR4dzf1SrtIJhfpXF4huTtJJLkrSHI81vH+HSHkV4OXKI1rO/kKpHmUXoR/4W1RTeGVg0fNdFuX17jT3NMU7xlPleoXpmj3HfCeaRD48rvrRDecry7Y3wKerAkU45Kt1XyRHAJ7h/U6JXeBHVV8EZCkkxGm/g3LH2ZzoapKG7tjNwr3SB40lIn1cjtf8crOtXljsudjjSCGTnsAEtFS/ileMOrPWCDNj7yL7BilHAQtHqVcEqSjApZ2VnOf0M8QyrB+PEB+YmmDfPPX+hGembiC9A5Niw34e2pRvNcR5ursJegAZwqKnCpm1EGvpp4Qrh+VgqU/uvspzySBaqFpKiLA/bfhx4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4123.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(39860400002)(366004)(376002)(136003)(396003)(451199015)(8936002)(2906002)(5660300002)(41300700001)(316002)(4326008)(66556008)(8676002)(6916009)(66476007)(66946007)(54906003)(26005)(6512007)(38100700002)(2616005)(31686004)(86362001)(186003)(31696002)(83380400001)(53546011)(36756003)(6506007)(478600001)(6486002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?S2FWQVI4U3YvMWw0VEFTdncwb0ZjRzdtSnQzcVhtSko1ZG5GOFhvSkpoOEFL?= =?utf-8?B?dDBiazBBRlppTjYzZDBxZDFMT2NjQTRXWFRVdEtQcHdNSXM1WDNzYS9rS3Fl?= =?utf-8?B?OEdCWmhQYnhlak9zeHFGM2dxODdmdXhNbmxZeDJ6cU5DZ0JUNWh0Vkx3cnJF?= =?utf-8?B?VmxHYWZHQkM3YzZIUDdQUXZyZ2srRXR4bm5FWDl2cXRZRmhXdGQ2Rll5Kyth?= =?utf-8?B?S2FvV0JHR011aUpxS3dJSEpjcDRDcmlrdGFvVmZyQzFLWmNhNnhITWg5OEhy?= =?utf-8?B?RWE0dE5mZ3gxZ1IvTFBKWkcvMmtVZmphdkRQOXpMdnJCYWhnaVNwaWJQc2Iz?= =?utf-8?B?OUU1d2lWRzdkRmwzS1V3bXlhUUdwVUxtcld1OXRrNUxVTlkxMEp6MjhuYVpJ?= =?utf-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exchange-CrossTenant-AuthSource: DM6PR12MB4123.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2023 14:05:57.5496 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DBw3h3atB1YIUbna/At5xgYxNnirH0o5X+Xtp+JzRiZjlkTRGKHC33S5ut6CPJ8i546uwH1Er7FIEjMm0eSLRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6915 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 On 11/01/23 18:34, Mark Brown wrote: > On Wed, Jan 11, 2023 at 02:32:11PM +0530, Vijendar Mukunda wrote: > >> +static int acp63_sdw_dma_start(struct snd_pcm_substream *stream) >> +{ >> + struct sdw_stream_instance *sdw_ins; >> + struct snd_soc_pcm_runtime *prtd; >> + u32 stream_id; >> + u32 sdw_dma_reg; >> + u32 sdw_dma_en_stat_reg; >> + u32 sdw_dma_stat; >> + u32 val; >> + int timeout = 0; >> + >> + sdw_ins = stream->runtime->private_data; >> + prtd = stream->private_data; >> + stream_id = sdw_ins->stream_id; >> + switch (stream_id) { >> + case ACP_SDW_AUDIO_TX: >> + sdw_dma_reg = ACP_SW_AUDIO_TX_EN; >> + sdw_dma_en_stat_reg = ACP_SW_AUDIO_TX_EN_STATUS; >> + break; > Not super urgent but if you're respinning then it looks like the > register selection here is the same in _dma_stop() so they could be > shared. Indeed it generally feels like it might be nicer to have a > table of structs listing the registers needed per stream so all these > switch statements can be more like > > sdw_dma_reg = stream_registers[sdw_ins->stream_id]; > > That'd make each function smaller and I'd expect it'd be a bit easier to > add new streams for new hardware that way. will fix it in next version.