From: Greg KH <gregkh@linuxfoundation.org>
To: Rajat Khandelwal <rajat.khandelwal@linux.intel.com>
Cc: heikki.krogerus@linux.intel.com, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] usb: typec: intel_pmc_mux: Expose IOM port status to debugfs
Date: Mon, 22 May 2023 08:37:59 +0100 [thread overview]
Message-ID: <2023052216-railway-zipfile-680f@gregkh> (raw)
In-Reply-To: <20230522070343.3675581-1-rajat.khandelwal@linux.intel.com>
On Mon, May 22, 2023 at 12:33:43PM +0530, Rajat Khandelwal wrote:
> IOM status has a crucial role during debugging to check the
> current state of the type-C port.
> There are ways to fetch the status, but all those require the
> IOM port status offset, which could change with platform.
>
> Make a debugfs directory for intel_pmc_mux and expose the status
> under it per port basis.
>
> Signed-off-by: Rajat Khandelwal <rajat.khandelwal@linux.intel.com>
> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
>
> v4:
> 1. Maintain a root directory for PMC module and incorporate devices
> under it
> 2. Add the debugfs module under '/sys/kernel/debug/usb'
> 3. Use the platform device 'pmc->dev' to assign the device's name
>
> v3: Allocate the debugfs directory name for the platform device with
> its ACPI dev name included
>
> v2:
> 1. Remove static declaration of the debugfs root for 'intel_pmc_mux'
> 2. Remove explicitly defined one-liner functions
>
> drivers/usb/typec/mux/intel_pmc_mux.c | 54 ++++++++++++++++++++++++++-
> 1 file changed, 53 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c
> index 34e4188a40ff..f400094c76f2 100644
> --- a/drivers/usb/typec/mux/intel_pmc_mux.c
> +++ b/drivers/usb/typec/mux/intel_pmc_mux.c
> @@ -15,6 +15,8 @@
> #include <linux/usb/typec_mux.h>
> #include <linux/usb/typec_dp.h>
> #include <linux/usb/typec_tbt.h>
> +#include <linux/debugfs.h>
> +#include <linux/usb.h>
>
> #include <asm/intel_scu_ipc.h>
>
> @@ -143,8 +145,14 @@ struct pmc_usb {
> struct acpi_device *iom_adev;
> void __iomem *iom_base;
> u32 iom_port_status_offset;
> +
> +#ifdef CONFIG_DEBUG_FS
> + struct dentry *dentry;
> +#endif
No need for the #ifdef anymore, right? In fact, I think it will break
the build if you have it this way and CONFIG_DEBUG_FS is not enabled,
right?
thanks,
greg k-h
next prev parent reply other threads:[~2023-05-22 7:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-22 7:03 [PATCH v4] usb: typec: intel_pmc_mux: Expose IOM port status to debugfs Rajat Khandelwal
2023-05-22 7:37 ` Greg KH [this message]
2023-05-22 9:54 ` Rajat Khandelwal
2023-05-22 16:26 ` Greg KH
2023-05-23 7:43 ` Rajat Khandelwal
2023-05-23 7:46 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2023052216-railway-zipfile-680f@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=rajat.khandelwal@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox