Lines Matching defs:hdev

10 void goya_set_pll_profile(struct hl_device *hdev, enum hl_pll_frequency freq)
12 struct goya_device *goya = hdev->asic_specific;
16 hl_set_frequency(hdev, MME_PLL, hdev->high_pll);
17 hl_set_frequency(hdev, TPC_PLL, hdev->high_pll);
18 hl_set_frequency(hdev, IC_PLL, hdev->high_pll);
21 hl_set_frequency(hdev, MME_PLL, GOYA_PLL_FREQ_LOW);
22 hl_set_frequency(hdev, TPC_PLL, GOYA_PLL_FREQ_LOW);
23 hl_set_frequency(hdev, IC_PLL, GOYA_PLL_FREQ_LOW);
26 hl_set_frequency(hdev, MME_PLL, goya->mme_clk);
27 hl_set_frequency(hdev, TPC_PLL, goya->tpc_clk);
28 hl_set_frequency(hdev, IC_PLL, goya->ic_clk);
31 dev_err(hdev->dev, "unknown frequency setting\n");
35 int goya_get_clk_rate(struct hl_device *hdev, u32 *cur_clk, u32 *max_clk)
39 if (hl_device_disabled_or_in_reset(hdev))
42 value = hl_get_frequency(hdev, MME_PLL, false);
45 dev_err(hdev->dev, "Failed to retrieve device max clock %ld\n",
52 value = hl_get_frequency(hdev, MME_PLL, true);
55 dev_err(hdev->dev,
69 struct hl_device *hdev = dev_get_drvdata(dev);
72 if (hl_device_disabled_or_in_reset(hdev))
75 value = hl_get_frequency(hdev, MME_PLL, false);
86 struct hl_device *hdev = dev_get_drvdata(dev);
87 struct goya_device *goya = hdev->asic_specific;
91 if (hl_device_disabled_or_in_reset(hdev)) {
96 if (hdev->pm_mng_profile == PM_AUTO) {
108 hl_set_frequency(hdev, MME_PLL, value);
118 struct hl_device *hdev = dev_get_drvdata(dev);
121 if (hl_device_disabled_or_in_reset(hdev))
124 value = hl_get_frequency(hdev, TPC_PLL, false);
135 struct hl_device *hdev = dev_get_drvdata(dev);
136 struct goya_device *goya = hdev->asic_specific;
140 if (hl_device_disabled_or_in_reset(hdev)) {
145 if (hdev->pm_mng_profile == PM_AUTO) {
157 hl_set_frequency(hdev, TPC_PLL, value);
167 struct hl_device *hdev = dev_get_drvdata(dev);
170 if (hl_device_disabled_or_in_reset(hdev))
173 value = hl_get_frequency(hdev, IC_PLL, false);
184 struct hl_device *hdev = dev_get_drvdata(dev);
185 struct goya_device *goya = hdev->asic_specific;
189 if (hl_device_disabled_or_in_reset(hdev)) {
194 if (hdev->pm_mng_profile == PM_AUTO) {
206 hl_set_frequency(hdev, IC_PLL, value);
216 struct hl_device *hdev = dev_get_drvdata(dev);
219 if (hl_device_disabled_or_in_reset(hdev))
222 value = hl_get_frequency(hdev, MME_PLL, true);
233 struct hl_device *hdev = dev_get_drvdata(dev);
236 if (hl_device_disabled_or_in_reset(hdev))
239 value = hl_get_frequency(hdev, TPC_PLL, true);
250 struct hl_device *hdev = dev_get_drvdata(dev);
253 if (hl_device_disabled_or_in_reset(hdev))
256 value = hl_get_frequency(hdev, IC_PLL, true);
267 struct hl_device *hdev = dev_get_drvdata(dev);
269 if (hl_device_disabled_or_in_reset(hdev))
273 (hdev->pm_mng_profile == PM_AUTO) ? "auto" :
274 (hdev->pm_mng_profile == PM_MANUAL) ? "manual" :
281 struct hl_device *hdev = dev_get_drvdata(dev);
283 if (hl_device_disabled_or_in_reset(hdev)) {
288 mutex_lock(&hdev->fpriv_list_lock);
290 if (hdev->compute_ctx) {
291 dev_err(hdev->dev,
299 if (hdev->pm_mng_profile == PM_MANUAL) {
300 hdev->curr_pll_profile = PLL_HIGH;
301 hdev->pm_mng_profile = PM_AUTO;
302 hl_device_set_frequency(hdev, PLL_LOW);
305 if (hdev->pm_mng_profile == PM_AUTO) {
311 hdev->pm_mng_profile = PM_MANUAL;
313 mutex_unlock(&hdev->fpriv_list_lock);
318 flush_delayed_work(&hdev->work_freq);
323 dev_err(hdev->dev, "value should be auto or manual\n");
328 mutex_unlock(&hdev->fpriv_list_lock);
336 struct hl_device *hdev = dev_get_drvdata(dev);
338 if (hl_device_disabled_or_in_reset(hdev))
341 return sprintf(buf, "%u\n", hdev->high_pll);
347 struct hl_device *hdev = dev_get_drvdata(dev);
351 if (hl_device_disabled_or_in_reset(hdev)) {
363 hdev->high_pll = value;
390 void goya_add_device_attr(struct hl_device *hdev,