Lines Matching defs:hdev

15 int hl_build_hwmon_channel_info(struct hl_device *hdev,
34 dev_err(hdev->dev,
91 hdev->hl_chip_info->info =
114 struct hl_device *hdev = dev_get_drvdata(dev);
117 if (hl_device_disabled_or_in_reset(hdev))
135 rc = hl_get_temperature(hdev, channel, attr, val);
148 rc = hl_get_voltage(hdev, channel, attr, val);
161 rc = hl_get_current(hdev, channel, attr, val);
172 rc = hl_get_fan_speed(hdev, channel, attr, val);
182 rc = hl_get_pwm_info(hdev, channel, attr, val);
193 struct hl_device *hdev = dev_get_drvdata(dev);
195 if (hl_device_disabled_or_in_reset(hdev))
207 hl_set_temperature(hdev, channel, attr, val);
217 hl_set_pwm_info(hdev, channel, attr, val);
226 hl_set_voltage(hdev, channel, attr, val);
235 hl_set_current(hdev, channel, attr, val);
311 int hl_get_temperature(struct hl_device *hdev,
324 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
328 dev_err(hdev->dev,
337 int hl_set_temperature(struct hl_device *hdev,
351 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
355 dev_err(hdev->dev,
362 int hl_get_voltage(struct hl_device *hdev,
375 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
379 dev_err(hdev->dev,
388 int hl_get_current(struct hl_device *hdev,
401 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
405 dev_err(hdev->dev,
414 int hl_get_fan_speed(struct hl_device *hdev,
427 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
431 dev_err(hdev->dev,
440 int hl_get_pwm_info(struct hl_device *hdev,
453 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
457 dev_err(hdev->dev,
466 void hl_set_pwm_info(struct hl_device *hdev, int sensor_index, u32 attr,
480 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
484 dev_err(hdev->dev,
489 int hl_set_voltage(struct hl_device *hdev,
503 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
507 dev_err(hdev->dev,
514 int hl_set_current(struct hl_device *hdev,
528 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
532 dev_err(hdev->dev,
539 int hl_hwmon_init(struct hl_device *hdev)
541 struct device *dev = hdev->pdev ? &hdev->pdev->dev : hdev->dev;
542 struct asic_fixed_properties *prop = &hdev->asic_prop;
545 if ((hdev->hwmon_initialized) || !(hdev->fw_loading))
548 if (hdev->hl_chip_info->info) {
549 hdev->hl_chip_info->ops = &hl_hwmon_ops;
551 hdev->hwmon_dev = hwmon_device_register_with_info(dev,
552 prop->cpucp_info.card_name, hdev,
553 hdev->hl_chip_info, NULL);
554 if (IS_ERR(hdev->hwmon_dev)) {
555 rc = PTR_ERR(hdev->hwmon_dev);
556 dev_err(hdev->dev,
561 dev_info(hdev->dev, "%s: add sensors information\n",
562 dev_name(hdev->hwmon_dev));
564 hdev->hwmon_initialized = true;
566 dev_info(hdev->dev, "no available sensors\n");
572 void hl_hwmon_fini(struct hl_device *hdev)
574 if (!hdev->hwmon_initialized)
577 hwmon_device_unregister(hdev->hwmon_dev);