From patchwork Tue Apr 5 12:16:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Whitchurch X-Patchwork-Id: 1613460 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=axis.com header.i=@axis.com header.a=rsa-sha256 header.s=axis-central1 header.b=qBNyGDzT; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4KXq9r6p9Qz9sFq for ; Wed, 6 Apr 2022 00:03:28 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241800AbiDEN6a (ORCPT ); Tue, 5 Apr 2022 09:58:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380313AbiDENOB (ORCPT ); Tue, 5 Apr 2022 09:14:01 -0400 Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0895E123BE0; Tue, 5 Apr 2022 05:16:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1649160999; x=1680696999; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=WGpnRbO3Pa93kFXTsPdsfO2hw74rogk5OdNNNdqKnyo=; b=qBNyGDzTr2KIP+FVoBPdK+IqSRK2y+sHO88HSPrcQTJTpYPYrRlKZA3A 4i7oPzidll0KBp2wGYQb+Tv1dM80IqygUG0/WaRADq4JzvPENKFKoZ4f2 XN4D+tU6A2MmuaJX3tTPh9o4Nkv7zxa4Wo+VHW35zfjsGqbQEph+QwLJB 7PFdbZKiT/8BgSe58LXHBENUnis4zXxsV872CbSEaEFqkKO1Sv7WBiV3N Car90Lx0JUmT0tISW6w2mRWKbK1U6diWhVx4UuoVXwv5Fcuxk+mbQ+rDZ ukD48Fn8NRIDZjHCxjfk43o/2BtMh4QkAKtX/8foY/BAWHUu4m/xqIxqv A==; From: Vincent Whitchurch To: CC: , Vincent Whitchurch , , , , , Subject: [PATCH 0/2] i2c: Allow disabling auto detection via devicetree Date: Tue, 5 Apr 2022 14:16:25 +0200 Message-ID: <20220405121627.1560949-1-vincent.whitchurch@axis.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org When a driver with a ->detect callback (such as lm75) is loaded, the i2c core performs I2C transactions on the bus to all the addresses listed in that driver's address_list. This kind of probing wastes time and as Documentation/i2c/instantiating-devices.rst says, this method is not recommended and it is instead advised to list all devices in the devicetree. However, even if all the devices are listed in the devicetree, there is currently no way to prevent the core from attempting auto detection short of patching controller drivers to not pass the I2C_CLASS* bits in adap->class. The latter is not always possible since generic drivers like i2c-gpio set these bits. To avoid this unnecessary probing and reduce boot time, this series adds a property to the devicetree and support in the I2C core to allow this feature to be disabled. Cc: linux-i2c@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: krzk+dt@kernel.org Cc: robh+dt@kernel.org Cc: linux-kernel@vger.kernel.org Vincent Whitchurch (2): i2c: add binding to prevent device detection i2c: core: support no-detect property Documentation/devicetree/bindings/i2c/i2c.txt | 4 ++++ drivers/i2c/i2c-core-base.c | 8 +++++++- include/linux/i2c.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-)