From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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 9783817A2E8 for ; Sat, 15 Aug 2026 23:22:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786836160; cv=none; b=BorwFwn7n2Xj2YlwgPl4ORnSeLWztDQry4WaAuj2NlQtEZZMjqsOyn/4PcxEsB2oE0L4KA06qDDH3j7LG/opQ5peUtD8g9V8lBuUnIzgygSny8Z4/TADN6Of/PorxNQVTRZEqfkcfQiffqfhzxMtUpS+xw+VtlZtLiFc7w7o7aU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786836160; c=relaxed/simple; bh=whO1Q9VWaVWlwDJyl6WQ73ejXjW88ihnTIFLJ1E6lng=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qxa2c7/iOrVAQUdHmFdMHcSA1ftL0RerknpsqUnUzsgxdx/dWq3asOo8jjf1kNwwaLPHGb7raqTesgVGyZt7myIXs7rb9DWLaIvtIoh5lt8yqArUojmg5LzLFK1r8hB/70DgUqZ01ZDU5wWBssgmwpKP2B0FfZfvDYFrXhHa5IA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cjv8/XWC; arc=none smtp.client-ip=209.85.219.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cjv8/XWC" Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-8eeb4508f29so14095686d6.0 for ; Sat, 15 Aug 2026 16:22:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786836157; x=1787440957; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=XEie+xTz9KWzihf6IIMxV4exfWw9NJVAxnNjO2mFmpo=; b=cjv8/XWC4MwNJyqAXeVACnLOJsGQ+om5rw2LNZNhvK4GJfzFvuK8Xyn0HKsMDfxPSY TzJrwAuGTFSCf6JQqpFFUGTAXW7ZY4/GoHr8utMOUM1/VaxBJMv+HoTHPScjMEJ+zZGT YDEGtu2uxhFqZdedjXHFljjgAjaULCJ/0C1begWaZOTAaRQwLIH1jU+H5qAalD64mQhW LNiFwJYkR7DAEl8OO22RmSf5dSWcWyvZcy6imiZo9y7QaV4GncLZuYc/JdEZxgjkG5hk vuwuUSGg+UPU1CWzoaIPYeugam4Jzf1lRlmVH7yRnsNgkXH86oLAr2+6QjVTmMaP+Sy0 WvCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786836157; x=1787440957; h=content-transfer-encoding:mime-version: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=XEie+xTz9KWzihf6IIMxV4exfWw9NJVAxnNjO2mFmpo=; b=eXXTSEvalefmmfjyDBW1EdmU1p8048eumeGjtCcYBJz0J+c8a/lmIVcmh+xMVi7ezi ARu4JfZySOyTVGpaW/w8eGo5DX/Q8Qk8tJyW+I7DTttEgT9d+7jS6iZeqfu8W2wK/tLU YfRvGYd4Gzfo+kJI+n8xpcEbiILiLaMR8EP24+hQrwWZ9UK5v7n/2UQ73ZKi6VQGBRmW sTjpT79pX4dOQjm0EigK+mGzoK9XHc/2lfr5uLqBwc/7n9+RhBGOXyfBK64YoOrfAYAa mz2Hw7UvbUIQz6qJxRrwzIdro9zIxSNJJ8O0deNUbp6cWpAjJYH5qkO4pSVu3OQaVcan ZLjg== X-Gm-Message-State: AOJu0YyczaATifN1Yz16VwDuGD0No+ili5wnvzwdcR4xfmG6BiYzTKuC JltSGgP6EgIjXMEZwWWEMo3TF4sVJjWoh8Trdl10A6mLkTA8M5uIZDAN9BUueQ== X-Gm-Gg: AR+sD13GycyxhVJPHZteF3FmRXxc4nF/TvvfTyg/POt71BckyJpiV7bvDzKZODxh+Rs oaUJxqKFlwae8/0E1+eJ/t6LImYlA14NXflLjrM9RJXDVZKxXfln1H2+WVfPdMjih8e2p4YstBW 22gfKaSDxnlUWF2+iMOapIgWEwEraNaXSxetX9IhQAtlBlMlCPM+jPw3Nx4Mt73Y9nnX4mo8uVw wDKRSshlBJsW8XURumqby6w8ZGtpFVTFdI47/0XmtNr3Glm43D+8P8SCGNGri5lQt5X7TsbueeO tMHOdshBO+SgRZJ867v1kQMn0deaVrte1UKlwJ2VQ0yzF9eatEqq7AEwpwtDnYr/yFs74qu+DQY R4ulwalILQ37DZYZaSTy9iH6Fcp5I4QhhkOdsayvGniL3R7nzrEC8BwZyD494ryhvSPpppcuQzu LhyKgjCkfCl5beqSjrBIv4ra0RSwi6HTO2zqDqZaVTxGuoqkw/BgnKcHsvV+J8v7vg9N/PX705h kRZOcr5DRjg/uoTtwKJyg== X-Received: by 2002:a05:6214:401b:b0:8ef:e0d0:9fae with SMTP id 6a1803df08f44-90a91cac861mr183665126d6.14.1786836157044; Sat, 15 Aug 2026 16:22:37 -0700 (PDT) Received: from localhost.localdomain ([2800:810:5c4:5ba:35db:aaad:44be:8eed]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-90a921e4f43sm51277756d6.9.2026.08.15.16.22.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 15 Aug 2026 16:22:36 -0700 (PDT) From: Mario Rugiero To: linux-kernel@vger.kernel.org Cc: lgirdwood@gmail.com, broonie@kernel.org, Mario Rugiero Subject: [PATCH] regulator: tps65185: wait for the IC to wake before the first I2C access Date: Sat, 15 Aug 2026 20:22:29 -0300 Message-ID: <20260815232229.68474-1-mrugiero@gmail.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The probe drives WAKEUP high with GPIOD_OUT_HIGH, enables the input supply, and then issues a regmap_update_bits() on INT_EN2 with no wait anywhere in between. The TPS65185 data sheet (TI SLVSAQ8G, February 2011, revised September 2017), section 7.6 "Timing Requirements: Data Transmission", Figure 2 "Power-Up and Power-Down Timing Diagram", footnote 1, requires 1.8 ms minimum between the WAKEUP rising edge and the IC being ready to accept an I2C transaction. The driver calls no delay function anywhere, and nothing on that path is guaranteed to take that long. On an RK3026 board the first transfer was NAKed: tps65185 0-0068: error -ENXIO: failed to enable temp irq -ENXIO here is rk3x_i2c reporting REG_INT_NAKRCV. Probe failed, so vposneg never registered and its consumer deferred indefinitely. Wait after the supply rather than at the gpiod_get(). Figure 2 times that 1.8 ms from a WAKEUP edge with VIN already up, whereas this driver asserts WAKEUP before enabling vin-supply; the data sheet does not describe that order, so on a board whose vin-supply is a switched regulator that was off, a wait placed at the gpiod_get() could elapse before the part had power. Waiting from whichever of the two comes last satisfies the specified case and is the conservative choice in the other. It also goes above the interrupt request rather than immediately before the INT_EN2 write, because that write is not necessarily the first transfer: tps65185_irq_thread() reads INT1 and INT2, and it is requested with IRQF_TRIGGER_LOW, so it can run as soon as the handler is installed. Tested on an ONYX BOOX C67ML (RK3026): the chip now probes, all three regulators register and the EPD controller comes up. Fixes: b0fc1e770194 ("regulator: Add TPS65185 driver") Signed-off-by: Mario Rugiero --- drivers/regulator/tps65185.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/regulator/tps65185.c b/drivers/regulator/tps65185.c index 1f13e4156cab..6a3130177e7a 100644 --- a/drivers/regulator/tps65185.c +++ b/drivers/regulator/tps65185.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -375,6 +376,11 @@ static int tps65185_probe(struct i2c_client *client) return dev_err_probe(&client->dev, ret, "failed to get vin regulator\n"); + // TPS65185x PMIC for E Ink Vizplex Enabled Electronic Paper Display Chapter 7.6 Figure 2: + // "Minimum delay time between WAKEUP rising edge and IC ready to accept I2C transaction." + // https://www.ti.com/lit/ds/symlink/tps65185.pdf + usleep_range(1800, 3000); + data->dev = &client->dev; i2c_set_clientdata(client, data); -- 2.55.0