From patchwork Tue Feb 13 14:22:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naresh Solanki X-Patchwork-Id: 200440 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp570583dyb; Tue, 13 Feb 2024 06:23:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcnFVKZc8JvqVXg0c4tQoKPQm+KGwK1e3zNYWw4Sauq45sqvUI/jl9PMUNp+KW/62Bj0vW X-Received: by 2002:a05:6830:1255:b0:6e2:f566:d667 with SMTP id s21-20020a056830125500b006e2f566d667mr1641505otp.4.1707834215994; Tue, 13 Feb 2024 06:23:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707834215; cv=pass; d=google.com; s=arc-20160816; b=qdO3sitsjqxymSJcdyA7U1gKYTifPdaVT0TmcfqEWLb8oP1YBCn741Qp/HOmTfXvcD DYK6Jd/+4EA79dbyHCbmE+/9EBtIimir3qfG1WPerZJXRHZSdGzXOKfN+fn3IaovAp71 MwdGsXdU8h0VugNyPkMvX6Ntrf2kTyeZnA4oo6lYvFw1Z4JY11AHRdofOyvmVUY7Ynp9 qgPvTQlw99xmnnVa1kuGwvuWuuSJichvegy/vD4aNTyjzJV/MLzBhvmVdibYmcvKdEl6 D/9IIYDaxKBaNDXhXi4xUFFcNT8aK9+WTe8pWLdWCb610Jb/I7mzjwMR6LuCOgaSfxR6 puVQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=Pe27R5El4Dv++yOPITXX9+jKm5cvh9lf2r0jCzdmu/0=; fh=lh372N03JcZJ8fZfyuZbsZWFAWTp8+exETFY+iOrqz4=; b=tNPxd8DTPfZUcd+G8x7rq4wtuuy4k2HvOMfU+iYrhuuA+g48gb0QPSfe0ox+T1mvaz Qo6YIgQCyusX7d8eOcQNQQ9aFaw2hrbbo8u7i25LS3Om8EPUR6T1fvazHNWQae7HPYQW +zxc0P19wUb8jYlsYXMAZFUJs45QJF6+WDNGEVQYir4H04YCFQMtuH/XY0HQp+dXwYss 1fOFHZMppxUM1Rxt7aNgFzDu1Ui0J2tziIVZkE5U449r2gxQ77KqkuHslTd+wNff70Zs fH3d7qJDdjYleV93HAowJiuBk1XWhaJXDRteynhP3AvjQYHuSCtE5aRgMoWCi/2U+4aq Dm5A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=IfMLbuos; arc=pass (i=1 spf=pass spfdomain=9elements.com dkim=pass dkdomain=9elements.com dmarc=pass fromdomain=9elements.com); spf=pass (google.com: domain of linux-kernel+bounces-63666-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63666-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com X-Forwarded-Encrypted: i=2; AJvYcCUGp7Pjnh/CEmcjJeK5v8oPtmPJos7M8hIs/R/e/v51k7P7N77g/41bUpCr4jUuIlON1cgFwLkqxkSkP+qi0ZOGw3/lxw== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id l25-20020ac84a99000000b0042da946f329si2363045qtq.738.2024.02.13.06.23.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 06:23:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63666-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=IfMLbuos; arc=pass (i=1 spf=pass spfdomain=9elements.com dkim=pass dkdomain=9elements.com dmarc=pass fromdomain=9elements.com); spf=pass (google.com: domain of linux-kernel+bounces-63666-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63666-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B2DCC1C22D0F for ; Tue, 13 Feb 2024 14:23:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3BB2D58ABD; Tue, 13 Feb 2024 14:22:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=9elements.com header.i=@9elements.com header.b="IfMLbuos" Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 7F2A058203 for ; Tue, 13 Feb 2024 14:22:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707834156; cv=none; b=KGNJy6RnZCeoRlqVrqlQ3XOiE4mgY0QGkebs2qQg0y0Eh3Qyiu+qjq19AqVM9nWlIsnCyUcLF7dmj6T/qEgTOC8tyuy5RMG8CiwKh5xaxk0oNuZ5nQqAt+ovlJxoEGx9YUCuJ1YTRyfjZ9VD6scGbnUT59XUiZAaEz+YCzrvO6E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707834156; c=relaxed/simple; bh=ZVoWPkWDGGWjLhBURKBmzMi+6xun3d9llfJxTCKJHGg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lO2i+/Y3yAX4f6kZHSHwuGAPT+Ye+ay1pxaK/wrg4j+dtgHVA9nYjsyaPLDxBN2Z+a3INQoVRj2756kHTltIJN/JrpMW+XRTr0hVKjZEWhERXMhZlvsZpRrdmJuC/Sh5Cdg4uve+UMc5hw3bdzrkl/467j/dgrcBTyiYt6RwEeM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=9elements.com; spf=pass smtp.mailfrom=9elements.com; dkim=pass (2048-bit key) header.d=9elements.com header.i=@9elements.com header.b=IfMLbuos; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=9elements.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=9elements.com Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a3d002bc6f7so75843366b.3 for ; Tue, 13 Feb 2024 06:22:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1707834153; x=1708438953; 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; bh=Pe27R5El4Dv++yOPITXX9+jKm5cvh9lf2r0jCzdmu/0=; b=IfMLbuosVUu9hLdyXKGteoM6WQFCQjI1NY2y1X7gf/TrEDibHaLN/fthxu8J1zjnAI KqKh3Cbju9joKL01o8UrrC+L2QoNPtTnkPF2JhIu50XHQ/scpDU8Y+WX9ef2kEWZcTsK Q1NcIwCujzDhY+Bpfeovg8cbgYz5Mlm5i9g0GQD2yQTfVbSnN9SVCtXb0fMoIQ17U9st ZIc1c8BnW75MdTqn0UbahHvKJsyhKmZXG1iPQ8wjsKHS4zYMSfl7k+Vn88emSBCxaONJ jjkpydH53NEOfLBLdzVY/uGmZR6iNxQG4ETi4IRR6o1xxhdd5aEZ2zjIv9AX0KN1PN5H NpLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707834153; x=1708438953; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Pe27R5El4Dv++yOPITXX9+jKm5cvh9lf2r0jCzdmu/0=; b=J5VuMgtIccGgP6UqWJa9DbPDFcz+rxO/7p8Ob62GRdJKE3Tgp6euy5KM4RUfP+rB+/ +m9ApeRm4mzz8wixaWG1jHhqq3rrR4ifh93O8hu1Etdv9bNy1SIIDwOcVlVsMkWCsbL/ fmQjWGHFLAQpPvZ0RroybZomC5oGa6lzdhx2nU0BcwAkbg1FliT1Tes+TGUQ6Y1T4Woo ZacFeCJrra2vZpnet2pBoSO5HiiQGy/cTtj62aevV7HTY8D73hKAGrp0XxFhyJpEhaN2 BYZSOyyI1Qljln/+vUYsZQ2BjQ03GNL94qSBUCi4X3qRrKwoDwkuNg1J4KG8I41z02jH sraw== X-Gm-Message-State: AOJu0YxchQkwB6uopDIBj2ma5pgtuRIkhqXdiI+K3JjbGEkl16XtWRa2 XuMsg0mSV32Jc8zykQD4mEvCemkODacEwku/iR13BgIEqeqzTUO3G+edzTxIMi0= X-Received: by 2002:a17:906:a419:b0:a3d:fb7:84a3 with SMTP id l25-20020a170906a41900b00a3d0fb784a3mr864127ejz.77.1707834152688; Tue, 13 Feb 2024 06:22:32 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXImBO3mmi4JY0TRPPzH+4244VODD/T2hLnxKqUoEVlKwe0g7ic8MIyyAPFjyIGcgh4iWydYEZvYuNSWCg1t2ZMB3LcqXeSPn8B+CrmOaJTTqf/ghzMTQ0DTic2JE3rUNGRPxfQhHU2yWKJIG6eDRySV4mP5csLxky1SKuAAjPoiAVZNIH1jf2NaM8RKe2jrhzryIPQmMKE9ip43fQvQFbySLzCdma6gFXZqpMM/4ZOrtPVWN4EdOldaQSQRA30VGeYFcddDRUyEV92wrOY/rWxQcq0d690exWGMb8XZjI+KQjKQ61iap2Y88tEUgdjPoIGI9n2L47tLdk9pAVEP3AsuzRKY7xZn4sOuEr9hZZWOSHNlQCFn5zwf+T/nHxQTZwP/h+0sq3ebW74WzPqAqiuDsbEiJMebIkTQvwN/4zsvGpkTG6Pp3hdMs8YB2iKONeo5oQ/Fg0c Received: from stroh80.sec.9e.network (ip-078-094-000-051.um19.pools.vodafone-ip.de. [78.94.0.51]) by smtp.gmail.com with ESMTPSA id lu1-20020a170906fac100b00a3c97e49bc9sm1322671ejb.218.2024.02.13.06.22.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 06:22:32 -0800 (PST) From: Naresh Solanki To: Peter Rosin , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Laurent Pinchart Cc: mazziesaccount@gmail.com, Patrick Rudolph , Naresh Solanki , Rob Herring , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 1/2] dt-bindings: i2c: pca954x: Add custom properties for MAX7357 Date: Tue, 13 Feb 2024 19:52:26 +0530 Message-ID: <20240213142228.2146218-1-naresh.solanki@9elements.com> X-Mailer: git-send-email 2.42.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790793971325984017 X-GMAIL-MSGID: 1790793971325984017 From: Patrick Rudolph Maxim Max7357 has a configuration register to enable additional features. These features aren't enabled by default & its up to board designer to enable the same as it may have unexpected side effects. These should be validated for proper functioning & detection of devices in secondary bus as sometimes it can cause secondary bus being disabled. Add booleans for: - maxim,isolate-stuck-channel - maxim,send-flush-out-sequence - maxim,preconnection-wiggle-test-enable Signed-off-by: Patrick Rudolph Signed-off-by: Naresh Solanki Reviewed-by: Rob Herring --- Changes in V5: - Append Reviewer-by Changes in V4: - Drop max7358. Changes in V3: - Update commit message Changes in V2: - Update properties. --- .../bindings/i2c/i2c-mux-pca954x.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) base-commit: 957bd221ac7b2b56cbdf56739e3a94d4f479209e diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml index 2d7bb998b0e9..9aa0585200c9 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml @@ -71,6 +71,23 @@ properties: description: A voltage regulator supplying power to the chip. On PCA9846 the regulator supplies power to VDD2 (core logic) and optionally to VDD1. + maxim,isolate-stuck-channel: + type: boolean + description: Allows to use non faulty channels while a stuck channel is + isolated from the upstream bus. If not set all channels are isolated from + the upstream bus until the fault is cleared. + + maxim,send-flush-out-sequence: + type: boolean + description: Send a flush-out sequence to stuck auxiliary buses + automatically after a stuck channel is being detected. + + maxim,preconnection-wiggle-test-enable: + type: boolean + description: Send a STOP condition to the auxiliary buses when the switch + register activates a channel to detect a stuck high fault. On fault the + channel is isolated from the upstream bus. + required: - compatible - reg @@ -95,6 +112,19 @@ allOf: "#interrupt-cells": false interrupt-controller: false + - if: + not: + properties: + compatible: + contains: + enum: + - maxim,max7357 + then: + properties: + maxim,isolate-stuck-channel: false + maxim,send-flush-out-sequence: false + maxim,preconnection-wiggle-test-enable: false + unevaluatedProperties: false examples: From patchwork Tue Feb 13 14:22:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naresh Solanki X-Patchwork-Id: 200441 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp570697dyb; Tue, 13 Feb 2024 06:23:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX8jxhZtviIWkOnrtDVGY62mpxGuSGh9UybcbsjIURD8ouPH9PMiewGjA1YlfEDTKSevWb1MtqKq6QrLMauEuT2iiO/WA== X-Google-Smtp-Source: AGHT+IGXU6p5W+aqQOj1iAXGjwYLBcXnqSlrbHY1ey+TgF9Kn69kSWApTE4WIhVU0bJl/tmcyGcN X-Received: by 2002:a05:622a:314:b0:42c:43d6:c69e with SMTP id q20-20020a05622a031400b0042c43d6c69emr4756668qtw.1.1707834226263; Tue, 13 Feb 2024 06:23:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707834226; cv=pass; d=google.com; s=arc-20160816; b=oxovS6L+GuFkCtEJy1PxUH7RVxtLk1KqdDEz7wuzJNkgvZXWM81Ms1pqGP5wP2iPBv l2ECt+SPI62A/EMZDEm4rohrzCTNtPf5Lvwbm6fpVC4pJKP/8e5h8n4iiD+7zndiaJv5 DPSR+sL3E6Emr5ZZDVYzkqqxvG1daA9eMEnOBlYxiSlQH8EdOYFMN8RFUrYOdB1DRFGB lJxPHh4UHmy/iC1T38w4Oxehystyx/SQ56ItmGmSiZnfe1/ecyR/zrxjxMzQsGtglIF7 ddoNQLpLOjoO/Fsdk4F2px2JjIPf25PtMmCFLngGthSoC8MeBc13p6Uk1EKk3N5EJyK+ dz6A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=FCYSTKoBxU4qe92Ir9ZfO3GMV6uHY4MYfHL/wqf2edA=; fh=3KfN8i7LVt0G29eiME28hcMPfD2EgC7EiokUXGE1vtQ=; b=M2avtgQs5itmv9fWF/W6J9bPCwbRjTs0tLaPsbP4I4OkzqOHW4oBMAF8m1LIHWpVxc k1zA6BZsjHTevTi3s4Dvn0zLsjbs/cV4c5xQlA5c7W0WbMXYOCBxwIvD2DLvuH/IITLB wV8St7e3bIJU5fB6pHMXqDkBkK/6Z3fDpNGPyyQhTHsz+AeSiyfli4PZ9rXdjxHo9hca tx+b1i7QINQPWcX5mMVlxveY6YHGLb8LtbbtcdVN6m1yi2YvI9kr3hQcIf88mC+d/Z7z V2oa/jZt3CQHKbso0bKBG8f15qaFNVWChKYFFwEgIb0YVyRpZYgfpumZ/3hXQkH9JyQY Nqhw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b="TP/yR7VR"; arc=pass (i=1 spf=pass spfdomain=9elements.com dkim=pass dkdomain=9elements.com dmarc=pass fromdomain=9elements.com); spf=pass (google.com: domain of linux-kernel+bounces-63667-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63667-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com X-Forwarded-Encrypted: i=2; AJvYcCW2Vqe7B4m7sOBAGNabOwK5KK060KQmI2GdHFab09xfnhOkWeuoWk40UBq/D9rCfIPjXOvTwlkXAH9xCySE5G1xAnJ0Og== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id s14-20020a05622a178e00b0042bff0055f0si2979454qtk.721.2024.02.13.06.23.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 06:23:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63667-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b="TP/yR7VR"; arc=pass (i=1 spf=pass spfdomain=9elements.com dkim=pass dkdomain=9elements.com dmarc=pass fromdomain=9elements.com); spf=pass (google.com: domain of linux-kernel+bounces-63667-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63667-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 00F7B1C2116A for ; Tue, 13 Feb 2024 14:23:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D458A57868; Tue, 13 Feb 2024 14:22:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=9elements.com header.i=@9elements.com header.b="TP/yR7VR" Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 1C55458222 for ; Tue, 13 Feb 2024 14:22:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707834157; cv=none; b=KZ5WLwYc4uSd4G7WDTlVR/7db+q5cnMWXV+tKc6R8Jp4Bc8Pu0ThWNTILgJSSoK5V9AtphN4EiyrBJgcrmJJHu5AHhZuH/N0AZhA0Yf4Ejf7tGVX5Oq0DSedpweUmPXfxDYyWJN/9sBmlRrzTUDYlVCWFRSR22VPZdhnZjZfSbw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707834157; c=relaxed/simple; bh=cGDhgb9JjmXcz1B7VT0bk/gyC+uEs/PtygXq4+otMW8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Mx9tB5TKypsDWfHEJxWY8QRnXgr0qNYLIu4p3S9JSOjRdg6ZRI+jF1oBm85r/7dbjynNlEzvN1MVZZAK/cczkRj8bRqOfHwy2mv135PA2gNQCso5jhdF6lF2vaA4YxTJC2SSoagU4LaSGioQNXYeNIvOcu02GbojQYu9KmJAMbw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=9elements.com; spf=pass smtp.mailfrom=9elements.com; dkim=pass (2048-bit key) header.d=9elements.com header.i=@9elements.com header.b=TP/yR7VR; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=9elements.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=9elements.com Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a28a6cef709so596957366b.1 for ; Tue, 13 Feb 2024 06:22:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1707834154; x=1708438954; 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=FCYSTKoBxU4qe92Ir9ZfO3GMV6uHY4MYfHL/wqf2edA=; b=TP/yR7VRXLPX0OG5HSbNrYzroOXb7VcjRpJDaRdrn9WIW/OUGhkdvYsI95ApApjX8l tUlKoi4/YCSAmMW+qe86UQTyY9TynLLj923Qzl0JL5QiznNdlv8YEv3sauq3EgPeJhlE MCMwwOP7eFLKFg8HKYD34hvDoA1SfOdn8fa8l0rEjSRBu0hZ2ZOQTuyofct24v81YNXC N1qYxTmqte1Vw6lJSucgipRSFi6am6F98gxUEA5fdT3EIvkDdks1iLo6/L7HKnqO7LIP tewCHKb01eiYaP1Ir3UnC0mHlxzhCRHyEq0BcZov3b+qFFXpiJ01agQQqWSHzfCqARJb gWTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707834154; x=1708438954; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FCYSTKoBxU4qe92Ir9ZfO3GMV6uHY4MYfHL/wqf2edA=; b=vDqi3wK3ZqNiHQuKzYMwWUKY5xvDg43WMxGlkhYPMFrx8mzDz2yRmIFVt2xHEF9lI8 e5A1NnfWqjOEyGM6NGCw6n4tY7pNWrSR/C5Nr5zm+XuNWJjuUMen9zCrTD6bNpacQ3AL 8jIcr1+wqE3hBYu5YKCHSkCJpV0UEngs4XxsuiUCUJX7cBIfodTVQrJSE7SfrA36JAAX eoduzZK8Hjd5rc+/uTL0TQ6PWuwAX5Pr01oZtU1kOBV/mkDuD2igSD84RH7yF8DKcm5l 4ADqZDuRYjh2bmhm5oGU7tCI1++ZfHwD2xXqbGWnswjovkNpHOKeN4YHRAKpwy1jezBY 1Vgg== X-Forwarded-Encrypted: i=1; AJvYcCUgf1BF8K0PmO/a+0vX2sBXPoxnBKmmmG0cX4HLo/THP5EQ8jGHMkaufsK3DaYgniCQoFipYkxHVHxUXioNMdAOMfiWHfzbGT0xkudZ X-Gm-Message-State: AOJu0YzCCqz4mjWU1SZ+9YKK9SZDjaS2GoHJsMXCGwWuxfk5phQ+52h1 f70SGJ2dA76Zbiz/QXMMrbzup2nF1JZxybCVWrlHwwWhQ9CsUYykpvZXaZj1x0f/b5bzd/JmjQE M X-Received: by 2002:a17:906:8417:b0:a38:7541:36f6 with SMTP id n23-20020a170906841700b00a38754136f6mr7924946ejx.21.1707834154387; Tue, 13 Feb 2024 06:22:34 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCW+2fap3g67K+xlSpRgqPTfNeRFPdzmmy/1Sx9FWajc48LBob+MvxXHOnI+Ei/e5oZegJo4x8nh8raGGIC4NyDVAx/TYdDm0DRRf/MIBxmzzQinnbYgCdihQfg11itAXNObnDMKWMSuRULKdzFPimF/I4XLscPtOntuY5iyXPD/3VYuNrAhtJgFBfUD7FNQj68SO6a8UkPfoyzmqyVewj1cCfsgkh+Ows8ZsjYy2jsw6TiVd6Yixmb9ZLRB Received: from stroh80.sec.9e.network (ip-078-094-000-051.um19.pools.vodafone-ip.de. [78.94.0.51]) by smtp.gmail.com with ESMTPSA id lu1-20020a170906fac100b00a3c97e49bc9sm1322671ejb.218.2024.02.13.06.22.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 06:22:33 -0800 (PST) From: Naresh Solanki To: Peter Rosin Cc: mazziesaccount@gmail.com, Patrick Rudolph , Naresh Solanki , Andi Shyti , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 2/2] i2c: muxes: pca954x: Enable features on MAX7357 Date: Tue, 13 Feb 2024 19:52:27 +0530 Message-ID: <20240213142228.2146218-2-naresh.solanki@9elements.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240213142228.2146218-1-naresh.solanki@9elements.com> References: <20240213142228.2146218-1-naresh.solanki@9elements.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790793981700493567 X-GMAIL-MSGID: 1790793981700493567 From: Patrick Rudolph Enable additional features based on DT settings and unconditionally release the shared interrupt pin after 1.6 seconds and allow to use it as reset. These features aren't enabled by default and it's up to board designer to validate for proper functioning and detection of devices in secondary bus as sometimes it can cause secondary bus being disabled. Signed-off-by: Patrick Rudolph Signed-off-by: Naresh Solanki Reviewed-by: Andi Shyti --- Changes in V5: - Fix typos - Update comment - Add newline in dev_warn Changes in V4: - Drop max7358 - Update #define - Move conf variable - Print warning when I2C_FUNC_SMBUS_WRITE_BYTE_DATA isn't supported Changes in V3: - Delete unused #define - Update pca954x_init - Update commit message Changes in V2: - Update comments - Update check for DT properties --- drivers/i2c/muxes/i2c-mux-pca954x.c | 43 ++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c index 2219062104fb..f5dfc33b97c0 100644 --- a/drivers/i2c/muxes/i2c-mux-pca954x.c +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c @@ -57,6 +57,20 @@ #define PCA954X_IRQ_OFFSET 4 +/* + * MAX7357's configuration register is writeable after POR, but + * can be locked by setting the basic mode bit. MAX7358 configuration + * register is locked by default and needs to be unlocked first. + * The configuration register holds the following settings: + */ +#define MAX7357_CONF_INT_ENABLE BIT(0) +#define MAX7357_CONF_FLUSH_OUT BIT(1) +#define MAX7357_CONF_RELEASE_INT BIT(2) +#define MAX7357_CONF_DISCON_SINGLE_CHAN BIT(4) +#define MAX7357_CONF_PRECONNECT_TEST BIT(7) + +#define MAX7357_POR_DEFAULT_CONF MAX7357_CONF_INT_ENABLE + enum pca_type { max_7356, max_7357, @@ -470,7 +484,34 @@ static int pca954x_init(struct i2c_client *client, struct pca954x *data) else data->last_chan = 0; /* Disconnect multiplexer */ - ret = i2c_smbus_write_byte(client, data->last_chan); + if (device_is_compatible(&client->dev, "maxim,max7357")) { + if (i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) { + u8 conf = MAX7357_POR_DEFAULT_CONF; + /* + * The interrupt signal is shared with the reset pin. Release the + * interrupt after 1.6 seconds to allow using the pin as reset. + */ + conf |= MAX7357_CONF_RELEASE_INT; + + if (device_property_read_bool(&client->dev, "maxim,isolate-stuck-channel")) + conf |= MAX7357_CONF_DISCON_SINGLE_CHAN; + if (device_property_read_bool(&client->dev, + "maxim,send-flush-out-sequence")) + conf |= MAX7357_CONF_FLUSH_OUT; + if (device_property_read_bool(&client->dev, + "maxim,preconnection-wiggle-test-enable")) + conf |= MAX7357_CONF_PRECONNECT_TEST; + + ret = i2c_smbus_write_byte_data(client, data->last_chan, conf); + } else { + dev_warn(&client->dev, "Write byte data not supported." + "Cannot enable enhanced mode features\n"); + ret = i2c_smbus_write_byte(client, data->last_chan); + } + } else { + ret = i2c_smbus_write_byte(client, data->last_chan); + } + if (ret < 0) data->last_chan = 0;