• Viresh Kumar's avatar
    clk: clk-gate: Create clk_gate_endisable() · fbc42aab
    Viresh Kumar authored
    This patch tries to remove duplicate code for clk_gate clocks. This creates
    another routine clk_gate_endisable() which will take care of enable/disable
    clock with knowledge of CLK_GATE_SET_TO_DISABLE flag.
    
    It works on following logic:
    
    For enabling clock, enable = 1
    	set2dis = 1	-> clear bit	-> set = 0
    	set2dis = 0	-> set bit	-> set = 1
    
    For disabling clock, enable = 0
    	set2dis = 1	-> set bit	-> set = 1
    	set2dis = 0	-> clear bit	-> set = 0
    
    So, result is always: enable xor set2dis.
    Signed-off-by: default avatarViresh Kumar <viresh.kumar@st.com>
    Signed-off-by: default avatarMike Turquette <mturquette@linaro.org>
    fbc42aab
clk-gate.c 3.55 KB