I do this (pseudo code), this works for at least two pwm's:
uint32_t pwm_io_info[gpio_pwm_size][3];
uint32_t pwm_duty_init[gpio_pwm_size];
gpio_init(); /* this may or may not matter, try it... */
for pwmchannel in all pwm's
{
pwm_io_info[pwmchannel][0] = mux_index;
pwm_io_info[pwmchannel][1] = mux_func;
pwm_io_info[pwmchannel][2] = pin_index;
pwm_duty_init[pwmchannel] = duty;
}
pwm_init(3000, pwm_duty_init, pwmchannel, pwm_io_channel);
pwm_start();