From nobody Sat Jul 25 01:24:57 2026 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.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 06CBC437130 for ; Tue, 21 Jul 2026 07:54:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620447; cv=none; b=F3eSMm16UHMedeO4YfguMU78PYPWQmcFkJlU63aDOsp+V3Y1LCrhAb9U2xSd3cvSavpCtzWp1su80lhVapexuO32qkA9zHPKhtb6Dq48E9zeoEAkzIyJtrWikDGQExODoiMPfDJx8hk0W3Trr8h6JVGe1XLgQAn7jH3xSHHFkjk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620447; c=relaxed/simple; bh=fGqqjYxRpJEquoSDoUijzydkeIkOzEwNSSUXC1u57cA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PhxC9bPgLKCrn97+VEGrO4VsqtlZ/H9Fpnvo5MFCG/1Yuo8C2S7rIM47BKegL+3a/xf8L9LUoFTbBQeyW5qKBEvYYd+wjRpYDcTZ+4A5BLIlf864ZwrifYB5jWTT66ogfj+2pnErUfEIgjTWj6xlgQkihuYVmOa6fb75PResQzw= 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=AY+cYaQ6; arc=none smtp.client-ip=209.85.214.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="AY+cYaQ6" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2cacf197759so125161455ad.2 for ; Tue, 21 Jul 2026 00:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1784620445; x=1785225245; 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=8rCW+zOBgfvbnw9BhnKL6QqmG00TxqWezJ2oP+m8mTI=; b=AY+cYaQ6eaF0nDZ5s/z0NDllGG5k704vJ+ij2IACyMhsQ7Rs0yXHKInTAztdwlJ0tW FhkTJFLovCrFttnO8CgWIsTE42EnffgWPJAu+LmKbjwZMg4uE8zSLZ+IEIidjmUaYkpd vS2ME/oCz3lOvB69/+fTui+7uN4GkdJzL1b9Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784620445; x=1785225245; 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=8rCW+zOBgfvbnw9BhnKL6QqmG00TxqWezJ2oP+m8mTI=; b=jrURrO+aWKz8kXgpZ7zbDmeejZs5Ht7PRu1Zv9M/ie5cGCDE6GKPg1PIdatQIqu8kP wSM+pRmGBWdbswWpTvyoqkNo2EB32e0s6Eqqs+iCk7/G+ZQvC6iMqAFbFwddF7oo52C6 BIxLOfI9ToWwxSoi4tfG6ItkcAH0W0G2RtflKw1y+8v9EKBhNwJySkrgrHVg9r+2kWwp e+MchP1uuhrSH+v8DUYQSoEtkwbEH5yycs/hwQQdcFme06lQi4zDr/b/8v49nWins/Dj QV1h0wpM/S732O4/1/V1GexN8OgjUwP9iCNhMgbucefkgBMXmqw7plYM5HVagxWj+1Es eeRQ== X-Forwarded-Encrypted: i=1; AHgh+RpldrN4uiHr4ifEPPK67W5mDC/t9veGOMCcndyD7nHMKQBymGxv+yAXQFciAIG6lxTeXcVN95BNKtQmV/c=@vger.kernel.org X-Gm-Message-State: AOJu0YzYfi9T0f1c3ib2xwhMckJmmucNSf8BBP7uo6a4Int/lEh2wjkI V8N23bisdtEFhOgKUBJ3uAX2gaarERVDerPGqOrTFgr/7oP04q6akryT4WG5PrGTfQ== X-Gm-Gg: AR+sD11DEn5Tgi3bbxJoV47tJHWHNahhh1Z1qLQzfKYrKr76hG1t3jnLiBzqk4x9NUF pWfLM45rW3mdSjMStbZh6L1AlJq2oWqgs+cbeQ4Y1NtlN1WH+lH8xQcpHZNgAqcNDYwdQd1hkZ7 tTTQ/3zfNVCIxOHmKVlOqwsvDh/fT+xRTKNOxexb2OKAyFk0kJ9G7FinYew/wzwm8x+utMQqxJs AvWSV75LTSKljLi3tmGfFGilIedm/7d3wqr1+IaZCPFLECh9c3FQdb7PHSXtBjbtqzZyOpvcERP US5yZbAF7+fte/c1fkEG6DYx/yx477CxZBkOEL+K4bLcoy6QmTQCciZ1f+W+/NwBGCN+7QG5VXi rtc0io3MIAQOjy72cYdsaSTcMIP1m6WM+ms+KsVTnkj7q54yjrpFI/n1lqeIYAznU5iz0ZVCqtK CZtU68TelZU6Eo4S6SsYKJdI1ix8AbqZ++wsBv/qjeHZFECaxWxRdhIG7CzGn+m54+RrW7LQ== X-Received: by 2002:a17:902:fb4c:b0:2ca:d91d:d3a7 with SMTP id d9443c01a7336-2cf34804857mr128068305ad.10.1784620445333; Tue, 21 Jul 2026 00:54:05 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:3916:f048:32c3:931f]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf3448f705sm70724175ad.15.2026.07.21.00.54.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 00:54:04 -0700 (PDT) From: Chen-Yu Tsai To: Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Andy Shevchenko , 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 v3 1/9] regulator: core: Add "enable and wait" functions Date: Tue, 21 Jul 2026 15:52:15 +0800 Message-ID: <20260721075226.2347933-2-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.229.g6434b31f56-goog In-Reply-To: <20260721075226.2347933-1-wenst@chromium.org> References: <20260721075226.2347933-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 v2: - New patch --- drivers/regulator/core.c | 53 ++++++++++++++++++++++-------- include/linux/regulator/consumer.h | 21 ++++++++---- include/linux/regulator/driver.h | 2 ++ 3 files changed, 57 insertions(+), 19 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 1797929dfe56..d14ce86d8f7b 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -98,7 +98,8 @@ struct regulator_event_work { unsigned long event; }; =20 -static int _regulator_enable(struct regulator *regulator); +static int _regulator_enable_and_wait(struct regulator *regulator, unsigne= d int wait_us); +#define _regulator_enable(regulator) _regulator_enable_and_wait(regulator,= 0) 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); @@ -3043,6 +3044,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; @@ -3112,8 +3115,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_and_wait(struct regulator *regulator, unsigne= d int wait_us) { struct regulator_dev *rdev =3D regulator->rdev; int ret; @@ -3159,13 +3162,24 @@ 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 (wait_us) { + ktime_t end =3D ktime_add_us(rdev->last_on, wait_us); + s64 remaining =3D ktime_us_delta(end, ktime_get_boottime()); + + if (remaining > 0) + fsleep(remaining); + } + return 0; =20 err_consumer_disable: @@ -3179,31 +3193,36 @@ 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; int ret; =20 regulator_lock_dependent(rdev, &ww_ctx); - ret =3D _regulator_enable(regulator); + ret =3D _regulator_enable_and_wait(regulator, wait_us); regulator_unlock_dependent(rdev, &ww_ctx); =20 return ret; } -EXPORT_SYMBOL_GPL(regulator_enable); +EXPORT_SYMBOL_GPL(regulator_enable_and_wait); =20 static int _regulator_do_disable(struct regulator_dev *rdev) { @@ -5372,30 +5391,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, bulk->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++) { + consumers[i].wait_us =3D wait_us; async_schedule_domain(regulator_bulk_enable_async, &consumers[i], &async_domain); } @@ -5423,7 +5450,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..a69157c9b5b5 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 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 ms); 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.229.g6434b31f56-goog From nobody Sat Jul 25 01:24:57 2026 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B38BE43441E for ; Tue, 21 Jul 2026 07:54:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620451; cv=none; b=cSR0ASl6v1D/szzLzeJ5GLgrZm1cNPuogUIU2MAGK8dUwtLxO+UWHKgPBNW5qtilpW5i9X8dxKMj8jfJDf1fNZgrgPYcB41/ryJWtsNXC0aNPuNIoQDuNjL+2MsCcCsQM1D9V73beoRy/kKp90FOiiSwwdPxJ1K0GhOVmjtLAiE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620451; c=relaxed/simple; bh=2aTFqtE74mVxCKzF4QnPnvxUaPaVEshhhNvwJjbpygI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OLRxa/jVwUjnisJr24+YCbhV2IWZucUscp6hN+4NI07SZLzBG1khdwiWrpkK9tfjOwb6wpo/J0/E/Jl5qSlJKt2H/YKXwP9ZepQ8pZSch9HlDgO51UxhLpGCM1P9ylgjhaRXfeBZC7wGRGyHOLnM1a6q2yhnanrS81dY7RCEhp8= 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=QCREa322; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="QCREa322" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2cf6d65d8a7so22721015ad.0 for ; Tue, 21 Jul 2026 00:54:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1784620449; x=1785225249; 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=CGtEOhOpR/1OiCj9qufh1O1atPkJph2JTGUTc+kCL1E=; b=QCREa322kDGkOIcVNmQA7ZLYuVCx0ATnZ6BtEAahiV7+gMVUOGJbT0KgwZj8rUG4FV 0PKCCg9P4rU2izCqIKLUjN2rfkjI45I0/QtUQvZlDxVwpF5OLDkPK9o/ictCmGddzeFL QUFL4Fi4tKNER+1+xEoRDWJfqVDytzdsoLeoc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784620449; x=1785225249; 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=CGtEOhOpR/1OiCj9qufh1O1atPkJph2JTGUTc+kCL1E=; b=P4Z7rnooULOoVdANhD+IDS8GD4DXOrYf9qjDGw3cVf+8x7JWxkDX1y7kJtngepp9io +fhwP8srtlGCTsnUttM5HnI3J/ajABwToAcofpo67/k8DlZkKpjK6kApcMMqxN06ocnM sZSV0EkuEE3yPs78sz/DqrsrfYipJjaa7vrCVs9C2oBwwY5NIeJlmZuoT7TLor2iPVFZ UsIhMW4y56PI7XCNyIj4Xf/NUrKOqkfwqEZyQ3EgsDpRL7kaV0eKFt5q94L5npS2J/CI ZLRuLGSSGHo7mM4lnYrp99lo2a15QOqUwpTT/GCRVkc07gfroC30wIABNcJWbp0O5wN3 uFnw== X-Forwarded-Encrypted: i=1; AHgh+Rp2ndEftD07r0qjxfn6Ck1Y9iQ2VKwM1AKFiJlKeEsj/74LZqz2qM7/AJgtn1TZPa/jxVLkFUXHFu87NnM=@vger.kernel.org X-Gm-Message-State: AOJu0YzVWEtWQCgoOttv1tF1958/N418jECFzXmPv4PvTl6Yg0l1Hiy1 8c7pR+F7fvMzSb/921VBpUz93bKgxQ1r14/0x0pXxa1g12PcZenrqxOrB0hblfUtyg== X-Gm-Gg: AR+sD13oIPNNgzG0ssR4MBrDGjn2gqXkuMIJdBJF3mlZfo1gozNDRIFQ6TQBvs1OKFO 1QvvHzEohEyWQnFeTrGU2HUPMhsdYeBwE4EJAvD6zWtcsrejsrW+Nm+i7mvDu4cd3XHXRzxLVnt MRfaYzXIzUMboaWzn2BJ7rzqw40jkhp3NBFnt5dzOEgLNnmHIjcBzyxH35Xe0KUU+o2wyMH6dta zMdD4Zd9MJXF4J/7agYUWVxl6gVHLTnIocUjrM0Jo284NdPGNwYuoxBva6quLVc/VUFnm1wMdFb VqJA7Xz7d9qcXnR2ip3zr6vx2Kh4J0uf2jm6gCX5c8D1AfsiNqPzkzz++NyqcrbZRexUfOwWGpv ZMq4IJ/ADcG5YlGFKvNZ/hE473Wi28YOpSQyQVDchqpC6C1aVRh2S+thSTJrG+oNI+oH/EC5ezf XwladyG7bE1nQtF28BbUfpSGgucBs8MtNqQxOwDdh4Dyi0TiTfNRVqzeP7+Ac= X-Received: by 2002:a17:902:e748:b0:2c1:98b7:ecf3 with SMTP id d9443c01a7336-2cf3494aebdmr189718205ad.23.1784620449012; Tue, 21 Jul 2026 00:54:09 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:3916:f048:32c3:931f]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf3448f705sm70724175ad.15.2026.07.21.00.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 00:54:08 -0700 (PDT) From: Chen-Yu Tsai To: Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Andy Shevchenko , 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 v3 2/9] Input: elan_i2c - sort include statements Date: Tue, 21 Jul 2026 15:52:16 +0800 Message-ID: <20260721075226.2347933-3-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.229.g6434b31f56-goog In-Reply-To: <20260721075226.2347933-1-wenst@chromium.org> References: <20260721075226.2347933-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. Signed-off-by: Chen-Yu Tsai Reviewed-by: Andy Shevchenko --- 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.229.g6434b31f56-goog From nobody Sat Jul 25 01:24:57 2026 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 E7FE0435536 for ; Tue, 21 Jul 2026 07:54:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620456; cv=none; b=ShinD4vX6zFdm8iGrxHJk3n8Ul0+CRdUjDgbTwm0L1fyPQBwOy69aZxNjX9Rc0X1TvfujOBs+JJH/+vMW6fntPCDqYFLq16OHoNsh39XhZd9UCZayyHWimoy9c/Ju3HjLXBWbCPnZvym0QSTaUKdilplhO58iOB/QQT3DqpOnSo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620456; c=relaxed/simple; bh=mZz+oxzJzJ+AFnTHJSeHvs13/lb/cPqLyNtaVfdyUoY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c2w5sX4T4BqPTq0IouRYnpyye5fRJAZtpJKvbJyFYyeRJ7ZHFfEHhJrFk3ihu5mAbJ5UQEcMlM2cgb+D001JnltLDEecVxporqHfuy/s0Uv87Qrrv770U9Ueq6LtVHPN0weoxiktGSiEJjh1GwFLHRqouqLhnsR/zSvAje/wwx8= 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=eHRcjrFJ; arc=none smtp.client-ip=209.85.214.177 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="eHRcjrFJ" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2cc73e322dbso128760915ad.1 for ; Tue, 21 Jul 2026 00:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1784620452; x=1785225252; 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=Sl4qlttmKIif7Xuk+0Av+jVf6HGOZu8iMGZv9Qz/Mv0=; b=eHRcjrFJ4NE6VohnhBYzld9TrjywI2x4/yh8PXwCSx55wLGdzXb6CEznhk73xt/2wj t+tufpCb4j3ZxF+kR9vbZpOMMkEQ3qJGxpOYGFZSninyCeWCTuyF5BBABZx5kPrsJ9Bt eF84wxg58OntBp+ZjwCH9n6331Yv8XlmTtWi0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784620452; x=1785225252; 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=Sl4qlttmKIif7Xuk+0Av+jVf6HGOZu8iMGZv9Qz/Mv0=; b=DchM0reubai1kh43ZyTcMnksmYF/Zi/GCv8vCdIKZzLUCbeBEsx4IDU97Bp+fQ7+QW H1CNddbky3+qNOCXsHgBj1ZcxEcFbZgZHqUoN7d/h0N38b1NZTrDgOH2MDcsKUA6d/Zi 8+kfFFS63E8lFvUg68sAZLJ7xr7D7TgDDGFnFl1fh1JzJV+j1XzBfFq4/VVe0rJGlgSx srC/epPaZnrY4MDU7eCHR/3B6H0+9YeOFr5UhfiDldv2mv/XiMR19hnJHLLXabGUZIuW bG7axuN/W7gKwJOYysDaNSln13A8wbQcjZpWyPK/3sLosf78fZuWW+VFde/RIkTvOoEO Nmag== X-Forwarded-Encrypted: i=1; AHgh+RpyLcXByfXxMA55iHmL2VlPAam1QessdKKHJbQu8V+hyJu1PKxUgsYzE6o3tSFKPKYSYrN9UIG/QPAUu/k=@vger.kernel.org X-Gm-Message-State: AOJu0YyJsWcKn5xiO9Peg6Qns3kqOAhMPoggHZlFr0aCEz7tyRxQ9kJI XnhiO5LP/zMtnqByJoy5l9GCcBtzm4HvjBe9Z1d+vXxh4LiPy8i7mmYc1glC08sLmA== X-Gm-Gg: AR+sD11VKt5tKiY49ME5JAl3/lADw+tuTCR2nyLSq4BDnjjIIcCFWjYyklBILkhi1Fv lHZZp+F2Y06fQweC3rYEPJiuonsdUngVGBa1ZsvKH0TCbtZYSypjPtlBWGDwgtxAdfzyU7e2Gx2 G8zPDdSKDTFAT4z6PiRv+Sy6/vDBhG6Fv7KjMwuPaL3PKm/w8jc5M8hT82FLh8GH9sKcC9NuBur ngqi/1gW6gvDjAxI2OllZkGF8z44gb//LAVyfcxsFxZlrVz/9NPlx4lf8cxXK3Ii+0T2ALx4y+x v6VVneghGZrKKHbUmIA46Q+5fi6a/28cXwZCkZ5P8ZbxEe9qGeOBvdbTaKw3qABFTQnTfGiorBW Wbkb5XC4IQsUDqzzGLk11IDUaeXjwJK6PWuNreqkSpMXxorCHZwMF1rD/vl2jAKMaCNGVg10FOv xDaD++TFG5G1G9lNuN00qAmOmJWwzbLdfVlFgN6YOInKeanhcNwSZV/XPNG6c= X-Received: by 2002:a17:903:1210:b0:2ce:d34a:5959 with SMTP id d9443c01a7336-2cf34a3a5eemr181108535ad.44.1784620452343; Tue, 21 Jul 2026 00:54:12 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:3916:f048:32c3:931f]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf3448f705sm70724175ad.15.2026.07.21.00.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 00:54:11 -0700 (PDT) From: Chen-Yu Tsai To: Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Andy Shevchenko , 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 v3 3/9] Input: elan_i2c - Wait for initialization after enabling regulator supply Date: Tue, 21 Jul 2026 15:52:17 +0800 Message-ID: <20260721075226.2347933-4-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.229.g6434b31f56-goog In-Reply-To: <20260721075226.2347933-1-wenst@chromium.org> References: <20260721075226.2347933-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") 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.229.g6434b31f56-goog From nobody Sat Jul 25 01:24:57 2026 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.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 40E01434E2F for ; Tue, 21 Jul 2026 07:54:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620457; cv=none; b=N6XZnqGybT4dnPxaGoJwSCApRSLFKZtKA/kz84GUN/ldcDg3KMQpK+Lxmun9kw/i9uD/vk/Xf/enO6dTPTYVFAr6SI9I5mGy1+AcPX0MMlNe/rYFqpvN8DE4wSBelnHAzRwE80O2F7VStxjCwqN3CgKfdygUwOf5mrYezu7RZKc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620457; c=relaxed/simple; bh=J3v6D8PZoDet97Lhy7NyAMAWEZCEiDewv+amHOXW9oI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q3Pf+1xUTCIMAvgdw9NNzc9MyZFWzaOU7dNEq3GCBKOtrojueq9c0MemnsVdYZxQrR79omQnhuBZ6laHd6qVKuSnr/ju1AKIOrAEtvw+4MUeLJHXXejwLhv8hrxBXZgbh2oIgv6S9wMYQcylqfG3m3uro1BePClqVun2e+X8yNc= 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=SUL68HRM; arc=none smtp.client-ip=209.85.214.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="SUL68HRM" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2ccf2360620so69421745ad.3 for ; Tue, 21 Jul 2026 00:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1784620455; x=1785225255; 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=SNKmqRLcn9Q9wFj4nPUvbsCt3JMsfIzkeIOJzLyzvCI=; b=SUL68HRM9N0nP1WKCb2UCBU8WNS8USD3r8qKfWisijf75G1XTCZgftHcPQTJkbiaOi KywUj8Ubf2/3s0WCHC/onG25jsQ61Uxvs260icpkH8xUwKTGCAisqdt+9WjAdB+kok41 mSEp6ThAF7DhAjk5ptWS/nBFFrLg28DnFvlcI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784620455; x=1785225255; 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=SNKmqRLcn9Q9wFj4nPUvbsCt3JMsfIzkeIOJzLyzvCI=; b=tZwnSwl6lmQBT+dJY5uO+UqJFXaOBiVWPQE6rA+JUroNc4Kz767Gp8sgF5Cj8nWRMU W7JGB69jGPtrqaIrxuNEUoQd9UtmdcmpsRNQuxxXg5EnLU9nKsNBUljEQf7IAzHuwYh6 PdJkx6jLJZDrhO+jJk1Ma1fEHOeh/19MPggc7ZLP42YV0gjTj5+c1rYq/7V7VdBvy/HN frNPsaTftFrmrZ0JYqY9cphAtkT1PVzXMITwYg315FQrVeUOPNugEhX12hRqpjMkkWii mOQRbhtuVDcHr8kIIXjKLfdIhz+v1/U7pLdluf3KugZOz8HxkK+PNzl2vwOPw7wzq24J DoNA== X-Forwarded-Encrypted: i=1; AHgh+Ro9UwLj8uqW30+ojD8C45nZNmXjCxCkyyliUhhx2swkWKb5NVEwMyWVACvb17vXcYmqMSVHwz+H5NqFXTk=@vger.kernel.org X-Gm-Message-State: AOJu0YyxN5xnOgLHGneffjVMXwCy5tUhTB9t5Dwh57+iCeHusv5SKzqH R2zNsHCHayMDcrhGtHix6sR0vvtnRlo4EowalDTub2Qe6lx7ZLCR4UOPKNktp5odCg== X-Gm-Gg: AR+sD12dFJzrtWX/4PYUeGWRp58XpfswB0VEEl+tG7BYa6uzFWkVe+sQcgyLOYpcMDn kgETwBYCHxsqNJwe4cy5iZYvnI8E71b6bNn9F8hp+W2kH4u8EnkHqNL/R4g9TmeUdvRYC5GLMDT 5eO27WfXpPW4Pds7n4uCrmviGSiwL8GmL81WJdtegcTzB0dSokxbb42iEN7uArxhvYaaeW+Llfi 6gUgdKJnwxCv2T2zL+tUf/s01C8iuGeghNiLU9XbBF7nBgYMJUCxCFqx39Hv78fBfgPYwI9yzxj xV1NFvEAg2P4sTuFtePbJWM9fMpcnjKbwVJTp45JtNZL19tuMD4DAFZ1ASwXfqBspBTBkVvB0Kd wWXiBX8GH3TZjI2lOL6kjRcSlHzKyzIRpVNWHr2fNRKAcFLXnziJ8nGXZBVXVFo50p+b9fRhZPs 3sQ15n7Pj8ieYZ26sUrGPNYZBn9WbpJXlE7Hm5iF6+bb3PFHEYhqZB5upa/MMf0+j+igM5xw== X-Received: by 2002:a17:903:2f84:b0:2c6:a012:6241 with SMTP id d9443c01a7336-2cf34850f28mr198999395ad.6.1784620455632; Tue, 21 Jul 2026 00:54:15 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:3916:f048:32c3:931f]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf3448f705sm70724175ad.15.2026.07.21.00.54.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 00:54:15 -0700 (PDT) From: Chen-Yu Tsai To: Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Andy Shevchenko , 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 v3 4/9] HID: i2c-hid-of: skip post-power-on delay if powered on sufficiently long Date: Tue, 21 Jul 2026 15:52:18 +0800 Message-ID: <20260721075226.2347933-5-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.229.g6434b31f56-goog In-Reply-To: <20260721075226.2347933-1-wenst@chromium.org> References: <20260721075226.2347933-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.229.g6434b31f56-goog From nobody Sat Jul 25 01:24:57 2026 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 7FD3E435ED0 for ; Tue, 21 Jul 2026 07:54:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620460; cv=none; b=Zc+q9yM7YsrmkT8LvP0BoQ0nB325xbpTV9BT+V+0ymF2iOlmdqu20aiY28cllF0r2+dwBodbJQw1+DzWQyDZzcWEeiMlH4nwuOk3KhGp+brNDsKBQuUeHtKVk84eoE78+D/3Nrh+SKUzhEXUToFt8UyAD9Y2KeWQoWdwkvH0N4A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620460; c=relaxed/simple; bh=v6GPocRuAdYXxfW5GCiY7PkoQqyVIhzeyfAlaB/90Io=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ConAskHiaZL4fM2+qHaIhoSdE++jGkKpGaFxzuysmQUcpZz1T+mTPp7fGavPU/xeokex7Wk9Or1/5MTOdGObzB2C7kD1pNjCZBZBUpgk+0DGCMRe1njHwhG2QkYtXCeuBI+DnRxlHTISilFvZU6qpsPnvonC9YdCTO6usoR8oFM= 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=QD/LPHKO; arc=none smtp.client-ip=209.85.214.177 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="QD/LPHKO" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2cce6a0c9c3so98888365ad.1 for ; Tue, 21 Jul 2026 00:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1784620459; x=1785225259; 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=fwE3F1d5K76sODY+n24O04o43zDEBUUtH4OGbkRqhTY=; b=QD/LPHKOGNi2+XaBdLMGVgrUjfGg41mV5vzf5LDIL0lxu/nj+B8IiK4L7jv2Q6jqLy idSCOH5tFaGoXd08tPcjpA3XsK4McqhItPoWhaeqM1mmHcB5NQlTWcipQ/c0X87htmTr 0wS2zOACOf6tn4IXzjpPw/leCVAUW5QjfVkws= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784620459; x=1785225259; 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=fwE3F1d5K76sODY+n24O04o43zDEBUUtH4OGbkRqhTY=; b=hQDO9D4pTn3IBRav0sWMCM9dWgkXt9hH8Dd5cMOxinhrqr4tuDa3bMYQJviVR6JWSt ofbIbNNhNM3cPW7vZXN65mNp2Wq1n+kji+qDi5P+/n5fq3qjadqdrztYioh+UqomeYLq aJxnQ6Zs5WNPtFOTmAf2FW5d5lPmApjFZkXdCk2iWtKVD11ztJxovYxCPdmXozCpfE7+ EnhSnmQGUOMRTe7ZxqYGsRAaR6vs3nutB4ubspGXhJ0hHrCSsGW8FnlUSRH6b5axnC3o 3XCsHgPfCux07RK3bwt2eClKh5qhHTrF2jlTFXAHuGSsBeaqCbSBwIWHfWddk7oImwta 3CdA== X-Forwarded-Encrypted: i=1; AHgh+RpXbDuGcKWLU4JpcaGgvC4wOhuilydxpk6I7AbBE2q4sWp1EIMtO2sh9JImLiizU/sK4q//UH7bFsH4Mek=@vger.kernel.org X-Gm-Message-State: AOJu0YytOpMnd7aOd6SiKBdA9TxqjlZHhrYcSgj9Yy7r2SZAT3TB/sBh ju9967MDx6m47Ct12QKN3EIMn952AI851iDgFuCES/3+VtvT6kS14JKUi1VKcaStDA== X-Gm-Gg: AR+sD12zU1uXAL/NlJf8mVJs3uHe+hB6lOjqDHJ1ZzDlf82AS8xqeLhPGC0qasIAc8Y 3fboPwJmyCF3ldMSQ27gvZsmlAFfR3MYmNC/C+2pYt3hdF0w9KUqnUAxkOQIndEMj8iYEYVI6p3 q0X6Ie65plyNQssCx/qU/t+uJEDq08yXrxNyomRudDn/OmZN1zG7R3KlLZWDK8ygmaWNiaaylDs lJwopBGpe7kvgPrp+z78mm7vbknNiZCNB4AF6lS7C6p1+YxX+M82IUQvhrS/Tyg0SjGDJw7MXNb Q95qJrCg2u7jjqbYGqmME6RnY2rxv6/ZJq49d7u8er3x73HZF5oLUbz8Sk337a6dlK0tx49vGzF Z8fwqmKAIwMfU4NcndrioRsrqKTsqaELVyzJniYcgMc1S5tUKY+lUoWsJW3emWY6Z6lvokg9LwA IYMYFa5z8tCBRn7ZittsvK/95Z+xP610u59UzY9Zfqzu9NW3G7+mdV80l7C+U= X-Received: by 2002:a17:903:1ae7:b0:2c0:e5ee:f554 with SMTP id d9443c01a7336-2cf34895672mr185287855ad.8.1784620458954; Tue, 21 Jul 2026 00:54:18 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:3916:f048:32c3:931f]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf3448f705sm70724175ad.15.2026.07.21.00.54.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 00:54:18 -0700 (PDT) From: Chen-Yu Tsai To: Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Andy Shevchenko , 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 v3 5/9] i2c: of-prober: skip post-power-on delay if powered on sufficiently long Date: Tue, 21 Jul 2026 15:52:19 +0800 Message-ID: <20260721075226.2347933-6-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.229.g6434b31f56-goog In-Reply-To: <20260721075226.2347933-1-wenst@chromium.org> References: <20260721075226.2347933-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.229.g6434b31f56-goog From nobody Sat Jul 25 01:24:57 2026 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 E2226438467 for ; Tue, 21 Jul 2026 07:54:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620464; cv=none; b=t21aTp8razf4wXVdGHCqnfF209IiBbqe+amnP+1d05GrGfbPzalSPDK4d494KDD8Zgi/ICEt9Tbp76N5BzkpcN0weQLABf4FbRVneK16Zz5I301l1GoXEqdXuSCIlThMp3foxdscDlCij7T6js6NjWaw5pRz9otpnWnOq+E8iDk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620464; c=relaxed/simple; bh=9Ni9zhrtKci5P2BRwTspKb8GrclLS+sUdzCWkor5diY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UcNqO2IC48h7Q8pUbEuANAxok5Fc6ps5mSmVSzrCfZQH29hjLoTND83Dwe+qZGb/cCgpZwQbFy+0b6wu2hCf93EvHD2DR1FXV5HN9ZKTwipB6bUqhD1sDi+90JzpFYvS8Ff7mRW0mJdATNSUEpgKSl/jjkz5JuOCQBuFa4B7NGM= 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=jtCD3UVT; arc=none smtp.client-ip=209.85.214.182 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="jtCD3UVT" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2cacb8416a1so75660785ad.1 for ; Tue, 21 Jul 2026 00:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1784620462; x=1785225262; 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=7iH2zA1ruu4tS3rL/ntmqLvjt6Xg4qydbdtr1Vk28d0=; b=jtCD3UVTieOZoQqULOsFiXtIiCoplzhCAv/fsA99FqyzfH5Nqxnw59NIdTh3ofLGUW qvtbHKYC16tah68FgbRWN1SeZy6kIrcsQ0YA06NLuzkN3R8jw3Nz4ISvdISJ+XV7U+73 TRgTcJ+BaLButP4eeMzVzTttK+9/r0PnfRElI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784620462; x=1785225262; 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=7iH2zA1ruu4tS3rL/ntmqLvjt6Xg4qydbdtr1Vk28d0=; b=NWEIuuQF8kyJtxj/R3+w4doAI+vQyWkSjZK15A0ekxUKhliXV/GUkJK8IymB/SfLFc 3BkPdcfBtpz6Pk7QAMipzCqUK5ueKK5JfvH06vi8ZsKdmq6I6BdUBKhkDj3QEcrqlTRf VKJOIsUG85j0iBsEtq6d5ncsGsx72GV2nBZ4lo2g09dKcP2DFR/bvN54mCS0VrQ9TOaa cWzQpJY5XRCAg1VC7q7vaJjPuqOMU0lrNaqFlGyXvFQBjYNvkauUMRYUL8wkLcnL4ojw 9av7+GncGGrKqm2TSYxkPdop5ivN6w92m16ABowB+u4bY+fkhOy8n7Yn4e3fmcrJQG/+ LZ/g== X-Forwarded-Encrypted: i=1; AHgh+RpomMViMDYGksLi4B09CLpjvGGN71qzLtgfzDo4aDJhgRiZRpc+Rht09AwdsinyFvZjKkKFonDk4aZ79gA=@vger.kernel.org X-Gm-Message-State: AOJu0Yz5+kl8hF3sQuE3w/C/87S8H+mmhnbp6hOGL8yFBAHJdVwtGfU4 kYQsPdb+wrK1tYTxJ8BqMKeLAWeH10dJ+7YtZFmo6IQwSE+LJqL/Njb+Xb7n82uGDA== X-Gm-Gg: AfdE7cmfAP2M6KTxE5J/9L2RRR9GhuSpcbPJIFxVeALJHyQ0ysQ0Gbw4Mzgoc4hKbOc VwO0j9weKK7z8x2SxZtJBJV8p2nm8HbGo23ax4I0gh+ekFxx7U5mml2aX79hKzNjzbdCAHiaRF0 oQWLtGE7qbINzko6YdSiZ/An72aZOFbUBzRBk2kNP4McqIQN+zv0N0A+85m/5+tFy2oGK6uu2qa LsCWswRrJ+MMPZEw+PLs7YQC6bkE+fgIJhw5J3MZmLjJzE5QZxkmB/WYzN4VaEgyNb3dlSe+1Yo TzM1DVzv50pJTLq8NuOC19YMQrKf5mJituw93ZeTZsaw3WCn4OdHECox4Qik/e6fvLEOGh8P4UT 9tOm2ERjzzpXjFsXz0s5GBv4Ufz8j13/Bj+TkxFNSyjao3wNYQOIIxguacddts8QXtn8bBqEvWZ WAHIHSRHPmoE9Hd9AfEpWk56gX/E5xGLm6K4arB7DGZheBW5aB71GKWnE33hQ= X-Received: by 2002:a17:902:d586:b0:2cc:df15:91f5 with SMTP id d9443c01a7336-2cf34a2a314mr196331925ad.44.1784620462223; Tue, 21 Jul 2026 00:54:22 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:3916:f048:32c3:931f]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf3448f705sm70724175ad.15.2026.07.21.00.54.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 00:54:21 -0700 (PDT) From: Chen-Yu Tsai To: Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Andy Shevchenko , 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 v3 6/9] i2c: of-prober: Defer regulator_disable() on successful probe in simple helper Date: Tue, 21 Jul 2026 15:52:20 +0800 Message-ID: <20260721075226.2347933-7-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.229.g6434b31f56-goog In-Reply-To: <20260721075226.2347933-1-wenst@chromium.org> References: <20260721075226.2347933-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. Wait a bit of time 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. The 100 ms delay was arbitrarily chosen. Signed-off-by: Chen-Yu Tsai --- 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.229.g6434b31f56-goog From nobody Sat Jul 25 01:24:57 2026 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.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 2BACB437846 for ; Tue, 21 Jul 2026 07:54:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620467; cv=none; b=OFLFct1QVv5lVLxiRsIbvXiDAMI/lq2+50CkoGyjdwhAMn4YyHrCUaqDBDYao/VVHtQPT7p8FU8l8E4l70S5NgxiulOdfuw0NzOJbLk7sxxC/l/IDZHFonl1UC5/AWaQ91YzY+l6LHh/6NYXzPw5FwwEYpwuuXoHy6yuqqvs7Ik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620467; c=relaxed/simple; bh=k0D8mghOQr74tTyVbSbMDMu8qtmXQ7oexCZsNGmSAYc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Mt70VPGhwfvyGasd2XmhpAIdiuTzFKlXhoYhMp2AJRPJ/OuiLeIcf4wMLoCNAlv41QtSgAzoISGvJ9JTEFf4kuvsT0Rb/Iv5NxWYFTeSuTxNArJ7iGCz4N3Q4xSRoIiCmcISeOaf+stzMAA2Sdhy6LMmOmlaHJ2K6V7JgsspPS8= 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=H0UyOfHb; arc=none smtp.client-ip=209.85.214.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="H0UyOfHb" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2cf50c6f235so30000635ad.0 for ; Tue, 21 Jul 2026 00:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1784620465; x=1785225265; 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=+HjmAlbOs1MBYQdjObhXrJEH8vF2H5aB6qgUxYH+azw=; b=H0UyOfHbMoVbSMtbKSA9+4Vawhs5WsNK6Qwrs1rsatzKguCDzflc4o8TlEEyBwE0eZ KfLsGjf0qcZI8LSit3TvPAzXQyA8ULXf8iGWef5Hc0E/Npn3+/xRZxwAMwlyHhcDdavO ls3qCWN4FN3ouhrtr/WCjT4stCNE8EjOlp6Ts= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784620465; x=1785225265; 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=+HjmAlbOs1MBYQdjObhXrJEH8vF2H5aB6qgUxYH+azw=; b=ahoLq1r8U9znC7MK9A7YU2/E1C5oO9MuV4ZLQ+CPhOaCYvDbH+8s2+eQ8d/uTvacH5 18XubambTCkKpbQdT5Josza+WdkeRc1UihnxBxHHvewDsRyX0RKT1Kc4jEJ1aDTqqQKK EdfxGgzwuUVIV+ZjbHNwoQdnihcWvy8w5ErTkrcSjk9lThyx3xXyOuYjqIb+JmdNr6vb JgbV5mAgMcEnKpuQM/TbkPiuQzNw2y9OAc0hQ4w39dD+iiOZ7bEJe1R4uECEPn2mV0HS rJj/rICtGCvjozvHBc8ih28Ns/w5SdkbcNcdb5HYOkz55LBE0RUNAyuNLJpX+kKAq4/6 ks5Q== X-Forwarded-Encrypted: i=1; AHgh+RpTgT8KsoaG7w7/2/4/r/edUOd51RGI8hxK9crTP2ttX7vFS/wsT71MhtMrR9KrzrTADZ9e8/ClSIRARvY=@vger.kernel.org X-Gm-Message-State: AOJu0YwwcoqEVjy0Y4TDbXRlUSpZyMB0hEnmJE82XxL+U1gL0jS9rMck UAacah+1iahCAEGAkdQU4OWkr7+CVZzREzGZKhtGQ5wTxYe7TM+17w7bIrtjM3i6QQ== X-Gm-Gg: AR+sD12SKo/6t6HP4Q8li7QfeW4DG70F6N0MCaJDW1NAIA79TKivWSs/Q3TiFK3gmkV bpawdNlIXO2T2jteZsdxockbZ95VJgm84B532tFFcwSeC+j/fQ0hMC/22ShzTJppW5nfXkwnrVI WV6zev6Q9vzsGgFoyXKD3VdMiB51EI2TnM4tQwC2jtLLiWnRNxDZ61wSPB6JfCCJW2yTYHQyf22 xtTkrfg4rq8LrJuYbLYvuO62FNcMO0yO9PMuXmoyOJAvMsmIiyUTKirOyFYenTq2wZDPSt/HikK L215B1x8Zrx93drrO+gNwDnyoBzBrKIZ6kUSyiwYhCmWPqByAivfJYRc1Z9dg72cDSQF04cDfDe bH/cVAXnvvj6ZyH0vSG0qowdTOE645D4Rcbkam3jKANm7ETo45kI4ho6bNx9XQ1TIjSveKOm0YD lRBsGher+03l/nHE809oiK8OHiECNj36/JNzx7zZEnqUXfqN5fj1wrBC4TXsc= X-Received: by 2002:a17:902:ef08:b0:2ca:5970:732d with SMTP id d9443c01a7336-2cf349d0276mr183734525ad.41.1784620465520; Tue, 21 Jul 2026 00:54:25 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:3916:f048:32c3:931f]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf3448f705sm70724175ad.15.2026.07.21.00.54.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 00:54:25 -0700 (PDT) From: Chen-Yu Tsai To: Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Andy Shevchenko , 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 v3 7/9] platform/chrome: of_hw_prober: Add delay for hana trackpads Date: Tue, 21 Jul 2026 15:52:21 +0800 Message-ID: <20260721075226.2347933-8-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.229.g6434b31f56-goog In-Reply-To: <20260721075226.2347933-1-wenst@chromium.org> References: <20260721075226.2347933-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.229.g6434b31f56-goog From nobody Sat Jul 25 01:24:57 2026 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75C1E439347 for ; Tue, 21 Jul 2026 07:54:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620471; cv=none; b=Z30MZi2wdLB7TnjspUX6pEj/KCv80PJhhbo8E7JE36HQKZc9rVbRBNentpBYlG2zjwtL5FMqSG0nAdflQk1VV9g3N3wNw+Mt5iHrFoPnp5kFbz8HsPeH/Gly9LNPcMmmyb99oEHnlWwId58/lFPbWUDgb7QFLaht1xa9dfRBGxM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620471; c=relaxed/simple; bh=27P+kO3E7rZQANAahmL4oW3JH5FufBpKYuQgwu7HS8w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bQK3uZrCzqu3j//smJC2tE5ZYHQ0tEiRCx8Wm1+0mOlpGY7KBf/yUNc2nNG/hCYXsGzjtE/Nl0JCSna3nFeHl5bm/aDldFoqRhNTfme2/+OXw+nNE3TvekSR8JJwE14P6I8Ed/kln0dshWxpaxiM9/pSD1HAMkT96ydwee67g/Q= 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=ElZ+0RDB; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ElZ+0RDB" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2cca0c5799eso87023325ad.0 for ; Tue, 21 Jul 2026 00:54:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1784620469; x=1785225269; 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=mpTQ+x9JRSQEI1YUOvflUoQb8hjimFA84CnTWedUkpQ=; b=ElZ+0RDBacwKpPFwIIhI5VknHD0gb05C592rQtcqcctQFFwCNilZZJQtN+6kCigGOd OpNOz4TME4z3M3Ndf2zMyb/3/QdIWloDL/Lc8xLJdN4srHp/gZWQ9BLTlgLPvG4RhhJY AKlg0PHcQTTJ8GUcN1lDVhNOl8I2Qc4j7pdNA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784620469; x=1785225269; 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=mpTQ+x9JRSQEI1YUOvflUoQb8hjimFA84CnTWedUkpQ=; b=geWr8RHzxObOTOPdQseKVXFIa2JGT4ndycSthyedKeBQSm7tvX7zRaAClx8IZP2TUS a87nDtrjD8Bb0xGPjic1g9EKY4h9xRRDAxzS5kGpQou0cI/KU7fsINNYbPaVYSyNqsza T4PXi02gZgn+QyP0SzMhvl9gE8hkkhy2e1lFyamzAoV/KYBiFM1PmueSGTWGd8fkMudJ u2Flb8g2T0Nc4GCs4iln+XI1Qr0s44t7p22o2VIUrtzmjjnTaUE8IoSJ+fAfGFPayu3H dwkCL6vQw45RFD713HyrJ8zq87gTyaFJyCdEriKoLKExScpr1N/i5A9UuBLEUakx6ljG OK9Q== X-Forwarded-Encrypted: i=1; AHgh+RrblWo3KmquLs1oLjM2+TwppKeP/Ectj4OkU5exCrbEbkLdDM3Cjtgo4PrhmGd/4TgWs4uxTkM5rXCw9FA=@vger.kernel.org X-Gm-Message-State: AOJu0YyfOEedI86kZt7c3UK6hUeh6/huhVRpIZtcx9mGwIRYCtv7HLsW 247ESgOJi6iN/xIcjZt1lyaHnpx/NaTQgdCH4jhlDy8RYccUjE7RfeLsRMOlnxsUpg== X-Gm-Gg: AR+sD12gtJPAvegdDLFl9V260pHBWDV8E3AjvF5py6p3E1OAnH6iPEFZlw6Q98GFVlL yinSzFNVQtFdkO4v2yaOCbWkznwF8WFQqhSsy9Sq+G57cV7nVXbQV0BRLG054Rte0gr8pyu0Tfx aK0+/K8/EBflu+QrIctWLM4mv4j+A2+v7hj0wohZRY8v/ThS0qSS+/uKix3o6uZX64LjmhPcAsl cKGhXW90COC4xiVZr0EzMztllwC2HjUgxXsILQuYzVTXKvZRQz2avwpSbxpkGScvuli1rLKHW8P cX2WNfF/H5511B2ZSSU8wE6ao0oWme+Rn3JXJt5VUrD3q0D4FLy7nAFyalJCJj4IZuhDUckIAHV o07ck8yTFDDl2EUA9Y5frHY+2rW7p/d4Dan/fO4fN1uB9v9Uozzl6VkYNyWl+UNwFrSNEeGW7M4 qzxMxPzkx/WPRJIzTDp4t4TSOufg9cAp7JyjJqWfj+49YOToumCTET/jEORPw= X-Received: by 2002:a17:902:ce84:b0:2ce:d957:59c4 with SMTP id d9443c01a7336-2cf348369cfmr185433115ad.6.1784620468826; Tue, 21 Jul 2026 00:54:28 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:3916:f048:32c3:931f]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf3448f705sm70724175ad.15.2026.07.21.00.54.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 00:54:28 -0700 (PDT) From: Chen-Yu Tsai To: Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Andy Shevchenko , 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 v3 8/9] arm64: dts: mediatek: mt8173-elm-hana: Unmark trackpad supply as always-on Date: Tue, 21 Jul 2026 15:52:22 +0800 Message-ID: <20260721075226.2347933-9-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.229.g6434b31f56-goog In-Reply-To: <20260721075226.2347933-1-wenst@chromium.org> References: <20260721075226.2347933-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.229.g6434b31f56-goog From nobody Sat Jul 25 01:24:57 2026 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0C443D6CC4 for ; Tue, 21 Jul 2026 07:54:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620474; cv=none; b=H17austI8FvdRVtCk2DfOmCEYOyCNqxBCeXiTQXlfqbrqClDeytFtwNJy3WT65mAj7IFCgR1xd021sbrqv3KDB5EZV483+nfm4tkJpVS3zf85DoDJFyTfGagEqC5ep+qs0r3V0TAQ4SdL+dOFifse0u3yrwNA4EOoiMeQ83V8gc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784620474; c=relaxed/simple; bh=YmTP+U2Zeto/TOo03rVHUOI/jAzel7OhJkJFnUSba3o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZWCrU7CERYG6phfZuDadqWbM561TJHeSgesCSRbMCpF5MgnGs5qL5kYGlDUyHUMp71ESPlbrKhbIqlktb6cIR1bwQe2obf/+RpIEdcrqyjHvYTbX1U2EzEk6SjwE8DRce6bOtScakCKAjkx9BUXTmqfFNP0Hfepa3ab8XVLfHB4= 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=MDS+uyY5; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="MDS+uyY5" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2caea3f742bso131332645ad.0 for ; Tue, 21 Jul 2026 00:54:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1784620472; x=1785225272; 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=XcG83pWDuxaLzQNicOj1pF1B6XObkyNl+NSmg3vDNXs=; b=MDS+uyY5XftEq1uR5cmUwi+v84CjXBTLfiNC5c4T6NnSUEn9MKKbUZ1A0oRCTswDLk LD/qdSPlEXGvimFxAAxA+uOxm16hqD77zcGariCV+CO4GtfaGGAO4W7vhbvdI+bPdujO 5O5OXmaKy4H5KWnYju83Q/13kyZXHSw5Czfc0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784620472; x=1785225272; 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=XcG83pWDuxaLzQNicOj1pF1B6XObkyNl+NSmg3vDNXs=; b=p7VuAJNuDNaCwVgDqvDJ4Awr7kAzl9NcXESVWIuuNFlOlmRlE00KuL7AY5xB0fLvLM 56t/RogefGJzGY6UGh1RPjYT0C6plN95X04ijIGWiDrfdtX+f5xk2EJ+kEsHESCFI4xH prkgzv3kpfBrugY4UKO24XMTt2TxzBdgP9jDhje//aboRzcZAPDOl4PMMPVNlCZrcaMV FjWyhARdyy6gAlHlVh0zizLWbZu7EX3bH78YtmHMipmdqjpEyxBWrPneDjI21xkpartu XMOVwXaS/iz6Ti0EKLZ/PN66aUcs99lcVFMHgof1JcGDJeQnfde3MNFrKy4b2NoTp1M5 eCJQ== X-Forwarded-Encrypted: i=1; AHgh+RpMZ7ceOYCHXQPZ9Y4zdKA3ViAY5ubI611ldy58kArzVh2Cc7p2afvH6CeID8peOJMBM2DF+anJjVCGhUI=@vger.kernel.org X-Gm-Message-State: AOJu0YxpxTZGwPF/phIcO5EEJcOc3UzSEY59aQcfRqdJQmXL5HsWKzbx a6DkglUEh+8RYU+CoCgxa+E7cGhzf906la2sgFdhI0o6SHViIgb0RcNZMJVhfxws/g== X-Gm-Gg: AR+sD13BPsJcgMYAxPllCQRgt8oqkO+M4P3R9t62/+j4dBoPYR5/hAc+al2RvtqpW/b 6OqZemBtUxZWLbZn08r3Ur7gEIODFZV73vayGECyvwvFgkEVS2BJpoexZiIJ0/LoyCXEAz2iLAK UYXx4Be4JbVeaUegkiJ+PCMgb/PhVdAByo6fvpKC+c3JVQFAJCagvcwzznq1042xdg72ccCVxx1 H0Kzdb7uOD3szTpYrBh3os5abrdc91rB6mV4nwMLO3UZLJTThQUELXkoyVlCjKfioiH23GJhU1j GNDVAFX2zeaff0H81xIUZ96BRjIXqGZW5p0FYAI0pqtjOgQVH6hFVcbq2GBpXp51PrfzELC1hhR C3i9zjdLiqLnGN238N9T2bb5ivrNX1SM5Oec4ClLQgU8PMHi7wmaeEuhMPJntgZkR5BpFG5Uh3M dPWgYge5ZATem7Rv7+XVK60k5i2lcLWwUmi6i3QsGlUH2KW8eX9uowNVlKQzXRIJVkW/xVUQ== X-Received: by 2002:a17:903:2b06:b0:2cf:8363:5ab7 with SMTP id d9443c01a7336-2cf83635d95mr15956285ad.26.1784620472296; Tue, 21 Jul 2026 00:54:32 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2a00:79e0:201d:8:3916:f048:32c3:931f]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf3448f705sm70724175ad.15.2026.07.21.00.54.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 00:54:31 -0700 (PDT) From: Chen-Yu Tsai To: Matthias Brugger , AngeloGioacchino Del Regno , Benson Leung , Tzung-Bi Shih , Dmitry Torokhov , Jiri Kosina , Andi Shyti Cc: Andy Shevchenko , 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 v3 9/9] arm64: dts: mediatek: mt8192-asurada-spherion: Add Synaptics trackpad's supply Date: Tue, 21 Jul 2026 15:52:23 +0800 Message-ID: <20260721075226.2347933-10-wenst@chromium.org> X-Mailer: git-send-email 2.55.0.229.g6434b31f56-goog In-Reply-To: <20260721075226.2347933-1-wenst@chromium.org> References: <20260721075226.2347933-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.229.g6434b31f56-goog