From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=148.163.129.52 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796169177; b=UCRb39dcYyoTlRzvZ6GnYu0JQLsMp79Hl4YCzpH2fAB5DL8IONUvBciFJN8cUsNvkO/P AEcV2xUMb7UoU7jls1fcC6q+IPykFJnfjOvn17VsOJXBa+5rBoFirfKBRiUB6+QF43xV9 58HXPgEu6b4/Hiogw6WnjhHNmTjCfQcEHVzuw+gfI6HYMgW//mYh5PpMD3aQB9DVfKmqV 3Txc+KNhCthX/4BJ582mbOOfZDwfubGxAlMYvyOdfzJAyb3tAJ1nnJgs0CCIWo2wwkiRM AYfJW34eBMCHjvrLoASXmzq5O3MXanzqV2eYlYK9mbif9qSpK4hnjvGKyLaCD0M1Tww== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796169177; h=DMARC-Filter:DKIM-Signature:X-Virus-Scanned:Received:DKIM-Signature: Received:Received:From:To:CC:Subject:Thread-Topic:Thread-Index:Date: Message-ID:References:In-Reply-To:Accept-Language:Content-Language: X-MS-Has-Attach:X-MS-TNEF-Correlator:x-ms-publictraffictype: x-ms-traffictypediagnostic:x-ms-office365-filtering-correlation-id: x-ms-exchange-senderadcheck:x-ms-exchange-antispam-relay: x-microsoft-antispam:x-microsoft-antispam-message-info: x-forefront-antispam-report: x-ms-exchange-antispam-messagedata-chunkcount: x-ms-exchange-antispam-messagedata-0:Content-Type: Content-Transfer-Encoding:MIME-Version: X-Exchange-RoutingPolicyChecked:X-OriginatorOrg: X-MS-Exchange-CrossTenant-AuthAs:X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-MDID:X-PPE-STACK: X-MDID-O:X-PPE-TRUSTED; bh=hqZTq8PFmwhnt1OIETjKk3WAmmj1sKW9NWFAGb/3cWg=; b=HRV/GICJ8QEXgK3IvyahCij67cFUQbqjaDBwWBAAWJmopsi2zni6gb8A0PhO+3Coufyx o8+E10SObEVO57bzyAuKFxuBOgaTZUy0pGX2oO587hiT4RlcUAnnvFHQNN4G+suzuzbhJ mKgcNKwNWqorF9WKuU4f8gatDYWZNVwxDYF5+VLKS4ZRz5KcY8/UA8l0dtFXGsL7kntrc AzFqIWMy4jxZW9E08JrPtez4tumcZWSvgkp6vk5M7TyaEUGy0DRsIjWwBS/K7SYO7QCsy hMkpP4G/0+Z/eaPSm728Xo0AKz7hada9/OVguBwZ9RvE+aSWu39anj5l1WJm/VB5D5A== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=sitime.com; spf=pass smtp.mailfrom=sitime.com; dkim=pass header.d=sitime.com header.i=@sitime.com header.a=rsa-sha256 header.s=mail header.b="b7GjBJ/k"; dkim=pass header.d=Sitime.onmicrosoft.com header.i=@Sitime.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-Sitime-onmicrosoft-com header.b=QcKe6nK+; arc=pass header.oldest-pass=0 smtp.remote-ip=148.163.129.52 Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2F9760A3802; Tue, 1 Dec 2026 23:52:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B2F9760A3802 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sitime.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sitime.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sitime.com header.i=@sitime.com header.a=rsa-sha256 header.s=mail header.b=b7GjBJ/k; dkim=pass (2048-bit key) header.d=Sitime.onmicrosoft.com header.i=@Sitime.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-Sitime-onmicrosoft-com header.b=QcKe6nK+ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sitime.com; h=cc:cc:content-transfer-encoding:content-transfer-encoding:content-type:content-type:date:date:from:from:in-reply-to:in-reply-to:message-id:message-id:mime-version:mime-version:references:references:subject:subject:to:to; s=mail; bh=hqZTq8PFmwhnt1OIETjKk3WAmmj1sKW9NWFAGb/3cWg=; b=b7GjBJ/kviyobqn7Ia9LqDecM3CgjyHp92K1uKYu5c0AHS5w5RUf+DoAOdm8MIt4MOQkCzucjiKFPPQsefSNw5ibkoQWZHh86ERw4zvZMI4RHxDQ35NM7ue+M9RwX81/aGrVqFx/pzrG12R2/bNuMirJY2LGw5mgZV0mh02BGT6QWkDBIvemiFYs62hf30WnY2AC3yMnwSX0BsINGaeUpkjALScowwXqY1+zPYBnth7gJKJWSVtiyme9bJO1MdQZoJbj959kzJXyuLpmbq/YUrPnnuvldEU0hcGPBX4XKXP27JTImfBPnyzAr7QzmPbCM1gEi2Ti7TY8vmGlyyzogg== X-Virus-Scanned: Proofpoint Essentials engine Received: from BN1PR04CU002.outbound.protection.outlook.com (mail-eastus2azon11020098.outbound.protection.outlook.com [52.101.56.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 88C77100067; Tue, 1 Dec 2026 23:52:53 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gEfK/ZMr6WKj1tvuu6gCwUp0pIC4ZksgdhwN5VzujpzlaBZyXHoTFV/dtPpxtfT7pJY/YviKvYu8rU5jMycQz3Rd7EzbDj3uDTk+q7S/PhrNPIYLFVxmRiV2UKEz8fOr7I6H2CyEpr+2ND5cChSqPm1kTjNYCdhwrCI1XA12ypVTAJhvf9HGfPId1jwA5LtQ8WfUUIbD6+vO9zmea4dQoO+XlSkU5RZowHN0m9PYpKYI/Zr6NQlKGg/UFLoCs2mmEDvQkRpXrEF2vtpuCfk+FQ71Kq6hV5iEV+qdwY+N1OBXuqNRCZl8SNIhDCxyxL666Or0rcT3Pi2KCKN7mzdjtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hqZTq8PFmwhnt1OIETjKk3WAmmj1sKW9NWFAGb/3cWg=; b=wXk+pwPTsdiFySgczGDYLY06uUB+1kHvfPUR4mElJuc/MEbbKpLZUZ9Nja7AKuEVTzT63zL1K9eTECGWE7rELptA316dttjJPiMvhCVE72eNjNi9asaYLuCnyLhRLYwAppo/z4QGVrd7sHLMAdskgxpDCFzwI2Scc75RSaELoKgUSs3pk8MTncYKQNoGWuxLAxZZ8R3o1cGHeK5UenjCdcLU1PSoFFVig3mKTQZfyKD0LVKXBugnFufxzYWJfxzL8lY51LIJ7ySnLHOHs9SAanuSpnHLZPbbma+tUR94P1PV7JlG8M/LC+PMrr0WWos/QtN9+/KuQmJ8RuAKyXzaSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=sitime.com; dmarc=pass action=none header.from=sitime.com; dkim=pass header.d=sitime.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Sitime.onmicrosoft.com; s=selector1-Sitime-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hqZTq8PFmwhnt1OIETjKk3WAmmj1sKW9NWFAGb/3cWg=; b=QcKe6nK+4VrK6W1KudwGpWW97eALwZrzm/0loBIGpscgnZQ0/7ZaaRL26uL+zjoSluVh3qJzU26MWY6i5U1PWVAfVOHiyZYUTM58ejXZFusEHY3EmQQGcz64/ktc2MC/UCepdkM5MDDMMS0cOp2X38FM0v3xw0ihvzYjQBULv+Oji2uD1zmOXZ2yptwBkCuTkFpH7MHtDEjRxbVF+TQ7cEG2MTUnrSbiOepLLyxMxqYcUUxOYMmghWguZ7hZaPjIb7WW8x3m4AK+7R1XP5ZoJPEEY/8zxxYKaVqEyMKb7K/kq2cGEYQLvx+4TBWltLgf2BEtkpjFACdtfkfyqD6vvQ== Received: from LVWPR20MB994915.namprd20.prod.outlook.com (2603:10b6:408:3bf::16) by MW4PR20MB4526.namprd20.prod.outlook.com (2603:10b6:303:18c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.10; Tue, 1 Dec 2026 23:52:48 +0000 Received: from LVWPR20MB994915.namprd20.prod.outlook.com ([fe80::9551:3864:128b:8c01]) by LVWPR20MB994915.namprd20.prod.outlook.com ([fe80::9551:3864:128b:8c01%4]) with mapi id 15.21.0688.009; Tue, 1 Dec 2026 23:52:48 +0000 From: Ali Rouhi To: "jiri@resnulli.us" CC: "ivecera@redhat.com" , "vadim.fedorenko@linux.dev" , "arkadiusz.kubalewski@intel.com" , "kuba@kernel.org" , "pabeni@redhat.com" , "robh@kernel.org" , "krzk+dt@kernel.org" , "conor+dt@kernel.org" , "prabhakar.mahadev-lad.rj@bp.renesas.com" , "cjubran@nvidia.com" , "Oleg.Zadorozhnyi@devoxsoftware.com" , "netdev@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH net-next v17 13/13] dpll: sit9531x: model the inter-PLL sync line as a pair of pins Thread-Topic: [PATCH net-next v17 13/13] dpll: sit9531x: model the inter-PLL sync line as a pair of pins Thread-Index: AQHdge76sQOvfcfJ802BEksrQvcUIA== Date: Tue, 1 Dec 2026 23:52:09 +0000 Message-ID: <20261201235202.97645-14-arouhi@sitime.com> References: <20261201235202.97645-1-arouhi@sitime.com> In-Reply-To: <20261201235202.97645-1-arouhi@sitime.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=sitime.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LVWPR20MB994915:EE_|MW4PR20MB4526:EE_ x-ms-office365-filtering-correlation-id: e4774dc1-fa67-4bdb-9410-08df500633f4 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|23010399003|366016|1800799024|5023799004|6133799003|22082099003|18002099003|3023799007|261009223027099003|56012099006|10067099003|261021130227099003|261026130827099003|261028144727099003|261021121427099003|261022113327099003|261026121527099003|261021123027099003|261026140227099003|261021133027099003|261026135527099003|261022075727099003|261022105027099003|261102123227099003|261022115727099003|261021135927099003|38070700021; x-microsoft-antispam-message-info: 0TSJKpqA3+J/f8TYdP90eHxxrR0l9nYPmBQK6CQV/Ef/CgytT9isXRh4+bRBtnBaG946qoCHbx4R0DzVPcVk82y+QE/TX78Ik44Yb0xIIIc80xbHda8eBnzDLUuu4EGYcb4UvYyMONW+urncpRJ+RaGRcXMHRSO8Gata8dZaUOZvJHaS5Sf2HOalJtAw2JsDJXvJfhZIIw79SKMmNo8gosRn3aXDBSIsRp2Tz6OxZDSSdDJUN1o8KtjqALfX2jj1R1Uq2C6XrvJK5Mil7798sxRDQNI41+ViA553ulZDCSifFStoaVSy/8g9PHnxmh1OFK9cz/a+c76PVGZy/DJtZWWIYDiULPOIgosK7/it/w6YyFhMtb6phbWzJUoGgZDtweMftol2hIa0ukJfS9qQHMAKG5ZCpVwbf+pTFvpLPGk+ItkQg71iPo/Z8qVWB2gls0KRVvJ4LMsR6mTooPYnFijFx9FNGZ9tYqToa+DaEbPdTv+GJ8mQChPfxz/1D/7QGRz1Qtec0ED/ROibTCw2a/EFFXsfr3mZ4Ln8nPwmxdrM+NpE/M6n0hnkz7svoytdugiFnv00VT1ARGX33tqBRiBvBRrvt/g/28ludkCKM8t9Ep30UlNR/mbhqHrvoI3MRptvBmz7hwIawFqwMVYiE7C/3+0zmv9sepdVTam7O/UcV5LED2CuwWDWM1Q9wxl5Siu1gTU0eic+YSMIHodM3JAmQ3DBxL9KwCwmxwpY7lw= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LVWPR20MB994915.namprd20.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(366016)(1800799024)(5023799004)(6133799003)(22082099003)(18002099003)(3023799007)(261009223027099003)(56012099006)(10067099003)(261021130227099003)(261026130827099003)(261028144727099003)(261021121427099003)(261022113327099003)(261026121527099003)(261021123027099003)(261026140227099003)(261021133027099003)(261026135527099003)(261022075727099003)(261022105027099003)(261102123227099003)(261022115727099003)(261021135927099003)(38070700021);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?rKFXO5pADeDsY47me2k5lNGUWd8c2BJGKeOF51Mxy1G51S2TXzgV+CigfR?= =?iso-8859-1?Q?KlaenNxotxWakHO8SDHLrJWIUN9EIA/m82c6/j5mZukC1SllMBlH/pMo1+?= =?iso-8859-1?Q?GY8sUc8jaHWkBkdjtT/8xHqnjRQ++JosIpcdpDHs1Bka3QUnY8xscSrRUM?= =?iso-8859-1?Q?GLvJcmnr+/UwMrGqvndo0qV1RqHPRgXEL/2OS75CZmLB7F2ig3bceydb9l?= =?iso-8859-1?Q?kIfvFFNJn/RNMTQg0N1E97ebT69hGMkIu4wLUQSQC+FH5axC5eXFItHpr/?= =?iso-8859-1?Q?nCDgoYWgnBs792tq7z68SvfwGCmNk8CSNzCnTF/h0qkdZUgLn2LNBp413c?= =?iso-8859-1?Q?IOldSd+oDnm+T+QMSBkKEAfgFA26AQm75hWJXHIf64fJXh8R3VdVJ0BWTZ?= =?iso-8859-1?Q?3mTEX/SgFV3vGq2024bgE6Ra4c2YbDXIM5hcDgOPiV4R43PnAFH7wCNU10?= =?iso-8859-1?Q?HoyelP6whK3WP3GsgULASUFneX+xzKYRaDcbUa8fnZYyERoBslRwIX0mx4?= =?iso-8859-1?Q?8gTom7PCuDzZHWh5jOElie1ABjOkMSmYC9PjoRieHeC2Fsc94d7VrnQqcQ?= =?iso-8859-1?Q?uebJiN2mStbKBGwZSrqeKlNMLf/9aA5kQrKzBmbGmfjZzxAXJOnEmzD+QZ?= =?iso-8859-1?Q?l7hmMCZU43Revh+qYYHamO6IiIItSsRSJG62rP9g79RNxyEMlVeOHVIKwj?= =?iso-8859-1?Q?OH2YIucjRUpppp+Mt4RU6NEbcJQqaxprMjrNZmcdH18kW3kBTlQyGPLHnN?= =?iso-8859-1?Q?fzYJGXOLU4oK+Z4oFSTZUCHFuUs7oYWkmM6fQhFNKryxkVInrBIPvncAnQ?= =?iso-8859-1?Q?EvibwZ5jPu1eEHzlj3pTnuF2xYyTiHXGYgvwT2D79wvI867lrAXSPxCoJB?= =?iso-8859-1?Q?lac+WeU5AVKUdzOfi68i294XG7R5l5QbFYQcBps/3K9UbJT3O1XbZqZHLY?= =?iso-8859-1?Q?qgS0fQL8isZrQp0kUv9rMhoXgcuQo4JfM8s40KG5dmU1TRye0k1IoGqd2r?= =?iso-8859-1?Q?/pp6HQ6WcVCgUC3lZgDKNRP/P0dDVAmw/yTeRT/ZcMjqOHEfITGFgqc0N9?= =?iso-8859-1?Q?ikAH87sXVwn9IhEacrQF9Ih79fghUFgOUwzK4aRE8o4bT3Q4ixlL52gWQe?= =?iso-8859-1?Q?KRTpnqD25yVPRUHzdW/b7n81f0hJYcLzuNM3QztkF5RwkVKNcYAJe88LYJ?= =?iso-8859-1?Q?6dU1DSqFeRLmwrAMxHMuIgaLClxU8jOxQHFwb1ynUOLdP27QrbtvlReD49?= =?iso-8859-1?Q?Mp2QJAPGqWFFvwBQSHXDXcQQrYPN5GuNr/rizq7CHO80ogUXwp/+D6ll8G?= =?iso-8859-1?Q?Spmbs0RoSCGSEEeM4iw/JVfblF1iqQvXs4UzI9Y8rYM9UPLxdf8pxT80a+?= =?iso-8859-1?Q?6541y3yLDFiiW8jMnuwCLN2LKZKphbZlWRNNncStBlXxXQuz0sziQGvohv?= =?iso-8859-1?Q?gBHE1KQtJHlA7L1PYu5bGYkfTws9u5yXVxqmPTQPgWBxgFM/GhSd/pCHW4?= =?iso-8859-1?Q?8pzI7OdSuzIWlLBPyDoaC2Z9jBVRhs1nB1dLXJsLzGr/fArZABhbREzwjD?= =?iso-8859-1?Q?qkv+bU/er8Qb6w9OUPRcXa4AbJAtlqhsXrQbE4EPanWQrRNdFBLKBlaG2S?= =?iso-8859-1?Q?bPDhMfIpsAJpZClvckWD07D4l4CjAZBKXlk3NPl02zykzVQtwXyyITwGWT?= =?iso-8859-1?Q?bN8mMoP1N6VEBB2A0SzbKhfVlYPxI2U6wPc9hDtCYj5FUdH0MkogoBmcQZ?= =?iso-8859-1?Q?0znJu1CQmi/C7Aed2DD89m8VLfQSYWNKQMP5Rm+9JxY6hY?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Exchange-RoutingPolicyChecked: kGZp6xANWj+AgCB+OVeBVvqhgh0vAbcYIA05l3u91Bd5gdomxJTV7nZZec846QL4dIrT58Od4zsvrczOm2imjWKaQZHg5uxu+xWTpStH//WaFiG9LiwpvRHlmt2AFRQReu5xc6UqHuEKE9sUBoT/pyloDSk2d+/WU/K+6PpyRjheWwT+Oggs1qphjfakSL+QrqVhZdmdTwu/5ixwlEm1n69gdwUwiMmvX0fBs1LqFnNXlZrNljLEper+u4RN/TzPIZZeWEcyV3eyDEoDX+zQyH3cQzHOL054ngplnHtL1an6K4GN2ms+Q+Ct4GNGFYu6NQhhkx1nDAxJZhXp3yNd/Q== X-OriginatorOrg: sitime.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LVWPR20MB994915.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4774dc1-fa67-4bdb-9410-08df500633f4 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Dec 2026 23:52:09.2802 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8fb55916-cf10-4b0d-96f4-cf3952657263 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: oHVWHa23ITufE097iHe34W/qCgO3c5ZQl6qMzYp0vsCtuzGAJLI94UfiGRhoRvE7xsk2+GsF+OQwmYNSLDP0ww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR20MB4526 X-MDID: 1796169174-FZdpHA2DI37O X-PPE-STACK: {"stack":"us1"} X-MDID-O: us1;ut7;1796169174;FZdpHA2DI37O;;ba04557de9d2da8490f5f1e6de07b967 X-PPE-TRUSTED: V=1;DIR=OUT; From: Oleg Zadorozhnyi =0A= =0A= The part has an internal line by which one PLL drives the others as a=0A= reference. Model it as two pins: a source pin on every DPLL, whose state=0A= says whether that PLL drives the line, and an input pin on each=0A= destination, with no signal while undriven. Both are INT_OSCILLATOR, the=0A= uAPI type for a clock made inside the device other than an NCO.=0A= =0A= Taking the line writes the reference sequence's source pattern to the=0A= source's EXT page under its debug key, then sets the global enable; the=0A= enable is set last because over a page holding part of the pattern it=0A= may drive the line from that page. Giving the line up clears the enable=0A= and writes the disable pattern. The getters answer from the owner read=0A= back from the four EXT pages. A page left with part of the pattern=0A= refuses a connect on another PLL until its source pin is disconnected.=0A= =0A= Resume reads the line owner and output delays again, notifies pins whose=0A= mute, delay or source changed, drops a pending write to registers a=0A= reloaded configuration sets, and keeps the undo of a state the driver=0A= set and a pending delay still in its registers.=0A= =0A= Signed-off-by: Oleg Zadorozhnyi =0A= Co-developed-by: Ali Rouhi =0A= Signed-off-by: Ali Rouhi =0A= ---=0A= drivers/dpll/sit9531x/core.c | 817 ++++++++++++++++++++++++++++++++++-=0A= drivers/dpll/sit9531x/core.h | 39 ++=0A= drivers/dpll/sit9531x/dpll.c | 451 +++++++++++++++++--=0A= drivers/dpll/sit9531x/regs.h | 8 +=0A= 4 files changed, 1278 insertions(+), 37 deletions(-)=0A= =0A= diff --git a/drivers/dpll/sit9531x/core.c b/drivers/dpll/sit9531x/core.c=0A= index 1f4ed3365ffe..9761f11a3ec3 100644=0A= --- a/drivers/dpll/sit9531x/core.c=0A= +++ b/drivers/dpll/sit9531x/core.c=0A= @@ -932,6 +932,8 @@ static bool sit9531x_prio_src_live(const struct sit9531= x_dev *sitdev, u8 src)=0A= {=0A= u8 index =3D sit9531x_hw_src_input(src);=0A= =0A= + if (index =3D=3D SIT9531X_INTSYNC_PIN_ID)=0A= + return sit9531x_intsync_driven(sitdev);=0A= if (index >=3D sitdev->info->num_inputs)=0A= return true;=0A= =0A= @@ -1200,6 +1202,18 @@ static u8 sit9531x_prio_activesel_pick(struct sit953= 1x_dev *sitdev,=0A= return srcs[0];=0A= }=0A= =0A= +static bool sit9531x_prio_table_lists_intsync(const u8 *srcs)=0A= +{=0A= + u8 slot;=0A= +=0A= + for (slot =3D 0; slot < SIT9531X_PRIO_MAX_SLOTS; slot++)=0A= + if ((srcs[slot] & SIT9531X_PRIO_NIBBLE_MASK) =3D=3D=0A= + SIT9531X_PRIO_SRC_INTSYNC)=0A= + return true;=0A= +=0A= + return false;=0A= +}=0A= +=0A= static int sit9531x_prio_table_commit(struct sit9531x_dev *sitdev, u8 pll_= idx,=0A= const u8 *srcs, bool reselect)=0A= {=0A= @@ -1216,6 +1230,11 @@ static int sit9531x_prio_table_commit(struct sit9531= x_dev *sitdev, u8 pll_idx,=0A= if (sit9531x_prio_src_usable(srcs[slot]))=0A= empty =3D false;=0A= =0A= + if (sitdev->intsync_stale &&=0A= + (sit9531x_prio_table_lists_intsync(srcs) ||=0A= + sit9531x_prio_table_lists_intsync(chan->prio_srcs)))=0A= + sit9531x_intsync_refresh(sitdev);=0A= +=0A= memcpy(back, chan->table_pending ? chan->table_back : chan->prio_srcs,=0A= sizeof(back));=0A= =0A= @@ -2760,6 +2779,596 @@ static int sit9531x_clear_notifications(struct sit9= 531x_dev *sitdev,=0A= return 0;=0A= }=0A= =0A= +/*=0A= + * Close the debug window on a PLL's EXT page; the key opens every debug= =0A= + * register on the page while it holds the unlock value.=0A= + */=0A= +static int sit9531x_intsync_debug_lock(struct sit9531x_dev *sitdev, u8 pll= )=0A= +{=0A= + int rc;=0A= +=0A= + rc =3D sit9531x_write_close(sitdev,=0A= + SIT9531X_REG(SIT9531X_PLL_EXT_PAGE(pll),=0A= + SIT9531X_PLL_REG_DEBUG),=0A= + SIT9531X_PLL_DEBUG_LOCK);=0A= + if (rc)=0A= + sitdev->intsync_key_pending |=3D BIT(pll);=0A= + else=0A= + sitdev->intsync_key_pending &=3D ~BIT(pll);=0A= +=0A= + return rc;=0A= +}=0A= +=0A= +/*=0A= + * The bytes Intsync_enable_disable.py writes, each register whole, to the= EXT=0A= + * page of the PLL that drives the line: en_val to drive it, dis_val to st= op.=0A= + */=0A= +struct sit9531x_intsync_reg {=0A= + u8 offset;=0A= + u8 en_val;=0A= + u8 dis_val;=0A= +};=0A= +=0A= +static const struct sit9531x_intsync_reg intsync_config[] =3D {=0A= + { 0x2D, 0x02, 0x00 },=0A= + { 0x50, 0x08, 0x00 },=0A= + { 0x51, 0x04, 0x00 },=0A= + { 0x54, 0x02, 0x00 },=0A= + { 0x55, 0x28, 0x20 },=0A= + { 0x5C, 0x0F, 0x00 },=0A= + { 0x5D, 0xFF, 0x00 },=0A= + { 0x6C, 0xDD, 0x00 },=0A= +};=0A= +=0A= +/*=0A= + * Find the PLL whose EXT page holds the INTSYNC enable pattern, whole or = in=0A= + * part. Caller must hold sitdev->multiop_lock.=0A= + */=0A= +int sit9531x_intsync_src_detect(struct sit9531x_dev *sitdev)=0A= +{=0A= + s8 src =3D -1, partial =3D -1;=0A= + int rc, ret, n_en, n_dis;=0A= + u8 pll, ext_page;=0A= + u8 n_pages =3D 0;=0A= + unsigned int i;=0A= + bool enabled;=0A= + u8 global;=0A= +=0A= + lockdep_assert_held(&sitdev->multiop_lock);=0A= +=0A= + rc =3D sit9531x_read_u8(sitdev, SIT9531X_REG_INTSYNC_GLOBAL, &global);=0A= + if (rc)=0A= + return rc;=0A= + enabled =3D global & BIT(SIT9531X_INTSYNC_EN_BIT);=0A= +=0A= + /*=0A= + * Read the EXT pages even with the global enable clear; a page can hold= =0A= + * the enable pattern under a clear bit.=0A= + */=0A= + for (pll =3D 0; pll < SIT9531X_NUM_PLLS; pll++) {=0A= + ext_page =3D SIT9531X_PLL_EXT_PAGE(pll);=0A= +=0A= + /*=0A= + * Open the EXT page's debug window to read the INTSYNC=0A= + * registers.=0A= + */=0A= + rc =3D sit9531x_write_u8(sitdev,=0A= + SIT9531X_REG(ext_page,=0A= + SIT9531X_PLL_REG_DEBUG),=0A= + SIT9531X_PLL_DEBUG_UNLOCK);=0A= + if (rc) {=0A= + sit9531x_intsync_debug_lock(sitdev, pll);=0A= + return rc;=0A= + }=0A= +=0A= + n_en =3D 0;=0A= + n_dis =3D 0;=0A= + for (i =3D 0; i < ARRAY_SIZE(intsync_config); i++) {=0A= + u16 reg;=0A= + u8 val;=0A= +=0A= + reg =3D SIT9531X_REG(ext_page, intsync_config[i].offset);=0A= +=0A= + rc =3D sit9531x_read_u8(sitdev, reg, &val);=0A= + if (rc)=0A= + break;=0A= + if (val =3D=3D intsync_config[i].en_val)=0A= + n_en++;=0A= + else if (val =3D=3D intsync_config[i].dis_val)=0A= + n_dis++;=0A= + }=0A= +=0A= + ret =3D sit9531x_intsync_debug_lock(sitdev, pll);=0A= + if (!rc)=0A= + rc =3D ret;=0A= + if (rc)=0A= + return rc;=0A= +=0A= + /*=0A= + * A page with the disable pattern or with other values is not a=0A= + * source.=0A= + */=0A= + if (!n_en || n_en + n_dis !=3D ARRAY_SIZE(intsync_config))=0A= + continue;=0A= + n_pages++;=0A= +=0A= + if (n_dis || !enabled) {=0A= + /*=0A= + * The whole pattern under a clear global enable does=0A= + * not drive the line; a page holding both patterns=0A= + * under the enable may drive it in an undefined state.=0A= + * Neither is reported as the source.=0A= + */=0A= + if (partial < 0)=0A= + partial =3D pll;=0A= + continue;=0A= + }=0A= +=0A= + if (src < 0)=0A= + src =3D pll;=0A= + }=0A= +=0A= + /*=0A= + * Record a PLL with a partial or unenabled pattern so that no other=0A= + * PLL is enabled alongside it.=0A= + */=0A= + sitdev->intsync_partial =3D src < 0 && partial >=3D 0;=0A= + if (sitdev->intsync_partial) {=0A= + dev_warn(sitdev->dev,=0A= + "PLL%c holds an INTSYNC source configuration that is not a defined sou= rce\n",=0A= + 'A' + partial);=0A= + src =3D partial;=0A= + }=0A= +=0A= + /*=0A= + * With more than one page holding the pattern, refuse every connect; an= =0A= + * enable on one would also set the global enable over the other.=0A= + */=0A= + sitdev->intsync_conflict =3D n_pages > 1;=0A= + if (sitdev->intsync_conflict)=0A= + dev_warn(sitdev->dev,=0A= + "%u PLLs hold the INTSYNC source pattern; recording PLL%c\n",=0A= + n_pages, 'A' + src);=0A= +=0A= + sitdev->intsync_src =3D src;=0A= + sitdev->intsync_foreign =3D enabled && src < 0;=0A= +=0A= + return 0;=0A= +}=0A= +=0A= +/**=0A= + * sit9531x_intsync_readback - re-read the sync source record from the par= t=0A= + * @sitdev: device pointer=0A= + *=0A= + * A page reads the same latched or not, so a recorded partial source is k= ept=0A= + * when the scan finds no source or the same PLL, and dropped when it find= s=0A= + * another PLL or the global enable set with no page holding the pattern.= =0A= + * Caller must hold sitdev->multiop_lock.=0A= + *=0A= + * Return: 0 on success, <0 on a read error=0A= + */=0A= +int sit9531x_intsync_readback(struct sit9531x_dev *sitdev)=0A= +{=0A= + bool partial =3D sitdev->intsync_partial;=0A= + s8 src =3D sitdev->intsync_src;=0A= + int rc;=0A= +=0A= + rc =3D sit9531x_intsync_src_detect(sitdev);=0A= + if (rc)=0A= + return rc;=0A= +=0A= + if (partial && !sitdev->intsync_foreign &&=0A= + (sitdev->intsync_src < 0 ||=0A= + (sitdev->intsync_src =3D=3D src && !sitdev->intsync_partial))) {=0A= + sitdev->intsync_src =3D src;=0A= + sitdev->intsync_partial =3D true;=0A= + sitdev->intsync_foreign =3D false;=0A= + }=0A= +=0A= + return 0;=0A= +}=0A= +=0A= +/**=0A= + * sit9531x_intsync_refresh - re-read a stale sync source record=0A= + * @sitdev: device pointer=0A= + *=0A= + * Caller must hold sitdev->multiop_lock.=0A= + *=0A= + * Return: 0 when the record is current, <0 when the scan fails=0A= + */=0A= +int sit9531x_intsync_refresh(struct sit9531x_dev *sitdev)=0A= +{=0A= + s8 owner;=0A= + int rc;=0A= +=0A= + if (!sitdev->intsync_stale)=0A= + return 0;=0A= +=0A= + owner =3D sit9531x_intsync_owner(sitdev);=0A= + rc =3D sit9531x_intsync_readback(sitdev);=0A= + if (rc)=0A= + return rc;=0A= + sitdev->intsync_stale =3D false;=0A= + if (owner !=3D sit9531x_intsync_owner(sitdev))=0A= + sitdev->intsync_ntf_pending =3D true;=0A= +=0A= + return 0;=0A= +}=0A= +=0A= +/*=0A= + * Check if the inter-PLL sync line carries a signal, from the recorded so= urce=0A= + * or a PLL locked to the line. Caller must hold sitdev->multiop_lock.=0A= + */=0A= +bool sit9531x_intsync_driven(const struct sit9531x_dev *sitdev)=0A= +{=0A= + const struct sit9531x_chan *chan;=0A= + u8 pll;=0A= +=0A= + lockdep_assert_held(&sitdev->multiop_lock);=0A= +=0A= + if (sitdev->intsync_src >=3D 0 && !sitdev->intsync_partial &&=0A= + !sitdev->intsync_stale)=0A= + return true;=0A= +=0A= + for (pll =3D 0; pll < SIT9531X_NUM_PLLS; pll++) {=0A= + chan =3D sit9531x_chan_state_get(sitdev, pll);=0A= + if (chan->routed_ref =3D=3D SIT9531X_INTSYNC_PIN_ID &&=0A= + chan->locked && !chan->ho_freeze &&=0A= + !chan->stale && !chan->intsync_dropped)=0A= + return true;=0A= + }=0A= +=0A= + return false;=0A= +}=0A= +=0A= +static int __sit9531x_intsync_disable(struct sit9531x_dev *sitdev,=0A= + u8 src_pll_idx, bool restore,=0A= + bool *owner_kept, bool *touched);=0A= +=0A= +/*=0A= + * Latch the INTSYNC source pattern into the PLL's EXT page, then set the = global=0A= + * enable. The enable comes last: set over a page holding part of the patt= ern,=0A= + * it may drive the line from that page. Caller must hold sitdev->multiop_= lock.=0A= + */=0A= +int sit9531x_intsync_enable(struct sit9531x_dev *sitdev, u8 src_pll_idx,= =0A= + bool *rollback_failed, bool *touched)=0A= +{=0A= + u8 ext_page, val;=0A= + int rc, lock_rc;=0A= + unsigned int i;=0A= +=0A= + lockdep_assert_held(&sitdev->multiop_lock);=0A= +=0A= + if (rollback_failed)=0A= + *rollback_failed =3D false;=0A= + if (touched)=0A= + *touched =3D false;=0A= + if (src_pll_idx >=3D SIT9531X_NUM_PLLS)=0A= + return -EINVAL;=0A= +=0A= + ext_page =3D SIT9531X_PLL_EXT_PAGE(src_pll_idx);=0A= +=0A= + rc =3D sit9531x_read_u8(sitdev, SIT9531X_REG_INTSYNC_GLOBAL, &val);=0A= + if (rc)=0A= + return rc;=0A= +=0A= + if (touched)=0A= + *touched =3D true;=0A= + rc =3D sit9531x_write_u8(sitdev,=0A= + SIT9531X_REG(ext_page,=0A= + SIT9531X_PLL_REG_DEBUG),=0A= + SIT9531X_PLL_DEBUG_UNLOCK);=0A= + if (rc)=0A= + goto relock_err;=0A= +=0A= + for (i =3D 0; i < ARRAY_SIZE(intsync_config); i++) {=0A= + rc =3D sit9531x_write_u8(sitdev,=0A= + SIT9531X_REG(ext_page,=0A= + intsync_config[i].offset),=0A= + intsync_config[i].en_val);=0A= + if (rc)=0A= + goto relock_err;=0A= + }=0A= +=0A= + rc =3D sit9531x_pll_small_update(sitdev, src_pll_idx);=0A= + if (rc)=0A= + goto relock_err;=0A= +=0A= + lock_rc =3D sit9531x_intsync_debug_lock(sitdev, src_pll_idx);=0A= + if (lock_rc)=0A= + dev_warn(sitdev->dev,=0A= + "PLL%c: INTSYNC pattern written but the debug window was left open: %d= \n",=0A= + 'A' + src_pll_idx, lock_rc);=0A= +=0A= + rc =3D sit9531x_write_u8(sitdev, SIT9531X_REG_INTSYNC_GLOBAL,=0A= + val | BIT(SIT9531X_INTSYNC_EN_BIT));=0A= + if (rc)=0A= + goto err_disable;=0A= +=0A= + /* The page-0 small update applies the global enable */=0A= + rc =3D sit9531x_write_u8(sitdev, SIT9531X_REG_GLOBAL_UPDATE,=0A= + SIT9531X_SMALL_UPDATE_CMD);=0A= + usleep_range(1000, 2000);=0A= + if (rc)=0A= + goto err_disable;=0A= +=0A= + return 0;=0A= +=0A= +relock_err:=0A= + sit9531x_intsync_debug_lock(sitdev, src_pll_idx);=0A= +=0A= +err_disable:=0A= + {=0A= + int rollback_rc;=0A= +=0A= + rollback_rc =3D __sit9531x_intsync_disable(sitdev, src_pll_idx,=0A= + false, NULL, NULL);=0A= + if (rollback_rc) {=0A= + dev_warn(sitdev->dev,=0A= + "INTSYNC rollback failed after enable error: %d (original %d)\n",=0A= + rollback_rc, rc);=0A= + if (rollback_failed)=0A= + *rollback_failed =3D true;=0A= + }=0A= + }=0A= +=0A= + return rc;=0A= +}=0A= +=0A= +/*=0A= + * Read whether every INTSYNC register of an EXT page holds its disable va= lue=0A= + * (@off) or its enable value (@on). The page's debug window must be open.= =0A= + */=0A= +static int sit9531x_intsync_page_state(struct sit9531x_dev *sitdev,=0A= + u8 ext_page, bool *off, bool *on)=0A= +{=0A= + unsigned int i;=0A= + u8 val;=0A= + int rc;=0A= +=0A= + *off =3D true;=0A= + *on =3D true;=0A= + for (i =3D 0; i < ARRAY_SIZE(intsync_config); i++) {=0A= + rc =3D sit9531x_read_u8(sitdev,=0A= + SIT9531X_REG(ext_page,=0A= + intsync_config[i].offset),=0A= + &val);=0A= + if (rc)=0A= + return rc;=0A= + if (val !=3D intsync_config[i].dis_val)=0A= + *off =3D false;=0A= + if (val !=3D intsync_config[i].en_val)=0A= + *on =3D false;=0A= + }=0A= +=0A= + return 0;=0A= +}=0A= +=0A= +static int __sit9531x_intsync_disable(struct sit9531x_dev *sitdev,=0A= + u8 src_pll_idx, bool restore,=0A= + bool *owner_kept, bool *touched)=0A= +{=0A= + bool in_window =3D false, was_enabled;=0A= + u8 ext_page, val;=0A= + int rc, lock_rc;=0A= + unsigned int i;=0A= +=0A= + lockdep_assert_held(&sitdev->multiop_lock);=0A= +=0A= + if (owner_kept)=0A= + *owner_kept =3D false;=0A= + if (touched)=0A= + *touched =3D false;=0A= + if (src_pll_idx >=3D SIT9531X_NUM_PLLS)=0A= + return -EINVAL;=0A= +=0A= + ext_page =3D SIT9531X_PLL_EXT_PAGE(src_pll_idx);=0A= +=0A= + rc =3D sit9531x_read_u8(sitdev, SIT9531X_REG_INTSYNC_GLOBAL, &val);=0A= + if (rc)=0A= + return rc;=0A= + was_enabled =3D val & BIT(SIT9531X_INTSYNC_EN_BIT);=0A= + if (touched)=0A= + *touched =3D true;=0A= + rc =3D sit9531x_write_u8(sitdev, SIT9531X_REG_INTSYNC_GLOBAL,=0A= + val & ~BIT(SIT9531X_INTSYNC_EN_BIT));=0A= + if (rc) {=0A= + int ret =3D 0;=0A= +=0A= + /*=0A= + * The write may have reached the register, where the next=0A= + * page-0 small update would apply it; put back the value read.=0A= + */=0A= + if (restore)=0A= + ret =3D sit9531x_write_close(sitdev,=0A= + SIT9531X_REG_INTSYNC_GLOBAL,=0A= + val);=0A= + if (ret)=0A= + dev_warn(sitdev->dev,=0A= + "PLL%c: INTSYNC enable register not written back: %d\n",=0A= + 'A' + src_pll_idx, ret);=0A= + return rc;=0A= + }=0A= + /* A sample taken before this write can still show a lock. */=0A= + for (i =3D 0; i < SIT9531X_NUM_PLLS; i++)=0A= + if (sitdev->chan[i].routed_ref =3D=3D SIT9531X_INTSYNC_PIN_ID)=0A= + sitdev->chan[i].intsync_dropped =3D true;=0A= +=0A= + rc =3D sit9531x_write_u8(sitdev, SIT9531X_REG_GLOBAL_UPDATE,=0A= + SIT9531X_SMALL_UPDATE_CMD);=0A= + usleep_range(1000, 2000);=0A= + if (rc)=0A= + goto restore_global;=0A= +=0A= + rc =3D sit9531x_write_u8(sitdev,=0A= + SIT9531X_REG(ext_page,=0A= + SIT9531X_PLL_REG_DEBUG),=0A= + SIT9531X_PLL_DEBUG_UNLOCK);=0A= + if (rc)=0A= + goto restore_global;=0A= + in_window =3D true;=0A= +=0A= + for (i =3D 0; i < ARRAY_SIZE(intsync_config); i++) {=0A= + rc =3D sit9531x_write_u8(sitdev,=0A= + SIT9531X_REG(ext_page,=0A= + intsync_config[i].offset),=0A= + intsync_config[i].dis_val);=0A= + if (rc)=0A= + goto restore_global;=0A= + }=0A= +=0A= + rc =3D sit9531x_pll_small_update(sitdev, src_pll_idx);=0A= + if (rc && owner_kept)=0A= + *owner_kept =3D true;=0A= +=0A= + goto relock;=0A= +=0A= +restore_global:=0A= + /*=0A= + * Finish the disable if the page holds the disable pattern; restore=0A= + * the global enable only if it still holds the enable pattern. Set=0A= + * over part of the pattern, the enable may drive the line, so it stays= =0A= + * clear.=0A= + */=0A= + if (restore) {=0A= + bool off, on;=0A= +=0A= + if (!in_window &&=0A= + sit9531x_write_u8(sitdev,=0A= + SIT9531X_REG(ext_page,=0A= + SIT9531X_PLL_REG_DEBUG),=0A= + SIT9531X_PLL_DEBUG_UNLOCK)) {=0A= + if (owner_kept)=0A= + *owner_kept =3D true;=0A= + goto relock;=0A= + }=0A= + if (sit9531x_intsync_page_state(sitdev, ext_page, &off, &on) ||=0A= + (!off && !on)) {=0A= + if (owner_kept)=0A= + *owner_kept =3D true;=0A= + goto relock;=0A= + }=0A= + if (off) {=0A= + rc =3D sit9531x_pll_small_update(sitdev, src_pll_idx);=0A= + if (rc && owner_kept)=0A= + *owner_kept =3D true;=0A= + goto relock;=0A= + }=0A= + }=0A= +=0A= + if (restore && was_enabled) {=0A= + int ret;=0A= +=0A= + ret =3D sit9531x_read_u8(sitdev, SIT9531X_REG_INTSYNC_GLOBAL,=0A= + &val);=0A= + if (!ret)=0A= + ret =3D sit9531x_write_u8(sitdev,=0A= + SIT9531X_REG_INTSYNC_GLOBAL,=0A= + val |=0A= + BIT(SIT9531X_INTSYNC_EN_BIT));=0A= + if (!ret) {=0A= + /* The page-0 small update applies the global enable */=0A= + ret =3D sit9531x_write_close(sitdev,=0A= + SIT9531X_REG_GLOBAL_UPDATE,=0A= + SIT9531X_SMALL_UPDATE_CMD);=0A= + usleep_range(1000, 2000);=0A= + }=0A= + if (ret) {=0A= + dev_warn(sitdev->dev,=0A= + "PLL%c: INTSYNC enable not put back after a failed disable: %d\n",=0A= + 'A' + src_pll_idx, ret);=0A= + if (owner_kept)=0A= + *owner_kept =3D true;=0A= + }=0A= + }=0A= +=0A= +relock:=0A= + lock_rc =3D sit9531x_intsync_debug_lock(sitdev, src_pll_idx);=0A= + if (lock_rc) {=0A= + if (rc)=0A= + dev_warn(sitdev->dev,=0A= + "PLL%c: debug window left open: %d\n",=0A= + 'A' + src_pll_idx, lock_rc);=0A= + else=0A= + dev_warn(sitdev->dev,=0A= + "PLL%c: INTSYNC disabled but the debug window was left open: %d\n",= =0A= + 'A' + src_pll_idx, lock_rc);=0A= + }=0A= +=0A= + return rc;=0A= +}=0A= +=0A= +/*=0A= + * Clear the global enable and latch the INTSYNC disable pattern into the = PLL's=0A= + * EXT page. Caller must hold sitdev->multiop_lock.=0A= + */=0A= +int sit9531x_intsync_disable(struct sit9531x_dev *sitdev, u8 src_pll_idx,= =0A= + bool *owner_kept, bool *touched)=0A= +{=0A= + return __sit9531x_intsync_disable(sitdev, src_pll_idx, true,=0A= + owner_kept, touched);=0A= +}=0A= +=0A= +/*=0A= + * Notify the output pins in @outs and, when @src, the INTSYNC source pin.= Call=0A= + * without multiop_lock: the notification takes the subsystem locks, which= are=0A= + * taken before multiop_lock.=0A= + */=0A= +static void sit9531x_drive_pins_ntf(struct sit9531x_dev *sitdev, u16 outs,= =0A= + bool src)=0A= +{=0A= + struct sit9531x_dpll *sitdpll;=0A= + struct sit9531x_dpll_pin *pin;=0A= + struct dpll_pin *dpll_pin;=0A= + int rc;=0A= +=0A= + if (!outs && !src)=0A= + return;=0A= +=0A= + list_for_each_entry(sitdpll, &sitdev->dplls, list) {=0A= + list_for_each_entry(pin, &sitdpll->pins, list) {=0A= + if (pin->dir !=3D DPLL_PIN_DIRECTION_OUTPUT)=0A= + continue;=0A= + if (pin->id =3D=3D SIT9531X_INTSYNC_OUT_PIN_ID ?=0A= + !src : !(outs & BIT(pin->id)))=0A= + continue;=0A= + dpll_pin =3D READ_ONCE(pin->dpll_pin);=0A= + if (!dpll_pin)=0A= + continue;=0A= + rc =3D dpll_pin_change_ntf(dpll_pin);=0A= + /*=0A= + * The source pin is one pin registered on every DPLL.=0A= + */=0A= + if (pin->id =3D=3D SIT9531X_INTSYNC_OUT_PIN_ID)=0A= + src =3D false;=0A= + if (!rc)=0A= + continue;=0A= + mutex_lock(&sitdev->multiop_lock);=0A= + if (pin->id =3D=3D SIT9531X_INTSYNC_OUT_PIN_ID)=0A= + sitdev->intsync_ntf_pending =3D true;=0A= + else=0A= + sitdev->out[pin->id].ntf_pending =3D true;=0A= + mutex_unlock(&sitdev->multiop_lock);=0A= + }=0A= + }=0A= +}=0A= +=0A= +/*=0A= + * Re-read a stale sync source record; return true when a source pin=0A= + * notification is pending. Caller must hold sitdev->multiop_lock.=0A= + */=0A= +static bool sit9531x_intsync_stale_retry(struct sit9531x_dev *sitdev)=0A= +{=0A= + if (sit9531x_intsync_refresh(sitdev))=0A= + return false;=0A= +=0A= + if (!sitdev->intsync_ntf_pending)=0A= + return false;=0A= + sitdev->intsync_ntf_pending =3D false;=0A= +=0A= + return true;=0A= +}=0A= +=0A= /**=0A= * sit9531x_phase_offset_read - read phase difference via TDC=0A= * @sitdev: device pointer=0A= @@ -3235,6 +3844,7 @@ static int sit9531x_chan_state_fetch(struct sit9531x_= dev *sitdev, u8 pll_idx)=0A= =0A= chan->ho_valid =3D !!(pll_status_1 & SIT9531X_PLL_STATUS_1_HO_VALID);=0A= chan->stale =3D false;=0A= + chan->intsync_dropped =3D false;=0A= =0A= return 0;=0A= }=0A= @@ -3446,6 +4056,15 @@ static int sit9531x_dev_state_fetch(struct sit9531x_= dev *sitdev)=0A= return rc;=0A= }=0A= =0A= + mutex_lock(&sitdev->multiop_lock);=0A= + rc =3D sit9531x_intsync_src_detect(sitdev);=0A= + mutex_unlock(&sitdev->multiop_lock);=0A= + if (rc) {=0A= + dev_err(sitdev->dev,=0A= + "Failed to detect INTSYNC source: %d\n", rc);=0A= + return rc;=0A= + }=0A= +=0A= for (i =3D 0; i < sitdev->info->num_outputs; i++) {=0A= bool beyond;=0A= s64 phase_ps;=0A= @@ -3803,6 +4422,9 @@ sit9531x_dev_chan_states_update(struct sit9531x_dev *= sitdev)=0A= } else if (sitdev->outsys_key_pending) {=0A= sit9531x_outsys_debug_close(sitdev);=0A= }=0A= + for (i =3D 0; i < SIT9531X_NUM_PLLS; i++)=0A= + if (sitdev->intsync_key_pending & BIT(i))=0A= + sit9531x_intsync_debug_lock(sitdev, i);=0A= sit9531x_phase_flush_undo_retry(sitdev);=0A= for (i =3D 0; i < sitdev->info->num_outputs; i++)=0A= sit9531x_retime_retry(sitdev, i);=0A= @@ -3840,7 +4462,7 @@ static void sit9531x_dev_periodic_work(struct kthread= _work *work)=0A= struct sit9531x_dev *sitdev =3D container_of(work, struct sit9531x_dev,= =0A= work.work);=0A= struct sit9531x_dpll *sitdpll;=0A= - bool latched;=0A= + bool src_moved, latched;=0A= bool answered;=0A= int rc;=0A= =0A= @@ -3850,16 +4472,16 @@ static void sit9531x_dev_periodic_work(struct kthre= ad_work *work)=0A= */=0A= mutex_lock(&sitdev->multiop_lock);=0A= answered =3D sit9531x_dev_ref_states_update(sitdev);=0A= + src_moved =3D sit9531x_intsync_stale_retry(sitdev);=0A= answered |=3D sit9531x_dev_chan_states_update(sitdev);=0A= mutex_unlock(&sitdev->multiop_lock);=0A= =0A= list_for_each_entry(sitdpll, &sitdev->dplls, list)=0A= sit9531x_dpll_changes_check(sitdpll);=0A= + /* The source pin is not a selection pin; the walk above skips it. */=0A= + sit9531x_drive_pins_ntf(sitdev, 0, src_moved);=0A= =0A= - /*=0A= - * Clear the W1C notification latches on pages 0 and 6 after acting on=0A= - * them; while set they keep INTRB asserted.=0A= - */=0A= + /* The latches are W1C; left set, they keep INTRB asserted. */=0A= mutex_lock(&sitdev->multiop_lock);=0A= rc =3D sit9531x_clear_notifications(sitdev, &latched);=0A= mutex_unlock(&sitdev->multiop_lock);=0A= @@ -4152,6 +4774,12 @@ static void sit9531x_dev_pending_retry(struct sit953= 1x_dev *sitdev)=0A= /* Last: a re-time opens the debug key again */=0A= if (sitdev->outsys_key_pending)=0A= sit9531x_outsys_debug_close(sitdev);=0A= + for (i =3D 0; i < SIT9531X_NUM_PLLS; i++)=0A= + if ((sitdev->intsync_key_pending & BIT(i)) &&=0A= + sit9531x_intsync_debug_lock(sitdev, i))=0A= + dev_warn(sitdev->dev,=0A= + "PLL%c: EXT page debug key left open at removal\n",=0A= + 'A' + i);=0A= for (i =3D 0; i < SIT9531X_NUM_PLLS; i++) {=0A= if (!sitdev->loops_open && !sitdev->bank_pending)=0A= sit9531x_flush_retry(sitdev, i);=0A= @@ -4352,13 +4980,13 @@ static bool sit9531x_dpll_pin_is_registrable(struct= sit9531x_dpll *sitdpll,=0A= if (index =3D=3D SIT9531X_MAX_INPUTS)=0A= return true;=0A= if (index =3D=3D SIT9531X_INTSYNC_PIN_ID)=0A= - return false;=0A= + return true;=0A= =0A= return sit9531x_input_pin_is_registrable(sitdev, index);=0A= }=0A= =0A= if (index =3D=3D SIT9531X_INTSYNC_OUT_PIN_ID)=0A= - return false;=0A= + return true;=0A= =0A= if (index >=3D sitdev->info->num_outputs)=0A= return false;=0A= @@ -4824,6 +5452,8 @@ static int sit9531x_dev_probe(struct sit9531x_dev *si= tdev)=0A= if (rc)=0A= return rc;=0A= =0A= + sitdev->intsync_src =3D -1;=0A= +=0A= rc =3D devm_mutex_init(sitdev->dev, &sitdev->multiop_lock);=0A= if (rc)=0A= return dev_err_probe(sitdev->dev, rc,=0A= @@ -4891,6 +5521,41 @@ static const struct of_device_id sit9531x_of_match[]= =3D {=0A= };=0A= MODULE_DEVICE_TABLE(of, sit9531x_of_match);=0A= =0A= +/*=0A= + * Compare the delay bytes of an output with its pending re-time, decoded = as the=0A= + * delay setter does: 1 if they hold the request, 0 if not or if the reque= st has=0A= + * no encoding for the divider, <0 if a read failed. Caller must hold=0A= + * sitdev->multiop_lock.=0A= + */=0A= +static int sit9531x_retime_kept(struct sit9531x_dev *sitdev, u8 out_idx)= =0A= +{=0A= + struct sit9531x_out *out =3D &sitdev->out[out_idx];=0A= + u8 bytes[SIT9531X_OUT_PRG_BYTES], fine, old_fine;=0A= + u64 fvco, divo, coarse, old_coarse;=0A= + s32 phase_adj;=0A= + int rc;=0A= +=0A= + if (!out->routed)=0A= + return 0;=0A= +=0A= + rc =3D sit9531x_get_fvco(sitdev, out->pll_idx, &fvco);=0A= + if (!rc)=0A= + rc =3D sit9531x_output_divo_read(sitdev, out_idx, &divo);=0A= + if (rc)=0A= + return rc =3D=3D -ENODATA ? 0 : rc;=0A= +=0A= + if (sit9531x_output_phase_encode(fvco, divo, out->retime_ps, &coarse,=0A= + &fine, &phase_adj))=0A= + return 0;=0A= +=0A= + rc =3D sit9531x_output_phase_bytes_read(sitdev, out_idx, bytes);=0A= + if (rc)=0A= + return rc;=0A= + sit9531x_output_phase_bytes_decode(bytes, &old_coarse, &old_fine);=0A= +=0A= + return old_coarse =3D=3D coarse && old_fine =3D=3D fine;=0A= +}=0A= +=0A= /*=0A= * Stop the poll and the IRQ across suspend so no paged I2C sequence reach= es a=0A= * suspended adapter; the poll worker is not freezable.=0A= @@ -4908,9 +5573,12 @@ static int sit9531x_suspend(struct device *dev)=0A= =0A= static int sit9531x_resume(struct device *dev)=0A= {=0A= + u16 outs_was =3D 0, outs_now =3D 0, outs_unread =3D 0, outs_moved =3D 0;= =0A= struct sit9531x_dev *sitdev =3D dev_get_drvdata(dev);=0A= struct sit9531x_dpll *sitdpll;=0A= - u8 modes_moved =3D 0;=0A= + u8 modes_moved =3D 0, kept =3D 0;=0A= + bool src_moved;=0A= + s8 owner;=0A= int rc;=0A= u8 i;=0A= =0A= @@ -4924,6 +5592,81 @@ static int sit9531x_resume(struct device *dev)=0A= mutex_lock(&sitdev->multiop_lock);=0A= /* One re-select for a source lost and restored between samples */=0A= sit9531x_reselect_arm(sitdev);=0A= + /*=0A= + * Drop and report the pending writes to registers a reloaded profile=0A= + * sets. Keep a delay re-time whose bytes still hold the request, and=0A= + * the undo of a state the driver set: loops or a debug key left open,=0A= + * debug taps left selected, a table write-back under forced holdover.=0A= + */=0A= + for (i =3D 0; i < SIT9531X_NUM_PLLS; i++) {=0A= + struct sit9531x_chan *chan =3D &sitdev->chan[i];=0A= + bool retime =3D false, flush, arm;=0A= + u8 j, ho;=0A= +=0A= + /*=0A= + * A table write-back is pending only under forced holdover;=0A= + * once that is cleared, the next poll reads the table from the=0A= + * registers.=0A= + */=0A= + if ((chan->table_pending || chan->ho_release_pending) &&=0A= + !sit9531x_read_pll_u8(sitdev, i, SIT9531X_PLL_REG_HO_CTRL,=0A= + &ho) &&=0A= + !(ho & BIT(SIT9531X_PLL_HO_FORCE_BIT))) {=0A= + dev_warn(sitdev->dev,=0A= + "PLL%c: forced holdover cleared over suspend, priority table restore = dropped\n",=0A= + 'A' + i);=0A= + chan->table_pending =3D false;=0A= + chan->ho_release_pending =3D false;=0A= + }=0A= +=0A= + for (j =3D 0; j < sitdev->info->num_outputs; j++) {=0A= + if (!sitdev->out[j].retime_pending ||=0A= + sitdev->out[j].pll_idx !=3D i)=0A= + continue;=0A= + if (sit9531x_retime_kept(sitdev, j)) {=0A= + kept |=3D BIT(i);=0A= + continue;=0A= + }=0A= + sitdev->out[j].retime_pending =3D false;=0A= + retime =3D true;=0A= + }=0A= + /*=0A= + * A re-time left pending ends in a flush, which first restores=0A= + * the trigger select and the flush enable: keep them pending.=0A= + */=0A= + flush =3D !(kept & BIT(i)) && chan->flush_pending;=0A= + arm =3D !(kept & BIT(i)) && (sitdev->flush_arm_pending & BIT(i));=0A= + if (!retime && !flush && !arm)=0A= + continue;=0A= + dev_warn(sitdev->dev,=0A= + "PLL%c: pending before suspend, dropped:%s%s%s\n",=0A= + 'A' + i, retime ? " output delay" : "",=0A= + flush ? " output realignment" : "",=0A= + arm ? " on-demand flush enable" : "");=0A= + if (kept & BIT(i))=0A= + continue;=0A= + chan->flush_pending =3D false;=0A= + sitdev->flush_arm_pending &=3D ~BIT(i);=0A= + }=0A= + if (sitdev->flush_ctrl_pending && !kept) {=0A= + dev_warn(sitdev->dev,=0A= + "flush trigger source select pending before suspend, dropped\n");=0A= + sitdev->flush_ctrl_pending =3D false;=0A= + }=0A= + if (sitdev->bank_pending) {=0A= + dev_warn(sitdev->dev,=0A= + "output divider bank update pending before suspend, dropped\n");=0A= + sitdev->bank_pending =3D false;=0A= + }=0A= + for (i =3D 0; i < sitdev->info->num_inputs; i++) {=0A= + if (!sitdev->ref[i].off_pending)=0A= + continue;=0A= + dev_warn(sitdev->dev,=0A= + "input %u: receiver gate-off pending before suspend, dropped\n",=0A= + i);=0A= + sitdev->ref[i].off_pending =3D false;=0A= + }=0A= + owner =3D sit9531x_intsync_owner(sitdev);=0A= =0A= /* Read again the configuration probe read */=0A= for (i =3D 0; i < sitdev->info->num_inputs / 2; i++) {=0A= @@ -4967,13 +5710,17 @@ static int sit9531x_resume(struct device *dev)=0A= for (i =3D 0; i < sitdev->info->num_outputs; i++) {=0A= struct sit9531x_out *out =3D &sitdev->out[i];=0A= u8 hiz_mask =3D out->hiz_mask, hiz_state =3D out->hiz_state;=0A= - bool enabled =3D out->enabled;=0A= bool routed =3D out->routed;=0A= u8 pll_idx =3D out->pll_idx;=0A= =0A= + if (out->enabled)=0A= + outs_was |=3D BIT(i);=0A= + /* The mute state of a request left unconfirmed is unknown */=0A= + if (out->state_stale)=0A= + outs_unread |=3D BIT(i);=0A= rc =3D sit9531x_out_state_fetch(sitdev, i);=0A= /* A muted output keeps the Hi-Z record taken before the mute */=0A= - if (rc || (!enabled && !out->enabled)) {=0A= + if (rc || (!(outs_was & BIT(i)) && !out->enabled)) {=0A= out->hiz_mask =3D hiz_mask;=0A= out->hiz_state =3D hiz_state;=0A= }=0A= @@ -4982,14 +5729,62 @@ static int sit9531x_resume(struct device *dev)=0A= "out%u: state not read on resume: %d\n",=0A= i, rc);=0A= out->state_stale =3D true;=0A= + outs_unread |=3D BIT(i);=0A= }=0A= - if (out->routed !=3D routed || out->pll_idx !=3D pll_idx)=0A= + if (out->routed !=3D routed || out->pll_idx !=3D pll_idx) {=0A= dev_warn(sitdev->dev,=0A= "out%u: routing changed over suspend; its pin stays on the DPLL it wa= s registered on\n",=0A= i);=0A= + outs_moved |=3D BIT(i);=0A= + }=0A= + if (out->enabled)=0A= + outs_now |=3D BIT(i);=0A= }=0A= + for (i =3D 0; i < sitdev->info->num_outputs; i++) {=0A= + struct sit9531x_out *out =3D &sitdev->out[i];=0A= + bool beyond, none;=0A= + s64 phase_ps;=0A= +=0A= + /* Bytes of a pending re-time are not a delay the part runs */=0A= + if (out->retime_pending)=0A= + continue;=0A= +=0A= + rc =3D sit9531x_output_phase_read(sitdev, i, &phase_ps,=0A= + &beyond);=0A= + /* Unrouted or with no valid Fvco, no delay, as at probe */=0A= + none =3D rc =3D=3D -ENODATA;=0A= + if (none) {=0A= + phase_ps =3D 0;=0A= + beyond =3D false;=0A= + rc =3D 0;=0A= + }=0A= + if (rc) {=0A= + dev_warn(sitdev->dev,=0A= + "out%u: delay not read on resume: %d\n",=0A= + i, rc);=0A= + out->phase_stale =3D true;=0A= + outs_unread |=3D BIT(i);=0A= + continue;=0A= + }=0A= + if (out->phase_adj !=3D phase_ps || out->phase_stale ||=0A= + out->phase_none !=3D none)=0A= + outs_moved |=3D BIT(i);=0A= + out->phase_none =3D none;=0A= + out->phase_adj =3D phase_ps;=0A= + out->phase_armed =3D !beyond && phase_ps;=0A= + out->phase_stale =3D false;=0A= + }=0A= + rc =3D sit9531x_intsync_readback(sitdev);=0A= + if (rc)=0A= + dev_warn(sitdev->dev,=0A= + "INTSYNC source not re-detected on resume: %d\n", rc);=0A= + sitdev->intsync_stale =3D rc !=3D 0;=0A= + src_moved =3D rc || owner !=3D sit9531x_intsync_owner(sitdev);=0A= mutex_unlock(&sitdev->multiop_lock);=0A= =0A= + sit9531x_drive_pins_ntf(sitdev,=0A= + (outs_was ^ outs_now) | outs_unread |=0A= + outs_moved, src_moved);=0A= /* The poll notifies a device whose mode changed */=0A= list_for_each_entry(sitdpll, &sitdev->dplls, list)=0A= if (modes_moved & BIT(sitdpll->id))=0A= diff --git a/drivers/dpll/sit9531x/core.h b/drivers/dpll/sit9531x/core.h=0A= index 933789c1aa1c..5bff2f91fa86 100644=0A= --- a/drivers/dpll/sit9531x/core.h=0A= +++ b/drivers/dpll/sit9531x/core.h=0A= @@ -168,6 +168,8 @@ struct sit9531x_out {=0A= * @locked: PLL is active and its outer loop reports lock=0A= * @stale: last state read failed; the fields hold an earlier sample, or= =0A= * part of a new one, and are not reported=0A= + * @intsync_dropped: driver turned INTSYNC off after this sample; a lock t= o=0A= + * INTSYNC in it is not trusted=0A= * @mode: 0 =3D sync (outer loop enabled), 1 =3D free-run=0A= * @routed_ref: input the device routes to the PLL, as a logical index=0A= * (INTSYNC: SIT9531X_INTSYNC_PIN_ID); SIT9531X_REF_INVALID if none=0A= @@ -228,6 +230,7 @@ struct sit9531x_chan {=0A= bool active;=0A= bool locked;=0A= bool stale;=0A= + bool intsync_dropped;=0A= u8 mode;=0A= u8 routed_ref;=0A= bool inner_lol;=0A= @@ -284,12 +287,22 @@ struct sit9531x_chan {=0A= * @clock_id_node: entry in the list of the clock ids of the bound parts= =0A= * @reset_gpio: optional reset line, NULL if absent=0A= * @irq: optional INTRB IRQ, 0 if not wired=0A= + * @intsync_src: PLL sourcing INTSYNC, or -1=0A= + * @intsync_partial: @intsync_src holds part of the source pattern, or the= whole=0A= + * pattern under a clear global enable; not reported as the source. A=0A= + * readback keeps it over a scan that finds the whole pattern enabled on= the=0A= + * same PLL, as the page reads the same whether the pattern was latched = or not=0A= + * @intsync_conflict: more than one PLL page holds the source pattern=0A= + * @intsync_foreign: global enable set with no page holding the pattern=0A= + * @intsync_stale: @intsync_src must be read back before use=0A= + * @intsync_ntf_pending: the poll must send a source pin notification=0A= * @irq_ack_fails: consecutive failed INTRB acknowledgements=0A= * @fvco_band_warned: bit per PLL warned for Fref * DIVN outside its VCO= =0A= * band; written under @multiop_lock=0A= * @loops_open: output loops not yet re-locked=0A= * @bank_pending: output divider bank update still to be issued=0A= * @outsys_key_pending: output-system debug key not closed=0A= + * @intsync_key_pending: bit per PLL whose EXT page debug key is not close= d=0A= * @flush_ctrl_pending: @flush_ctrl still to be written back=0A= * @flush_ctrl: trigger register value to restore=0A= * @flush_arm_pending: bit per PLL whose flush enable is still to be resto= red=0A= @@ -325,9 +338,17 @@ struct sit9531x_dev {=0A= struct gpio_desc *reset_gpio;=0A= int irq;=0A= =0A= + s8 intsync_src;=0A= + bool intsync_partial;=0A= + bool intsync_conflict;=0A= + bool intsync_foreign;=0A= + bool intsync_stale;=0A= + bool intsync_ntf_pending;=0A= +=0A= bool loops_open;=0A= bool bank_pending;=0A= bool outsys_key_pending;=0A= + u8 intsync_key_pending;=0A= bool flush_ctrl_pending;=0A= u8 flush_ctrl;=0A= u8 flush_arm_pending;=0A= @@ -374,6 +395,24 @@ int sit9531x_output_phase_read(struct sit9531x_dev *si= tdev, u8 out_idx,=0A= int sit9531x_output_phase_adjust_set(struct sit9531x_dev *sitdev,=0A= u8 out_idx, s32 phase_ps);=0A= =0A= +/*=0A= + * Return the PLL driving INTSYNC with a complete source configuration, or= -1.=0A= + * Caller must hold sitdev->multiop_lock.=0A= + */=0A= +static inline s8 sit9531x_intsync_owner(const struct sit9531x_dev *sitdev)= =0A= +{=0A= + return sitdev->intsync_partial ? -1 : sitdev->intsync_src;=0A= +}=0A= +=0A= +int sit9531x_intsync_enable(struct sit9531x_dev *sitdev, u8 src_pll_idx,= =0A= + bool *rollback_failed, bool *touched);=0A= +int sit9531x_intsync_disable(struct sit9531x_dev *sitdev, u8 src_pll_idx,= =0A= + bool *owner_kept, bool *touched);=0A= +int sit9531x_intsync_src_detect(struct sit9531x_dev *sitdev);=0A= +int sit9531x_intsync_readback(struct sit9531x_dev *sitdev);=0A= +int sit9531x_intsync_refresh(struct sit9531x_dev *sitdev);=0A= +bool sit9531x_intsync_driven(const struct sit9531x_dev *sitdev);=0A= +=0A= int sit9531x_chan_routed_ref_read(struct sit9531x_dev *sitdev, u8 pll_idx,= =0A= u8 *ref);=0A= int sit9531x_input_mon_fetch(struct sit9531x_dev *sitdev);=0A= diff --git a/drivers/dpll/sit9531x/dpll.c b/drivers/dpll/sit9531x/dpll.c=0A= index 3fe65e2d5aec..096749b39f1e 100644=0A= --- a/drivers/dpll/sit9531x/dpll.c=0A= +++ b/drivers/dpll/sit9531x/dpll.c=0A= @@ -27,6 +27,20 @@ static bool sit9531x_dpll_is_input_pin(const struct sit9= 531x_dpll_pin *pin)=0A= return pin->dir =3D=3D DPLL_PIN_DIRECTION_INPUT;=0A= }=0A= =0A= +static bool=0A= +sit9531x_dpll_is_intsync_pin(const struct sit9531x_dpll_pin *pin)=0A= +{=0A= + return sit9531x_dpll_is_input_pin(pin) &&=0A= + pin->id =3D=3D SIT9531X_INTSYNC_PIN_ID;=0A= +}=0A= +=0A= +static bool=0A= +sit9531x_dpll_is_intsync_src_pin(const struct sit9531x_dpll_pin *pin)=0A= +{=0A= + return !sit9531x_dpll_is_input_pin(pin) &&=0A= + pin->id =3D=3D SIT9531X_INTSYNC_OUT_PIN_ID;=0A= +}=0A= +=0A= static bool=0A= sit9531x_dpll_is_xo_pin(const struct sit9531x_dpll_pin *pin)=0A= {=0A= @@ -178,18 +192,23 @@ const struct dpll_device_ops sit9531x_dpll_device_ops= =3D {=0A= };=0A= =0A= /*=0A= - * Pin-state contract. An input is SELECTABLE while listed in this PLL's= =0A= - * priority table and DISCONNECTED otherwise; CONNECTED is refused because= the=0A= - * device selects by priority. Operstate is ACTIVE when the device feeds t= he PLL=0A= - * this input (chan->routed_ref), the PLL is tracking and the lane has sig= nal;=0A= - * NO_SIGNAL on loss of signal; QUAL_FAILED on frequency drift; STANDBY=0A= - * otherwise. The routed reference is used because on loss of signal the d= evice=0A= - * falls back to another listed source and leaves the selection naming the= lost=0A= - * one. On manual input select, the selected input is CONNECTED: the one t= he=0A= - * select register names, or the one the PLL last tracked when the select = pins=0A= - * or the indirect choice pick it; a state request is refused. An output i= s=0A= - * CONNECTED while driven and DISCONNECTED while muted; SELECTABLE is refu= sed.=0A= - * The XO pin is always CONNECTED and reports its priority read-only.=0A= + * Pin-state contract. An input or the INTSYNC destination is SELECTABLE w= hile=0A= + * listed in this PLL's priority table and DISCONNECTED otherwise; CONNECT= ED is=0A= + * refused because the device selects by priority. Operstate is ACTIVE whe= n the=0A= + * device feeds the PLL this source (chan->routed_ref), the PLL is trackin= g and=0A= + * the lane has signal; NO_SIGNAL on loss of signal; QUAL_FAILED on freque= ncy=0A= + * drift; STANDBY otherwise. The routed reference is used because on loss = of=0A= + * signal the device falls back to another listed source and leaves the=0A= + * selection naming the lost one. On manual input select, the selected inp= ut is=0A= + * CONNECTED: the one the select register names, or the one the PLL last= =0A= + * tracked when the select pins or the indirect choice pick it; a state re= quest=0A= + * is refused. The INTSYNC destination has signal while the driver's recor= d=0A= + * shows a PLL driving the line or a PLL is locked to it; it is DISCONNECT= ED on=0A= + * the PLL recorded as the source, whole or partial. An output or the INTS= YNC=0A= + * source is CONNECTED while driven and DISCONNECTED otherwise; SELECTABLE= is=0A= + * refused. A DISCONNECTED request on the source pin of a partial source c= lears=0A= + * its page; until then a connect on another PLL is refused. The XO pin is= =0A= + * always CONNECTED and reports its priority read-only.=0A= */=0A= =0A= /* Caller must hold sitdev->multiop_lock. */=0A= @@ -218,6 +237,22 @@ sit9531x_dpll_selection_state_get(struct sit9531x_dev = *sitdev,=0A= *state =3D DPLL_PIN_STATE_DISCONNECTED;=0A= }=0A= =0A= +/*=0A= + * For INTSYNC, use the driver's record of a PLL driving or locked to the = line=0A= + * in place of the LOS monitor. Caller must hold sitdev->multiop_lock.=0A= + */=0A= +static bool=0A= +sit9531x_dpll_selection_no_signal(struct sit9531x_dev *sitdev, u8 pin_id)= =0A= +{=0A= + lockdep_assert_held(&sitdev->multiop_lock);=0A= +=0A= + if (pin_id =3D=3D SIT9531X_INTSYNC_PIN_ID)=0A= + return !sit9531x_intsync_driven(sitdev);=0A= +=0A= + return pin_id < sitdev->info->num_inputs &&=0A= + sit9531x_ref_state_get(sitdev, pin_id)->los;=0A= +}=0A= +=0A= /* Caller must hold sitdev->multiop_lock. */=0A= static bool=0A= sit9531x_dpll_selection_active(struct sit9531x_dev *sitdev,=0A= @@ -232,12 +267,7 @@ sit9531x_dpll_selection_active(struct sit9531x_dev *si= tdev,=0A= if (chan->routed_ref !=3D pin_id || !sit9531x_chan_tracking(chan))=0A= return false;=0A= =0A= - /*=0A= - * Do not report a lane without signal as locked, whatever the lock bit= =0A= - * says; the PLL is about to switch away from it.=0A= - */=0A= - if (pin_id < sitdev->info->num_inputs &&=0A= - sit9531x_ref_state_get(sitdev, pin_id)->los)=0A= + if (sit9531x_dpll_selection_no_signal(sitdev, pin_id))=0A= return false;=0A= =0A= return true;=0A= @@ -259,12 +289,13 @@ sit9531x_dpll_selection_operstate_get(struct sit9531x= _dev *sitdev,=0A= return;=0A= }=0A= =0A= + if (sit9531x_dpll_selection_no_signal(sitdev, pin_id)) {=0A= + *operstate =3D DPLL_PIN_OPERSTATE_NO_SIGNAL;=0A= + return;=0A= + }=0A= +=0A= if (pin_id < sitdev->info->num_inputs) {=0A= ref =3D sit9531x_ref_state_get(sitdev, pin_id);=0A= - if (ref->los) {=0A= - *operstate =3D DPLL_PIN_OPERSTATE_NO_SIGNAL;=0A= - return;=0A= - }=0A= if (ref->qual_fail) {=0A= *operstate =3D DPLL_PIN_OPERSTATE_QUAL_FAILED;=0A= return;=0A= @@ -596,8 +627,7 @@ sit9531x_dpll_input_pin_phase_offset_get(const struct d= pll_pin *pin,=0A= */=0A= if (!rc) {=0A= rc =3D sit9531x_input_mon_fetch(sitdev);=0A= - if (!rc && dpin->id < sitdev->info->num_inputs &&=0A= - sit9531x_ref_state_get(sitdev, dpin->id)->los)=0A= + if (!rc && sit9531x_dpll_selection_no_signal(sitdev, dpin->id))=0A= rc =3D -ENODATA;=0A= }=0A= out:=0A= @@ -677,6 +707,366 @@ static const struct dpll_pin_ops sit9531x_dpll_input_= pin_norate_manual_ops =3D {=0A= .phase_offset_get =3D sit9531x_dpll_input_pin_phase_offset_get,=0A= };=0A= =0A= +/*=0A= + * INTSYNC is the inter-PLL sync line: one PLL drives it and other PLLs ma= y lock=0A= + * to it. Each DPLL registers a source pin to drive the line and a destina= tion=0A= + * pin to lock to it.=0A= + */=0A= +=0A= +static int=0A= +sit9531x_dpll_output_pin_direction_get(const struct dpll_pin *pin,=0A= + void *pin_priv,=0A= + const struct dpll_device *dpll,=0A= + void *dpll_priv,=0A= + enum dpll_pin_direction *direction,=0A= + struct netlink_ext_ack *extack);=0A= +=0A= +/* Caller must hold sitdev->multiop_lock. */=0A= +static bool=0A= +sit9531x_dpll_intsync_src_connected(const struct sit9531x_dev *sitdev,=0A= + const struct sit9531x_dpll *sitdpll)=0A= +{=0A= + return sitdev->intsync_src =3D=3D sitdpll->id && !sitdev->intsync_partial= ;=0A= +}=0A= +=0A= +/* Caller must hold sitdev->multiop_lock. */=0A= +static int sit9531x_dpll_intsync_refresh(struct sit9531x_dev *sitdev,=0A= + struct netlink_ext_ack *extack)=0A= +{=0A= + int rc;=0A= +=0A= + rc =3D sit9531x_intsync_refresh(sitdev);=0A= + if (rc)=0A= + NL_SET_ERR_MSG(extack, "INTSYNC source could not be read back");=0A= +=0A= + return rc;=0A= +}=0A= +=0A= +static int=0A= +sit9531x_dpll_intsync_src_state_on_dpll_get(const struct dpll_pin *pin,=0A= + void *pin_priv,=0A= + const struct dpll_device *dpll,=0A= + void *dpll_priv,=0A= + enum dpll_pin_state *state,=0A= + struct netlink_ext_ack *extack)=0A= +{=0A= + struct sit9531x_dpll *sitdpll =3D dpll_priv;=0A= + struct sit9531x_dev *sitdev =3D sitdpll->dev;=0A= +=0A= + mutex_lock(&sitdev->multiop_lock);=0A= + sit9531x_intsync_refresh(sitdev);=0A= + if (sit9531x_dpll_intsync_src_connected(sitdev, sitdpll))=0A= + *state =3D DPLL_PIN_STATE_CONNECTED;=0A= + else=0A= + *state =3D DPLL_PIN_STATE_DISCONNECTED;=0A= + mutex_unlock(&sitdev->multiop_lock);=0A= +=0A= + return 0;=0A= +}=0A= +=0A= +/*=0A= + * Whether the PLL takes INTSYNC as a reference: by the source it is route= d=0A= + * from, a manual PLL by its select code, an automatic one by its table.= =0A= + */=0A= +static bool sit9531x_dpll_intsync_selected(struct sit9531x_dev *sitdev,=0A= + u8 pll_idx)=0A= +{=0A= + const struct sit9531x_chan *chan;=0A= +=0A= + chan =3D sit9531x_chan_state_get(sitdev, pll_idx);=0A= + if (!chan->stale && chan->routed_ref =3D=3D SIT9531X_INTSYNC_PIN_ID)=0A= + return true;=0A= + if (chan->manual_input)=0A= + return chan->manual_ref =3D=3D SIT9531X_INTSYNC_PIN_ID;=0A= +=0A= + return sit9531x_input_prio_present(sitdev, pll_idx,=0A= + sit9531x_input_hw_src(SIT9531X_INTSYNC_PIN_ID));=0A= +}=0A= +=0A= +/*=0A= + * Driving the line is an explicit routing, not a selection candidate, so= =0A= + * SELECTABLE is refused.=0A= + */=0A= +static int=0A= +sit9531x_dpll_intsync_src_state_on_dpll_set(const struct dpll_pin *pin,=0A= + void *pin_priv,=0A= + const struct dpll_device *dpll,=0A= + void *dpll_priv,=0A= + enum dpll_pin_state state,=0A= + struct netlink_ext_ack *extack)=0A= +{=0A= + bool was_connected, moved, owner_kept =3D false;=0A= + struct sit9531x_dpll_pin *dpin =3D pin_priv;=0A= + struct sit9531x_dpll *sitdpll =3D dpll_priv;=0A= + struct sit9531x_dev *sitdev =3D sitdpll->dev;=0A= + int rc =3D 0, detect_rc =3D 0;=0A= + bool changed =3D false;=0A= +=0A= + mutex_lock(&sitdev->multiop_lock);=0A= +=0A= + rc =3D sit9531x_dpll_intsync_refresh(sitdev, extack);=0A= + if (rc) {=0A= + mutex_unlock(&sitdev->multiop_lock);=0A= + return rc;=0A= + }=0A= + was_connected =3D sit9531x_dpll_intsync_src_connected(sitdev, sitdpll);= =0A= +=0A= + switch (state) {=0A= + case DPLL_PIN_STATE_CONNECTED:=0A= + if (was_connected)=0A= + break;=0A= + if (sitdev->intsync_src >=3D 0 &&=0A= + sitdev->intsync_src !=3D sitdpll->id) {=0A= + if (sitdev->intsync_partial)=0A= + NL_SET_ERR_MSG_FMT(extack,=0A= + "PLL%c holds a partial INTSYNC source; disconnect its source pin = first",=0A= + 'A' + sitdev->intsync_src);=0A= + else=0A= + NL_SET_ERR_MSG(extack,=0A= + "INTSYNC is already sourced by another PLL");=0A= + rc =3D -EBUSY;=0A= + break;=0A= + }=0A= + /*=0A= + * The enable drives the line from every page holding the source=0A= + * pattern.=0A= + */=0A= + if (sitdev->intsync_conflict) {=0A= + NL_SET_ERR_MSG(extack,=0A= + "More than one PLL holds the INTSYNC source pattern");=0A= + rc =3D -EBUSY;=0A= + break;=0A= + }=0A= + /*=0A= + * The global enable covers every page, so this PLL would drive=0A= + * the line alongside the configuration that set it.=0A= + */=0A= + if (sitdev->intsync_foreign) {=0A= + NL_SET_ERR_MSG(extack,=0A= + "INTSYNC is enabled by a configuration the driver does not reco= gnize");=0A= + rc =3D -EBUSY;=0A= + break;=0A= + }=0A= + if (sit9531x_dpll_intsync_selected(sitdev, sitdpll->id)) {=0A= + NL_SET_ERR_MSG(extack,=0A= + "PLL selects INTSYNC as a reference; it cannot drive it");=0A= + rc =3D -EBUSY;=0A= + break;=0A= + }=0A= + rc =3D sit9531x_intsync_enable(sitdev, sitdpll->id, &owner_kept,=0A= + &changed);=0A= + break;=0A= + case DPLL_PIN_STATE_DISCONNECTED:=0A= + if (sitdev->intsync_src !=3D sitdpll->id)=0A= + break;=0A= + rc =3D sit9531x_intsync_disable(sitdev, sitdpll->id,=0A= + &owner_kept, &changed);=0A= + break;=0A= + default:=0A= + NL_SET_ERR_MSG(extack,=0A= + "A PLL drives INTSYNC or not; use connected or disconnected");= =0A= + rc =3D -EINVAL;=0A= + break;=0A= + }=0A= +=0A= + if (changed && !rc) {=0A= + sitdev->intsync_src =3D state =3D=3D DPLL_PIN_STATE_CONNECTED ?=0A= + sitdpll->id : -1;=0A= + sitdev->intsync_partial =3D false;=0A= + }=0A= +=0A= + /* A disconnect reads back through the partial record */=0A= + if (changed)=0A= + detect_rc =3D state =3D=3D DPLL_PIN_STATE_DISCONNECTED ?=0A= + sit9531x_intsync_readback(sitdev) :=0A= + sit9531x_intsync_src_detect(sitdev);=0A= + if (changed && rc) {=0A= + if (owner_kept ||=0A= + (state =3D=3D DPLL_PIN_STATE_CONNECTED &&=0A= + (detect_rc || sitdev->intsync_src =3D=3D sitdpll->id))) {=0A= + sitdev->intsync_src =3D sitdpll->id;=0A= + sitdev->intsync_partial =3D true;=0A= + sitdev->intsync_foreign =3D false;=0A= + } else if (detect_rc) {=0A= + sitdev->intsync_stale =3D true;=0A= + }=0A= + } else if (changed && detect_rc && sitdev->intsync_conflict) {=0A= + sitdev->intsync_stale =3D true;=0A= + sitdev->intsync_ntf_pending =3D true;=0A= + }=0A= + if (detect_rc)=0A= + dev_warn(sitdev->dev,=0A= + "INTSYNC source cache not refreshed: %d\n",=0A= + detect_rc);=0A= +=0A= + /* The core notifies only a request that succeeded */=0A= + moved =3D sit9531x_dpll_intsync_src_connected(sitdev, sitdpll) !=3D=0A= + was_connected;=0A= +=0A= + mutex_unlock(&sitdev->multiop_lock);=0A= +=0A= + if (rc) {=0A= + struct dpll_pin *dpll_pin;=0A= +=0A= + if (rc !=3D -EBUSY && rc !=3D -EINVAL && rc !=3D -EOPNOTSUPP)=0A= + NL_SET_ERR_MSG(extack,=0A= + "Failed to set INTSYNC source state");=0A= + /*=0A= + * Runs under the core's lock, as __dpll_pin_change_ntf()=0A= + * requires.=0A= + */=0A= + dpll_pin =3D READ_ONCE(dpin->dpll_pin);=0A= + if (moved && dpll_pin && __dpll_pin_change_ntf(dpll_pin)) {=0A= + mutex_lock(&sitdev->multiop_lock);=0A= + sitdev->intsync_ntf_pending =3D true;=0A= + mutex_unlock(&sitdev->multiop_lock);=0A= + }=0A= + }=0A= +=0A= + return rc;=0A= +}=0A= +=0A= +static const struct dpll_pin_ops sit9531x_dpll_intsync_src_pin_ops =3D {= =0A= + .direction_get =3D sit9531x_dpll_output_pin_direction_get,=0A= + .state_on_dpll_get =3D sit9531x_dpll_intsync_src_state_on_dpll_get,=0A= + .state_on_dpll_set =3D sit9531x_dpll_intsync_src_state_on_dpll_set,=0A= +};=0A= +=0A= +static int=0A= +sit9531x_dpll_intsync_dst_state_on_dpll_get(const struct dpll_pin *pin,=0A= + void *pin_priv,=0A= + const struct dpll_device *dpll,=0A= + void *dpll_priv,=0A= + enum dpll_pin_state *state,=0A= + struct netlink_ext_ack *extack)=0A= +{=0A= + struct sit9531x_dpll *sitdpll =3D dpll_priv;=0A= + struct sit9531x_dev *sitdev =3D sitdpll->dev;=0A= +=0A= + mutex_lock(&sitdev->multiop_lock);=0A= + sit9531x_intsync_refresh(sitdev);=0A= + if (sitdev->intsync_src =3D=3D sitdpll->id)=0A= + *state =3D DPLL_PIN_STATE_DISCONNECTED;=0A= + else=0A= + sit9531x_dpll_selection_state_get(sitdev, sitdpll,=0A= + SIT9531X_INTSYNC_PIN_ID,=0A= + state);=0A= + mutex_unlock(&sitdev->multiop_lock);=0A= +=0A= + return 0;=0A= +}=0A= +=0A= +/* INTSYNC is an internal line; only the per-PLL priority table is touched= . */=0A= +static int=0A= +sit9531x_dpll_intsync_dst_state_on_dpll_set(const struct dpll_pin *pin,=0A= + void *pin_priv,=0A= + const struct dpll_device *dpll,=0A= + void *dpll_priv,=0A= + enum dpll_pin_state state,=0A= + struct netlink_ext_ack *extack)=0A= +{=0A= + u8 hw_src =3D sit9531x_input_hw_src(SIT9531X_INTSYNC_PIN_ID);=0A= + struct sit9531x_dpll_pin *dpin =3D pin_priv;=0A= + struct sit9531x_dpll *sitdpll =3D dpll_priv;=0A= + struct sit9531x_dev *sitdev =3D sitdpll->dev;=0A= + int rc;=0A= +=0A= + mutex_lock(&sitdev->multiop_lock);=0A= +=0A= + if (sit9531x_chan_state_get(sitdev, sitdpll->id)->manual_input) {=0A= + mutex_unlock(&sitdev->multiop_lock);=0A= + return sit9531x_dpll_manual_select_refuse(extack);=0A= + }=0A= + rc =3D sit9531x_dpll_intsync_refresh(sitdev, extack);=0A= + if (rc) {=0A= + mutex_unlock(&sitdev->multiop_lock);=0A= + return rc;=0A= + }=0A= + switch (state) {=0A= + case DPLL_PIN_STATE_DISCONNECTED:=0A= + rc =3D sit9531x_input_prio_remove(sitdev, sitdpll->id, hw_src);=0A= + break;=0A= + case DPLL_PIN_STATE_CONNECTED:=0A= + NL_SET_ERR_MSG(extack,=0A= + "Device selects its reference by priority; use selectable");=0A= + rc =3D -EOPNOTSUPP;=0A= + break;=0A= + case DPLL_PIN_STATE_SELECTABLE:=0A= + if (sitdev->intsync_src =3D=3D sitdpll->id) {=0A= + if (sitdev->intsync_partial)=0A= + NL_SET_ERR_MSG(extack,=0A= + "PLL holds a partial INTSYNC source; disconnect its source pin= first");=0A= + else=0A= + NL_SET_ERR_MSG(extack,=0A= + "PLL cannot lock to the INTSYNC it drives");=0A= + rc =3D -EINVAL;=0A= + break;=0A= + }=0A= + rc =3D sit9531x_input_prio_add(sitdev, sitdpll->id, hw_src);=0A= + break;=0A= + default:=0A= + rc =3D -EINVAL;=0A= + break;=0A= + }=0A= +=0A= + /* As for an input pin: the core notifies this request */=0A= + if (!rc)=0A= + sit9531x_dpll_pin_baseline(dpin);=0A= +=0A= + mutex_unlock(&sitdev->multiop_lock);=0A= +=0A= + if (rc =3D=3D -ENOSPC)=0A= + NL_SET_ERR_MSG(extack,=0A= + "Priority table is full of unique sources on this PLL");=0A= + else if (rc && rc !=3D -EINVAL && rc !=3D -EOPNOTSUPP)=0A= + NL_SET_ERR_MSG(extack, "Failed to set INTSYNC input state");=0A= +=0A= + return rc;=0A= +}=0A= +=0A= +static int=0A= +sit9531x_dpll_intsync_dst_operstate_on_dpll_get(const struct dpll_pin *pin= ,=0A= + void *pin_priv,=0A= + const struct dpll_device *dpll,=0A= + void *dpll_priv,=0A= + enum dpll_pin_operstate *state,=0A= + struct netlink_ext_ack *extack)=0A= +{=0A= + struct sit9531x_dpll *sitdpll =3D dpll_priv;=0A= + struct sit9531x_dev *sitdev =3D sitdpll->dev;=0A= +=0A= + mutex_lock(&sitdev->multiop_lock);=0A= + sit9531x_intsync_refresh(sitdev);=0A= + sit9531x_dpll_selection_operstate_get(sitdev, sitdpll,=0A= + SIT9531X_INTSYNC_PIN_ID,=0A= + state);=0A= + mutex_unlock(&sitdev->multiop_lock);=0A= +=0A= + return 0;=0A= +}=0A= +=0A= +/*=0A= + * The destination pin id SIT9531X_INTSYNC_PIN_ID is one past the end of r= ef[];=0A= + * do not add ops that index ref[id].=0A= + */=0A= +static const struct dpll_pin_ops sit9531x_dpll_intsync_dst_pin_ops =3D {= =0A= + .direction_get =3D sit9531x_dpll_input_pin_direction_get,=0A= + .state_on_dpll_get =3D sit9531x_dpll_intsync_dst_state_on_dpll_get,=0A= + .state_on_dpll_set =3D sit9531x_dpll_intsync_dst_state_on_dpll_set,=0A= + .operstate_on_dpll_get =3D=0A= + sit9531x_dpll_intsync_dst_operstate_on_dpll_get,=0A= + .prio_get =3D sit9531x_dpll_input_pin_prio_get,=0A= + .prio_set =3D sit9531x_dpll_input_pin_prio_set,=0A= +};=0A= +=0A= +static const struct dpll_pin_ops sit9531x_dpll_intsync_dst_pin_manual_ops = =3D {=0A= + .direction_get =3D sit9531x_dpll_input_pin_direction_get,=0A= + .state_on_dpll_get =3D sit9531x_dpll_intsync_dst_state_on_dpll_get,=0A= + .state_on_dpll_set =3D sit9531x_dpll_manual_pin_state_on_dpll_set,=0A= + .operstate_on_dpll_get =3D=0A= + sit9531x_dpll_intsync_dst_operstate_on_dpll_get,=0A= +};=0A= +=0A= /*=0A= * The XO feeds every PLL and is always connected. The priority is the one= the=0A= * PLL's table sorts the OCXO source by; it has no setter.=0A= @@ -1025,13 +1415,19 @@ sit9531x_dpll_pin_ops_get(const struct sit9531x_dpl= l_pin *pin)=0A= const struct sit9531x_dev *sitdev =3D pin->dpll->dev;=0A= bool manual;=0A= =0A= - if (!sit9531x_dpll_is_input_pin(pin))=0A= + if (!sit9531x_dpll_is_input_pin(pin)) {=0A= + if (sit9531x_dpll_is_intsync_src_pin(pin))=0A= + return &sit9531x_dpll_intsync_src_pin_ops;=0A= return &sit9531x_dpll_output_pin_ops;=0A= + }=0A= /* As read at probe, before any pin is registered */=0A= manual =3D sit9531x_chan_state_get(sitdev, pin->dpll->id)->manual_input;= =0A= if (sit9531x_dpll_is_xo_pin(pin))=0A= return manual ? &sit9531x_dpll_xo_pin_manual_ops :=0A= &sit9531x_dpll_xo_pin_ops;=0A= + if (sit9531x_dpll_is_intsync_pin(pin))=0A= + return manual ? &sit9531x_dpll_intsync_dst_pin_manual_ops :=0A= + &sit9531x_dpll_intsync_dst_pin_ops;=0A= /*=0A= * Set before any pin of the input is published and not written again.=0A= */=0A= @@ -1052,7 +1448,10 @@ static void sit9531x_dpll_pin_snapshot(struct sit953= 1x_dpll *sitdpll,=0A= struct sit9531x_dev *sitdev =3D sitdpll->dev;=0A= u8 id =3D pin->id;=0A= =0A= - sit9531x_dpll_selection_state_get(sitdev, sitdpll, id, state);=0A= + if (id =3D=3D SIT9531X_INTSYNC_PIN_ID && sitdev->intsync_src =3D=3D sitdp= ll->id)=0A= + *state =3D DPLL_PIN_STATE_DISCONNECTED;=0A= + else=0A= + sit9531x_dpll_selection_state_get(sitdev, sitdpll, id, state);=0A= sit9531x_dpll_selection_operstate_get(sitdev, sitdpll, id, operstate);=0A= /* A PLL on manual input select reports no priority */=0A= if (sit9531x_chan_state_get(sitdev, sitdpll->id)->manual_input ||=0A= diff --git a/drivers/dpll/sit9531x/regs.h b/drivers/dpll/sit9531x/regs.h=0A= index 5d104b39bc4f..d7a817bb728f 100644=0A= --- a/drivers/dpll/sit9531x/regs.h=0A= +++ b/drivers/dpll/sit9531x/regs.h=0A= @@ -23,6 +23,7 @@=0A= #define SIT9531X_PAGE_OUTSYS0 0x03=0A= #define SIT9531X_PAGE_OUTSYS1 0x04=0A= #define SIT9531X_PAGE_PLLA 0x0A=0A= +#define SIT9531X_PAGE_PLLA_EXT 0x1A=0A= =0A= /* Reg 0x03 holds an unrelated revision byte, not part of the variant ID *= /=0A= #define SIT9531X_REG_VARIANT_ID SIT9531X_REG(0x00, 0x02)=0A= @@ -46,6 +47,10 @@=0A= #define SIT9531X_REG_HO_FREEZE_STATUS SIT9531X_REG(0x00, 0x0A)=0A= #define SIT9531X_REG_HO_FREEZE_NOTIF SIT9531X_REG(0x00, 0x0B)=0A= =0A= +/* INTSYNC (inter-PLL synchronization) global enable */=0A= +#define SIT9531X_REG_INTSYNC_GLOBAL SIT9531X_REG(0x00, 0x40)=0A= +#define SIT9531X_INTSYNC_EN_BIT 6=0A= +=0A= /*=0A= * Priority table: six registers per PLL from 0x16 + 6 * PLL, holding slot= s=0A= * 0-10 and the active-reference nibble; slot 2n in [7:4], 2n+1 in [3:0].= =0A= @@ -247,6 +252,9 @@=0A= #define SIT9531X_PLL_REG_ACTIVE 0x02=0A= #define SIT9531X_PLL_ACTIVE_BIT BIT(0) /* PLL reached active state */=0A= =0A= +/* PLL EXT page INTSYNC configuration registers */=0A= +#define SIT9531X_PLL_EXT_PAGE(_idx) (SIT9531X_PAGE_PLLA_EXT + (_idx))=0A= +=0A= #define SIT9531X_PLL_STATUS_OUTER_DIS BIT(5)=0A= =0A= /*=0A= -- =0A= 2.39.2 (Apple Git-143)=0A= =0A=