From nobody Tue Sep 29 06:59:02 2026 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (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 4FBAB43B49C for ; Tue, 11 Aug 2026 12:20:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450839; cv=none; b=hyCvxIR30+ilimAyLjXWDtjrl97OU43zshVZQ5EsGkUX6euwhGfY+ry+no/clmGIVNWa2MUvOCA4eC7ukls6Nfq5OVGdC4ReSLkAPUq2EFEEb4IbavrpSXvBcBJPcfjXuRbQm0My/ISAP8Zl2eBSWkARDbweqINM3VfBky93xAg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450839; c=relaxed/simple; bh=u+z0AwRO8/TSAUMbuMg66Cd0/+Rr78HnvpPXb+NIM+g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sOdYLKq4r6eeOXlQkv+L23vz60YD6VP6Sh3luNefiqINe158L0KDEe/JrPJJlcmKEFtt0onqK8mQaf0ODYN4D9vuE5kYyWW+QCjC49n63kWRa09g3V8p/vHrxTXG4zAdG2X3eh7/Ed4h75vszcNW3AirqiSD3jVM4n2px7EYYQQ= 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=ButOzhgM; arc=none smtp.client-ip=209.85.210.169 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="ButOzhgM" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-84830c774a0so3024013b3a.1 for ; Tue, 11 Aug 2026 05:20:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1786450837; x=1787055637; 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=Mhe3GkzE7TtO88F1kpNcvywePxi+2kbW1KiUnFj6D6w=; b=ButOzhgMoWMmUi8u3EdW6sI9W8ols+M+JFndKECFMcauOl3FlibEr7bJMw3vau+a+K okaKVW1AMctBLbutMaPhkTRTYMikEcMo2m120OL2TxjErnIyBPa97ukVU6nmWKL9QFgY rT3aTIP7qaaRhxQYuGyjs3j9AptBWC8rXoxNM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786450837; x=1787055637; 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=Mhe3GkzE7TtO88F1kpNcvywePxi+2kbW1KiUnFj6D6w=; b=b2lQDfGzlPhdRJ07fko+kPK/Fx8M2863LvTNbWG1RRvVVDpj+N7XY06TfXkoYUUiv0 UWfMjJ8AuyYu2azupFHQY4Iu7vRRHljZXiXDJqh8bU0jpREoiwkmW3NVzWsl6m1Vcwmw J4IQ2AuauuYRbGaecffd3jhxDtR8VjdOIavDiUyR911rR14W45X8WkRLicnxo9XU2DOe YwYpBYTZsL/87RaizfkquODVYRCpeHS3dWiBq+BWbP+qVz7/fQFHWDlYuDf0B1uMO+Mk F+WEThRSGimNaj993X6PuG057D7BR5TkpGMDK0qCQM19nT/x1RbLYN0CysmxyJFOKRSM 7Msg== X-Forwarded-Encrypted: i=1; AHgh+Rog/p+5j5k4eOKMOTl6HxtMEYAu8WdpB/mPqAN044h9S/6j8GP6yxMff9tcPqYEAwe95KfONgfEv9hgfhM=@vger.kernel.org X-Gm-Message-State: AOJu0Yy6wO7wAL5UG5bwRjgrI/l3Vf2DoJ3CRB16YCBVdSI/NWJEXvgY MXFkuByV0zYCtuXEGwWKaBSjjYXZ1jzaZrebGp7bk4Z2Bt5RZYfHrxKj5zkWoYpycA== X-Gm-Gg: AR+sD13Z8qREccm1LpwfKp5jh/SP4iMyswJsJerHyn9f5Vih5MajriZOGMDumE+m9JL 51f9UxcJdjj2c0c7QP45hNJx9hHVd/CzTCSHtUqqOw1ZK8Zq35epfeT5iA3DDSxKailo+leOrMt gsG8k9kaJkxdk7cKTUoIVxZJb5V6RBaPO20vAinN60fkZVblBqDdJGlo92rCGe19TwBXhrEmF9u +bs4evz0eRZSDkaSKEgO0rfDnJRfQkAyRWMDSICb+A2Kd5XslMM0J8PEDpnpLw5EtOeSnocwjFn J+P9p7tmaXyLFVRD+/GqCEyeCkTqNfcWnJ3Kv1eFOy0Kfqer+NYpMgprWiet6WTIinwh1pXPu2L UhXCIsPN4h/u6jLN6PCKxqmBtix4MrNzlKEU0VXgSppCpp8BAOuit1ELt+2t6keDeKfN26wxvPU hxgpo+P0YbplNvMI25+KXyHkNO34L9V2omx/xQC9AHDj1O1MVQfGkT+b3pPF78ushz/wgPzhdLy SA3Rf/q1MYilWv/pkiLYKmLz/Xs/a2anDq4Grbeop7XCA== X-Received: by 2002:a05:6a00:a93:b0:847:9315:fb8b with SMTP id d2e1a72fcca58-84fa8686d1bmr2586060b3a.6.1786450836537; Tue, 11 Aug 2026 05:20:36 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:12e1:df26:6add:1ea7]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84fa9574e9dsm662454b3a.54.2026.08.11.05.20.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2026 05:20:35 -0700 (PDT) From: Chen-Yu Tsai To: Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Chen-Yu Tsai , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, linux-input@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 1/9] regulator: core: Add "enable and wait" functions Date: Tue, 11 Aug 2026 20:20:01 +0800 Message-ID: <20260811122011.3539250-2-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.679.g6767b8d81c-goog In-Reply-To: <20260811122011.3539250-1-wenst@chromium.org> References: <20260811122011.3539250-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: quoted-printable Content-Type: text/plain; charset="utf-8" In device power sequencing and initialization use cases, it is common for the driver to enable the regulator and then wait for a certain period of time to pass before continuing. In cases where the regulator supply is always on, or has been turned on or left on by another consumer, the driver could shorten the delay or skip it altogether, provided that enough time has already passed since the regulator was _actually_ turned on. Tracking this requires support from the regulator core. Introduce a "last turned on" timestamp field to the regulator device, and "enable and wait" functions to the single and bulk regulator consumer APIs. The existing "enable without wait" functions are then converted to macros that expand to the new functions. One case in particular is not optimized yet: a regulator left on either by hardware reset default or by the bootloader, but does not have the "regulator-boot-on" property set. As the enable timestamp only gets updated when enabled by a consumer or by the core, the first enablement always needs to wait. Signed-off-by: Chen-Yu Tsai --- Changes since v3: - Added __private modified to regulator_bulk_data.wait_us field and switched to ACCESS_PRIVATE accessor for the field - Moved wait outside regulator lock scope - Moved "remaining" value assignment closer to conditional - Fixed variable unit name in regulator_enable_and_wait() prototype Changes since v2: - New patch --- drivers/regulator/core.c | 64 +++++++++++++++++++++++------- include/linux/regulator/consumer.h | 21 +++++++--- include/linux/regulator/driver.h | 2 + 3 files changed, 66 insertions(+), 21 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 2e61606fc1d0..9b766302bdba 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -98,7 +98,7 @@ struct regulator_event_work { unsigned long event; }; =20 -static int _regulator_enable(struct regulator *regulator); +static int _regulator_enable(struct regulator *regulator, ktime_t *last_on= ); static int _regulator_is_enabled(struct regulator_dev *rdev); static int _regulator_disable(struct regulator *regulator); static int _regulator_get_error_flags(struct regulator_dev *rdev, unsigned= int *flags); @@ -1674,7 +1674,7 @@ static int set_machine_constraints(struct regulator_d= ev *rdev, (rdev->constraints->always_on || !regulator_is_enabled(rdev->supply))) { ret =3D (is_locked - ? _regulator_enable(rdev->supply) + ? _regulator_enable(rdev->supply, NULL) : regulator_enable(rdev->supply)); if (ret < 0) { _regulator_put(rdev->supply); @@ -3060,6 +3060,8 @@ static int _regulator_do_enable(struct regulator_dev = *rdev) fsleep(delay); } =20 + rdev->last_on =3D ktime_get_boottime(); + trace_regulator_enable_complete(rdev_get_name(rdev)); =20 return 0; @@ -3129,8 +3131,8 @@ static int _regulator_handle_consumer_disable(struct = regulator *regulator) return 0; } =20 -/* locks held by regulator_enable() */ -static int _regulator_enable(struct regulator *regulator) +/* locks held by regulator_enable_and_wait() */ +static int _regulator_enable(struct regulator *regulator, ktime_t *last_on) { struct regulator_dev *rdev =3D regulator->rdev; int ret; @@ -3138,7 +3140,7 @@ static int _regulator_enable(struct regulator *regula= tor) lockdep_assert_held_once(&rdev->mutex.base); =20 if (rdev->use_count =3D=3D 0 && rdev->supply) { - ret =3D _regulator_enable(rdev->supply); + ret =3D _regulator_enable(rdev->supply, NULL); if (ret < 0) return ret; } @@ -3176,13 +3178,19 @@ static int _regulator_enable(struct regulator *regu= lator) } else if (ret < 0) { rdev_err(rdev, "is_enabled() failed: %pe\n", ERR_PTR(ret)); goto err_consumer_disable; + } else { + /* regulator already enabled somehow, but timestamp might be invalid */ + if (!rdev->last_on) + rdev->last_on =3D ktime_get_boottime(); } - /* Fallthrough on positive return values - already enabled */ } =20 if (regulator->enable_count =3D=3D 1) rdev->use_count++; =20 + if (last_on) + *last_on =3D rdev->last_on; + return 0; =20 err_consumer_disable: @@ -3196,31 +3204,49 @@ static int _regulator_enable(struct regulator *regu= lator) } =20 /** - * regulator_enable - enable regulator output + * regulator_enable_and_wait - enable regulator output and wait for time + * passed after regulator actually enabled * @regulator: regulator source + * @wait_us: time to wait after regulator actually turned on; 0 to not wait * * Request that the regulator be enabled with the regulator output at * the predefined voltage or current value. Calls to regulator_enable() * must be balanced with calls to regulator_disable(). * + * If wait_us is greater than zero, then check that wait_us has passed sin= ce + * the regulator is _actually_ enabled before returning. + * * NOTE: the output value can be set by other drivers, boot loader or may = be * hardwired in the regulator. * * Return: 0 on success or a negative error number on failure. */ -int regulator_enable(struct regulator *regulator) +int regulator_enable_and_wait(struct regulator *regulator, unsigned int wa= it_us) { struct regulator_dev *rdev =3D regulator->rdev; struct ww_acquire_ctx ww_ctx; + ktime_t last_on =3D 0; int ret; =20 regulator_lock_dependent(rdev, &ww_ctx); - ret =3D _regulator_enable(regulator); + ret =3D _regulator_enable(regulator, &last_on); regulator_unlock_dependent(rdev, &ww_ctx); =20 + if (ret) + return ret; + + if (wait_us) { + ktime_t end =3D ktime_add_us(last_on, wait_us); + s64 remaining; + + remaining =3D ktime_us_delta(end, ktime_get_boottime()); + if (remaining > 0) + fsleep(remaining); + } + return ret; } -EXPORT_SYMBOL_GPL(regulator_enable); +EXPORT_SYMBOL_GPL(regulator_enable_and_wait); =20 static int _regulator_do_disable(struct regulator_dev *rdev) { @@ -5389,30 +5415,38 @@ static void regulator_bulk_enable_async(void *data,= async_cookie_t cookie) { struct regulator_bulk_data *bulk =3D data; =20 - bulk->ret =3D regulator_enable(bulk->consumer); + bulk->ret =3D regulator_enable_and_wait(bulk->consumer, ACCESS_PRIVATE(bu= lk, wait_us)); } =20 /** - * regulator_bulk_enable - enable multiple regulator consumers + * regulator_bulk_enable_and_wait - enable multiple regulator consumers and + * wait for time passed after regulators are + * actually enabled * * @num_consumers: Number of consumers * @consumers: Consumer data; clients are stored here. + * @wait_us: time to wait after regulators actually turned on; 0 to not wa= it * * This convenience API allows consumers to enable multiple regulator * clients in a single API call. If any consumers cannot be enabled * then any others that were enabled will be disabled again prior to * return. * + * If wait_us is greater than zero, then check that wait_us has passed sin= ce + * the regulators are _actually_ enabled before returning. + * * Return: 0 on success or a negative error number on failure. */ -int regulator_bulk_enable(int num_consumers, - struct regulator_bulk_data *consumers) +int regulator_bulk_enable_and_wait(int num_consumers, + struct regulator_bulk_data *consumers, + unsigned int wait_us) { ASYNC_DOMAIN_EXCLUSIVE(async_domain); int i; int ret =3D 0; =20 for (i =3D 0; i < num_consumers; i++) { + ACCESS_PRIVATE(consumers, wait_us) =3D wait_us; async_schedule_domain(regulator_bulk_enable_async, &consumers[i], &async_domain); } @@ -5440,7 +5474,7 @@ int regulator_bulk_enable(int num_consumers, =20 return ret; } -EXPORT_SYMBOL_GPL(regulator_bulk_enable); +EXPORT_SYMBOL_GPL(regulator_bulk_enable_and_wait); =20 /** * regulator_bulk_disable - disable multiple regulator consumers diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/c= onsumer.h index 56fe2693d9b2..0b83acc015d4 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -145,6 +145,7 @@ struct regulator_bulk_data { =20 /* private: Internal use */ int ret; + unsigned int __private wait_us; }; =20 #if defined(CONFIG_REGULATOR) @@ -192,7 +193,7 @@ int devm_regulator_bulk_register_supply_alias(struct de= vice *dev, int num_id); =20 /* regulator output control and status */ -int __must_check regulator_enable(struct regulator *regulator); +int __must_check regulator_enable_and_wait(struct regulator *regulator, un= signed int wait_us); int regulator_disable(struct regulator *regulator); int regulator_force_disable(struct regulator *regulator); int regulator_is_enabled(struct regulator *regulator); @@ -209,8 +210,9 @@ int __must_check devm_regulator_bulk_get_const( struct device *dev, int num_consumers, const struct regulator_bulk_data *in_consumers, struct regulator_bulk_data **out_consumers); -int __must_check regulator_bulk_enable(int num_consumers, - struct regulator_bulk_data *consumers); +int __must_check regulator_bulk_enable_and_wait(int num_consumers, + struct regulator_bulk_data *consumers, + unsigned int wait_us); int devm_regulator_bulk_get_enable(struct device *dev, int num_consumers, const char * const *id); int regulator_bulk_disable(int num_consumers, @@ -410,7 +412,8 @@ static inline int devm_regulator_bulk_register_supply_a= lias(struct device *dev, return 0; } =20 -static inline int regulator_enable(struct regulator *regulator) +static inline int regulator_enable_and_wait(struct regulator *regulator, + unsigned int wait_us) { return 0; } @@ -457,8 +460,9 @@ static inline int devm_regulator_bulk_get_const( return 0; } =20 -static inline int regulator_bulk_enable(int num_consumers, - struct regulator_bulk_data *consumers) +static inline int regulator_bulk_enable_and_wait(int num_consumers, + struct regulator_bulk_data *consumers, + unsigned int wait_us) { return 0; } @@ -676,6 +680,11 @@ regulator_is_equal(struct regulator *reg1, struct regu= lator *reg2) } #endif =20 +#define regulator_enable(regulator) regulator_enable_and_wait(regulator, 0) + +#define regulator_bulk_enable(num_consumers, consumers) \ + regulator_bulk_enable_and_wait(num_consumers, consumers, 0) + #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_REGULATOR) struct regulator *__must_check of_regulator_get(struct device *dev, struct device_node *node, diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/dri= ver.h index cc6ce709ec86..8a74aa681df3 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h @@ -658,6 +658,8 @@ struct regulator_dev { unsigned int constraints_pending:1; unsigned int is_switch:1; =20 + /* time when this regulator was enabled last time */ + ktime_t last_on; /* time when this regulator was disabled last time */ ktime_t last_off; int cached_err; --=20 2.55.0.679.g6767b8d81c-goog From nobody Tue Sep 29 06:59:02 2026 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (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 EA5EE442FD4 for ; Tue, 11 Aug 2026 12:20:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450844; cv=none; b=btXJ9RawZf13q5ncQgWTyl9aeTjeAZTuY9oKYWhX8HQp72KXiUxiv35uSztL9P3Ck6mNDzFbTUG0d2rbjzVKWHjjtlbd3AZzuOVT/jFTDxT+ec+XUUEUCTr8zX9Qj5Jhpc7zFOtIe9JXj3XI90XoOkBJ2RJlGh2IEsQVsnD2wps= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450844; c=relaxed/simple; bh=FmJ253mDx04B3QJ1bIl+tfh8HdALdb4bRYDxE/DUlnw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cEsTwcJnxLWMdKQgth1DDoDVpSPaBqq3Fbda94UrgpgcYwhvPmXA+VmX2HkCHShG6723jN2vE5iKOSE4kZVaWSYvt3j6JxyOUbtEljNWv/l6N0SDPgMAHKx3gM83NTawX21TthbGHaXeiiCQ8+VRemV27J9Z15e09gIjztVfLtI= 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=Az5P1T6S; arc=none smtp.client-ip=209.85.210.172 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="Az5P1T6S" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-8453427d3f4so3036757b3a.3 for ; Tue, 11 Aug 2026 05:20:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1786450842; x=1787055642; 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=L7I9lwGzwg7czeq/kM88e0ae+cNOZS1aNNH4lK4EhTU=; b=Az5P1T6SPNsGLtkJZ4qiKSiRDN0IqSJ4Fr5WPSXhPTDbrZM+6P7BcyMJujMcLWt9bw 8eZJDQepy4D8n3HN4E6X1z6Uk6HiPTkvbrNxIRjtB/DcMOuHcFufRUYi+G5U36EY/m2N VYoeHpTPPvwqpKm60d2GWfdJeUHq5hkVHoQ4k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786450842; x=1787055642; 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=L7I9lwGzwg7czeq/kM88e0ae+cNOZS1aNNH4lK4EhTU=; b=nDbpvHTFtMWyxeM8zd2iNzsmbOcw97KLx8mfd7L2v9/4zb9pkGDrQeqYra1o4D2NgJ faN68B7JeLxNzE8dsqUg816eZ0PZ0AXe8846lTJf4Q5tv68YkIfyD3tYO80ijKSl9d7m 3nkHO3MKi5dUIfP0moQUTSsaaLvc6Qa4lzURmMUEp3vTwtjn3ozVMBnIN89POrRMgubR LjBm1ZPF+z95fOzPEkKjk78vT4KMOv3fqWDwQMwX5LKHqLuh6xWQI8qUunGFL+gwNtOl P6zNJ1HQynyT8teEVuMiAB1zi5XoI/anQyP0YTaTyS/G5GM/G2y14y1Mah2xABGaTep5 2ueQ== X-Forwarded-Encrypted: i=1; AHgh+Rq9aqjIHGnJx4VQVtK7RCR2FoM7t5FPMrIc2go7hkf1pEf7Y1ZkuMDhNzemNBDIG03cJbRwM5Jt7SKXLok=@vger.kernel.org X-Gm-Message-State: AOJu0Yz81AT6YyLO3xuklP6KjDSAjSLnT+3qAxkBULi6a/+w5VgTl3bC WGerwneuXBMPc36Afvld8IsEXmVko0NQhts9CUqeFERJVHOY1J1rVIOVyieSDENWEw== X-Gm-Gg: AR+sD10nQqaCjraSxfetwyCuJvN2pFJ7VvlTJ6JahEX+CNoqI79xwTo5WCQBZtnEBKo u4Fn1x2w8eBG80YqLjdXPR6+lNCo+yhZEGSwhOqgJ5NaWTwy1147LRQJyRfZX85DHZzATJF8JLI PBZTDRmmLhOOT4eNCqbQ473WtfqWV4+k0c8r3UDintFOB/j14qquZejMaF2toMHS8pV5tPWSxWf ojAymvQs5/BvdtTYZsTCp/Mfum0ezK6tMV9SI95hFt+26IrsYdCZx91obEgoZfG7UC03ABgN1E9 XmrtFMjk+G/0FCgc1bfms3vuFPQhIdirsujtoqom23ZPfInxtcVfqgosmFrI0NpLsPVcmUp38Pf 476TkJxWlD+sjmtTr4YQICddpPCMkhKTaJ9LL2B1b4IsgbUDJu3aK/EQlq42QvVHj5Lg7FQ1mL/ UDWE4ok69kMTXZUlQt+ojUAt1uXQF9JiL9FQXa3ri0adsfjA965OC3/6JLNn5ARUV+gz4HbYJls f2NeFG803DrJNAnXoT4IxgnAJMa45ixnZfFIErF/oNArg== X-Received: by 2002:a05:6a00:23d2:b0:845:c906:5ff5 with SMTP id d2e1a72fcca58-84fa8842ea1mr2725202b3a.30.1786450842194; Tue, 11 Aug 2026 05:20:42 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:12e1:df26:6add:1ea7]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84fa9574e9dsm662454b3a.54.2026.08.11.05.20.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2026 05:20:40 -0700 (PDT) From: Chen-Yu Tsai To: Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Chen-Yu Tsai , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, linux-input@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Shevchenko Subject: [PATCH v4 2/9] Input: elan_i2c - sort include statements Date: Tue, 11 Aug 2026 20:20:02 +0800 Message-ID: <20260811122011.3539250-3-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.679.g6767b8d81c-goog In-Reply-To: <20260811122011.3539250-1-wenst@chromium.org> References: <20260811122011.3539250-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: quoted-printable Content-Type: text/plain; charset="utf-8" Sort the include statements before adding new ones in the next change. Reviewed-by: Andy Shevchenko Signed-off-by: Chen-Yu Tsai --- Changes since v2: - New patch --- drivers/input/mouse/elan_i2c_core.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan= _i2c_core.c index f93dd545d66b..9f024a435dbf 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -16,27 +16,27 @@ */ =20 #include +#include #include #include #include #include #include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include #include -#include +#include +#include #include #include #include #include +#include +#include +#include +#include #include =20 #include "elan_i2c.h" --=20 2.55.0.679.g6767b8d81c-goog From nobody Tue Sep 29 06:59:02 2026 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (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 C2FCD442FB6 for ; Tue, 11 Aug 2026 12:20:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450849; cv=none; b=usqaLiYCDSHVhSIosB3VPr2cBGnESTyGZVwKSV8BR6ihZFaofohS32IGWvfgprWP4pkD3xEnsqwp5nGW6OYJhHd2kAt2q05o+jFrgHQti+xsukArzNV9BqOnKb1bLFZCAFMR+6IQRXzg5U8S844k3upDHs2T5uJuiam5a1ezXvw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450849; c=relaxed/simple; bh=tRbezXAeChB8yAzXWfWX++wNhT7E8rc/SaVPrOaXwTI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OqOTaeLmhVpPr2cwHod7lFMdR3/Mw0eMOIvh3lMMw1+6+ImgbsjFe+egbp2coLDjBEFa3+UBjMon+DiaNOkmJN0tndI8Gi8zZ8CPfgDtl/M+T9WjgDZdTFltX1NcnnBxZWR+b1mLgfn1ZmAdnDF3f6DuRAsTgQolf8rWyFoSFxQ= 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=aZmPNv/G; arc=none smtp.client-ip=209.85.215.181 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="aZmPNv/G" Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-ca766c1c9ccso2016562a12.0 for ; Tue, 11 Aug 2026 05:20:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1786450847; x=1787055647; 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=7AY/BjzRkfyU3t+6SOkz7/qVT24RkrhiWULr6d4aAG4=; b=aZmPNv/GVfjxDsuhWeYDuLKUHF8RfT5JCKCH0p672sSfhGIbmJyRW3Nj3UmXSKpx/m x5SuCNltcX+X34uuN8G5naUmrmOnQzCbdjY/ViOk7n+1mSKZNRPkei6HweBZhdf+ITwQ 2uqUDk4ebtQPWoP5ZRxj/OZtVZduL5yI9Hhg4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786450847; x=1787055647; 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=7AY/BjzRkfyU3t+6SOkz7/qVT24RkrhiWULr6d4aAG4=; b=LmkjLmdpPDeA1GTSbFeOPx0X2Q50jWLfkY+G+ZXXgGwAkHdBBujs+0giQJ+DoevTBu uwbczJzwinkkpAZwMVNUm6z8KAyvaTnOqPAgNIZshJBoxWHa1WBpikQu+v4x4vVi3JJ7 lOtnDQqNJ8dhLPKcBkfMSF0mIOhDISaIAv0SL+ThoqF8p05UYZHOUWvi0QFeLzGNx0C6 2V3W/HrKXGbu7cFLsKFAkQ6PqE8OSJNtalI5yjY4cF+MpBJZ6dkrlzDjhDSFdxL+llU6 B2l+/gquMlHVQql+6cFMfGVWNvt44D1pU8KD8KLNCTNBuqFxe/GQadghtkSsLj9tgug+ GtqA== X-Forwarded-Encrypted: i=1; AHgh+RqvQxkPESqsk5FIcApMhfaH4Qwf3uE0D7GUKSWa8eDn9EyfMXGFDe1IN0pMpIFJ0xpEbOEBD969d9nYWmI=@vger.kernel.org X-Gm-Message-State: AOJu0Yw/mSyrdK7zYNDhok3ZLtjD5kr3M1HxpkAQYuqNrXEgmEhMRBPX o5Rx0C4lm8I6zvG7gQ3l+TY6Zi/Yx/RNXFNHOPdHNMOU5MqWuoAqW2gTxdkwenlsTA== X-Gm-Gg: AR+sD10gy0p7R1gY7hCWmsODwAW0xFG0EHcd78sa/bmmX/q7qzd+F+KsX+ENarVUC+Q vkktuaq+/vqmALH9qF6YjyVh+Uy+KJ1J8bp2HBeWNtnwXosPyGh89SY8c4XKd7wdMWMKwoI6YkL FmziwQbS8nE5h7CabbHihL6dKQnU9TUpErm3u4HmGKlVaVM8tcss/ymNerNICiD0VMELhxaujrb oE8j4nlSU3rPuFQuZAZoJoGAC9/As+zlhi1j+T/0VI5i7805Na1HmgXMR+ZA0WtDvydOuGSfq38 cVMR+KXl3Xru6a9blM+TYhNE47yxf78su60JbNzBaV94esJ6HxiKTJQLMPE8FkKEMD4WEIAvvkQ 86PC/bRpK0/VmOHDZ1h2ubqs9Jnl8LX8CxbfCRC4LyPZ5IUJuDmt50CyH+5xBTPgG7LoQxZwm52 Esd1zJWpzo5wPN+uIHp4NGVpWBMeLt7aWSAJe7Qy63n7zkerRz4MQ4JX6P9d/7yuxrnCmLEofQG xGPFjkJfyr3IxDKreTIAbtsArVSy82A7Aop82T7i6uTrw== X-Received: by 2002:a05:6a00:6ca1:b0:84e:89a:b8ec with SMTP id d2e1a72fcca58-84fa86ab177mr2896532b3a.11.1786450847047; Tue, 11 Aug 2026 05:20:47 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:12e1:df26:6add:1ea7]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84fa9574e9dsm662454b3a.54.2026.08.11.05.20.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2026 05:20:45 -0700 (PDT) From: Chen-Yu Tsai To: Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Chen-Yu Tsai , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, linux-input@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 3/9] Input: elan_i2c - Wait for initialization after enabling regulator supply Date: Tue, 11 Aug 2026 20:20:03 +0800 Message-ID: <20260811122011.3539250-4-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.679.g6767b8d81c-goog In-Reply-To: <20260811122011.3539250-1-wenst@chromium.org> References: <20260811122011.3539250-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: quoted-printable Content-Type: text/plain; charset="utf-8" Elan trackpad controllers require some delay after enabling power to the controller for the hardware and firmware to initialize: - 2ms for hardware initialization - 100ms for firmware initialization Until then, the hardware will not respond to I2C transfers. This was observed on the MT8173 Chromebooks after the regulator supply for the trackpad was changed to "not always on". Switch to the new regulator_enable_and_wait(). This makes sure that enough time has passed since the regulator was first enabled, satisfying the power sequencing delay requirement. This allows the delay to be skipped if the regulator supply was already enabled by some other part of the kernel, such as the I2C OF component prober. Fixes: 6696777c6506 ("Input: add driver for Elan I2C/SMbus touchpad") Link: https://lore.kernel.org/all/20241001093815.2481899-1-wenst@chromium.o= rg/ Signed-off-by: Chen-Yu Tsai --- Changes since v2: - Switched to new regulator_enable_and_wait() API Changes since v1: - Delay only if the regulator was previously disabled / turned off - Link to v1 https://lore.kernel.org/all/20241001093815.2481899-1-wenst@chromium.org/ --- drivers/input/mouse/elan_i2c_core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan= _i2c_core.c index 9f024a435dbf..77885930bf9e 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include =20 @@ -47,6 +48,8 @@ #define ETP_FWIDTH_REDUCE 90 #define ETP_FINGER_WIDTH 15 #define ETP_RETRY_COUNT 3 +/* H/W init 2 ms + F/W init 100 ms w/ round up */ +#define ETP_POWER_ON_DELAY_US (110 * USEC_PER_MSEC) =20 /* quirks to control the device */ #define ETP_QUIRK_QUICK_WAKEUP BIT(0) @@ -1250,7 +1253,7 @@ static int elan_probe(struct i2c_client *client) if (IS_ERR(data->vcc)) return dev_err_probe(dev, PTR_ERR(data->vcc), "Failed to get 'vcc' regul= ator\n"); =20 - error =3D regulator_enable(data->vcc); + error =3D regulator_enable_and_wait(data->vcc, ETP_POWER_ON_DELAY_US); if (error) { dev_err(dev, "Failed to enable regulator: %d\n", error); return error; @@ -1406,7 +1409,7 @@ static int elan_resume(struct device *dev) int error; =20 if (!device_may_wakeup(dev)) { - error =3D regulator_enable(data->vcc); + error =3D regulator_enable_and_wait(data->vcc, ETP_POWER_ON_DELAY_US); if (error) { dev_err(dev, "error %d enabling regulator\n", error); goto err; --=20 2.55.0.679.g6767b8d81c-goog From nobody Tue Sep 29 06:59:02 2026 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (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 F05514446FA for ; Tue, 11 Aug 2026 12:20:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450853; cv=none; b=Lv8CiyyOJXziW3sty+pdS6yv/NBY+4iRz2PzPs9elCcLQ6k+2TS8LbCidAhvYFAZ+odXztl+7JnIhuGW64gBG/kBaJnNXmvfLXXHPp6fL0RsL8Mw/VTJIVfLHWy7oGELydm9KZ2OMzINKHFa5cJ/DepawvRtpPpCqN5T0qUmcPM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450853; c=relaxed/simple; bh=uirJlTrzUDnDWGluHgHaYZhmNeiDmkFi3DnjsuZpHfI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h+VSHiP10so9W6JxqjjK09iyJ/BncKnPiCUWvkAf+YxwpgtkFI2SjD4fVdCpGs+febYX2kQHIYrjkpJVHfE9hKu3xug50OiDWj7A3DbOhrUD5Hr07+e13FalnGGrty+TTv0pTQuJiuOGGqqOeIY6Fx1uZBdw8Dvni9QH0VDcQew= 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=AHysLrxK; arc=none smtp.client-ip=209.85.210.175 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="AHysLrxK" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-8487b7b3fc8so732742b3a.3 for ; Tue, 11 Aug 2026 05:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1786450851; x=1787055651; 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=GsFbGvUc+lL3nEmcNAop98oZPFXcbP5zb4ZbtxDxx0U=; b=AHysLrxKBQRBWDPQAOCDHjM1n5xvZQ2q4T4wopMN1EbGiPvP79efhy6Y3H7y6zDD72 lyfi2zZZ8MGtj8/g5V/hUMa8gIMA8lo5N2dUIF8D11cVzr9S9opuhIFIzZiQirmuKigP xwvegTrWzYjUhwxR0dEjzjN0A14QdcOpuXZTQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786450851; x=1787055651; 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=GsFbGvUc+lL3nEmcNAop98oZPFXcbP5zb4ZbtxDxx0U=; b=lsjKAw7fF5bJ89oiMkv6wX2JCP4BnqbmdwzFG0ylU1NgbRhwz28vEk3++SmuUKUjJB OnrGHteyONg+X0kNb94opIfwzXTxKT3yXtDn+hnX07g74NKzZP1LoMm2mxQA3COPG3q/ PXjIPoi5C9Kn0fdSnU43W9inH+8rHYWdthnzkZblzhZ37DwHWZRXlvKC+IzpM8mXDpGw 0iYzTYK129/dcZb1ZwAniBwclGeI+xDt0DMs3FA2gaPnsFxeOhS/PEFxaUx7LX6DYDFE cSM1fNzZyZaiepHIJQZzL1F8fzoDTI5IXQfDxssrhQnpw80IX8KVLMdzX9bcLIEt2Eue 7WPQ== X-Forwarded-Encrypted: i=1; AHgh+RpXvBOnoEjf/tL/mhztdN6XefNEGLP7GgEz8XuyyyxzOPpT5cddy+Au6ZeOXWE8Ay7FVGHywEmdNQmneuw=@vger.kernel.org X-Gm-Message-State: AOJu0Yx8Ka/YDiOdpzbA+xPxzTZgmzRuppYTgp1sE7/syzL05ULE8bqP cjYYDPWhO/0zj0roIhNjXykeQhpaCRqESFdt4IznbLhcOjbDlXF9R8TFmF9cIYaLzQ== X-Gm-Gg: AR+sD10b38EmS9lF8w+dXMCjYUorZBZRahH5BigcpiTNgsKbPZ04lSeXgSttXZfywyB l3DAi7u67gnpKx3Ko1OTMBiuvyICzLJoD/GWhUVPFX21HU3/WJsIx3WC1uDA9PpXiRXAKhOkTv6 NHRSCfp/OFt1F/HrNPEkSdwMHVADLvrslK3cAoadWo0ATwuk0n8DIhxnv8psVrFuCwoE6Hr5Ece NYCDA8KEe5guHZndk8Gtn+1tJMw5TBGNOzxqB25ZE15/nB6n+VzcIEpLz6WexSAFyS2kIIojzcv A3kB+0D3fjPMEoEVGFRvInTGYSmmEmAO4RmDyhPRv7067Jj23Ng8gutJyhKg/4BRpHsTw6EarQd FUMjNu0qWrPv66BxsAQEA8oLEYuxP5BKTiM39jssZGC63SygXi5hjRYOiidYLPKyU2Kr9rLRM9/ w4nnZlbqobGWyeO2lPVtrJzHZGLOvCj2zL8+Y0j4NKHbFQudYKrDzvZFfRkWPm+0er2aQIgqKyq w1l8ZRDN3khNToS9CkXeSVjZbl5diopM4n9OscdVY+TBg== X-Received: by 2002:a05:6a00:8d1:b0:846:22ea:e171 with SMTP id d2e1a72fcca58-84fa872c289mr2761703b3a.3.1786450851388; Tue, 11 Aug 2026 05:20:51 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:12e1:df26:6add:1ea7]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84fa9574e9dsm662454b3a.54.2026.08.11.05.20.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2026 05:20:50 -0700 (PDT) From: Chen-Yu Tsai To: Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Chen-Yu Tsai , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, linux-input@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 4/9] HID: i2c-hid-of: skip post-power-on delay if powered on sufficiently long Date: Tue, 11 Aug 2026 20:20:04 +0800 Message-ID: <20260811122011.3539250-5-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.679.g6767b8d81c-goog In-Reply-To: <20260811122011.3539250-1-wenst@chromium.org> References: <20260811122011.3539250-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: quoted-printable Content-Type: text/plain; charset="utf-8" On some devices the HID device is powered from an always-on power rail, or the power rail has been left on by either POR defaults or the bootloader. By the time the driver probes, the device most certainly has finished initializing. There is no need for the delay. In such designs, the system integrators tend to work around the delay to avoid the boot time penalty by simply omitting it from the device tree. This is undesired, as the device tree is not fully describing the hardware. Switch to the new regulator_bulk_enable_and_wait() function that makes sure a certain amount of time has passed since the regulator supplies were actually enabled. Signed-off-by: Chen-Yu Tsai --- Changes since v2: - Switched to new regulator_bulk_enable_and_wait() API --- drivers/hid/i2c-hid/i2c-hid-of.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/hid/i2c-hid/i2c-hid-of.c b/drivers/hid/i2c-hid/i2c-hid= -of.c index 59393d71ddb9..fdaad451e710 100644 --- a/drivers/hid/i2c-hid/i2c-hid-of.c +++ b/drivers/hid/i2c-hid/i2c-hid-of.c @@ -29,6 +29,7 @@ #include #include #include +#include =20 #include "i2c-hid.h" =20 @@ -48,16 +49,14 @@ static int i2c_hid_of_power_up(struct i2chid_ops *ops) struct device *dev =3D &ihid_of->client->dev; int ret; =20 - ret =3D regulator_bulk_enable(ARRAY_SIZE(ihid_of->supplies), - ihid_of->supplies); + ret =3D regulator_bulk_enable_and_wait(ARRAY_SIZE(ihid_of->supplies), + ihid_of->supplies, + ihid_of->post_power_delay_ms * USEC_PER_MSEC); if (ret) { dev_warn(dev, "Failed to enable supplies: %d\n", ret); return ret; } =20 - if (ihid_of->post_power_delay_ms) - msleep(ihid_of->post_power_delay_ms); - gpiod_set_value_cansleep(ihid_of->reset_gpio, 0); if (ihid_of->post_reset_delay_ms) msleep(ihid_of->post_reset_delay_ms); --=20 2.55.0.679.g6767b8d81c-goog From nobody Tue Sep 29 06:59:02 2026 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.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 6B5C742C4FD for ; Tue, 11 Aug 2026 12:20:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450858; cv=none; b=fUucOMEZ+pSh6YGzu3H15Dq8mcdTFaZJx5vdKoIATrTyu65OBLd481+a9MLeneObnc6Dni5vbB5Vj3QxBCVBDNCXf7JNpbtuTngby/McocNfC57DLfGtzN/esNq+NTrIYO7ftlDSENBO7J/lyiYc9OjH5t42+x+ajFNzJdfudes= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450858; c=relaxed/simple; bh=eYYAZt1D/azsw9KiyzJSs5x1E12lPK58GJkuELjCTl0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aKbzjDJK506O7yeyrC8Iv5qiNrMeM/4ej0nC1JPqZYNSx+dilQawlLO7IuYaoCxpzUAz1UarerkaxZvLdIoKon9mfwUk1PxR6xbs0XfLNiUXzpGTy6jC/QVcvqd09Zg9yikBvBtdYsK/mN7afa11tUOLK5xHicb13HZfqHJ2VlI= 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=UmD2gsVl; arc=none smtp.client-ip=209.85.210.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="UmD2gsVl" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-84e27035206so441588b3a.3 for ; Tue, 11 Aug 2026 05:20:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1786450857; x=1787055657; 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=W0rjMz7r89FDG00LgKpSG7rJxKNH2nfPyMU32ONUt3s=; b=UmD2gsVlUCkjjjCgEhB1BENgxroVNIETQZHZCmnABrHU5UOkWXXEsRTLE2H6VlqswC Jwd9uk4puvmNyLdAv/+kOFXYWMaMEzwZVN8nDqoxsHFx15ilzAGsGF8XINHTtjhKO5av hQCaIKiV3T+hipr5e16zLCF9RhDKedg4OQyG4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786450857; x=1787055657; 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=W0rjMz7r89FDG00LgKpSG7rJxKNH2nfPyMU32ONUt3s=; b=YUH9p9f/5qaTHocN3giCeVjT7ardZoR5c0JhvD8Mt6mt4GcpvxiwdecVEL/sKDewMU zj8NhvcOo6cOVviwJVnrxJwG0NLJ8rt57FrTvopUKleaPCaUKOmwdjRL8/+SU1p67XBr Y9Goo3FfQ5H2H4MVOfv5p7rC5h9SV9zsgPyRXC62VApbY3L/poDZvWd3tKV8L4ezeFeg VQOGrCSwfl33Zn1lQ8QJdkW2eOL38Pdr4Bq9XeDSm7PmRWk+VdnsL0HNZIk5QiaA+5y1 KIqCy1gg6hIBtCL0yXWIda6PtT00lVpWeJ0VlDgZzqDLClRWPMqzYTznSPc0YbfV1oxU qxwg== X-Forwarded-Encrypted: i=1; AHgh+RoFF7bdWVducgnPJOnH63jprokBkZxHj/GC+9tKNxCX1Zo/j95DMy9VNGEKeBWnW89WMIRP8GBEal6OdoE=@vger.kernel.org X-Gm-Message-State: AOJu0Yx7xBGKiIF32N02+t/jmPh+oa9Gm9MEuE82yaEuJkk6BNjbIqz5 buPy+Vlija4vtJp+1RFDT0cVH0TMj2SNOydDm84jQSWfdht0raFDrgNhI6YSSjbElw== X-Gm-Gg: AR+sD116hOF/tMZOr2UHbM+nKNkKl1L+A8tCsVQyPQxvoMgwxv1wj1le6EZTX+Znx/T qE+tB9ETUmL47NuBTJv1yCpN2J4HXAkYKsykIDiW18PJifyIEmADfoOYpE8fJ9SbqCB/kiIcKPU hbWYXny1dH/A1qeGJgslWiRteNLDpevuLAGgCB2DejK5lhATJ1WHiXDBY/dTBmqPrOZwx2Sz6Yf WjXZVORnggpAfQ+dn7Ndrl3nbNub+IeydFoDBNpmFXiZx/rNiOFm48R1887Tgkv5tdPcdEQ3dqA by3x/htF5Ir4EbXEq5euko7adWQ2gt4A6x3E2i2jr4AUEcMGefjEVsttuifPTjd1heagh86zrVq IUTfXKncKAKL5xCbVcRgFNEz6btefvhIt+v9vovAYuoIN909vv7JKCW/e1Qxd37nma4xyPzoya3 nOPOjqJaMpt7G/Jnal6O4zUYW/QpejYDHGriVX9UUazMycHisCbtwUHQUby4tcrDAuEDY1UhDf+ S7/HE0//DEftTknRIFhb6OtGpq9E0wKYCUIKS64tZ4poA== X-Received: by 2002:a05:6a00:32c3:b0:845:40d1:87fa with SMTP id d2e1a72fcca58-84fa873632emr3028343b3a.25.1786450856753; Tue, 11 Aug 2026 05:20:56 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:12e1:df26:6add:1ea7]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84fa9574e9dsm662454b3a.54.2026.08.11.05.20.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2026 05:20:54 -0700 (PDT) From: Chen-Yu Tsai To: Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Chen-Yu Tsai , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, linux-input@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 5/9] i2c: of-prober: skip post-power-on delay if powered on sufficiently long Date: Tue, 11 Aug 2026 20:20:05 +0800 Message-ID: <20260811122011.3539250-6-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.679.g6767b8d81c-goog In-Reply-To: <20260811122011.3539250-1-wenst@chromium.org> References: <20260811122011.3539250-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: quoted-printable Content-Type: text/plain; charset="utf-8" On some devices the I2C component is powered from an always-on power rail, or the power rail has been left on by either POR defaults or the bootloader. By the time the prober probes the device, the device most certainly has finished initializing and can respond. There is no need for the delay. In such designs, the system integrators tend to work around the delay to avoid the boot time penalty by simply omitting it from the device tree and the component prober. This is undesired, as the device tree is not fully describing the hardware. Switch to the new regulator_enable_and_wait() function that makes sure a certain amount of time has passed since the regulator supply was actually enabled. Signed-off-by: Chen-Yu Tsai --- Changes since v2: - Switched to new regulator_enable_and_wait() API --- drivers/i2c/i2c-core-of-prober.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/i2c-core-of-prober.c b/drivers/i2c/i2c-core-of-pro= ber.c index 6a82b03809d4..f9f3c0ef93ff 100644 --- a/drivers/i2c/i2c-core-of-prober.c +++ b/drivers/i2c/i2c-core-of-prober.c @@ -18,6 +18,7 @@ #include #include #include +#include =20 /* * Some devices, such as Google Hana Chromebooks, are produced by multiple @@ -226,13 +227,11 @@ static int i2c_of_probe_simple_enable_regulator(struc= t device *dev, struct i2c_o =20 dev_dbg(dev, "Enabling regulator supply \"%s\"\n", ctx->opts->supply_name= ); =20 - ret =3D regulator_enable(ctx->supply); + ret =3D regulator_enable_and_wait(ctx->supply, + ctx->opts->post_power_on_delay_ms * USEC_PER_MSEC); if (ret) return ret; =20 - if (ctx->opts->post_power_on_delay_ms) - msleep(ctx->opts->post_power_on_delay_ms); - return 0; } =20 --=20 2.55.0.679.g6767b8d81c-goog From nobody Tue Sep 29 06:59:02 2026 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (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 55DF14446F6 for ; Tue, 11 Aug 2026 12:21:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450864; cv=none; b=dNKcQHlYQKtfBdRG6dMU4r2rseRYiG2ZZPUx+fDUnJdC1ZUEh5fguKG3AeNA7frGqi+IOY+aIYVM1NjbR90r82f2X2jnPsCYmwMLSG4/+E+Va5S6lPQeFvtKVzYzz1TVfawQQdmbHm/VmkY4D/3U25x4fIO9uZzfrfglcqwXbt8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450864; c=relaxed/simple; bh=nKnUL7RA48eM39vIJpkkgut+B3bUEsWflS642HIWZWg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t5qXU1qo5KrvA6V9XdVX5uAiNWzx+AnrH5/5fc/vsEHrPmx0OUBSbaq4KYp6qTsd1oSQ3Bymoaj7HMvbyzvTdighHVoyEqkBvYbOGXSFPXXQl7mU96VPJAYDcEM8p10+/kKAvoi7KjNWh2zCbDJ+6TGgnkPSgNPHuAiwuU+SdBE= 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=ekUT60pl; arc=none smtp.client-ip=209.85.210.179 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="ekUT60pl" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-84e0688b7e8so2495100b3a.1 for ; Tue, 11 Aug 2026 05:21:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1786450862; x=1787055662; 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=vW5QGWu8BTDFFV87gdYCqNM0QrJMO5Ieo8Go/wJMx6I=; b=ekUT60plaDGMVpr6QAgLGWJNSkxFGZdx/cwlrcy5Y6rnZ/teyijKkrJmkfJPak01GU C0WamYKgufMc0c7Et0+598J1hXXaeja6tI7IuExbztAl/KVFWnH8MMQXAN2AdSg8Y9FE 5e5sPc/ohnKrK9ZSQ0StH21SqZjkVGCXVv02E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786450862; x=1787055662; 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=vW5QGWu8BTDFFV87gdYCqNM0QrJMO5Ieo8Go/wJMx6I=; b=jRNvUMaLc1xGGQvIN1GJnxT2a1OWJkQhh1tnpcXMqNwo/Ug0rcjWGve2P415wq4USA 2aW3xyEJIWqrHJIib1NjicW0CYOw8+bl3+Q6hnwem/ynwBvd44VpbEB6TvAjTrUmZ9+a Os4MvyNjJImL9O0pSuhZTJW98RZhE3efg+REVrKZqDBG8ST1jS4Oes+ADnrKjXDT4yj3 ixXjw7zsqXJazCsEuV+QeAlZPztZVr/Hyjfll8lEyw+13jb4yyBlrWj0rFfUxfslK6R3 XCjlQt+V+eT5tC2z+BprX5RRntr3NsqnG0KlfsnfRk65lNpiOAyk+uSZpAybEz0w9lbI Vhww== X-Forwarded-Encrypted: i=1; AHgh+RpCJMZG4dujI3LCIfo/erJ9Xovd/51oWnaTS58W61i1JSdLpx6sRDs0MpivUoJvq9jkqzitvtQDwKQ+PiU=@vger.kernel.org X-Gm-Message-State: AOJu0Yyz9+EAQAND6UoJsKiyA7C2xcSxzumE/x78QMGpHsvl04C6nnh0 spbDAXIvp3H5QM7F6KtNpd0UjesDSLB89N5MMKgw4aIieadgNGU2R0wtqVdjfOAjRw== X-Gm-Gg: AR+sD10N/XNIp8u69xtyQvhE3LDXhWbzCc0jIM/dGzFL5sgdZbe9JrF5y0CDxoMfkxT hSl+nhmdWLV/i0u2DuQa2pI3xoqTZYeRzUWyskHqjXCbXQwVkNOqx1hvF7h7l2vIia55WUG7eHS 5lw0x0U1OT+mF62WR6VhTIfW2Mm9HFsdkuDMu0vOCRYwpdHBYWE04EKXvuAGNnJJQAafN231PQV oCZU6lK6TE/BSCRc1+GFi/aCniJV/GWos21MaI1k3fKAHG1IPFN9mmazLHTyqZ0EoE0uZ0OTw/v QbAhs2Qc/OdOlEbFWPusrKTKPInRLwLPNVB/4IokGWohWy9iWom/zsOZYOTioCzUYccV7sykvxZ kvIBG9UhuXh5DoPAnDgI2cYxflYniviGU3E5pxB7lGeQGSpsAb2WeCc2VFCaL7u2n9nlNSC/Nd1 Fpwa51aKEttFIy3BwAiPJPsE3pHTbN/lCZKs2R8jNrZsx4u5l75ZMp6Wnx88otQH0TWWjSR5BNv y6UigkYaHUKQ2gef2pmGhFovC4caldP5Gjy2OExWSS1aQ== X-Received: by 2002:a05:6a00:e1b:b0:837:f79d:909 with SMTP id d2e1a72fcca58-84fa889d2a0mr3074138b3a.39.1786450861717; Tue, 11 Aug 2026 05:21:01 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:12e1:df26:6add:1ea7]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84fa9574e9dsm662454b3a.54.2026.08.11.05.20.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2026 05:21:00 -0700 (PDT) From: Chen-Yu Tsai To: Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Chen-Yu Tsai , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, linux-input@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 6/9] i2c: of-prober: Defer regulator_disable() on successful probe in simple helper Date: Tue, 11 Aug 2026 20:20:06 +0800 Message-ID: <20260811122011.3539250-7-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.679.g6767b8d81c-goog In-Reply-To: <20260811122011.3539250-1-wenst@chromium.org> References: <20260811122011.3539250-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: quoted-printable Content-Type: text/plain; charset="utf-8" When a I2C component is found, it's device node is immediately enabled. This triggers device creation and driver binding. The prober will hold the regulator enable reference across this part. If the driver probes synchronously, then it happens within this window. On the other hand, if the driver probes asynchronously, there is high chance that it happens after the prober's cleanup function was called, in which case the regulator would have been disabled when the driver's probe function is called. This would then require the driver to wait 100 ms for the hardware to reinitialize, even if the probe function was just a split second late and the regulator was disabled a few milliseconds ago. Recently, some of the drivers for the component that are targeted by the I2C OF component prober gained the ability to skip waiting for hardware initialization if the regulator was left enabled. This happens when the PMIC has them on by default, or if the component prober left them on after probing the component. Tests on the Hana Chromebook showed that if the prober and trackpad drivers are both builtin, then the time between the prober enabling the device node and the trackpad driver asynchronously probing is between 5 ms and 30 ms, though sometimes there are outliers exceeding 100 ms. Wait 100 ms before dropping the enable refcount on our end so that the actual driver has the opportunity to catch and increase the refcount on their end. Signed-off-by: Chen-Yu Tsai --- Changes since v3: - Added commit message section showing average delay needed --- drivers/i2c/i2c-core-of-prober.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/i2c-core-of-prober.c b/drivers/i2c/i2c-core-of-pro= ber.c index f9f3c0ef93ff..68c929b16b06 100644 --- a/drivers/i2c/i2c-core-of-prober.c +++ b/drivers/i2c/i2c-core-of-prober.c @@ -235,11 +235,23 @@ static int i2c_of_probe_simple_enable_regulator(struc= t device *dev, struct i2c_o return 0; } =20 -static void i2c_of_probe_simple_disable_regulator(struct device *dev, stru= ct i2c_of_probe_simple_ctx *ctx) +static void i2c_of_probe_simple_disable_regulator(struct device *dev, + struct i2c_of_probe_simple_ctx *ctx, + bool defer_disable) { if (!ctx->supply) return; =20 + /* + * Wait a bit of time for async drivers to probe and increase the + * regulator enable count. This allows the drivers to check and + * skip waiting for re-initialization. + */ + if (defer_disable) { + dev_dbg(dev, "Deferring regulator disable\n"); + msleep(100); + } + dev_dbg(dev, "Disabling regulator supply \"%s\"\n", ctx->opts->supply_nam= e); =20 regulator_disable(ctx->supply); @@ -356,7 +368,7 @@ int i2c_of_probe_simple_enable(struct device *dev, stru= ct device_node *bus_node, return 0; =20 out_disable_regulator: - i2c_of_probe_simple_disable_regulator(dev, ctx); + i2c_of_probe_simple_disable_regulator(dev, ctx, false); out_put_gpiod: i2c_of_probe_simple_put_gpiod(ctx); out_put_supply: @@ -401,7 +413,7 @@ void i2c_of_probe_simple_cleanup(struct device *dev, vo= id *data) i2c_of_probe_simple_disable_gpio(dev, ctx); i2c_of_probe_simple_put_gpiod(ctx); =20 - i2c_of_probe_simple_disable_regulator(dev, ctx); + i2c_of_probe_simple_disable_regulator(dev, ctx, true); i2c_of_probe_simple_put_supply(ctx); } EXPORT_SYMBOL_NS_GPL(i2c_of_probe_simple_cleanup, "I2C_OF_PROBER"); --=20 2.55.0.679.g6767b8d81c-goog From nobody Tue Sep 29 06:59:02 2026 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (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 2D7C4444705 for ; Tue, 11 Aug 2026 12:21:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450868; cv=none; b=gOX26xjRTifrx2Fn+F8TKKeweMwP4LNGFexTxEqVDpP3CP7DfqkQv0+HZh+iRLIojDSkrLCvBHPDInIZoQmtAME486rDviEbAIxhgv4ZnHm6/CGYCYltOnyrtQkawzs2Liw7eZqnU2wfmMJiFTm9KS8Xm/WVpFaIEzq3CsoDkR8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450868; c=relaxed/simple; bh=uwYCui3c4XPv1rsWnK/RPsaDrOamMJWwHcg3hSpC47c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SWSXRB892BJunKSPg73z+Cx1LHZ/BcH6Qo318SC9s5hzaLfmbU4dRvmQo1RdZNBPWvvITUptToAMYRAqCUNh314m0xmQ5W5PJ6mvG3dCI1y+JsMZ1Si+Sblz5ysxfY6Z2fB6sJvK3nVY0ExlXJyK0pXg27Huv1sq0yT2h6Z8UA4= 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=Mt0pGgZR; arc=none smtp.client-ip=209.85.210.171 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="Mt0pGgZR" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-84a652535dcso1696163b3a.3 for ; Tue, 11 Aug 2026 05:21:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1786450866; x=1787055666; 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=dA0DiMJYo6Co7ip9aLY71U3LlTdqy5LziCnokKFtcGE=; b=Mt0pGgZRc+dMa2v2Jtyuct2spmGKye97vRGWyNhkzFej6BiqmCMkw0CDCBQXn6DBlC yzq3Ra4XxWvU/X3utTCIlFd8oYR90cn/KbgLOSpOQao/M8fZvIzK+VY8jv7Oby8qg+s7 9dYDux8EqV9kZNtESFbJp1HiumNLjwBgqys84= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786450866; x=1787055666; 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=dA0DiMJYo6Co7ip9aLY71U3LlTdqy5LziCnokKFtcGE=; b=rShur+JAdgJhZelWA6ph866xueJXhAfdUoXNDoOzqME7kjhfYsFnpfVvT4Zaq42OOu UMC9gxK+zGq12/FL4EK983OHVx6+FJFrtQQ/vwFBJEPITG9tzv/fi1ltGZyCM565w0VY QKadKvhNaD+F2tedQLGdYh490i+NBntIkohc5Dx5MbPwVLp4AT4gW1fLtjqwPGZSKz3N 4wZaYnBSB33rTqCaShUwNz0x8Xrtyi2ZorcA6Ggf01TCKN/CD7hyBvqHxCalsk5YTh1U zLX+VG344KnHz2gKA5YFHA6jYBsA1LGi6EdvwMnnVmR8mTT1RXYV/pozvbUkBuzstZUi B0aQ== X-Forwarded-Encrypted: i=1; AHgh+RpXj/265s6M24CbzwknxL4eCFQS0RLs1TP/j6Bnp13xfHVNSQGbCRLc2ir9rjx0UBW9AHY6sjpHfVccjpg=@vger.kernel.org X-Gm-Message-State: AOJu0YyEw8IJabiEL/FHcp35k3LenvX/WVWU4e7SG97ykr2C9O18ZU2F BshKkG1BL/r8++83O/YDdZp8f/hEY1AqAD7UEsxeYmkyXnJ5CeSV31TJx9THGlln/g== X-Gm-Gg: AR+sD10JH8cdpQJmYBzZEBB7//qRpcDAdYDhHsx/88/C60LTF+a/gqe2n8USupFU95t iAVq1Dl3LHwWmK6v6J0Bl2dWSB0IpPXJ4pQ68x+e3hApLY+Md2Uh2/mV3er2rsByXfAMLqa7cxT j/iL0Zck/0zTHjUklHMnr1uEkCBHMkGROAPZugYEOq60O0h1BAfmVsEikmlE4sdrzrmgUnQwum4 lv4FPY1NGNJj8NELopqD3EtIvWroNDmuViDKXuC4rZxvNFzgTgkS+iUecVcxUWgS/NPzwGQsGDO Zf3EzqhNQBSzzRL0nzFI48WOod2s2JJ0TqknzPh12ZFoSgr5upwqhIQLG4xFX4EGMx0vnOSAepw an9btuFE8N10UX0MolDwIMJ3WBII3a+P6Oe5wuQOLtSPwXCArOwX1mX60p6t+B3gm4LTJlgQzFJ KflzXkjhGqiT84d7pazzy4z+VlWhA1ilF3yWUsFt9ujR+gIYMV4IPsQeBqxrAK5WehH+zTY64Fk +PzNIGh7gVibRtwSBsUA1Y83lwPuhQzzJQiLDuXFxu6Zw== X-Received: by 2002:a05:6a00:181b:b0:847:8504:9946 with SMTP id d2e1a72fcca58-84fa882d05emr2571459b3a.25.1786450866341; Tue, 11 Aug 2026 05:21:06 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:12e1:df26:6add:1ea7]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84fa9574e9dsm662454b3a.54.2026.08.11.05.21.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2026 05:21:05 -0700 (PDT) From: Chen-Yu Tsai To: Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Chen-Yu Tsai , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, linux-input@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 7/9] platform/chrome: of_hw_prober: Add delay for hana trackpads Date: Tue, 11 Aug 2026 20:20:07 +0800 Message-ID: <20260811122011.3539250-8-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.679.g6767b8d81c-goog In-Reply-To: <20260811122011.3539250-1-wenst@chromium.org> References: <20260811122011.3539250-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: quoted-printable Content-Type: text/plain; charset="utf-8" Up until now, the MT8173 elm/hana device tree has set the dedicated regulator supplying the trackpad as always-on, simply because the Elan driver was missing proper delays. As a result the delay for the Synaptics trackpad was also omitted, as it was not strictly required under such a model and delayed the availability of the trackpad to the user. The Elan driver recently gained proper delays after power-up, with adaptive skipping of the delay if the regulator was originally on. The I2C HID driver and I2C OF component prober library gained similar adaptive delay skipping. The device tree will be fixed to have the regulator not be always on, and proper post-power-on delay time added to the I2C HID device. Also add the post-power-on delay to the ChromeOS OF component prober, so that if the regulator is off at the time of probing, the prober knows to wait for the hardware to initialize. Signed-off-by: Chen-Yu Tsai --- drivers/platform/chrome/chromeos_of_hw_prober.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/platform/chrome/chromeos_of_hw_prober.c b/drivers/plat= form/chrome/chromeos_of_hw_prober.c index 8562a0e89dc6..54d8941617e2 100644 --- a/drivers/platform/chrome/chromeos_of_hw_prober.c +++ b/drivers/platform/chrome/chromeos_of_hw_prober.c @@ -70,10 +70,8 @@ static const struct chromeos_i2c_probe_data chromeos_i2c= _probe_hana_trackpad =3D { /* * ELAN trackpad needs 2 ms for H/W init and 100 ms for F/W init. * Synaptics trackpad needs 100 ms. - * However, the regulator is set to "always-on", presumably to - * avoid this delay. The ELAN driver is also missing delays. */ - .post_power_on_delay_ms =3D 0, + .post_power_on_delay_ms =3D 110, }, }; =20 --=20 2.55.0.679.g6767b8d81c-goog From nobody Tue Sep 29 06:59:02 2026 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (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 0F2D6347506 for ; Tue, 11 Aug 2026 12:21:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450873; cv=none; b=BBlVQeylmJL0Lt0w2BGkzQJ+ag2gxbukDEet1uzQCnf0ExLpKlpBwsGLRsmPnDyaHnOzfrz7ybGS2jgnG6gMXH9nJKp+RrpbjJh/1CPcPDZ8e1rm1dm5CItOfAhu3e75XULXRSTWI1OeNtVbxIkzHm0BdX/NEWDNoTfVD3Z2lYg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450873; c=relaxed/simple; bh=AcYr1FXo/iH50loWw6bRNXzrMnv1gP4UhMWCRYTk09o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g4F1wS+yBIy3GzYjOXdPODwDnWhZw8P4ymLDhAasJiVi5TXOJOaGKWTllhfmObSbaqezZmP2uYXMHMjb+FW3ackf1j66ZHHRksu2Ci5Z18LhFL7NCa4sy5cTr532zWZzrZBcUseWbezA3kdNnWqDTJjRGR03tEub35VfigyLNTo= 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=ScxbrV9i; arc=none smtp.client-ip=209.85.210.180 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="ScxbrV9i" Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-84862b0d5f8so2404157b3a.3 for ; Tue, 11 Aug 2026 05:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1786450871; x=1787055671; 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=V0/BWpZ1mHkr6NJqOIKhKHqUTotk7EFya8FeeruKRfI=; b=ScxbrV9ily9IznGof5fmsJPoTzTNyC82zZbJQLMMM96uywAuNcIzv+MMSs5wIJs3QC q6KDt1hRVN59iihSuYJjkA64DoWY8qeyhUi116dSzhZConu1RKzkPr0lO8qEklzLWGNN GTp5S+pwRmB2gwBR1dbFwhqJrhmtTb0ayMCDI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786450871; x=1787055671; 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=V0/BWpZ1mHkr6NJqOIKhKHqUTotk7EFya8FeeruKRfI=; b=pmty1R+++0sJZEZIH06Ask+giJ60TNrq6VDsUF32Ii1zq6mWsWUFfFnPUeKmAUMSYv vVmbfB2SuGY1J33WLkbXmds8Wq2l80oYhMcRTaHr38hLHEvY3xdK244/fk3Y9QgXekd7 cXKf4TXDI1BYdVBcqauHnd2s4DVtq/J72y8a7xWpu6/0GTz2bZIvvEwAiOGjYSi5amOl ILFlMLENF7hatNne74T8NVPi+Ljc6l5WO/2yTqOIeTo/5akL+HzOoeHICTi6rq3tf0Pl 7QHp59J6ZefnKVbHQOoWBJvegP0a0350P7HPu+f9fLIPM3iPbbo7o1nGkhG9XRDlraZO aVhA== X-Forwarded-Encrypted: i=1; AHgh+RoWU/ZSEmMTtjRk7+le1zADtVzw8iY3KogDvuIX9y48xSDcMWY2DITbjuWO7yxIchaTwGimDVp3Em8GJng=@vger.kernel.org X-Gm-Message-State: AOJu0Yz5zo1/r04JIcSyQrgTe/hc8F7zfSbOTT5wmHWxInSnC1V1Ek9m FZ4suyGjCF4IS7jTEqJkSzSjp95C1/Hm0gxf/t5nkK5WMOOCS/C9tTCO0lYCMRhb0A== X-Gm-Gg: AR+sD12B+lUn+baytuuVNQL3BMh4bYrl5Cdx534wWmFYZwuSfu2Cjua6M8BGV6dWQJk tVVefU5CDBh821j8KDFHYjrY4LeWuHKmu0isybTzC9zprne59Nm3x8ZVe5GDoEH+SD0cREYyKJK 2+ayxQCuw+91QJ4hcrU7mfxsaH+WGu0i1vaQhmK6VGp4gbh56jEAZ1OiMba1NEnzelm1WtD1SEb 1JcEzuuxIqz6p5t9PudfdscQAZ1TwbKLapm7SbHz1dFznYPXgTb6NqNV/8Dx+yhik+hAiOSIo2+ Z3VH8yM7QhZwTK7ggxOYIiGnke7Y+i6jHnixs52BUNhAoiubS2XVFsHRvy7S2VflwLyeWFaB6VN 86kXZKmE/V8E4rP0ILwBROR+ce7PanPPOM7So3TENQ6XJArJEPjKXNsLoSxPGiHjD4WEabffWZu OAhh5hXpf0jQuI/C3XgPZwKZXhO+NCQf9Nv2mG67CnTOs00PmLuSQC7yEqnHTbNgONFM3G/ncLD A2Hjp+8bp9oSvoZoDJQeuMM3u+abrmaV4C6LV5tvYxeIQ== X-Received: by 2002:a05:6a00:17aa:b0:848:2c2e:c79e with SMTP id d2e1a72fcca58-84fa86e19e7mr2769479b3a.12.1786450871439; Tue, 11 Aug 2026 05:21:11 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:12e1:df26:6add:1ea7]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84fa9574e9dsm662454b3a.54.2026.08.11.05.21.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2026 05:21:10 -0700 (PDT) From: Chen-Yu Tsai To: Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Chen-Yu Tsai , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, linux-input@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 8/9] arm64: dts: mediatek: mt8173-elm-hana: Unmark trackpad supply as always-on Date: Tue, 11 Aug 2026 20:20:08 +0800 Message-ID: <20260811122011.3539250-9-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.679.g6767b8d81c-goog In-Reply-To: <20260811122011.3539250-1-wenst@chromium.org> References: <20260811122011.3539250-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: quoted-printable Content-Type: text/plain; charset="utf-8" Up until now, the MT8173 elm/hana device tree has set the dedicated regulator supplying the trackpad as always-on, simply because the Elan driver was missing proper delays. As a result the delay for the Synaptics trackpad was also omitted, as it was not strictly required under such a model and delayed the availability of the trackpad to the user. The Elan driver recently gained proper delays after power up, with opportunistic skipping of the delay when the regulator was originally on. The I2C HID driver gained similar opportunistic delay skipping. So has the I2C OF component prober library. Now fix the device tree to have the regulator not be always on, and let the I2C HID device have the correct post-power-on delay time. Signed-off-by: Chen-Yu Tsai --- arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi | 8 +------- arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi b/arch/arm64= /boot/dts/mediatek/mt8173-elm-hana.dtsi index 1004eb8ea52c..b9e311fcd9a0 100644 --- a/arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi @@ -62,13 +62,7 @@ trackpad2: trackpad@2c { pinctrl-0 =3D <&trackpad_irq>; reg =3D <0x2c>; hid-descr-addr =3D <0x0020>; - /* - * The trackpad needs a post-power-on delay of 100ms, - * but at time of writing, the power supply for it on - * this board is always on. The delay is therefore not - * added to avoid impacting the readiness of the - * trackpad. - */ + post-power-on-delay-ms =3D <100>; vdd-supply =3D <&mt6397_vgp6_reg>; wakeup-source; status =3D "fail-needs-probe"; diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi b/arch/arm64/boot= /dts/mediatek/mt8173-elm.dtsi index a0573bc359fb..6b9f47f515c7 100644 --- a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi @@ -1093,7 +1093,6 @@ mt6397_vgp6_reg: ldo_vgp6 { regulator-min-microvolt =3D <3300000>; regulator-max-microvolt =3D <3300000>; regulator-enable-ramp-delay =3D <218>; - regulator-always-on; }; =20 mt6397_vibr_reg: ldo_vibr { --=20 2.55.0.679.g6767b8d81c-goog From nobody Tue Sep 29 06:59:02 2026 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (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 0F02E443E5D for ; Tue, 11 Aug 2026 12:21:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450879; cv=none; b=XQxUdcgiDIgGdcTGpYd6ICy323gaQ63aQmWaHeE2PRZvTrFvX6NiqRNbY1AAcYqulrp5T0UPB/AiVkXpP1KoqQ61BLlWzo4vdNycOilP2ZJhvkZmBxhMJwjFsWLhZgp8Df4UZPuesexA5RwsZSjFU5v8CVEyTXdEsvY7E5t6CjA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450879; c=relaxed/simple; bh=zw9K5bulR5RCbQzcch5UFQFm1ClqUI2Eu5cBqRJdZYs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eq0bMNjIUyaKi09L3+u8MwlYbDzYmys02l8FPTVUcuXEwXGI0OgCAR7Rh54ROLzgzCqu3iz3fZTmCTkPscgDLsyBiWuBfCKiz2KhRUe6t/IIs7C8RzzcDvIhikzjW9R6SypfvPyt2m6rN2HMFnbyv0PWepzshX+dpWPxnWkkTEY= 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=R55gbYpG; arc=none smtp.client-ip=209.85.215.181 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="R55gbYpG" Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-ca97d139d5fso2544223a12.0 for ; Tue, 11 Aug 2026 05:21:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1786450876; x=1787055676; 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=/5LbZtLdzstzREZ48zu7bbbJyct6fe22QDz6/0rMi/0=; b=R55gbYpGy9ivCS9D6o20yhuvitL8znHDWJg9vGlJX7pc61gdH+juU7lECmzUNwxalZ X7ngyHVEG78QYf/gDywHghwSBg6snPASWUBoMkrYSh01D7Hv5ar7wcoKThZtwcVMNCeN WCOuw0GFCnRP/BYWSrGlNbLUfBiebsCV63CsM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786450876; x=1787055676; 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=/5LbZtLdzstzREZ48zu7bbbJyct6fe22QDz6/0rMi/0=; b=OXIhN/V8//zoEObv0X+UEVDVnMpQQS8VrTH81+WzBe87+ChGKCLoGF91hcHiEQgnbx dvNWk8zsfJkZkYdq7W6+N2261KgVTXIo9Hn67YDq5ecs2xWGdIetD3TjrRID5jM4WjIw wOhMtUTA4IlANmxZMTWDZ8O0r+7N0avPOwQ4H3Q4nzNHa8sLlRsoovLccAhQoGvxhC4F QuoR3iHQ6Clzq/KtCTDjcz7exILPGahrn/8Ppljgn7xqZzwUzGfaVC1+pTtgdChfgpo9 iEl69KSxL7xanIyYCARW0neYRLeHrNr2O0rZx8WI7LTqem8zHyOJrrl4KjSvQF9X2mls u0MA== X-Forwarded-Encrypted: i=1; AHgh+RrnxR14A6PZ+64jDUL496kZNzJfTvU3T+JGBwy0nnkwJsiIiIzbk6qFlbJbBKxsRjBnjgDBYPu4nJA3ZyA=@vger.kernel.org X-Gm-Message-State: AOJu0Yx0Y3adVcQwbFuHfb3IBSP0qcTMN0rv/oqeOqhIv9yby7iVGIGS 5bGrEFG/KkIJUFNtO09P4+A+8NHdqVL0W37PGymqq3TIJjpXxAs6oGREj9iyvEtMoA== X-Gm-Gg: AR+sD12byOanTM5ddpUd88sxLeFGWjjP+kF4hH4wbpI2yZrubGrgG4ENrNtO5Z4CvQH 0+RRk+o9+ai0rQjM+peNf0mBB7kalY/9Vd2Hi8KrXzRy/SAwSPedH56XQWovGm5T00DtfcgCq0X +BOqO2Whuj62xSu2LiPMrGPHkFXDiju+RcXXdhtrVHdV81Or76rSunehD9/zO6EVZhdG54fT0B7 gWN4Syj+0lmbzmiJiEnim315Adn6bj6ADfmhLEQs8ix+m/qdpQm4ykkZoRzkteF72HOuXPzxorB uzDCgWHz+vnbWtKaEomMEFeBji4qX+6hFg+9RWR//M0hIPoVYaoIXOaiNr5GWyiShm4CrIn37AK iwaoWvirvXK3Zy7IReX/mJuEyGDOx98AtImcvdtH5g3nUOjaSqVDN79aPM3Bn8pCwQ8ddb54/wo PrDYNKaNrfR4n8ZtrMJCYT60WwYXLcnuxPiVL6M7Cj9A4Ci4cEhYNAlEyPqz5tRafdq+LSF78t/ UhXsTHqfHPBJPvgMYMeHOTsA3EltYG1gNnr9SQ7p8IxcQ== X-Received: by 2002:a05:6a00:234a:b0:84e:915:d7eb with SMTP id d2e1a72fcca58-84fa8889f0amr2532844b3a.37.1786450876479; Tue, 11 Aug 2026 05:21:16 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:12e1:df26:6add:1ea7]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84fa9574e9dsm662454b3a.54.2026.08.11.05.21.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2026 05:21:15 -0700 (PDT) From: Chen-Yu Tsai To: Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Chen-Yu Tsai , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev, linux-input@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, stable+noautosel@kernel.org Subject: [PATCH v4 9/9] arm64: dts: mediatek: mt8192-asurada-spherion: Add Synaptics trackpad's supply Date: Tue, 11 Aug 2026 20:20:09 +0800 Message-ID: <20260811122011.3539250-10-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.679.g6767b8d81c-goog In-Reply-To: <20260811122011.3539250-1-wenst@chromium.org> References: <20260811122011.3539250-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: quoted-printable Content-Type: text/plain; charset="utf-8" The Synaptics trackpad, like the Elan trackpad option, is fed from the system 3.3V power rail. Add it to the trackpad device node. Also add the correct post-power-on delay, even though in practice it is not required. The Synaptics trackpad requires 100ms after power-on (or deasserting the reset, whichever comes later) to fully initialize. The power is always on and the reset pin is not routed out, so the implementation could try skipping the delay. Cc: # Without driver changes only lengthens p= robe time Fixes: 925ebc0cd55c ("arm64: dts: mt8192-asurada-spherion: Add Synaptics tr= ackpad support") Signed-off-by: Chen-Yu Tsai --- I think this shouldn't be backported, as backporting it without the driver enhancements just delays the trackpad probing with no real gains. --- arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dts b/= arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dts index 68caf4c58cfe..8adbfc307fca 100644 --- a/arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dts +++ b/arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dts @@ -94,6 +94,8 @@ trackpad@2c { hid-descr-addr =3D <0x20>; interrupts-extended =3D <&pio 15 IRQ_TYPE_LEVEL_LOW>; wakeup-source; + vdd-supply =3D <&pp3300_u>; + post-power-on-delay-ms =3D <100>; status =3D "fail-needs-probe"; }; }; --=20 2.55.0.679.g6767b8d81c-goog