summaryrefslogtreecommitdiff
path: root/drivers/hwmon/socfpga-hwmon.c
blob: 5b43274d0aa2d3ccfd5230838e395fee2c2b879b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
// SPDX-License-Identifier: GPL-2.0
/*
 * Altera SoC FPGA hardware monitoring driver
 *
 * Copyright (c) 2026 Altera Corporation
 *
 * Authors:
 *	Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
 *	Tze Yee Ng <tze.yee.ng@altera.com>
 */

#include <linux/bitops.h>
#include <linux/cleanup.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/firmware/intel/stratix10-svc-client.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/jiffies.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/platform_device.h>

#define HWMON_TIMEOUT			msecs_to_jiffies(SVC_HWMON_REQUEST_TIMEOUT_MS)
#define HWMON_RETRY_SLEEP_US		1000U
#define HWMON_ASYNC_MSG_RETRY		3U
#define SOCFPGA_HWMON_MAXSENSORS	16
#define SOCFPGA_HWMON_CHANNEL_MASK	GENMASK(15, 0)
#define SOCFPGA_HWMON_PAGE_SHIFT	16
#define SOCFPGA_HWMON_CHAN(page, channel) \
	(((page) << SOCFPGA_HWMON_PAGE_SHIFT) | \
	 ((channel) & SOCFPGA_HWMON_CHANNEL_MASK))
#define SOCFPGA_HWMON_ATTR_VISIBLE	0444
/* Temperature from SDM is signed Q8.8 degrees Celsius (8 fractional bits). */
#define SOCFPGA_HWMON_TEMP_FRAC_BITS	8
#define SOCFPGA_HWMON_TEMP_FRAC_DIV	BIT(SOCFPGA_HWMON_TEMP_FRAC_BITS)
#define SOCFPGA_HWMON_TEMP_MDEG_SCALE	1000
/* Voltage from SDM is unsigned Q16 volts (16 fractional bits). */
#define SOCFPGA_HWMON_VOLT_FRAC_BITS	16
#define SOCFPGA_HWMON_VOLT_FRAC_DIV	BIT(SOCFPGA_HWMON_VOLT_FRAC_BITS)
#define SOCFPGA_HWMON_VOLT_MV_SCALE	1000

#define ETEMP_INACTIVE			0x80000000U
#define ETEMP_TOO_OLD			0x80000001U
#define ETEMP_NOT_PRESENT		0x80000002U
#define ETEMP_TIMEOUT			0x80000003U
#define ETEMP_CORRUPT			0x80000004U
#define ETEMP_BUSY			0x80000005U
#define ETEMP_NOT_INITIALIZED		0x800000FFU

struct socfpga_hwmon_channel {
	u32 reg;
	const char *label;
};

struct socfpga_hwmon_board_data {
	const struct socfpga_hwmon_channel *temp;
	unsigned int num_temp;
	const struct socfpga_hwmon_channel *volt;
	unsigned int num_volt;
};

struct socfpga_hwmon_priv {
	struct stratix10_svc_chan *chan;
	struct stratix10_svc_client client;
	struct completion completion;
	struct mutex lock;	/* protect SVC calls */
	bool async;
	int last_err;		/* sync-mode SVC result; 0 on success */
	u32 temperature;
	u32 voltage;
	int temperature_channels;
	int voltage_channels;
	const char *temp_chan_names[SOCFPGA_HWMON_MAXSENSORS];
	const char *volt_chan_names[SOCFPGA_HWMON_MAXSENSORS];
	u32 temp_chan[SOCFPGA_HWMON_MAXSENSORS];
	u32 volt_chan[SOCFPGA_HWMON_MAXSENSORS];
};

static umode_t socfpga_hwmon_is_visible(const void *dev,
					enum hwmon_sensor_types type,
					u32 attr, int chan)
{
	const struct socfpga_hwmon_priv *priv = dev;

	switch (type) {
	case hwmon_temp:
		if (chan < priv->temperature_channels)
			return SOCFPGA_HWMON_ATTR_VISIBLE;
		return 0;
	case hwmon_in:
		if (chan < priv->voltage_channels)
			return SOCFPGA_HWMON_ATTR_VISIBLE;
		return 0;
	default:
		return 0;
	}
}

static void socfpga_hwmon_readtemp_cb(struct stratix10_svc_client *client,
				      struct stratix10_svc_cb_data *data)
{
	struct socfpga_hwmon_priv *priv = client->priv;

