* Klaus.K Pedersen (Nokia-M/Helsinki) <klaus.k.pedersen@xxxxxxxxx> [080124 13:19]: > On Wed, 2008-01-23 at 16:53 -0800, ext Tony Lindgren wrote: > > From: Gadiyar, Anand <gadiyar@xxxxxx> > > > > This patch adds pinmux support for OMAP3. > .... > > + > > +/* PHY - HSUSB: 12-pin ULPI PHY: Port 1*/ > > +MUX_CFG_34XX("Y9_3430_USB1HS_PHY_STP", 0x5d8, 3, 1, 1, 0, > > + 0, 0, 0, 1, 1, 0) > > Seriously - 12 positional arguments to configure an IO pad? - where 9 of > them are 0/1 flags? > > ... and the mode for this pad is output with pull-up? That sounds wrong, > and would be a waste of power! I would really like to avoid this kind of > errors(!) > > Browsing through the TRM it becomes obvious that only very few > combinations makes any sense. > Basically you have to configure the pad for active mode and off state. > > In active state the state can be output or input with some kind of pull. > > So all valid states for the first argument (active) is one of: > OUTPUT > INPUT > INPUT_PULLUP > INPUT_PULLDOWN > > Off mode is more complicated. As you select here you can have input > with combinations of wake and pull and output high or low. > > The second argument (off) can be: > NONE > OUTPUT_H > OUTPUT_L > INPUT_PULLUP > INPUT_PULLDOWN > INPUT_PULLUP_WAKE > INPUT_PULLDOWN_WAKE > > This: > > MUX_CFG_34XX("AB11_3430_USB2HS_PHY_NXT", 0x5f6, 3, 0, 0, 1, > 0, 0, 0, 0, 0, 0) > > could be expressed with: > > MUX_CFG_34XX("AB11_3430_USB2HS_PHY_NXT", 0x5f6, 3, INPUT, OFF_NONE) > > > And you would spot the error in this one right away: > > MUX_CFG_34XX("Y9_3430_USB1HS_PHY_STP", 0x5d8, 3, 1, 1, 0, > 0, 0, 0, 1, 1, 0) > > which would become: > > MUX_CFG_34XX("Y9_3430_USB1HS_PHY_STP", 0x5d8, 3, OUTPUT, OFF_INPUT_PULL_H) This sounds like a good way to group the pin options to me. We could also pass the active state flags to omap_cfg_reg() as some may depend on devices connected. Can anybody see cases where Klaus' grouping would not work? Tony - To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html