All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Neil Armstrong <neil.armstrong@linaro.org>,
	 Bjorn Andersson <andersson@kernel.org>,
	 Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-arm-msm@vger.kernel.org,
	 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Subject: [PATCH 6/8] usb: typec: ucsi: add ucsi_registered() callback
Date: Tue, 16 Apr 2024 05:20:55 +0300	[thread overview]
Message-ID: <20240416-ucsi-glink-altmode-v1-6-890db00877ac@linaro.org> (raw)
In-Reply-To: <20240416-ucsi-glink-altmode-v1-0-890db00877ac@linaro.org>

As the registration of the UCSI device is performed from the scheduled
worker, the glue driver isn't notified when the UCSI registration
succeeds. The ucsi_glink driver needs this event to be able to manually
register DisplayPort altmodes.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/usb/typec/ucsi/ucsi.c | 3 +++
 drivers/usb/typec/ucsi/ucsi.h | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index cb52e7b0a2c5..ae89c4c8341d 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -1755,6 +1755,9 @@ static int ucsi_init(struct ucsi *ucsi)
 	if (UCSI_CCI_CONNECTOR(cci))
 		ucsi_connector_change(ucsi, UCSI_CCI_CONNECTOR(cci));
 
+	if (ucsi->ops->ucsi_registered)
+		ucsi->ops->ucsi_registered(ucsi);
+
 	return 0;
 
 err_unregister:
diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h
index c4d103db9d0f..37ee1b1d8c31 100644
--- a/drivers/usb/typec/ucsi/ucsi.h
+++ b/drivers/usb/typec/ucsi/ucsi.h
@@ -62,6 +62,7 @@ struct dentry;
  * @update_altmodes: Squashes duplicate DP altmodes
  * @update_connector: Update connector capabilities before registering
  * @connector_status: Updates connector status, called holding connector lock
+ * @ucsi_registered: notify host driver when the UCSI interface is registered
  *
  * Read and write routines for UCSI interface. @sync_write must wait for the
  * Command Completion Event from the PPM before returning, and @async_write must
@@ -78,6 +79,7 @@ struct ucsi_operations {
 				struct ucsi_altmode *updated);
 	void (*update_connector)(struct ucsi_connector *con);
 	void (*connector_status)(struct ucsi_connector *con);
+	void (*ucsi_registered)(struct ucsi *ucsi);
 };
 
 struct ucsi *ucsi_create(struct device *dev, const struct ucsi_operations *ops);

-- 
2.39.2


  parent reply	other threads:[~2024-04-16  2:21 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16  2:20 [PATCH 0/8] usb: typec: ucsi: glink: merge in altmode support Dmitry Baryshkov
2024-04-16  2:20 ` [PATCH 1/8] usb: typec: Handle retimers in typec_set_mode() Dmitry Baryshkov
2024-04-16 14:30   ` Konrad Dybcio
2024-04-16 17:26   ` Neil Armstrong
2024-04-22  8:00   ` Heikki Krogerus
2024-04-16  2:20 ` [PATCH 2/8] usb: typec: altmode: add low level altmode configuration helper Dmitry Baryshkov
2024-04-16 14:32   ` Konrad Dybcio
2024-04-16 14:48     ` Dmitry Baryshkov
2024-04-16 14:57       ` Konrad Dybcio
2024-04-16 15:20         ` Dmitry Baryshkov
2024-04-16  2:20 ` [PATCH 3/8] usb: typec: ucsi: glink: check message data sizes Dmitry Baryshkov
2024-04-16 14:33   ` Konrad Dybcio
2024-04-16 14:49     ` Dmitry Baryshkov
2024-04-16  2:20 ` [PATCH 4/8] usb: typec: ucsi: glink: use le32 for message data Dmitry Baryshkov
2024-04-16 14:34   ` Konrad Dybcio
2024-04-16 17:28   ` Neil Armstrong
2024-04-22 10:29   ` Heikki Krogerus
2024-04-16  2:20 ` [PATCH 5/8] usb: typec: ucsi: glink: simplify notification handling Dmitry Baryshkov
2024-04-16 14:36   ` Konrad Dybcio
2024-04-16 15:15     ` Dmitry Baryshkov
2024-04-16  2:20 ` Dmitry Baryshkov [this message]
2024-04-16  2:20 ` [PATCH 7/8] usb: typec: ucsi: glink: merge pmic_glink_altmode driver Dmitry Baryshkov
2024-04-22 10:59   ` Heikki Krogerus
2024-04-22 12:45     ` Dmitry Baryshkov
2024-04-22 15:02       ` Heikki Krogerus
2024-04-22 15:22         ` Dmitry Baryshkov
2024-05-04  6:49         ` Dmitry Baryshkov
2024-05-15 15:01           ` Dmitry Baryshkov
2024-05-16  8:18             ` Heikki Krogerus
2024-04-16  2:20 ` [PATCH 8/8] soc: qcom: pmic-glink: drop separate altmode driver support Dmitry Baryshkov

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=20240416-ucsi-glink-altmode-v1-6-890db00877ac@linaro.org \
    --to=dmitry.baryshkov@linaro.org \
    --cc=andersson@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=neil.armstrong@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.