From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95F383E3152 for ; Wed, 15 Jul 2026 08:55:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784105725; cv=none; b=tkAV+XsLIgTsx+SEiHzwBmUkjq/2QpBrtJA2mE6IEh3f2+DznZPOvcU/vh6AxxZLwg0b6q3IMvU2OsLoG66jj97kTerXWHMl6rkqBnlEFYg7OqgBBhdAw1N4hMZw8hBpTZFPsep7Qh/heIHDTYhw31bWnLKn5c/fqXROo5aesG4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784105725; c=relaxed/simple; bh=S9qazdwnsr1QgW0osAkaYIzoucgKhcC+gdhN23cyZxU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q1BPy443dX9pVDaOjFUk4PUOCD4bR2v4Mr/1SXv8baOPpQrUwkgPs3vHgJhC+x2b9OSBk8t8Q6tK239lxXcZgLKLdUvQTaNCmob10jp6mwQM0/Pbh/7OfPR2FlQ+KM55Vbf81KIRZ5ee0D28/2ghayGoj2PHDhe8KRnhusXS58g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=QjfXTdVw; arc=none smtp.client-ip=209.85.215.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="QjfXTdVw" Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-c9aea40d799so866600a12.0 for ; Wed, 15 Jul 2026 01:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1784105719; x=1784710519; darn=lists.linux.dev; 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=R59ctZio0nbgqHRQ4JYecMwYKlS4svhcqsOXKq5o7ro=; b=QjfXTdVwo60lV6+SVEXYvSl9yEgpgPpPv4mI/gkom4jXVA8VPq9+k7+02CJogDshdU sDHMmqlVb6TUT5kUp/tPXTRQxkhEQJG9BQwOSPm3c5zgSjB+kNL3SHoow2gAKlxJrhuw OS9AKayCVMkbuedoKgwdgWIxaHiJoOENraM7Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784105719; x=1784710519; 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=R59ctZio0nbgqHRQ4JYecMwYKlS4svhcqsOXKq5o7ro=; b=OQGnOXEocNLPSJXH16sj79Rx4gJ1sYHe2Nat2f1i6znIuGuRdReghGR2OgON1J0U14 imwoUrcpvVtw89K1Ih/J5y4O9wocr2xgA9r4l+JMhYzqVZRjlh6x6eENCQka2HAa4kDg Op6cHeV/QeEi0pI6gOJ5FN8ns64qhPUr6El8QksGsgqz/FAD0xdlckczZsOk5aJzWDr+ 8fQV1ctFTstBIJIskVmiNcaa+i8E9zpgtrTQrbNixSlFfIZ/kIvkBQ5vfLuYDgu3Uh4s XGjBbew7vVP12kZdAXgP5GnoVvPmKvvhNlLes6e63yhj1V5z7GNtQPp5s9JCvDiZFOkq ygMw== X-Forwarded-Encrypted: i=1; AHgh+RpCxF6GIgeLdK88S/oQ//QUHM/UyTEtMRL0R5POQPy0iD1sMo05uWNEb81CwnOzJWWK97isLRMHu30XFg==@lists.linux.dev X-Gm-Message-State: AOJu0YyGOkBZrFH029f4dj6++hjwILnmZ5KJVaD1W1oEJZr82ZtQZ0Xi MsC1b8pcnf3DQzJH6lts+hZeXPGK4olqhNDir+mehv0l9cZeyda+rsc1z1Y4GgpCcQ== X-Gm-Gg: AfdE7ckzZPDqbUvz8hq4SK9ifJt7hzuTrOn8aolYbQ72is47p3ilRVhvRy79qEItl5o aVeWEludgG5Zad/aYtQvbeEBBzCOFDpjZM6zNrCCs1T2gGf/w3IQatnkpCrG2r4irCF471PmFMj RvLPjLL91LylIuow43WqHgNEw5uzD0EPGZRJShtoCJlGMP+hAS3e44djbZU7R5tDmD5yrWA6vF7 WlDWrQ6EywiHvGgSIsX5ScL8n1iXQdwcIUpZv9o/0OGasUBpgRT1OLP9+SjO8l571Sf53H1GfkJ e1ajK1xvQjsmbuz72LnSfp+St813EHxMLIFWj7khTWzLa47vYV3IgPC9f7IWzBpQNq2pUDF3gl+ reBQwaW5/rnTkXwBI+dWEh3H72RkDc/8Ip4wn4P30moH50UL6Lf0TC2XqLylF+PLFZwEro8IXnC R+dT8lExGoAaSb6Y4c+56ebZNVDi7eDnO1NTkXJMlbnxkCYA5ku8l8AiMVFDLoUPlyEc1VuQ== X-Received: by 2002:a05:6a00:ab8a:b0:848:48e7:437b with SMTP id d2e1a72fcca58-8488985bd87mr15890965b3a.69.1784105719486; Wed, 15 Jul 2026 01:55:19 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:47d7:4aa5:a6f8:2279]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84a4f819117sm2757491b3a.59.2026.07.15.01.55.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 01:55:19 -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 , 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 v5 13/16] power: sequencing: pcie-m2: Add usb and sdio targets for E-key connector Date: Wed, 15 Jul 2026 16:53:43 +0800 Message-ID: <20260715085348.3457359-14-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.141.g00534a21ce-goog In-Reply-To: <20260715085348.3457359-1-wenst@chromium.org> References: <20260715085348.3457359-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: driver-core@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 691cad0a6dd0..693b0d33f8cf 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.795.g602f6c329a-goog