	priv->last_err = -EIO;
	if (data->status == BIT(SVC_STATUS_OK)) {
		priv->last_err = 0;
		priv->temperature = (u32)*(unsigned long *)data->kaddr1;
	} else if (data->kaddr1) {
		dev_err(client->dev, "%s failed with status 0x%x, value 0x%lx\n",
			__func__, data->status,
			*(unsigned long *)data->kaddr1);
	} else {
		dev_err(client->dev, "%s failed with status 0x%x\n",
			__func__, data->status);
	}

	complete(&priv->completion);
}

static void socfpga_hwmon_readvolt_cb(struct stratix10_svc_client *client,
				      struct stratix10_svc_cb_data *data)
{
	struct socfpga_hwmon_priv *priv = client->priv;

	priv->last_err = -EIO;
	if (data->status == BIT(SVC_STATUS_OK)) {
		priv->last_err = 0;
		priv->voltage = (u32)*(unsigned long *)data->kaddr1;
	} else if (data->kaddr1) {
		dev_err(client->dev, "%s failed with status 0x%x, value 0x%lx\n",
			__func__, data->status,
			*(unsigned long *)data->kaddr1);
	} else {
		dev_err(client->dev, "%s failed with status 0x%x\n",
			__func__, data->status);
	}

	complete(&priv->completion);
}

static int socfpga_hwmon_parse_temp(long *val, u32 temperature)
{
	switch (temperature) {
	case ETEMP_INACTIVE:
	case ETEMP_NOT_PRESENT:
	case ETEMP_CORRUPT:
	case ETEMP_NOT_INITIALIZED:
		return -EOPNOTSUPP;
	case ETEMP_TIMEOUT:
	case ETEMP_BUSY:
	case ETEMP_TOO_OLD:
		return -EAGAIN;
	default:
		/* SDM returns a 16-bit signed Q8.8 value in the low 16 bits. */
		*val = (long)(s16)(temperature & SOCFPGA_HWMON_CHANNEL_MASK) *
			SOCFPGA_HWMON_TEMP_MDEG_SCALE / SOCFPGA_HWMON_TEMP_FRAC_DIV;
		return 0;
	}
}

static int socfpga_hwmon_encode_temp_arg(u32 reg, u64 *arg)
{
	u32 page = (reg >> SOCFPGA_HWMON_PAGE_SHIFT) & SOCFPGA_HWMON_CHANNEL_MASK;
	u32 channel = reg & SOCFPGA_HWMON_CHANNEL_MASK;

	if (channel >= SOCFPGA_HWMON_MAXSENSORS)
		return -EINVAL;

	*arg = (1ULL << channel) | ((u64)page << SOCFPGA_HWMON_PAGE_SHIFT);
	return 0;
}

static int socfpga_hwmon_encode_volt_arg(u32 reg, u64 *arg)
{
	u32 channel = reg & SOCFPGA_HWMON_CHANNEL_MASK;

	if (channel >= SOCFPGA_HWMON_MAXSENSORS)
		return -EINVAL;

	*arg = 1ULL << channel;
	return 0;
}

static int socfpga_hwmon_async_read(struct device *dev,
				    enum hwmon_sensor_types type,
				    struct stratix10_svc_client_msg *msg)
{
	struct socfpga_hwmon_priv *priv = dev_get_drvdata(dev);
	struct stratix10_svc_cb_data data = {};
	unsigned long deadline = jiffies + HWMON_TIMEOUT;
	void *handle = NULL;
	int status, index, ret;

	for (index = 0; index < HWMON_ASYNC_MSG_RETRY; index++) {
		status = stratix10_svc_async_send(priv->chan, msg, &handle,
						  NULL, NULL);
		if (status == 0)
			break;
		dev_warn(dev, "Failed to send async message: %d\n", status);
		usleep_range(HWMON_RETRY_SLEEP_US, HWMON_RETRY_SLEEP_US * 2);
	}

	if (status && !handle) {
		dev_err(dev, "Failed to send async message after %u retries: %d\n",
			HWMON_ASYNC_MSG_RETRY, status);
		return status;
	}

	ret = -ETIMEDOUT;
	while (!time_after(jiffies, deadline)) {
		status = stratix10_svc_async_poll(priv->chan, handle, &data);
		if (status == -EAGAIN) {
			/* still in progress */
		} else if (status < 0) {
			ret = status;
			break;
		} else if (status == 0) {
			ret = 0;
			break;
		}
		usleep_range(HWMON_RETRY_SLEEP_US, HWMON_RETRY_SLEEP_US * 2);
	}

