From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (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 CA146406804 for ; Thu, 9 Jul 2026 09:58:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783591125; cv=none; b=j4hOXjW84jHzPgZfOvQIagsCvfjqvHSFFFAgXKYk86XxKVIL1mYMDq8CDfUOEKPXnrU0SUCBLyw40fGqxFqKCwANwdRQBmBfGUgwI5il7KRdbcFoiRHwbSBY92YbOJjcfoU0aVZOskdjnyRIpB62bVmnVShik0MWua8BgMCIqyM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783591125; c=relaxed/simple; bh=mcWMNv7HhsNiSp3DMmLXndV6/eLqusOEgpevEhArbcw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RsdxOJZDI672TZ7MF9pp5y0d8dbK8BMBdReuiWO1v9LTHvxRSTMT53jjwSicbsq5ie7uW3pdGto8tOlJbctRT/hHvg6njixHlZRNfz1L9Xkt5ctAjhaBFH3oRqAMnt2B6zBcbGQzVOkXYKV7B0OjkQKUNX3iEQkISiESgUv4fFA= 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=DuWwPQD7; arc=none smtp.client-ip=209.85.214.176 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="DuWwPQD7" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2cc6ae3e7f1so10391715ad.0 for ; Thu, 09 Jul 2026 02:58:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1783591122; x=1784195922; 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=3TJQhyYS4M5x6G4jk8p4LYaJRSq9L1d3/4D1LtBYsTE=; b=DuWwPQD7wQ0mhRksupjCKU/ih7a8Q7MOwh/D4isVlhnWqdPIEuWTq+io4Y6HNL+KZ7 HQZrhV60f6ogtOWDXlWpSzR0kTs/NRAO34HsXcd+MQx14cqxieTUEzWfsiA/Wn2bACCX LtwoZlg9y3cq+jf46yP30oXXAwbqgr6lpdnEw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783591122; x=1784195922; 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=3TJQhyYS4M5x6G4jk8p4LYaJRSq9L1d3/4D1LtBYsTE=; b=RI1/lklmFO2lULiIrlJtfEudjefk921BCoCHJ+HQJ9X8aJA8i+ACD98VQMVNefRodx Yq9C33uwvyp1Lk5CCr8Dbx/tK28zDzwlUvYqEAOQo6rGFyEBkxl7CPro4Czf8/67dQ9Y Wt+5IhGowAf3Ik9ec6+nv9mIAewQ3QmnjbOod0QuE6cYTr3n31TM9+IBAJFVz/b3OU74 oTT55BEwOIYN8H1YxeNTkDHI6Ycitvw6zlGYJ90WGU3A2MglSTemOgowFN3MtnEybxVk m4E5nWB8ZaBtreoMTEtoecx0XZtTGkNKhwb+J4z3onFYiI+IHcJQSor1HB1tRpnHriZI /byw== X-Forwarded-Encrypted: i=1; AHgh+RqKOE06etUdqod5g8yfrrxFfEhFaw3KJCCDxaOLe3Q57ijeDzvrALvnYeREUO/VIfU9X5/bsBcCKl70abU=@vger.kernel.org X-Gm-Message-State: AOJu0Yw56OwZYiND67hqHSU0eHTm+lRVU35d+N1d40/e7N4wbhRSyJOl HEDed8TwTT430V6Jo2ZXizdA807RolyQCp68COt8fshL5jlwda63QoJlwcYGMqsaPA== X-Gm-Gg: AfdE7ckHko1wVltXNYrw6MJ3muU/d6T8MQ8YjCUAigz8LLBOyDjqK+K8is2CVPWE+Pn PWkkPb+iPcV9jWgq3wX8zNZhRkcodhNmQc5exqbWDygljfPvO77BiIVgAAKw0biKYEazRrDungt y4oYZKPZGGLT5bPmI9oTeoONG6yGtgO6fWVRNSn31zf3VnP3w36JPijkD5yI2yr4LEujEdKy4pG fEXiQN7mXgcORDsRZeDivcpA8w4YZBw3LCHm4FOkT1WquRkWqvNE8ajjQSAlnxy3E1KlJl30ZKk NShn1IH5UgEKCBjalna7MFnQJyHIuRx0pzO56QSVwI+gxhXzQFqa5r2u8o2mB+0o9A7mkNqG1e1 h8X9nd6Pp5eJcgOnQokENx+3katFMLdKkNvahMX6WaMUO4yoR6bedIcI1UtzpIqVA69J2Oi9xxz JPMag4dUhz0uRx31r2WWhJmt0Q9ndCQuSITcLdoy/jLg/oRFTLslBCbjsONypdT6Rq1DKpDg== X-Received: by 2002:a17:902:fc8e:b0:2ca:ddbd:a19b with SMTP id d9443c01a7336-2ccea40b65emr65003915ad.28.1783591122348; Thu, 09 Jul 2026 02:58:42 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:bd09:6ddb:180a:69c5]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ccc9d5bd2fsm41082155ad.78.2026.07.09.02.58.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 02:58:41 -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 v4 12/14] power: sequencing: pcie-m2: Add usb and sdio targets for E-key connector Date: Thu, 9 Jul 2026 17:57:17 +0800 Message-ID: <20260709095726.704448-13-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.795.g602f6c329a-goog In-Reply-To: <20260709095726.704448-1-wenst@chromium.org> References: <20260709095726.704448-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 733190175f84..d67bf275480e 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