From mboxrd@z Thu Jan 1 00:00:00 1970 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 D6893C44500 for ; Fri, 3 Jul 2026 11:04:38 +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:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xqdlZomoyNAVRvaeXkG61JOu1jmM++65FkGRpMf9qL4=; b=3hJUaQd6hiEpHOmMTWIO5Eh/4Z sAinBxt61IsZtw2pL5hN8jssnp3WSUm1KnC6IvaxQHmCooKgVZ+SWf3ov/x6LFGea09qv58vUB5OS 7IBGhIurH8QOxe4GIvkqZArzlPDgbR3bKAvC5ZoG8NPPT90yIqhuQ/K7yOkdifGBl+ORdqJfL6KPZ /Q8BizoGNdiLUFq1M9NyMBcY+bH3rYKCqetqsX89Dsk8LwjBWJMr2JmlevdI4Sj7I4h35WNcFjqf2 IrEu+Dqo9mH+K1WW8gKBJ4r0zeBrhePqPXf9Tw09unuJoj+dLAQ4T1sgNziUpxvCFgXkAGCLEZOEj 6eScOuGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wfbh9-00000006ltg-28xv; Fri, 03 Jul 2026 11:04:31 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wfbh2-00000006lmg-3C9q for linux-arm-kernel@lists.infradead.org; Fri, 03 Jul 2026 11:04:26 +0000 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-2c9b42be8feso4115495ad.2 for ; Fri, 03 Jul 2026 04:04:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1783076664; x=1783681464; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xqdlZomoyNAVRvaeXkG61JOu1jmM++65FkGRpMf9qL4=; b=AlYbp5gV4Wk6z3JTHwV8nKrnIKDxCsqc21b/gWKe0+I72XyuW88KSPCGJ7S2DidD4S eBtGTuuLqyW/XKA29At4tYGKkankmF+XRptmdoOJvhSjzYpJsFDPQBxgSfSgQ32py8d8 HvnDsMq9KhjgJHByBye36k2QFD8hvmCggpWWM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783076664; x=1783681464; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=xqdlZomoyNAVRvaeXkG61JOu1jmM++65FkGRpMf9qL4=; b=d/dY+r2mqrehhoR2gyS0Cr5X0fRnodiern5fcTMXpzwIVOs6JjY+4QALsg8eGnFc4s rndQiiEvjCGeE1hMK4Falqpin0/E5JiNLyw1M7yWuRA+CCotQPopD90bcenr0vw80Nmr gy3jPBypoy/HBjIY1SIFDNFW7t5mXmafCWSEhe1+6NhkU1ZgXmEaGEViv3siLqRjz9xL rkHXBs07BgmrMl2FdEFjsjCSqMx2jXza+ocH6DAuq040lLMOaPC6yr1vVhHG831TBzpM tzFEPnIm3tSzZQcLCPiOdMu66cA71DC65JQkxM/Db0aKi4BWLDriFvxr+aEms7sMiu0I dUhg== X-Forwarded-Encrypted: i=1; AHgh+RpjOeOIn97Oyg8bqVIBTkrQain6hq6xkHqxjoIImSzx8g/UiYS5b3PkWQ+PbSxSTw37VlGILHSp8QEMawb5kL/Z@lists.infradead.org X-Gm-Message-State: AOJu0YzgEN78Ygsl/TqhQP5mMQtXpIyzbVFMfvLnb/M5/Gvi+L23+dMr NDnNf1sLSicFTyrVN5UV/Q4+BF3Pj2s1vA5+uOG7fIoGoHMjbp9BdDNCxLkeRveXKA== X-Gm-Gg: AfdE7cn4rnSVBcT6jpmE59JpBfrgoPyY3vShLflLARxZKLJ+aAo/QVX/JPR36TQ1y6y iYI5lcGLAYf+5Du8C4+ofLqbiBMsagPDjVZ3kwj3zeV09wHTwPs7CdWgUa4p4/honqABkS44ppJ wFLvfFCHkyJS/XL21EVXgBK7xVGbsoGpV5E/Qt2FTxuhIAqODoXBL3txJqhs0ttA5jne7i6hA/h zibF6JhI+IALIrapxr7RGvUYhPKrkqOokc16W263tR9fZMWXCaMp5yruWITaBhBm2t8wvDN2Igj LPBktnfKuD4LiZqNeyYnlDJh9rpMzWdKaWJGzY5Mjqb7J8ZrfKSfVbDRmoSR4WgHds11Z6NMcrn krogGRPNpi9czsjZ6F+CioXNPeHhtUG3EuLsEnAxbegeWQDl5P0h9FFYdS6fjUmhBCefX7tv3sI cf4gjQ+peG58km1doCwHI0hgmmniEelGVX59cFUnH4OzmVuS04q0uEPkjs0MT4dWT7pfpTdUzFr zHDn/d9 X-Received: by 2002:a17:902:f642:b0:2ca:ecf6:9119 with SMTP id d9443c01a7336-2caecf69930mr5132115ad.5.1783076664127; Fri, 03 Jul 2026 04:04:24 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:7bc5:6c83:76cd:cbd6]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cad6f25e15sm7785315ad.13.2026.07.03.04.04.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2026 04:04:23 -0700 (PDT) From: Chen-Yu Tsai To: Bartosz Golaszewski , Greg Kroah-Hartman , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , "Rafael J. Wysocki" , Danilo Krummrich , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno Cc: Chen-Yu Tsai , linux-acpi@vger.kernel.org, driver-core@lists.linux.dev, linux-pm@vger.kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam , Alan Stern Subject: [PATCH v3 11/13] power: sequencing: pcie-m2: Add usb and sdio targets for E-key connector Date: Fri, 3 Jul 2026 19:03:12 +0800 Message-ID: <20260703110317.1283411-12-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog In-Reply-To: <20260703110317.1283411-1-wenst@chromium.org> References: <20260703110317.1283411-1-wenst@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260703_040424_834036_1761BABC X-CRM114-Status: GOOD ( 15.88 ) 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.2 E-key connector allows either PCIe or SDIO for WiFi and USB or UART for BT. Currently the driver only supports PCIe and UART. Add power sequencing targets for SDIO and USB. To avoid adding a complicated dependency tree, rename the existing power sequencing units "pcie" and "uart" to "wifi" and "bt". The existing target names are left untouched. The new "sdio" and "usb" targets just point to the renamed "wifi" and "bt" units. The "unit" names are internal to the power sequencing framework, and should be confined to a single provider. The names are only informational. Dependencies are tracked with pointers to other units. The "target" names are the strings that the consumer uses to acquire a descriptor with. As these remain the same, existing users will continue to work. Signed-off-by: Chen-Yu Tsai --- Changes since v2: - Expand commit message --- drivers/power/sequencing/pwrseq-pcie-m2.c | 41 +++++++++++++++-------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/drivers/power/sequencing/pwrseq-pcie-m2.c b/drivers/power/sequencing/pwrseq-pcie-m2.c index 16a47f76e7ce..029ae39f6e3d 100644 --- a/drivers/power/sequencing/pwrseq-pcie-m2.c +++ b/drivers/power/sequencing/pwrseq-pcie-m2.c @@ -69,46 +69,46 @@ static const struct pwrseq_unit_data *pwrseq_pcie_m2_unit_deps[] = { NULL }; -static int pwrseq_pci_m2_e_uart_enable(struct pwrseq_device *pwrseq) +static int pwrseq_pci_m2_e_bt_enable(struct pwrseq_device *pwrseq) { struct pwrseq_pcie_m2_ctx *ctx = pwrseq_device_get_drvdata(pwrseq); return gpiod_set_value_cansleep(ctx->w_disable2_gpio, 0); } -static int pwrseq_pci_m2_e_uart_disable(struct pwrseq_device *pwrseq) +static int pwrseq_pci_m2_e_bt_disable(struct pwrseq_device *pwrseq) { struct pwrseq_pcie_m2_ctx *ctx = pwrseq_device_get_drvdata(pwrseq); return gpiod_set_value_cansleep(ctx->w_disable2_gpio, 1); } -static const struct pwrseq_unit_data pwrseq_pcie_m2_e_uart_unit_data = { - .name = "uart-enable", +static const struct pwrseq_unit_data pwrseq_pcie_m2_e_bt_unit_data = { + .name = "bt-enable", .deps = pwrseq_pcie_m2_unit_deps, - .enable = pwrseq_pci_m2_e_uart_enable, - .disable = pwrseq_pci_m2_e_uart_disable, + .enable = pwrseq_pci_m2_e_bt_enable, + .disable = pwrseq_pci_m2_e_bt_disable, }; -static int pwrseq_pci_m2_e_pcie_enable(struct pwrseq_device *pwrseq) +static int pwrseq_pci_m2_e_wifi_enable(struct pwrseq_device *pwrseq) { struct pwrseq_pcie_m2_ctx *ctx = pwrseq_device_get_drvdata(pwrseq); return gpiod_set_value_cansleep(ctx->w_disable1_gpio, 0); } -static int pwrseq_pci_m2_e_pcie_disable(struct pwrseq_device *pwrseq) +static int pwrseq_pci_m2_e_wifi_disable(struct pwrseq_device *pwrseq) { struct pwrseq_pcie_m2_ctx *ctx = pwrseq_device_get_drvdata(pwrseq); return gpiod_set_value_cansleep(ctx->w_disable1_gpio, 1); } -static const struct pwrseq_unit_data pwrseq_pcie_m2_e_pcie_unit_data = { - .name = "pcie-enable", +static const struct pwrseq_unit_data pwrseq_pcie_m2_e_wifi_unit_data = { + .name = "wifi-enable", .deps = pwrseq_pcie_m2_unit_deps, - .enable = pwrseq_pci_m2_e_pcie_enable, - .disable = pwrseq_pci_m2_e_pcie_disable, + .enable = pwrseq_pci_m2_e_wifi_enable, + .disable = pwrseq_pci_m2_e_wifi_disable, }; static const struct pwrseq_unit_data pwrseq_pcie_m2_m_pcie_unit_data = { @@ -130,13 +130,24 @@ static int pwrseq_pcie_m2_e_pwup_delay(struct pwrseq_device *pwrseq) static const struct pwrseq_target_data pwrseq_pcie_m2_e_uart_target_data = { .name = "uart", - .unit = &pwrseq_pcie_m2_e_uart_unit_data, + .unit = &pwrseq_pcie_m2_e_bt_unit_data, .post_enable = pwrseq_pcie_m2_e_pwup_delay, }; +static const struct pwrseq_target_data pwrseq_pcie_m2_e_usb_target_data = { + .name = "usb", + .unit = &pwrseq_pcie_m2_e_bt_unit_data, +}; + static const struct pwrseq_target_data pwrseq_pcie_m2_e_pcie_target_data = { .name = "pcie", - .unit = &pwrseq_pcie_m2_e_pcie_unit_data, + .unit = &pwrseq_pcie_m2_e_wifi_unit_data, + .post_enable = pwrseq_pcie_m2_e_pwup_delay, +}; + +static const struct pwrseq_target_data pwrseq_pcie_m2_e_sdio_target_data = { + .name = "sdio", + .unit = &pwrseq_pcie_m2_e_wifi_unit_data, .post_enable = pwrseq_pcie_m2_e_pwup_delay, }; @@ -147,7 +158,9 @@ static const struct pwrseq_target_data pwrseq_pcie_m2_m_pcie_target_data = { static const struct pwrseq_target_data *pwrseq_pcie_m2_e_targets[] = { &pwrseq_pcie_m2_e_pcie_target_data, + &pwrseq_pcie_m2_e_sdio_target_data, &pwrseq_pcie_m2_e_uart_target_data, + &pwrseq_pcie_m2_e_usb_target_data, NULL }; -- 2.55.0.rc0.799.gd6f94ed593-goog