From patchwork Fri Oct 11 13:16:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Schneider-Pargmann X-Patchwork-Id: 13832569 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8575DD0D78F for ; Fri, 11 Oct 2024 13:27:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Vga3MOZfmZ29kxHJN0FdVgZZZBaaChAjrwFcDU1qvO0=; b=wUdVgbil4+oW/t5866SNoiUzfp NOBE0CtUYR9pyBXbb3qsA95pUAgia70TNwxoAuZG0aRnjGZlIzYZHLsx3BgkN+fb6C9q6kXP9EKNP 6Hvmj+aMkfngPsqgjCY6L2uKjy+AF52tHL0Ypgi82ruITpvaA3ykINq0M5r9fo8nMLigklQRS7CBX ROzeFdhw5VpY+Y21yIBhIy4oLJIQhb/WlBPazKjS8Jkh9yARaHytalSZ9TKPgAuB2DwF2O5Yp4QUI 56QBKiPHqcw7NP9r/Fn6URZ/cjiJsRO1nPk45AkRmzapxlt6EPIF/X4ZxdhROdBTQOSKokxdD3ThI Iw+IhDQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1szFgF-0000000GRsW-03N6; Fri, 11 Oct 2024 13:27:43 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1szFWy-0000000GQ5k-0huk for linux-arm-kernel@lists.infradead.org; Fri, 11 Oct 2024 13:18:09 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5c918c067a1so2480942a12.3 for ; Fri, 11 Oct 2024 06:18:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1728652686; x=1729257486; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Vga3MOZfmZ29kxHJN0FdVgZZZBaaChAjrwFcDU1qvO0=; b=jkBQsFNvdkBQMncNbYKUek9VNDLbraebII+T6dXGO04S8+H0kT2Oi2RsHaFNS9629R oMzLlg/LqBpphxBpgjJ3gyiP3ZYgY6/StewUlhNJG6Q2xdBcsg1FbE+RxGKmQvN9HaUx 4jr+xVtYklgHz6CLQK5T5kRWoHR1a9EZJ1nuEkr4ZPnriJtTcufxvh3Tlqmna63D2C97 auqPrIezmvtUXtteqmB3aLBswQPc/GoGKHnElfZPjcnaH3jIwS5JEJQzhgw/Y/gHSIHR vHc7bqCZCrtAgGCG4DHlLwYjhX8wnDL6KBPZ/un/fau7zN3ezMWTZwtdge4uJzAIje5R ik/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728652686; x=1729257486; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Vga3MOZfmZ29kxHJN0FdVgZZZBaaChAjrwFcDU1qvO0=; b=k+hJWQ9lVvGMynjHRNiNlWp85fHBnbDflP631Cf01EqejxdS8Jq4ijh5319MgkhRwh PDWeSB5KsfUx6L0f2BodfkO5PTkpI+Y4+wEAAaWNbRrN4aYiPfHb4eKIHz/F1Im4r6MA dQqZ7Xd4Q6MeN7FuSjWA6weaRNObW63SOnsYPzaoT4ZW48draSfkwoiQlj5VvdzoAWnw 0BwE1w68ao7QnQvZeqteas3iJHkQe/nB7S97hRPbPOpqFtEQRgKd5WnrsOhUivav9L2I icw04Kxu/YEAQIRDjqaJMmuHudhgd7P6gBrdEKsly3E9jJbemuS/Rpmb/4EANbwCBDPh 9GUA== X-Forwarded-Encrypted: i=1; AJvYcCUUSTKy2llwxWSBc0NM1AZXdtrLfJFgK29BKgY7qpD8KMASDgVp1VKZ9gXtbS1Q63PP+tzARuegNggOnc23UklE@lists.infradead.org X-Gm-Message-State: AOJu0YzMTi6nUntDbL4uTD3xydcPfYS92DNlhEdWyazjZqHWcExDPMn3 748i6S7wlixw3ADJXH3lrrEk5sSEfsvWLLhurJbdZRAEOOJzGCNobpAXDqkbHVVMMYcDt0xqSc9 2 X-Google-Smtp-Source: AGHT+IGgoWPy1ViOIak8PVBnyQlhX6rbT31r7c6raHYXCjGwe6/3JiHlA5M2yM504nFnhQ1ciPMqXQ== X-Received: by 2002:a17:906:d7d4:b0:a99:75bb:a37f with SMTP id a640c23a62f3a-a99b95a5e37mr203682866b.54.1728652686348; Fri, 11 Oct 2024 06:18:06 -0700 (PDT) Received: from localhost ([2001:4090:a244:83ae:2517:2666:43c9:d0d3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99a80c0133sm210634266b.114.2024.10.11.06.18.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 06:18:05 -0700 (PDT) From: Markus Schneider-Pargmann Date: Fri, 11 Oct 2024 15:16:43 +0200 Subject: [PATCH v3 6/9] can: m_can: Add use of optional regulator MIME-Version: 1.0 Message-Id: <20241011-topic-mcan-wakeup-source-v6-12-v3-6-9752c714ad12@baylibre.com> References: <20241011-topic-mcan-wakeup-source-v6-12-v3-0-9752c714ad12@baylibre.com> In-Reply-To: <20241011-topic-mcan-wakeup-source-v6-12-v3-0-9752c714ad12@baylibre.com> To: Chandrasekar Ramakrishnan , Marc Kleine-Budde , Vincent Mailhol , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Matthias Schiffer , Vishal Mahaveer , Kevin Hilman , Dhruva Gole , Markus Schneider-Pargmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1195; i=msp@baylibre.com; h=from:subject:message-id; bh=ulDHdao8BTiFyv+Pi61bMFlLk5gdDHQrGY9errmbLQE=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNI5VfP/1iQ80tPZ75Kx42dt2JHw94lrkh/uVZa2XML99 v6+rWd/d5SyMIhxMMiKKbLc/bDwXZ3c9QUR6x45wsxhZQIZwsDFKQATuVXLyLD4/Qamp91bjJd/ +bJx67HC/O3nY4zkqw39JwjdjzgdN+EBI8PuazdthD6er/qTfdYjL+jLCa5HcY+VO9/fKOCSXMS s3cwMAA== X-Developer-Key: i=msp@baylibre.com; a=openpgp; fpr=BADD88DB889FDC3E8A3D5FE612FA6A01E0A45B41 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241011_061808_252257_901D80CD X-CRM114-Status: GOOD ( 11.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support to use a regulator for the core. This is optional and used to register the dependency on the regulator. Signed-off-by: Markus Schneider-Pargmann Reviewed-by: Vincent Mailhol --- 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 c56d61b0d20b05be36c95ec4a6651b0457883b66..b009575354cf5f19e93950bb17d448f81609aae4 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "m_can.h" @@ -2383,6 +2384,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 */