[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241015-topic-mcan-wakeup-source-v6-12-v4-6-fdac1d1e7aa6@baylibre.com>
Date: Tue, 15 Oct 2024 21:16:00 +0200
From: Markus Schneider-Pargmann <msp@...libre.com>
To: Chandrasekar Ramakrishnan <rcsekar@...sung.com>,
Marc Kleine-Budde <mkl@...gutronix.de>,
Vincent Mailhol <mailhol.vincent@...adoo.fr>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Nishanth Menon <nm@...com>,
Vignesh Raghavendra <vigneshr@...com>, Tero Kristo <kristo@...nel.org>
Cc: linux-can@...r.kernel.org, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Matthias Schiffer <matthias.schiffer@...tq-group.com>,
Vishal Mahaveer <vishalm@...com>, Kevin Hilman <khilman@...libre.com>,
Dhruva Gole <d-gole@...com>, Simon Horman <horms@...nel.org>,
Vincent MAILHOL <mailhol.vincent@...adoo.fr>,
Markus Schneider-Pargmann <msp@...libre.com>
Subject: [PATCH v4 6/9] can: m_can: Add use of optional regulator
Add support to use a regulator for the core. This is optional and used
to register the dependency on the regulator.
Reviewed-by: Vincent Mailhol <mailhol.vincent@...adoo.fr>
Signed-off-by: Markus Schneider-Pargmann <msp@...libre.com>
---
drivers/net/can/m_can/m_can.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index c539375005f71c88fd1f7d1a885ce890ce0e9327..274fdcae49c31d4792b81cdc065821206d3cb206 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -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
*/
--
2.45.2
Powered by blists - more mailing lists