From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (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 693F63D5673 for ; Wed, 15 Jul 2026 08:55:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784105726; cv=none; b=gHYbKMJKkKzwciCCNegWMo4mmlyNbetw7dZTGNFmOed3qyh8tD8Ppk+EALn1JTMEbcK9C/Zt0v9t/jVIWGc7kkiWsg4C29u+LPY6lf3gIwME977+gI1E0nlF6YV/s2HnnpXq9+8UWsOjjpoRXhNScCxAlN7+PAqAWpPoq116PTc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784105726; c=relaxed/simple; bh=S9qazdwnsr1QgW0osAkaYIzoucgKhcC+gdhN23cyZxU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iuWrtxgzt7hVZIRzUlLdeyQuYbfBn/d2tOfIbjdk0PcVbKK64cxscrFhoLh3JciKl51+cKl9YtEUYzoqQbred/jyhzV/LUcQjBrnsXHCyIVOJaiAK5ntkEx85hzmUt5/RkqW6lbMA4Y4o3ofjWiD4FMhAKDG3p1Tb7l7PqJQvE0= 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=UJdH6aVp; arc=none smtp.client-ip=209.85.215.170 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="UJdH6aVp" Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-c9e0b89e228so1175117a12.1 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=vger.kernel.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=R59ctZio0nbgqHRQ4JYecMwYKlS4svhcqsOXKq5o7ro=; b=UJdH6aVpvcxq7poyI7pN4WpXDbtvcjl3Gajb+p9bZ6Mf/iN6Sdnr+pTkawsVmtCQHb bGJa862wQ9cnUKRTEH0Cinkm2kizRGy/Eddyumaw1Xs56rf+w/u3mdMv9VSJeMGdEfg5 x4S4qLZHFMDhDY985fB1VxdVAC9CQT4uawi1w= 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=KLoZMh9/kMr9VsqeUbb+//SqUXX+Ftowxh7dYPbdPZz+Sr7ZdGQHBE2zdNQZSz+aB4 4sme9Aw+Ask/LfXlrq2i4EkeyI9G1hhSnCP67ugEFwBj3TtYtfSfBj+35XNUOEoCzJ2J wbO3xOF2UFMpXpE7/jjACdshnoME7iI4Sj8WmQXtYm9ruLwDH9GUzPvBtI8AwVsJJka4 qE1cgb9bGsrp26tWg1Y9/0J/O8T274od6aG7QKVNPLLTzQqtrO1+fl74rGho8BwrBGi9 vBIgcFQ7GhpLq0juFzIjnfVJnYcLgMB+/gkxWkP/ZvGVuwt+N3E/NET6FoO8k1Epp46n nMPg== X-Forwarded-Encrypted: i=1; AHgh+RoKnyPld5qpjkseawVlOS+sWiDtjvSA9ZHMDxYADr3fi+nhsaUc32oPtzrooFk+FC7WFJtFT/K6JJKDr/o=@vger.kernel.org X-Gm-Message-State: AOJu0YyeOLYIFPz5QnNRKOrI23HaRoNo76+tE59DMwNGsxw3XhR1TcYB bjTHdRQVduqQ+QZpAH6ikumN3YvUk8ZapYZEAGmD0UT0rNHkMVeoMKi3tiF0Yhhf8A== X-Gm-Gg: AfdE7ckEaQpMTe8DrokM6s0AveDDDdv9Ld/mJDBuj0wy9/s0k6s0Szr/qBWP/IPV6xP j9Fl5knyuZTNsY0TQEVH8S102hgIZlnDgS7n8HU2+HMBP4kS+lDA5wCpSOn9EaUFoATuqx9eFwY 1U4xJHCcPIys4hmPlcFEbs0EiF6vS7+jdFdFe5CNTLcDrXm14zqChbpSRLHLHaTv8FAm883N49l YEz5KTxG0gxgsyDFiZJGVQitynzV8LdLcDx3UlRSnKfWMtp9MI51uTN7qMx0qCQ2x7mQzXpSrQd KpLXXsXXEiacG8bCYtkmL4MtAuLn+VBFnpzG8h0eXR6vWRQwOvce56OBogSLtXHSFZotiJbzRXd bK2rdp+jL1mc1t8/N/tB60ZD5DM1LQ0TDZQFNNg4tIs/bnfl0TycmU1ngNxprhT6mxhDa9MDT5j TnpmAKZfLUzJIayBN1wJs6anwZXtGrhRn+Z570huCi6/93xa7axYLSQHrTW5mEi6GFeuhkNg== 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: linux-kernel@vger.kernel.org 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