From nobody Sat Oct 4 01:39:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 308952D12F5; Thu, 21 Aug 2025 15:40:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755790804; cv=none; b=UCicCF6Ci/E5syCUSvCv8BBeMy/frewlMXUREt1+7oBLp+Aa7KSRi30q8iZyt+4okwNjyHer4br8Rq+m25lWBzDEpAii6FKgc9kryiujmD8l+DgFW0FQOB55oKXhijQVZnCcsH4NLfb97ux3ZJ5mscaIivi1FBnFPpPOOB0W6BM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755790804; c=relaxed/simple; bh=eKL7OgN/DvasHSMHY1JVLFsa5OJf2n5Y1v/SsiTf9mc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MwYMMNHprUseE9fKqwO4dbl6cBBbDRZ1rZVkYu1FyesjmXy5+4C9f0OcCjLjBX8aN1p26drWbdrS+hYVO+7W1M5AjtIEl6+4STLM1s3T+HMZgeRTJjr1+VH0cbslABA8XvPdy2jjRZH7mynWWJVz4nhez4eqIuW54BOuvmpRvTc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qRY2mg5G; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qRY2mg5G" Received: by smtp.kernel.org (Postfix) with ESMTPS id 905CEC4CEED; Thu, 21 Aug 2025 15:40:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755790803; bh=eKL7OgN/DvasHSMHY1JVLFsa5OJf2n5Y1v/SsiTf9mc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qRY2mg5GQkc65Ta4lI85H18iIpKkwg1ta0TR9yxaUtoRjMF0NWhL9VIQdFBSNCHPN y6vmxLbthe0oKnuSV5JD8lcORuypR67ewqJvNKj4RwW6Rcrljdk1j/Kwqt6VPZM+XO sdVqHx+/NZ7V8cJizDZN2aVesdXJiaD6VRO4iIhPAFj60NYQXJ6KREYac/L/lQg8g2 DEJV414dmCSB5MoNOYV/c+hvkvoxa4sDKgYQGyjKGjdVvH9qM5I1BtrIwjcZCynVmw Ax2HmTTYSPjarUP49NbkoGOZaAh0mCcqUERebuTQ3DLAu/GO2VbQDYYQu/NXJWNz77 1mee46CiPDw/Q== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87C89CA0EFC; Thu, 21 Aug 2025 15:40:03 +0000 (UTC) From: Sven Peter Date: Thu, 21 Aug 2025 15:39:01 +0000 Subject: [PATCH RFC 09/22] usb: typec: tipd: Move initial irq mask to tipd_data Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250821-atcphy-6-17-v1-9-172beda182b8@kernel.org> References: <20250821-atcphy-6-17-v1-0-172beda182b8@kernel.org> In-Reply-To: <20250821-atcphy-6-17-v1-0-172beda182b8@kernel.org> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Felipe Balbi , Janne Grunau , Alyssa Rosenzweig , Neal Gompa , Vinod Koul , Kishon Vijay Abraham I , Thinh Nguyen , Heikki Krogerus , Philipp Zabel Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, Sven Peter X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3168; i=sven@kernel.org; h=from:subject:message-id; bh=eKL7OgN/DvasHSMHY1JVLFsa5OJf2n5Y1v/SsiTf9mc=; b=owGbwMvMwCHmIlirolUq95LxtFoSQ8Zy29X37j8tXW0dVX/4fuKD1QwXrzTmbLzzSqfre/7cg ANRd7KLOkpZGMQ4GGTFFFm277c3ffLwjeDSTZfew8xhZQIZwsDFKQAT+WXMyPDlg+aeFWmbFnVG VHzKC/6to/fT4O6yrr6O3/yLxauu3w1j+CvEr+Aj/2KZ2tLtriqpZ9n6f6mfi3gnvSNV+u7/tPO +CewA X-Developer-Key: i=sven@kernel.org; a=openpgp; fpr=A1E3E34A2B3C820DBC4955E5993B08092F131F93 X-Endpoint-Received: by B4 Relay for sven@kernel.org/default with auth_id=407 Since the irq mask was originally added more tipd variants have been introduced and there's now struct tipd_data. Move the initial mask in there. Signed-off-by: Sven Peter Reviewed-by: Heikki Krogerus --- drivers/usb/typec/tipd/core.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 1c80296c3b273e24ceacb3feff432c4f6e6835cc..6d8bcbc9cad8a1394e066504d4c= 5ca570edd4e4f 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -112,6 +112,7 @@ struct tps6598x; =20 struct tipd_data { irq_handler_t irq_handler; + u64 irq_mask1; int (*register_port)(struct tps6598x *tps, struct fwnode_handle *node); void (*trace_power_status)(u16 status); void (*trace_status)(u32 status); @@ -1298,7 +1299,6 @@ static int tps6598x_probe(struct i2c_client *client) u32 status; u32 vid; int ret; - u64 mask1; =20 tps =3D devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); if (!tps) @@ -1337,16 +1337,6 @@ static int tps6598x_probe(struct i2c_client *client) if (ret) return ret; =20 - /* CD321X chips have all interrupts masked initially */ - mask1 =3D APPLE_CD_REG_INT_POWER_STATUS_UPDATE | - APPLE_CD_REG_INT_DATA_STATUS_UPDATE | - APPLE_CD_REG_INT_PLUG_EVENT; - - } else { - /* Enable power status, data status and plug event interrupts */ - mask1 =3D TPS_REG_INT_POWER_STATUS_UPDATE | - TPS_REG_INT_DATA_STATUS_UPDATE | - TPS_REG_INT_PLUG_EVENT; } =20 tps->data =3D i2c_get_match_data(client); @@ -1364,7 +1354,7 @@ static int tps6598x_probe(struct i2c_client *client) return ret; } =20 - ret =3D tps6598x_write64(tps, TPS_REG_INT_MASK1, mask1); + ret =3D tps6598x_write64(tps, TPS_REG_INT_MASK1, tps->data->irq_mask1); if (ret) goto err_reset_controller; =20 @@ -1527,6 +1517,9 @@ static const struct dev_pm_ops tps6598x_pm_ops =3D { =20 static const struct tipd_data cd321x_data =3D { .irq_handler =3D cd321x_interrupt, + .irq_mask1 =3D APPLE_CD_REG_INT_POWER_STATUS_UPDATE | + APPLE_CD_REG_INT_DATA_STATUS_UPDATE | + APPLE_CD_REG_INT_PLUG_EVENT, .register_port =3D tps6598x_register_port, .trace_power_status =3D trace_tps6598x_power_status, .trace_status =3D trace_tps6598x_status, @@ -1536,6 +1529,9 @@ static const struct tipd_data cd321x_data =3D { =20 static const struct tipd_data tps6598x_data =3D { .irq_handler =3D tps6598x_interrupt, + .irq_mask1 =3D TPS_REG_INT_POWER_STATUS_UPDATE | + TPS_REG_INT_DATA_STATUS_UPDATE | + TPS_REG_INT_PLUG_EVENT, .register_port =3D tps6598x_register_port, .trace_power_status =3D trace_tps6598x_power_status, .trace_status =3D trace_tps6598x_status, @@ -1546,6 +1542,9 @@ static const struct tipd_data tps6598x_data =3D { =20 static const struct tipd_data tps25750_data =3D { .irq_handler =3D tps25750_interrupt, + .irq_mask1 =3D TPS_REG_INT_POWER_STATUS_UPDATE | + TPS_REG_INT_DATA_STATUS_UPDATE | + TPS_REG_INT_PLUG_EVENT, .register_port =3D tps25750_register_port, .trace_power_status =3D trace_tps25750_power_status, .trace_status =3D trace_tps25750_status, --=20 2.34.1