/* This function is used to set whether to loop.  */
int tls_pwm_loop_mode_config(u8 channel, enum tls_pwm_loop_type loop_mode)
/* This function is used to set whether to loop.  */
int tls_pwm_loop_mode_config(u8 channel, enum tls_pwm_loop_type loop_mode)
{
    if(channel > (PWM_CHANNEL_MAX_NUM - 1))
		return WM_FAILED;
    if (4 == channel)
    {
        if (WM_PWM_LOOP_TYPE_LOOP == loop_mode)
            tls_reg_write32(HR_PWM_CH4_REG2, tls_reg_read32(HR_PWM_CH4_REG2) |   BIT(1));
        else
            tls_reg_write32(HR_PWM_CH4_REG2, tls_reg_read32(HR_PWM_CH4_REG2) & (~BIT(1)));
    }
    else
    {
        if (WM_PWM_LOOP_TYPE_LOOP == loop_mode)
            tls_reg_write32(HR_PWM_CTL,    tls_reg_read32(HR_PWM_CTL) |   BIT(8 + channel));
        else
            tls_reg_write32(HR_PWM_CTL,    tls_reg_read32(HR_PWM_CTL) & (~BIT(8 + channel)));
    }
    return WM_SUCCESS;
}