From patchwork Wed Jul 31 15:42:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle Swenson X-Patchwork-Id: 13748938 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2058.outbound.protection.outlook.com [40.107.249.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC8395A10B for ; Wed, 31 Jul 2024 15:42:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722440539; cv=fail; b=NzGskyhqL+ojVBXPPcdubFNg3MoItIxMlxy3j40RWjX0VmC1J8FDA3mXXpRIzy6LI6YqVIvC+rRE+6ay8J0XHVUJr/Nu1MMHXjvfu6YQxKh3YbYrPiGqA0acCV12tTQGlQIkGWP5nBi5AlfY+bxTId+MoOfpYyPNVuhFHhfJWxo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722440539; c=relaxed/simple; bh=g/SVlgtoIuaXN2MpC+bagRCGxTs4hJ4BQG2Sf7B8yIE=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=NxjZHgsp4slkMX+YTpduaAesVJPr4RiV5DDGXaELO11XPerw/3tpEOgcFWf6ClsuXUkstcvcBxywMVusjSCmRQjW92em4h+1uPfvy8XoCucMbyfmzHZu4dTSmwPTtbDmb0NdEcnBb8Q/Rf64JS8GZlD31MQkqd91XtomYRiRCFE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=est.tech; spf=pass smtp.mailfrom=est.tech; dkim=pass (1024-bit key) header.d=est.tech header.i=@est.tech header.b=gjOXMfYU; arc=fail smtp.client-ip=40.107.249.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=est.tech Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=est.tech Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=est.tech header.i=@est.tech header.b="gjOXMfYU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KpHO5kXPdcDbmF1ZWSzjV0s8dwZcDykjOnnBQlrhI8+s8xxBo+FMEx+Z5vQ3WgP0RYXPujm5CLzDScCk+YxwpiYG0FjRlvlnuDuey59TsWsuT2Ev3Iv+6aVo88sl/uzWM8/p7GrPF7uIO5sZwFYqv4KgAlhckezUrCmTgwmygsNYiLRl8gzCLfjQ6qI52hjeAyixPkvpTCWhzkK5zYaXmH7U+BQqBZBF3G+DzA7MLFJJ5drWLZGh6z9QoJ3EiUSPyujvVb+UXJNq3Uq5a/k1nDtErmnACFDPmwEBFV0P7IcaF8WPCbN27B8H/cZpCjg/GzzNXp8HMBo0s3H7N/Usng== 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=pvb2UmC2pZEnHxgwRvf20uQ5lSj5/+q6IhiqTSSqB1E=; b=f1gbQqnhO+KiH5nKhxC6UkVP/AegL1BHgOjrnxtItX9diB4Y6sr/rQO9WnH2zIm5Rxq4pgy/UCMdLoqRfN17bpw7Y14N5tvQImEUeqGKhHXoz58MZ1qrh3Itsk5xE7gGczqr9afAZi8kDAAHUT86JYoQmcqPrPhgFlKcBxySU2TjEGA2RmzR6yd2pE7sl8+IiqTLm23YolEgCNnP7bh0+IouRzs/7rig4zZjrdE1YTUNgpeA8HxmSAE8JBlcF9nX56vFCHvOIgKvzm/moBtxYnOTsUHe8yMVvBHg7DVyCM9TuHarSoI7lj+d5CdcIjcBGntzdSTtamxLvcftjp1Vtw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=est.tech; dmarc=pass action=none header.from=est.tech; dkim=pass header.d=est.tech; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=est.tech; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pvb2UmC2pZEnHxgwRvf20uQ5lSj5/+q6IhiqTSSqB1E=; b=gjOXMfYUbUT99J0f578W8kvcJevS4i64L8bbt7A91k52WXLPMzkvgseqCSoh3F1j7h7Oc6johGujKfJgydcLEsNT8lVijrh2JPCwhKjArnZXso4sfhn73B6k531++u3JX9DQjGdP0suxPEn/cMXEALrydL1duFaz+sG7N+Y6eZE= Received: from AM7P189MB0807.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:115::19) by PA1P189MB2693.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:452::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21; Wed, 31 Jul 2024 15:42:14 +0000 Received: from AM7P189MB0807.EURP189.PROD.OUTLOOK.COM ([fe80::53cd:a2f6:34be:7dab]) by AM7P189MB0807.EURP189.PROD.OUTLOOK.COM ([fe80::53cd:a2f6:34be:7dab%6]) with mapi id 15.20.7849.002; Wed, 31 Jul 2024 15:42:14 +0000 From: Kyle Swenson To: Kyle Swenson , "o.rempel@pengutronix.de" , "kory.maincent@bootlin.com" , "kuba@kernel.org" CC: "davem@davemloft.net" , "edumazet@google.com" , "pabeni@redhat.com" , "thomas.petazzoni@bootlin.com" , "netdev@vger.kernel.org" Subject: [PATCH net-next v2] net: pse-pd: tps23881: Fix the device ID check Thread-Topic: [PATCH net-next v2] net: pse-pd: tps23881: Fix the device ID check Thread-Index: AQHa42A3SArVdM7xfUK5bqVOsDUdiA== Date: Wed, 31 Jul 2024 15:42:14 +0000 Message-ID: <20240731154152.4020668-1-kyle.swenson@est.tech> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=est.tech; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AM7P189MB0807:EE_|PA1P189MB2693:EE_ x-ms-office365-filtering-correlation-id: 2bc50540-5abf-43d1-5c0d-08dcb1775a01 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|366016|376014|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?XbRf86OgEtlE8L3Q9Vs8Y/3jfW?= =?iso-8859-1?q?FFZjDtf1A4XQNJyX7zmprVMoQF4aRYzdWXxPK/Rm/J8jehWOKF1aIpXj7Gi5?= =?iso-8859-1?q?E4+CVpsDA+b5j0/HmlwBByRhf55ZPjfpbqVMM4uu8uVoKNuTka1KdbyCYr9e?= =?iso-8859-1?q?Dbx/fvV4wKJWEoUSo3rNrWG3Rcf3wlNPspsZJHTpcXEcHM4PLtkHuO439Ylc?= =?iso-8859-1?q?baL2zH3BkN9kdJysippVRnn501XZp5+UhAuox60zJWxNaiYlHnzTai2bQUNA?= =?iso-8859-1?q?wQ/SNNd90mF9tGDOyPvQZQ2ZmAeKBbinGAleidNGvoCBu5aG2zhH8azmfTy1?= =?iso-8859-1?q?IfrbMjAzq02ADe819dcH9pN1jjPOdnU4VNZ3zC7+LNiwdeSu+Q6BYWhzqV7F?= =?iso-8859-1?q?F4y5J+k83u+bcDk/Ti/fAcq2sq2DRvoJ+WSIn8QLi6Oy1arw2t+0SVUR1pTR?= =?iso-8859-1?q?ORO7DBSZm3+Ja7BAJs7/2hMRmsOgJ+jqOuT4NGlawmLGEX5SWTRdEvIhhvjv?= =?iso-8859-1?q?1AlEZALp0QV1O6ubaWvr1NrL/zYZeQCZFfOoUq0fZf/uYCHC0G1CSURWG+Xr?= =?iso-8859-1?q?TH5iP+n2OmD9NXN6Imrf46zxgO8/9+4mQLB6+zPRdlfv/CpsjnvGeQwH2pvP?= =?iso-8859-1?q?LNuwTRrdEbLOpH2HiXHmT0dp2olhbqmtc3KsqkHuWUztgQn6WuTGBP/j3Vvj?= =?iso-8859-1?q?nUOpQbG6+/1Cy1c6t/MGE7MrHj2an1xn5cL4SzGc09/Vk7XMHYHcd/vZOC4i?= =?iso-8859-1?q?16TxxLTwZoh54K9a3CM3KXxw3OTYaGnFzp5eUQLbT1xTIiivU4QjznUKan36?= =?iso-8859-1?q?2iP4X5GJJt2Pi3aljSCY9dJnMBe5H+iQi8e32JJWt5wY98g62frFLxLt37hv?= =?iso-8859-1?q?6zSA7JHBEDWeXMDqTPBYdj3DSGiSFYHp9r1Fi/0ZpXaz6rVhaSHnKfhIaSNZ?= =?iso-8859-1?q?dkboDwrdeE09f0p5j5JhctbJU6x3J03EOq6K8LhbLssvroO7y2MdgzufhmEK?= =?iso-8859-1?q?rF1NSykuc4w1I21LUAlvZ4SeTVGVk1gOHgHVoBm3lxuqv8pNv87bQaNLh14o?= =?iso-8859-1?q?nLNj4PpX1iFB204SJStTlSwd3t25YhgrCu4GSeuSgmigS4lz/TgBNz9InZCN?= =?iso-8859-1?q?rA7yHRPB0nSxdEGlQ1zMbcm9jAPQrGbEb6X0ADIUWuBN744c+iS56mxfakbH?= =?iso-8859-1?q?ibXcgVqRVxiDE/OlWiln+fXNV9x3gWmmyH+T2yHxUZhJPGOeqvZSHULX34Zu?= =?iso-8859-1?q?x9fOvgTiNjOk8yNNYH6aGTaOF99XkuBWhibE2B4LTOr+PHleV1qvqrL3Du+j?= =?iso-8859-1?q?AFPkDIYZDhOeMH6uDareBxEB9qnmvhXUQwBtNtl74byLvfs2/wFM5kIlYHIJ?= =?iso-8859-1?q?J5Hg8UBIdhD8Rj4lLTRjKFcibajaQqzHcMWB3nEWU=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7P189MB0807.EURP189.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?TKSG19vHa0l4DTE3AVXXZ+h?= =?iso-8859-1?q?0Ujkk3sZ9s7/mLkl91A8LvYHqi8kh9kp0BP2ofAdhdijWdWqHJw985NNJCaQ?= =?iso-8859-1?q?WNlNXrULXT9BU6mSiK5iGrcA62go0N9m0jz6Mxe83oCB/XWqeO0uJj3kzyoN?= =?iso-8859-1?q?HKTUEDBDhWqIi8vxWWtpFRHfhDvoOqaPaMuj/I+UA9bf+lVXNkTq52JQjH3O?= =?iso-8859-1?q?k5YgQEqMVZTw3/jM/gxsEaW8zxg5vZN7ymtR1ukWnvzgXYJmdFE2xyaNNP1S?= =?iso-8859-1?q?ITjLbR4cf+1+VUC9lNbZmlEtWfC7rI0HWNfNZYLMMPJ1l/cetfn3FqIUrXpE?= =?iso-8859-1?q?RD/2ofR7HMqxAJNcNSPAAyb3dpTJuD7HHKt7TL5Pjbotc9FhclI62lAhXfl4?= =?iso-8859-1?q?iuuf7LwqUQrMidiHKqrGfBhK3jiGMvpfraYxhCzJic1roYtTd1r12LYGvthI?= =?iso-8859-1?q?p+NROZrpUPiCEWIPl4RKSyoSyWXiupfYnLAfDjPzP3dl8bHhecq38Dh3R8+m?= =?iso-8859-1?q?2MKgDdwAduKsDjl2aZXI7rIRHpV/IJZXIAxth/bEPqZ040b9kk3H2hiuDWz2?= =?iso-8859-1?q?gSWWu2nI+DwgW1x3dfJrBf1nliur7OUbODNF5kuzPVGOmLWzpBcPZ2hjQDAG?= =?iso-8859-1?q?1khDYQ1asdBEhU0WJzpgvtRRoDfJUClDAefG/od6BYQZsGFr4cHW/2u3/py9?= =?iso-8859-1?q?p+4ynV54KiVpnGg+LslvGXt7iXEgX3NT47sgEsPCkbPety3mjn19rVI+GsYp?= =?iso-8859-1?q?j5mbM1Xer3wozwAe+7Qjhy9a2ZfCUzMH2AWQ+EFy4Wr4fpzPeGVBEyw/CdsW?= =?iso-8859-1?q?3iPn6M15L7ZXoF1HDBvUyvOkwH1ZLog7OLbnDJYqbUCOoxfGQQ0doJ3V50nf?= =?iso-8859-1?q?De3+AG2ku/KaJ8COjOw4gC7y538klGth5i46lNQKpM3PiuNUO3332ntr6urU?= =?iso-8859-1?q?jX1oIuPBE/Wt8Di5qs8j98t2Udo0b23kZxXPHKoJ/8eSw8DO3Z68UR5IbRhX?= =?iso-8859-1?q?wqIco3/tpfpHyP6hq4KH3C4urIGIXxM/l6kVm3v8eYfHwyjhi4H1BMEHUiy/?= =?iso-8859-1?q?AmcXgh+3t0eIdN8CvGuL+Rb2IGXQVLoKAelG7KQath0jNRJHHH5ibIPJRm+a?= =?iso-8859-1?q?SZt4340yfG6ySgir0RKiEFvIaClqxypJlRkg1/XUPFUQWc8lXbz4tGbOcP08?= =?iso-8859-1?q?PxooqXGSbYtXm+FxjiYuX+Zq6khvq00rPQYmT/368rHZSRAtjyANxHkjL0oE?= =?iso-8859-1?q?0RWl6xDy5RbxQaUuFD5b6Rfn7K4BONpE37/fX7rAoxow3auAmVfVZ/FMyhbV?= =?iso-8859-1?q?ebEXjtYCClsKewbMa6y/l4e+CyRze5xY9C0C/VLhD0QNfYUnL+D6uC7odzgn?= =?iso-8859-1?q?VDzDqhC25mRMoRizEUISwLa5l+ad/I8HK09o0Kj8jt6kvK/DYIpnb4SIp69U?= =?iso-8859-1?q?YNqrWkg3/6kQipLk4nZlimo55tPLR0QUyUOSG/5+gAZ7FylkeEkVKInHwpC4?= =?iso-8859-1?q?LVVrPAaX7Gz9hOLnlrjNgu6d6wUquhD7NmiOXamSpMuaL78imfSW/n3plcX0?= =?iso-8859-1?q?8WMGc7rIqpys2OX2yK2MdxOkGltRVK9wbATrQmuhLpzCN1XX/0WCaAZkaJ/p?= =?iso-8859-1?q?yPe/+hGD4JMy3a1wZBGod3TRIJGxADjK3uFS+hA=3D=3D?= Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM7P189MB0807.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 2bc50540-5abf-43d1-5c0d-08dcb1775a01 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jul 2024 15:42:14.8835 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d2585e63-66b9-44b6-a76e-4f4b217d97fd X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: QaJE0JA0JjxwwkdFFXs9agwT1uidR9UKrEZAzIJKDmxQunz7tKXbou8CLQ0KsLnugAXwNsxeo01tu2LePX9hCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1P189MB2693 X-Patchwork-Delegate: kuba@kernel.org The DEVID register contains two pieces of information: the device ID in the upper nibble, and the silicon revision number in the lower nibble. The driver should work fine with any silicon revision, so let's mask that out in the device ID check. Fixes: 20e6d190ffe1 ("net: pse-pd: Add TI TPS23881 PSE controller driver") Signed-off-by: Kyle Swenson Reviewed-by: Thomas Petazzoni Acked-by: Oleksij Rempel Reviewed-by: Kory Maincent --- v2: - Use FIELD_GET and defines instead of raw numbers v1: https://lore.kernel.org/netdev/20240730161032.3616000-1-kyle.swenson@est.tech/ drivers/net/pse-pd/tps23881.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c index 61f6ad9c1934..f90db758554b 100644 --- a/drivers/net/pse-pd/tps23881.c +++ b/drivers/net/pse-pd/tps23881.c @@ -27,10 +27,12 @@ #define TPS23881_REG_PORT_POWER 0x29 #define TPS23881_REG_POEPLUS 0x40 #define TPS23881_REG_TPON BIT(0) #define TPS23881_REG_FWREV 0x41 #define TPS23881_REG_DEVID 0x43 +#define TPS23881_REG_DEVID_MASK 0xF0 +#define TPS23881_DEVICE_ID 0x02 #define TPS23881_REG_SRAM_CTRL 0x60 #define TPS23881_REG_SRAM_DATA 0x61 struct tps23881_port_desc { u8 chan[2]; @@ -748,11 +750,11 @@ static int tps23881_i2c_probe(struct i2c_client *client) ret = i2c_smbus_read_byte_data(client, TPS23881_REG_DEVID); if (ret < 0) return ret; - if (ret != 0x22) { + if (FIELD_GET(TPS23881_REG_DEVID_MASK, ret) != TPS23881_DEVICE_ID) { dev_err(dev, "Wrong device ID\n"); return -ENXIO; } ret = tps23881_flash_sram_fw(client);