Merge tag 'io_uring-5.11-2021-01-16' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / platform / mellanox / mlxreg-hotplug.c
blobb013445147dd5692e688a8808ab01a533b00bc4a
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * Mellanox hotplug driver
5 * Copyright (C) 2016-2020 Mellanox Technologies
6 */
8 #include <linux/bitops.h>
9 #include <linux/device.h>
10 #include <linux/hwmon.h>
11 #include <linux/hwmon-sysfs.h>
12 #include <linux/i2c.h>
13 #include <linux/interrupt.h>
14 #include <linux/module.h>
15 #include <linux/of_device.h>
16 #include <linux/platform_data/mlxreg.h>
17 #include <linux/platform_device.h>
18 #include <linux/spinlock.h>
19 #include <linux/string_helpers.h>
20 #include <linux/regmap.h>
21 #include <linux/workqueue.h>
23 /* Offset of event and mask registers from status register. */
24 #define MLXREG_HOTPLUG_EVENT_OFF 1
25 #define MLXREG_HOTPLUG_MASK_OFF 2
26 #define MLXREG_HOTPLUG_AGGR_MASK_OFF 1
28 /* ASIC good health mask. */
29 #define MLXREG_HOTPLUG_GOOD_HEALTH_MASK 0x02
31 #define MLXREG_HOTPLUG_ATTRS_MAX 24
32 #define MLXREG_HOTPLUG_NOT_ASSERT 3
34 /**
35 * struct mlxreg_hotplug_priv_data - platform private data:
36 * @irq: platform device interrupt number;
37 * @dev: basic device;
38 * @pdev: platform device;
39 * @plat: platform data;
40 * @regmap: register map handle;
41 * @dwork_irq: delayed work template;
42 * @lock: spin lock;
43 * @hwmon: hwmon device;
44 * @mlxreg_hotplug_attr: sysfs attributes array;
45 * @mlxreg_hotplug_dev_attr: sysfs sensor device attribute array;
46 * @group: sysfs attribute group;
47 * @groups: list of sysfs attribute group for hwmon registration;
48 * @cell: location of top aggregation interrupt register;
49 * @mask: top aggregation interrupt common mask;
50 * @aggr_cache: last value of aggregation register status;
51 * @after_probe: flag indication probing completion;
52 * @not_asserted: number of entries in workqueue with no signal assertion;
54 struct mlxreg_hotplug_priv_data {
55 int irq;
56 struct device *dev;
57 struct platform_device *pdev;
58 struct mlxreg_hotplug_platform_data *plat;
59 struct regmap *regmap;
60 struct delayed_work dwork_irq;
61 spinlock_t lock; /* sync with interrupt */
62 struct device *hwmon;
63 struct attribute *mlxreg_hotplug_attr[MLXREG_HOTPLUG_ATTRS_MAX + 1];
64 struct sensor_device_attribute_2
65 mlxreg_hotplug_dev_attr[MLXREG_HOTPLUG_ATTRS_MAX];
66 struct attribute_group group;
67 const struct attribute_group *groups[2];
68 u32 cell;
69 u32 mask;
70 u32 aggr_cache;
71 bool after_probe;
72 u8 not_asserted;
75 /* Environment variables array for udev. */
76 static char *mlxreg_hotplug_udev_envp[] = { NULL, NULL };
78 static int
79 mlxreg_hotplug_udev_event_send(struct kobject *kobj,
80 struct mlxreg_core_data *data, bool action)
82 char event_str[MLXREG_CORE_LABEL_MAX_SIZE + 2];
83 char label[MLXREG_CORE_LABEL_MAX_SIZE] = { 0 };
85 mlxreg_hotplug_udev_envp[0] = event_str;
86 string_upper(label, data->label);
87 snprintf(event_str, MLXREG_CORE_LABEL_MAX_SIZE, "%s=%d", label, !!action);
89 return kobject_uevent_env(kobj, KOBJ_CHANGE, mlxreg_hotplug_udev_envp);
92 static int mlxreg_hotplug_device_create(struct mlxreg_hotplug_priv_data *priv,
93 struct mlxreg_core_data *data)
95 struct mlxreg_core_hotplug_platform_data *pdata;
96 struct i2c_client *client;
98 /* Notify user by sending hwmon uevent. */
99 mlxreg_hotplug_udev_event_send(&priv->hwmon->kobj, data, true);
102 * Return if adapter number is negative. It could be in case hotplug
103 * event is not associated with hotplug device.
105 if (data->hpdev.nr < 0)
106 return 0;
108 pdata = dev_get_platdata(&priv->pdev->dev);
109 data->hpdev.adapter = i2c_get_adapter(data->hpdev.nr +
110 pdata->shift_nr);
111 if (!data->hpdev.adapter) {
112 dev_err(priv->dev, "Failed to get adapter for bus %d\n",
113 data->hpdev.nr + pdata->shift_nr);
114 return -EFAULT;
117 client = i2c_new_client_device(data->hpdev.adapter,
118 data->hpdev.brdinfo);
119 if (IS_ERR(client)) {
120 dev_err(priv->dev, "Failed to create client %s at bus %d at addr 0x%02x\n",
121 data->hpdev.brdinfo->type, data->hpdev.nr +
122 pdata->shift_nr, data->hpdev.brdinfo->addr);
124 i2c_put_adapter(data->hpdev.adapter);
125 data->hpdev.adapter = NULL;
126 return PTR_ERR(client);
129 data->hpdev.client = client;
131 return 0;
134 static void
135 mlxreg_hotplug_device_destroy(struct mlxreg_hotplug_priv_data *priv,
136 struct mlxreg_core_data *data)
138 /* Notify user by sending hwmon uevent. */
139 mlxreg_hotplug_udev_event_send(&priv->hwmon->kobj, data, false);
141 if (data->hpdev.client) {
142 i2c_unregister_device(data->hpdev.client);
143 data->hpdev.client = NULL;
146 if (data->hpdev.adapter) {
147 i2c_put_adapter(data->hpdev.adapter);
148 data->hpdev.adapter = NULL;
152 static ssize_t mlxreg_hotplug_attr_show(struct device *dev,
153 struct device_attribute *attr,
154 char *buf)
156 struct mlxreg_hotplug_priv_data *priv = dev_get_drvdata(dev);
157 struct mlxreg_core_hotplug_platform_data *pdata;
158 int index = to_sensor_dev_attr_2(attr)->index;
159 int nr = to_sensor_dev_attr_2(attr)->nr;
160 struct mlxreg_core_item *item;
161 struct mlxreg_core_data *data;
162 u32 regval;
163 int ret;
165 pdata = dev_get_platdata(&priv->pdev->dev);
166 item = pdata->items + nr;
167 data = item->data + index;
169 ret = regmap_read(priv->regmap, data->reg, &regval);
170 if (ret)
171 return ret;
173 if (item->health) {
174 regval &= data->mask;
175 } else {
176 /* Bit = 0 : functional if item->inversed is true. */
177 if (item->inversed)
178 regval = !(regval & data->mask);
179 else
180 regval = !!(regval & data->mask);
183 return sprintf(buf, "%u\n", regval);
186 #define PRIV_ATTR(i) priv->mlxreg_hotplug_attr[i]
187 #define PRIV_DEV_ATTR(i) priv->mlxreg_hotplug_dev_attr[i]
189 static int mlxreg_hotplug_attr_init(struct mlxreg_hotplug_priv_data *priv)
191 struct mlxreg_core_hotplug_platform_data *pdata;
192 struct mlxreg_core_item *item;
193 struct mlxreg_core_data *data;
194 unsigned long mask;
195 u32 regval;
196 int num_attrs = 0, id = 0, i, j, k, ret;
198 pdata = dev_get_platdata(&priv->pdev->dev);
199 item = pdata->items;
201 /* Go over all kinds of items - psu, pwr, fan. */
202 for (i = 0; i < pdata->counter; i++, item++) {
203 if (item->capability) {
205 * Read group capability register to get actual number
206 * of interrupt capable components and set group mask
207 * accordingly.
209 ret = regmap_read(priv->regmap, item->capability,
210 &regval);
211 if (ret)
212 return ret;
214 item->mask = GENMASK((regval & item->mask) - 1, 0);
217 data = item->data;
219 /* Go over all unmasked units within item. */
220 mask = item->mask;
221 k = 0;
222 for_each_set_bit(j, &mask, item->count) {
223 if (data->capability) {
225 * Read capability register and skip non
226 * relevant attributes.
228 ret = regmap_read(priv->regmap,
229 data->capability, &regval);
230 if (ret)
231 return ret;
232 if (!(regval & data->bit)) {
233 data++;
234 continue;
237 PRIV_ATTR(id) = &PRIV_DEV_ATTR(id).dev_attr.attr;
238 PRIV_ATTR(id)->name = devm_kasprintf(&priv->pdev->dev,
239 GFP_KERNEL,
240 data->label);
242 if (!PRIV_ATTR(id)->name) {
243 dev_err(priv->dev, "Memory allocation failed for attr %d.\n",
244 id);
245 return -ENOMEM;
248 PRIV_DEV_ATTR(id).dev_attr.attr.name =
249 PRIV_ATTR(id)->name;
250 PRIV_DEV_ATTR(id).dev_attr.attr.mode = 0444;
251 PRIV_DEV_ATTR(id).dev_attr.show =
252 mlxreg_hotplug_attr_show;
253 PRIV_DEV_ATTR(id).nr = i;
254 PRIV_DEV_ATTR(id).index = k;
255 sysfs_attr_init(&PRIV_DEV_ATTR(id).dev_attr.attr);
256 data++;
257 id++;
258 k++;
260 num_attrs += k;
263 priv->group.attrs = devm_kcalloc(&priv->pdev->dev,
264 num_attrs,
265 sizeof(struct attribute *),
266 GFP_KERNEL);
267 if (!priv->group.attrs)
268 return -ENOMEM;
270 priv->group.attrs = priv->mlxreg_hotplug_attr;
271 priv->groups[0] = &priv->group;
272 priv->groups[1] = NULL;
274 return 0;
277 static void
278 mlxreg_hotplug_work_helper(struct mlxreg_hotplug_priv_data *priv,
279 struct mlxreg_core_item *item)
281 struct mlxreg_core_data *data;
282 unsigned long asserted;
283 u32 regval, bit;
284 int ret;
287 * Validate if item related to received signal type is valid.
288 * It should never happen, excepted the situation when some
289 * piece of hardware is broken. In such situation just produce
290 * error message and return. Caller must continue to handle the
291 * signals from other devices if any.
293 if (unlikely(!item)) {
294 dev_err(priv->dev, "False signal: at offset:mask 0x%02x:0x%02x.\n",
295 item->reg, item->mask);
297 return;
300 /* Mask event. */
301 ret = regmap_write(priv->regmap, item->reg + MLXREG_HOTPLUG_MASK_OFF,
303 if (ret)
304 goto out;
306 /* Read status. */
307 ret = regmap_read(priv->regmap, item->reg, &regval);
308 if (ret)
309 goto out;
311 /* Set asserted bits and save last status. */
312 regval &= item->mask;
313 asserted = item->cache ^ regval;
314 item->cache = regval;
316 for_each_set_bit(bit, &asserted, 8) {
317 data = item->data + bit;
318 if (regval & BIT(bit)) {
319 if (item->inversed)
320 mlxreg_hotplug_device_destroy(priv, data);
321 else
322 mlxreg_hotplug_device_create(priv, data);
323 } else {
324 if (item->inversed)
325 mlxreg_hotplug_device_create(priv, data);
326 else
327 mlxreg_hotplug_device_destroy(priv, data);
331 /* Acknowledge event. */
332 ret = regmap_write(priv->regmap, item->reg + MLXREG_HOTPLUG_EVENT_OFF,
334 if (ret)
335 goto out;
337 /* Unmask event. */
338 ret = regmap_write(priv->regmap, item->reg + MLXREG_HOTPLUG_MASK_OFF,
339 item->mask);
341 out:
342 if (ret)
343 dev_err(priv->dev, "Failed to complete workqueue.\n");
346 static void
347 mlxreg_hotplug_health_work_helper(struct mlxreg_hotplug_priv_data *priv,
348 struct mlxreg_core_item *item)
350 struct mlxreg_core_data *data = item->data;
351 u32 regval;
352 int i, ret = 0;
354 for (i = 0; i < item->count; i++, data++) {
355 /* Mask event. */
356 ret = regmap_write(priv->regmap, data->reg +
357 MLXREG_HOTPLUG_MASK_OFF, 0);
358 if (ret)
359 goto out;
361 /* Read status. */
362 ret = regmap_read(priv->regmap, data->reg, &regval);
363 if (ret)
364 goto out;
366 regval &= data->mask;
368 if (item->cache == regval)
369 goto ack_event;
372 * ASIC health indication is provided through two bits. Bits
373 * value 0x2 indicates that ASIC reached the good health, value
374 * 0x0 indicates ASIC the bad health or dormant state and value
375 * 0x3 indicates the booting state. During ASIC reset it should
376 * pass the following states: dormant -> booting -> good.
378 if (regval == MLXREG_HOTPLUG_GOOD_HEALTH_MASK) {
379 if (!data->attached) {
381 * ASIC is in steady state. Connect associated
382 * device, if configured.
384 mlxreg_hotplug_device_create(priv, data);
385 data->attached = true;
387 } else {
388 if (data->attached) {
390 * ASIC health is failed after ASIC has been
391 * in steady state. Disconnect associated
392 * device, if it has been connected.
394 mlxreg_hotplug_device_destroy(priv, data);
395 data->attached = false;
396 data->health_cntr = 0;
399 item->cache = regval;
400 ack_event:
401 /* Acknowledge event. */
402 ret = regmap_write(priv->regmap, data->reg +
403 MLXREG_HOTPLUG_EVENT_OFF, 0);
404 if (ret)
405 goto out;
407 /* Unmask event. */
408 ret = regmap_write(priv->regmap, data->reg +
409 MLXREG_HOTPLUG_MASK_OFF, data->mask);
410 if (ret)
411 goto out;
414 out:
415 if (ret)
416 dev_err(priv->dev, "Failed to complete workqueue.\n");
420 * mlxreg_hotplug_work_handler - performs traversing of device interrupt
421 * registers according to the below hierarchy schema:
423 * Aggregation registers (status/mask)
424 * PSU registers: *---*
425 * *-----------------* | |
426 * |status/event/mask|-----> | * |
427 * *-----------------* | |
428 * Power registers: | |
429 * *-----------------* | |
430 * |status/event/mask|-----> | * |
431 * *-----------------* | |
432 * FAN registers: | |--> CPU
433 * *-----------------* | |
434 * |status/event/mask|-----> | * |
435 * *-----------------* | |
436 * ASIC registers: | |
437 * *-----------------* | |
438 * |status/event/mask|-----> | * |
439 * *-----------------* | |
440 * *---*
442 * In case some system changed are detected: FAN in/out, PSU in/out, power
443 * cable attached/detached, ASIC health good/bad, relevant device is created
444 * or destroyed.
446 static void mlxreg_hotplug_work_handler(struct work_struct *work)
448 struct mlxreg_core_hotplug_platform_data *pdata;
449 struct mlxreg_hotplug_priv_data *priv;
450 struct mlxreg_core_item *item;
451 u32 regval, aggr_asserted;
452 unsigned long flags;
453 int i, ret;
455 priv = container_of(work, struct mlxreg_hotplug_priv_data,
456 dwork_irq.work);
457 pdata = dev_get_platdata(&priv->pdev->dev);
458 item = pdata->items;
460 /* Mask aggregation event. */
461 ret = regmap_write(priv->regmap, pdata->cell +
462 MLXREG_HOTPLUG_AGGR_MASK_OFF, 0);
463 if (ret < 0)
464 goto out;
466 /* Read aggregation status. */
467 ret = regmap_read(priv->regmap, pdata->cell, &regval);
468 if (ret)
469 goto out;
471 regval &= pdata->mask;
472 aggr_asserted = priv->aggr_cache ^ regval;
473 priv->aggr_cache = regval;
476 * Handler is invoked, but no assertion is detected at top aggregation
477 * status level. Set aggr_asserted to mask value to allow handler extra
478 * run over all relevant signals to recover any missed signal.
480 if (priv->not_asserted == MLXREG_HOTPLUG_NOT_ASSERT) {
481 priv->not_asserted = 0;
482 aggr_asserted = pdata->mask;
484 if (!aggr_asserted)
485 goto unmask_event;
487 /* Handle topology and health configuration changes. */
488 for (i = 0; i < pdata->counter; i++, item++) {
489 if (aggr_asserted & item->aggr_mask) {
490 if (item->health)
491 mlxreg_hotplug_health_work_helper(priv, item);
492 else
493 mlxreg_hotplug_work_helper(priv, item);
497 spin_lock_irqsave(&priv->lock, flags);
500 * It is possible, that some signals have been inserted, while
501 * interrupt has been masked by mlxreg_hotplug_work_handler. In this
502 * case such signals will be missed. In order to handle these signals
503 * delayed work is canceled and work task re-scheduled for immediate
504 * execution. It allows to handle missed signals, if any. In other case
505 * work handler just validates that no new signals have been received
506 * during masking.
508 cancel_delayed_work(&priv->dwork_irq);
509 schedule_delayed_work(&priv->dwork_irq, 0);
511 spin_unlock_irqrestore(&priv->lock, flags);
513 return;
515 unmask_event:
516 priv->not_asserted++;
517 /* Unmask aggregation event (no need acknowledge). */
518 ret = regmap_write(priv->regmap, pdata->cell +
519 MLXREG_HOTPLUG_AGGR_MASK_OFF, pdata->mask);
521 out:
522 if (ret)
523 dev_err(priv->dev, "Failed to complete workqueue.\n");
526 static int mlxreg_hotplug_set_irq(struct mlxreg_hotplug_priv_data *priv)
528 struct mlxreg_core_hotplug_platform_data *pdata;
529 struct mlxreg_core_item *item;
530 struct mlxreg_core_data *data;
531 u32 regval;
532 int i, j, ret;
534 pdata = dev_get_platdata(&priv->pdev->dev);
535 item = pdata->items;
537 for (i = 0; i < pdata->counter; i++, item++) {
538 /* Clear group presense event. */
539 ret = regmap_write(priv->regmap, item->reg +
540 MLXREG_HOTPLUG_EVENT_OFF, 0);
541 if (ret)
542 goto out;
545 * Verify if hardware configuration requires to disable
546 * interrupt capability for some of components.
548 data = item->data;
549 for (j = 0; j < item->count; j++, data++) {
550 /* Verify if the attribute has capability register. */
551 if (data->capability) {
552 /* Read capability register. */
553 ret = regmap_read(priv->regmap,
554 data->capability, &regval);
555 if (ret)
556 goto out;
558 if (!(regval & data->bit))
559 item->mask &= ~BIT(j);
563 /* Set group initial status as mask and unmask group event. */
564 if (item->inversed) {
565 item->cache = item->mask;
566 ret = regmap_write(priv->regmap, item->reg +
567 MLXREG_HOTPLUG_MASK_OFF,
568 item->mask);
569 if (ret)
570 goto out;
574 /* Keep aggregation initial status as zero and unmask events. */
575 ret = regmap_write(priv->regmap, pdata->cell +
576 MLXREG_HOTPLUG_AGGR_MASK_OFF, pdata->mask);
577 if (ret)
578 goto out;
580 /* Keep low aggregation initial status as zero and unmask events. */
581 if (pdata->cell_low) {
582 ret = regmap_write(priv->regmap, pdata->cell_low +
583 MLXREG_HOTPLUG_AGGR_MASK_OFF,
584 pdata->mask_low);
585 if (ret)
586 goto out;
589 /* Invoke work handler for initializing hot plug devices setting. */
590 mlxreg_hotplug_work_handler(&priv->dwork_irq.work);
592 out:
593 if (ret)
594 dev_err(priv->dev, "Failed to set interrupts.\n");
595 enable_irq(priv->irq);
596 return ret;
599 static void mlxreg_hotplug_unset_irq(struct mlxreg_hotplug_priv_data *priv)
601 struct mlxreg_core_hotplug_platform_data *pdata;
602 struct mlxreg_core_item *item;
603 struct mlxreg_core_data *data;
604 int count, i, j;
606 pdata = dev_get_platdata(&priv->pdev->dev);
607 item = pdata->items;
608 disable_irq(priv->irq);
609 cancel_delayed_work_sync(&priv->dwork_irq);
611 /* Mask low aggregation event, if defined. */
612 if (pdata->cell_low)
613 regmap_write(priv->regmap, pdata->cell_low +
614 MLXREG_HOTPLUG_AGGR_MASK_OFF, 0);
616 /* Mask aggregation event. */
617 regmap_write(priv->regmap, pdata->cell + MLXREG_HOTPLUG_AGGR_MASK_OFF,
620 /* Clear topology configurations. */
621 for (i = 0; i < pdata->counter; i++, item++) {
622 data = item->data;
623 /* Mask group presense event. */
624 regmap_write(priv->regmap, data->reg + MLXREG_HOTPLUG_MASK_OFF,
626 /* Clear group presense event. */
627 regmap_write(priv->regmap, data->reg +
628 MLXREG_HOTPLUG_EVENT_OFF, 0);
630 /* Remove all the attached devices in group. */
631 count = item->count;
632 for (j = 0; j < count; j++, data++)
633 mlxreg_hotplug_device_destroy(priv, data);
637 static irqreturn_t mlxreg_hotplug_irq_handler(int irq, void *dev)
639 struct mlxreg_hotplug_priv_data *priv;
641 priv = (struct mlxreg_hotplug_priv_data *)dev;
643 /* Schedule work task for immediate execution.*/
644 schedule_delayed_work(&priv->dwork_irq, 0);
646 return IRQ_HANDLED;
649 static int mlxreg_hotplug_probe(struct platform_device *pdev)
651 struct mlxreg_core_hotplug_platform_data *pdata;
652 struct mlxreg_hotplug_priv_data *priv;
653 struct i2c_adapter *deferred_adap;
654 int err;
656 pdata = dev_get_platdata(&pdev->dev);
657 if (!pdata) {
658 dev_err(&pdev->dev, "Failed to get platform data.\n");
659 return -EINVAL;
662 /* Defer probing if the necessary adapter is not configured yet. */
663 deferred_adap = i2c_get_adapter(pdata->deferred_nr);
664 if (!deferred_adap)
665 return -EPROBE_DEFER;
666 i2c_put_adapter(deferred_adap);
668 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
669 if (!priv)
670 return -ENOMEM;
672 if (pdata->irq) {
673 priv->irq = pdata->irq;
674 } else {
675 priv->irq = platform_get_irq(pdev, 0);
676 if (priv->irq < 0)
677 return priv->irq;
680 priv->regmap = pdata->regmap;
681 priv->dev = pdev->dev.parent;
682 priv->pdev = pdev;
684 err = devm_request_irq(&pdev->dev, priv->irq,
685 mlxreg_hotplug_irq_handler, IRQF_TRIGGER_FALLING
686 | IRQF_SHARED, "mlxreg-hotplug", priv);
687 if (err) {
688 dev_err(&pdev->dev, "Failed to request irq: %d\n", err);
689 return err;
692 disable_irq(priv->irq);
693 spin_lock_init(&priv->lock);
694 INIT_DELAYED_WORK(&priv->dwork_irq, mlxreg_hotplug_work_handler);
695 dev_set_drvdata(&pdev->dev, priv);
697 err = mlxreg_hotplug_attr_init(priv);
698 if (err) {
699 dev_err(&pdev->dev, "Failed to allocate attributes: %d\n",
700 err);
701 return err;
704 priv->hwmon = devm_hwmon_device_register_with_groups(&pdev->dev,
705 "mlxreg_hotplug", priv, priv->groups);
706 if (IS_ERR(priv->hwmon)) {
707 dev_err(&pdev->dev, "Failed to register hwmon device %ld\n",
708 PTR_ERR(priv->hwmon));
709 return PTR_ERR(priv->hwmon);
712 /* Perform initial interrupts setup. */
713 mlxreg_hotplug_set_irq(priv);
714 priv->after_probe = true;
716 return 0;
719 static int mlxreg_hotplug_remove(struct platform_device *pdev)
721 struct mlxreg_hotplug_priv_data *priv = dev_get_drvdata(&pdev->dev);
723 /* Clean interrupts setup. */
724 mlxreg_hotplug_unset_irq(priv);
725 devm_free_irq(&pdev->dev, priv->irq, priv);
727 return 0;
730 static struct platform_driver mlxreg_hotplug_driver = {
731 .driver = {
732 .name = "mlxreg-hotplug",
734 .probe = mlxreg_hotplug_probe,
735 .remove = mlxreg_hotplug_remove,
738 module_platform_driver(mlxreg_hotplug_driver);
740 MODULE_AUTHOR("Vadim Pasternak <vadimp@mellanox.com>");
741 MODULE_DESCRIPTION("Mellanox regmap hotplug platform driver");
742 MODULE_LICENSE("Dual BSD/GPL");
743 MODULE_ALIAS("platform:mlxreg-hotplug");