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 5692FC624DE for ; Fri, 4 Sep 2026 08:44: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: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=QXiJKGEMuTwqwy42qG7uMnjSfbdcOoA9DAqQks+0PHc=; b=no9Mc8iCL1H7tJmtumohZOAbWc mI6hkTgxJMRVACNLB1Ky8W4sFYwmQ5COjdfHbnwXewrN8hop7DeOuN4cfGZO0ZDHhZ0MbYCIITz0U rlayU1WsGwr4hal8b17Mpeqq0KP6/mXg2wJsd2nm7yu0gmIaG8g5RkreJx6ipJYuNqEJpwbwVdq0l KE4wpiMj05AmPYTH7Q2D860504iZmlNz9ykB/nBks25KvHMY9gtErGCsuk9QLHXprK/2LiOFhImeP 3nDCFOF7Cuu198qyWrtI3rHmxPKTjJej6OakqHibWzQhwz8MPlfiPe53+PymZgLK/pV7oI01iFFsM mBEzxpmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x2PXE-00000001QhZ-1RSa; Fri, 04 Sep 2026 08:44:32 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x2PXA-00000001QdE-280B for linux-mediatek@lists.infradead.org; Fri, 04 Sep 2026 08:44:30 +0000 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-cc1cc97b84bso668047a12.1 for ; Fri, 04 Sep 2026 01:44:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1788511468; x=1789116268; 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:content-type; bh=QXiJKGEMuTwqwy42qG7uMnjSfbdcOoA9DAqQks+0PHc=; b=L3/iA+TOMAeeSXUBKYsTPb9BdZ4zigcCz6T1lpkuuYv9S/Uw3p6uu8nJMSLlpIwa8z vHVXndVwdRUZ00DbJzMVv0JQYLjfxTatlQn8mLZv7caPYKm+D4M13+jf9zhuRoWPJ6Jf hPKvohpDHOje22bwqUx0oN1/ntpkxxukNPUVE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788511468; x=1789116268; 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:content-type; bh=QXiJKGEMuTwqwy42qG7uMnjSfbdcOoA9DAqQks+0PHc=; b=hblDrQh3mgafI+1jcIDvL/HBXXVXkgjKZlsv1xDEffc9itqPhOsfZnRewIwVgoYrvR /Q/nnD8ZjLG+/xs3eabnfz0sQni7Y4Nfj1laL7+CRRrDMKRwaePRPTIDdGM+GKGIb39B /1QImGx64M99ZTjc8xjyUGJUXr3ZXmd3jJM2BhfGMbDXGaF+3kT//7+hCE3n0pGcXcXb oMtHu1fkaQzGTydxZNH3EBLWtRGTduISEFdZNEAW3uA9RalYZIZ3LoBRgyA3hx5wJ5rc U6tGpFMjtDfmC5K16EKBed1twnftfwB8nplu1GAjJNLjiOBmOlTVgfvymucVYsJq9fht 1pRQ== X-Forwarded-Encrypted: i=1; AKwUvBwHCmBfMJkOwa9kzAA/3qaF/Rpdgwusgq5a1J19ITeAjg8do5X7UXcR5sckwl7H/AgLI+rzxDq+ZWHkv+r3tA==@lists.infradead.org X-Gm-Message-State: AFuF++lK0KGK7aV+ujkQw6XN7XgedU6ZvOtz92yTH7baGgATifE9GTsr s1wTr7GqifgNpVfECTJ8UA2V7GOwCRzM/AqOSYjp8zySlKFj9qA5gTFGypzlbMKdNA== X-Gm-Gg: AYBFou2NEUhg+XHShEG8ia6LWYXJX79Yf0MAkpwWseKPaMXkLiPTDk77BXv5uaSiWPE cD+xIP1CJlQNctQQP5CrTkB9dHJR9hPQ/vyRuilHxtZ4KiZWY8ZlrKkLyBhcD1xmfBeimpWmxb+ zVc5d85hKVqxl+00997NpN7C0XdSxcC/LZY4A4qBWxaiV2XROEAF/xnhpp62y3h8U5DeyMfSXnV BMsgjV59HPeCUryLufZFlgVETmCSosTqkNzWl9GBAoldWupYQ3XAaNd+3MXVRLpeq/N5OKFnJzX C0528xM7eCDKU0URK2Zzl0hwg8qcicAV6BR/2h2MMvBBacDTiH0ux3g152wiyH1+RlohyiXR1Gm o7VSwK3G5Y8EYOrtH8JCasTG1T0hZlgjtTjzBq2p46qNP510G6rBB7t7Svuk7owM7leFxae6eIy v7OdqKIzCkhQVA4jFjtAnGPq8DJzUnSuSCkCDj1Tzb09XUAH3yF/QEeZKKjmq0RChMiCwa+yYY6 scjyHBrbyYXt5BRzCrE/vMNXcDRJUkQ6FOel4610bHT X-Received: by 2002:a17:90b:2b8c:b0:398:9be6:f995 with SMTP id 98e67ed59e1d1-39b262aaf48mr7479557a91.20.1788511467843; Fri, 04 Sep 2026 01:44:27 -0700 (PDT) Received: from wenst-7875.tpe.corp.google.com ([2a00:79e0:201d:8:343:bf21:3095:9c5]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-39b260fdf9asm3343538a91.9.2026.09.04.01.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2026 01:44:27 -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: Wei Deng , Konrad Dybcio , 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 , Manivannan Sadhasivam Subject: [PATCH v8 13/16] power: sequencing: pcie-m2: Add usb and sdio targets for E-key connector Date: Fri, 4 Sep 2026 16:41:52 +0800 Message-ID: <20260904084158.1341550-14-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.979.g7e5102b832-goog In-Reply-To: <20260904084158.1341550-1-wenst@chromium.org> References: <20260904084158.1341550-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-20260904_014428_566410_6F70FC53 X-CRM114-Status: GOOD ( 14.80 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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. Reviewed-by: Manivannan Sadhasivam 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 43b2328a6661..987faa9f3b3b 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.979.g7e5102b832-goog