@@ -23,6 +23,7 @@
#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
+#include <linux/regulator/consumer.h>
#include "m_can.h"
@@ -2421,6 +2422,11 @@ struct m_can_classdev *m_can_class_allocate_dev(struct device *dev,
if (dev->of_node && of_property_read_bool(dev->of_node, "wakeup-source"))
device_set_wakeup_capable(dev, true);
+ ret = devm_regulator_get_enable_optional(dev, "vio");
+ if (ret)
+ return ERR_PTR(
+ dev_err_probe(dev, ret, "Failed to get or enable optional regulator\n"));
+
/* Get TX FIFO size
* Defines the total amount of echo buffers for loopback
*/