	if (ret) {
		dev_err(dev, "Failed to get async response\n");
		goto done;
	}

	if (data.status) {
		dev_err(dev, "%s returned 0x%x from SDM\n", __func__,
			data.status);
		ret = -EFAULT;
		goto done;
	}

	if (type == hwmon_temp)
		priv->temperature = (u32)*(unsigned long *)data.kaddr1;
	else
		priv->voltage = (u32)*(unsigned long *)data.kaddr1;

	ret = 0;

done:
	stratix10_svc_async_done(priv->chan, handle);
	return ret;
}

static int socfpga_hwmon_sync_read(struct device *dev,
				   enum hwmon_sensor_types type,
				   struct stratix10_svc_client_msg *msg)
{
	struct socfpga_hwmon_priv *priv = dev_get_drvdata(dev);
	int ret;

	reinit_completion(&priv->completion);

	if (type == hwmon_temp)
		priv->client.receive_cb = socfpga_hwmon_readtemp_cb;
	else
		priv->client.receive_cb = socfpga_hwmon_readvolt_cb;

	ret = stratix10_svc_send(priv->chan, msg);
	if (ret < 0)
		goto status_done;

	ret = wait_for_completion_timeout(&priv->completion, HWMON_TIMEOUT);
	if (!ret) {
		dev_err(priv->client.dev, "timeout waiting for SMC call\n");
		ret = -ETIMEDOUT;
		goto status_done;
	}

	ret = priv->last_err;

status_done:
	stratix10_svc_done(priv->chan);
	return ret;
}

static int socfpga_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
			      u32 attr, int chan, long *val)
{
	struct socfpga_hwmon_priv *priv = dev_get_drvdata(dev);
	struct stratix10_svc_client_msg msg = {0};
	int ret;

	if (chan >= SOCFPGA_HWMON_MAXSENSORS)
		return -EOPNOTSUPP;

	switch (type) {
	case hwmon_temp:
		ret = socfpga_hwmon_encode_temp_arg(priv->temp_chan[chan],
						    &msg.arg[0]);
		if (ret)
			return ret;
		msg.command = COMMAND_HWMON_READTEMP;
		break;
	case hwmon_in:
		ret = socfpga_hwmon_encode_volt_arg(priv->volt_chan[chan],
						    &msg.arg[0]);
		if (ret)
			return ret;
		msg.command = COMMAND_HWMON_READVOLT;
		break;
	default:
		return -EOPNOTSUPP;
	}

	guard(mutex)(&priv->lock);
	if (priv->async)
		ret = socfpga_hwmon_async_read(dev, type, &msg);
	else
		ret = socfpga_hwmon_sync_read(dev, type, &msg);
	if (ret)
		return ret;

	if (type == hwmon_temp)
		ret = socfpga_hwmon_parse_temp(val, priv->temperature);
	else
		/* SDM returns Q16 volts; convert to hwmon millivolts. */
		*val = (long)priv->voltage * SOCFPGA_HWMON_VOLT_MV_SCALE /
			SOCFPGA_HWMON_VOLT_FRAC_DIV;
	return ret;
}

static int socfpga_hwmon_read_string(struct device *dev,
				     enum hwmon_sensor_types type, u32 attr,
				     int chan, const char **str)
{
	struct socfpga_hwmon_priv *priv = dev_get_drvdata(dev);

	switch (type) {
	case hwmon_in:
		*str = priv->volt_chan_names[chan];
		return 0;
	case hwmon_temp:
		*str = priv->temp_chan_names[chan];
		return 0;
	default:
		return -EOPNOTSUPP;
	}
}

static const struct hwmon_ops socfpga_hwmon_ops = {
	.is_visible = socfpga_hwmon_is_visible,
	.read = socfpga_hwmon_read,
	.read_string = socfpga_hwmon_read_string,
};

