Lines Matching refs:sclk
455 static void syscon_block_reset_enable(struct clk_syscon *sclk) in syscon_block_reset_enable() argument
461 if (!sclk->res_reg) in syscon_block_reset_enable()
464 val = readw(sclk->res_reg); in syscon_block_reset_enable()
465 val |= BIT(sclk->res_bit); in syscon_block_reset_enable()
466 writew(val, sclk->res_reg); in syscon_block_reset_enable()
468 sclk->reset = true; in syscon_block_reset_enable()
471 static void syscon_block_reset_disable(struct clk_syscon *sclk) in syscon_block_reset_disable() argument
477 if (!sclk->res_reg) in syscon_block_reset_disable()
480 val = readw(sclk->res_reg); in syscon_block_reset_disable()
481 val &= ~BIT(sclk->res_bit); in syscon_block_reset_disable()
482 writew(val, sclk->res_reg); in syscon_block_reset_disable()
484 sclk->reset = false; in syscon_block_reset_disable()
489 struct clk_syscon *sclk = to_syscon(hw); in syscon_clk_prepare() local
492 if (sclk->reset) in syscon_clk_prepare()
493 syscon_block_reset_disable(sclk); in syscon_clk_prepare()
499 struct clk_syscon *sclk = to_syscon(hw); in syscon_clk_unprepare() local
502 if (sclk->clk_val == U300_SYSCON_SBCER_UART_CLK_EN) in syscon_clk_unprepare()
505 if (!sclk->reset) in syscon_clk_unprepare()
506 syscon_block_reset_enable(sclk); in syscon_clk_unprepare()
511 struct clk_syscon *sclk = to_syscon(hw); in syscon_clk_enable() local
514 if (sclk->hw_ctrld) in syscon_clk_enable()
517 if (sclk->clk_val == 0xFFFFU) in syscon_clk_enable()
520 writew(sclk->clk_val, syscon_vbase + U300_SYSCON_SBCER); in syscon_clk_enable()
526 struct clk_syscon *sclk = to_syscon(hw); in syscon_clk_disable() local
529 if (sclk->hw_ctrld) in syscon_clk_disable()
531 if (sclk->clk_val == 0xFFFFU) in syscon_clk_disable()
534 if (sclk->clk_val == U300_SYSCON_SBCER_UART_CLK_EN) in syscon_clk_disable()
537 writew(sclk->clk_val, syscon_vbase + U300_SYSCON_SBCDR); in syscon_clk_disable()
542 struct clk_syscon *sclk = to_syscon(hw); in syscon_clk_is_enabled() local
546 if (!sclk->en_reg) in syscon_clk_is_enabled()
549 val = readw(sclk->en_reg); in syscon_clk_is_enabled()
550 val &= BIT(sclk->en_bit); in syscon_clk_is_enabled()
568 struct clk_syscon *sclk = to_syscon(hw); in syscon_clk_recalc_rate() local
571 switch(sclk->clk_val) { in syscon_clk_recalc_rate()
636 struct clk_syscon *sclk = to_syscon(hw); in syscon_clk_round_rate() local
638 if (sclk->clk_val != U300_SYSCON_SBCER_CPU_CLK_EN) in syscon_clk_round_rate()
653 struct clk_syscon *sclk = to_syscon(hw); in syscon_clk_set_rate() local
657 if (sclk->clk_val != U300_SYSCON_SBCER_CPU_CLK_EN) in syscon_clk_set_rate()
701 struct clk_syscon *sclk; in syscon_clk_register() local
705 sclk = kzalloc(sizeof(struct clk_syscon), GFP_KERNEL); in syscon_clk_register()
706 if (!sclk) { in syscon_clk_register()
716 sclk->hw.init = &init; in syscon_clk_register()
717 sclk->hw_ctrld = hw_ctrld; in syscon_clk_register()
719 sclk->reset = true; in syscon_clk_register()
720 sclk->res_reg = res_reg; in syscon_clk_register()
721 sclk->res_bit = res_bit; in syscon_clk_register()
722 sclk->en_reg = en_reg; in syscon_clk_register()
723 sclk->en_bit = en_bit; in syscon_clk_register()
724 sclk->clk_val = clk_val; in syscon_clk_register()
726 hw = &sclk->hw; in syscon_clk_register()
729 kfree(sclk); in syscon_clk_register()