[PATCH v2 3/8] drm/msm/dsi: drop unused GPIOs handling
Marijn Suijten
marijn.suijten at somainline.org
Thu Jun 13 18:05:38 UTC 2024
On 2024-06-13 20:05:06, Dmitry Baryshkov wrote:
> Neither disp-enable-gpios nor disp-te-gpios are defined in the schema.
> None of the board DT files use those GPIO pins. Drop them from the
> driver.
What's worse, when people set disp-te-gpios the
devm_gpiod_get_optional("disp-te", GPIOD_IN) below resets the typical mdp_vsync
function via pinctrl to the IN function, causing vsync signals to be lost and
the MDP hardware to fall back to half the requested refresh rate since commit
da9e7b7696d8 ("drm/msm/dpu: Correctly configure vsync tearcheck for command
mode").
>
> Reviewed-by: Abhinav Kumar <quic_abhinavk at quicinc.com>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov at linaro.org>
Reviewed-by: Marijn Suijten <marijn.suijten at somainline.org>
> ---
> drivers/gpu/drm/msm/dsi/dsi_host.c | 37 -------------------------------------
> 1 file changed, 37 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
> index a50f4dda5941..c4d72562c95a 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> @@ -7,7 +7,6 @@
> #include <linux/delay.h>
> #include <linux/dma-mapping.h>
> #include <linux/err.h>
> -#include <linux/gpio/consumer.h>
> #include <linux/interrupt.h>
> #include <linux/mfd/syscon.h>
> #include <linux/of.h>
> @@ -130,9 +129,6 @@ struct msm_dsi_host {
>
> unsigned long src_clk_rate;
>
> - struct gpio_desc *disp_en_gpio;
> - struct gpio_desc *te_gpio;
> -
> const struct msm_dsi_cfg_handler *cfg_hnd;
>
> struct completion dma_comp;
> @@ -1613,28 +1609,6 @@ static irqreturn_t dsi_host_irq(int irq, void *ptr)
> return IRQ_HANDLED;
> }
>
> -static int dsi_host_init_panel_gpios(struct msm_dsi_host *msm_host,
> - struct device *panel_device)
> -{
> - msm_host->disp_en_gpio = devm_gpiod_get_optional(panel_device,
> - "disp-enable",
> - GPIOD_OUT_LOW);
> - if (IS_ERR(msm_host->disp_en_gpio)) {
> - DBG("cannot get disp-enable-gpios %ld",
> - PTR_ERR(msm_host->disp_en_gpio));
> - return PTR_ERR(msm_host->disp_en_gpio);
> - }
> -
> - msm_host->te_gpio = devm_gpiod_get_optional(panel_device, "disp-te",
> - GPIOD_IN);
> - if (IS_ERR(msm_host->te_gpio)) {
> - DBG("cannot get disp-te-gpios %ld", PTR_ERR(msm_host->te_gpio));
> - return PTR_ERR(msm_host->te_gpio);
> - }
> -
> - return 0;
> -}
> -
> static int dsi_host_attach(struct mipi_dsi_host *host,
> struct mipi_dsi_device *dsi)
> {
> @@ -1651,11 +1625,6 @@ static int dsi_host_attach(struct mipi_dsi_host *host,
> if (dsi->dsc)
> msm_host->dsc = dsi->dsc;
>
> - /* Some gpios defined in panel DT need to be controlled by host */
> - ret = dsi_host_init_panel_gpios(msm_host, &dsi->dev);
> - if (ret)
> - return ret;
> -
> ret = dsi_dev_attach(msm_host->pdev);
> if (ret)
> return ret;
> @@ -2422,9 +2391,6 @@ int msm_dsi_host_power_on(struct mipi_dsi_host *host,
> dsi_sw_reset(msm_host);
> dsi_ctrl_enable(msm_host, phy_shared_timings, phy);
>
> - if (msm_host->disp_en_gpio)
> - gpiod_set_value(msm_host->disp_en_gpio, 1);
> -
> msm_host->power_on = true;
> mutex_unlock(&msm_host->dev_mutex);
>
> @@ -2454,9 +2420,6 @@ int msm_dsi_host_power_off(struct mipi_dsi_host *host)
>
> dsi_ctrl_disable(msm_host);
>
> - if (msm_host->disp_en_gpio)
> - gpiod_set_value(msm_host->disp_en_gpio, 0);
> -
> pinctrl_pm_select_sleep_state(&msm_host->pdev->dev);
>
> cfg_hnd->ops->link_clk_disable(msm_host);
>
> --
> 2.39.2
>
More information about the dri-devel
mailing list