Lines Matching refs:clk_gating

507 	dev_err(hba->dev, "Clk gate=%d\n", hba->clk_gating.state);  in ufshcd_print_host_state()
1477 clk_gating.ungate_work); in ufshcd_ungate_work()
1479 cancel_delayed_work_sync(&hba->clk_gating.gate_work); in ufshcd_ungate_work()
1482 if (hba->clk_gating.state == CLKS_ON) { in ufshcd_ungate_work()
1493 hba->clk_gating.is_suspended = true; in ufshcd_ungate_work()
1502 hba->clk_gating.is_suspended = false; in ufshcd_ungate_work()
1522 hba->clk_gating.active_reqs++; in ufshcd_hold()
1530 switch (hba->clk_gating.state) { in ufshcd_hold()
1543 flush_work(&hba->clk_gating.ungate_work); in ufshcd_hold()
1549 if (cancel_delayed_work(&hba->clk_gating.gate_work)) { in ufshcd_hold()
1550 hba->clk_gating.state = CLKS_ON; in ufshcd_hold()
1552 hba->clk_gating.state); in ufshcd_hold()
1563 hba->clk_gating.state = REQ_CLKS_ON; in ufshcd_hold()
1565 hba->clk_gating.state); in ufshcd_hold()
1566 queue_work(hba->clk_gating.clk_gating_workq, in ufshcd_hold()
1567 &hba->clk_gating.ungate_work); in ufshcd_hold()
1576 hba->clk_gating.active_reqs--; in ufshcd_hold()
1581 flush_work(&hba->clk_gating.ungate_work); in ufshcd_hold()
1587 __func__, hba->clk_gating.state); in ufshcd_hold()
1599 clk_gating.gate_work.work); in ufshcd_gate_work()
1609 if (hba->clk_gating.is_suspended || in ufshcd_gate_work()
1610 (hba->clk_gating.state == REQ_CLKS_ON)) { in ufshcd_gate_work()
1611 hba->clk_gating.state = CLKS_ON; in ufshcd_gate_work()
1613 hba->clk_gating.state); in ufshcd_gate_work()
1617 if (hba->clk_gating.active_reqs in ufshcd_gate_work()
1628 hba->clk_gating.state = CLKS_ON; in ufshcd_gate_work()
1630 hba->clk_gating.state); in ufshcd_gate_work()
1652 if (hba->clk_gating.state == REQ_CLKS_OFF) { in ufshcd_gate_work()
1653 hba->clk_gating.state = CLKS_OFF; in ufshcd_gate_work()
1655 hba->clk_gating.state); in ufshcd_gate_work()
1669 hba->clk_gating.active_reqs--; in __ufshcd_release()
1671 if (hba->clk_gating.active_reqs || hba->clk_gating.is_suspended in __ufshcd_release()
1678 hba->clk_gating.state = REQ_CLKS_OFF; in __ufshcd_release()
1679 trace_ufshcd_clk_gating(dev_name(hba->dev), hba->clk_gating.state); in __ufshcd_release()
1680 queue_delayed_work(hba->clk_gating.clk_gating_workq, in __ufshcd_release()
1681 &hba->clk_gating.gate_work, in __ufshcd_release()
1682 msecs_to_jiffies(hba->clk_gating.delay_ms)); in __ufshcd_release()
1700 return snprintf(buf, PAGE_SIZE, "%lu\n", hba->clk_gating.delay_ms); in ufshcd_clkgate_delay_show()
1713 hba->clk_gating.delay_ms = value; in ufshcd_clkgate_delay_store()
1723 return snprintf(buf, PAGE_SIZE, "%d\n", hba->clk_gating.is_enabled); in ufshcd_clkgate_enable_show()
1737 if (value == hba->clk_gating.is_enabled) in ufshcd_clkgate_enable_store()
1744 hba->clk_gating.active_reqs++; in ufshcd_clkgate_enable_store()
1748 hba->clk_gating.is_enabled = value; in ufshcd_clkgate_enable_store()
1788 hba->clk_gating.delay_ms = 150; in ufshcd_init_clk_gating()
1789 INIT_DELAYED_WORK(&hba->clk_gating.gate_work, ufshcd_gate_work); in ufshcd_init_clk_gating()
1790 INIT_WORK(&hba->clk_gating.ungate_work, ufshcd_ungate_work); in ufshcd_init_clk_gating()
1794 hba->clk_gating.clk_gating_workq = alloc_ordered_workqueue(wq_name, in ufshcd_init_clk_gating()
1797 hba->clk_gating.is_enabled = true; in ufshcd_init_clk_gating()
1799 hba->clk_gating.delay_attr.show = ufshcd_clkgate_delay_show; in ufshcd_init_clk_gating()
1800 hba->clk_gating.delay_attr.store = ufshcd_clkgate_delay_store; in ufshcd_init_clk_gating()
1801 sysfs_attr_init(&hba->clk_gating.delay_attr.attr); in ufshcd_init_clk_gating()
1802 hba->clk_gating.delay_attr.attr.name = "clkgate_delay_ms"; in ufshcd_init_clk_gating()
1803 hba->clk_gating.delay_attr.attr.mode = 0644; in ufshcd_init_clk_gating()
1804 if (device_create_file(hba->dev, &hba->clk_gating.delay_attr)) in ufshcd_init_clk_gating()
1807 hba->clk_gating.enable_attr.show = ufshcd_clkgate_enable_show; in ufshcd_init_clk_gating()
1808 hba->clk_gating.enable_attr.store = ufshcd_clkgate_enable_store; in ufshcd_init_clk_gating()
1809 sysfs_attr_init(&hba->clk_gating.enable_attr.attr); in ufshcd_init_clk_gating()
1810 hba->clk_gating.enable_attr.attr.name = "clkgate_enable"; in ufshcd_init_clk_gating()
1811 hba->clk_gating.enable_attr.attr.mode = 0644; in ufshcd_init_clk_gating()
1812 if (device_create_file(hba->dev, &hba->clk_gating.enable_attr)) in ufshcd_init_clk_gating()
1820 device_remove_file(hba->dev, &hba->clk_gating.delay_attr); in ufshcd_exit_clk_gating()
1821 device_remove_file(hba->dev, &hba->clk_gating.enable_attr); in ufshcd_exit_clk_gating()
1822 cancel_work_sync(&hba->clk_gating.ungate_work); in ufshcd_exit_clk_gating()
1823 cancel_delayed_work_sync(&hba->clk_gating.gate_work); in ufshcd_exit_clk_gating()
1824 destroy_workqueue(hba->clk_gating.clk_gating_workq); in ufshcd_exit_clk_gating()
2461 WARN_ON(hba->clk_gating.state != CLKS_ON); in ufshcd_queuecommand()
7335 hba->clk_gating.state = CLKS_ON; in __ufshcd_setup_clocks()
7337 hba->clk_gating.state); in __ufshcd_setup_clocks()
7770 hba->clk_gating.is_suspended = true; in ufshcd_suspend()
7841 hba->clk_gating.state = CLKS_OFF; in ufshcd_suspend()
7842 trace_ufshcd_clk_gating(dev_name(hba->dev), hba->clk_gating.state); in ufshcd_suspend()
7866 hba->clk_gating.is_suspended = false; in ufshcd_suspend()
7948 hba->clk_gating.is_suspended = false; in ufshcd_resume()