static const struct hwmon_channel_info *socfpga_hwmon_info[] = {
	HWMON_CHANNEL_INFO(temp,
			   HWMON_T_INPUT | HWMON_T_LABEL,
			   HWMON_T_INPUT | HWMON_T_LABEL,
			   HWMON_T_INPUT | HWMON_T_LABEL,
			   HWMON_T_INPUT | HWMON_T_LABEL,
			   HWMON_T_INPUT | HWMON_T_LABEL,
			   HWMON_T_INPUT | HWMON_T_LABEL,
			   HWMON_T_INPUT | HWMON_T_LABEL,
			   HWMON_T_INPUT | HWMON_T_LABEL,
			   HWMON_T_INPUT | HWMON_T_LABEL,
			   HWMON_T_INPUT | HWMON_T_LABEL,
			   HWMON_T_INPUT | HWMON_T_LABEL,
			   HWMON_T_INPUT | HWMON_T_LABEL,
			   HWMON_T_INPUT | HWMON_T_LABEL,
			   HWMON_T_INPUT | HWMON_T_LABEL,
			   HWMON_T_INPUT | HWMON_T_LABEL,
			   HWMON_T_INPUT | HWMON_T_LABEL),
	HWMON_CHANNEL_INFO(in,
			   HWMON_I_INPUT | HWMON_I_LABEL,
			   HWMON_I_INPUT | HWMON_I_LABEL,
			   HWMON_I_INPUT | HWMON_I_LABEL,
			   HWMON_I_INPUT | HWMON_I_LABEL,
			   HWMON_I_INPUT | HWMON_I_LABEL,
			   HWMON_I_INPUT | HWMON_I_LABEL,
			   HWMON_I_INPUT | HWMON_I_LABEL,
			   HWMON_I_INPUT | HWMON_I_LABEL,
			   HWMON_I_INPUT | HWMON_I_LABEL,
			   HWMON_I_INPUT | HWMON_I_LABEL,
			   HWMON_I_INPUT | HWMON_I_LABEL,
			   HWMON_I_INPUT | HWMON_I_LABEL,
			   HWMON_I_INPUT | HWMON_I_LABEL,
			   HWMON_I_INPUT | HWMON_I_LABEL,
			   HWMON_I_INPUT | HWMON_I_LABEL,
			   HWMON_I_INPUT | HWMON_I_LABEL),
	NULL
};

static const struct hwmon_chip_info socfpga_hwmon_chip_info = {
	.ops = &socfpga_hwmon_ops,
	.info = socfpga_hwmon_info,
};

static const struct socfpga_hwmon_channel s10_hwmon_volt_channels[] = {
	{ SOCFPGA_HWMON_CHAN(0, 2), "0.8V VCC" },
	{ SOCFPGA_HWMON_CHAN(0, 3), "1.8V VCCIO_SDM" },
	{ SOCFPGA_HWMON_CHAN(0, 6), "0.9V VCCERAM" },
};

static const struct socfpga_hwmon_channel s10_hwmon_temp_channels[] = {
	{ SOCFPGA_HWMON_CHAN(0, 0), "Main Die SDM" },
};

static const struct socfpga_hwmon_board_data s10_hwmon_board = {
	.temp = s10_hwmon_temp_channels,
	.num_temp = ARRAY_SIZE(s10_hwmon_temp_channels),
	.volt = s10_hwmon_volt_channels,
	.num_volt = ARRAY_SIZE(s10_hwmon_volt_channels),
};

static const struct socfpga_hwmon_channel agilex_hwmon_volt_channels[] = {
	{ SOCFPGA_HWMON_CHAN(0, 2), "0.8V VCC" },
	{ SOCFPGA_HWMON_CHAN(0, 3), "1.8V VCCIO_SDM" },
	{ SOCFPGA_HWMON_CHAN(0, 4), "1.8V VCCPT" },
	{ SOCFPGA_HWMON_CHAN(0, 5), "1.2V VCCCRCORE" },
	{ SOCFPGA_HWMON_CHAN(0, 6), "0.9V VCCH" },
	{ SOCFPGA_HWMON_CHAN(0, 7), "0.8V VCCL" },
};

static const struct socfpga_hwmon_channel agilex_hwmon_temp_channels[] = {
	{ SOCFPGA_HWMON_CHAN(0, 0), "Main Die SDM" },
	{ SOCFPGA_HWMON_CHAN(1, 0), "Main Die corner bottom left max" },
	{ SOCFPGA_HWMON_CHAN(2, 0), "Main Die corner top left max" },
	{ SOCFPGA_HWMON_CHAN(3, 0), "Main Die corner bottom right max" },
	{ SOCFPGA_HWMON_CHAN(4, 0), "Main Die corner top right max" },
};

static const struct socfpga_hwmon_board_data agilex_hwmon_board = {
	.temp = agilex_hwmon_temp_channels,
	.num_temp = ARRAY_SIZE(agilex_hwmon_temp_channels),
	.volt = agilex_hwmon_volt_channels,
	.num_volt = ARRAY_SIZE(agilex_hwmon_volt_channels),
};

