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 15FE7C44501 for ; Wed, 15 Jul 2026 08:55:30 +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=R59ctZio0nbgqHRQ4JYecMwYKlS4svhcqsOXKq5o7ro=; b=ubpvZBAt0aXtAtqB4ZUmTwn2s3 Vgq2MKNlZnuaMT79P4DRO1VIJ/+WmcN9oXIlal49oJg75/i4MuglTf/YK5BVODJcO1FFohVPkogVg W13/mLnRYCgNbzHSURaIpvY6U/6A0ehrDqcXva2ZZ5QGwY6/kFrElxe2N3ElJWFQSgZ68VTRXXWY1 hWyG5dB7Am3mqp3GzpKBH5EAH8eJn6ag1D/tUzGHjz1+30eFaiSGd3zOt0ovuPneegO94NW4aYI0k 3oj+lZnFRiuKPrP7f2F6B7nycBzRub3frLdc9rjZSsGhJZ+b3ERMxfRJZdc/oi3z3QFUmRw5zw9um rHGBzi5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wjvOr-0000000EEX4-01wS; Wed, 15 Jul 2026 08:55:29 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wjvOi-0000000EEL5-1Foo for linux-mediatek@lists.infradead.org; Wed, 15 Jul 2026 08:55:26 +0000 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-848479c9bd5so1501480b3a.3 for ; Wed, 15 Jul 2026 01:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1784105719; x=1784710519; 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=R59ctZio0nbgqHRQ4JYecMwYKlS4svhcqsOXKq5o7ro=; b=T33nPbBTcD1AT/aT6J1SYuuDLHrczwFFAGJxpVDIqoDv0vs54Aqv+IIwTXB/xeFCVY 3nRf1smNhPrlnDfBaSm1NzMWXjttJYmYqlz2RWkaoXVgrW4BRLS0K/NS3XfpbswiCDkj xcuq3CfRVm9uMEOjNBFcZoTCUNdfpNppuDvys= 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=Tq7dLA6xc4X30SjyFHBjabFqo/ughwE1Aw6Q+kqWaaLa484jHElC8FSJNzEQ2tiPR2 cVzoJusjezILECu8bI6tQ63hx7j0+CLnTFkup0wkmWzWLVPpHffOVw9VGV+eSLNCUA7e prW2Glr4yg86HYoLcHL8i1gzJt0Kv2KV1T3LcuZnZo2dRHjTJViuSG+x81qGQ6cH6SOp kBeEQEa6RhnYMxXppLncDUFNvu6A/QxdpaDM0BZzJqkX/ir8aGOXtzZ91zO/fXHUkfWd QajFutCN/HDIACebMSmvchzQl4PmPd2Zz0Y/0B9jeyYFTk+89063e77dV5zoM4wUT/Es I1Xg== X-Forwarded-Encrypted: i=1; AHgh+RoiH6QwpO/LYHXmps6mpkEiObZlrS+vmE4M/AE4cWoj8cyqurhves3v6hiLNomVJAlY5oQ2heC1eRZoedzIXA==@lists.infradead.org X-Gm-Message-State: AOJu0YzG1PqyaTTwn7jm8WjNyACHafRN6dR5JITKAWgSq15uDMknPhpV n+HY1wa4MnqzoGRKmO+yMaZobOXCl3UG76e6qBtu8N8dJgIQH5//NiMgo85kNdeRXQ== X-Gm-Gg: AfdE7ckBD7ufBo0xUVlLxy5kLdlP/S7BqcVuy2UWc/q86lEfvOQK10/9ShlXAUI4OVh XYSqf6JXJedDuVWczs5rVC90dfndxivr+6I2FXfXpb7trjxY90Ucg/I0ETEM3EzUHW1iEuC5GPr I8c90oUje3gJRW9Fdr7b7Ymu9B/ivFsaccA1cn+Ayg9IHzzOiDIXhkqgCcpSirjCBbp4W3E1bqW kK44Lrll5voDgPJIoIIh8wVJ089y3XdJHC2E3Jx6lstMGIQQmZoL1miYdAcZ2smbcUA3xePUbxe 5tPejxHkb+vTlPH8L4Q0nEXkOAU92I5dq7+6+hcz1Z0KOtKCqlgQuKu4Pqa56vxb1iNbe1RC3+j m/LRaxY7cb8mpZD0RfExRYRpNh9SC7jTbOuwqx1dtX7jAomQbOy84/b9KFwKPADC9vWZmNlCDzi IZ4EMmEBa/LJRsPwpdk2JrnozvHxNZ0SQfKuhJcKDiVKQ4sxpFt88nZn+qsZJFZkDjuM3ZbQ== 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> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260715_015520_483349_57C6E7E8 X-CRM114-Status: GOOD ( 14.59 ) 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. 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