From: Guenter Roeck <linux@roeck-us.net>
To: Badhri Jagan Sridharan <badhri@google.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Kyle Tso <kyletso@google.com>
Subject: Re: [PATCH v1 4/4] usb: typec: maxim_contaminant: Implement check_contaminant callback
Date: Tue, 30 Aug 2022 10:55:23 -0700 [thread overview]
Message-ID: <20220830175523.GA239841@roeck-us.net> (raw)
In-Reply-To: <20220826084001.3341215-4-badhri@google.com>
On Fri, Aug 26, 2022 at 01:40:01AM -0700, Badhri Jagan Sridharan wrote:
> Maxim TCPC has additional ADCs and low current(1ua) current source
> to measure the impedance of CC and SBU pins. When tcpm invokes
> the check_contaminant callback, Maxim TCPC measures the impedance
> of the CC & SBU pins and when the impedance measured is less than
> 1MOhm, it is assumed that USB-C port is contaminated. CC comparators
> are also checked to differentiate between presence of sink and
> contaminant. Once USB-C is deemed to be contaminated, MAXIM TCPC
> has additional hardware to disable normal DRP toggling cycle and
> enable 1ua on CC pins once every 2.4secs/4.8secs. Maxim TCPC
> interrupts AP once the impedance on the CC pin is above the
> 1MOhm threshold. The Maxim tcpc driver then signals TCPM_PORT_CLEAN
> to restart toggling.
>
> Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
> ---
> drivers/usb/typec/tcpm/Makefile | 2 +-
> drivers/usb/typec/tcpm/maxim_contaminant.c | 338 +++++++++++++++++++++
> drivers/usb/typec/tcpm/tcpci_maxim.c | 34 ++-
> drivers/usb/typec/tcpm/tcpci_maxim.h | 68 +++++
> 4 files changed, 429 insertions(+), 13 deletions(-)
> create mode 100644 drivers/usb/typec/tcpm/maxim_contaminant.c
> create mode 100644 drivers/usb/typec/tcpm/tcpci_maxim.h
>
> diff --git a/drivers/usb/typec/tcpm/Makefile b/drivers/usb/typec/tcpm/Makefile
> index 906d9dced8e7..81e4e9421fa0 100644
> --- a/drivers/usb/typec/tcpm/Makefile
> +++ b/drivers/usb/typec/tcpm/Makefile
> @@ -7,4 +7,4 @@ obj-$(CONFIG_TYPEC_TCPCI) += tcpci.o
> obj-$(CONFIG_TYPEC_RT1711H) += tcpci_rt1711h.o
> obj-$(CONFIG_TYPEC_MT6360) += tcpci_mt6360.o
> obj-$(CONFIG_TYPEC_TCPCI_MT6370) += tcpci_mt6370.o
> -obj-$(CONFIG_TYPEC_TCPCI_MAXIM) += tcpci_maxim.o
> +obj-$(CONFIG_TYPEC_TCPCI_MAXIM) += tcpci_maxim.o maxim_contaminant.o
This creates two separate modules, which doesn't really add any value.
I would suggest to adjust the file names and create a single module
named tcpci_maxim instead. Renaming tcpci_maxim.c to, say,
tcpci_maxim_core.c and
obj-$(CONFIG_TYPEC_TCPCI_MAXIM) += tcpci_maxim.o
tcpci_maxim-y := tcpci_maxim_core.o maxim_contaminant.o
should do. This would also avoid the need for exporting symbols
from tcpci_maxim.c.
Thanks,
Guenter
next prev parent reply other threads:[~2022-08-30 17:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-26 8:39 [PATCH v1 1/4] usb: typec: tcpm: Add callbacks to mitigate wakeups due to contaminant Badhri Jagan Sridharan
2022-08-26 8:39 ` [PATCH v1 2/4] usb: typec: tcpci: Add callback for evaluating contaminant presence Badhri Jagan Sridharan
2022-08-26 8:40 ` [PATCH v1 3/4] usb: typec: tcpci_maxim: Export helper function for register reads Badhri Jagan Sridharan
2022-08-30 10:57 ` Heikki Krogerus
2022-08-30 13:00 ` Greg Kroah-Hartman
2022-08-31 0:20 ` Badhri Jagan Sridharan
2022-08-26 8:40 ` [PATCH v1 4/4] usb: typec: maxim_contaminant: Implement check_contaminant callback Badhri Jagan Sridharan
2022-08-30 17:55 ` Guenter Roeck [this message]
2022-08-31 0:22 ` Badhri Jagan Sridharan
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=20220830175523.GA239841@roeck-us.net \
--to=linux@roeck-us.net \
--cc=badhri@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=kyletso@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/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