Ok, I hate to keep harping on this, but I do thing you're missing the point. The function (or documentation of the function) has a bug.
According to the documentation, this particular function serves two purposes:
1. Attach a base clock to an input source.
2. Power down a base clock.
It should be possible to do #2 WITHOUT doing #1. In your example, not only do I powerdown the SPIFI clock, I also attach it to the 32kHz oscillator. Sure, I can do this, but then, depending on which clock I'm powering down, I have to select a proper input clock. I *could* use the 32kHz clock for most (unless it's USB0), however, this is contrary to the documented use of the function.
ALSO, if the function was intended to be used how you describe, why would the fall through of the first 'if' statement be to shut down a non-existent BaseClock:
if (BaseClock < CLK_BASE_NONE) {
....
}
else {
LPC_CGU->BASE_CLK[BaseClock] = reg | 1; /* Power down this base clock */
}
This would try to set the power-down bit of a non-existent (BaseClock >= CLK_BASE_NONE) clock by writing to a portion of register space that is not defined.
I think it's far more reasonable to assume that this function is buggy, and the 'else' parameter specified above should be related to the 'if(Input != CLKINPUT_PD)' block.
If you had a public bugtracker for LPCOpen, I would submit this, but since you don't (that I can find), the forums seem to be my only way.