From: Sui Jingfeng <sui.jingfeng@linux.dev>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
Sui Jingfeng <suijingfeng@loongson.cn>,
Thomas Zimmermann <tzimmermann@suse.de>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
Maxime Ripard <mripard@kernel.org>,
Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@gmail.com>
Subject: Re: [PATCH 5/5] drm-bridge: display-connector: Switch to use fwnode API
Date: Tue, 23 Jan 2024 20:35:48 +0800 [thread overview]
Message-ID: <5b0e1b73-9a94-4ab5-b30d-59caea8954cb@linux.dev> (raw)
In-Reply-To: <20240123012026.GC22880@pendragon.ideasonboard.com>
Hi,
On 2024/1/23 09:20, Laurent Pinchart wrote:
> On Tue, Jan 23, 2024 at 12:32:20AM +0800, Sui Jingfeng wrote:
>> From: Sui Jingfeng<suijingfeng@loongson.cn>
>>
>> Because API has wider coverage, it can be used on non-DT systems as well.
>>
>> Signed-off-by: Sui Jingfeng<suijingfeng@loongson.cn>
>> ---
>> drivers/gpu/drm/bridge/display-connector.c | 22 ++++++++++++----------
>> 1 file changed, 12 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/bridge/display-connector.c b/drivers/gpu/drm/bridge/display-connector.c
>> index eb7e194e7735..2c3e54a458e8 100644
>> --- a/drivers/gpu/drm/bridge/display-connector.c
>> +++ b/drivers/gpu/drm/bridge/display-connector.c
>> @@ -243,8 +243,8 @@ static int display_connector_probe(struct platform_device *pdev)
>> case DRM_MODE_CONNECTOR_DVII: {
>> bool analog, digital;
>>
>> - analog = of_property_read_bool(pdev->dev.of_node, "analog");
>> - digital = of_property_read_bool(pdev->dev.of_node, "digital");
>> + analog = fwnode_property_present(pdev->dev.fwnode, "analog");
>> + digital = fwnode_property_present(pdev->dev.fwnode, "digital");
>> if (analog && !digital) {
>> conn->bridge.type = DRM_MODE_CONNECTOR_DVIA;
>> } else if (!analog && digital) {
>> @@ -261,8 +261,8 @@ static int display_connector_probe(struct platform_device *pdev)
>> case DRM_MODE_CONNECTOR_HDMIA: {
>> const char *hdmi_type;
>>
>> - ret = of_property_read_string(pdev->dev.of_node, "type",
>> - &hdmi_type);
>> + ret = fwnode_property_read_string(pdev->dev.fwnode, "type",
>> + &hdmi_type);
>> if (ret < 0) {
>> dev_err(&pdev->dev, "HDMI connector with no type\n");
>> return -EINVAL;
>> @@ -292,7 +292,7 @@ static int display_connector_probe(struct platform_device *pdev)
>> conn->bridge.interlace_allowed = true;
>>
>> /* Get the optional connector label. */
>> - of_property_read_string(pdev->dev.of_node, "label", &label);
>> + fwnode_property_read_string(pdev->dev.fwnode, "label", &label);
>>
>> /*
>> * Get the HPD GPIO for DVI, HDMI and DP connectors. If the GPIO can provide
>> @@ -330,12 +330,13 @@ static int display_connector_probe(struct platform_device *pdev)
>> if (type == DRM_MODE_CONNECTOR_DVII ||
>> type == DRM_MODE_CONNECTOR_HDMIA ||
>> type == DRM_MODE_CONNECTOR_VGA) {
>> - struct device_node *phandle;
>> + struct fwnode_handle *fwnode;
>>
>> - phandle = of_parse_phandle(pdev->dev.of_node, "ddc-i2c-bus", 0);
>> - if (phandle) {
>> - conn->bridge.ddc = of_get_i2c_adapter_by_node(phandle);
>> - of_node_put(phandle);
>> + fwnode = fwnode_find_reference(pdev->dev.fwnode, "ddc-i2c-bus", 0);
>> + if (!IS_ERR_OR_NULL(fwnode)) {
>> + dev_info(&pdev->dev, "has I2C bus property\n");
> This looks like a debugging leftover.
Yes, thanks a lot for reviewing.
I will pick up suggestions and go back to improve.
WARNING: multiple messages have this Message-ID (diff)
From: Sui Jingfeng <sui.jingfeng@linux.dev>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: David Airlie <airlied@gmail.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
Daniel Vetter <daniel@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Sui Jingfeng <suijingfeng@loongson.cn>
Subject: Re: [PATCH 5/5] drm-bridge: display-connector: Switch to use fwnode API
Date: Tue, 23 Jan 2024 20:35:48 +0800 [thread overview]
Message-ID: <5b0e1b73-9a94-4ab5-b30d-59caea8954cb@linux.dev> (raw)
In-Reply-To: <20240123012026.GC22880@pendragon.ideasonboard.com>
Hi,
On 2024/1/23 09:20, Laurent Pinchart wrote:
> On Tue, Jan 23, 2024 at 12:32:20AM +0800, Sui Jingfeng wrote:
>> From: Sui Jingfeng<suijingfeng@loongson.cn>
>>
>> Because API has wider coverage, it can be used on non-DT systems as well.
>>
>> Signed-off-by: Sui Jingfeng<suijingfeng@loongson.cn>
>> ---
>> drivers/gpu/drm/bridge/display-connector.c | 22 ++++++++++++----------
>> 1 file changed, 12 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/bridge/display-connector.c b/drivers/gpu/drm/bridge/display-connector.c
>> index eb7e194e7735..2c3e54a458e8 100644
>> --- a/drivers/gpu/drm/bridge/display-connector.c
>> +++ b/drivers/gpu/drm/bridge/display-connector.c
>> @@ -243,8 +243,8 @@ static int display_connector_probe(struct platform_device *pdev)
>> case DRM_MODE_CONNECTOR_DVII: {
>> bool analog, digital;
>>
>> - analog = of_property_read_bool(pdev->dev.of_node, "analog");
>> - digital = of_property_read_bool(pdev->dev.of_node, "digital");
>> + analog = fwnode_property_present(pdev->dev.fwnode, "analog");
>> + digital = fwnode_property_present(pdev->dev.fwnode, "digital");
>> if (analog && !digital) {
>> conn->bridge.type = DRM_MODE_CONNECTOR_DVIA;
>> } else if (!analog && digital) {
>> @@ -261,8 +261,8 @@ static int display_connector_probe(struct platform_device *pdev)
>> case DRM_MODE_CONNECTOR_HDMIA: {
>> const char *hdmi_type;
>>
>> - ret = of_property_read_string(pdev->dev.of_node, "type",
>> - &hdmi_type);
>> + ret = fwnode_property_read_string(pdev->dev.fwnode, "type",
>> + &hdmi_type);
>> if (ret < 0) {
>> dev_err(&pdev->dev, "HDMI connector with no type\n");
>> return -EINVAL;
>> @@ -292,7 +292,7 @@ static int display_connector_probe(struct platform_device *pdev)
>> conn->bridge.interlace_allowed = true;
>>
>> /* Get the optional connector label. */
>> - of_property_read_string(pdev->dev.of_node, "label", &label);
>> + fwnode_property_read_string(pdev->dev.fwnode, "label", &label);
>>
>> /*
>> * Get the HPD GPIO for DVI, HDMI and DP connectors. If the GPIO can provide
>> @@ -330,12 +330,13 @@ static int display_connector_probe(struct platform_device *pdev)
>> if (type == DRM_MODE_CONNECTOR_DVII ||
>> type == DRM_MODE_CONNECTOR_HDMIA ||
>> type == DRM_MODE_CONNECTOR_VGA) {
>> - struct device_node *phandle;
>> + struct fwnode_handle *fwnode;
>>
>> - phandle = of_parse_phandle(pdev->dev.of_node, "ddc-i2c-bus", 0);
>> - if (phandle) {
>> - conn->bridge.ddc = of_get_i2c_adapter_by_node(phandle);
>> - of_node_put(phandle);
>> + fwnode = fwnode_find_reference(pdev->dev.fwnode, "ddc-i2c-bus", 0);
>> + if (!IS_ERR_OR_NULL(fwnode)) {
>> + dev_info(&pdev->dev, "has I2C bus property\n");
> This looks like a debugging leftover.
Yes, thanks a lot for reviewing.
I will pick up suggestions and go back to improve.
next prev parent reply other threads:[~2024-01-23 12:35 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-22 16:32 [PATCH 0/5] drm/bridge: Allow using fwnode API to get the next bridge Sui Jingfeng
2024-01-22 16:32 ` Sui Jingfeng
2024-01-22 16:32 ` [PATCH 1/5] drm/bridge: Add drm_bridge_find_by_fwnode() helper Sui Jingfeng
2024-01-22 16:32 ` Sui Jingfeng
2024-01-23 1:17 ` Laurent Pinchart
2024-01-23 1:17 ` Laurent Pinchart
2024-01-23 8:01 ` Sui Jingfeng
2024-01-23 8:01 ` Sui Jingfeng
2024-01-23 15:15 ` Laurent Pinchart
2024-01-23 15:15 ` Laurent Pinchart
2024-01-22 16:32 ` [PATCH 2/5] drm/bridge: simple-bridge: Extend match support for non-DT based systems Sui Jingfeng
2024-01-22 16:32 ` Sui Jingfeng
2024-01-23 1:21 ` Laurent Pinchart
2024-01-23 1:21 ` Laurent Pinchart
2024-01-23 8:20 ` Sui Jingfeng
2024-01-23 8:20 ` Sui Jingfeng
2024-01-23 15:16 ` Laurent Pinchart
2024-01-23 15:16 ` Laurent Pinchart
2024-01-23 12:31 ` Sui Jingfeng
2024-01-23 12:31 ` Sui Jingfeng
2024-03-20 20:34 ` Andy Shevchenko
2024-01-22 16:32 ` [PATCH 3/5] drm/bridge: simple-bridge: Allow acquiring the next bridge with fwnode API Sui Jingfeng
2024-01-22 16:32 ` Sui Jingfeng
2024-01-23 1:18 ` Laurent Pinchart
2024-01-23 1:18 ` Laurent Pinchart
2024-01-23 12:18 ` Sui Jingfeng
2024-01-23 12:18 ` Sui Jingfeng
2024-01-23 15:18 ` Laurent Pinchart
2024-01-23 15:18 ` Laurent Pinchart
2024-01-24 15:00 ` Maxime Ripard
2024-01-24 15:00 ` Maxime Ripard
2024-01-22 16:32 ` [PATCH 4/5] drm/bridge: display-connector: Extend match support for non-DT based systems Sui Jingfeng
2024-01-22 16:32 ` Sui Jingfeng
2024-01-22 16:32 ` [PATCH 5/5] drm-bridge: display-connector: Switch to use fwnode API Sui Jingfeng
2024-01-22 16:32 ` Sui Jingfeng
2024-01-23 1:20 ` Laurent Pinchart
2024-01-23 1:20 ` Laurent Pinchart
2024-01-23 12:35 ` Sui Jingfeng [this message]
2024-01-23 12:35 ` Sui Jingfeng
2024-03-20 20:32 ` Andy Shevchenko
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=5b0e1b73-9a94-4ab5-b30d-59caea8954cb@linux.dev \
--to=sui.jingfeng@linux.dev \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=suijingfeng@loongson.cn \
--cc=tzimmermann@suse.de \
/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.