From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71697C433E1 for ; Wed, 26 Aug 2020 16:41:24 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CD29D206FA for ; Wed, 26 Aug 2020 16:41:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="E4hM1Z5I"; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="0/CE7/9x" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD29D206FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 581D7176E; Wed, 26 Aug 2020 18:40:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 581D7176E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1598460082; bh=Nhxs6GLEXkmk91ceSYxBRjhcy81ZD8QVkvWailiH5V8=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=E4hM1Z5IDttllxSFzjcYyEyErbM8++ClrDWDnJMJphIoHjIYv+6iA6jzDTqKo+JEe sbgiNxv/7aqiZo6EObDr7hg3MpZMBhhklf6RY2kwPwmp1yfgLCEXEjOoO4G0q9Q1H8 M4QO4P0Azla0g45q1VDnvBDuzIi3HOZdZlilitv4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DF71CF8016F; Wed, 26 Aug 2020 18:40:31 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 75E51F801D9; Wed, 26 Aug 2020 18:40:30 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A2FDBF800EB for ; Wed, 26 Aug 2020 18:40:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A2FDBF800EB Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="0/CE7/9x" Received: from localhost (unknown [122.171.38.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4F5322071E; Wed, 26 Aug 2020 16:40:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598460022; bh=Nhxs6GLEXkmk91ceSYxBRjhcy81ZD8QVkvWailiH5V8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0/CE7/9xoULdHqEYGdYFuGogIbhVNQgRoRg1NbIRk3g1xglWTV8iEm8f0Y0khaTKo qoKGl301FSUks2EGYBJmhla9zwh0FLvlOECCAo+KTbjAqUcOk0udgLToVHois88arU mK3AbOh4P7yZmzG+RHaQw1vbQjHqPCqSbL4ud3Es= Date: Wed, 26 Aug 2020 22:10:18 +0530 From: Vinod Koul To: Pierre-Louis Bossart Subject: Re: [PATCH 3/4] soundwire: SDCA: add helper macro to access controls Message-ID: <20200826164018.GF2639@vkoul-mobl> References: <20200825171656.75836-1-pierre-louis.bossart@linux.intel.com> <20200825171656.75836-4-pierre-louis.bossart@linux.intel.com> <20200826085540.GY2639@vkoul-mobl> <9c078341-7e90-a4e8-da30-19e9720d93e4@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9c078341-7e90-a4e8-da30-19e9720d93e4@linux.intel.com> Cc: Guennadi Liakhovetski , alsa-devel@alsa-project.org, Kai Vehmanen , tiwai@suse.de, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Ranjani Sridharan , Hui Wang , broonie@kernel.org, srinivas.kandagatla@linaro.org, jank@cadence.com, slawomir.blauciak@intel.com, Sanyog Kale , Bard liao , Rander Wang X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" On 26-08-20, 10:00, Pierre-Louis Bossart wrote: > > > > > +/* v1.2 device - SDCA address mapping */ > > > > Can you please add description of bits used by each field here, > > something like we have done for DevId > > were you referring to something like this? > > * Spec definition > * Register Bit Contents > * DevId_0 [7:4] 47:44 sdw_version > * DevId_0 [3:0] 43:40 unique_id > * DevId_1 39:32 mfg_id [15:8] > * DevId_2 31:24 mfg_id [7:0] > * DevId_3 23:16 part_id [15:8] > * DevId_4 15:08 part_id [7:0] > * DevId_5 07:00 class_id Correct > > > > > +#define SDW_SDCA_CTL(fun, ent, ctl, ch) (BIT(30) | \ > > > + (((fun) & 0x7) << 22) | \ > > > + (((ent) & 0x40) << 15) | \ > > > + (((ent) & 0x3f) << 7) | \ > > > + (((ctl) & 0x30) << 15) | \ > > > + (((ctl) & 0x0f) << 3) | \ > > > + (((ch) & 0x38) << 12) | \ > > > + ((ch) & 0x07)) > > > > GENMASK() for the bitmaps here please. Also it would look very neat by > > using FIELD_PREP() here, you can skip the bit shifts and they would be > > done by FIELD_PREP() for you. > > ok. FWIW I am testing changes to do the conversion for subsystem to use nice stuff in bitfield.h -- ~Vinod