static const struct socfpga_hwmon_board_data *
socfpga_hwmon_get_board(struct device *dev)
{
	struct device_node *np = dev->of_node;

	if (!np)
		return NULL;

	if (of_device_is_compatible(np, "intel,stratix10-svc"))
		return &s10_hwmon_board;
	if (of_device_is_compatible(np, "intel,agilex-svc"))
		return &agilex_hwmon_board;

	return NULL;
}

static int socfpga_hwmon_init_channels(struct device *dev,
				       const struct socfpga_hwmon_board_data *board,
				       struct socfpga_hwmon_priv *priv)
{
	unsigned int i;

	if (board->num_temp > SOCFPGA_HWMON_MAXSENSORS ||
	    board->num_volt > SOCFPGA_HWMON_MAXSENSORS)
		return -EINVAL;

	for (i = 0; i < board->num_temp; i++) {
		priv->temp_chan_names[i] = board->temp[i].label;
		priv->temp_chan[i] = board->temp[i].reg;
	}
	priv->temperature_channels = board->num_temp;

	for (i = 0; i < board->num_volt; i++) {
		priv->volt_chan_names[i] = board->volt[i].label;
		priv->volt_chan[i] = board->volt[i].reg;
	}
	priv->voltage_channels = board->num_volt;

	return 0;
}

static void socfpga_hwmon_release_svc(void *data)
{
	struct socfpga_hwmon_priv *priv = data;

	if (priv->async)
		stratix10_svc_remove_async_client(priv->chan);
	stratix10_svc_free_channel(priv->chan);
}

static int socfpga_hwmon_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
	struct device *parent = dev->parent;
	const struct socfpga_hwmon_board_data *board;
	struct socfpga_hwmon_priv *priv;
	struct device *hwmon_dev;
	int ret;

	if (!parent || !parent->of_node) {
		dev_err(dev, "missing parent device node\n");
		return -ENODEV;
	}

	board = socfpga_hwmon_get_board(parent);
	if (!board) {
		dev_err(dev, "unsupported service layer compatible\n");
		return -ENODEV;
	}

	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
	if (!priv)
		return -ENOMEM;

	priv->client.dev = dev;
	priv->client.priv = priv;
	init_completion(&priv->completion);
	mutex_init(&priv->lock);

	ret = socfpga_hwmon_init_channels(dev, board, priv);
	if (ret)
		return ret;

	priv->chan = stratix10_svc_request_channel_byname(&priv->client,
							  SVC_CLIENT_HWMON);
	if (IS_ERR(priv->chan)) {
		ret = PTR_ERR(priv->chan);
		if (ret == -EPROBE_DEFER)
			dev_dbg(dev, "service channel %s not ready, deferring probe\n",
				SVC_CLIENT_HWMON);
		else
			dev_err(dev, "couldn't get service channel %s: %d\n",
				SVC_CLIENT_HWMON, ret);
		return ret;
	}

	ret = stratix10_svc_add_async_client(priv->chan, false);
	switch (ret) {
	case 0:
		priv->async = true;
		break;
	case -EINVAL:
	case -EOPNOTSUPP:
		/*
		 * stratix10_svc_add_async_client() returns -EINVAL when the
		 * async controller is not initialized; fall back to sync mode.
		 */
		dev_dbg(dev, "async operations not supported, using sync mode\n");
		priv->async = false;
		break;
	default:
		dev_err(dev, "failed to add async client: %d\n", ret);
		stratix10_svc_free_channel(priv->chan);
		return ret;
	}

	ret = devm_add_action_or_reset(dev, socfpga_hwmon_release_svc, priv);
	if (ret)
		return ret;

	hwmon_dev = devm_hwmon_device_register_with_info(dev, "socfpga_hwmon",
							 priv,
							 &socfpga_hwmon_chip_info,
							 NULL);
	if (IS_ERR(hwmon_dev))
		return PTR_ERR(hwmon_dev);

	platform_set_drvdata(pdev, priv);
	return 0;
}

static struct platform_driver socfpga_hwmon_driver = {
	.probe = socfpga_hwmon_probe,
	.driver = {
		.name = "socfpga-hwmon",
	},
};
module_platform_driver(socfpga_hwmon_driver);

MODULE_AUTHOR("Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>");
MODULE_AUTHOR("Tze Yee Ng <tze.yee.ng@altera.com>");
MODULE_DESCRIPTION("Altera SoC FPGA hardware monitoring driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:socfpga-hwmon");