Linux-PHY Archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@gmail.com>
To: Stanley Chang <stanley_chang@realtek.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Vinod Koul" <vkoul@kernel.org>,
	"Johan Hovold" <johan@kernel.org>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Jinjie Ruan" <ruanjinjie@huawei.com>,
	"Rob Herring" <robh@kernel.org>,
	"Alan Stern" <stern@rowland.harvard.edu>,
	"Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
	"Flavio Suligoi" <f.suligoi@asem.it>,
	"Ricardo Cañuelo" <ricardo.canuelo@collabora.com>,
	linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH v3 RESEND 1/4] phy: core: add notify_connect and notify_disconnect callback
Date: Thu, 7 Dec 2023 11:54:29 +0300	[thread overview]
Message-ID: <c0af54de-2664-4c20-2d01-7fc64c98b238@gmail.com> (raw)
In-Reply-To: <20231207074022.14116-1-stanley_chang@realtek.com>

On 12/7/23 10:38 AM, Stanley Chang wrote:

> In Realtek SoC, the parameter of usb phy is designed to can dynamic
> tuning base on port status. Therefore, add a notify callback of phy

   To be able to do dynamic tuning based in the port status, maybe?

> driver when usb connection/disconnection change.
> 
> Signed-off-by: Stanley Chang <stanley_chang@realtek.com>
[...]
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index 96a0b1e111f3..a84ad4896b7f 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -489,6 +489,53 @@ int phy_calibrate(struct phy *phy)
>  }
>  EXPORT_SYMBOL_GPL(phy_calibrate);
>  
> +/**
> + * phy_notify_connect() - phy connect notify

   Notification?

> + * @phy: the phy returned by phy_get()
> + * @port: the port index for connect
> + *
> + * If phy need the get connection status, the callback can be used.

   If the PHY needs to get the connection status, maybe?

> + * Returns: %0 if successful, a negative error code otherwise
> + */
> +int phy_notify_connect(struct phy *phy, int port)
> +{
> +	int ret;
> +
> +	if (!phy || !phy->ops->connect)
> +		return 0;
> +
> +	mutex_lock(&phy->mutex);
> +	ret = phy->ops->connect(phy, port);
> +	mutex_unlock(&phy->mutex);
> +
> +	return ret;
> +}
> +EXPORT_SYMBOL_GPL(phy_notify_connect);
> +
> +/**
> + * phy_notify_disconnect() - phy disconnect notify

   Notification?

> + * @phy: the phy returned by phy_get()
> + * @port: the port index for disconnect
> + *
> + * If phy need the get disconnection status, the callback can be used.

   If the PHY needs to get the connection status, maybe?

[...]
> diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
> index f6d607ef0e80..cf98cb29ddaa 100644
> --- a/include/linux/phy/phy.h
> +++ b/include/linux/phy/phy.h
[...]

MBR, Sergey

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

       reply	other threads:[~2023-12-07  8:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20231207074022.14116-1-stanley_chang@realtek.com>
2023-12-07  8:54 ` Sergei Shtylyov [this message]
2023-12-07 10:02 ` [PATCH v3 RESEND 1/4] phy: core: add notify_connect and notify_disconnect callback Greg Kroah-Hartman
     [not found] ` <20231207074022.14116-4-stanley_chang@realtek.com>
2023-12-07 10:08   ` [PATCH v3 RESEND 4/4] usb: core: add phy notify connect and disconnect Greg Kroah-Hartman

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=c0af54de-2664-4c20-2d01-7fc64c98b238@gmail.com \
    --to=sergei.shtylyov@gmail.com \
    --cc=f.suligoi@asem.it \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=johan@kernel.org \
    --cc=kishon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ricardo.canuelo@collabora.com \
    --cc=robh@kernel.org \
    --cc=ruanjinjie@huawei.com \
    --cc=stanley_chang@realtek.com \
    --cc=stern@rowland.harvard.edu \
    --cc=vkoul@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).