From patchwork Mon Aug 19 19:02: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: 13768880 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2089.outbound.protection.outlook.com [40.107.241.89]) (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 D11011D54E9; Mon, 19 Aug 2024 19:02:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724094141; cv=fail; b=ShfwzO8BtUUB6jjpfoTrx5s03b+7FVRwNRjStFoaeQFNhLx4DLiih7VnPwWTOieq7wZBi2bqW+Q8or3fexg4YxIOBE0DaMdEIV8MH0r8IZu/dQj+jnHnXpqvokhj36DXi9CwrvLru0NDQct31EFx6UAfYuLut3j2cV3iMjlsJaE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724094141; c=relaxed/simple; bh=Lh99dE4MK8U55sy1Iust28fVOYrjw54Ue/MjH+6sC+M=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=Hzo4RibdScwMx4OY6xskmoguM6ULKymZoC72SkkOQICxgt1LUH5i2iBBuF6MaXoIEml/nzLZ/WlhX1nMe9nQUpUaqFfpj/9ZrMoguyRIKPNxHSoMRGz07JlHaofn4YbxgzuVl425k39fMqnmhkpZ/6El6VSxMuAhSen3XYIHOp0= 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=iPinE0s0; arc=fail smtp.client-ip=40.107.241.89 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="iPinE0s0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Wf+SDKvE/0Y0V/hOxB/LNkv+6rbBPlWfiy1ZT8dq083rmyMkd90Vyq2HxTr96O0afNLqlAJLMhOmMsfc4lCCTBvU+Elx+QTe7tqU8iyqEyxbmT8aYNrBSqPByzVIhVKcu0i8JVtgexUVUWxIXOkkKwICtCqnNe26FgSKfliVvXRQwK2rIYKTKNmexiB+FpK4wRJ7sbcPb25fbCTvyaG2SSlJegCrslupRoyJljvh0EY83iDV19w4zcvFziquy9tDXDOWOn2us8EhDrq65MmcAk3YuFNSftipwzJAfbyzthMABWaHQMedXfTyESAXSEqxxbqHgyIBU4VwA1oXSAsWjA== 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=g8t2sOhK/EgDhEkXkg2zr5OGqh/T7EjbB1FiXqhlo5g=; b=Xt7lYL7De/lnwrHiAo/UsAR7GHIQXN59Ccj20/VeavaRSBCBvrfkNAw6dD9UCDNYrtd67DSViwX+W+XvSxkybWY/+VvEA3T0Z7r5P+T7CVoGSNWt5vEKfW4U99XK7QlpdKchNKfdcFotecUvLv9pwhxVFgzNa6lBH1/IRurU7vZMyJKCk30/v7vogCmMW9GkTChYp1a4HxqXt4CrQthpus3TbuCS58RQayalLwg+42g8FKR6hW4rIInNfucJDsEDruk9wsM3946kasCigbGbYvKALJ4oe3kWD6IeJoy4WG8Ja5bS+AeCfxeONYiwYVhTK2rI9mw1SGz8J51RXlrbMQ== 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=g8t2sOhK/EgDhEkXkg2zr5OGqh/T7EjbB1FiXqhlo5g=; b=iPinE0s0EWzvpJNPYldPGZTPo6O49UDydiUmny/eRH71FkduwAECiBW/ewMBfhlZJAKzKRq46VDFXMT450vNcGJCvVJp8Mn/Pz4ZtEdHuxkFl5CvUTVpCFts4zdKYzsR9Lu4FV5cMAG4tOModG/rGSB3Jv/b1X6A85xg2eEy1+E= Received: from AM7P189MB0807.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:115::19) by DB8P189MB1109.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:14a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Mon, 19 Aug 2024 19:02: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.7875.019; Mon, 19 Aug 2024 19:02:14 +0000 From: Kyle Swenson To: "o.rempel@pengutronix.de" , "kory.maincent@bootlin.com" , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , "robh@kernel.org" , "krzk+dt@kernel.org" , "conor+dt@kernel.org" CC: "thomas.petazzoni@bootlin.com" , Kyle Swenson , "netdev@vger.kernel.org" , "devicetree@vger.kernel.org" Subject: [PATCH net-next 2/2] net: pse-pd: tps23881: support reset-gpios Thread-Topic: [PATCH net-next 2/2] net: pse-pd: tps23881: support reset-gpios Thread-Index: AQHa8mpN+TA+JG1k4E2yihVubvKI7Q== Date: Mon, 19 Aug 2024 19:02:14 +0000 Message-ID: <20240819190151.93253-3-kyle.swenson@est.tech> References: <20240819190151.93253-1-kyle.swenson@est.tech> In-Reply-To: <20240819190151.93253-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_|DB8P189MB1109:EE_ x-ms-office365-filtering-correlation-id: 29be2183-15ac-4292-1c9a-08dcc0817053 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|366016|1800799024|376014|7416014|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?utXGLsqaXHlXA8EzAkzz9O79XY?= =?iso-8859-1?q?jXPaTnu7C7ZZ5NlvFbKtkRRl8xirRb2pNpEEzfke+d/0AafpaoKnj8dvNHIv?= =?iso-8859-1?q?n0b6CMsDgZyvN2f7+N041PFN2bk2He2g5G6mEF+DIvJI5eZdbRoXOZ+A/Upd?= =?iso-8859-1?q?29IP8qzi0snijh9UzhMDXF7IXBn+OCP4EgUbRy/0MwktIab3omTBWv1EMr5p?= =?iso-8859-1?q?tEzgF0lav4Eg/kowvYixw7kYjFfF7ZUO0HiBajtqcuAehOk1sEfgQzLp/1jr?= =?iso-8859-1?q?oVsmddKUHaSxCxAmLPq/WuGgYsa2POG+AOfdBoLu8zZ7HWPzonYGcyq0TtNK?= =?iso-8859-1?q?/Rc2ZR7Nrsu6/70bZlOzvBrzflZ6gPoRMF4duwqs5lNS29KTpwugPtjf5mqv?= =?iso-8859-1?q?24jDsnYHeHukyrgIjRRUccRdM00q7Bn4DZgEmzC+gw2uAlgqa4LnPe5aVbSB?= =?iso-8859-1?q?7mKfc7k8xFZo22x176MjGTxo999OXK1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iso-8859-1?q?15LzTkV0FXDq64/eMhBRJmP/xU0bj/JvGypHqzFZgM/rxPYv8WaD9WdwnaAN?= =?iso-8859-1?q?QV/12snJOqFy7+a57ryD2jYA=3D=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)(366016)(1800799024)(376014)(7416014)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?+yE7kEiCWubG/HuibjQuE7C?= =?iso-8859-1?q?QXOXGYT7vcq5QnYy5zPfKjo2K5eEKvnxvmSVo1lYRIfMGYFBunxuWBnHz083?= =?iso-8859-1?q?ouaQJ56RnIUW2GohDu8RrSVmcuqHVWT+NnZiAwMYm9Xj2jhGXURMkqXKb8IN?= =?iso-8859-1?q?pSyp6gUHvCRX5BKjy3Oz4WQlLXFJrXCLsvQSS3Go42oObOlacYssfsHRdzqT?= =?iso-8859-1?q?gn2W0YL/ov/DagdeLlE7NMEKNfDSqjWmMnH3RQGjUK1oEJ3fH61px+LqWk6a?= =?iso-8859-1?q?CdCppjjtl4r82ts6OrIUV4xzRfD3d8obqS7efMtOMM3b0n/ek2w2zbeh4+jk?= =?iso-8859-1?q?e979aWuIAa7GMAEDaCZBNtD9q0dT6mhkpv1hopH6aV+Q01cSMiBVActEViy+?= =?iso-8859-1?q?O+s7gqqpx/pZeEp9QntJexjbxdt17Y+WP66IGBFC7AxuJaQuWUU6nhfjmdKt?= =?iso-8859-1?q?9ITvuvsu6UqS1I5VM05FCSxAulwlJxSTxm3lt0NIzQPE8jyOl4TBF4sx4xI8?= =?iso-8859-1?q?2ZfZN3OxxuRm4AerBEBE2sK+Dh2gniaHxWZHXY7xNCaraWmgGejW0Jux/rKi?= =?iso-8859-1?q?KR/XRj1l23ajHtYh6DljEiwIdAQxAXe+4i6F0YpsVvqzoEkzHuN6TW3e60Iv?= =?iso-8859-1?q?NxgO362qP5sNhJR6KIdXRsAm3At5qumWTsCiZDF/N9kXEQDYB7G6FpW7txNT?= =?iso-8859-1?q?7CCoDSBhs9VIdOqzEXGkYKBaaLhzfuZvevLqaViBGB2G6fY024lJrBJxwgmh?= =?iso-8859-1?q?iWQqNGFaJqHdFEALziAv04VwGUN91LnY/XnZwv8nKw0M5eFNkgl+3DpybNud?= =?iso-8859-1?q?5a6F5mahpVOGuWwoS22C6DAAR5Yb0fs8D3rqVPKp07gunRut/0TIHbY8IbE5?= =?iso-8859-1?q?ZAWvEgPst9UHwLxolobGSFN/yB+QFo6M7YNkTnOcgGelE9III39ajuHxrNfb?= =?iso-8859-1?q?JclvJklZasanyTZaUR92iVePGHVcwmzM4o5B17sbuycsmi2RQHeb6MV7v7aN?= =?iso-8859-1?q?hi9Lsg9pMm5pVjten3kasQDEn7QaCKsoEeo00LEm78sdVQQV7fm427ay9Rwh?= =?iso-8859-1?q?MOFtjoZMEUoiIJDa9+Vx1PsqlvLTnDoR9Rjht8KBwE7ASg9uOuOFn/kQub1k?= =?iso-8859-1?q?Qa+buUBLSon/mfJrCwsw7pVMPvgkapZu2k9pnPtwBkfeCdJxbTfLk4/3AcSD?= =?iso-8859-1?q?7W/VnuXDcpFcXzRhll5yc3XJ9zE4DOL0puG99waVVB0UOrbgTw8TP6r6CYOc?= =?iso-8859-1?q?7dybW0eHzoWuZ9svU8uRZByT7JlqVX44WfH0EQgkLE/E7TWLCiAX4pmtH0Y0?= =?iso-8859-1?q?P3JFdNjMK2S23SYFiEXvXxHvK7m82fXFDKkMfzXzvzmCTnjjj40Oqv72ENIz?= =?iso-8859-1?q?sTRh4AkD7llgKKXs0il8p7CdY6KBAxN/KQo7VJzdSotHn88pG42MHngRYt+p?= =?iso-8859-1?q?QnO3/ZYIIzd9ylFKQzOssB5Gs1/+7lcgK2SH5lrN5gxl8ZgV2WDh/UPjnDmZ?= =?iso-8859-1?q?CprLJGJ9Zi6ieAYFhQ4511mdE54z6HYI+5ZuYVwnalRn3z2YvwXoeDbgOUFX?= =?iso-8859-1?q?AqaiO3eFYC2nBoqJ6a6RrNpKBBUsBvCDzY1hOYNlKO00mHq7hPA4mRG5rKvL?= =?iso-8859-1?q?hjPWKNIKOVaw6nSstYcdGbem0AChTjFGqmH5VJQ=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: 29be2183-15ac-4292-1c9a-08dcc0817053 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Aug 2024 19:02:14.7426 (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: 0ZY+wTDM4zDXg+jhTttNq9dEtP5b5wNLR0h3Wf/y2Th0TqhCxKUwr7f40lEtO284VgvArxCzC4xsnoPpNYLDDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8P189MB1109 X-Patchwork-Delegate: kuba@kernel.org The TPS23880/1 has an active-low reset pin that some boards connect to the SoC to control when the TPS23880 is pulled out of reset. Add support for this via a reset-gpios property in the DTS. Signed-off-by: Kyle Swenson --- drivers/net/pse-pd/tps23881.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c index 2ea75686a319..837e1a2119ee 100644 --- a/drivers/net/pse-pd/tps23881.c +++ b/drivers/net/pse-pd/tps23881.c @@ -6,16 +6,16 @@ */ #include #include #include +#include #include #include #include #include #include - #define TPS23881_MAX_CHANS 8 #define TPS23881_REG_PW_STATUS 0x10 #define TPS23881_REG_OP_MODE 0x12 #define TPS23881_OP_MODE_SEMIAUTO 0xaaaa @@ -735,10 +735,11 @@ static int tps23881_flash_sram_fw(struct i2c_client *client) static int tps23881_i2c_probe(struct i2c_client *client) { struct device *dev = &client->dev; struct tps23881_priv *priv; + struct gpio_desc *reset; int ret; u8 val; if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { dev_err(dev, "i2c check functionality failed\n"); @@ -747,10 +748,20 @@ static int tps23881_i2c_probe(struct i2c_client *client) priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; + reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); + if (IS_ERR(reset)) + return dev_err_probe(&client->dev, PTR_ERR(reset), "Failed to get reset GPIO\n"); + + if (reset) { + usleep_range(1000, 10000); + gpiod_set_value_cansleep(reset, 0); /* De-assert reset */ + usleep_range(1000, 10000); + } + ret = i2c_smbus_read_byte_data(client, TPS23881_REG_DEVID); if (ret < 0) return ret; if (FIELD_GET(TPS23881_REG_DEVID_MASK, ret) != TPS23881_DEVICE_ID) {