From patchwork Tue Oct 15 19:15: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: 13837067 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 24F06D1F9C5 for ; Tue, 15 Oct 2024 20:30:47 +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=BosgQ+kD0H5BJCs43wOOr0oQ/yjsIN/cdckDvbryFCI=; b=zToJdQ1s7iZmUM+yFI0zZpCA8G 4gBloTv7kRdp/HDwrJR/Iok7hG3fyvTrmCDuBez72wccw91ji7WCBa1lUDGkNiM3JH3gpPovB0PuX X2ZEdh/9fLxazl0zmz2Xi0AT3C622Pd0pQJsJlzlXu6ilEDS1X/a4nGfZJXmD6RxQyEWHrIW1nbAB 6xhCn9JJ4N5pOxI6SB9EE5zzOC5LS7VhXAiKi3QDnFvynARGDBj3QkTqnrw4Q4QfZCPcDU4NPUzL+ e8I2gow+jBUuBvCcjZeDkt19ZEO3bvbbzm8rQBfVJ/2r4im/TFGTpYdYiREb6so+Q061r+V0j8bZY YY9x9Fpw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0oBg-00000009W92-2g8b; Tue, 15 Oct 2024 20:30:36 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0n2f-00000009MRm-0Xai for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 19:17:14 +0000 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a99f1fd20c4so539443366b.0 for ; Tue, 15 Oct 2024 12:17:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1729019830; x=1729624630; 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=BosgQ+kD0H5BJCs43wOOr0oQ/yjsIN/cdckDvbryFCI=; b=1KnKUBd8ZDhJPM41TelDXrQVLjZcg7n44du4v9bwo/454owQpqfcAH+H8RTQ8a4BoF fz+rW3kKHlhP3zdIjhTxAirUiqqkliI9nzAdkCiXv0F4Y3tB48dIm/xcQ8xBJ09vT44l D/BsvFeFwMfRjFWOx2wwUagDy+BDlBE9D1ZiJVSlwMoQD5DGw1fPCrdMv/KuArBgGWFS NGaIOBBsT5wBtMb40Z+ExX/dTyz0+9q4Yrcxia/GDNPU3Arbe4/96pFzil4KCOP9xhiu gHV8LwOJwHQs45c2cqPw1V1fYNbj0iC8/NjaOK7Co6gj9VlrEWjwThf49VQTTi61Qg+y llDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729019830; x=1729624630; 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=BosgQ+kD0H5BJCs43wOOr0oQ/yjsIN/cdckDvbryFCI=; b=B0zvMOirkgw4Jvy9v1Xz9nUG4/SCHVLEy7rHL8J38Shk0XTmI9TV+ruvc4i24VRTaH dC/ZwbC/y3f+IAwzLiqXVVxtAdcaMnweeMvoYdK5uLp1AcWYQwhZQ65M+nZZyJgrXRrd ElVef6NMid6h/yUv7HlzTdHWPgDDl041lNN7y3ivm0SW5nlDHlgwPG3xII4eiJuJXgJZ usJkRhZDTby6+/FDQQD/63cPYffUFzhxiuStMir4kBcWlfP7b4az53RRaWPVHXyjbk7R NroN01PzOYHNBqPZGv3xrnWdnr9PyXcNjxaiG5ykLTpMyH3okjvHK+ZQKVY6MwBH27Ms tVzQ== X-Forwarded-Encrypted: i=1; AJvYcCWbcL8lGbosS/I1NXtlIpdDhsXIgfZdEX8t8osGYH+5WoYOxpB6qnRYx/ZXpuH2qDuE0Bhp6vFBIufMbSH1+5WE@lists.infradead.org X-Gm-Message-State: AOJu0YwBSEtQdfJPRBsrDis5RX4EHanbjlqWXFk7xMAeNRCF5EtBUp9z Ra0+KPkL6qLCUh3BFUEZhFYLi1wniVHtUllOUCzKbeekaW2fK3Z9J91gpBlau2Y= X-Google-Smtp-Source: AGHT+IFsYtA77wAuh9nis+Oc6a+Lfq19dmpQld1Bd4sJ531FzQwGqpJkoSD0d+dwGzwE0A/GIUGxDg== X-Received: by 2002:a17:907:7291:b0:a99:f4eb:b7ee with SMTP id a640c23a62f3a-a99f4ebba87mr1017022866b.11.1729019830501; Tue, 15 Oct 2024 12:17:10 -0700 (PDT) Received: from localhost ([2001:4090:a244:83ae:2517:2666:43c9:d0d3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a2971a51esm101941966b.37.2024.10.15.12.17.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 12:17:10 -0700 (PDT) From: Markus Schneider-Pargmann Date: Tue, 15 Oct 2024 21:15:55 +0200 Subject: [PATCH v4 1/9] dt-bindings: can: m_can: Add wakeup properties MIME-Version: 1.0 Message-Id: <20241015-topic-mcan-wakeup-source-v6-12-v4-1-fdac1d1e7aa6@baylibre.com> References: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@baylibre.com> In-Reply-To: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@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 , Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1874; i=msp@baylibre.com; h=from:subject:message-id; bh=Jw+WdBzdeJ1ejN6JFooZdebJTss0hVEiqW0IkRTOyf4=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNL59rcHTtJ/VpO3mLlHjY0r6UKy1A873eMXXD+4bivaV Ki43HxfRykLgxgHg6yYIsvdDwvf1cldXxCx7pEjzBxWJpAhDFycAjCRr8YM/2uytik0z7co6z+5 f/NiuZi2pwwypzN/bHXdcr3Nb0XR61uMDP3xIbNWWVbbZBsf/XOsQtx5goxrOr+e+ryluV37PbJ OswAA 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-20241015_121713_205264_C3703397 X-CRM114-Status: GOOD ( 12.82 ) 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. 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. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Markus Schneider-Pargmann --- .../devicetree/bindings/net/can/bosch,m_can.yaml | 18 ++++++++++++++++++ 1 file changed, 18 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..0c1f9fa7371897d45539ead49c9d290fb4966f30 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,8 @@ properties: minItems: 1 maxItems: 2 + wakeup-source: true + required: - compatible - reg From patchwork Tue Oct 15 19:15: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: 13837066 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 53C81D1F9C6 for ; Tue, 15 Oct 2024 20:30:47 +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=saDUfDEJR0b1bnX4tkk4rHbVAroR4qkyv+y1+fjCTpM=; b=tVk7YBx6T3osznYjlEKe/ATWR0 iVt4oaIrKMDsmBj49tS3DCQIoR5hcBeqm9QbgyW5XnDyfSRYJWPFmms4Tta0AQZsLg0x2Y/3o0c3U r2Hmgq5bmxDAEGv5TNukmkFwoTcLgemGAwg/Y5EFm9sFB2ZRIVbAh+HqSWm01AJB2khIdlZmpOi4E qj4b+ALmg7hY7mVusvqA5mPLXRs6y4vU8BIYY9fe4beKzqogT+agnHvhxD0oTImevH6ZVIP48//DH Qt5Ad1ikyUG/3JJYSgtw5gfNZjS+NWr/mf/kQUjCnK6AD3gQePJGfpJV3nfgca3qKxqLFGetkwjij FXOKBCng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0oBh-00000009W96-2EVV; Tue, 15 Oct 2024 20:30:37 +0000 Received: from mail-lf1-f44.google.com ([209.85.167.44]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0n2g-00000009MS2-1l8F for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 19:17:15 +0000 Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-539f0f9ee49so3149312e87.1 for ; Tue, 15 Oct 2024 12:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1729019832; x=1729624632; 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=saDUfDEJR0b1bnX4tkk4rHbVAroR4qkyv+y1+fjCTpM=; b=SBcEp9KQo8U51eLd2zt8MsDO23lccrXbosY4N5n7IixbeGQWdndBdADlPjunHmnnki HruGsNYVnv4z0Z0Z8qdFGf1VSST0LDn65PGGWN3SZMgmdQJtzWHyA8hRc59QgvJv0XsS bG9IevYccv47/Y7opY86olzLh9CsBRY2x/GwDexfd+tGuP0xfXrJtXrK5RQNatiPJzxh s0g2epxMnsxjfqb3ST7Fc1OQ3c8qMYmQnSl7BMwyORM3R28RjG1MaI/Oj+PBoPcjrkdi dCa350PNGnwSxm/hRq5r6sEYtSuhcOkr62UbRTVrx2A9IslWXpLguxxSObOCazWIfpPk Ld8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729019832; x=1729624632; 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=saDUfDEJR0b1bnX4tkk4rHbVAroR4qkyv+y1+fjCTpM=; b=jGGqQSa1aDSQU3j4XKRrt+nJAzF4/U43ckpsDWX6GEnR4kldLcigxY5Nu57/n7M1DX 6heltvkj2xoN8GBcUL1Sx5Yk88wHlzr4Ikrcm1I7vlZQtXu2vlMFFwfLjifmIdRMPnu1 OHUjnjUReFgahZRWEmSk0azTyX+Bo32jsbEY9jS746aL/nccNrBB4Acxv9EwXDTaWaax Bow4DcmcO7+Te1B6779SxPnGLGpwaLBki1k6pn0OofDRAomQUV9+UIkBZ7W+ynFARxQA Vy0TNM/cuMEYoSwLe8MC0EXbaFVpF/iq4j4VIzitHAkRydSo3Cmu9WqMLyge0UCIDYHS ULSA== X-Forwarded-Encrypted: i=1; AJvYcCWVJ/RC2tC2vFbwkiyYmSREk0vOn3FdE7qPk+gpt8BBcTaW/kEav3oVOJTnaD10xB1jiXe0vstDPfEm3jypfwd+@lists.infradead.org X-Gm-Message-State: AOJu0YxABJJy0j23bcUNhbSlT6t72uBilNn7qp8A21ZJ7fyWvKDGJ7nS t633heorjmKjScg7WX+4FtpUgPjKawCWWVQL5wkLgNesiEgxe4jo8fc+hTgoo0Y= X-Google-Smtp-Source: AGHT+IFxGivhAN/nSNOoLheyHq+ARNplWEmPyvbotn4tEsxOfN/CTNRV/WQq00xw7zNxKmVZkX8xEw== X-Received: by 2002:a05:6512:1599:b0:539:fd1b:baf5 with SMTP id 2adb3069b0e04-53a03f18d61mr957911e87.16.1729019831697; Tue, 15 Oct 2024 12:17:11 -0700 (PDT) Received: from localhost ([2001:4090:a244:83ae:2517:2666:43c9:d0d3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a29844cc9sm100891566b.182.2024.10.15.12.17.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 12:17:11 -0700 (PDT) From: Markus Schneider-Pargmann Date: Tue, 15 Oct 2024 21:15:56 +0200 Subject: [PATCH v4 2/9] dt-bindings: can: m_can: Add vio-supply MIME-Version: 1.0 Message-Id: <20241015-topic-mcan-wakeup-source-v6-12-v4-2-fdac1d1e7aa6@baylibre.com> References: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@baylibre.com> In-Reply-To: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@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 , Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1211; i=msp@baylibre.com; h=from:subject:message-id; bh=UPDN5Sq6sr7oOOH4G9BvBLb/9GgPBe4IrDFtGwTay8A=; b=kA0DAAgWJIy04tQVrj8ByyZiAGcOv4yj3tsKAl5GXHqokb05W6ep2N/lbn0I+W8qCDj1wuDdj Yh1BAAWCAAdFiEE3fCh7n4e16BYruJBJIy04tQVrj8FAmcOv4wACgkQJIy04tQVrj8loAEAg7v/ fmMlmA9duPbbiOawXOqpUc9t+28UBJWyEe/V8oUA/2oR68+3s4nCZte+s7g225dGBOOf9wokyJe BCw4WQjoO 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-20241015_121714_493279_9A6FD9A1 X-CRM114-Status: GOOD ( 11.07 ) 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 The m_can unit can be integrated in different ways. For AM62 the unit is integrated in different parts of the system (MCU or Main domain) and can be powered by different external power sources. For example on am62-lp-sk mcu_mcan0 and mcu_mcan1 are powered through VDDSHV_CANUART by an external regulator. To be able to describe these relationships, add a vio-supply property to this binding. Acked-by: Krzysztof Kozlowski Signed-off-by: Markus Schneider-Pargmann --- Documentation/devicetree/bindings/net/can/bosch,m_can.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml index 0c1f9fa7371897d45539ead49c9d290fb4966f30..aac2add319e240f4f561b755f41bf267b807ebcd 100644 --- a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml +++ b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml @@ -140,6 +140,10 @@ properties: wakeup-source: true + vio-supply: + description: + Reference to the main power supply of the unit. + required: - compatible - reg From patchwork Tue Oct 15 19:15: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: 13837015 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 C8CE8D1F9C5 for ; Tue, 15 Oct 2024 19:27:23 +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=mWNsNiv/VcA8vMctiIZy19xLDs/iPmWut03+H1meriQ=; b=Czp4tAaA70FLXiafQX/97yR+iu fEznKzHzyxKko1FiswlG5FfT+MLyBZGXFaoIwpYTCB20Ua7iMSIcPJSzvsBVc9kmzRlC9e5QmteN+ mmmQIZKVvb3vH1IP/yj0CZjV669unuumkwLUTWWeH2VtS7gJeLrQVeuDooVJunPUjuZwQJJC1bbqb y6Mo7JztUmg8/kHAIq/J/N0OXJjy5Z9tYDdZ0q5OKHwbf1O4NxEQh4Q3Iv5Hw8utqJosl9HyD3P10 YqFTrj6033T7XF7Jr+D6IpKmn+LRJrRLk0H8KfC6RtVAKMIktgdzq8ADDljFRhNzxoXWWK656pFZo FdTJ/YgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0nCM-00000009OH5-1hzG; Tue, 15 Oct 2024 19:27:14 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0n2s-00000009MWE-1049 for linux-arm-kernel@bombadil.infradead.org; Tue, 15 Oct 2024 19:17:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=mWNsNiv/VcA8vMctiIZy19xLDs/iPmWut03+H1meriQ=; b=Kh5QNDXfQswFKb17Fu3r0qH/2z Vc3/IhXL5Q9yscUMhseksHFDJvC+mJrghnLkZR8OnGiuDfpTZB/6c9mAL3/eIslfz6hYsDgrjVLr0 xQQRh1ZssJG9T3938pjFJXoJhMVqOrj/ab+v085SlcGXOYTvJkuoQRpFvp+zE98UJKz6ryNVv66EA OXXd+T6GJxQo0Tj9b/2o+IjRPoLuuO4AyDi1RcGUGOni4nF6xFupaXAamq/D7TuEy6qfmW5l9aTSs R3ihPaL2ylcKJmDpbHX5CHCT0h14X0jKR74sXxCS3iKbPmOXnDg3h8OHg5QDyQHTKKAIRS5ARP8wo VCueaTtg==; Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0n2h-00000006dfh-2IuD for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 19:17:19 +0000 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5c903f5bd0eso8704791a12.3 for ; Tue, 15 Oct 2024 12:17:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1729019833; x=1729624633; 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=mWNsNiv/VcA8vMctiIZy19xLDs/iPmWut03+H1meriQ=; b=wfCwu0+08KiIn15k20UyhT1wU/906Jym/sg8Kl8sQIPoc4TSsfISYKay+wolVw+kI5 YLdXxBXFnslqFN3vkbGKo9QgdisQsYff+q6nVuB07f0FhHYiLBRp/JK64gQi6PNJrf+E ZelgU0vVyAtgXmH7ug8K4JIvvpek9gdPcp7NIkmR62B112uUgUkyeyCt6l8U8Ex2eoh9 plMKxif9w9qDXKGD+3vbKC2+QpdJtCLbNAYv3lKjxU4znFxIeL+WLod69Mf9K5xJulPg Z+RuEvKEYqsrjApHbxQfQDIX9VDIXyFkSpUQGy1bK8PrdO/pfQgNrJi0COIWTKDjg9Ll 8Tww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729019833; x=1729624633; 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=mWNsNiv/VcA8vMctiIZy19xLDs/iPmWut03+H1meriQ=; b=Ixwp0Tv2r5uXiJnfSLK8BlyBOxLX4173Oe8XD+zzo9VG+B2OBxXCfZgVeSBdTTZ/k6 iAoQu7gmOCmeoRglzTXdxynKbCQEoJZLratu0cmG2kRGYHtzq4NOOcjPx7DhvNfaLLfj QioCz8KFKc/+CauFHr7cDYILJFD7jhNYc2M+T0nAM8lMrLEgdtZPu179Pw3YPJmVEnFn XgvW+QDeh3+SsbvTxozryCteSU3LzkbNg1ouRwvvgluoBZc/wssRQhhxnZVpZMzpcG46 sD/7xo6NRE6U6KU/SVR8L0dIyfgEjQc7R+QLuh5HJ8NjQc4SFvdhNDXnRVXkXQ6bfpX3 2F+Q== X-Forwarded-Encrypted: i=1; AJvYcCVEV3X9uKj/p/vIOpiqRmR0BXPWfQZLDRzfp/pO8MvxpqHNzHmgFUXoy7gC/6cVfMJQHrPVvzidZ7hK8T1fz7EU@lists.infradead.org X-Gm-Message-State: AOJu0YxHuTBCsFQz9tPUYASABLcwVKtUf5AI/UWffGP2zmb6C7Lr02HV FJ0etKrjT5QFhD1HirsLwvtOS46JC7B0TbxpVzo1TtZ1iuMp+Z80G7iX07jNDts= X-Google-Smtp-Source: AGHT+IG6Wi1Y05CbHfGWTKc2Zvkf+SR2UYH5CumYtIzfZCX8f8wWHAG3iJhGVNaioMcvfL42erh2WA== X-Received: by 2002:a17:907:94d0:b0:a9a:e2b:170e with SMTP id a640c23a62f3a-a9a0e2b1ab5mr793919066b.10.1729019832936; Tue, 15 Oct 2024 12:17:12 -0700 (PDT) Received: from localhost ([2001:4090:a244:83ae:2517:2666:43c9:d0d3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a29843374sm101011666b.157.2024.10.15.12.17.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 12:17:12 -0700 (PDT) From: Markus Schneider-Pargmann Date: Tue, 15 Oct 2024 21:15:57 +0200 Subject: [PATCH v4 3/9] can: m_can: Map WoL to device_set_wakeup_enable MIME-Version: 1.0 Message-Id: <20241015-topic-mcan-wakeup-source-v6-12-v4-3-fdac1d1e7aa6@baylibre.com> References: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@baylibre.com> In-Reply-To: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@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=2797; i=msp@baylibre.com; h=from:subject:message-id; bh=u3MS8m9UeG/FKMz+2aOKCV8URfG29eAzix8kKH+yzxk=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNL59k90PPz83/zbxmZT0q8prg/tYjDLUb7E+uH+Ke9ZS Uq3Dhjc7ChlYRDjYJAVU2S5+2Hhuzq56wsi1j1yhJnDygQyhIGLUwAmIv+N4X980sdAKe+fenOi BPbcXe81x0oilP1I45oVa5WXOBxoP9/IyNDGrD/7x7TU6bdipAy7HDhEikS1Q0/v9ew/mdkS1qO nyQYA 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-20241015_201718_083478_F01C00F9 X-CRM114-Status: GOOD ( 18.01 ) 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. Signed-off-by: Markus Schneider-Pargmann Reviewed-by: Vincent Mailhol --- 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 a978b960f1f1e1e8273216ff330ab789d0fd6d51..d427645a5b3baf7d0a648e3b008d7d7de7f23374 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -2185,6 +2185,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) != wol->wolopts) + 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 | @@ -2194,10 +2224,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) @@ -2324,6 +2358,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 Tue Oct 15 19:15: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: 13837014 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 6E37ED1F9C5 for ; Tue, 15 Oct 2024 19:26: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=I+gZxIafqFrR6BMcHIhEjszPUzk8N9qpO7jS8LguSsI=; b=yKxcWseEM/M83pwpro5FMzcOsc PB9+n1Op1HNC2fgW5TPDkjFvNkVK8MyFrFoLVjI0eo82EKCBQw3muY0FUX3D1vXq4zpiFD6cV+p4L ekTLYlSHqbRlPFZg0Bn6XefF/Fz2kVXHhMZKgKcjtxSaVpszJA61Iecl7Rvfn/wuhgNVYYBPxlqa8 KT/cel/29XIhMzZ312NQlwZFUblwS2MHqggY8yyMfOAU1aVJz1z3fi6MVbhESF8JjmVrMgL0Gj4EM hCOW3EHXhlOad0tpimv/LiJ0B3+o7ARNrarOeig00y0Ja+V+MBWYYRZkOSCLa51+FTpIZik8vLmH2 tBLBtiFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0nAz-00000009O5r-3bFZ; Tue, 15 Oct 2024 19:25:49 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0n2s-00000009MWF-10zB for linux-arm-kernel@bombadil.infradead.org; Tue, 15 Oct 2024 19:17:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=I+gZxIafqFrR6BMcHIhEjszPUzk8N9qpO7jS8LguSsI=; b=oWOZFTl7E/L/IwCRTDWjaxQvqV S6GuTyQDUBDQzFZAHKRdWiX3v7Q4/YAx8aytK5PrEML6swMqs8ItulffROExgEx7pA44aCqPyw4ES v/N/s/KBm4MNhm71vlscFjt3huJ6h8gxWDirNjnIAv5uKJqmOPV+tzn/DoaxeVc/9xpvPNAAEyJlK M9wt7LzEH6i0Ao2WRNtj5WISzxvSpCCjgMgM/7unaiXPy8n5qIAOq5M2ViY8Ukbzo7XOY3hJBk5+9 jyQSRyOw/3FjMAn1c2UUf5wa+Iw6AvdWXlEKVWNZu7s+kqqScpPF8Wv2WPahsgoKATIWBIzcKem8R AH3cuZmw==; Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0n2j-00000006dfj-1lTk for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 19:17:21 +0000 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a93c1cc74fdso946006266b.3 for ; Tue, 15 Oct 2024 12:17:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1729019834; x=1729624634; 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=I+gZxIafqFrR6BMcHIhEjszPUzk8N9qpO7jS8LguSsI=; b=FVgKiZiaC3/CI1sWGs/2gUslsqOCwQgQ5oCrynV462PwiqPbweb998SSx6IJyZPvLC 93E27/cin1aVowOaqLsLxKFY/EpKr0MDBxlyUn8LgdWoc3NaTkn+p6R6zrlEDIPx7W83 DCBmMIo3FZMrFi4yVPn7RrFtlqGo5dMkB0YJUKbTuBF3I6a2SwT5AlNRRfnsLBt1FC5C shuCLosv/f1unQq3IMSQPexrGMhr4ESDm32OMHjnUNWrXJOs3kZfhsvW0ZyPamMjTzLV zgkTxmTZHUE7I9zhNFna8Yd/mx4nW8Txz5O9OFz4FAKZgKMIqXnLVnRlvJpgmOCLB/Js T6dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729019834; x=1729624634; 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=I+gZxIafqFrR6BMcHIhEjszPUzk8N9qpO7jS8LguSsI=; b=BnDS/7icSHUPnUSqaKsNjPglTLvKVbjn7yyMaLYW/HByDIv2ZC6UsZUabV35KXQvrD on8gpIMsx5Ih2a+c61VuClAzNGqWy2Gk2gCnP95eRdWiW6Hmy5M1h/X5j7+cTWQndH0J F97ZcXOmS1iPle1c1KIvq3sL1ftTSYmEQdldYdTfPlFCLU8JaqRLCLNE5bR3cmDuqWM4 nOlt/Z0/+GS4pv0Et+7+UDAsP32G4oq5AnZ0F4bl3RL70BIAhlnWiZtCTZti8NvfqeEr UlpGzZ6f57XyOfaLwWxLqlah7uZVv44C9c3VzB3XejV/pBl3SPhRqKHRyX5DvDLV712g nVzg== X-Forwarded-Encrypted: i=1; AJvYcCWUxcGrykA95pdwrtvED991tIag8jcEh7F10vSd+mPCuCoTvec7MS5eH0evCYJoFJ3gBE87kTEpIAOLNnv/Kirs@lists.infradead.org X-Gm-Message-State: AOJu0YxVG8A+hLDpYMflq0wtVi5uaWrrQ+QqPv+Nzz81zu/QQN4CHi2L dDXPWYOok05Y/PPBWBvxt83tCKiiLMOeEif7Qv9kbJYy0FczqV5YB0g7W+BV0v8= X-Google-Smtp-Source: AGHT+IEnWhyoMdkPWKAnqSZfQ5E35xloBUwyytezjQk7zjPCXojeRmRve/u2bGJ3yuGwNR720ej3zA== X-Received: by 2002:a17:907:f1c7:b0:a99:8a0e:8710 with SMTP id a640c23a62f3a-a99e3b5b167mr1064453866b.14.1729019834109; Tue, 15 Oct 2024 12:17:14 -0700 (PDT) Received: from localhost ([2001:4090:a244:83ae:2517:2666:43c9:d0d3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a2988c57asm101052866b.204.2024.10.15.12.17.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 12:17:13 -0700 (PDT) From: Markus Schneider-Pargmann Date: Tue, 15 Oct 2024 21:15:58 +0200 Subject: [PATCH v4 4/9] can: m_can: Return ERR_PTR on error in allocation MIME-Version: 1.0 Message-Id: <20241015-topic-mcan-wakeup-source-v6-12-v4-4-fdac1d1e7aa6@baylibre.com> References: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@baylibre.com> In-Reply-To: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@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=FuSyoKzeygeLVHKVCKFUjItYDNK1CDXLTHh7H2UiD20=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNL59k/z2Lj1No/cl7I9t1MUPx1QXZx7ecckPVFvB4mmI 2vai37N7ShlYRDjYJAVU2S5+2Hhuzq56wsi1j1yhJnDygQyhIGLUwAmsnEtI8MuIZcVy569Tdhl d/vE54mpLC8EmrNF9zk++LzZc6pH01NORoZbyw0ily0ubKg1lLGYPcPCO03OcfI1x4lTduVd3MI WEsUIAA== 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-20241015_201718_538303_95461296 X-CRM114-Status: GOOD ( 15.64 ) 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 d427645a5b3baf7d0a648e3b008d7d7de7f23374..5a4e0ad07e9ecc82de5f1f606707f3380d3679fc 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -2355,7 +2355,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")) @@ -2370,7 +2370,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); @@ -2379,7 +2379,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 Tue Oct 15 19:15:59 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: 13837068 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 1191BD1F9CB for ; Tue, 15 Oct 2024 20:30:47 +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=C53L7ElLnJx+g4UjgYE4Yk8Jb0cDN7FkWpfutP4xQkE=; b=17y/s2VkQ+KuT6tDUGtWOtPLPG 1fGedoUfyPl34iMKfaVuC4uCeJtCWAvqWhKJr95OwI3gcdWYoiekKzhL0UX3nLEYhZUazIw/XBwrZ KPoKzOvYdKfd2yp+/vjMG+5bh+nmyLakD/Y3n/NNUgy2jMRvIA9mk6a8eb1bopROwd4xFXF1XVeNm 45dMJ0TRGEYK4bTd0p83R0BquwfjPE/qSiXp6I8olYK6JffFHi/HI4LcRsEf5Uqz1RLzmtR1DKSCh vz/tDiWKouJnM2CiQapLLqjydcFTWLIFYnDBB5Je9fb1jG3Uedw97IMjFOEQ905f+3xaHCJnJXHpt HuwgmS6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0oBi-00000009W9Y-0cc1; Tue, 15 Oct 2024 20:30:38 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0n2j-00000009MTH-2A96 for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 19:17:18 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5c97c7852e8so3696258a12.1 for ; Tue, 15 Oct 2024 12:17:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1729019835; x=1729624635; 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=C53L7ElLnJx+g4UjgYE4Yk8Jb0cDN7FkWpfutP4xQkE=; b=HFyW/Og+z/5G+q7dZzr4zIgt+cN8CNqTGjp2+/eejMe9SH7PEizXU1h7uFSuC3BKF0 y9ByhTJq9fb6KlpaRQEQm1uwdWK5C4JCGSlr+FP+cQfwZWJd/5szU+Zkpqdtjvs3dTkD W9pi1PmO6SH/qaDhY1apqmHH6xxfMIeYkxzd5Y/s1Bs1R4RL4vJlLhup/late3UP0Rys 9wwqznr4hpMseV7+HrQ78/18vrxNL0KIPWlf9iZCyPs2dQMYSOjPmzf88o9ji7SEGIDu Tuq7FRExnEhSnDugk3GEKSoL4Wq1vy298sw+CgIqq/bExzWh08zlyrdD6rB+B8dMaYgx +0eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729019835; x=1729624635; 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=C53L7ElLnJx+g4UjgYE4Yk8Jb0cDN7FkWpfutP4xQkE=; b=KqcSHc9b1X3t5xkH8a35o3V7ztAIS80hBbrdLUMi9yQv1tRQl7bDitcNWxMsZ75MJW EbEbi34wbckShjyEtdUnFQ9wB4ZA3Hm6xA6tFby/BKgF8o4jt+UODeZGuHm47dqQ45jh D/y25vjLaFFcqLpMHzIm7wJrDI5kQDbnQqSKClWh+ImAF5wkVSXeQqcMbDcqyRSJX8cS +buhS11F1d9OTeDKffQHjhDkSQDA5iF7mzwuUTCNWLzxtcjZSrgipl5RNfIiHyH48Wd2 S+WkFu4HM1E/9aDivGb33oxCZMShk2b9lJfS8QCQ9OuNAS15kiecvy/TY9NBpPFSFCNn vQWQ== X-Forwarded-Encrypted: i=1; AJvYcCXlp4u1lUepsDDbllZ7mkiPQCF2jaNNJDGC9Tvl0gfBjzX7MGdVm1UVv2aJfWRmX0eVGYCLOdkuYtu1A3zkyysB@lists.infradead.org X-Gm-Message-State: AOJu0Yzsu30fzXHhoYEgAsBCL5JLfxBU7uiAmAX6gFLQXpfoYw0qjmUE n/v6PvVQ0e1Y29GHBn6oOh8aHpxxR7dqnuPh9WEhgXFp98D0qNuZSt14daTqpT4= X-Google-Smtp-Source: AGHT+IFuNaXJ/r/nqGOo1Icj0J/5EWknD2G800st6YUHsrMWW7mRsRlVQykeajKpoYEWh9kT1ftaMA== X-Received: by 2002:a05:6402:5191:b0:5c9:5e43:9480 with SMTP id 4fb4d7f45d1cf-5c95e43f157mr8602638a12.7.1729019835369; Tue, 15 Oct 2024 12:17:15 -0700 (PDT) Received: from localhost ([2001:4090:a244:83ae:2517:2666:43c9:d0d3]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c98d5298d1sm990283a12.57.2024.10.15.12.17.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 12:17:14 -0700 (PDT) From: Markus Schneider-Pargmann Date: Tue, 15 Oct 2024 21:15:59 +0200 Subject: [PATCH v4 5/9] can: m_can: Support pinctrl wakeup state MIME-Version: 1.0 Message-Id: <20241015-topic-mcan-wakeup-source-v6-12-v4-5-fdac1d1e7aa6@baylibre.com> References: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@baylibre.com> In-Reply-To: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@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=4027; i=msp@baylibre.com; h=from:subject:message-id; bh=fXagSgDKvwKb5T6QGKzoWAYbWw5MKKnGO7kvv5dC+zw=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNL59s9uW8v09/SRimWqRdrZTa8f+wvx3hdxjb40ibtyW kPi0VCzjlIWBjEOBlkxRZa7Hxa+q5O7viBi3SNHmDmsTCBDGLg4BWAiTz8yMmyomvCWXXrysZVi HZXeE9ms2F33pGXcrYjQbDRR2r9z4RFGho4nHXcD3TPPxG17WRX4rudRD3OK5KsTb6+y+FfkTem I5AAA 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-20241015_121717_594374_217323AF X-CRM114-Status: GOOD ( 17.75 ) 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. Signed-off-by: Markus Schneider-Pargmann Reviewed-by: Vincent Mailhol --- 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 5a4e0ad07e9ecc82de5f1f606707f3380d3679fc..c539375005f71c88fd1f7d1a885ce890ce0e9327 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -2196,6 +2196,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; @@ -2212,7 +2213,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 = { @@ -2340,6 +2362,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) { @@ -2380,7 +2440,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 Tue Oct 15 19:16:00 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: 13837012 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 8D939D1F9C5 for ; Tue, 15 Oct 2024 19:23:14 +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=sjKPLiEdokQkg97Y4Rb67l893kRgrHE7+ULSYL6zJKs=; b=oooyv5mMdbCyzcfuoxBO2LPQFj T1wvqGBC9goueISby0kfaddELV5LhZjIR8zGYFCWhhKSLnUTyhK1O8svC+Fcc446faCM0C8pLyyqn kiqICYyg5ai16v27HRl0zh5x+gtSABFl4EzZjYlMrSVPjcc4HS83yvSgNYVKeYoy/l0pZWKRIGK03 WKqP9SEry6ABg7kfOZAtSHqnm+5Sk9LIZxd7ufgmb8aiqgerTssRpYaVrG3I0Vr9/jPxD6smyx7tD cvD390oKs6UUpOpjbTvXLDaE8l0NgT/0VapCCMl1MbtbsYVyNHKe0s2ni3lS0/SCvwrm1IiyJe6SC CGxE4b8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0n8D-00000009Nc3-2NUy; Tue, 15 Oct 2024 19:22:57 +0000 Received: from mail-lj1-f170.google.com ([209.85.208.170]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0n2l-00000009MTd-199W for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 19:17:20 +0000 Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2fb5a9c7420so13788931fa.3 for ; Tue, 15 Oct 2024 12:17:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1729019837; x=1729624637; 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=sjKPLiEdokQkg97Y4Rb67l893kRgrHE7+ULSYL6zJKs=; b=HNCmWU2IkT1n0tCT1T4oT5G/Lbgi3rARcToeJ+SHHm0ci60hOVkXG2KJy2W+NMlzwr bJ5TcFVrA/trEvEumG8n7mU52QGGWKsYSJOJBf8o066X3qVyG100ijANByagdTH6CrMK wBvpBZWReymjzTOTmou46uQjkMoJvtyQNKUGnxQjUqL11idZ6PtELZ+JjIBcj0VBTGCf rfENche8y6jfRsqq099FaOpk84esnE3VuxX44cvstNIBe5qyIGew80i8TsZTG73JD8AR RSkGdlKRwz3GREQWIdV3/+WxtRXEfZAgC11Bll1xlEfwFr8R9ROXAxcTmk2PC30Zui3y 2ymw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729019837; x=1729624637; 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=sjKPLiEdokQkg97Y4Rb67l893kRgrHE7+ULSYL6zJKs=; b=cQS5UL1qy6w+5QMsEWE2TZ9fJFrzsRrQSmyl/QO2/usMKYeTe68VEvXiMDnpE2qsJc LvaPA/pkE0D+d2Xk1MYLu9Xn0/3D7NnYhJLA9009o2WN/B9uemqMj+wVkbq69LrizciT qCqXwOpEhfY/wsyBdILtjIX9W1CYPaCImyHgS1iQuubFS34KFro6vSblT/YQhSUcOnQf hsOqw0ATsZBy5cHMuivAASuqMQzaImdyTUoiWZZUstpIpty/CatdR5Qs9bDGH/D1pPPv ecQhn7CD0LBnPaLCavsmBaK3h6rqtLRCPBw14X0ukOIvlU+qzfUeWCSy5sBL4or0gzaG LptQ== X-Forwarded-Encrypted: i=1; AJvYcCUP1d3z0K/Kz16nug7GpZxspHlxcp7FdX7v+CoPg3rAp8uJ/X8MwwVEjtbeb729URFrktM5mvVvB7QUoM+ikSKg@lists.infradead.org X-Gm-Message-State: AOJu0Yy9Smz8noSlfWiWZ8/zTX3Mfq4KEvlHezxBYS8BDhnAZ2txkQdb e1+JVjY12yCsl/Luhi6+Tpay3A0sfr/Gvc2SfAFSo+Hrr81/b7oyYuUggwEFSbA= X-Google-Smtp-Source: AGHT+IE4dzRsD/tCQ28U43nJXbo8BVQgpvc+e/8APYlr/mwBjZLsFjDakC3/JIU6v1rQg0lg4s5rnQ== X-Received: by 2002:a2e:b8ce:0:b0:2fb:c20:dbc3 with SMTP id 38308e7fff4ca-2fb3f2edde8mr59233971fa.39.1729019836565; Tue, 15 Oct 2024 12:17:16 -0700 (PDT) Received: from localhost ([2001:4090:a244:83ae:2517:2666:43c9:d0d3]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c98d779975sm971515a12.67.2024.10.15.12.17.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 12:17:16 -0700 (PDT) From: Markus Schneider-Pargmann Date: Tue, 15 Oct 2024 21:16:00 +0200 Subject: [PATCH v4 6/9] can: m_can: Add use of optional regulator MIME-Version: 1.0 Message-Id: <20241015-topic-mcan-wakeup-source-v6-12-v4-6-fdac1d1e7aa6@baylibre.com> References: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@baylibre.com> In-Reply-To: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@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=1254; i=msp@baylibre.com; h=from:subject:message-id; bh=aipUUq+7RrB1fQczjwGFQJsXFUnND3UwiWP5TZKO64w=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNL59s/XqnFdKfDRbN+T+WsKHVybDbOyYt1kjex0p2ZPP 8fbcdSko5SFQYyDQVZMkeXuh4Xv6uSuL4hY98gRZg4rE8gQBi5OAZiI3W1GhjWPb03bLCHc+rVj 3ZH/zMcOcPNpBHzacP4tp8yJfSt1F2xnZHj2dff7aQv9JK24TzXfzy/8Wc/B2PdyzTW3nvPTvY3 Cm7gA 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-20241015_121719_348773_B32037C8 X-CRM114-Status: GOOD ( 12.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support to use a regulator for the core. This is optional and used to register the dependency on the regulator. Reviewed-by: Vincent Mailhol Signed-off-by: Markus Schneider-Pargmann --- drivers/net/can/m_can/m_can.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index c539375005f71c88fd1f7d1a885ce890ce0e9327..274fdcae49c31d4792b81cdc065821206d3cb206 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "m_can.h" @@ -2421,6 +2422,11 @@ struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, if (dev->of_node && of_property_read_bool(dev->of_node, "wakeup-source")) device_set_wakeup_capable(dev, true); + ret = devm_regulator_get_enable_optional(dev, "vio"); + if (ret) + return ERR_PTR( + dev_err_probe(dev, ret, "Failed to get or enable optional regulator\n")); + /* Get TX FIFO size * Defines the total amount of echo buffers for loopback */ From patchwork Tue Oct 15 19:16:01 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: 13837018 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 7C8C1D1F9C5 for ; Tue, 15 Oct 2024 19:30:17 +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=81ZVnQPK5cdOXNd0U587x7C4r0h4m8ObdC4H2ODABA8=; b=e9ss85ZQa0X1lxM2j3oIRp+n/S m5S+menQYWwJ/5qZRU556D/Q60KQiebWXTshXS5CodmycKVZ+zwdl+V6X2gOvk9KgbrYmOwqgu+ZC MgX8Uyl5SxHqN7nkslBr5Zo9QG7dbvrxJwZghGfvuYRz9f5Y+PQxFR0MmRMBWfCSMW680WTWAqm0/ VBp7UR32j9nxuc3Z1bZIhaUZdMK2PD8Ogwt5mLD3U4jLUwdC2Lh8S/h70XEoerHfIDsvdFGDBN7Yu 9KOU5YfoSQ+d7qq3IHuQyI2H/fJf+6EpuP7EQDwEUiqxeEHgm+supJv7rkC760Fs8UGF44gVid1xu ShNxoVKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0nFA-00000009OqU-1PGN; Tue, 15 Oct 2024 19:30:08 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0n2v-00000009MWo-1jCy for linux-arm-kernel@bombadil.infradead.org; Tue, 15 Oct 2024 19:17:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=81ZVnQPK5cdOXNd0U587x7C4r0h4m8ObdC4H2ODABA8=; b=mNF7EINgnTsRP49YQ0MATszqrd zRX/09sgw5/zPtioN3FFEgjbi/E7svDBXtbAX/0nka9Za1QJFYpHodQGTFj7P/ZA33KEuxYM61loz rQjR7Dr/dnQHXK8itxRjfZ14lsoaEfYbPIjoR6LRT8PRz+LTVVkNt39SA3ECdBgjOxIetfwLEYiYN Xuzs8ArjPaRCROY2dBZmYGO7kPcwB8h2LljTlAnKkRGC0nqPLg3kwg/bAa9KumU6IrmUssdhoP3mb 3Vv+fgDotVck18+CEBPMn4YbZNi0rF9E38pj9FD480F9uTgJ5ug/VwXtfzq2SuxH+2fRDaa1Jt8Ef 4P4fb1MQ==; Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0n2m-00000006dgQ-131k for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 19:17:25 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a99c0beaaa2so765092566b.1 for ; Tue, 15 Oct 2024 12:17:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1729019838; x=1729624638; 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=81ZVnQPK5cdOXNd0U587x7C4r0h4m8ObdC4H2ODABA8=; b=l/1Ce+KPpQvdNqWflNYv/gcX0dDg+ST/KVSFpSegnQAX+DzU7qyHPLm/hHTr4MC3kc tUF5PVwMh1PRbWxfFcnkw7Yxms6wmvej6tQifkCPxjuB1zJ+JerP2Xa3QsnENN10Hbnt G7tBf7TDga5pWz5QIHXDOaq0bAIiA3VhDVJYJP+LKudTHkNrFi7rlM4iC8HxnOYXTnc0 RpgEpqnwYsI+TNF7u6FdrRWmTbFtR5WHNHVWdv1kuxS5Mw0oRxC2MDUg3HCZoaBfH3fJ zt5teAXi2kUtz5/B47Qq5z089PqmmDfj/0sjY2SQ4KtgfUwBBNlSMOUkOovNbUY+761t u9cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729019838; x=1729624638; 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=81ZVnQPK5cdOXNd0U587x7C4r0h4m8ObdC4H2ODABA8=; b=jkkhzAtGH49J35HTZ7Gqcf9911RxnKOPtj7ZdzSRCt9a4AJhkTr2EgabDVEb5nw1S/ JaF/A0jSresX3Nime13rgwkgq1+tmgCAexFmVgsxs4LntkCQ1rfzYG4BA7VNpufZdbWy 2FrDURNlDrmZmXri/2vdNtXSrVVuhhxN52A9gJK6HcqT8vE3iQUuwC3Agg/RmzZUYLhP sjIQgMiY488wawUOBAO4UYJNECjaErE6beJOEkATR/qyYhrrAPg/w2tdkSdveAJv/6bR ll4pdpQa3PmfFDl9NJS4KJh7TIyxCjmPYwoFLXVQsn7zM53Bgza+PLkghH6zUvcVcO8+ ZILw== X-Forwarded-Encrypted: i=1; AJvYcCXkYVQ7UU+SWSiDeBOBgoJeX9O7Vsjm2mbHbmc+eZDaSmSc/JwnClGpGnEde1eDuXwHcn4x6hKvNdemUSdEXrkS@lists.infradead.org X-Gm-Message-State: AOJu0Yw/zYL45Jgz5065H6Mlpe5CZRYC01FAh9gj1ZOIp9ogcFCq/UjC VE2bs8MagjP0KUWzwA1v25BflcUaNWqDE6ffbRrOd21GBjzj5YQAnhxNN6eoJiI= X-Google-Smtp-Source: AGHT+IFe6y5YxcAp7iE8drp6DyY0gA3+wgMZd7L0bgY5EMYWR88rCbdnKDAk49FEAypBphut0IJ6yA== X-Received: by 2002:a17:907:d2e7:b0:a99:ffef:aec5 with SMTP id a640c23a62f3a-a9a34d6e9aamr112640966b.23.1729019837837; Tue, 15 Oct 2024 12:17:17 -0700 (PDT) Received: from localhost ([2001:4090:a244:83ae:2517:2666:43c9:d0d3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a29719196sm102080566b.33.2024.10.15.12.17.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 12:17:17 -0700 (PDT) From: Markus Schneider-Pargmann Date: Tue, 15 Oct 2024 21:16:01 +0200 Subject: [PATCH v4 7/9] arm64: dts: ti: k3-am62: Mark mcu_mcan0/1 as wakeup-source MIME-Version: 1.0 Message-Id: <20241015-topic-mcan-wakeup-source-v6-12-v4-7-fdac1d1e7aa6@baylibre.com> References: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@baylibre.com> In-Reply-To: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@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=1023; i=msp@baylibre.com; h=from:subject:message-id; bh=L5jePk++a0uY91JQrASnpEj/bjSiMyJjUq1CjjPGGl0=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNL59i+ZPGmy1PW/eRuvPTjolT7riMnqP14vVzI8zrkwQ ZTN5MC9VR2lLAxiHAyyYoosdz8sfFcnd31BxLpHjjBzWJlAhjBwcQrARBYwMjIsYM/J0lA7kHP4 Q/++E0fME6Re9uxXntPq4Zd84HR8z+/vDP8Lzq/Z6PgoQWlP5tqAreWOy+cnel2cfj5mb2c653X Jl4XMAA== 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-20241015_201724_072483_8E5AFB6A X-CRM114-Status: GOOD ( 10.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 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 bb43a411f59b281df476afcb1a71b988ca27f002..e22177b9dfecb541e99b0807f8b79e7b878b6514 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; 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; status = "disabled"; }; }; From patchwork Tue Oct 15 19:16:02 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: 13837019 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 2D076D1F9C2 for ; Tue, 15 Oct 2024 19:31: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=p570CyCpET4jQOMvqTRvBlj0hjjJLO72psUJRNLRpe8=; b=Alo3mFNfpnWsdgUZ65Yym5o2Mh LBlSfIAbm8NyYiU63OBSdqxfKGdw4WAZCNWuo/8AAUEKahEvJSOx1r6zwzEEvoEdak7rbfKYvzvs4 S3J79ONT2jw5TEU6Cw6ZSk8T5ricFPQ4VNrMTlwwhaJ70qXyD/qPuaz2iDIoNTbBqLXt0o/8nDa16 nd7Ehe+GhyB3fOUHib6Y1eC1WVqr3DCHNAdBmOnsduFePBmakrcrsSWdlm6vPPPVyNgD9kWsl79A1 eTety8wdD1dY/pkSALVvaUflKXBA7gSKImYWfYvGsxqXoTDnZI+0zb2sdcQTowT6ThVtSCOcwSpjG e+ZS9pUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0nGX-00000009P0x-0SZA; Tue, 15 Oct 2024 19:31:33 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0n2v-00000009MWp-1ox0 for linux-arm-kernel@bombadil.infradead.org; Tue, 15 Oct 2024 19:17:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=p570CyCpET4jQOMvqTRvBlj0hjjJLO72psUJRNLRpe8=; b=AXPZYjjBVGtDuanfeILTcHAwjW Cqd7gEHZepkuzHMN1uRzytKNG46qL8CWxYdeuZgS+qyadwE7Pf+1w06vcKb9dU9klPj0at+lagtsS ivCkTr5ADsPsykfaMckofcekydcoM1oFm2nR3KecQWBwXRDzkMZsYTEp2HFjTXuBreE3HPEDVFK3h czglukGmSkK+ZomSLbmLnX2QyJVouNx1GB5VzX7RzaWRA665W9tm/qG+TGHf1ilnvw4bJXrfkzoZC AHaRhrr6KJ1nybFekhBq4PWDb6kImm/329o0yMwmB5j6VeFXxYmqTpdW4DFWjYXHSYSM3z4hOjwDE WLusmcNQ==; Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0n2n-00000006dgU-3n6g for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 19:17:26 +0000 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5c97cc837c3so3452164a12.0 for ; Tue, 15 Oct 2024 12:17:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1729019839; x=1729624639; 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=p570CyCpET4jQOMvqTRvBlj0hjjJLO72psUJRNLRpe8=; b=lTaq045xOzFl6KAtApqJ23pCJB/Wnk0qa1s63O1r/sonZGAEra7ZabkKZP2WHvplKo Nx+z5yAEJKhaXzz4JPLeWFi3JVwceClHVFNMoWSWw8X1FLVoqhZrNcUp9d8i/P1yiZj4 UJL3Zl2tuDVpeGqE2H40fQiG4IymQVQ2nseeNDy19R2eQp/zg76Sjj8UlufcxjR4itwT bAQ1QtJyExPTIsn1OcXZ/E2I08F+KegZwL1nXc5Kf5Gu1/qfIPSfku94jYOaacLU57CT r5sEyEdpq3oTDSUUf0B5mURdJak+/5qhjLb9qSKLurdwySbwj3uPy0puvb2DqRFTfrAd AnOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729019839; x=1729624639; 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=p570CyCpET4jQOMvqTRvBlj0hjjJLO72psUJRNLRpe8=; b=lepPbfZUmDQdxREqAp2wd8Ow8trZnhoawaOffXKCiTLMK227sImHX9u++BFKtmn2cI n4xQ819pM//CAt0NkTw9giwwmWROxGvRdKYmthzXdU6Keon/ojwyv9aK+W1Z7VS2wrms D+cQIkCoNNSAsqsJNRa6A/jtY4+7K1T74tDpU7FVFj01TLjhfV3M6pPMFbCZRupU3nxX V7U8OIJ6GmR5raNqa7P2nDW0migaqXAtEx2f1SSj2VeVoOOSujF78mvVVU48Mp6Pgt8Y mYeGl6fsxIiXDBr+CfJt05t9r8dYSUfBLoLXuCGvw9pqwOqz2q+Fx168Eo4dMPxSHbl0 7p4A== X-Forwarded-Encrypted: i=1; AJvYcCXCOVke1lWHSv77JGoevEyJEENRvWAJ+txOrvfDNiw7wOgrV5hFMN5jpx3hXzpRtb47liPwktbf+776zKDE+8ei@lists.infradead.org X-Gm-Message-State: AOJu0YzDmWO/i2uZjwlZRPZ9jbAEThrd2Uyx7p3hGchLUNkDkB+IX0/w Eg+dHH+EIfpEsJ2Ia3l3nP9o90s1R+2IEaUImAaORQ968BY5i/fKWybGFL0XhZA= X-Google-Smtp-Source: AGHT+IFeN2E97a+E3jhI8sBljZvv6XC7mfzgwimmU3ry+3H1MazUngu2M9qkKbFXzssYTp7lbfxmBA== X-Received: by 2002:a17:907:9709:b0:a9a:4d1:460 with SMTP id a640c23a62f3a-a9a04d10662mr844482266b.63.1729019839017; Tue, 15 Oct 2024 12:17:19 -0700 (PDT) Received: from localhost ([2001:4090:a244:83ae:2517:2666:43c9:d0d3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a29816bf8sm100951666b.101.2024.10.15.12.17.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 12:17:18 -0700 (PDT) From: Markus Schneider-Pargmann Date: Tue, 15 Oct 2024 21:16:02 +0200 Subject: [PATCH v4 8/9] arm64: dts: ti: k3-am62a-mcu: Mark mcu_mcan0/1 as wakeup-source MIME-Version: 1.0 Message-Id: <20241015-topic-mcan-wakeup-source-v6-12-v4-8-fdac1d1e7aa6@baylibre.com> References: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@baylibre.com> In-Reply-To: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@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=1028; i=msp@baylibre.com; h=from:subject:message-id; bh=lb40xLu/VXrpPNedn2QOJM+HYtvP+0chbzXXKOqoOlE=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNL59q94MX33ke3S9c4mE9jWHv1mP//Od4Gayds38yydZ v7npB6zXEcpC4MYB4OsmCLL3Q8L39XJXV8Qse6RI8wcViaQIQxcnAIwEZ6/jAzn9mxmt1lycNe9 2dWNL/cnhb/10NRZMPF0+CKGhFVXS82/MfyVreBkqimdrOu19NX5C99vFH+21DlW5Wcf7ew0qWJ RjDYzAA== 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-20241015_201724_897751_275B7E42 X-CRM114-Status: GOOD ( 10.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 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..06361cfd7a8ee6f2acf2d15e8106087dd0f38008 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; 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; status = "disabled"; }; }; From patchwork Tue Oct 15 19:16:03 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: 13837013 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 589B5D1F9C5 for ; Tue, 15 Oct 2024 19:24:33 +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=U0ITVZ/ruKG/TLGpfGAwzLMygWSysjucbld18q4vTYY=; b=HqI8RPh90WkyOmNpqVwEkRhoy/ FUyeBb5GrrDd/gsswwbo6A75qUZr/WwvL8M9ggQ/5ICtAlLiDCYJAROmd8i3vbhBt/EYMLwRhcgPQ fBr+ILiEoFf8hiTc0yncp1HEvUEJsmoEGjUlxovqtJ5TfvgudPcYG87QTB5uvnn+dLcXz1HE8G5es v+KlpZtm+pjUVQAkEvuHauLVxY/KTpPYwK9GQhZ9XjZD3jJYNgs6QPZyPJjkBY36w0KkBU2qDvlaV j6xgtHIXaf0RzsSJgYq1FoAHGEXCSCkB3jYqExrrwP3+F4Ktnc/G5fAV80Wn70oKZvmAh1VA5MtYb NcRaE/Yg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0n9b-00000009NsI-3JZb; Tue, 15 Oct 2024 19:24:23 +0000 Received: from mail-ej1-f51.google.com ([209.85.218.51]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0n2o-00000009MUd-45aB for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 19:17:24 +0000 Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a99f646ff1bso484035866b.2 for ; Tue, 15 Oct 2024 12:17:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1729019840; x=1729624640; 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=U0ITVZ/ruKG/TLGpfGAwzLMygWSysjucbld18q4vTYY=; b=WlMbhryGeodvd1y+HGUDJQJRFuKehfsA5fuCkjL6Wddim3XoHJW/rK+/VVMFkxqC/m 73np6waLvmZcv0sQipvx/C2mjbDPAtZHgSfuVmNeQQHPq5ns0px5VRhuTle5pLroMCYN b7p5WGHG6xf+NCw2b8DH/wA27fmvnP3jvF83I1sThVQIMitZFjQJThZUUeteP5omnlJ1 93SuF1WDISucJKqLeWSZfRBQPd90F0O/xVvn0ETwsIKvC+bFAyGhxgwJDGYwQSsViSrF 7LUjWIoLUIEeNLxAfIhT/Jf5Oh/65Fso47ffbVAlI3D6nMCxk3KRIF4pKlhYp2bZhuhn +n1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729019840; x=1729624640; 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=U0ITVZ/ruKG/TLGpfGAwzLMygWSysjucbld18q4vTYY=; b=R3cn4xakM+gfajA/Dd3KVUXz7zd6TknrcGdjtcGNH+j1VwcjCh0wJh3zxYWwRphbuE MYWW2Ov98MNyNKdILbCAmByb/NvMeprnR0VFGP4kQjqPoZuVbQAF0j/+tmC9+6s3wXVL AYjquTMp842sqFG2DcPYlJTkavgtskRDPvlPxL/4lEcVUs2ODdCswbBo0EmFWWihr2Km waoFYEQR5wuphMH/cj3inhTEAZnz/8RsJy5BmUWmcCCsICoJoz4DXq5xqxh+PDDsVJzr fEkJdPW32HuoYKFiR0VTyuA+pi6hdqT0BOXjtADmFvI+dWprqTgOhmwIt5MCnfi53e6u DPDw== X-Forwarded-Encrypted: i=1; AJvYcCVicYC45aZJMebpXTd07XO+aIAWPvfwk1ZgdS478ijLdfLvTVYmEQUTniM36Ac18s+SybgQvCRBst6W7DuU/Auz@lists.infradead.org X-Gm-Message-State: AOJu0Ywp8UvzRPJHb+hoQXqb9g5CLH+8G7NXfTeTrje7pQPbVUzIbTOG kvNy7mWMJXQze0huT+Ogjs9SAT//uqIxAm/45D5q7n4dQCGzPQa6geciJif9yEE= X-Google-Smtp-Source: AGHT+IFE3zU2wsWTaMuFRX4RT0/Jxds4c9H2MyVuhIDmZBUP8boAZj8D2JLinmI6aBazvsto4DV1Nw== X-Received: by 2002:a17:907:3f8f:b0:a99:f746:385 with SMTP id a640c23a62f3a-a99f746105fmr1163295466b.1.1729019840193; Tue, 15 Oct 2024 12:17:20 -0700 (PDT) Received: from localhost ([2001:4090:a244:83ae:2517:2666:43c9:d0d3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a29749540sm101289166b.76.2024.10.15.12.17.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 12:17:19 -0700 (PDT) From: Markus Schneider-Pargmann Date: Tue, 15 Oct 2024 21:16:03 +0200 Subject: [PATCH v4 9/9] arm64: dts: ti: k3-am62p-mcu: Mark mcu_mcan0/1 as wakeup-source MIME-Version: 1.0 Message-Id: <20241015-topic-mcan-wakeup-source-v6-12-v4-9-fdac1d1e7aa6@baylibre.com> References: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@baylibre.com> In-Reply-To: <20241015-topic-mcan-wakeup-source-v6-12-v4-0-fdac1d1e7aa6@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=1170; i=msp@baylibre.com; h=from:subject:message-id; bh=Tq/fbr0WhZHR5UVyg7x0DcqyPJVYjETLUN6TQAqpB5E=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNL59q9r6nha9Hh5SuMeznWH2r4sOONbuO/kHN3Ls+fGu Syurd9/vqOUhUGMg0FWTJHl7oeF7+rkri+IWPfIEWYOKxPIEAYuTgGYyPpqhn92rt2Nr1as3zBp iqqu7MKwdG2e72VxM0NEmzz/ay+Y8v4dw/+0xo+R89ulZlmvn9J26sPnrSva7yu+i1wZ38bg8n+ i8noOAA== 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-20241015_121723_043512_1DCDE4B8 X-CRM114-Status: GOOD ( 11.30 ) 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..3afa17e6592f39387a667547835c90f95a9af351 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; status = "disabled"; }; @@ -188,6 +189,7 @@ mcu_mcan1: can@4e18000 { interrupts = , ; interrupt-names = "int0", "int1"; + wakeup-source; status = "disabled"; };