Lines Matching +full:report +full:- +full:speed +full:- +full:hz

1 // SPDX-License-Identifier: GPL-2.0+
3 * nzxt-kraken2.c - hwmon driver for NZXT Kraken X42/X52/X62/X72 coolers
6 * communicate current fan speed, pump speed and coolant temperature. The
7 * device does not respond to Get_Report requests for this status report.
9 * Copyright 2019-2021 Jonas Malaco <jonas@protocubo.io>
50 if (time_after(jiffies, priv->updated + STATUS_VALIDITY * HZ)) in kraken2_read()
51 return -ENODATA; in kraken2_read()
55 *val = priv->temp_input[channel]; in kraken2_read()
58 *val = priv->fan_input[channel]; in kraken2_read()
61 return -EOPNOTSUPP; /* unreachable */ in kraken2_read()
78 return -EOPNOTSUPP; /* unreachable */ in kraken2_read_string()
104 struct hid_report *report, u8 *data, int size) in kraken2_raw_event() argument
108 if (size < 7 || report->id != STATUS_REPORT_ID) in kraken2_raw_event()
122 priv->temp_input[0] = data[1] * 1000 + data[2] * 100; in kraken2_raw_event()
124 priv->fan_input[0] = get_unaligned_be16(data + 3); in kraken2_raw_event()
125 priv->fan_input[1] = get_unaligned_be16(data + 5); in kraken2_raw_event()
127 priv->updated = jiffies; in kraken2_raw_event()
138 priv = devm_kzalloc(&hdev->dev, sizeof(*priv), GFP_KERNEL); in kraken2_probe()
140 return -ENOMEM; in kraken2_probe()
142 priv->hid_dev = hdev; in kraken2_probe()
146 * Initialize ->updated to STATUS_VALIDITY seconds in the past, making in kraken2_probe()
150 priv->updated = jiffies - STATUS_VALIDITY * HZ; in kraken2_probe()
159 * Enable hidraw so existing user-space tools can continue to work. in kraken2_probe()
173 priv->hwmon_dev = hwmon_device_register_with_info(&hdev->dev, "kraken2", in kraken2_probe()
176 if (IS_ERR(priv->hwmon_dev)) { in kraken2_probe()
177 ret = PTR_ERR(priv->hwmon_dev); in kraken2_probe()
195 hwmon_device_unregister(priv->hwmon_dev); in kraken2_remove()
209 .name = "nzxt-kraken2",