Lines Matching refs:clk_gating
517 dev_err(hba->dev, "Clk gate=%d\n", hba->clk_gating.state); in ufshcd_print_host_state()
1545 clk_gating.ungate_work); in ufshcd_ungate_work()
1547 cancel_delayed_work_sync(&hba->clk_gating.gate_work); in ufshcd_ungate_work()
1550 if (hba->clk_gating.state == CLKS_ON) { in ufshcd_ungate_work()
1563 hba->clk_gating.is_suspended = true; in ufshcd_ungate_work()
1572 hba->clk_gating.is_suspended = false; in ufshcd_ungate_work()
1593 hba->clk_gating.active_reqs++; in ufshcd_hold()
1596 switch (hba->clk_gating.state) { in ufshcd_hold()
1610 hba->clk_gating.active_reqs--; in ufshcd_hold()
1614 flush_result = flush_work(&hba->clk_gating.ungate_work); in ufshcd_hold()
1615 if (hba->clk_gating.is_suspended && !flush_result) in ufshcd_hold()
1622 if (cancel_delayed_work(&hba->clk_gating.gate_work)) { in ufshcd_hold()
1623 hba->clk_gating.state = CLKS_ON; in ufshcd_hold()
1625 hba->clk_gating.state); in ufshcd_hold()
1635 hba->clk_gating.state = REQ_CLKS_ON; in ufshcd_hold()
1637 hba->clk_gating.state); in ufshcd_hold()
1638 if (queue_work(hba->clk_gating.clk_gating_workq, in ufshcd_hold()
1639 &hba->clk_gating.ungate_work)) in ufshcd_hold()
1649 hba->clk_gating.active_reqs--; in ufshcd_hold()
1654 flush_work(&hba->clk_gating.ungate_work); in ufshcd_hold()
1660 __func__, hba->clk_gating.state); in ufshcd_hold()
1672 clk_gating.gate_work.work); in ufshcd_gate_work()
1683 if (hba->clk_gating.is_suspended || in ufshcd_gate_work()
1684 (hba->clk_gating.state != REQ_CLKS_OFF)) { in ufshcd_gate_work()
1685 hba->clk_gating.state = CLKS_ON; in ufshcd_gate_work()
1687 hba->clk_gating.state); in ufshcd_gate_work()
1691 if (hba->clk_gating.active_reqs in ufshcd_gate_work()
1703 hba->clk_gating.state = CLKS_ON; in ufshcd_gate_work()
1707 hba->clk_gating.state); in ufshcd_gate_work()
1727 if (hba->clk_gating.state == REQ_CLKS_OFF) { in ufshcd_gate_work()
1728 hba->clk_gating.state = CLKS_OFF; in ufshcd_gate_work()
1730 hba->clk_gating.state); in ufshcd_gate_work()
1744 hba->clk_gating.active_reqs--; in __ufshcd_release()
1746 if (hba->clk_gating.active_reqs || hba->clk_gating.is_suspended || in __ufshcd_release()
1750 hba->clk_gating.state == CLKS_OFF) in __ufshcd_release()
1753 hba->clk_gating.state = REQ_CLKS_OFF; in __ufshcd_release()
1754 trace_ufshcd_clk_gating(dev_name(hba->dev), hba->clk_gating.state); in __ufshcd_release()
1755 queue_delayed_work(hba->clk_gating.clk_gating_workq, in __ufshcd_release()
1756 &hba->clk_gating.gate_work, in __ufshcd_release()
1757 msecs_to_jiffies(hba->clk_gating.delay_ms)); in __ufshcd_release()
1775 return snprintf(buf, PAGE_SIZE, "%lu\n", hba->clk_gating.delay_ms); in ufshcd_clkgate_delay_show()
1788 hba->clk_gating.delay_ms = value; in ufshcd_clkgate_delay_store()
1798 return snprintf(buf, PAGE_SIZE, "%d\n", hba->clk_gating.is_enabled); in ufshcd_clkgate_enable_show()
1812 if (value == hba->clk_gating.is_enabled) in ufshcd_clkgate_enable_store()
1819 hba->clk_gating.active_reqs++; in ufshcd_clkgate_enable_store()
1823 hba->clk_gating.is_enabled = value; in ufshcd_clkgate_enable_store()
1863 hba->clk_gating.state = CLKS_ON; in ufshcd_init_clk_gating()
1865 hba->clk_gating.delay_ms = 150; in ufshcd_init_clk_gating()
1866 INIT_DELAYED_WORK(&hba->clk_gating.gate_work, ufshcd_gate_work); in ufshcd_init_clk_gating()
1867 INIT_WORK(&hba->clk_gating.ungate_work, ufshcd_ungate_work); in ufshcd_init_clk_gating()
1871 hba->clk_gating.clk_gating_workq = alloc_ordered_workqueue(wq_name, in ufshcd_init_clk_gating()
1874 hba->clk_gating.is_enabled = true; in ufshcd_init_clk_gating()
1876 hba->clk_gating.delay_attr.show = ufshcd_clkgate_delay_show; in ufshcd_init_clk_gating()
1877 hba->clk_gating.delay_attr.store = ufshcd_clkgate_delay_store; in ufshcd_init_clk_gating()
1878 sysfs_attr_init(&hba->clk_gating.delay_attr.attr); in ufshcd_init_clk_gating()
1879 hba->clk_gating.delay_attr.attr.name = "clkgate_delay_ms"; in ufshcd_init_clk_gating()
1880 hba->clk_gating.delay_attr.attr.mode = 0644; in ufshcd_init_clk_gating()
1881 if (device_create_file(hba->dev, &hba->clk_gating.delay_attr)) in ufshcd_init_clk_gating()
1884 hba->clk_gating.enable_attr.show = ufshcd_clkgate_enable_show; in ufshcd_init_clk_gating()
1885 hba->clk_gating.enable_attr.store = ufshcd_clkgate_enable_store; in ufshcd_init_clk_gating()
1886 sysfs_attr_init(&hba->clk_gating.enable_attr.attr); in ufshcd_init_clk_gating()
1887 hba->clk_gating.enable_attr.attr.name = "clkgate_enable"; in ufshcd_init_clk_gating()
1888 hba->clk_gating.enable_attr.attr.mode = 0644; in ufshcd_init_clk_gating()
1889 if (device_create_file(hba->dev, &hba->clk_gating.enable_attr)) in ufshcd_init_clk_gating()
1897 device_remove_file(hba->dev, &hba->clk_gating.delay_attr); in ufshcd_exit_clk_gating()
1898 device_remove_file(hba->dev, &hba->clk_gating.enable_attr); in ufshcd_exit_clk_gating()
1899 cancel_work_sync(&hba->clk_gating.ungate_work); in ufshcd_exit_clk_gating()
1900 cancel_delayed_work_sync(&hba->clk_gating.gate_work); in ufshcd_exit_clk_gating()
1901 destroy_workqueue(hba->clk_gating.clk_gating_workq); in ufshcd_exit_clk_gating()
2552 (hba->clk_gating.state != CLKS_ON)); in ufshcd_queuecommand()
8090 hba->clk_gating.state = CLKS_ON; in ufshcd_setup_clocks()
8092 hba->clk_gating.state); in ufshcd_setup_clocks()
8535 hba->clk_gating.is_suspended = true; in ufshcd_suspend()
8624 hba->clk_gating.state = CLKS_OFF; in ufshcd_suspend()
8626 hba->clk_gating.state); in ufshcd_suspend()
8647 hba->clk_gating.is_suspended = false; in ufshcd_suspend()
8741 hba->clk_gating.is_suspended = false; in ufshcd_resume()
8771 hba->clk_gating.state = CLKS_OFF; in ufshcd_resume()
8773 hba->clk_gating.state); in ufshcd_resume()