Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp311927rdb; Thu, 19 Oct 2023 05:29:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4M9PxbpTSmXzYCuMxSnzU+zjx8pounvltXSPTtY06DAVM7YcbLJsHGA1Gj4q+ZzeNvSzp X-Received: by 2002:a05:6870:ebc5:b0:1e9:d1b8:5d5a with SMTP id cr5-20020a056870ebc500b001e9d1b85d5amr2534725oab.39.1697718594707; Thu, 19 Oct 2023 05:29:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697718594; cv=none; d=google.com; s=arc-20160816; b=bkBFoQHyv/PfxIzbu2qO0zP16cZcCvdC5KAlCja7zSGfnxSIu0bF+gnZ3peatICIfV vZ/BGAyeaiCj51Q5tqcXlXM5fMyc9KbhNpG5RgR+QW36rTFHejk2PFV6LqaX1clP9RHW UP1HjYCwwiL0dAj5bHLjBfWZRUn606nWHWt0nOFBpbfrsVqGGVlIPaLmExPgzlbJJ01I o7z4+tMa+dccMO+hkb+u5yy1XlWX/+17Lz3LzcvWDT5MCIiyG1CPLD2dZbVIQ+N0OqY1 GjRrchhR3QbBqCpdZ7O9KY1UIW8oz6s1vliSpu6Ox7jMpjSVSdo0xrXs59cqQ2jd4fkY bu+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=mEtjdk/k/N71jIKJwHYR2cMwMsK6XqGLfYwFpVfFamU=; fh=oL5u1qxwpthPG0onT/4SNMwjdlMbLicDue2DPzZvioY=; b=zR637cxCfh6MVdO1vmZ1m/nYvI+OrsWbm5YM+4VpV+VPVXlhy7P22BrXsml1MfACmF N7FWm2L00ubVdbTTxzQA28ByunQ5Mh5QzaAxqE/d70ZnKFwChwHV6l3TX5lwCIWXIMXU C2d2FwTt7wdk/QdEsY8EDuySzvexlcuK9yyM1hYmsTlzuqZQCNuLPZWThIDZndqMPkjq c3pBteUh9ebcNYMrSRoQc1OnYklQyzNvGCCxDrZtZxVCL4RUPYP8Y038dpF0l0GIfkaY E124q4M3Wyog9q/WmPd+wsoYj/Ihchb4bf33htEdFu/G4mKNMMBH7Womq7DrQ5PE9Vd6 nVSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id e64-20020a636943000000b005a9b2800a08si4303133pgc.783.2023.10.19.05.29.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 05:29:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id E9BD88197016; Thu, 19 Oct 2023 05:29:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345616AbjJSM3Z (ORCPT + 99 others); Thu, 19 Oct 2023 08:29:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345543AbjJSM3S (ORCPT ); Thu, 19 Oct 2023 08:29:18 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAFA212D for ; Thu, 19 Oct 2023 05:29:15 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtS8y-0006Kv-OV; Thu, 19 Oct 2023 14:28:52 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtS8x-002mrm-I1; Thu, 19 Oct 2023 14:28:51 +0200 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1qtS8x-005292-1U; Thu, 19 Oct 2023 14:28:51 +0200 From: Oleksij Rempel To: "David S. Miller" , Andrew Lunn , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Paolo Abeni , Vladimir Oltean , Woojung Huh , Arun Ramadoss , Conor Dooley , Krzysztof Kozlowski , Rob Herring Cc: Oleksij Rempel , Florian Fainelli , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com, "Russell King (Oracle)" , devicetree@vger.kernel.org Subject: [PATCH net-next v6 3/9] net: dsa: microchip: use wakeup-source DT property to enable PME output Date: Thu, 19 Oct 2023 14:28:44 +0200 Message-Id: <20231019122850.1199821-4-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231019122850.1199821-1-o.rempel@pengutronix.de> References: <20231019122850.1199821-1-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 19 Oct 2023 05:29:49 -0700 (PDT) KSZ switches with WoL support signals wake event over PME pin. If this pin is attached to some external PMIC or System Controller can't be described as GPIO, the only way to describe it in the devicetree is to use wakeup-source property. So, add support for this property and enable PME switch output if this property is present. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli --- drivers/net/dsa/microchip/ksz_common.c | 3 +++ drivers/net/dsa/microchip/ksz_common.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index 02fab1adb27f..11adae8a2037 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -4159,6 +4159,9 @@ int ksz_switch_register(struct ksz_device *dev) dev_err(dev->dev, "inconsistent synclko settings\n"); return -EINVAL; } + + dev->wakeup_source = of_property_read_bool(dev->dev->of_node, + "wakeup-source"); } ret = dsa_register_switch(dev->ds); diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h index 8842efca0871..f7c471bc040f 100644 --- a/drivers/net/dsa/microchip/ksz_common.h +++ b/drivers/net/dsa/microchip/ksz_common.h @@ -163,6 +163,7 @@ struct ksz_device { phy_interface_t compat_interface; bool synclko_125; bool synclko_disable; + bool wakeup_source; struct vlan_table *vlan_cache; -- 2.39.2