From: Wolfgang Denk Date: Thu, 08 May 2014 08:03:58 +0200 Subject: [U-Boot] [PATCH] drivers/usb : Introduce APIs for fsl usb registers In-Reply-To: <0adb0aa7c7c6434fb762e1d076b24dae@BLUPR03MB133.namprd03.prod.outlook.com> References: <1399468595-953-1-git-send-email-nikhil.badola@freescale.com> <20140507181227.87A20380180@gemini.denx.de> <0adb0aa7c7c6434fb762e1d076b24dae@BLUPR03MB133.namprd03.prod.outlook.com> Message-ID: <20140508060358.A2EA238060E@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear "nikhil.badola at freescale.com", In message <0adb0aa7c7c6434fb762e1d076b24dae@BLUPR03MB133.namprd03.prod.outlook.com> you wrote: > > > > Why exactly do we need a new API for that? All you'r doing is adding > > just more bits to the mask, right? > > I am adding mask for a register with w1c(write 1 to clear) bits set. So while > setting/resetting any other bit in this register, these bits(w1c bits) should not > get set so as to prevent them from clearing. For this purpose a new API is needed. > This API can be used for any fsl registers that have any number of w1c bit(s). > All one needs is to define mask for that register with w1c bits set. You do not need a new API. We have clrsetbits_*(), which can do exactly what you need. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "To IBM, 'open' means there is a modicum of interoperability among some of their equipment." - Harv Masterson