From nobody Wed Dec 17 19:19:06 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B33C6C2FC22 for ; Thu, 17 Aug 2023 07:11:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348388AbjHQHL2 (ORCPT ); Thu, 17 Aug 2023 03:11:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348366AbjHQHLH (ORCPT ); Thu, 17 Aug 2023 03:11:07 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C12C2D53 for ; Thu, 17 Aug 2023 00:11:01 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-99bcf2de59cso952923266b.0 for ; Thu, 17 Aug 2023 00:11:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1692256260; x=1692861060; 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=VIjrnEwaKeqGTU5grAtJfqf2YP8aALmcmlloCUUh95k=; b=WacsCwd/mTW/bUVtr3GPWrz7PCmkCc2+kASptV0P7rFTE0R9JwO0dwS0d9fm5zWWCP jVQLBAEuEY2TeZ+7J43YpwG/rvwmOFcUtCixJOpcfUD9ER/YGw6ud6q0H3BJuii5bTmm oz7NiDzwXh+YNrM3WWh0maeTRON+wvh0VkyxUxYITj4CUpXFRfSbsY8lOZsmtQRMVP9J d7LiAEEEaNIfXlpOUBvsxhQpbKS97igXv9he8JpvAoJDmMh+QfEoCCQIqu7vaGfdjiOF cz7UZfJ/vzykdECCYUEClUJwoo8cNxkkZ4QUJoy2rQTI3/tSdPg/ua9ngS7lgAjjz76+ AGTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692256260; x=1692861060; 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=VIjrnEwaKeqGTU5grAtJfqf2YP8aALmcmlloCUUh95k=; b=LotKhBFdRoPuu/jMdo5DOw980lZSrvt8Dxzqr+JWvnGMsyc1wkfzj0/zUuxsqSWaVF 8YVzJAlogjqHv6Q97vzlKr0w8eHbirt+jOMoaUKrz0cN94qlfbpGTpcZqRq58YNolVWR 8Vd8x4f3Zrwk54Sv0Gmg87Nr7Uj2B6A+t7xKP52zrqTZqjiO1/GM3DFe/NgVvaGgyB75 ngIZonBd6tS/b7LmTw3nIR+4q0LUndxs+opqXbIpGO+OE9Zsu6IT67whbUaNERKey8dT 6HUSZk1Gz+QADFaN0uzpqwFA+aBhVaFpFN9gXYN+BpOtwmPwD7BAZ6xbLP+muPZtWNIj pxWg== X-Gm-Message-State: AOJu0Ywpd7L193RYS6WFKNRLc9XzUihEaF90x+OI0KmJgrHQmip79VBD otN/uM5lSxwOsCrDG5h6bdEUGg== X-Google-Smtp-Source: AGHT+IEm3Zuw6iWJxveFv6TWkJryZMT36/j5LUA/U0DfI6Y7uj4yMRyUOzDLKV23+RFgUnjU5V3B+w== X-Received: by 2002:a17:906:20dc:b0:99b:ed53:5c12 with SMTP id c28-20020a17090620dc00b0099bed535c12mr3023587ejc.17.1692256260537; Thu, 17 Aug 2023 00:11:00 -0700 (PDT) Received: from fedora.sec.9e.network (ip-095-222-150-251.um34.pools.vodafone-ip.de. [95.222.150.251]) by smtp.gmail.com with ESMTPSA id qn17-20020a170907211100b00992b510089asm9674361ejb.84.2023.08.17.00.10.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 00:11:00 -0700 (PDT) From: Patrick Rudolph To: Peter Rosin , Laurent Pinchart Cc: naresh.solanki@9elements.com, Patrick Rudolph , Krzysztof Kozlowski , Rob Herring , Krzysztof Kozlowski , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v15 1/4] dt-bindings: i2c: pca954x: Correct interrupt support Date: Thu, 17 Aug 2023 09:10:50 +0200 Message-ID: <20230817071056.2125679-2-patrick.rudolph@9elements.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230817071056.2125679-1-patrick.rudolph@9elements.com> References: <20230817071056.2125679-1-patrick.rudolph@9elements.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Only some of the PCA954x compatible ICs have interrupt capability, but the binding advertises it on all ICs. Sync the dt-binding with the driver and only advertise it on: - nxp,pca9542 - nxp,pca9543 - nxp,pca9544 - nxp,pca9545 Signed-off-by: Patrick Rudolph Reviewed-by: Krzysztof Kozlowski Acked-by: Peter Rosin --- .../bindings/i2c/i2c-mux-pca954x.yaml | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml b/D= ocumentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml index 9f1726d0356b..e5c1070903ef 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml @@ -12,9 +12,6 @@ maintainers: description: The binding supports NXP PCA954x and PCA984x I2C mux/switch devices. =20 -allOf: - - $ref: /schemas/i2c/i2c-mux.yaml# - properties: compatible: oneOf: @@ -63,6 +60,24 @@ required: - compatible - reg =20 +allOf: + - $ref: /schemas/i2c/i2c-mux.yaml# + - if: + not: + properties: + compatible: + contains: + enum: + - nxp,pca9542 + - nxp,pca9543 + - nxp,pca9544 + - nxp,pca9545 + then: + properties: + interrupts: false + "#interrupt-cells": false + interrupt-controller: false + unevaluatedProperties: false =20 examples: @@ -74,7 +89,7 @@ examples: #size-cells =3D <0>; =20 i2c-mux@74 { - compatible =3D "nxp,pca9548"; + compatible =3D "nxp,pca9545"; #address-cells =3D <1>; #size-cells =3D <0>; reg =3D <0x74>; --=20 2.41.0 From nobody Wed Dec 17 19:19:06 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D59DC2FC23 for ; Thu, 17 Aug 2023 07:11:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348383AbjHQHL0 (ORCPT ); Thu, 17 Aug 2023 03:11:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348368AbjHQHLH (ORCPT ); Thu, 17 Aug 2023 03:11:07 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58EB32D54 for ; Thu, 17 Aug 2023 00:11:03 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-9923833737eso974847166b.3 for ; Thu, 17 Aug 2023 00:11:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1692256262; x=1692861062; 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=b90IMLBWM6zQGsk777iCjnjr53BKkJdrEo5WNQ1ldaY=; b=H2c7NBiQQhO7/E+JhYmltH5Qey+YF7rioiXGPAct8f1Q++JttPziqyPgN9AzV7QaeC wbvn0skUZbWJx3/XZ8hT5/KK2lY+EoBYEsTKBGFocAUZyM2BqhyFrNd/fMB1Jt4bxcfP vt5Sp3TwVEGX2NMLnd3+P4pVzHO3g98ugqPOPMomOVeuLRGo7ljqecvx/0HL90dJY5MY BTyNeomIxik49AbiSKIH5sYTeHhEkCbXYPS9OO6LqQwlx6nRijQaQZU8J26pIAfRMm42 F62n2sZeF8VDqtjLbFTM7Gd0ii2k7oQXvuNl+Q/85HIColE/a4BXG26jmUckMCnjEPZb 4y/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692256262; x=1692861062; 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=b90IMLBWM6zQGsk777iCjnjr53BKkJdrEo5WNQ1ldaY=; b=Sn5MDH96aF1VDHiHncmjLfwRf2wHNb6B/NjQ/mmLzVs9iT0QRwQ3RnTTyjXtwiV6KJ ZZz0+vcpJDUlVuDKx58JFbUo22SkpQwV7ljPqCRe8IKbPCS5Ar22S7weltgwuRmF5KqE Zu5pvJwCTkEGBdCsb5GXz9MgqNfFD2sC6eYEcA5uWzpNlNuHd+kuewGzpW67BRhUZj30 RWl+9XuEjnQJpf3vFRkg6PTTA6dXEmnsLZmleeBNoQqJ6WShQ0KOug8sQMy/hArTlur+ ulOkRZQe6jajkV8wD52HyQf0iQqr3W73GEQkL9qHa55RUd+18SWJFYcxkPU2GrAvGu3+ w9Dg== X-Gm-Message-State: AOJu0YwKG29HxGchdvPZ0f4pz/rRUL690aDOhFGwpJtbNdwSJZ2+QGi+ dAie+0WCQSZZetu4NnbjDTmomg== X-Google-Smtp-Source: AGHT+IEgdlNDyUuQTO740sHhf8djCEa8VT8SCiFbw6TV/IOas227T3QbIjZIW2aIg8rgvvW1eRh80Q== X-Received: by 2002:a17:906:311b:b0:99b:507d:dc05 with SMTP id 27-20020a170906311b00b0099b507ddc05mr3493724ejx.16.1692256261878; Thu, 17 Aug 2023 00:11:01 -0700 (PDT) Received: from fedora.sec.9e.network (ip-095-222-150-251.um34.pools.vodafone-ip.de. [95.222.150.251]) by smtp.gmail.com with ESMTPSA id qn17-20020a170907211100b00992b510089asm9674361ejb.84.2023.08.17.00.11.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 00:11:01 -0700 (PDT) From: Patrick Rudolph To: Peter Rosin , Laurent Pinchart Cc: naresh.solanki@9elements.com, Patrick Rudolph , Krzysztof Kozlowski , Rob Herring , Krzysztof Kozlowski , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v15 2/4] dt-bindings: i2c: Add Maxim MAX735x/MAX736x variants Date: Thu, 17 Aug 2023 09:10:51 +0200 Message-ID: <20230817071056.2125679-3-patrick.rudolph@9elements.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230817071056.2125679-1-patrick.rudolph@9elements.com> References: <20230817071056.2125679-1-patrick.rudolph@9elements.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Update the pca954x bindings to add support for the Maxim MAX735x/MAX736x chips. The functionality will be provided by the existing pca954x driver. For chips that are powered off by default add a regulator called vdd-supply. Signed-off-by: Patrick Rudolph Reviewed-by: Krzysztof Kozlowski Acked-by: Peter Rosin --- .../bindings/i2c/i2c-mux-pca954x.yaml | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml b/D= ocumentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml index e5c1070903ef..2d7bb998b0e9 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.yaml @@ -4,18 +4,29 @@ $id: http://devicetree.org/schemas/i2c/i2c-mux-pca954x.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# =20 -title: NXP PCA954x I2C bus switch +title: NXP PCA954x I2C and compatible bus switches =20 maintainers: - Laurent Pinchart =20 description: - The binding supports NXP PCA954x and PCA984x I2C mux/switch devices. + The NXP PCA954x and compatible devices are I2C bus + multiplexer/switches that share the same functionality + and register layout. + The devices usually have 4 or 8 child buses, which are + attached to the parent bus by using the SMBus "Send Byte" + command. =20 properties: compatible: oneOf: - enum: + - maxim,max7356 + - maxim,max7357 + - maxim,max7358 + - maxim,max7367 + - maxim,max7368 + - maxim,max7369 - nxp,pca9540 - nxp,pca9542 - nxp,pca9543 @@ -56,6 +67,10 @@ properties: description: if present, overrides i2c-mux-idle-disconnect $ref: /schemas/mux/mux-controller.yaml#/properties/idle-state =20 + vdd-supply: + description: A voltage regulator supplying power to the chip. On PCA98= 46 + the regulator supplies power to VDD2 (core logic) and optionally to = VDD1. + required: - compatible - reg @@ -68,6 +83,8 @@ allOf: compatible: contains: enum: + - maxim,max7367 + - maxim,max7369 - nxp,pca9542 - nxp,pca9543 - nxp,pca9544 @@ -94,6 +111,8 @@ examples: #size-cells =3D <0>; reg =3D <0x74>; =20 + vdd-supply =3D <&p3v3>; + interrupt-parent =3D <&ipic>; interrupts =3D <17 IRQ_TYPE_LEVEL_LOW>; interrupt-controller; --=20 2.41.0 From nobody Wed Dec 17 19:19:06 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2E67C2FC27 for ; Thu, 17 Aug 2023 07:11:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348393AbjHQHL3 (ORCPT ); Thu, 17 Aug 2023 03:11:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348374AbjHQHLH (ORCPT ); Thu, 17 Aug 2023 03:11:07 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE2542D5D for ; Thu, 17 Aug 2023 00:11:04 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-977e0fbd742so952495666b.2 for ; Thu, 17 Aug 2023 00:11:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1692256263; x=1692861063; 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=G6lotLojQ1FtLW5br6dNExLIFwwLXzZYXdRfDLzNsvI=; b=RqINhEDBx2CQD2y8ECXOvQo/ibRF9CYh3v2VSCewsYuIc/jOfu8DpKV8aNK3vUl99y YhDQrgIh4rJUdbfjMJ/Z64Go8dAJxhe0IBnLVENj72V788PaRmYDOFSHTzgV9AWdcy5V SaQvtNwC5bcAKJaHUFckvcpbi2FlGomfoNzg4zU0m3cOW/lXUerP/IitHLVfN8uAi0ZC AvGyiJHs6VrLxN5Q+f92Xx+3lUsyFtS/RkZT8j8En9zIOYSQ/Icy6RxidgTsySXiwY7u 2tZ5uPJmRoeqRfc2K/NNJq96wd41zGVjSZj+KaAr1e8IBMTTTTwOXoXwfotllM6UqsHN dxRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692256263; x=1692861063; 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=G6lotLojQ1FtLW5br6dNExLIFwwLXzZYXdRfDLzNsvI=; b=jbOvaNg29uoLrducBygxXuwvezsalFfZ4Y9En4KgqaFzaf+pAk9eJKGngFwVOzZhcb TyMlc+GHTO1qUmFQnMkyqcA6s0uismqEd4wPuGnTwA3uKhTDaQu9Y9LYACjV9TjyOhhH 38obDJTqyQxSd8x8BDmsAgEHi3jNkacMkxkiHJzZY28jghnqLyJ6XmoLp69kMR3f0FCL 7BfwpZVqGMX5X5U3RziqjubFykHgEZdPmJYp+JQKJ0EV+0dhQjlhK+wLsmvN8MfKEC3n NFFE1u8QpXrKQnwpB47wkywZkmslIkzBwnPjOlxdVUN6WIZUCbIzKCoyZBgy/PikvL7n FSrg== X-Gm-Message-State: AOJu0YwEtzg4aY/gFDe6NS8Lyn1rqwBuMDoK9f4r7qprxOMljKD0/2+T Xtzrg/mRHqYk1A5EhELdXatyLQ== X-Google-Smtp-Source: AGHT+IHItXPAsSWcj7ZQeceHrkE1zlRbsJHRTQH9dM9h1AyD5xMkHPT8t5X/7ZlAUFeVBx3g9XUW/A== X-Received: by 2002:a17:906:300d:b0:99b:d693:cb8e with SMTP id 13-20020a170906300d00b0099bd693cb8emr3305434ejz.71.1692256263250; Thu, 17 Aug 2023 00:11:03 -0700 (PDT) Received: from fedora.sec.9e.network (ip-095-222-150-251.um34.pools.vodafone-ip.de. [95.222.150.251]) by smtp.gmail.com with ESMTPSA id qn17-20020a170907211100b00992b510089asm9674361ejb.84.2023.08.17.00.11.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 00:11:02 -0700 (PDT) From: Patrick Rudolph To: Peter Rosin Cc: naresh.solanki@9elements.com, Patrick Rudolph , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v15 3/4] i2c: muxes: pca954x: Add MAX735x/MAX736x support Date: Thu, 17 Aug 2023 09:10:52 +0200 Message-ID: <20230817071056.2125679-4-patrick.rudolph@9elements.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230817071056.2125679-1-patrick.rudolph@9elements.com> References: <20230817071056.2125679-1-patrick.rudolph@9elements.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add support for the following Maxim chips using the existing PCA954x driver: - MAX7356 - MAX7357 - MAX7358 - MAX7367 - MAX7368 - MAX7369 All added Maxim chips behave like the PCA954x, where a single SMBUS byte write selects up to 8 channels to be bridged to the primary bus. While the MAX7357/MAX7358 have interrupt support, they don't act as interrupt controller like the PCA9545 does. Thus don't enable IRQ support and handle them like the PCA9548. Tested using the MAX7357. Signed-off-by: Patrick Rudolph --- drivers/i2c/muxes/Kconfig | 6 +-- drivers/i2c/muxes/i2c-mux-pca954x.c | 64 ++++++++++++++++++++++++++++- 2 files changed, 66 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/muxes/Kconfig b/drivers/i2c/muxes/Kconfig index ea838dbae32e..db1b9057612a 100644 --- a/drivers/i2c/muxes/Kconfig +++ b/drivers/i2c/muxes/Kconfig @@ -65,11 +65,11 @@ config I2C_MUX_PCA9541 will be called i2c-mux-pca9541. =20 config I2C_MUX_PCA954x - tristate "NXP PCA954x and PCA984x I2C Mux/switches" + tristate "NXP PCA954x/PCA984x and Maxim MAX735x/MAX736x I2C Mux/switches" depends on GPIOLIB || COMPILE_TEST help - If you say yes here you get support for the NXP PCA954x - and PCA984x I2C mux/switch devices. + If you say yes here you get support for NXP PCA954x/PCA984x + and Maxim MAX735x/MAX736x I2C mux/switch devices. =20 This driver can also be built as a module. If so, the module will be called i2c-mux-pca954x. diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mu= x-pca954x.c index 0ccee2ae5720..968111442625 100644 --- a/drivers/i2c/muxes/i2c-mux-pca954x.c +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c @@ -4,6 +4,7 @@ * * Copyright (c) 2008-2009 Rodolfo Giometti * Copyright (c) 2008-2009 Eurotech S.p.A. + * Copyright (c) 2022 9elements GmbH * * This module supports the PCA954x and PCA984x series of I2C multiplexer/= switch * chips made by NXP Semiconductors. @@ -11,6 +12,12 @@ * PCA9540, PCA9542, PCA9543, PCA9544, PCA9545, PCA9546, PCA9547, * PCA9548, PCA9846, PCA9847, PCA9848 and PCA9849. * + * It's also compatible to Maxims MAX735x I2C switch chips, which are cont= rolled + * as the NXP PCA9548 and the MAX736x chips that act like the PCA9544. + * + * This includes the: + * MAX7356, MAX7357, MAX7358, MAX7367, MAX7368 and MAX7369 + * * These chips are all controlled via the I2C bus itself, and all have a * single 8-bit register. The upstream "parent" bus fans out to two, * four, or eight downstream busses or channels; which of these @@ -51,6 +58,12 @@ #define PCA954X_IRQ_OFFSET 4 =20 enum pca_type { + max_7356, + max_7357, + max_7358, + max_7367, + max_7368, + max_7369, pca_9540, pca_9542, pca_9543, @@ -90,8 +103,45 @@ struct pca954x { raw_spinlock_t lock; }; =20 -/* Provide specs for the PCA954x types we know about */ +/* Provide specs for the MAX735x, PCA954x and PCA984x types we know about = */ static const struct chip_desc chips[] =3D { + [max_7356] =3D { + .nchans =3D 8, + .muxtype =3D pca954x_isswi, + .id =3D { .manufacturer_id =3D I2C_DEVICE_ID_NONE }, + }, + [max_7357] =3D { + .nchans =3D 8, + .muxtype =3D pca954x_isswi, + .id =3D { .manufacturer_id =3D I2C_DEVICE_ID_NONE }, + /* No interrupt controller support. + The interrupt provides information about stuck channels. */ + }, + [max_7358] =3D { + .nchans =3D 8, + .muxtype =3D pca954x_isswi, + .id =3D { .manufacturer_id =3D I2C_DEVICE_ID_NONE }, + /* No interrupt controller support. + The interrupt provides information about stuck channels. */ + }, + [max_7367] =3D { + .nchans =3D 4, + .muxtype =3D pca954x_isswi, + .has_irq =3D 1, + .id =3D { .manufacturer_id =3D I2C_DEVICE_ID_NONE }, + }, + [max_7368] =3D { + .nchans =3D 4, + .muxtype =3D pca954x_isswi, + .id =3D { .manufacturer_id =3D I2C_DEVICE_ID_NONE }, + }, + [max_7369] =3D { + .nchans =3D 4, + .enable =3D 0x4, + .muxtype =3D pca954x_ismux, + .has_irq =3D 1, + .id =3D { .manufacturer_id =3D I2C_DEVICE_ID_NONE }, + }, [pca_9540] =3D { .nchans =3D 2, .enable =3D 0x4, @@ -177,6 +227,12 @@ static const struct chip_desc chips[] =3D { }; =20 static const struct i2c_device_id pca954x_id[] =3D { + { "max7356", max_7356 }, + { "max7357", max_7357 }, + { "max7358", max_7358 }, + { "max7367", max_7367 }, + { "max7368", max_7368 }, + { "max7369", max_7369 }, { "pca9540", pca_9540 }, { "pca9542", pca_9542 }, { "pca9543", pca_9543 }, @@ -194,6 +250,12 @@ static const struct i2c_device_id pca954x_id[] =3D { MODULE_DEVICE_TABLE(i2c, pca954x_id); =20 static const struct of_device_id pca954x_of_match[] =3D { + { .compatible =3D "maxim,max7356", .data =3D &chips[max_7356] }, + { .compatible =3D "maxim,max7357", .data =3D &chips[max_7357] }, + { .compatible =3D "maxim,max7358", .data =3D &chips[max_7358] }, + { .compatible =3D "maxim,max7367", .data =3D &chips[max_7367] }, + { .compatible =3D "maxim,max7368", .data =3D &chips[max_7368] }, + { .compatible =3D "maxim,max7369", .data =3D &chips[max_7369] }, { .compatible =3D "nxp,pca9540", .data =3D &chips[pca_9540] }, { .compatible =3D "nxp,pca9542", .data =3D &chips[pca_9542] }, { .compatible =3D "nxp,pca9543", .data =3D &chips[pca_9543] }, --=20 2.41.0 From nobody Wed Dec 17 19:19:06 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3820C2FC24 for ; Thu, 17 Aug 2023 07:11:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348398AbjHQHLa (ORCPT ); Thu, 17 Aug 2023 03:11:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348372AbjHQHLH (ORCPT ); Thu, 17 Aug 2023 03:11:07 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 034DA2D40 for ; Thu, 17 Aug 2023 00:11:06 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-99c0290f0a8so912135766b.1 for ; Thu, 17 Aug 2023 00:11:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1692256264; x=1692861064; 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=89F7HPVQyXXTql6NKond4APoTNtrcoR3WWVsZWeYnGU=; b=TgbZ/CJaNT5E0pj5GYvONqmkY9clXaDgZ3GzFBalCaFrSv0lcMDrWxA3FIoESnHuSp lnk0quVRulaA0xNXQla3opRrVW/yUkYgRBw1YuZGCTjUZUuLlG0h2Gy76KtnaFzf6rdN fuaLqDkWKWKRW1nl0+bTR79RrqVDD9PTC2I616oUPhzdZ4ezByFHnsgMykFe6LJvrgki OltaoZoZNQ4du8HJ6noqzMhYIH5l4atz6wH0itLVjrErfLSVdYoykRusEiZczIahSAfH YyqTPGvgS/vk+xoJMefOpL46tdlGdQZ20gKiKYAv2U6cCrlgLpKeQwnjVinrvshnIYdq mWgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692256264; x=1692861064; 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=89F7HPVQyXXTql6NKond4APoTNtrcoR3WWVsZWeYnGU=; b=SMWmOCgaUMR4iKWeb71ztTAEemviWCau6mmpj1TtD9UgaGcGQ1aCapPPg4wi2YD1gq jZPlaiIFlpoFCzZbxtFc7F10Gx/XPtA2j6moHPcUSy89ZW+YvFsQEis+qpWsENFH9aIX tzXf87XXvI0eAl+q1r5PgGgxWanNebfnSiwZJH82vkHBFJFLASk4VFiRmFQX5mx3NfGx vn3lYKoeobA0zlFbf/heE7Ns7KqWgreIrnj80xsfzyTHChujXdSlLxrflHia7+6YjFp4 wQTFgADVEWNjr935i9pn+F+sDkES8KvI/e8jU27XpxkexkWOymtUAejwNXs/XqnOM1Cz 5J3g== X-Gm-Message-State: AOJu0YwqyjjYMiHDLVRvWtxwTnYwbPFHgp6pGPfiRePkVFbB192l3Qz1 4DGZUMmGzrgRTWue/x/Sk4gnbQ== X-Google-Smtp-Source: AGHT+IFtJOLkzjgVmHbLgbpjFzK/zm5xo4iX82t+PikH5g9nEQtQqq+sKdZl/RoN5YPHQQgLU97h+A== X-Received: by 2002:a17:907:a078:b0:993:d617:bdc8 with SMTP id ia24-20020a170907a07800b00993d617bdc8mr3293049ejc.7.1692256264435; Thu, 17 Aug 2023 00:11:04 -0700 (PDT) Received: from fedora.sec.9e.network (ip-095-222-150-251.um34.pools.vodafone-ip.de. [95.222.150.251]) by smtp.gmail.com with ESMTPSA id qn17-20020a170907211100b00992b510089asm9674361ejb.84.2023.08.17.00.11.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 00:11:04 -0700 (PDT) From: Patrick Rudolph To: Peter Rosin Cc: naresh.solanki@9elements.com, Patrick Rudolph , Andi Shyti , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v15 4/4] i2c: muxes: pca954x: Add regulator support Date: Thu, 17 Aug 2023 09:10:53 +0200 Message-ID: <20230817071056.2125679-5-patrick.rudolph@9elements.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230817071056.2125679-1-patrick.rudolph@9elements.com> References: <20230817071056.2125679-1-patrick.rudolph@9elements.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add a vdd regulator and enable it for boards that have the mux powered off by default. Signed-off-by: Patrick Rudolph Reviewed-by: Andi Shyti Acked-by: Peter Rosin --- drivers/i2c/muxes/i2c-mux-pca954x.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mu= x-pca954x.c index 968111442625..b863f7b18190 100644 --- a/drivers/i2c/muxes/i2c-mux-pca954x.c +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -101,6 +102,7 @@ struct pca954x { struct irq_domain *irq; unsigned int irq_mask; raw_spinlock_t lock; + struct regulator *supply; }; =20 /* Provide specs for the MAX735x, PCA954x and PCA984x types we know about = */ @@ -444,6 +446,8 @@ static void pca954x_cleanup(struct i2c_mux_core *muxc) struct pca954x *data =3D i2c_mux_priv(muxc); int c, irq; =20 + regulator_disable(data->supply); + if (data->irq) { for (c =3D 0; c < data->chip->nchans; c++) { irq =3D irq_find_mapping(data->irq, c); @@ -496,10 +500,22 @@ static int pca954x_probe(struct i2c_client *client) i2c_set_clientdata(client, muxc); data->client =3D client; =20 + data->supply =3D devm_regulator_get(dev, "vdd"); + if (IS_ERR(data->supply)) + return dev_err_probe(dev, PTR_ERR(data->supply), + "Failed to request regulator\n"); + + ret =3D regulator_enable(data->supply); + if (ret) + return dev_err_probe(dev, ret, + "Failed to enable vdd supply\n"); + /* Reset the mux if a reset GPIO is specified. */ gpio =3D devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); - if (IS_ERR(gpio)) - return PTR_ERR(gpio); + if (IS_ERR(gpio)) { + ret =3D PTR_ERR(gpio); + goto fail_cleanup; + } if (gpio) { udelay(1); gpiod_set_value_cansleep(gpio, 0); @@ -516,7 +532,7 @@ static int pca954x_probe(struct i2c_client *client) =20 ret =3D i2c_get_device_id(client, &id); if (ret && ret !=3D -EOPNOTSUPP) - return ret; + goto fail_cleanup; =20 if (!ret && (id.manufacturer_id !=3D data->chip->id.manufacturer_id || @@ -524,7 +540,8 @@ static int pca954x_probe(struct i2c_client *client) dev_warn(dev, "unexpected device id %03x-%03x-%x\n", id.manufacturer_id, id.part_id, id.die_revision); - return -ENODEV; + ret =3D -ENODEV; + goto fail_cleanup; } } =20 @@ -543,7 +560,8 @@ static int pca954x_probe(struct i2c_client *client) ret =3D pca954x_init(client, data); if (ret < 0) { dev_warn(dev, "probe failed\n"); - return -ENODEV; + ret =3D -ENODEV; + goto fail_cleanup; } =20 ret =3D pca954x_irq_setup(muxc); --=20 2.41.0