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 016BEC44506 for ; Thu, 9 Jul 2026 09:58:49 +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=3TJQhyYS4M5x6G4jk8p4LYaJRSq9L1d3/4D1LtBYsTE=; b=F0iFHj/WnA6DrN5sEYitxp0uJI gWMsT8omUx8LanQkSQ7zWJl6i5pz+T4mwy1A70Sngq+LxpaD0dr9qN63i2zXgV+Z+66ulhMt+UdQe p2azfEvNsQtTSy+XrkZ/8eAP7MaM7ItT3aBR/fUlbpYPL6rRrYprlDESn16tq3Hi9rS+xHHj4/x09 iKYkrFbb9u2eEySInGnzuMVEmGmOJbhkAn4dmZPMgti/acSmcjsNLbyuXvrLtYcqSI9+Tp2lV9vmy c8u7D4hppoPFSAhkLkKIg4MttcKyb1Zlm8oHU4E8o9XaTCZamHGD+7lHbt+aiX8sHDL+oO+lLXon7 BxuoUY4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1whlWq-00000001q5J-497M; Thu, 09 Jul 2026 09:58:48 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1whlWl-00000001pws-1J4x for linux-mediatek@lists.infradead.org; Thu, 09 Jul 2026 09:58:47 +0000 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-2cc7e86e7aeso16602635ad.2 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=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=3TJQhyYS4M5x6G4jk8p4LYaJRSq9L1d3/4D1LtBYsTE=; b=LIKBkCWkA8Kg3KRKCybaNcovv9d03PBMlBQ6KgEze60Yan1aBCJk6/rP+ELMbwmwdq v0R3C4D0Do3Q22ReVyTElS/2fdphPTmAbvDLBPZ0w1yfZS/b6rCWFkothlvbpEOFrIej monZY2lBXvZ6z8lRSmmzTqmvJGR60DWkaZFOA= 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=c6fifE2/YuRKceB6jvLhpQ0s4YPml5ZJT/RVsYrzBin6UXYHy9WexIyC+0w7l2McCY fX0K0Eat++KEofUWvP/ogWGEYfBvAT4HOBx29P0cj1JjP9cMdI5jL/x52NRAsnknGuba xFE3j5UWRug6n5RhqevXUBvjhBVRT0rZVwsMGYsQyIw5HUCgUmGWDlGDXQJBBg2+KZLj mnwoAMWyUNFzeeOcxpiCn+A0/rZWC1enTwuPzDlUNuLya6IVqf6zje/z2egashgigsZh VBT6GCr++IKLHqEeJguNqcjEbFNbu2di1DQv8CFsMdCc3qgoyzBK0kRbWGzvZ4yYRp/n 9Hsw== X-Forwarded-Encrypted: i=1; AHgh+RpT5zqhx7XUUv2G2qarF7/QZVmxyGHoOyViG09iZ+TwjUlniz3J261C5oUMuk2si2AY4Pl7KfgUGi0A1kxEZw==@lists.infradead.org X-Gm-Message-State: AOJu0YyoCLG877p4Q6uld7f+lePmtEXJtI3Km9Zu6s/qyrfumLCFz1ZA TeH6HhDn88DJjru9edFmaZf8aMJLx90lysC+xJmALe1oHO0JhA2Us589Zn28tkywSA== X-Gm-Gg: AfdE7cnmC3U371iPDP+o5dtGjs4M6lWVZnkP7paJJESVEkVrvV49om9PtJKnFv+kLfO 2OLBPF5QZizFyDmbNDz5O4ixM1wTGpqgaYP0VK6Qxr1DYQTLhqs7gT9updGUzcakJ8rXFVeCWjf 4rYwArG/HeBnfNijwV9gIgLQqzS8rq7R7lKeBoJHwcO5QeHwGbZFuHHLvTc1P275FF7s67RLPo1 i0D/lD8W+tZCtCsmjdpZrutG1w18JDp9sF1UXNW/Eqh+ZdlHCLQJ2CK/D+Y/+v7UTgOKtqbLrmy ZS8lAVG8fPReLtoQLWF5Vq8a76bDTCneaaXbLZxQ2yfMINvvqqvztwLF3lXO7AhydmAbDQ+ciuh WZ5l6DGjnqFHtJIqJllejWJELVgVEAcdzKhe2FIdtYNDdfEtremsYQL5Zh7+RQ/vmeCIOPmZB0c Ddn90ycft+JB3HeDUSLSGVv3Fcu9TtD5cqKNxI4rBv5cXfDiPJXC0Lyam3ib9kNFwKYwO7Nw== 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> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260709_025843_399639_14C8AC1A X-CRM114-Status: GOOD ( 14.86 ) 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 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