From patchwork Tue Oct 3 15:58:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abdel Alkuor X-Patchwork-Id: 147986 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp2185889vqb; Tue, 3 Oct 2023 09:02:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IERZW6ZMurD9c8GGJbSNZB/A0rFhjxh390B4xzFvVUdRD7YIptj6bYPKRqiIkFrvolkzstz X-Received: by 2002:a17:903:32c6:b0:1c4:3ae6:381a with SMTP id i6-20020a17090332c600b001c43ae6381amr94212plr.0.1696348940313; Tue, 03 Oct 2023 09:02:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696348940; cv=none; d=google.com; s=arc-20160816; b=eIOdlhWEep7uCjmo5pFoMIczl3HcCmDSSIG9HF9iuCPw+wtIJLj4fSCEaohIQdX49E YgMXphZNDKOLU/aeY7F6jHA6i/YXhU1u9z+4Mkoqz0Dc4Sv1sId375ysDenCbDjoIvbY SpEFB+ZE5OZaG7Yq8KGnO+lXIKzBhBNVLkC6F3BFjI9EeaTkk3iAXW5rsckAoiba3YmU pzRuqeSz/dZ/teaF5mBzRbboXI4TamZ0zRYP1AaDsqj5Hy4klLRrzLukhqDk3STgwWWk N8W/cp3pVusRQNi3GSrmK58MINeNCiVTB4jOGbwvRov1bP8qVgOI00wBmBaKFc4KNPbk GxPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=foHavn1yNGCukcn3QtzQJjXudL1xRCClcudMiYe9+Bw=; fh=NDkcCmflgZsGSiSjskszThji4SYIrQ1hJIxt3Zy9sPE=; b=k3I7Sl4u1w05WtZWj6yl7U4IPiO7o3+Q7KEdoZz/3DilZ7At8jnPyB5mS9WzLnLL3p gtqj1qtQnt9J1qz4KWCTe4xYYWHncifQDQ4r38zJvnLAq4RycdgQA6GvZ9e37FPJwuQn brH5kB7hzNe0OExYqABlfFdwcAmqPbBnrvl0uX0KxlcIEBzF4KfOUPaNcdJXvimnIeDR 6XUjUJCIDbmizi+71MV2kFpufX2jvcBWIP3lPDWYm3xriCilVWXE5YIEU9HFCpWrLY4y DisDNkKOi0Ii4MV9BfXgBJONYsCqVM6fCDxKvyqIoFVmDVKO/VtKqMRAgCZ9peYLydVh MwKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NFhAS0QT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id l18-20020a170902e2d200b001c72d694ec7si1530163plc.328.2023.10.03.09.02.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 09:02:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NFhAS0QT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 8C7978145570; Tue, 3 Oct 2023 09:02:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240405AbjJCQBZ (ORCPT + 17 others); Tue, 3 Oct 2023 12:01:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240287AbjJCQBQ (ORCPT ); Tue, 3 Oct 2023 12:01:16 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F32D136; Tue, 3 Oct 2023 09:01:04 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-533d6a8d6b6so1981083a12.2; Tue, 03 Oct 2023 09:01:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696348862; x=1696953662; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=foHavn1yNGCukcn3QtzQJjXudL1xRCClcudMiYe9+Bw=; b=NFhAS0QTARZ4dBdFNTa55+Lz/zo+YOgYjozBzmpL5qc3YRG1cY8/Ja8l60EXphpidr YXZxHwfuYqVjp6no/FBB4ZTBIz8afc84WQ3MOam77hpyDWB4G8HW13wOUIBQ1DD/DwUi p5dqTaom0QmedaxAQDX4Ku+Yq9bqnS/WXbvG+DxJRnGT2LEfetO76qA2JZZuUWUJL6uN AylvW/L7lz+Er4lupcdYFXkOjyTKvMPNjlP/VlB6WZp0gPZcQ2hCIg065xIujJq6Ftj1 LFMkZGdX7WKJbxBDgAOS7L7jV9Dx3Ems2MUHkhxyEnXm4HBfUVi6RWbeGzmYKLsDnFYj MFGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696348862; x=1696953662; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=foHavn1yNGCukcn3QtzQJjXudL1xRCClcudMiYe9+Bw=; b=AmPgmhpwwtTxs9wKhnXpr5ioXuDcwcQH5CtCetnlpvQb4c6iiKiD0BbWvN5cxi81w6 GogvHf5+DvRnR5xSR5UhrisBbKb0P9Rem4bvtUAkw2MYHrqvjUqtXdCc/rYbG7P05NJk Ln4ZIWQlFnu4G3gihxGWJ+bJn8XDO7jo9Lgbf61nutAZav4mQks+E5QLEoXirmF5GZS0 2sRrryW8WypbpbmQSCzHlAyzI8Kx56AShtMba1amdpzRGpTANEza+tmHvx/rnWBW4Cqh FYT8p33nrcPH5sV7Gzhjlt9EUcBLDlZcm6wp52gDqsVkZAeBJ+4vJQCy3nZ2SVPOJ7rM c1yQ== X-Gm-Message-State: AOJu0YwyhnYYGkSL344mJaY5Scz1gr71fIlz+ikdJLqMUdsDbXsGQkyn NNhN5MZWOfjD19PJJi4FulU= X-Received: by 2002:a17:906:30cd:b0:9a9:e3be:1310 with SMTP id b13-20020a17090630cd00b009a9e3be1310mr11806623ejb.53.1696348862442; Tue, 03 Oct 2023 09:01:02 -0700 (PDT) Received: from primary.. ([213.139.52.198]) by smtp.gmail.com with ESMTPSA id jo3-20020a170906f6c300b0099df2ddfc37sm1270526ejb.165.2023.10.03.09.01.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 09:01:02 -0700 (PDT) From: Abdel Alkuor To: heikki.krogerus@linux.intel.com, krzysztof.kozlowski+dt@linaro.org, bryan.odonoghue@linaro.org Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, ryan.eleceng@gmail.com, robh+dt@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org, Abdel Alkuor Subject: [PATCH v10 7/9] USB: typec: tps6598x: Add trace for tps25750 irq Date: Tue, 3 Oct 2023 11:58:40 -0400 Message-Id: <20231003155842.57313-8-alkuor@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231003155842.57313-1-alkuor@gmail.com> References: <20231003155842.57313-1-alkuor@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 03 Oct 2023 09:02:01 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778750786750924439 X-GMAIL-MSGID: 1778750786750924439 From: Abdel Alkuor tps25750 event1 register doesn't have all bits in tps6598x event registers, only show the events that are masked Signed-off-by: Abdel Alkuor Reviewed-by: Heikki Krogerus --- Changes in v10: - Move 0012-USB-typec-tps6598x-Add-trace-for-tps25750-irq.patch to patch 7 Changes in v9: - No changes Changes in v8: - Use device_is_compatible instead of of_device_is_compatible Changes in v7: - Add driver name to commit subject Changes in v6: - Check tps25750 using is_compatiable device node Changes in v5: - Incorporating tps25750 into tps6598x driver drivers/usb/typec/tipd/core.c | 1 + drivers/usb/typec/tipd/trace.h | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 892432ad80a3..e0ff6fc9f256 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -589,6 +589,7 @@ static irqreturn_t tps25750_interrupt(int irq, void *data) dev_err(tps->dev, "%s: failed to read events\n", __func__); goto err_unlock; } + trace_tps25750_irq(event[0]); if (!(event[0] | event[1])) goto err_unlock; diff --git a/drivers/usb/typec/tipd/trace.h b/drivers/usb/typec/tipd/trace.h index 12cad1bde7cc..28725234a2d8 100644 --- a/drivers/usb/typec/tipd/trace.h +++ b/drivers/usb/typec/tipd/trace.h @@ -74,6 +74,13 @@ { APPLE_CD_REG_INT_DATA_STATUS_UPDATE, "DATA_STATUS_UPDATE" }, \ { APPLE_CD_REG_INT_STATUS_UPDATE, "STATUS_UPDATE" }) +#define show_tps25750_irq_flags(flags) \ + __print_flags_u64(flags, "|", \ + { TPS_REG_INT_PLUG_EVENT, "PLUG_EVENT" }, \ + { TPS_REG_INT_POWER_STATUS_UPDATE, "POWER_STATUS_UPDATE" }, \ + { TPS_REG_INT_STATUS_UPDATE, "STATUS_UPDATE" }, \ + { TPS_REG_INT_PD_STATUS_UPDATE, "PD_STATUS_UPDATE" }) + #define TPS6598X_STATUS_FLAGS_MASK (GENMASK(31, 0) ^ (TPS_STATUS_CONN_STATE_MASK | \ TPS_STATUS_PP_5V0_SWITCH_MASK | \ TPS_STATUS_PP_HV_SWITCH_MASK | \ @@ -230,6 +237,21 @@ TRACE_EVENT(cd321x_irq, show_cd321x_irq_flags(__entry->event)) ); +TRACE_EVENT(tps25750_irq, + TP_PROTO(u64 event), + TP_ARGS(event), + + TP_STRUCT__entry( + __field(u64, event) + ), + + TP_fast_assign( + __entry->event = event; + ), + + TP_printk("event=%s", show_tps25750_irq_flags(__entry->event)) +); + TRACE_EVENT(tps6598x_status, TP_PROTO(u32 status), TP_ARGS(status),