Lines Matching refs:clk_scaling

1146 		memcpy(&new_pwr_info, &hba->clk_scaling.saved_pwr_info.info,  in ufshcd_scale_gear()
1152 if (hba->pwr_info.gear_tx > hba->clk_scaling.min_gear || in ufshcd_scale_gear()
1153 hba->pwr_info.gear_rx > hba->clk_scaling.min_gear) { in ufshcd_scale_gear()
1155 memcpy(&hba->clk_scaling.saved_pwr_info.info, in ufshcd_scale_gear()
1160 new_pwr_info.gear_tx = hba->clk_scaling.min_gear; in ufshcd_scale_gear()
1161 new_pwr_info.gear_rx = hba->clk_scaling.min_gear; in ufshcd_scale_gear()
1187 if (!hba->clk_scaling.is_allowed || in ufshcd_clock_scaling_prepare()
1266 clk_scaling.suspend_work); in ufshcd_clk_scaling_suspend_work()
1270 if (hba->clk_scaling.active_reqs || hba->clk_scaling.is_suspended) { in ufshcd_clk_scaling_suspend_work()
1274 hba->clk_scaling.is_suspended = true; in ufshcd_clk_scaling_suspend_work()
1283 clk_scaling.resume_work); in ufshcd_clk_scaling_resume_work()
1287 if (!hba->clk_scaling.is_suspended) { in ufshcd_clk_scaling_resume_work()
1291 hba->clk_scaling.is_suspended = false; in ufshcd_clk_scaling_resume_work()
1320 if (!hba->clk_scaling.active_reqs) in ufshcd_devfreq_target()
1349 queue_work(hba->clk_scaling.workq, in ufshcd_devfreq_target()
1350 &hba->clk_scaling.suspend_work); in ufshcd_devfreq_target()
1378 struct ufs_clk_scaling *scaling = &hba->clk_scaling; in ufshcd_devfreq_get_dev_status()
1479 hba->clk_scaling.window_start_t = 0; in __ufshcd_suspend_clkscaling()
1488 cancel_work_sync(&hba->clk_scaling.suspend_work); in ufshcd_suspend_clkscaling()
1489 cancel_work_sync(&hba->clk_scaling.resume_work); in ufshcd_suspend_clkscaling()
1492 if (!hba->clk_scaling.is_suspended) { in ufshcd_suspend_clkscaling()
1494 hba->clk_scaling.is_suspended = true; in ufshcd_suspend_clkscaling()
1508 if (hba->clk_scaling.is_suspended) { in ufshcd_resume_clkscaling()
1510 hba->clk_scaling.is_suspended = false; in ufshcd_resume_clkscaling()
1523 return sysfs_emit(buf, "%d\n", hba->clk_scaling.is_enabled); in ufshcd_clkscale_enable_show()
1543 if (value == hba->clk_scaling.is_enabled) in ufshcd_clkscale_enable_store()
1549 hba->clk_scaling.is_enabled = value; in ufshcd_clkscale_enable_store()
1570 hba->clk_scaling.enable_attr.show = ufshcd_clkscale_enable_show; in ufshcd_init_clk_scaling_sysfs()
1571 hba->clk_scaling.enable_attr.store = ufshcd_clkscale_enable_store; in ufshcd_init_clk_scaling_sysfs()
1572 sysfs_attr_init(&hba->clk_scaling.enable_attr.attr); in ufshcd_init_clk_scaling_sysfs()
1573 hba->clk_scaling.enable_attr.attr.name = "clkscale_enable"; in ufshcd_init_clk_scaling_sysfs()
1574 hba->clk_scaling.enable_attr.attr.mode = 0644; in ufshcd_init_clk_scaling_sysfs()
1575 if (device_create_file(hba->dev, &hba->clk_scaling.enable_attr)) in ufshcd_init_clk_scaling_sysfs()
1581 if (hba->clk_scaling.enable_attr.attr.name) in ufshcd_remove_clk_scaling_sysfs()
1582 device_remove_file(hba->dev, &hba->clk_scaling.enable_attr); in ufshcd_remove_clk_scaling_sysfs()
1592 if (!hba->clk_scaling.min_gear) in ufshcd_init_clk_scaling()
1593 hba->clk_scaling.min_gear = UFS_HS_G1; in ufshcd_init_clk_scaling()
1595 INIT_WORK(&hba->clk_scaling.suspend_work, in ufshcd_init_clk_scaling()
1597 INIT_WORK(&hba->clk_scaling.resume_work, in ufshcd_init_clk_scaling()
1602 hba->clk_scaling.workq = create_singlethread_workqueue(wq_name); in ufshcd_init_clk_scaling()
1604 hba->clk_scaling.is_initialized = true; in ufshcd_init_clk_scaling()
1609 if (!hba->clk_scaling.is_initialized) in ufshcd_exit_clk_scaling()
1613 destroy_workqueue(hba->clk_scaling.workq); in ufshcd_exit_clk_scaling()
1615 hba->clk_scaling.is_initialized = false; in ufshcd_exit_clk_scaling()
1982 if (!hba->clk_scaling.active_reqs++) in ufshcd_clk_scaling_start_busy()
1985 if (!hba->clk_scaling.is_enabled || hba->pm_op_in_progress) { in ufshcd_clk_scaling_start_busy()
1991 queue_work(hba->clk_scaling.workq, in ufshcd_clk_scaling_start_busy()
1992 &hba->clk_scaling.resume_work); in ufshcd_clk_scaling_start_busy()
1994 if (!hba->clk_scaling.window_start_t) { in ufshcd_clk_scaling_start_busy()
1995 hba->clk_scaling.window_start_t = curr_t; in ufshcd_clk_scaling_start_busy()
1996 hba->clk_scaling.tot_busy_t = 0; in ufshcd_clk_scaling_start_busy()
1997 hba->clk_scaling.is_busy_started = false; in ufshcd_clk_scaling_start_busy()
2000 if (!hba->clk_scaling.is_busy_started) { in ufshcd_clk_scaling_start_busy()
2001 hba->clk_scaling.busy_start_t = curr_t; in ufshcd_clk_scaling_start_busy()
2002 hba->clk_scaling.is_busy_started = true; in ufshcd_clk_scaling_start_busy()
2009 struct ufs_clk_scaling *scaling = &hba->clk_scaling; in ufshcd_clk_scaling_update_busy()
2016 hba->clk_scaling.active_reqs--; in ufshcd_clk_scaling_update_busy()
5940 hba->clk_scaling.is_allowed = allow; in ufshcd_clk_scaling_allow()
5947 if (hba->clk_scaling.is_enabled) in ufshcd_clk_scaling_suspend()
5952 if (hba->clk_scaling.is_enabled) in ufshcd_clk_scaling_suspend()
5983 hba->clk_scaling.is_enabled) in ufshcd_err_handling_prepare()
7982 memcpy(&hba->clk_scaling.saved_pwr_info.info, in ufshcd_add_lus()
7985 hba->clk_scaling.saved_pwr_info.is_valid = true; in ufshcd_add_lus()
7986 hba->clk_scaling.is_allowed = true; in ufshcd_add_lus()
7992 hba->clk_scaling.is_enabled = true; in ufshcd_add_lus()