From patchwork Wed Jun 12 08:52:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 1114369 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=axentia.se Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=axentia.se header.i=@axentia.se header.b="I5c96KDF"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45P0y925WDz9sDB for ; Wed, 12 Jun 2019 18:53:05 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408008AbfFLIxA (ORCPT ); Wed, 12 Jun 2019 04:53:00 -0400 Received: from mail-eopbgr40091.outbound.protection.outlook.com ([40.107.4.91]:47108 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2436779AbfFLIxA (ORCPT ); Wed, 12 Jun 2019 04:53:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axentia.se; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0UfHLwB7NiF8BD1q9AQ+4p8GVMtsleNPdqN2S2nL84Y=; b=I5c96KDF4+ugZcCKEhvMmySBaZoNcGNZxcqTScU5yGJc6nSaXOPeYeUmA9Jm8191bardL5qc2OhRKcKlrKsEDkYstE/K37a2XV6prB2yjeW/O5TNhcj7q7xM8JBwo9ONTZbUh6R5DZPCl082cagRonDcz7+0FUb8xYlTbztmjx0= Received: from DB3PR0202MB3434.eurprd02.prod.outlook.com (52.134.66.158) by DB3PR0202MB3275.eurprd02.prod.outlook.com (52.134.66.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1965.14; Wed, 12 Jun 2019 08:52:56 +0000 Received: from DB3PR0202MB3434.eurprd02.prod.outlook.com ([fe80::49ac:3a71:a3ec:d6bf]) by DB3PR0202MB3434.eurprd02.prod.outlook.com ([fe80::49ac:3a71:a3ec:d6bf%5]) with mapi id 15.20.1987.010; Wed, 12 Jun 2019 08:52:56 +0000 From: Peter Rosin To: Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" CC: Pankaj Bansal , Peter Rosin , Rob Herring , Mark Rutland , "devicetree@vger.kernel.org" Subject: [RESEND PATCH 1/2] dt-bindings: add register based devices' mux controller DT bindings Thread-Topic: [RESEND PATCH 1/2] dt-bindings: add register based devices' mux controller DT bindings Thread-Index: AQHVIPw6O6T+ZmHGOUCUYNQplQDsYQ== Date: Wed, 12 Jun 2019 08:52:56 +0000 Message-ID: <20190612085238.1763-2-peda@axentia.se> References: <20190612085238.1763-1-peda@axentia.se> In-Reply-To: <20190612085238.1763-1-peda@axentia.se> Accept-Language: en-US, sv-SE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.11.0 x-originating-ip: [213.112.138.100] x-clientproxiedby: HE1PR0102CA0053.eurprd01.prod.exchangelabs.com (2603:10a6:7:7d::30) To DB3PR0202MB3434.eurprd02.prod.outlook.com (2603:10a6:8:5::30) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ef4510af-c142-45c1-3e86-08d6ef135ce3 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(7021145)(8989299)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:DB3PR0202MB3275; x-ms-traffictypediagnostic: DB3PR0202MB3275: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 0066D63CE6 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(376002)(39830400003)(396003)(346002)(136003)(189003)(199004)(25786009)(508600001)(8936002)(4326008)(66476007)(74482002)(256004)(64756008)(66446008)(66556008)(66946007)(50226002)(73956011)(486006)(2906002)(11346002)(446003)(14454004)(476003)(81166006)(86362001)(110136005)(186003)(71200400001)(2501003)(3846002)(66066001)(8676002)(76176011)(53936002)(6486002)(81156014)(2616005)(26005)(6512007)(6436002)(14444005)(316002)(5660300002)(6116002)(99286004)(7736002)(36756003)(52116002)(68736007)(305945005)(1076003)(6506007)(54906003)(102836004)(71190400001)(386003); DIR:OUT; SFP:1102; SCL:1; SRVR:DB3PR0202MB3275; H:DB3PR0202MB3434.eurprd02.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: axentia.se does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 82rfooLbV717teWqrieaSpCtAqFC13BjpTTiNHerIPt2GDGvQddPXow2OSvQP6dknZHMXOvDQaHJiFbeGDIokYR5cXG4KhMiUo+/HgHmUu05OrrAjuudrJF8aCivZdiX3CUN5EBbUBtLNRi34rXNczure2YevhxL3g+tZ4hSFbEj9pMOhh07F5uFb/SiqPCcQRyP9ROjamBpp6Q3ECegLgesyVun+O5mvFxRF25RFGcCILL1KzlaUnxzZUWtgz+XXUCXM8L7etgoBTf2aZled4v6L25nVNPylrAWtGOjRDU0qpt/K0XDlTBbuVmJZIydEQS8HgjvRxEDbu3u7T1dzLt6mqNlEEirnC4g7snnlRlDwyCkrlJk+VQjhojvJCOh3DlMthcymi/9Qqc+xc2vSPmsMz4G+Ofuxsrzvq2pkZA= MIME-Version: 1.0 X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-Network-Message-Id: ef4510af-c142-45c1-3e86-08d6ef135ce3 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jun 2019 08:52:56.3456 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4ee68585-03e1-4785-942a-df9c1871a234 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: peda@axentia.se X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0202MB3275 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Pankaj Bansal This adds device tree binding documentation for generic register based multiplexer controlled by a bitfields in a parent device's register range. since MMIO mux is a special case of generic register based mux, the MMIO mux bindings have been subsumed in these bindings. Signed-off-by: Pankaj Bansal Signed-off-by: Peter Rosin --- Documentation/devicetree/bindings/mux/mmio-mux.txt | 60 ---------- Documentation/devicetree/bindings/mux/reg-mux.txt | 129 +++++++++++++++++++++ 2 files changed, 129 insertions(+), 60 deletions(-) delete mode 100644 Documentation/devicetree/bindings/mux/mmio-mux.txt create mode 100644 Documentation/devicetree/bindings/mux/reg-mux.txt diff --git a/Documentation/devicetree/bindings/mux/mmio-mux.txt b/Documentation/devicetree/bindings/mux/mmio-mux.txt deleted file mode 100644 index a9bfb4d8b6ac..000000000000 --- a/Documentation/devicetree/bindings/mux/mmio-mux.txt +++ /dev/null @@ -1,60 +0,0 @@ -MMIO register bitfield-based multiplexer controller bindings - -Define register bitfields to be used to control multiplexers. The parent -device tree node must be a syscon node to provide register access. - -Required properties: -- compatible : "mmio-mux" -- #mux-control-cells : <1> -- mux-reg-masks : an array of register offset and pre-shifted bitfield mask - pairs, each describing a single mux control. -* Standard mux-controller bindings as decribed in mux-controller.txt - -Optional properties: -- idle-states : if present, the state the muxes will have when idle. The - special state MUX_IDLE_AS_IS is the default. - -The multiplexer state of each multiplexer is defined as the value of the -bitfield described by the corresponding register offset and bitfield mask pair -in the mux-reg-masks array, accessed through the parent syscon. - -Example: - - syscon { - compatible = "syscon"; - - mux: mux-controller { - compatible = "mmio-mux"; - #mux-control-cells = <1>; - - mux-reg-masks = <0x3 0x30>, /* 0: reg 0x3, bits 5:4 */ - <0x3 0x40>, /* 1: reg 0x3, bit 6 */ - idle-states = , <0>; - }; - }; - - video-mux { - compatible = "video-mux"; - mux-controls = <&mux 0>; - - ports { - /* inputs 0..3 */ - port@0 { - reg = <0>; - }; - port@1 { - reg = <1>; - }; - port@2 { - reg = <2>; - }; - port@3 { - reg = <3>; - }; - - /* output */ - port@4 { - reg = <4>; - }; - }; - }; diff --git a/Documentation/devicetree/bindings/mux/reg-mux.txt b/Documentation/devicetree/bindings/mux/reg-mux.txt new file mode 100644 index 000000000000..4afd7ba73d60 --- /dev/null +++ b/Documentation/devicetree/bindings/mux/reg-mux.txt @@ -0,0 +1,129 @@ +Generic register bitfield-based multiplexer controller bindings + +Define register bitfields to be used to control multiplexers. The parent +device tree node must be a device node to provide register r/w access. + +Required properties: +- compatible : should be one of + "reg-mux" : if parent device of mux controller is not syscon device + "mmio-mux" : if parent device of mux controller is syscon device +- #mux-control-cells : <1> +- mux-reg-masks : an array of register offset and pre-shifted bitfield mask + pairs, each describing a single mux control. +* Standard mux-controller bindings as decribed in mux-controller.txt + +Optional properties: +- idle-states : if present, the state the muxes will have when idle. The + special state MUX_IDLE_AS_IS is the default. + +The multiplexer state of each multiplexer is defined as the value of the +bitfield described by the corresponding register offset and bitfield mask +pair in the mux-reg-masks array. + +Example 1: +The parent device of mux controller is not a syscon device. + +&i2c0 { + fpga@66 { // fpga connected to i2c + compatible = "fsl,lx2160aqds-fpga", "fsl,fpga-qixis-i2c", + "simple-mfd"; + reg = <0x66>; + + mux: mux-controller { + compatible = "reg-mux"; + #mux-control-cells = <1>; + mux-reg-masks = <0x54 0xf8>, /* 0: reg 0x54, bits 7:3 */ + <0x54 0x07>; /* 1: reg 0x54, bits 2:0 */ + }; + }; +}; + +mdio-mux-1 { + compatible = "mdio-mux-multiplexer"; + mux-controls = <&mux 0>; + mdio-parent-bus = <&emdio1>; + #address-cells = <1>; + #size-cells = <0>; + + mdio@0 { + reg = <0x0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + mdio@8 { + reg = <0x8>; + #address-cells = <1>; + #size-cells = <0>; + }; + + .. + .. +}; + +mdio-mux-2 { + compatible = "mdio-mux-multiplexer"; + mux-controls = <&mux 1>; + mdio-parent-bus = <&emdio2>; + #address-cells = <1>; + #size-cells = <0>; + + mdio@0 { + reg = <0x0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + mdio@1 { + reg = <0x1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + .. + .. +}; + +Example 2: +The parent device of mux controller is syscon device. + +syscon { + compatible = "syscon"; + + mux: mux-controller { + compatible = "mmio-mux"; + #mux-control-cells = <1>; + + mux-reg-masks = <0x3 0x30>, /* 0: reg 0x3, bits 5:4 */ + <0x3 0x40>, /* 1: reg 0x3, bit 6 */ + idle-states = , <0>; + }; +}; + +video-mux { + compatible = "video-mux"; + mux-controls = <&mux 0>; + #address-cells = <1>; + #size-cells = <0>; + + ports { + /* inputs 0..3 */ + port@0 { + reg = <0>; + }; + port@1 { + reg = <1>; + }; + port@2 { + reg = <2>; + }; + port@3 { + reg = <3>; + }; + + /* output */ + port@4 { + reg = <4>; + }; + }; +};