From patchwork Thu Dec 19 19:57:52 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: 13915698 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 1A960E77184 for ; Thu, 19 Dec 2024 20:01:52 +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=PRShUSBjq5I6HKenuUGB0yK2sVXlFvGUz4LilaU4jRU=; b=L8rj6e2tcewPoHR/qrQ9GlcMql i3gBqv1dALG5Xxo7gCFu6LnYgpS/fz4mn/dgIwMo9pwCm1qiOleJWMzO3RUPaq46oh8rr/3rEtEo6 ctJKjb9aqeHm9QdFoCRh1GjLoOvUAH998u62XTIuCBKY1+ZTPSgaq4A4oqlZLh3dnss4g49Hl7BRL qhDATK0yVfDZMEnm4ksQLYSj0FRtJ635MxbwDBFcqe6C07sEBtuNBxrtXU8DLfa1X7whCAZh9Y3j5 NQW5w1K6wfNjQ2Vv4F1W7/dqlOW0B66DqODDUaPgtgCcx+6M9nUU1FHoKmSCxNsc/fTVyMP/ZMO6+ J56AAHcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tOMiM-00000002x1t-1Q1b; Thu, 19 Dec 2024 20:01:42 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tOMfp-00000002wI8-1XDd for linux-arm-kernel@lists.infradead.org; Thu, 19 Dec 2024 19:59:06 +0000 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5d0f6fa6f8bso1777294a12.0 for ; Thu, 19 Dec 2024 11:59:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1734638343; x=1735243143; 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=PRShUSBjq5I6HKenuUGB0yK2sVXlFvGUz4LilaU4jRU=; b=GOjKGivM8Sls9EJiEalkGhLstHYBBJFMFQ4NOxrYZfFHAGc50mKeSr5rUbyGDNUMYb /gg+9ix+tc7bBr0zdoemCKe6Xqo/g2HfAvT5YgaeRfTCVwtk7M8PUJZQDfyTFbDfEvqi KdylBDIL1zFRECexku/1XXaosYAfunUApfjK6virTUYjcoDaFy8lqeiJUHGXQH9PwWou rtns0D3NHL3yvKzQgzfB5EHY+i5iUjq5xde/RK/OHkzISAmU+6Wr/0P43xBljd78KQRF GfTBlpUzpzpYGs59Bbe7GhgQJv3YU/s0UMy95Vx1HISMBzrRytVyZoR5aY7bm6irg+Dy /SmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734638343; x=1735243143; 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=PRShUSBjq5I6HKenuUGB0yK2sVXlFvGUz4LilaU4jRU=; b=WKe24MhPaMPv4YBy/Np5bRxQftPHBtbZ1EhqgXqkbcDCS93TOrzXIWndtqAxZkHPFe K8xdsiiDoA56j+m3rho0ziqb6vX11uYztWx+6J8bSLGvKizNAK9aSqtWCRRQFfu/mklF qkzl4ncmFkEifSZo2l2VojRWSibM07GCCfuocsTIzp8japkGdfMy1ZTHajzTvsz9fUGN Abh24aozwg/UTfsVSaVxhrJ0I5p5OQTZcSVR8746xVekihopeF7eieVmDq0X5BpEnRgp WopqzapntumM+LZcpoDCN40HL/CqbhncYRXfaxFtLFvbV5FuoRP6kDZVyfHZipTGrNWX iIRg== X-Forwarded-Encrypted: i=1; AJvYcCX8Dpt1XFzbiDM9vf31UeELSu7wYWxe41PQqpNyph3IY60SMDkaXpRyG+3dkT89/TkgeqOqb0OWHL5zNDbHP4jO@lists.infradead.org X-Gm-Message-State: AOJu0YxXcUiFNs7uin1Bj6cCdgHJW+Gi51dcqzC1kxTrr0p60Ws+K1SS fXMHBU1M/xeN7klBi2XopCGel6JARQoRInSlEOtZDeS1UeOIwcWKM5WF28Ck43s= X-Gm-Gg: ASbGncvRUnvZvvKcmJad7u/PVogUdiGDovgs9zk+HtaPE+VohAEa8P38Mpk0zH1gzkT iVLWOiheq/WR5kto75cOCadre5pBZ1bt70WO73UqOw+MQu22BeczbPQwTOz32tTk8eiGkj2iII/ 2XYkwsEtrlPZR+0CMcB6ECf87WPnycp11t3jfOrCUUwuPYbGCOGsiLjUxHqNN0TorJFdtl9Yab7 XlRZ55MNTGtU5dpJELDxaWL1MNoPB35lJ1noGTjlqm3H7yHHg== X-Google-Smtp-Source: AGHT+IFWWW5j/dWBpAa3jLvu/efCTMtDMJLR6V5NnS7zYJJvfEW3vIH7rRRkkbWVf34McH8wrBcmmw== X-Received: by 2002:a17:907:9621:b0:aa6:6f92:74b1 with SMTP id a640c23a62f3a-aac2ad7fa01mr7034866b.13.1734638343290; Thu, 19 Dec 2024 11:59:03 -0800 (PST) Received: from localhost ([2001:4090:a244:82f5:6854:cb:184:5d19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0f015b3csm96559066b.161.2024.12.19.11.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 11:59:02 -0800 (PST) From: Markus Schneider-Pargmann Date: Thu, 19 Dec 2024 20:57:52 +0100 Subject: [PATCH v6 1/7] dt-bindings: can: m_can: Add wakeup properties MIME-Version: 1.0 Message-Id: <20241219-topic-mcan-wakeup-source-v6-12-v6-1-1356c7f7cfda@baylibre.com> References: <20241219-topic-mcan-wakeup-source-v6-12-v6-0-1356c7f7cfda@baylibre.com> In-Reply-To: <20241219-topic-mcan-wakeup-source-v6-12-v6-0-1356c7f7cfda@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 , Simon Horman , Vincent MAILHOL , Markus Schneider-Pargmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2145; i=msp@baylibre.com; h=from:subject:message-id; bh=pbVz5i7bBpn8K6oPpV4EgG0QmN+pyuIY566qROm5zTA=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNJTqp6offH44/KPdSX7St1Yu4MBb2b7V4b+4yprywlpW bjh0NXfHaUsDGIcDLJiiix3Pyx8Vyd3fUHEukeOMHNYmUCGMHBxCsBETm9j+Kfnf+rjiws/Xwns rC5e8FZJWOSH/6XsOU5X9nTeO3/76stDDH94pxsYbfgbdG/acqct3KdkGd653z5re15dqvL45Uy t2mIuAA== 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-20241219_115905_411278_57794A06 X-CRM114-Status: GOOD ( 14.12 ) 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 m_can can be a wakeup source on some devices. Especially on some of the am62* SoCs pins, connected to m_can in the mcu, can be used to wakeup the SoC. The wakeup-source property defines on which devices m_can can be used for wakeup and in which power states. The pins associated with m_can have to have a special configuration to be able to wakeup the SoC. This configuration is described in the wakeup pinctrl state while the default state describes the default configuration. Signed-off-by: Markus Schneider-Pargmann --- .../devicetree/bindings/net/can/bosch,m_can.yaml | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml index c4887522e8fe97c3947357b4dbd4ecf20ee8100a..75963b11d31964c47679370664824ea111e70ca7 100644 --- a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml +++ b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml @@ -106,6 +106,22 @@ properties: maximum: 32 minItems: 1 + pinctrl-0: + description: Default pinctrl state + + pinctrl-1: + description: Wakeup pinctrl state + + pinctrl-names: + description: + When present should contain at least "default" describing the default pin + states. The second state called "wakeup" describes the pins in their + wakeup configuration required to exit sleep states. + minItems: 1 + items: + - const: default + - const: wakeup + power-domains: description: Power domain provider node and an args specifier containing @@ -122,6 +138,17 @@ properties: minItems: 1 maxItems: 2 + wakeup-source: + oneOf: + - description: This device is capable of wakeup. + type: boolean + - description: This device is capable of wakeup from the defined power + states. + $ref: /schemas/types.yaml#/definitions/string-array + enum: + - suspend + - poweroff + required: - compatible - reg From patchwork Thu Dec 19 19:57:53 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: 13915699 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 D917CE77184 for ; Thu, 19 Dec 2024 20:03:02 +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=2hLOILUzDo5sXZb8TaMc1HjYSIW50UI2D0EZn3eUUCc=; b=RHlIghpRuWYpfaZ7Dm+t9R4hML 4IsXg7YT8dlgVL5H1ilOD8W8ciugALpUlgTuADLrRrP1wQoq2kreSzEoi4EWNc4AQciJq8KLdMfnI 11bKVccs1MdSGPFWQ2qItBy/Oq8Q8CB6mTQZrtM8nVq7tGO5SoKZUefjNmMxZ5AbtCP/ioenluc4m wmCbl7gxPMoJqSY0KizaCyNJ5plS3vPdBdHLuyqceKwq8Ni1Rt3J+aig6bZfkdMBZiczS3aATPVuZ PQYXHukrChPaAM2xl9bGze80MZvxotTmiOMg/tDpOtaLDGJ5PMUl/CHlOvnkxSFqOcLdwwPUp9ITC XMILoQ5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tOMjR-00000002xJz-41D4; Thu, 19 Dec 2024 20:02:49 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tOMfr-00000002wJk-1JHU for linux-arm-kernel@lists.infradead.org; Thu, 19 Dec 2024 19:59:08 +0000 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5d7e3f1fdafso2266180a12.0 for ; Thu, 19 Dec 2024 11:59:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1734638345; x=1735243145; 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=2hLOILUzDo5sXZb8TaMc1HjYSIW50UI2D0EZn3eUUCc=; b=u1g3BQp04uB4hL/t4ACCyGeD+qFbIeexprQmF+Zv0Fpxc6Jy68MZjCv2Bqta3Nnta6 ywfxAXozm43xhOt2x+vpGtMeF0QkCkF3pwzhu1gmv15ezuQJ7kXXRTgsSiOtxhVAkCGj XNdiN2ZKdYlNdlW7FgXhoLM8dUHz2aLBDp9ZfHFGCGerGPQslei776LtEyeZi7pQU28E zsz4QxXJMM3REcr9CXiVFPTCukbHWqYQ8rx0zdVvdcpuOgzTztjphID9RIWz/vOSfnx3 ttE9AilvXc9vvT2VG1BLonNIl+BQXA9qsqhoy0MAlH+f0SyJowCicyVi9S/ou3bga3qC ViyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734638345; x=1735243145; 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=2hLOILUzDo5sXZb8TaMc1HjYSIW50UI2D0EZn3eUUCc=; b=o+enMWFmtcdk+F0X2LnW+rDD9c0PJDq6SeFylWzODa3woInf3ZdWLSs0HpxF/Bu1ts S/e48bGjpvmUbSLQ1U792nonuuaZbiSjJeM7OyESA1chtz9zsF8T5HcUfqLa4GUNDpYr SQYwsF7l3VgyiK0d9Lz1NCAY9SDBDwDB5bA2883qON3bzHCsOvgvcsITsLXBxUmV4yzM yKRCkmqvVu2dBQsUGgm5a28BlylyMK5ulQeZUGoIvkWIuzJxFNjK1sW/050wYBnih1KB 22FGg1atx6mgTdTJW7rVFgf0VKPsvT5kIQHgN0YjugZeTLA1iVlESQWNb7h4GB0+Wg0h Akkw== X-Forwarded-Encrypted: i=1; AJvYcCXuxbAsTZcTWRw2tMYctounabVHwyEFbc531fJ1RqM+Qzj3AwBundgTycGkW7/VOsd8OuvPe/+FjGwpKUCgp5aH@lists.infradead.org X-Gm-Message-State: AOJu0YzCC4obuVmOZRrug8hMLCNFo19AwtKaWOAd9WT0OCqWES9z/n4b cMHOaAme/lo3+myjt+6LpTbY34eQtwqX0WQD2+qiBrIWrQC2fgORinA5/kyX9Qg= X-Gm-Gg: ASbGnctu+RnVIu6aT5yCyZG6QbRh5WRjxu15E+7UGkJej6samgwamyRY8eH59Eb7VxF IhcOLbS9641zgwiZaVdiAFpqoFjeiA45SsPFqKKOEkMBuf7yOtV8PG9yVwxND6+uUmmL2RTazVl R7TeLp2i9KvKJ2T+KqnLbdUXNTCGiiMoIQs9LHC9DJek7sEH1SRKX5U/Z639o9g/mYKuITIlYvn +QWkGmkJJysa47PVMZp24kowGSgtAKY/imU9a5ETrg+JOSJJA== X-Google-Smtp-Source: AGHT+IF0fmv4Wr8LY08jRHZsI4hjJsYafL7GiFI9dClEL14qKh8/PvfWAazPI1H0PfTeK1OuVNPC+Q== X-Received: by 2002:a05:6402:401a:b0:5d0:e560:487f with SMTP id 4fb4d7f45d1cf-5d81dd9cda0mr166803a12.11.1734638345098; Thu, 19 Dec 2024 11:59:05 -0800 (PST) Received: from localhost ([2001:4090:a244:82f5:6854:cb:184:5d19]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d80701c822sm944816a12.77.2024.12.19.11.59.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 11:59:04 -0800 (PST) From: Markus Schneider-Pargmann Date: Thu, 19 Dec 2024 20:57:53 +0100 Subject: [PATCH v6 2/7] can: m_can: Map WoL to device_set_wakeup_enable MIME-Version: 1.0 Message-Id: <20241219-topic-mcan-wakeup-source-v6-12-v6-2-1356c7f7cfda@baylibre.com> References: <20241219-topic-mcan-wakeup-source-v6-12-v6-0-1356c7f7cfda@baylibre.com> In-Reply-To: <20241219-topic-mcan-wakeup-source-v6-12-v6-0-1356c7f7cfda@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 , Simon Horman , Vincent MAILHOL , Markus Schneider-Pargmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2839; i=msp@baylibre.com; h=from:subject:message-id; bh=JFdVPVem4046BqyFJNrVT8yrmK5qAD0B08AcK/8jouc=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNJTql42hv/19nSYusP1CavLp22BNzZ/n7ouRXbt/D8C6 h7r+A5c6ChlYRDjYJAVU2S5+2Hhuzq56wsi1j1yhJnDygQyhIGLUwAmov+J4b9TXO2Cm37sN//f a8hrCUk+uTZxt8CZi5NOl7adu+ObLfaMkeFTQNfl8oeFMqtrDm/I4c1fUBR8zveqgEjR8R0uXD8 MLzMBAA== 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-20241219_115907_364985_8ED6063E X-CRM114-Status: GOOD ( 17.93 ) 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 In some devices the pins of the m_can module can act as a wakeup source. This patch helps do that by connecting the PHY_WAKE WoL option to device_set_wakeup_enable. By marking this device as being wakeup enabled, this setting can be used by platform code to decide which sleep or poweroff mode to use. Also this prepares the driver for the next patch in which the pinctrl settings are changed depending on the desired wakeup source. Reviewed-by: Vincent Mailhol Signed-off-by: Markus Schneider-Pargmann --- drivers/net/can/m_can/m_can.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index 16e9e7d7527d9762d73a7ec47940c73c0976e05d..0dcdcde3449c7647e4bc9a92f918160a336f94c0 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -2186,6 +2186,36 @@ static int m_can_set_coalesce(struct net_device *dev, return 0; } +static void m_can_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) +{ + struct m_can_classdev *cdev = netdev_priv(dev); + + wol->supported = device_can_wakeup(cdev->dev) ? WAKE_PHY : 0; + wol->wolopts = device_may_wakeup(cdev->dev) ? WAKE_PHY : 0; +} + +static int m_can_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) +{ + struct m_can_classdev *cdev = netdev_priv(dev); + bool wol_enable = !!(wol->wolopts & WAKE_PHY); + int ret; + + if (wol->wolopts & ~WAKE_PHY) + return -EINVAL; + + if (wol_enable == device_may_wakeup(cdev->dev)) + return 0; + + ret = device_set_wakeup_enable(cdev->dev, wol_enable); + if (ret) { + netdev_err(cdev->net, "Failed to set wakeup enable %pE\n", + ERR_PTR(ret)); + return ret; + } + + return 0; +} + static const struct ethtool_ops m_can_ethtool_ops_coalescing = { .supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS_IRQ | ETHTOOL_COALESCE_RX_MAX_FRAMES_IRQ | @@ -2195,10 +2225,14 @@ static const struct ethtool_ops m_can_ethtool_ops_coalescing = { .get_ts_info = ethtool_op_get_ts_info, .get_coalesce = m_can_get_coalesce, .set_coalesce = m_can_set_coalesce, + .get_wol = m_can_get_wol, + .set_wol = m_can_set_wol, }; static const struct ethtool_ops m_can_ethtool_ops = { .get_ts_info = ethtool_op_get_ts_info, + .get_wol = m_can_get_wol, + .set_wol = m_can_set_wol, }; static int register_m_can_dev(struct m_can_classdev *cdev) @@ -2325,6 +2359,9 @@ struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, goto out; } + if (dev->of_node && of_property_read_bool(dev->of_node, "wakeup-source")) + device_set_wakeup_capable(dev, true); + /* Get TX FIFO size * Defines the total amount of echo buffers for loopback */ From patchwork Thu Dec 19 19:57:54 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: 13915700 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 5C662E77184 for ; Thu, 19 Dec 2024 20:04:09 +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=GjY9DIvP/j+a2vEDWbQw6B5IBSbTgKjYEYRIEWyupmM=; b=QOQi7qKGUWsvCcyV/5+9hOqkPO BU7lKSYTer4FjO7OLsQcoEFMQ5oCrA1qUwykG0sZuTWK/gHGLkM8/R2UOcdYQCH+oSQGxUCs6H6Jm 2D+DgLz5vZ7aj7yOV2aKo1P2ANyy4it1i9aRuSylSf6dxzJJUBTm68jFOnplZ+DojqUe1+WLAyH3B w4wylwcly7mCTPUv3mcKzVeHxX5lEAO/fRxJnB8eqgpBq9HxHK/dNDgLbNWvGnyn2lyL3GHXc378c 53jLmOObR8K15bMhgTk2Lva9Vnsak53QW/5UhlJYRm5uAQs9NwfyDEyZRj0/UBqf8N9ExE9sYSyTF RlEXwhSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tOMkY-00000002xdJ-2aRv; Thu, 19 Dec 2024 20:03:58 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tOMfs-00000002wKr-1YFp for linux-arm-kernel@lists.infradead.org; Thu, 19 Dec 2024 19:59:09 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-aa6a92f863cso238044266b.1 for ; Thu, 19 Dec 2024 11:59:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1734638346; x=1735243146; 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=GjY9DIvP/j+a2vEDWbQw6B5IBSbTgKjYEYRIEWyupmM=; b=kmzOt5pHaYqTJBDZd0WySSOg3EBwFtRzUFRa+4ZkVTM7SOQx4OVfYXgTlHf5KY7OXl iP0jKNt2Du9Gam2zM7QYGKGJ/e5gtZUj87MnThXH2N9z8w0CvwaKLjXxIMtBOJUuvXfR oB3Y/G0na5tCDsFI7tiLdJ4m8ph0J2IXLrJcAyRWnzHa1+kmgNKuJm3ad1IjjN38lwNA QKtiw7qQF/ZJiTpGUWolPcS3D3fcoVevqE0LKIWkN/ANfcUQXynkBCm7FP3Mi2M8Y4VG NeU7BoVR+6BvPHg8zAS+nufOe/J36uXzPpilSaiF+9UIfRzQKzUhi8O17X5ydyrtLcoS HUmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734638346; x=1735243146; 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=GjY9DIvP/j+a2vEDWbQw6B5IBSbTgKjYEYRIEWyupmM=; b=D/w4CR/ANKu6uUAieUUMQVMp349Jqsg93Os1utbYppKhDV1EzhTw+vYh6Dl2sqMsNg 4NSumjbPdDlsUZDmM8zeNX7JLKKcEbMUtSD7moCzL73Kavp78grgnLcd+/wHVf7KopNq qRX7sG7wubQC5uRQ4/vUOb7kdw6HoCwdWN5aD6OobsZlnkqpBYSDDApw8xyxL5VzlNt6 k+1knashY4AMuX4i1C1oEOruaWOp4NoRUnGPhZW3WF59ZSyxn1J7GYI9bPwezSp6BuaA ia+U0EFP+C52x2gSD5h+uTSeXvu2bXLXyiS2Paa0W2ZPoJ1FwlP64WKFRp8IPhs+/Ksz kSCA== X-Forwarded-Encrypted: i=1; AJvYcCXLjY4dBMZztqQRBFKSvo2BmhTRLv5Wk0e7s89XHn2kkj9g88R+ciwATRtvBFML+HsAlzEiBewDb0E3Ik2Yppb2@lists.infradead.org X-Gm-Message-State: AOJu0YyT+zoDedaAUkFhX+AvTiQ5/NWaRoOCcIuIJau/GYQY877q0eHn 1aHUdzv+I4fHATxpNGwqcPHdggZ4YW+Q7OlpvEF+o+GSgVZH0JQSJus4HCpPvTQ= X-Gm-Gg: ASbGncuT8B1Ht6w55KlwFW6USwkWieZPb591mE9ZSyUIKPhWCJ61H92n9crwStLBEUZ aqhp2482N6wbyNhXS0piVC0BtS4XNjXojZyl+nAjH/w+vcFX7bn6dbL7WVbbs5TzAq4R4lRkPI3 y+rHABM1+XGlRFBfIM8sjWWizSNWcIQdA07BNQwhFMEWe5qAqNf4KNZf8ss6gcFsUFyYadTx6Rm hlYp6YS09xTWZrZt3l04R4DcSHqHl710ZPDPQ9rJEhDhakOpw== X-Google-Smtp-Source: AGHT+IGasreMAbBLOSYmozk5zkbcfUr/mtndjRwbhEURyo571uEoHnYhBSDfIDFuCEtn8LDH45uGSg== X-Received: by 2002:a17:907:1c14:b0:aa6:a228:afaf with SMTP id a640c23a62f3a-aac3378d0b4mr3761866b.52.1734638346219; Thu, 19 Dec 2024 11:59:06 -0800 (PST) Received: from localhost ([2001:4090:a244:82f5:6854:cb:184:5d19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0f015ab9sm97118666b.155.2024.12.19.11.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 11:59:05 -0800 (PST) From: Markus Schneider-Pargmann Date: Thu, 19 Dec 2024 20:57:54 +0100 Subject: [PATCH v6 3/7] can: m_can: Return ERR_PTR on error in allocation MIME-Version: 1.0 Message-Id: <20241219-topic-mcan-wakeup-source-v6-12-v6-3-1356c7f7cfda@baylibre.com> References: <20241219-topic-mcan-wakeup-source-v6-12-v6-0-1356c7f7cfda@baylibre.com> In-Reply-To: <20241219-topic-mcan-wakeup-source-v6-12-v6-0-1356c7f7cfda@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 , Simon Horman , Vincent MAILHOL , Markus Schneider-Pargmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3520; i=msp@baylibre.com; h=from:subject:message-id; bh=s9w+e101TyQrbO6pYnUr4GEGJbwIl5NBy74FHjUoVy0=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNJTqt5OXTaz78I15uRqe17jCXdW+7HzfjqqdSRmzZKm4 GmT7ZWiO0pZGMQ4GGTFFFnuflj4rk7u+oKIdY8cYeawMoEMYeDiFICJ5Nxh+J/xa9EuV//kk0sb OFZXsahc7BOJ/zUp4GLGxRUOh5eprl3O8M/+568+9hP29lvy/oX3nFtvnHbRpb+iKrnu54Q57a1 bTjABAA== 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-20241219_115908_418368_DD9FE6C7 X-CRM114-Status: GOOD ( 15.58 ) 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 We have more detailed error values available, return them in the core driver and the calling drivers to return proper errors to callers. Reviewed-by: Vincent Mailhol Signed-off-by: Markus Schneider-Pargmann --- drivers/net/can/m_can/m_can.c | 6 +++--- drivers/net/can/m_can/m_can_pci.c | 4 ++-- drivers/net/can/m_can/m_can_platform.c | 4 ++-- drivers/net/can/m_can/tcan4x5x-core.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index 0dcdcde3449c7647e4bc9a92f918160a336f94c0..e69e9799710b3e4cb267324e8e9db40ca02328e2 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -2356,7 +2356,7 @@ struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, sizeof(mram_config_vals) / 4); if (ret) { dev_err(dev, "Could not get Message RAM configuration."); - goto out; + return ERR_PTR(ret); } if (dev->of_node && of_property_read_bool(dev->of_node, "wakeup-source")) @@ -2371,7 +2371,7 @@ struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, net_dev = alloc_candev(sizeof_priv, tx_fifo_size); if (!net_dev) { dev_err(dev, "Failed to allocate CAN device"); - goto out; + return ERR_PTR(-ENOMEM); } class_dev = netdev_priv(net_dev); @@ -2380,7 +2380,7 @@ struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, SET_NETDEV_DEV(net_dev, dev); m_can_of_parse_mram(class_dev, mram_config_vals); -out: + return class_dev; } EXPORT_SYMBOL_GPL(m_can_class_allocate_dev); diff --git a/drivers/net/can/m_can/m_can_pci.c b/drivers/net/can/m_can/m_can_pci.c index d72fe771dfc7aa768c728f817e67a87b49fd9974..05a01dfdbfbf18b74f796d2efc75e2be5cbb75ed 100644 --- a/drivers/net/can/m_can/m_can_pci.c +++ b/drivers/net/can/m_can/m_can_pci.c @@ -111,8 +111,8 @@ static int m_can_pci_probe(struct pci_dev *pci, const struct pci_device_id *id) mcan_class = m_can_class_allocate_dev(&pci->dev, sizeof(struct m_can_pci_priv)); - if (!mcan_class) - return -ENOMEM; + if (IS_ERR(mcan_class)) + return PTR_ERR(mcan_class); priv = cdev_to_priv(mcan_class); diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c index b832566efda042929486578fad1879c7ad4a0cff..40bd10f71f0e2fab847c40c5bd5f7d85d3d46712 100644 --- a/drivers/net/can/m_can/m_can_platform.c +++ b/drivers/net/can/m_can/m_can_platform.c @@ -87,8 +87,8 @@ static int m_can_plat_probe(struct platform_device *pdev) mcan_class = m_can_class_allocate_dev(&pdev->dev, sizeof(struct m_can_plat_priv)); - if (!mcan_class) - return -ENOMEM; + if (IS_ERR(mcan_class)) + return PTR_ERR(mcan_class); priv = cdev_to_priv(mcan_class); diff --git a/drivers/net/can/m_can/tcan4x5x-core.c b/drivers/net/can/m_can/tcan4x5x-core.c index 2f73bf3abad889c222f15c39a3d43de1a1cf5fbb..4c40b444727585b30df33a897c398e35e7592fb2 100644 --- a/drivers/net/can/m_can/tcan4x5x-core.c +++ b/drivers/net/can/m_can/tcan4x5x-core.c @@ -375,8 +375,8 @@ static int tcan4x5x_can_probe(struct spi_device *spi) mcan_class = m_can_class_allocate_dev(&spi->dev, sizeof(struct tcan4x5x_priv)); - if (!mcan_class) - return -ENOMEM; + if (IS_ERR(mcan_class)) + return PTR_ERR(mcan_class); ret = m_can_check_mram_cfg(mcan_class, TCAN4X5X_MRAM_SIZE); if (ret) From patchwork Thu Dec 19 19:57:55 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: 13915704 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 0AB0DE77184 for ; Thu, 19 Dec 2024 20:05:32 +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=HUvfT27SCPJ/1I/rQ7u1CFfvkxFi4BwZuv6rcMUwBXw=; b=sAXhQdH2VTR1+qgoXxVGCKEBUj 4jtdE30+DWNUfvR4DAh1VBbr/19WB2M2NKcLMihNKDqoEifxRyvGFvQ5ER3T7ryW4C7i6KxTjeR99 zQdEMeT92zuyRT7GuZfsmETU+rfKgG60+xp2GpysGT1cmGXSDy9CnjxKLDyZauHxeVriIrg1xYAPh /oDnRKenJWJIG1meGjRRuVa0AW3zkITiYdc1kHXpGYu3Hu227etmT3BooYI+uDkAPQDnKR/mgXQrq uNDie6vFlDTxbiMv3XjY6ZlRHXgXJiuxRb36NRpFjCkKeK/jZVzafkAHx6KxZe0t2C0jaoP4/4M1h 2RRNML5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tOMlq-00000002xrs-1QDb; Thu, 19 Dec 2024 20:05:18 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tOMft-00000002wLg-1jqn for linux-arm-kernel@lists.infradead.org; Thu, 19 Dec 2024 19:59:10 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-aa67333f7d2so203921266b.0 for ; Thu, 19 Dec 2024 11:59:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1734638347; x=1735243147; 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=HUvfT27SCPJ/1I/rQ7u1CFfvkxFi4BwZuv6rcMUwBXw=; b=qLx1xKqKW8oZmUywX/Q9ZzDNVoWyZYEWJAwvx38Dt312Uo3IohkWsfM+BKwgCAuxnJ YMwnFkXs+Vhr1Ojhs4EC8SkHmQ9+dVfMBR/Kaxs9/e9wX/gIha0NnleuvEJInYDhFfH+ vR7/FARCJWV7XI6w2BYWKwAdorEwZLiryDIH/PBikqGGM3bpOIU5c+0kI+ypdsTyMEtU pqhDlopkDHhbC17MR46XIFjoXEopmOO+fzFq0ERojy7R8RswnwPvDhsqiM6uIsiJBQUG AH0WqNb6gNbp76uroqxOO0jCSuQjkjEY2XqCX33szz9SQ15Hm6+rS1HsTdRrQNiR9cr4 bYDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734638347; x=1735243147; 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=HUvfT27SCPJ/1I/rQ7u1CFfvkxFi4BwZuv6rcMUwBXw=; b=G4AtdCUNWsYT4lEQmIABNrYLd3xiW1VICAVkyIc24viauL53GTKkJdy0AkiF/smz4+ 04pZcQPTWa3q/39wRbTCzCYui1GRRGfZEHW5UTZQrd5ZCaH6NkWJd9vhNcq9/92MyrpV mDfA/75Y4XjoLulb/A9dyxvQ5Pp9ROWxNa22Hxs81r52a0U8VjKCKHOJh6ozZgzy6m1Q x4DOKmU9Hv60f1wJKy+bYCBJpZ+IqU1417EpRtRNfmOx+7yTda1uJzyKC7WNIHpYvRpr imG9m2Oz/diorT0are1fqkf2pCGt5fTm5x0QLfEbOi4CWoPg9Xzku23+JgYm4WiNFpgN W8kQ== X-Forwarded-Encrypted: i=1; AJvYcCVNH0eG1BrMa7b1nkl05x9tjzbTaNp7S3nK3D9WrtX6z56TzjKuOOBU2x6V5Ao9WgjHVR2s7W7wyfl9hpBkkCm2@lists.infradead.org X-Gm-Message-State: AOJu0YyYUioQbRenPf/hMVGM0f1Q8wGsWoglfaWPNZ5F4aRbRBEPIpQF X3e3+k6uMCCIikGxLrSqtG5Ly6cDjqrrYLXP5JNC4P63Amnx6ygaRyWm2iSDA0A= X-Gm-Gg: ASbGncvz/99U5iaW+mUmdNwG2tH4VbOZxgGbknZVqoZI45LghwWW4J+C68q0JXY6q0q OBPHtU6ycBTm7bHwEBcboKi9Wmto7RHFWceI/cMrusf6kXdFJiaejiEh6fymdGLR2bRsvTTUdVS iWuFqw0J9Ec8g3uRaSpSoHcRFqRMa8qY/uoXly0kQYU1QY0NA7YR4KlBvIP5ulUSUKFbUHx9uPL +qWXcKSMgMBM0FMDaPpJ/H3m7T0X1EyqknCrcvK7GuyA2EezA== X-Google-Smtp-Source: AGHT+IH/fZzedKlcK5U0wriyo0zt+BLfVIxeZ3sOC7b5Lbwtvat8IssszxYlnVAebbWoaHGw9AkAhg== X-Received: by 2002:a17:906:478f:b0:aa6:6c46:7ca1 with SMTP id a640c23a62f3a-aac27038e93mr8059666b.10.1734638347397; Thu, 19 Dec 2024 11:59:07 -0800 (PST) Received: from localhost ([2001:4090:a244:82f5:6854:cb:184:5d19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0f015b1asm98230866b.148.2024.12.19.11.59.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 11:59:07 -0800 (PST) From: Markus Schneider-Pargmann Date: Thu, 19 Dec 2024 20:57:55 +0100 Subject: [PATCH v6 4/7] can: m_can: Support pinctrl wakeup state MIME-Version: 1.0 Message-Id: <20241219-topic-mcan-wakeup-source-v6-12-v6-4-1356c7f7cfda@baylibre.com> References: <20241219-topic-mcan-wakeup-source-v6-12-v6-0-1356c7f7cfda@baylibre.com> In-Reply-To: <20241219-topic-mcan-wakeup-source-v6-12-v6-0-1356c7f7cfda@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 , Simon Horman , Vincent MAILHOL , Markus Schneider-Pargmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4086; i=msp@baylibre.com; h=from:subject:message-id; bh=LNk2Yj//BXYCvnGeYALUx0IGjDCStCiWRmkgerTUxYo=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNJTqj7dOLK0YW7EhP5JSS/+Pw9YorDKzmGl0NlpLTKp9 6IzhE/O7ChlYRDjYJAVU2S5+2Hhuzq56wsi1j1yhJnDygQyhIGLUwAmskiIkWHzS+bt04r/yzNO 9NWQ8zhcIVIzp//2Kaf9Dd8/bmvyuxvP8E9Z5obMcjnNn/5xPz4Z9cxVy8jbcfAce9lGW5mz2Yu 7bvMAAA== 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-20241219_115909_486033_348E870B X-CRM114-Status: GOOD ( 17.93 ) 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 am62 requires a wakeup flag being set in pinctrl when mcan pins acts as a wakeup source. Add support to select the wakeup state if WOL is enabled. Reviewed-by: Vincent Mailhol Signed-off-by: Markus Schneider-Pargmann --- drivers/net/can/m_can/m_can.c | 68 +++++++++++++++++++++++++++++++++++++++++++ drivers/net/can/m_can/m_can.h | 4 +++ 2 files changed, 72 insertions(+) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index e69e9799710b3e4cb267324e8e9db40ca02328e2..ce39685a7c42a2238ad8afd6cf53aa53c9bbb3bb 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -2197,6 +2197,7 @@ static void m_can_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) static int m_can_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) { struct m_can_classdev *cdev = netdev_priv(dev); + struct pinctrl_state *new_pinctrl_state = NULL; bool wol_enable = !!(wol->wolopts & WAKE_PHY); int ret; @@ -2213,7 +2214,28 @@ static int m_can_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) return ret; } + if (wol_enable) + new_pinctrl_state = cdev->pinctrl_state_wakeup; + else + new_pinctrl_state = cdev->pinctrl_state_default; + + if (IS_ERR_OR_NULL(new_pinctrl_state)) + return 0; + + ret = pinctrl_select_state(cdev->pinctrl, new_pinctrl_state); + if (ret) { + netdev_err(cdev->net, "Failed to select pinctrl state %pE\n", + ERR_PTR(ret)); + goto err_wakeup_enable; + } + return 0; + +err_wakeup_enable: + /* Revert wakeup enable */ + device_set_wakeup_enable(cdev->dev, !wol_enable); + + return ret; } static const struct ethtool_ops m_can_ethtool_ops_coalescing = { @@ -2341,6 +2363,44 @@ int m_can_class_get_clocks(struct m_can_classdev *cdev) } EXPORT_SYMBOL_GPL(m_can_class_get_clocks); +static int m_can_class_setup_optional_pinctrl(struct m_can_classdev *class_dev) +{ + struct device *dev = class_dev->dev; + int ret; + + class_dev->pinctrl = devm_pinctrl_get(dev); + if (IS_ERR(class_dev->pinctrl)) { + ret = PTR_ERR(class_dev->pinctrl); + class_dev->pinctrl = NULL; + + if (ret == -ENODEV) + return 0; + + return dev_err_probe(dev, ret, "Failed to get pinctrl\n"); + } + + class_dev->pinctrl_state_wakeup = + pinctrl_lookup_state(class_dev->pinctrl, "wakeup"); + if (IS_ERR(class_dev->pinctrl_state_wakeup)) { + ret = PTR_ERR(class_dev->pinctrl_state_wakeup); + class_dev->pinctrl_state_wakeup = NULL; + + if (ret == -ENODEV) + return 0; + + return dev_err_probe(dev, ret, "Failed to lookup pinctrl wakeup state\n"); + } + + class_dev->pinctrl_state_default = + pinctrl_lookup_state(class_dev->pinctrl, "default"); + if (IS_ERR(class_dev->pinctrl_state_default)) { + ret = PTR_ERR(class_dev->pinctrl_state_default); + return dev_err_probe(dev, ret, "Failed to lookup pinctrl default state\n"); + } + + return 0; +} + struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, int sizeof_priv) { @@ -2381,7 +2441,15 @@ struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, m_can_of_parse_mram(class_dev, mram_config_vals); + ret = m_can_class_setup_optional_pinctrl(class_dev); + if (ret) + goto err_free_candev; + return class_dev; + +err_free_candev: + free_candev(net_dev); + return ERR_PTR(ret); } EXPORT_SYMBOL_GPL(m_can_class_allocate_dev); diff --git a/drivers/net/can/m_can/m_can.h b/drivers/net/can/m_can/m_can.h index 92b2bd8628e6b31370f4accbc2e28f3b2257a71d..b75b0dd6ccc93973d0891daac07c92b61f81dc2a 100644 --- a/drivers/net/can/m_can/m_can.h +++ b/drivers/net/can/m_can/m_can.h @@ -126,6 +126,10 @@ struct m_can_classdev { struct mram_cfg mcfg[MRAM_CFG_NUM]; struct hrtimer hrtimer; + + struct pinctrl *pinctrl; + struct pinctrl_state *pinctrl_state_default; + struct pinctrl_state *pinctrl_state_wakeup; }; struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, int sizeof_priv); From patchwork Thu Dec 19 19:57:56 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: 13915705 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 59DDFE77184 for ; Thu, 19 Dec 2024 20:06:44 +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=gk8cThuOVr3SSVx4chFLhJB4lJSnrqBstxF8oe/bdWU=; b=I2qgdDg5GxWkd+Z1sa8ST8vOH9 FU098yXAxuVImtl7o6qdo5KVVSgJC35mesINeb+duknn7ESzlXgpQeyqpKhnvB/0ha1ig2FcRygQw 0Ncgbrv6Lv9cTe/XiuWgXyTIwOkFIeJLhCYZ6TUSPoosfy4kCpp8uJB8a/0/1sVOXs3SG4xZVcYzT lVia2KwBw1XE8cHQeoq/hOodMurMzGJUGMYKP2ve0A327KtUR+OSd7w/fCA0VVQxLqTX/Q+V6k/yV flXL971HWDFxdlTNkYzwYRrOsIB0fhgmIGjpiVD8wh6+gQZ+pen7bbgpcYhMrtZCzdDv18B1DMvXv 3v7TY/9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tOMn5-00000002y6u-08Is; Thu, 19 Dec 2024 20:06:35 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tOMfv-00000002wMv-3SFW for linux-arm-kernel@lists.infradead.org; Thu, 19 Dec 2024 19:59:12 +0000 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5d3d0205bd5so1599454a12.3 for ; Thu, 19 Dec 2024 11:59:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1734638350; x=1735243150; 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=gk8cThuOVr3SSVx4chFLhJB4lJSnrqBstxF8oe/bdWU=; b=wt2SMglCjztgg8jxtT89pXXeZkwTtdy9beozG16V/H88ZcleiYjGlKFacv6bjJxyNH yYnFTMwn+6PQAnLPRBURLBLuQ8lbIT8r2UhAL3QoWXBxw1DJHARlHToP4J3OcHrTPNMU fNAkeoi4lT7Yo5BhtEnD6zfJUwJIG9uU9ePyLKPmaY9fOmyxf9Xk+OFRX91+y5x8kttB ymrr3j1aSCGYYvIDgWmpTlOxP5xCa7RsH+r4juJ1Ld1AA9um6usEqU9ZwzLZ7iKNj6tE eLIScBTYgUScuWNZ/nitQC2rCHKFBLq/d9zhfHp83EzT8Wd1eByoD8Y8qd+oar8KbIUB QDBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734638350; x=1735243150; 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=gk8cThuOVr3SSVx4chFLhJB4lJSnrqBstxF8oe/bdWU=; b=C/m1yMyglMShbrREuUlhX8P5WQHmr9DeblTbSR6XDmrgefhFea4hZOJFUeDof7Mq6r hbCO5iGOs53yC5bnRwFDQhSD/3Fl7C8FmnXS9NgB3e1dy7cr6Z4ma/PyFvkrbIXeC8a6 y7jZh1iiHiMywcDl5upOzNpLv2khZMrw/dHc8w/UmUGxb/HSSquGydKfzIxyvnlLI5eZ SqgKjbybHAKq4WT6AKd+B5loV/BYe3yLc4a74g39zQPLCjp6a2Ppo71czYgBGF2qVCWR qMBdCnVBqljQ4wO3UFuhWDJdjKccODTjy63Kl3uh3VaIaKgDTEmSIffGGEavLLqlkLjS /GCw== X-Forwarded-Encrypted: i=1; AJvYcCUaDTJ8KIVQxoMShJBXNJdphUOwYm4V4dm7AbRQEcvsunTmGk1g0YSke1o2iulsnA8/1m9G+TAwg2LmYp7jWO6v@lists.infradead.org X-Gm-Message-State: AOJu0YyP8aO433Khi/dhoL9eQpL0XSwE3SPnwNfWNzNE4uhVWB8mAWgu YtHgTDKNc3uxFD0bxjmt1yozDwBOiIW78PSBUnW6eXdyiLfy4daIAHjyuKZWwbQ= X-Gm-Gg: ASbGncvm1URbid1X8UQ9HoQV7sTFaigZrqE6Vot9+CjWHdBp2r9vBl3kcwteKYtnkjo qv0j7QQNbU/ACnlTd6RDmWvKvnIeEZavJ902/rb0/bjHAlu0rmfV60W6yrcg5UqQlLBaizNhlRV FVXeOSo6MQhg+kw/cE/hx0utRDM8eLF+tHb8y2rHclQ2kz2WWCP+VsquXrJtwl63vN4MwDgq4Ik BCBa9jmb3Ih2/l9c9ePnhCvNXD+H39zFXnnhH8jEDut4gCt4A== X-Google-Smtp-Source: AGHT+IGYlDf+Xz6gFvbvHg+7Mk8TNFhqb5LHJUrSxJ853FDaHbi3aKQlIsQUWT9tR8k7sWykNjFhJg== X-Received: by 2002:a05:6402:510a:b0:5d2:60d9:a2ae with SMTP id 4fb4d7f45d1cf-5d81de19afcmr122678a12.33.1734638349836; Thu, 19 Dec 2024 11:59:09 -0800 (PST) Received: from localhost ([2001:4090:a244:82f5:6854:cb:184:5d19]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d80675a3d2sm953164a12.16.2024.12.19.11.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 11:59:08 -0800 (PST) From: Markus Schneider-Pargmann Date: Thu, 19 Dec 2024 20:57:56 +0100 Subject: [PATCH v6 5/7] arm64: dts: ti: k3-am62: Mark mcu_mcan0/1 as wakeup-source MIME-Version: 1.0 Message-Id: <20241219-topic-mcan-wakeup-source-v6-12-v6-5-1356c7f7cfda@baylibre.com> References: <20241219-topic-mcan-wakeup-source-v6-12-v6-0-1356c7f7cfda@baylibre.com> In-Reply-To: <20241219-topic-mcan-wakeup-source-v6-12-v6-0-1356c7f7cfda@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 , Simon Horman , Vincent MAILHOL , Markus Schneider-Pargmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1069; i=msp@baylibre.com; h=from:subject:message-id; bh=9hRKFs2Z9paofbu+as+4aAVd9C5fh/XVAfao6kHuNUM=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNJTqr6//L3ocqJQt8MR14+vZWzlDx7cMUNDvnzjkt1Lw i2vtnyd2VHKwiDGwSArpshy98PCd3Vy1xdErHvkCDOHlQlkCAMXpwBMRHQuw2/WXJNXDTePmsXY i6R6NUUVXT9cvMnQQsMwuDRfOyIhP4qR4UKhdXb91Pbfc1f/qldn6BVTYvogYNBUfGn3/jWvV17 5yw4A 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-20241219_115911_867657_311923A3 X-CRM114-Status: GOOD ( 10.74 ) 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 mcu_mcan0 and mcu_mcan1 can be wakeup sources for the SoC. Mark them accordingly in the devicetree. Signed-off-by: Markus Schneider-Pargmann --- arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi b/arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi index 68e906796aefebc5eaaa5a231e56105a9cdd13e5..cc693be47df080e8b8dba9f1aca2cd725f4ea85f 100644 --- a/arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi @@ -160,6 +160,7 @@ mcu_mcan0: can@4e08000 { clocks = <&k3_clks 188 6>, <&k3_clks 188 1>; clock-names = "hclk", "cclk"; bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>; + wakeup-source = "suspend", "poweroff"; status = "disabled"; }; @@ -172,6 +173,7 @@ mcu_mcan1: can@4e18000 { clocks = <&k3_clks 189 6>, <&k3_clks 189 1>; clock-names = "hclk", "cclk"; bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>; + wakeup-source = "suspend", "poweroff"; status = "disabled"; }; From patchwork Thu Dec 19 19:57:57 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: 13915733 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 2B408E7718A for ; Thu, 19 Dec 2024 20:16:52 +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=9z+OFIo6oYvRs30dPwtO+gLECAhFDSFhyF+Jm1Y9wnQ=; b=rX60J8ZtNkTTOTjAOFOCaosnQw kPhOKa2lBt6SeSgcLSWJbcGtKpDwHZOmoKHKdP1bcRRjyLvPEY/PceyZbLtFBTXvO2zvQN4R7kCbb hy5iDbSfDnwGWjWKvVBZ+hVrC/r60mK5cX6A0swvndWED6lFp/71+mcwLUOTkmrhXVPXxh3j1e/03 +n2hOBtRrvJK6sgmSbcWH5H9OlFFCGIjYRYqFO8a3eLe8vaxyr66RerESedV6ShidVGG4H7VjZyMB EVfVK76OFviq3REDazJHmYQrznZ6MwcLT0PReZCj+OLhyRrcYTX2EIaDcmHqR3DtBGeC+v67fCtT5 BzzKF5gA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tOMwq-000000030CW-1aAM; Thu, 19 Dec 2024 20:16:40 +0000 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tOMn4-00000002y64-1Jce for linux-arm-kernel@lists.infradead.org; Thu, 19 Dec 2024 20:06:35 +0000 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-540201cfedbso1061277e87.3 for ; Thu, 19 Dec 2024 12:06:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1734638792; x=1735243592; 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=9z+OFIo6oYvRs30dPwtO+gLECAhFDSFhyF+Jm1Y9wnQ=; b=MQu5Wr7Gy+Aq5TjXAAxLgyZpSvFWYriTVz5JnMFzZAAo6JkoramEdOj8gazkG059D9 6RXulAXDkL7mQoojnnQPynqq27l1QZmozdOFeRhFXkz8VZPp1WEPoOV8rOQWbTnGSuI6 Z6qzVMO1Knqj9GFDT47tyY4ZQqrbZYbR24WBYPEhx7qqeaPMVIpv82KRiLlgGphxyi0O qwoLSt1ZFd1/pYK+UhlTuE4KViaVAytGuX8WouyDYDKKamr6uwrXmmZR3C6PUa5uHPgK UQremma2S9O6MsEhwfMQtFuaLORLAyPPJoRBuzKEzc8sotmPNo/vqMTrF8f60Kosm0Bi TpQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734638792; x=1735243592; 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=9z+OFIo6oYvRs30dPwtO+gLECAhFDSFhyF+Jm1Y9wnQ=; b=W8iauzAM7pJ6hzI4phMHtAqdxKt1A2t98POrd1N18TJL19wnebIAmgy58DSPiPQrpa Z/1KQx7enjPAfOHObtWMJjpoOo54OxghCH8Zjzs2iP0Vsk5RQRssi+F5l0xJWhu0+PQd rUSLiJTP0Awmsyace7z11sdoOeGsHscj2upD2upKgJ8re0DHkuLWspUq2ft7la+11tnv Cme9YRvelkaXkKqvfD0/qZGN5aHtamoF8Woh6hEW6SL5Hc5o0UwweJHC9EfrJopz77uu 5XP7webfBXxB7Aiz7YgO2G9o95oArvCGx9q7gXJ00CqZRC1Kk0i9zXwUVQ/Nhk2VEer1 63tA== X-Forwarded-Encrypted: i=1; AJvYcCVWVG9cNyztCeXh/WK/IAXM9KtpHz/fzPzM0mkUZxCKkPOmP2G3FHKaE4wn414QRWMG/OuwiqNFTiKwTVABisQE@lists.infradead.org X-Gm-Message-State: AOJu0YxC0xVUpEhus6ylcUXLDT/7AVnem619n25sUdL3ozAnpU3V1LVr 2DPrq27m5T2erqEkRTOamL8aQgjotjrcuSq66kVNf5IWr3x41edPh1Vv16B7W4iY0QM/ZOcsHrc C X-Gm-Gg: ASbGnctE9kj7EzGtxADLhiVFhBbUbXDhPudWjX+URVK3rJB48ba28rT1h2jFmekabSh Czk3V1/YhAd3q7OOc89G8iNOrVCVB7pDIiurtudhBHATlzXBacGDJOVMr1nM1PRrRFN2oCCOpK5 BaZ+00MOIGRORj0TSRriMy3YGp0TUGhuvVsUdT7uvtHBCiYFqoBHKdbAWGJZ+B4CRG3kyn+dYgz 773WjvTRrn8klYiV3S8WToZGgj88/GsfPcG5iN5cNy69SY0LA== X-Google-Smtp-Source: AGHT+IF4QehdfOuEvDMqzB9MY4lPolUTGRMgbZDTTZ30MZlE7/TjNW2+5MWxblm0XOXTHJASMqJcPw== X-Received: by 2002:a17:907:6d17:b0:aa6:8211:ff85 with SMTP id a640c23a62f3a-aac2d479750mr6446266b.35.1734638350970; Thu, 19 Dec 2024 11:59:10 -0800 (PST) Received: from localhost ([2001:4090:a244:82f5:6854:cb:184:5d19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e894781sm97668366b.44.2024.12.19.11.59.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 11:59:10 -0800 (PST) From: Markus Schneider-Pargmann Date: Thu, 19 Dec 2024 20:57:57 +0100 Subject: [PATCH v6 6/7] arm64: dts: ti: k3-am62a-mcu: Mark mcu_mcan0/1 as wakeup-source MIME-Version: 1.0 Message-Id: <20241219-topic-mcan-wakeup-source-v6-12-v6-6-1356c7f7cfda@baylibre.com> References: <20241219-topic-mcan-wakeup-source-v6-12-v6-0-1356c7f7cfda@baylibre.com> In-Reply-To: <20241219-topic-mcan-wakeup-source-v6-12-v6-0-1356c7f7cfda@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 , Simon Horman , Vincent MAILHOL , Markus Schneider-Pargmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1076; i=msp@baylibre.com; h=from:subject:message-id; bh=QvPC9XT2nTzuBVKU8Y0OkYtXeaFjH0JRpNZRrR05gzg=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNJTqn6Hqj1OYj4hs2fjkpBZl9sNVrwPbMm60vH0xXVTv onsrKedO0pZGMQ4GGTFFFnuflj4rk7u+oKIdY8cYeawMoEMYeDiFICJFB5k+B/sFhC+ul/0kEPe 742zNtvt/yYQbtX24KrUqrP8c+1bpTYzMrQeOJiUdmw+t6m6tPe1CfzCWh8FzRY9ySycxqF5sCf 0Ci8A 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-20241219_120634_360160_AB316819 X-CRM114-Status: GOOD ( 10.76 ) 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 mcu_mcan0 and mcu_mcan1 can be wakeup sources for the SoC. Mark them accordingly in the devicetree. Signed-off-by: Markus Schneider-Pargmann --- arch/arm64/boot/dts/ti/k3-am62a-mcu.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-am62a-mcu.dtsi b/arch/arm64/boot/dts/ti/k3-am62a-mcu.dtsi index 0469c766b769e46068f23e0073f951aa094c456f..7f88f284ea5daeba189976d03dbd048626104b77 100644 --- a/arch/arm64/boot/dts/ti/k3-am62a-mcu.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62a-mcu.dtsi @@ -161,6 +161,7 @@ mcu_mcan0: can@4e08000 { clocks = <&k3_clks 188 6>, <&k3_clks 188 1>; clock-names = "hclk", "cclk"; bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>; + wakeup-source = "suspend", "poweroff"; status = "disabled"; }; @@ -173,6 +174,7 @@ mcu_mcan1: can@4e18000 { clocks = <&k3_clks 189 6>, <&k3_clks 189 1>; clock-names = "hclk", "cclk"; bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>; + wakeup-source = "suspend", "poweroff"; status = "disabled"; }; }; From patchwork Thu Dec 19 19:57:58 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: 13915706 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 3B966E7718A for ; Thu, 19 Dec 2024 20:07:53 +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=yH6hsp2KM99yT0BDbWTUeIR3jr/s6dYxtO7YCFid8y0=; b=U7xGB0MPcg8nWKLry62gff1/Cq +oZhnw972U6vjoxyByXPPtUek5nRuoAsodW/XGECIs3mmdpg6ggj0f/zZSl4kjq2AlhaOMfb9jQGq fC7PagecdQEqaFvbSmCI5gl/CkesCUMECj2lS14BqdjHpvxTMqh3Z/+nY3cCvZMLHAEQPrKOUnY2N xJgi4fx9Feba+d2y6wTGJAT3eZFIuNJlBBQeqIUEOEF9TuxZ6Oaq2W/oH0NHgVZG2qxT9d5lw8I1k fZVKFCFcAkkkYQa1UkDC6Ua98kKGy/jsmQ/PmTV/6Ji+NvfzfHsDGgnoC4nqQTkEvWvkTP0WDVqyk 0O+unc5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tOMo9-00000002yJo-2oCa; Thu, 19 Dec 2024 20:07:41 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tOMfy-00000002wNV-0uMT for linux-arm-kernel@lists.infradead.org; Thu, 19 Dec 2024 19:59:15 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5d3e9a88793so1982514a12.1 for ; Thu, 19 Dec 2024 11:59:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1734638352; x=1735243152; 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=yH6hsp2KM99yT0BDbWTUeIR3jr/s6dYxtO7YCFid8y0=; b=0sCe0rIMCYTQ4kZA+rzSWJcCo7KOCPKA5uOjG3JojJq90ejYZtvGLkPMNCQfbL17BO paParPvG5GSCLCI+FfzJx47Ai2Ewids4aNVzqKXnjPKJbz/DzgCN0EKElAP9gPZP457D rjcwFZYI4siWGUCqLbK4inBdb4cEIqkML8V9jQt+gqAgl6OGLXuQyxmAxn/VKWXzwHhL PS0TVwYNfnKcg5xOZpB76klX6N7xZV8R64mw8kcpyg1tR//vdDNKb0+ptV/rZ5rUZ/my kc8PB2DC1eqtsin4OBRThawe5oHS1B5CcPIBOb80UEnTtTHUeDAlomXVoNuiO5+okq50 FADQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734638352; x=1735243152; 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=yH6hsp2KM99yT0BDbWTUeIR3jr/s6dYxtO7YCFid8y0=; b=bFbrhwZF9FhcohXgm8EM0qQRPS7Uld6gVmPxxuuYW7t6irFulJ0ANihOg17nvUfbhs yTx9v0CCKDAZTpGDP6UHDMQxkJY4xw9D9fbzNkEJ3Hy3eht0UvttbVhduf7iGg8TsZHd nPkHMUmqdyvV9w0sJKrMZw5SSAVfrIlpvyR+j2pHU8HTZ3xjCXXcrSzCtOP2CGh3EW5e 6nV6fLGpFyPNkl/1b+drtJzifwGIil527nBjX/xgX1tcqiOC/jVh3bgXtxgUkEQV8K5J hCtdgGa/DkHEUP/yaEJkC74EGp5ALwQz4iLMjXLaPCd8oLoWsZAscpWfQS4IJSctyCTm pwaA== X-Forwarded-Encrypted: i=1; AJvYcCXebDzWNR31BT9CEHzNevOeVUCFe3dYnGpMcvZQRj8okGRWfuGs4ZdIAZi03X1ysM/uj8riWmS733N9Hws8n9nr@lists.infradead.org X-Gm-Message-State: AOJu0Yz7UbbdMCEKpuUDHCOrfp57tHOx4EZ+xZDK3O3D1u+H+pyBEsp6 c+rJTqApqFasqBJjLq2wAuGq8AxGXMcJm4jW2FJdp02JUi0c+ZLWhwG88FwkFYY= X-Gm-Gg: ASbGncu06niZasPkhk41zmk6c7z4DTBZAgeZoPxXhwQzp3smxSOTpFeGtF29BJ2I1EZ 61+WmFbrH29gPDLiY1U9Sru0XslR4tbJ6ouYKTFXLVJEndG2LR7RSMSxi9VEcVoCLzqH4yDF0FG p4RGr2BmyTYj2P7mEbkz0HS70lEej7m2U8XDkOAWZ0XZmi/5uCjxAPbkySLncwqGpgZhHWUtzG9 mB7UkCdm9glbAjEgq3/bzV45cxTxcTvDP4ZDWwAEMjCyAdIJQ== X-Google-Smtp-Source: AGHT+IGtcrLbNDzvZMlctOsefUcwsi1FQVpwzQvY/+MU9MQ42A/89PCMdpAPKvI3wEO2j49f+U5l6w== X-Received: by 2002:a17:907:1c21:b0:aa6:a844:8791 with SMTP id a640c23a62f3a-aac334e4c53mr4967266b.45.1734638352144; Thu, 19 Dec 2024 11:59:12 -0800 (PST) Received: from localhost ([2001:4090:a244:82f5:6854:cb:184:5d19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0f066112sm97044866b.179.2024.12.19.11.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 11:59:11 -0800 (PST) From: Markus Schneider-Pargmann Date: Thu, 19 Dec 2024 20:57:58 +0100 Subject: [PATCH v6 7/7] arm64: dts: ti: k3-am62p-mcu: Mark mcu_mcan0/1 as wakeup-source MIME-Version: 1.0 Message-Id: <20241219-topic-mcan-wakeup-source-v6-12-v6-7-1356c7f7cfda@baylibre.com> References: <20241219-topic-mcan-wakeup-source-v6-12-v6-0-1356c7f7cfda@baylibre.com> In-Reply-To: <20241219-topic-mcan-wakeup-source-v6-12-v6-0-1356c7f7cfda@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 , Simon Horman , Vincent MAILHOL , Markus Schneider-Pargmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1218; i=msp@baylibre.com; h=from:subject:message-id; bh=9F9vMEKbj2mOv4/2m1bk48Pas2jClZzC2oJ41WmTRoc=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNJTqv6vDM53mtt799LchQ9dnrOdWPhRaW/tZw/JJwmz6 /8e3hfr1FHKwiDGwSArpshy98PCd3Vy1xdErHvkCDOHlQlkCAMXpwBMxKaQkeG5d3Feyttqw1Ub Pdg9FfZ56UeKdQcf2PCMl8nyqHjlX2aG/7HSKXuyoy/ytLu+i3tysyw19XrS9rqWiMOaex4Y/Zz VxQAA 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-20241219_115914_261905_02ED85FF X-CRM114-Status: GOOD ( 11.45 ) 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 From: Vibhore Vardhan mcu_mcan0 and mcu_mcan1 can be wakeup sources for the SoC. Mark them accordingly in the devicetree. Based on the patch for AM62a. Signed-off-by: Vibhore Vardhan Signed-off-by: Markus Schneider-Pargmann --- arch/arm64/boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi b/arch/arm64/boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi index b33aff0d65c9def755f8dda9eb9feda7bc74e5c8..cf57f954dd3e31a8747c833bcc583dbc6ba21d03 100644 --- a/arch/arm64/boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi @@ -173,6 +173,7 @@ mcu_mcan0: can@4e08000 { interrupts = , ; interrupt-names = "int0", "int1"; + wakeup-source = "suspend", "poweroff"; status = "disabled"; }; @@ -188,6 +189,7 @@ mcu_mcan1: can@4e18000 { interrupts = , ; interrupt-names = "int0", "int1"; + wakeup-source = "suspend", "poweroff"; status = "disabled"; };