Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3709675pxb; Mon, 1 Nov 2021 19:23:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzqEWd8PrHUYE5az7SYKjT6ChgqPTSnyb+quOjS+Z+zuQD9ezICpgMdBOWT0iyEn6hh8NY X-Received: by 2002:a17:906:8686:: with SMTP id g6mr16547791ejx.98.1635819797822; Mon, 01 Nov 2021 19:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635819797; cv=none; d=google.com; s=arc-20160816; b=vBYeQBiAwqDYVEGZwYijrIkcxefhU/HTPfg8PfEyjtZ4DoggyIl24F+f9Ro90tqpLv dpLljn+bfcnsMNuhivjanzM50RghqKUcB96lEErZBzARjmnRZSRC18uezR4+ZNx9k/0g xfQIjTF2OPgsk8HQh0PlV9G1iDY3W7iFJdXBXKapAfA53mQbIHTJ7b6kYo0J7+Veg0rk CGhXoWhCP8UWIDuzDtHgFSpiVZvqeT2WNkDI/mk37HXNMRevuEjjo9AjWGDS8LIIo9Vz P/afLptU5IR/5VHbFf8+k6dT3b/gHClLVGLWOCHpoaYzC8B67E26bXkskAKsn7xk0V9e yF9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=TeHGklbsWJ2iSzr/5MHFyU8553eNgPnreRe65lH6NhU=; b=i6B0yxWEENe+sYOoRZeCGHBkin5PDVfMHc6Faq4eEP/6tY881Mv6oUz+nD/XHt4huk 48WKpPXhv3AjzcBKnlziGSzh1KJcvQwQYZAfayXLbvxwZsM4CTr+DmK3uQ99E8mcktNy prCMZP8npSkYD0SBDs6I3yXKPUljN0ACQK00q9dRgqYT+3PuzopPXkEQmbMZEB4l5aJ5 TTrmwUgJfVPkRmv7sltzgv3ErYRYntICqBCQRxAIB8IIEf9Rd8mvJMkXEohERbrWMK8J k6qx9aL1R5C8VvMBJ5k/KWpPLoBVbfwm2SMqKloko6o8ztE+p6IqAXibcsV2nmNrW2mb DV1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@usp.br header.s=usp-google header.b=BZwfWggd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=usp.br Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hq4si30662866ejc.66.2021.11.01.19.22.51; Mon, 01 Nov 2021 19:23:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@usp.br header.s=usp-google header.b=BZwfWggd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=usp.br Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231473AbhKBCWz (ORCPT + 99 others); Mon, 1 Nov 2021 22:22:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230362AbhKBCWo (ORCPT ); Mon, 1 Nov 2021 22:22:44 -0400 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D0BCC061767 for ; Mon, 1 Nov 2021 19:20:10 -0700 (PDT) Received: by mail-qt1-x833.google.com with SMTP id 8so200133qty.10 for ; Mon, 01 Nov 2021 19:20:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=usp.br; s=usp-google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding; bh=TeHGklbsWJ2iSzr/5MHFyU8553eNgPnreRe65lH6NhU=; b=BZwfWggd+/dvjEMDdNmiEIqpxvWCv6b4m28LKY5geUgyiIj794SoJpPfXVxERVaEI9 tLyML6H4F7sl5fxcmB6LPxYyUJJsbKaQOIUz8Zvn6hRiYi51XMqVI83OsGive+XfWcn3 QajSdbJixF+6l492FHi5cEgzbKkIc9vef/TzbcUIkE0UQ9vqThJI8iFO/cpHNYmSnpKp ZiLI8y6C/rhnu2m9dolNE/THLnOqAcomq3TkQL8i+M2q2r+PlvMFS8VpxIirV6daZOf0 Nf5K8geoGMhdgWWgwwcXrU+VTHG3Yo7TDJv79ZLb44O1ZkewXOhJ95WSBN9wKm9t0uke ittA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding; bh=TeHGklbsWJ2iSzr/5MHFyU8553eNgPnreRe65lH6NhU=; b=QdmSCa6NDKbzunv19nFmBYTCKLYYXPWWXbBwKUHZOO8VFtKqAHOYx1vQdYyxWfyV4j ywHkmp0TMScuHMdI/IVr+KymZtGlsjBg/colFnH5D1OuRR8NnamVZStMpyQTAQPXApPp JwjxDwDESE8UYrXIrLCNvDyJ0HNIl/LsKdQTOL17jEMTanNUj1fZkv2F2+EUN9KoHnjm Say3/RKDWezm5mhmM9ww1Y3iHWkcgNai7jhdRHNwjR+R2tAI42dhrSGu6HH9WJhgRSUJ iupBMQCN+Ah4TdSgZcplEdmKDhP3vG8wZMdjbM2uEytOveyDs35IwGMuwDfZFyosCF5K 1vfA== X-Gm-Message-State: AOAM533xczx1/gaKk5TjTB6FIiF0Br8yg1HJ4HaPk7yGvlR1pxOCK822 ucglldiNwIvlLTuoulPpRQsduA== X-Received: by 2002:a05:622a:2c3:: with SMTP id a3mr9430222qtx.3.1635819609361; Mon, 01 Nov 2021 19:20:09 -0700 (PDT) Received: from fedora ([187.64.134.142]) by smtp.gmail.com with ESMTPSA id v16sm1371671qtw.90.2021.11.01.19.20.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 19:20:09 -0700 (PDT) Date: Mon, 1 Nov 2021 23:20:03 -0300 From: =?iso-8859-1?Q?Ma=EDra?= Canal To: inki.dae@samsung.com, jy0922.shim@samsung.com, sw0312.kim@samsung.com, kyungmin.park@samsung.com, airlied@linux.ie, daniel@ffwll.ch, krzysztof.kozlowski@canonical.com Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/exynos: Replace legacy gpio interface for gpiod interface Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Considering the current transition of the GPIO subsystem, remove all dependencies of the legacy GPIO interface (linux/gpio.h and linux /of_gpio.h) and replace it with the descriptor-based GPIO approach. Signed-off-by: Ma?ra Canal --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 42 +++++++++---------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 8d137857818c..b0b1acb7e712 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -265,7 +264,7 @@ struct exynos_dsi { struct clk **clks; struct regulator_bulk_data supplies[2]; int irq; - int te_gpio; + struct gpio_desc *te_gpio; u32 pll_clk_rate; u32 burst_clk_rate; @@ -1298,14 +1297,14 @@ static void exynos_dsi_enable_irq(struct exynos_dsi *dsi) { enable_irq(dsi->irq); - if (gpio_is_valid(dsi->te_gpio)) - enable_irq(gpio_to_irq(dsi->te_gpio)); + if (dsi->te_gpio) + enable_irq(gpiod_to_irq(dsi->te_gpio)); } static void exynos_dsi_disable_irq(struct exynos_dsi *dsi) { - if (gpio_is_valid(dsi->te_gpio)) - disable_irq(gpio_to_irq(dsi->te_gpio)); + if (dsi->te_gpio) + disable_irq(gpiod_to_irq(dsi->te_gpio)); disable_irq(dsi->irq); } @@ -1335,29 +1334,20 @@ static int exynos_dsi_register_te_irq(struct exynos_dsi *dsi, int ret; int te_gpio_irq; - dsi->te_gpio = of_get_named_gpio(panel->of_node, "te-gpios", 0); - if (dsi->te_gpio == -ENOENT) - return 0; - - if (!gpio_is_valid(dsi->te_gpio)) { - ret = dsi->te_gpio; - dev_err(dsi->dev, "cannot get te-gpios, %d\n", ret); + dsi->te_gpio = devm_gpiod_get_optional(dsi->dev, "te", GPIOD_IN); + if (IS_ERR(dsi->te_gpio)) { + dev_err(dsi->dev, "gpio request failed with %ld\n", + PTR_ERR(dsi->te_gpio)); goto out; } - ret = gpio_request(dsi->te_gpio, "te_gpio"); - if (ret) { - dev_err(dsi->dev, "gpio request failed with %d\n", ret); - goto out; - } - - te_gpio_irq = gpio_to_irq(dsi->te_gpio); + te_gpio_irq = gpiod_to_irq(dsi->te_gpio); ret = request_threaded_irq(te_gpio_irq, exynos_dsi_te_irq_handler, NULL, IRQF_TRIGGER_RISING | IRQF_NO_AUTOEN, "TE", dsi); if (ret) { dev_err(dsi->dev, "request interrupt failed with %d\n", ret); - gpio_free(dsi->te_gpio); + gpiod_put(dsi->te_gpio); goto out; } @@ -1367,10 +1357,9 @@ static int exynos_dsi_register_te_irq(struct exynos_dsi *dsi, static void exynos_dsi_unregister_te_irq(struct exynos_dsi *dsi) { - if (gpio_is_valid(dsi->te_gpio)) { - free_irq(gpio_to_irq(dsi->te_gpio), dsi); - gpio_free(dsi->te_gpio); - dsi->te_gpio = -ENOENT; + if (dsi->te_gpio) { + free_irq(gpiod_to_irq(dsi->te_gpio), dsi); + gpiod_put(dsi->te_gpio); } } @@ -1745,9 +1734,6 @@ static int exynos_dsi_probe(struct platform_device *pdev) if (!dsi) return -ENOMEM; - /* To be checked as invalid one */ - dsi->te_gpio = -ENOENT; - init_completion(&dsi->completed); spin_lock_init(&dsi->transfer_lock); INIT_LIST_HEAD(&dsi->transfer_list); -- 2.31.1