From: Kim Phillips Date: Thu, 29 Oct 2009 18:23:04 -0500 Subject: [U-Boot] [PATCH] Davinci: add a pin multiplexer configuration API In-Reply-To: <4AE9B6EA.9080206@gefanuc.com> References: <4AE9B6EA.9080206@gefanuc.com> Message-ID: <20091029182304.469c9f7f.kim.phillips@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, 29 Oct 2009 15:38:18 +0000 Nick Thompson wrote: > +int davinci_configure_pin_mux(const struct pinmux_config *pins, int n_pins) > +{ > + int i; > + > + for (i = 0; i < n_pins; i++) { > + int value = pins[i].value; > + int field = pins[i].field; > + > + if (field < PIN_MUX_NUM_FIELDS && > + (value & ~PIN_MUX_FIELD_MASK) == 0) { the second line should not be indented as though it is the code subblock; it should fall directly underneath the column where 'field <..' starts, like this: if (field < PIN_MUX_NUM_FIELDS && (value & ~PIN_MUX_FIELD_MASK) == 0) { > + int offset = field * PIN_MUX_FIELD_SIZE; > + unsigned int mux = pins[i].mux; > + unsigned int mask = PIN_MUX_FIELD_MASK << offset; also please just declare everything@the top of the function - same for value and field declarations above. > + value <<= offset; > + writel(value | (readl(mux) & (~mask)), mux); I guess arm doesn't have setbits32 and friends, huh. Kim