[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b3f89c19-a6d6-40a0-9225-111cc59221a2@kernel.org>
Date: Fri, 29 Nov 2024 09:21:08 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Xiangxu Yin <quic_xiangxuy@...cinc.com>, Rob Clark <robdclark@...il.com>,
Abhinav Kumar <quic_abhinavk@...cinc.com>,
Dmitry Baryshkov <dmitry.baryshkov@...aro.org>, Sean Paul <sean@...rly.run>,
Marijn Suijten <marijn.suijten@...ainline.org>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Kuogee Hsieh <quic_khsieh@...cinc.com>,
Vinod Koul <vkoul@...nel.org>, Kishon Vijay Abraham I <kishon@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>, Bartosz Golaszewski
<brgl@...ev.pl>, quic_lliu6@...cinc.com, quic_fangez@...cinc.com
Cc: linux-arm-msm@...r.kernel.org, dri-devel@...ts.freedesktop.org,
freedreno@...ts.freedesktop.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-phy@...ts.infradead.org,
linux-gpio@...r.kernel.org
Subject: Re: [PATCH 8/8] drm/msm/dp: Support external GPIO HPD with 3rd
pinctrl chip
On 29/11/2024 08:57, Xiangxu Yin wrote:
>
> + if (of_find_property(pdev->dev.of_node, "dp-hpd-gpio", NULL)) {
> + dp->ext_gpio = true;
> + dp->gpio_num = of_get_named_gpio(pdev->dev.of_node, "dp-hpd-gpio", 0);
> + if (dp->gpio_num < 0) {
> + dev_err(&pdev->dev, "Failed to get gpio:%d\n", dp->gpio_num);
> + return dp->gpio_num;
> + }
> +
> + if (!gpio_is_valid(dp->gpio_num)) {
> + DRM_ERROR("gpio(%d) invalid\n", dp->gpio_num);
> + return -EINVAL;
> + }
> +
> + rc = gpio_request(dp->gpio_num, "dp-hpd-gpio");
This is not how you request GPIOs. All this code is just wrong. See
Gpiolib API description/document. Or any other driver using GPIOs.
Best regards,
Krzysztof
Powered by blists - more mailing lists