From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Oliver Facklam <oliver.facklam@zuehlke.com>
Cc: Biju Das <biju.das@bp.renesas.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Benedict von Heyl <benedict.vonheyl@zuehlke.com>,
Mathis Foerst <mathis.foerst@zuehlke.com>,
Michael Glettig <michael.glettig@zuehlke.com>
Subject: Re: [PATCH v2 2/4] usb: typec: hd3ss3220: use typec_get_fw_cap() to fill typec_cap
Date: Mon, 18 Nov 2024 12:03:56 +0200 [thread overview]
Message-ID: <ZzsRDK_9LZLs8Hf3@kuha.fi.intel.com> (raw)
In-Reply-To: <20241114-usb-typec-controller-enhancements-v2-2-362376856aea@zuehlke.com>
On Thu, Nov 14, 2024 at 09:02:07AM +0100, Oliver Facklam wrote:
> The type, data, and prefer_role properties were previously hard-coded
> when creating the struct typec_capability.
>
> Use typec_get_fw_cap() to populate these fields based on the
> respective fwnode properties, if present.
>
> Signed-off-by: Oliver Facklam <oliver.facklam@zuehlke.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/hd3ss3220.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/hd3ss3220.c b/drivers/usb/typec/hd3ss3220.c
> index 56f74bf70895ca701083bde44a5bbe0b691551e1..e581272bb47de95dee8363a5491f543354fcbbf8 100644
> --- a/drivers/usb/typec/hd3ss3220.c
> +++ b/drivers/usb/typec/hd3ss3220.c
> @@ -264,7 +264,14 @@ static int hd3ss3220_probe(struct i2c_client *client)
> typec_cap.type = TYPEC_PORT_DRP;
> typec_cap.data = TYPEC_PORT_DRD;
> typec_cap.ops = &hd3ss3220_ops;
> - typec_cap.fwnode = connector;
> +
> + /*
> + * Try to get properties from connector,
> + * but continue with defaults anyway if they are not found
> + */
> + ret = typec_get_fw_cap(&typec_cap, connector);
> + if (ret != 0 && ret != -EINVAL && ret != -ENXIO)
> + goto err_put_role;
>
> hd3ss3220->port = typec_register_port(&client->dev, &typec_cap);
> if (IS_ERR(hd3ss3220->port)) {
>
> --
> 2.34.1
--
heikki
next prev parent reply other threads:[~2024-11-18 10:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-14 8:02 [PATCH v2 0/4] usb: typec: hd3ss3220: enhance driver with port type, power opmode, and role preference settings Oliver Facklam
2024-11-14 8:02 ` [PATCH v2 1/4] usb: typec: hd3ss3220: configure advertised power opmode based on fwnode property Oliver Facklam
2024-11-18 10:02 ` Heikki Krogerus
2024-11-14 8:02 ` [PATCH v2 2/4] usb: typec: hd3ss3220: use typec_get_fw_cap() to fill typec_cap Oliver Facklam
2024-11-18 10:03 ` Heikki Krogerus [this message]
2024-11-14 8:02 ` [PATCH v2 3/4] usb: typec: hd3ss3220: support configuring port type Oliver Facklam
2024-11-18 11:49 ` Heikki Krogerus
2024-11-18 14:00 ` Facklam, Olivér
2024-11-25 10:28 ` Heikki Krogerus
2024-11-27 8:02 ` Facklam, Olivér
2024-11-27 8:47 ` Biju Das
2024-12-02 14:27 ` Facklam, Olivér
2024-12-02 14:39 ` Biju Das
2024-11-28 13:15 ` Heikki Krogerus
2024-11-28 13:31 ` Facklam, Olivér
2024-11-14 8:02 ` [PATCH v2 4/4] usb: typec: hd3ss3220: support configuring role preference based on fwnode property and typec_operation Oliver Facklam
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=ZzsRDK_9LZLs8Hf3@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=benedict.vonheyl@zuehlke.com \
--cc=biju.das@bp.renesas.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathis.foerst@zuehlke.com \
--cc=michael.glettig@zuehlke.com \
--cc=oliver.facklam@zuehlke.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
all inboxes | Powered by JetHome®