[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f123856e-c741-3eb1-ec8e-51ba78ff6090@linaro.org>
Date: Mon, 2 Oct 2023 12:27:15 +0200
From: Konrad Dybcio <konrad.dybcio@...aro.org>
To: Neil Armstrong <neil.armstrong@...aro.org>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH v2 2/4] usb: ucsi: glink: use the connector orientation
GPIO to provide switch events
On 10/2/23 12:20, Neil Armstrong wrote:
> On SM8550, the non-altmode orientation is not given anymore within
> altmode events, even with USB SVIDs events.
>
> On the other side, the Type-C connector orientation is correctly
> reported by a signal from the PMIC.
>
> Take this gpio signal when we detect some Type-C port activity
> to notify any Type-C switches tied to the Type-C port connectors.
>
> Acked-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
> Signed-off-by: Neil Armstrong <neil.armstrong@...aro.org>
> ---
[...]
> + device_for_each_child_node(dev, fwnode) {
> + struct gpio_desc *desc;
> + u32 port;
> +
> + ret = fwnode_property_read_u32(fwnode, "reg", &port);
> + if (ret < 0) {
> + dev_err(dev, "missing reg property of %pOFn\n", fwnode);
> + return ret;
> + }
> +
> + if (port >= PMIC_GLINK_MAX_PORTS) {
> + dev_warn(dev, "invalid connector number, ignoring\n");
> + continue;
> + }
> +
> + desc = devm_gpiod_get_index_optional(&adev->dev, "orientation", port, GPIOD_IN);
Personally, I'd add a comment about this being a lookup on the
pmic-glink node, as dev is reused throughout this function
Acked-by: Konrad Dybcio <konrad.dybcio@...aro.org>
Konrad
Powered by blists - more mailing lists