[PATCH v2 14/22] usb: typec: tipd: Read data status in probe and cache its value
Heikki Krogerus
heikki.krogerus at linux.intel.com
Tue Sep 9 03:03:00 PDT 2025
On Tue, Sep 09, 2025 at 01:02:13PM +0300, Heikki Krogerus wrote:
> On Sat, Sep 06, 2025 at 03:43:27PM +0000, Sven Peter wrote:
> > From: Hector Martin <marcan at marcan.st>
> >
> > Just like for power status we also need to keep track of data status to
> > be able to detect mode changes once we introduce de-bouncing for CD321x.
> > Read it during probe and keep a cached copy of its value.
> >
> > Signed-off-by: Hector Martin <marcan at marcan.st>
> > Signed-off-by: Sven Peter <sven at kernel.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus at linux.intel.com>
> > ---
> > drivers/usb/typec/tipd/core.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
> > index e6e9730ee6dacd8c1271b1d52a02da49ff248d3e..b558fc5ecbc35a9dabbf33c444f38173740af7c3 100644
> > --- a/drivers/usb/typec/tipd/core.c
> > +++ b/drivers/usb/typec/tipd/core.c
> > @@ -176,6 +176,7 @@ struct tps6598x {
> >
> > int wakeup;
> > u32 status; /* status reg */
> > + u32 data_status;
> > u16 pwr_status;
> > struct delayed_work wq_poll;
> >
> > @@ -538,6 +539,7 @@ static bool tps6598x_read_data_status(struct tps6598x *tps)
> > dev_err(tps->dev, "failed to read data status: %d\n", ret);
> > return false;
> > }
> > + tps->data_status = data_status;
> >
> > if (tps->data->trace_data_status)
> > tps->data->trace_data_status(data_status);
> > @@ -1551,6 +1553,8 @@ static int tps6598x_probe(struct i2c_client *client)
> > if (status & TPS_STATUS_PLUG_PRESENT) {
> > if (!tps6598x_read_power_status(tps))
> > goto err_unregister_port;
> > + if (!tps->data->read_data_status(tps))
> > + goto err_unregister_port;
> > ret = tps6598x_connect(tps, status);
> > if (ret)
> > dev_err(&client->dev, "failed to register partner\n");
> >
> > --
> > 2.34.1
> >
>
> --
> heikki
--
heikki
More information about the linux-arm-kernel
mailing list