[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200826164018.GF2639@vkoul-mobl>
Date: Wed, 26 Aug 2020 22:10:18 +0530
From: Vinod Koul <vkoul@...nel.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
Cc: Guennadi Liakhovetski <guennadi.liakhovetski@...ux.intel.com>,
alsa-devel@...a-project.org,
Kai Vehmanen <kai.vehmanen@...ux.intel.com>, tiwai@...e.de,
gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
Hui Wang <hui.wang@...onical.com>, broonie@...nel.org,
srinivas.kandagatla@...aro.org, jank@...ence.com,
slawomir.blauciak@...el.com, Sanyog Kale <sanyog.r.kale@...el.com>,
Bard liao <yung-chuan.liao@...ux.intel.com>,
Rander Wang <rander.wang@...ux.intel.com>
Subject: Re: [PATCH 3/4] soundwire: SDCA: add helper macro to access controls
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
Powered by blists - more mailing lists