From: Takashi Iwai Subject: Re: [PATCH 1/5] [RFC]intel_hdmi_audio:include header Date: Thu, 25 Nov 2010 07:25:59 +0100 Message-ID: References: <1290433186-31628-1-git-send-email-ramesh.babu@intel.com> <4F93CB265C2E2E42A19CD9E994A1FA5D060B039E7E@bgsmsx501.gar.corp.intel.com> <4F93CB265C2E2E42A19CD9E994A1FA5D060B039F28@bgsmsx501.gar.corp.intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 1A932103B97 for ; Thu, 25 Nov 2010 07:26:00 +0100 (CET) In-Reply-To: <4F93CB265C2E2E42A19CD9E994A1FA5D060B039F28@bgsmsx501.gar.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: "Bandarupalli, Sailaja" Cc: "Wu, Fengguang" , "alsa-devel@alsa-project.org" , Mark Brown , "Babu, Ramesh" List-Id: alsa-devel@alsa-project.org At Thu, 25 Nov 2010 11:37:58 +0530, Bandarupalli, Sailaja wrote: > > > > > > > +/** > > > > > + * union aud_cfg - Audio configuration offset - 69000 > > > > > + * > > > > > + * @cfg_regx: individual register bits > > > > > + * @cfg_regval: full register value > > > > > + * > > > > > + * */ > > > > > +union aud_cfg { > > > > > + struct { > > > > > + u32 aud_en:1; > > > > > + u32 layout:1; > > > > > + u32 fmt:2; > > > > > + u32 num_ch:2; > > > > > + u32 rsvd0:1; > > > > > + u32 set:1; > > > > > + u32 flat:1; > > > > > + u32 val_bit:1; > > > > > + u32 user_bit:1; > > > > > + u32 underrun:1; > > > > > + u32 rsvd1:20; > > > > > + } cfg_regx; > > > > > + u32 cfg_regval; > > > > > +}; > > > > > > > > In general, better to avoid bit fields if it's used for the data > > > > transfer. The bit-fields are never portable. > > > > > > > These bit fields are used for programming the HDMI controller > > subsystem. > > > > So, these bit-fields data aren't exposed to the hardware as is, but > > used only between the hdmi audio and the controller drivers? > > (But then, why these have to be defined in here?) > > > > > These bits fields are used between HDMI audio driver and hardware. > They are exposed by the hardware as is, and we need to write to > specific bits to enable HDMI audio. Then the bit-fields aren't suitable regarding the portability. Takashi