Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2311145rdb; Mon, 9 Oct 2023 23:01:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXqviyqdV1/geQgi3BK+RNM0dwPRiENn/MZa70np2me5eKFq5u9Aqc2nHQZyW2dp4kb6Ml X-Received: by 2002:a05:6e02:156b:b0:352:6fff:ccb2 with SMTP id k11-20020a056e02156b00b003526fffccb2mr21233266ilu.16.1696917690999; Mon, 09 Oct 2023 23:01:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696917690; cv=none; d=google.com; s=arc-20160816; b=SBI0Il9DW7CjFP+ZeCn0VqVqfGnXtZpkbgKlHofGrbRXj79sKgyTP4bjCepVP1h9uu Q2yxSysdUpCPag/RTCXulZASaXNiizxzM0R5AzGNo9t0IbhmPks9pp8Pgv/M2egBFt8+ UjZfcB8byl9X6ytTCnsFj7awc5uK2JysNS9cxUxU0itoUCJyWMFlb+rOKN1wkHMfxMfH zlE2g+ptF6XZ6JutsUH1Bc4B8UgHEs9PQ/R1SK/GDA6WYeB5AbC3yYPAM6LbSc8yfOew 1/VhFcLj7hOoGKfJJ/nZ/W0ImWxFpAgArLIEIUc+j7aOK+AgLbDCzFzQeEfPQYU0LT77 Payg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ddxgQAxDmAlkll5sPYif1xzbUWgh1N7fbCGVHQ8UvUY=; fh=4FTxD8y/AkqrxGSds7He/tgcu1K8JroTMbxcGH2DVaw=; b=ouF8Jc8qEAjlftSOGuQiPnSExnHS7TVDhCxp4qWzzK1qPUAte02RemoEiUkcuq2kHl /7BDimMsgkDSdSnSjAdkZ+WZuQj8M460OUMauwm9sIHPy7f+N0EH8e/mI7OJcOK45BGr X+TZbrCAcKxWFnMVJdIyEav73JN7d64Od3NWNnLYd/kQ4HzpdVjZIXFpPCo1Ws/ECsOT 5sCGyVZDeDVbsMNpPWd/51N4ZhQB9DeefhaEk1bJWdl+1946quK9Id1q80DvxM7fo6Ka jVuC6YGbb1PZPjyN99NsTRtaX/yzpCxLaYz65kMSwl5Ml8qNFB5PwQISzBElJwBcrAKE nFBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="KUCLIO/w"; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id u69-20020a637948000000b0057d08dac74csi10534231pgc.157.2023.10.09.23.01.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 23:01:30 -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=@intel.com header.s=Intel header.b="KUCLIO/w"; 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=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 5B96B807CF43; Mon, 9 Oct 2023 23:00:13 -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 S1442179AbjJJGAA (ORCPT + 99 others); Tue, 10 Oct 2023 02:00:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442161AbjJJF76 (ORCPT ); Tue, 10 Oct 2023 01:59:58 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6B129D; Mon, 9 Oct 2023 22:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696917597; x=1728453597; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=THINrPfpttlZRtTWFpoj0pkcWumqQenOCJ3YusrWSnM=; b=KUCLIO/wk+T0uB0xAoGDkqHCHf+MH1GWpdLTh69qJpI+uVvoSXGbJsM0 bll3jYLRvYrZVRiTw9ST9Vh2DK3OqIC5dg/bz5hvzG5VQ5iDLGu15ED+G Mu+s5OY1+xvOXx6v2iPaAaw6xkNjDYEINtgRGnH1bDm95yveTA6pkK4Cs ITgg8bvLLKZNTtTldqZJbDrNxi+gYW57aJZbtrv/x96vqCemga2hhY5al VL7RWst/SkcW5OUvXBDZai2P/ewPWVaCDep2EDCsfMesOSSpNtpKbnKFW edfBM1aIBLcBRYcNhcjIXB1sgv4g02BoNZ3XvKCB2fK818MgJjdICXbg+ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10858"; a="364610674" X-IronPort-AV: E=Sophos;i="6.03,211,1694761200"; d="scan'208";a="364610674" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2023 22:59:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10858"; a="788448551" X-IronPort-AV: E=Sophos;i="6.03,211,1694761200"; d="scan'208";a="788448551" Received: from kuha.fi.intel.com ([10.237.72.185]) by orsmga001.jf.intel.com with SMTP; 09 Oct 2023 22:59:51 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 10 Oct 2023 08:59:50 +0300 Date: Tue, 10 Oct 2023 08:59:50 +0300 From: Heikki Krogerus To: Abdel Alkuor Cc: krzysztof.kozlowski+dt@linaro.org, bryan.odonoghue@linaro.org, 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: Re: [PATCH v10 9/9] USB: typec: tps6598x: Add status trace for tps25750 Message-ID: References: <20231003155842.57313-1-alkuor@gmail.com> <20231003155842.57313-10-alkuor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231003155842.57313-10-alkuor@gmail.com> X-Spam-Status: No, score=2.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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]); Mon, 09 Oct 2023 23:00:13 -0700 (PDT) X-Spam-Level: ** On Tue, Oct 03, 2023 at 11:58:42AM -0400, Abdel Alkuor wrote: > From: Abdel Alkuor > > tps25750 status register is a subset of tps6598x status register, hence > a trace for tps25750 status register is added. > > Signed-off-by: Abdel Alkuor Reviewed-by: Heikki Krogerus > --- > Changes in v10: > - Move 0014-USB-typec-tps6598x-Add-status-trace-for-tps25750.patch to patch 9 > - Remove status trace prototype from device data > Changes in v9: > - No changes > Changes in v8: > - No changes > Changes in v7: > - Add driver name to commit subject > Changes in v6: > - No changes > Changes in v5: > - Incorporating tps25750 into tps6598x driver > drivers/usb/typec/tipd/core.c | 1 + > drivers/usb/typec/tipd/trace.h | 37 ++++++++++++++++++++++++++++++++++ > 2 files changed, 38 insertions(+) > > diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c > index 7bdf1ef5dd1a..0e867f531d34 100644 > --- a/drivers/usb/typec/tipd/core.c > +++ b/drivers/usb/typec/tipd/core.c > @@ -1412,6 +1412,7 @@ static const struct tipd_data tps25750_data = { > .irq_handler = tps25750_interrupt, > .register_port = tps25750_register_port, > .trace_power_status = trace_tps25750_power_status, > + .trace_status = trace_tps25750_status, > .apply_patch = tps25750_apply_patch, > }; > > diff --git a/drivers/usb/typec/tipd/trace.h b/drivers/usb/typec/tipd/trace.h > index 739b0a2a867d..0669cca12ea1 100644 > --- a/drivers/usb/typec/tipd/trace.h > +++ b/drivers/usb/typec/tipd/trace.h > @@ -91,6 +91,14 @@ > TPS_STATUS_USB_HOST_PRESENT_MASK | \ > TPS_STATUS_LEGACY_MASK)) > > +#define TPS25750_STATUS_FLAGS_MASK (GENMASK(31, 0) ^ (TPS_STATUS_CONN_STATE_MASK | \ > + GENMASK(19, 7) | \ > + TPS_STATUS_VBUS_STATUS_MASK | \ > + TPS_STATUS_USB_HOST_PRESENT_MASK | \ > + TPS_STATUS_LEGACY_MASK | \ > + BIT(26) | \ > + GENMASK(31, 28))) > + > #define show_status_conn_state(status) \ > __print_symbolic(TPS_STATUS_CONN_STATE((status)), \ > { TPS_STATUS_CONN_STATE_CONN_WITH_R_A, "conn-Ra" }, \ > @@ -148,6 +156,14 @@ > { TPS_STATUS_HIGH_VOLAGE_WARNING, "HIGH_VOLAGE_WARNING" }, \ > { TPS_STATUS_HIGH_LOW_VOLTAGE_WARNING, "HIGH_LOW_VOLTAGE_WARNING" }) > > +#define show_tps25750_status_flags(flags) \ > + __print_flags((flags & TPS25750_STATUS_FLAGS_MASK), "|", \ > + { TPS_STATUS_PLUG_PRESENT, "PLUG_PRESENT" }, \ > + { TPS_STATUS_PLUG_UPSIDE_DOWN, "UPSIDE_DOWN" }, \ > + { TPS_STATUS_PORTROLE, "PORTROLE" }, \ > + { TPS_STATUS_DATAROLE, "DATAROLE" }, \ > + { TPS_STATUS_BIST, "BIST" }) > + > #define show_power_status_source_sink(power_status) \ > __print_symbolic(TPS_POWER_STATUS_SOURCESINK(power_status), \ > { 1, "sink" }, \ > @@ -292,6 +308,27 @@ TRACE_EVENT(tps6598x_status, > ) > ); > > +TRACE_EVENT(tps25750_status, > + TP_PROTO(u32 status), > + TP_ARGS(status), > + > + TP_STRUCT__entry( > + __field(u32, status) > + ), > + > + TP_fast_assign( > + __entry->status = status; > + ), > + > + TP_printk("conn: %s, vbus: %s, usb-host: %s, legacy: %s, flags: %s", > + show_status_conn_state(__entry->status), > + show_status_vbus_status(__entry->status), > + show_status_usb_host_present(__entry->status), > + show_status_legacy(__entry->status), > + show_tps25750_status_flags(__entry->status) > + ) > +); > + > TRACE_EVENT(tps6598x_power_status, > TP_PROTO(u16 power_status), > TP_ARGS(power_status), > -- > 2.34.1 -- heikki