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: 13915689 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EFD7D1BEF81 for ; Thu, 19 Dec 2024 19:59:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734638347; cv=none; b=Gs1f/Yvh68MpUTeEF4AAvWgG3evqsSDcQ+ePle/4tHjhfiBeyXPRSJwhPoy4oKRfbnPT9ZI6Ph8YSY4P+yzTHpCFgu9RwJ6Zb6wwykixZfw1Iy9dUV3DaxUoxB23r0UuLk7YlENEqesdHtaUZGbMbmHpjxF3m0sPngZbJaXJJBo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734638347; c=relaxed/simple; bh=pbVz5i7bBpn8K6oPpV4EgG0QmN+pyuIY566qROm5zTA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V2N5HJatbVUvzc/SCaDH2h8K9X6OiMQ/ThI6YLD788TLbFljuepNaEw25USOpwYMmJaW1c6OnGFk+KTtOqV332LQC4+zC4975FSULAcLoii8YAaZNg6y9d9Rd2jgxS/Gi9q+dtU21TN1PkSAbmYQLqL0nfpYZT9WiDFYmVm5fmU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=2nj7UVeo; arc=none smtp.client-ip=209.85.208.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="2nj7UVeo" Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-5d34030ebb2so1846301a12.1 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=vger.kernel.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=2nj7UVeoMh9+4F+yHQihVV/sQZ0/JyVaGr5BTA5YP3bx4b9TlrsYmhCaFbZUGI/VtO t+YkBDlzyHl6WiKLpcwmgbfkFaDJqYRKCy6AlbiD91SehEEn6BlIOSRCMuvlPJGh5RkK 9OISoIswIfLPImp1wWTwVonW3VxTO2CzgeGKuH+68m533qDmLzWCnz38bBoX31bdOoz3 pi7dHsuH2jquAhAH5iinfsmAnsYJNdaoDnmlNUeIWLXjCGaRisHlggVpcyx5V69SDGqu NKJm2dEepca2DQXqHnx6d0tOWhclXQ3gucO5ezjwFuG/QjfO1KQVEywnng3dyPyEMjhc HXjA== 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=FGc/f9xXzRaOnvN13odRrHNzZ0ctypMIgFTwAP16dZ7GKZMJM6pQhM8g4w4owgYR2o IJekhVvVewpcd8y/o6Ns/QrVBosVbS1K36rtXbCZ3cF13uSaJFwCpQZVJXSvXlVKOisG G7OXrskPFPWSzhEKgUAJiIAYgom5QIhMr5IEOfo5wEWKLiR3/BEHuA582VZgEgMi5tDW LQEHvHvFKrHC6ysv8WqN+yLlwnvt26p/euxvORxNzxHrFkNQO/WcVdnoUsVXt7kKaXj0 EDsaNSWn0AfdpZ3jjjKXivDac8gga7Au27jcrisUBAZDNf2o+RXdGi+CyxNjiqfmfE3W 2Hig== X-Forwarded-Encrypted: i=1; AJvYcCV+dgjCgXGiMLmemTmubfAgkx7djByIuSl2WEsHy12nODvVV/tE+FMb+kGKbkRe0txeMMOM+6I=@vger.kernel.org X-Gm-Message-State: AOJu0Yyg1dSvYTQKpYZm2A6oQT24jzlpjQPeFqDWea+NVaQOG+oC9z3y K8Z9paxqoo1buX8jSN7DUpZ3o7k+dlrzvTweIXAy8c8zTPUN6uaRi4fKRecdcg4= X-Gm-Gg: ASbGncuPFHFXwvBTpy99qNyzzP1QFP+GcYmYZumsbV8a0K2pLnHslRtTUI4oi8iuw/v R1SAsBA9zMaDjpKaFArhHFAav8MGA85wAjcah7CFgiFPTdACK/WdygUvAX7hAKbJ0xMEVjHzhdF zJALwHnfeuddTfFN+/IvCqj8cNRKPxESRxTWLuwxn1T7vQIzTjGV5cqxlKOv9/y4Lzh2IkIvZfK CFtvCq/tCNICY1lKcQWGAkF11xc0HzjvemILCQKepaKQJAU/Q== 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 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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-Patchwork-Delegate: kuba@kernel.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: 13915691 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9ECC31C07CB for ; Thu, 19 Dec 2024 19:59:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734638349; cv=none; b=V7uEMgR/rUaig7+XvrrupXd7lkRR/6yHkDEBjpsdsrl/WtZIwzF6/lBvcPLjJjDzuan30TeCiwJSGaeGnuXfcSF3a6ca61thLQuartXjawJvei+cvvqLZJWXua/z+sPRtF1RHA0+FC/J/5DVLWMBZzb5EDdYCBTaxr3XvbzS/28= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734638349; c=relaxed/simple; bh=JFdVPVem4046BqyFJNrVT8yrmK5qAD0B08AcK/8jouc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BuPZVC6PfmRxNEgZUTl+owl3iJ/jRduIbh8L/xh07iJrW/2BK5QRvBLCnbvompIWb344PZwc0yHujoMVLu3JlQQTeCxF2bYeeHVA33Dfjg5Zf4isXajFSjOihFKME9pMF1AJh0bfc0aRQg0iHm0R+fpGdz+RwfzFjfUCZj5aezM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=XjzFeR/2; arc=none smtp.client-ip=209.85.208.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="XjzFeR/2" Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-5d7e3f1fdafso2266193a12.0 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=vger.kernel.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=XjzFeR/2bEKWzpAFe/fpx6GAM2nPZH7iSbhamd9PCgoq8+PZZiPjhDs8M8hahk7gVy 7dr+7gxzskVdlUAciNcwJL7avN/FmTCFuE9cA9cStAoPb276DnrVJq+qF075IIuz2bWD XVaKVB8U3NGn69YOIV1pQ3MdosxeoBa03VbKBGis6OGe0kFyZKaWxedXEIEyFMjSXK7G yT2qmBZCNIPMvBn75qDy4n9OCv9+nyCWixL8EPScYgygiSoQ9zjzxMzHvr7VSrlmehUe F2J0ZEugJPiG8JioK8a3wdMDxYAd5LFmP1GALbQBXm72ducurGxwtDuGSDAUWdpFYDrD hCow== 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=2hLOILUzDo5sXZb8TaMc1HjYSIW50UI2D0EZn3eUUCc=; b=laIXfBCz4IdgGxXDvONUPU0XJ3fvJEmnJxXB9QUfcPJgmtCYiuZ84dtKRvEd/IJE4A FT9H5BDVFQzgmgyJTkvZIp+iFYwGyxCoTWhDXEpz0OdOyvOFkV9I9uNWbyztw7DFhqMX 0zEKZKIqHe9puuTWnToUAo8yOim39AxDt4/OMMAiMSAOhwL6955sr60S2Ah8VLaYMmu/ 7VckTGcdxtMpGAcPxQGc4GY7UJvHoupRh25uBUMFBH+eCu+88hlWVXxRg5q03IwomggO s6Yqo/XfF9+nMHxqjFi1RCfh9Gh17f4kx8S3w1af4DcJRfSrTDuheC2clknQ6zKWrUt2 kuVg== X-Forwarded-Encrypted: i=1; AJvYcCVEwGo4IJjL2UCVi77ONi2GkeNcLvvLSrRmLtLMlyIZOzpLzgzvPceIAY9HqeSRflYgjrgTk1I=@vger.kernel.org X-Gm-Message-State: AOJu0YxcHisVfRuvmg5Tv8RnkImoCETW9OMX5OQypYU9MU72nlVInV2z SMOvk8t/xgcZ7nLvGaNwVuhVmxK6mwUfpHTDqFW9IZGrz1yG1QFWzuZeu7FSqOE= X-Gm-Gg: ASbGncs9ZB32u6IjluQdRdjrdaHycy4G4Qm2ERiu0vZCuFRDU9wSFs/jdmgzrtxRxiS AH4Vy0UjirS5c4lkUZ2be/VvYgf9G/WH/Ewlwo5Zw26nlaThmFduZ35KLzr9Hptwc3qvfR7RA/n +GSQG8ipwcK5q7/8bSmqvzNzSRysfMrrAJTkAy2oqFEwtkihq8xWLSfPnqhFWCHZeQ3XTzApvOX 0rUKLW4HnOhEkBeS8f+yQcNRmlmYIc4ZrFcMcsGnKCCEItVFA== 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 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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-Patchwork-Delegate: kuba@kernel.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: 13915693 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D14461DC9B3 for ; Thu, 19 Dec 2024 19:59:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734638351; cv=none; b=lUD67cqkaaGg2uklS0AI9j2bSDZJ5lJeBwTb3q7wIxckmw1ewVClXU2ITI3amXIyOVrICtvXKVCiCGE0o+kKqi45LkkmtvG2uXCNjb7eFjXBkI/vwTSnzuQRow5Spo1gklDqEMnDM6Yuh4m7C5oVSsU60cdNO3T2kAkpHwV89jU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734638351; c=relaxed/simple; bh=s9w+e101TyQrbO6pYnUr4GEGJbwIl5NBy74FHjUoVy0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aWqRhw389ONZgsW3jTBkZyG5kxk90m0M+rtQMLRhLlWugN4V5s4cMrP/sHvrOjiMBBfku820IXN+WF+dvenIHfBp4PjpA0JOGQW+G7/u5Fz2TZR/xQkUpof9HQCeoxfdlwAFXpW4pWGU7Buk8DSYNkz2N+N0UkT3xPsLmqdn0pQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=smn1Svre; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="smn1Svre" Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-aa543c4db92so232799966b.0 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=vger.kernel.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=smn1SvreS33AL5NQr4MDze190jD5LgtEj3fNxX4G6NepdaB5iwE5dguydi+rLwZOSM eDCVpFKSLk+de8KBBNE+9bnzeRV5Y4oPk3Va6YjQcXXJ7ccWEUzxRh2SBznSMPPne3wj 1PO8Br8ygfYgnoxE5w1tmziybjeq3ZgNaLLnoN4U2QTWwUryTN+dRWyxKvb1OkkyOtTZ Ddb/uEAUszfVmKloaGGHIsmO/2Fl35ZIq2C1IY3Skug9REeDxCJEzyMk5i1BzAk1ysWu RBBuhH5ef0oJlW0B+zHTtWYHtPNw1rSBbi87Z0mqgm0lARd6X6ubMNeGz+sgsMIjFOs0 1uqA== 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=mVPp6+IUgR3n+GBlM9Fpy6bpPvh0JQs/0QaY7M+kFJ+zJ3+CACqO6dBizBdraXQIhL XdTgCkOTzHlYYWMpDWpB+VQjN8smlpbOWW4baLOmn6zGxyXPH/im/fAxT8fidQS1mHP1 U++qQ5ZjzWETtit33dNSXZoOlLD/kpHYQml9YRxgchYNm82L8gD62NHsmQahAeiYD+5v tAsibT36xsQSRHCEqci6rtrn1XHeJsC1OFmXzIcnZsmCocPCoFZy8mQ+7Bhl7aPiaPet YiQJmIzKdtXhUK7I+wZhRtYA3A23kQuC/RkCwHLI+QssOvDrGn41mDB0ctSepHyFxvrV XInQ== X-Forwarded-Encrypted: i=1; AJvYcCUB+3QCIBuB1LDr12DyrW2NywvdLhKru2bbLI7AN1YpWjMWWS8AUz2n0uYzI8zVEa9QePUm+p0=@vger.kernel.org X-Gm-Message-State: AOJu0YzEgnGDxzx2vT7DaaEOZY06MJZYH2m64kBPsFGi7Hz6xu7zTkt2 knOTRYvN6VqekvwpgpW9lBe3Nfy6tCerfAAj7mFSNrTPEznCKZ+ZyqidRhl5wog= X-Gm-Gg: ASbGncsThQfV9QGyUQl6pxasJ9scRzrdoEzmHyKbnNV46tYX2A68b4KOZ2hSvsCdX2y F2B7CGKFrIw0G+uDAEANUAX6DU7yr1NvKshHXqOR+F1IXC6tW1Zq62qf0Xk1El5qP2qQhv9/LbH M+YBDRlleZxG7bebwIPB1DRbhw6TFOK+zQy8foLZZB1UKq+vgW+Hq7sDA4oC94lKsP89ZWjqxqT GciriuFpo982ZT0Pt+QyOfU3+FRwcg1sF5eC0t3I48a3VenoA== 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 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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-Patchwork-Delegate: kuba@kernel.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: 13915692 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 267F21EE7BC for ; Thu, 19 Dec 2024 19:59:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734638351; cv=none; b=FQ3AiENtsLZLKiZrKlAGy+Mrl/4i9O1AirvKxpzu/gpGIm9i9Drlo7OiP2bvNXK4OJ/dSg6S1df2yHTYEhViQEvIaBLrAToQ8Qb5BNCEce/7dvZGuhkpL+Ls1nXYTX3alzJsAEBfNKgjgsQle/aDU/x0Zol3lWE+j680XN3/680= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734638351; c=relaxed/simple; bh=LNk2Yj//BXYCvnGeYALUx0IGjDCStCiWRmkgerTUxYo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XcaZr7XIg2PnmP3mXYxtpKUQMDcqXeIclkZ3Ofu7t5Gf77rMP5KS4T5r0dvTPkwFhSiMFGHUSZhZuabpU+NJ1vYUafL7tj2hE1wgnUOhhgv3hH2J2s03Ur8N09Q7N4AOh63NzLffQReJ2i18enPqL+0+E4i3cBEiI9ooeCNBiyY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=uN6ThgxO; arc=none smtp.client-ip=209.85.218.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="uN6ThgxO" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-aa5f1909d6fso193552166b.3 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=vger.kernel.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=uN6ThgxOEWEMaapmYxeupmuNtxOw3GIX5wf2qXGTb9cidnV6Bpwd6NhBz0j/2fBCzf f6stEFeEKk4X6YJW03MPjsdLrsp+gZbYbxugtf4o6dfghrBOhds9YJOb1MBFWpP36lxx HPz0eOGLxry1bVQfvaughJ4I7SGHt4IirEruocPTguJZeJ0w4BF4Vdw/Hflu0oYwV9+G vP1NZipgv1uKOkGyehxM4E24zEQa9bJnoHkPI4FsPxbpUmnCW4S5L5TnWQqiZfPUqUmh TrJYsmXACtoMgXT0WO1FfjcVede83f6Y9pc7Pw08v+60ZGKGvaaR4lo351SwertJDE6J bq3A== 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=jWZSb8K/RZzCBIOtcGK9Akl0JqCEr/Qi1b8n8eP1ieg/xivKe2uSgjSc4EwLaPEw8D ZVQ35De/1VBsbzpGnGI7mANec0ZXPRMeFE1tATPBAfERSkV7I1suSX3r78iHA4LTB/rg OGfuW5FI256zebdCEX6b1zoVLfBQFWtoK1Jw0A25JpbvSAx8szite91wNCSP5L5/DQm3 TayaB2ntkMyiUc7sO/UkeWsyND5L+oe5HAS9YRfAGExVux+u+f1PCJUyS1ptSrXH/OGm bzb2myZLuy7R8z/WxW93YDk2SCkf9VRgGlY2+QZy199evDFkb5X9QfXB53x3bw8QD40v wCzg== X-Forwarded-Encrypted: i=1; AJvYcCX36pIY2xJOyfk2RND3vduADUifsABhPSt+vfiNELN6y/CHCtueCFikDrYO1kVGZju4As77uWw=@vger.kernel.org X-Gm-Message-State: AOJu0YwH50TUEZ5+uDclWFql6IYa5ZdWmOv2braC8D4p+e/1AGRWvQhy PsTImTvPB4M070r976YFgUq29LuMJ/oB84oqqiizquryQJCJC+NHwyEDtcJQE3Q= X-Gm-Gg: ASbGnctTUNTR9BTwJm+wL+fQcLwEpXw+DvBDCqEAgFqcZln9GGlIiWjUrirMzFdRz+U XRxDaVZPL1ctiLSeeUH/cx8yV6DKdkZW+sjpT/uBLT8Mefsyiqgj5SVD+6G/fDJuqjFhLdvtTA4 b4O18N0vg6dAmF6fzzADZm5Q9Ytl9UjwQZiN3+uFTrIC7VYva3lpglYvvy2SCtXZX3ZeO4OxkLq v9NELKdwZyoHfWNiIVqIYVIXoxkiyPLvUEzwKva8lB6fUuQyQ== 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 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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-Patchwork-Delegate: kuba@kernel.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: 13915694 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E4751FECB8 for ; Thu, 19 Dec 2024 19:59:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734638353; cv=none; b=ZS3AMNN2cr/zZ3j2jpIiMu7pTd6cxS6QVyROSsFlbNTbk0DjbAX0h4y+elNv2o6PS3abxbdDeJm4GDJ1ZGqU3ddvRu4GH5iQHZ6zzuB7lww9y1Q2XR7LcL6ysIneZIUhKL5CbKbFnXhwEPEkpFwSbk/dAvOftAoMYPBK5xM2AYU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734638353; c=relaxed/simple; bh=9hRKFs2Z9paofbu+as+4aAVd9C5fh/XVAfao6kHuNUM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=j2p/i0xRZIFQRoEvuctLqk+h9H9qK916gtadTOHbMqIaX3vC6wqE0Qa9nM3V32s8pLaMgc4+52tDnRXVPBRrz9G045SzrZPoJvF1pADY7YhjGUQd3Z4ynFt7jvCf8bsmnUyUkr3r44xY3CAKaz9HzUMDGTyPkxtw+CoFXXQF+ok= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=fpMrF/tV; arc=none smtp.client-ip=209.85.208.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="fpMrF/tV" Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-5cec9609303so1544630a12.1 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=vger.kernel.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=fpMrF/tVQBlS9G1pltUBTSnIEu7IK2qAwYh9r04ChM4mXl1I6YuXswpfgCONVxI9XW 2Rxs6IzvQEkC8ynRxdVvlwGtgBC7PKZsbs2ZngFc+NiJd4O340gELEZIlA3lUS+qztHE qn5izFAMIqeLA4ET9k1u62Wew4Dsg3Bfvz6FRsrCyiUDImqpdVzANqq6IekTmVNKLYxg 55cyQrq2zOH2OOLwKonULXsiXrHb9fkJ/TYzj26NqBIpQpl763jPneuavlaf2PKam6mv ULk3oK8Q4WIXq/Luk+GWEYePPoL5N7KZa+UrmA0BQzqdizeZd6wry9aInPDXCehksz4B 6TaA== 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=k7Uu0nDQ9d4NFDASHbThKA52CrFn3UaF4AIcnu1y99kmw79TiYiJZ2wvv/VqT7CKEn fMqw/Hhmh3tei5i3B2O8f40IVdDHXk1TK7jMhdvWVdUnGP1MBojeo0StKKQ5wLgb2/lo 5NVaWdh60w6JVEyD/eqfVDhyHlybkABOJOKKKumHZ0BRtIy6Bt6cr95hzCr7/PWhdF6S jCx3enCpJBUp4XkD8LgTBCc3qd40xIx7r0qisSJaKFANsQLaGYasVgziIpbzsLegxJs9 Evru9R8HjKxHZ5a1j8YJuPkNxx1+UZw8Z9lvhpe5Q15iX7wIXHjahxnAJthJDRTVfXfP vxJQ== X-Forwarded-Encrypted: i=1; AJvYcCVbQtEPt8qi+PXYGgqq19NvNCS9PArw5P5BMzIqdeLZ6k5XU/jpoaFJIu8J0zN0GmxwDktye44=@vger.kernel.org X-Gm-Message-State: AOJu0Yzvr+/nRt5HMXPCpJDGLPe5pfOMghWVwpu0jAkLSsEiY5GZbv2b ZG+JWfa1n/1qkyAiwpd8E0inGXVmJqGIDtFrpEnPku+w57Dtza7HX5lvOIf2kv4= X-Gm-Gg: ASbGncshQ/cbR9ETq46AQYdXEam/tGAe7PRmiw4sejQ91aTzJpkw6GTvBTdCqK/2ZIC hYq6OQREpmXZJDLrrT5YkDupl9xKupFkVr7juFNChQnNd+H2YWGfjy2WXPGgEeM9RV5ECMv7pa8 n8EWkSpSsx1GltWbFxqWXO2JAiaxSglJD5cq8QtcCtWhY0y3b8+sLHtk8tvNts4kT0RX9uvt5wV TfwMEbQXue9fV6PT0wztZ6YwdSgtCRnMRVMpO9SQ0QLN1DZmA== 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 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13915695 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECA321FF60A for ; Thu, 19 Dec 2024 19:59:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734638355; cv=none; b=Rma5UYwyr930UCFV2FK8lcPmh8KsmngO58rXzB5PRSkRZRoY4UkrSKR9XHSLGsnUOLIGfoxqjmevbrPKCR7+D/tUf3M3n8PAe6ti12Xc6QBxcO5TWYQw9+PP5rHxzPFupb7uNbE7b63UGPwUlws2Dy4grm5Rhbhb82MqIz1Tib4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734638355; c=relaxed/simple; bh=QvPC9XT2nTzuBVKU8Y0OkYtXeaFjH0JRpNZRrR05gzg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V0Gd6NlYhvnQ5DEmIiX97u6aQm7g3NVza/TOzMVGIaRNOte747h60GLnAlej61lkhWpfwSvo5qQG0EHiQpVv155fG6I5h8MDYlwB5JFRzsbhAZAAyaqzo35FZLrNM5l1Toek79ff/n0xd18mBBkAlmfXC6kcCVIF4tm1wmQ+b24= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=SnLw+Tf2; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="SnLw+Tf2" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-aa6a618981eso205173366b.3 for ; Thu, 19 Dec 2024 11:59:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1734638351; x=1735243151; darn=vger.kernel.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=SnLw+Tf2rZViKlc+V7t1D8e3z3fpd1uD5s+SJUFoXd0UkHTZTNaoeIl/79r/YbVXep aIPDHNvrTkifvkVIVMTvKSKjd5jFvigE9sqPq441WgLbFPJjfJuisotqxVqjxKBSHA+a dUBnNpadWjhUEz/yhs+tNl7bkNmohauxrYMJla5JawiRNEgS3Ee+loZPREnPWD5lNmaW TGe6EaEnm7loaINWiu/j0vl0Na2OmvC7wxpnT6GU6CHNSUoFYFMRXOPa0rOVDbFWMeqP SqKulM/EUmeUxZHk8WLcE26QrI94V43tje7BfPu4AMHhaOX3HT6vx4qoWPI+3anQrThm H6Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734638351; x=1735243151; 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=C/efaRkER4eWoHRHWSE+tFJdr67HUEbBBB83FeMfagNnAnhofY+mjUNSKy+17FIIv8 vLj4jL3PP6T3GriqjEGUnlN0xEpNgeqbc6ZH5hVhkTa3AxXDyDpD74fi+4TP6zNV81y4 IiC55W/Rkru6pgDF0Z1+4/2LleIbkQyt5JrsZzxi/optNt9d2enrCBdqYeQD/BgFT92k lgSuqJ9VkxkZ1JO1ARhhqKmc+WStnSIl5zWuch911juhic05qKmAFEz5IwxCPD/QVJG+ naNzZBIP3yABNJuEaZxAul/jIPsskoHd9Ul1J2EQ+feeipSryyZB4B0//bUcaFT60bJS gx2Q== X-Forwarded-Encrypted: i=1; AJvYcCV2e/ovb53LA9IMnfpbKPNzQ+sqA1Vaurn6Pdj531GSL0jt7XusCbRqMRz5pQW9mB36ypCBhfE=@vger.kernel.org X-Gm-Message-State: AOJu0YwcpBvL99fKm4DCv+KIaA9xWff30E+yyGm4uKhswCm6JmHrcIKA x6vsZbpGqlaOD98TseQFIaJ24c0RPDUjxmtDbExoWVR02zB6Jj8t+D1qeXfiVEo= X-Gm-Gg: ASbGncutxieytLlXe5EF0PEeUQtAxfAQ66bOG/jFM1Ci+ZsUCwGl/vDM1RbxctkWeUx G5aWx7LWLoYTNXRIzWsUG2zjtwcWmn0b9osD0VBAsVvEPDrLmx4nyLlpakbos+DZJv8Qb2KHwYC wE9FR7IIdIuKdtIRDHboqxIqVEwHIXwFfGKW+R1xd7oJqCr/giICbJtYtK2Q/j0RGNSZEtpEDnM oFiPIt1YbEOF0TS7jix4SKgJBFU2qwX15U8uF23hP5QVFbDeQ== 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 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13915696 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B45B51FF7D8 for ; Thu, 19 Dec 2024 19:59:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734638355; cv=none; b=GKg8IOEEeefWnAjp8fBvJ9a6ZheSn4fOTKurTIrRYv82fhEbXPjbcVGvahHNfRQ7pnEV7fHYexSoyJkj2W/b6ZjeTh2hy9TcMv007jCkW2Vmq8FJg38GOvIenGytorQXkYOPu29LOdBVQNjLXbvSA7ELrkjvXcelVztm3R5YFfc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734638355; c=relaxed/simple; bh=gIDyCYJjlCLFkyL9Llh35tLNtJDT+5TvpttgjdY3QDE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hFNSGGaaqM0BgXYOQ7fG33E7bP5c5GQjRHu9DhQfpG1gpPUy07/x54tQNbuRSK64hZ9vDmKLjxEu6QLDR/bcn14eXj46worY+a6chVF/Hc2jea3506r5xyMEcDZEWZvfiuB1dqAJy6rIBfwYQMEHbV4RXX19YpQbekvXFWEvLSo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=iXWfhIqy; arc=none smtp.client-ip=209.85.208.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="iXWfhIqy" Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5d3cf094768so1915298a12.0 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=vger.kernel.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=iXWfhIqyYW2nuWWXCWCPx7nkpqAPliTEzhpRxUZFWoiWl0asvD8xf78ZQ4pn6PJEt+ IYJUFch5eYTeukEV/XwUMlcNXB093Q2qLpYjElrPtxKJz0LFsTGuNyoy9/Yp9/KyhMh9 Drm+aNzEth/aqaU/r5aKF9OhzkWuTk4pxcBvif6SMcTYqF6oL5wcnjdJQ3DL+ZTvn8Ms zRr1ioQutsyF68GXPgburpgSxdM0ZTtZdlseOdaiZ3wWH6+E9QMgOP9s4hqE9/dv8Rki oinW4l9XAs4en7VMpQj5XHYltd5jzPvlabuIAIdxelrxSmYZJpYNWERkwq4aSeVK1eEE yXEQ== 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=PGd6AqA5c6DsS1jnMkuYnQGumy1/3i4RKVPPSn3/o3/7UzmzDDWQLH8qc9z8n/AQh6 H+kVqdkfTtp4B4ivbsZL4nOdzNy9Xrg1MUnhkUsClzvoAG6c0sc4njzUbpOWkTMShWle TgSd8WDFUY6m0LZ6NLo+g+RfY8ytbuRXKqkpPWVEXLw9YrL66AbxoCjtKCQMIElLYKhH 3fV+bAi1nBjoXnspW1Ha3DVkWAryPvmDwLwLYpflXxrf5Y2n8D8mpWn8vambSE8lz1lq bE72GYHdogkBvix+w3UJMF67ELhCBpUFmcPhQoDet/1O5iUvt7brDykiacXpeg7+FiEh R/Nw== X-Forwarded-Encrypted: i=1; AJvYcCXPDWWGo6waYNdtqRQiEU/3c/DxK/CB/y7e0OKPu1xFi/VLADJpBhjvBZoECJNvP+nak+RvV3Q=@vger.kernel.org X-Gm-Message-State: AOJu0YyieznKatMYFv/ddnoUvXv7ffaGHA/bDvb97D+zbsfrjmc9J+ar b6jFOxaye4Kh0tUUrOAxbTPbwiTVVN2jpCRjqwETR893BwNXgyMbEURZI9Ue8Zg= X-Gm-Gg: ASbGncuFpjewUzfiNc3OvqNTCZo7gWdRFMeqs/3cUnwkRH5Vl7KQeitUiolajzcvMM/ rjJC9MBGFmiHrcx2XvtEUoD3yqCFJ9Us4a7hLnfzzT+FM4tFu75GOKDX36uBsfdBGJCg60tTI1T 0iEGMkhD+s4J7LvjCSqiUcShRmEI6ZaL6tGhotZzvG+XDMfU3mXQv+PaAIOXzO+XKZhb1iuwcOU Ph2cLIZjv75oOJGie0T9fLUzszjGZCm1ftXrwfXNS3bUumyKg== 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 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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"; };