void nvhost_scale_emc_init(struct platform_device *pdev) { struct nvhost_device_data *pdata = platform_get_drvdata(pdev); struct nvhost_device_profile *profile; struct nvhost_gr3d_params *gr3d_params; nvhost_scale_init(pdev); profile = pdata->power_profile; if (!profile) return; gr3d_params = kzalloc(sizeof(*gr3d_params), GFP_KERNEL); if (!gr3d_params) goto err_allocate_gr3d_params; gr3d_params->clk_3d = 0; gr3d_params->clk_3d_emc = 1; profile->private_data = gr3d_params; nvhost_scale_emc_calibrate_emc(&gr3d_params->emc_params, clk(profile, gr3d_params->clk_3d), clk(profile, gr3d_params->clk_3d_emc), pdata->linear_emc); if (nvhost_module_add_client(pdev, gr3d_params)) nvhost_err(&pdev->dev, "failed to register as a acm client"); return; err_allocate_gr3d_params: nvhost_scale_deinit(pdev); }
void nvhost_scale3d_deinit(struct platform_device *pdev) { struct nvhost_device_data *pdata = platform_get_drvdata(pdev); if (!pdata->power_profile) return; kfree(pdata->power_profile->private_data); pdata->power_profile->private_data = NULL; nvhost_scale_deinit(pdev); }
void nvhost_scale_emc_deinit(struct platform_device *pdev) { struct nvhost_device_data *pdata = platform_get_drvdata(pdev); if (!pdata->power_profile) return; /* Remove devfreq from acm client list */ nvhost_module_remove_client(pdev, pdata->power_profile->private_data); kfree(pdata->power_profile->private_data); pdata->power_profile->private_data = NULL; nvhost_scale_deinit(pdev); }