From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 5B92F221555 for ; Sun, 1 Feb 2026 11:18:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769944700; cv=none; b=CwhMc3IpCilM1+/E6lj4iXSctl+oUGj/bZQ2RFPLEGxx0h7gQ6FpPp0p3j3c0CtHP+gXlDmuhIQy3aS13B2EEzf9Ow962f4XjYi83y/CmgIY4aEEsHS83eq2j33TcYSYLN/p1dLQekPNoATfUdSzT65BNZcTKqgnaTQgohktqTI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769944700; c=relaxed/simple; bh=PnFCt7U5faHEoRgRm4/E1Qi8Fg0C73L8gOhM1SYo3fI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FqjUTCKNIdWbUiGWsFjGpJsev1qNl3B2JgmNE1Pa2NJV6ayvMhoG1aH2kXmavGX5CqGD7lZT2+iVqArCWbfMBMKnvATm9xBsUVGxWcT2n8UQsZbPLaaL/kL0jpu7r15iafhGZzt4EPRDa6j47wkpSlGShR17gEyQQRgtB5JrFwM= 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=jgJ1UAxZ; arc=none smtp.client-ip=209.85.218.46 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="jgJ1UAxZ" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-b883c8dfb00so842902366b.1 for ; Sun, 01 Feb 2026 03:18:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769944698; x=1770549498; 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; bh=Apd4Pw04WM7E8SQOUu4pdhPSYadrEuDMSe+FLY9m1bA=; b=jgJ1UAxZY3fX4xPWDcv60FOa/hKhGHJqqv3hGiKlVKbN7ntx9LRG3NSEqLBvPo+ppn oQICEJdPXRVAKuf/NLXxKK42N9NgB8h+pQq9GKBEMYBL7KZ3VKdzP1lWpUHdDjO4iztS gr+RVEeBG6yop7tebAg3ndsg0zOAXkV7o37TK8U7reyLaLPaaayL+1ZsG1NQVAA7lA2O FnK+VBjw4YjZwYVrPOAGG7Ttxme45KXM6RVHfQC05dg2aMT6ZpCELcKR2BedlAPjDcV7 HRfHK3Kg45hOtuPEAJyWBChx/GL5s8ZWpwN/8B83b36NMH4Crha04ZFBuYYeoS4ElhjK lB2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769944698; x=1770549498; 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; bh=Apd4Pw04WM7E8SQOUu4pdhPSYadrEuDMSe+FLY9m1bA=; b=PdTZyQbek4gd+CQk5eOTd9IR1sjxd7ZNMI5syNcwB4Ep7msbVe6q+Iuprtz8RYlPIa 1KvaewPoZn/jP08nGH4lrk1fkR6bwVNUthNscS6uz4OELt9x8VKOvkn/J6rICqNdnSUe KEAV591bcX7wkzMJsqbdQGuDxDr7IAU8GHwDIEelmM0yGLtSL/lO107qCt0JPCHe4DBE pauVo13AMl4sFx5MGF7rSzZX2o4F2XWTPDWKSYc1OvtriAGIh66xRhhovTmT+/vKmysO rCOnaz6gLZpfiJU49Vf3XpN8XofFUFaaVByIiTtmavZY6Se4QQxpOgUHy4f9mfvY3TcS Sszg== X-Forwarded-Encrypted: i=1; AJvYcCUWeRwy3xJEApIs1nx95ioOMphgRVraTGlK2r8YuCSXTNcsBGXJUeXkrX/OtRDP2VarXAxlqB1FDUxOw0k=@vger.kernel.org X-Gm-Message-State: AOJu0YxKKJYBbPTxwiW74EYpn1z60Aqf53PeDSZGeWc1f1QlNOdS9NAd 7ThYZR67KKGkJLOjx+TnBYQP5s6jbk6yyLiLjrrqYnkibraH1AvvHJgY X-Gm-Gg: AZuq6aIU6f56OEiSTTUIfxlAKT3a6+6fFFLBKwwo/1vnP7fLt7WbLY4DC3oOl1X73WK gq2y1vcHv+hPgkm1/1VHAYQok77xZGn8qb9jl31NItzma7hfQ8rsQPYU23wmvwpdYQaHSNh5vW2 Ts2PFlj89v+8eT5jFbXlKEv4L7JqhtSIEJJWkTwdjk6bqP1Kaw1KMxGXP7dmUyR3bEwObzDVIM0 A63XRM1IMfS6X97oL+fc/977QKGuWuep0klJ0lSxRtp0rZ+IDXP/FKNqJdG9ho5oz09taQQfINe VQvsZT/ZS7LKrDA0AcLlfkD5wnGXSHB0SFb6s079Rn0xYOB7LZJvao/QUqTqKUOjPbKvIE/xLHd 4cuXJe6ADV5gApKv9tIhLjPXHRdtUQcatnju+ZL/51PmPVuI1HJo7hCTt1FQFuYxLnpHvZf+dVt +zBLp+2ZysVzvTlTcrNFTv1HA= X-Received: by 2002:a17:907:97d1:b0:b87:1f21:f09d with SMTP id a640c23a62f3a-b8dff58a0ebmr540036466b.19.1769944697422; Sun, 01 Feb 2026 03:18:17 -0800 (PST) Received: from C-PF5D4647.localdomain ([147.161.249.21]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8dbf2ed6besm714713066b.60.2026.02.01.03.18.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Feb 2026 03:18:16 -0800 (PST) From: Jie Li X-Google-Original-From: Jie Li To: wsa@kernel.org, linusw@kernel.org Cc: linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Jie Li Subject: [PATCH v3 0/2] i2c: improve bus recovery for single-ended GPIOs Date: Sun, 1 Feb 2026 12:18:10 +0100 Message-ID: <20260201111812.18945-1-jie.i.li@nokia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Greetings, Apologies for the delay in responding. Thank you very much for your review and the specific guidance regarding the return types. I really appreciate your patience and time spent guiding me through my first contribution to the kernel. This series (v3) updates the helper function to use the 'bool' type as suggested and includes the Reviewed-by tags. This series addresses a limitation in the I2C bus recovery mechanism where certain open-drain GPIOs are incorrectly identified as input-only, preventing the recovery logic from functioning. Following the suggestion from Linus Walleij, this version drops the previously proposed "force-set-sda" DT property. Instead, it introduces a generic helper in the GPIO subsystem to identify single-ended configurations. This allows the I2C core to reliably enable recovery for open-drain lines regardless of the instantaneous hardware direction reporting. Changes in v3: - Patch 1: - Changed return type of gpiod_is_single_ended() from int to bool. - Updated return values from 0/1 to false/true. - Added Reviewed-by: Linus Walleij. - Patch 2: - Added Reviewed-by: Linus Walleij. Changes in v2: - Replaced DT-based "force-set-sda" with a gpiolib helper. - Added gpiod_is_single_ended() to drivers/gpio/gpiolib.c. - Updated i2c-core-base.c to use the new helper. Jie Li (2): gpiolib: add gpiod_is_single_ended() helper i2c: core: support recovery for single-ended GPIOs drivers/gpio/gpiolib.c | 22 ++++++++++++++++++++++ drivers/i2c/i2c-core-base.c | 3 ++- include/linux/gpio/consumer.h | 5 +++++ 3 files changed, 29 insertions(+), 1 deletion(-) -- 2.43.0