From patchwork Thu Nov 3 22:46:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 621297 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4840C4321E for ; Thu, 3 Nov 2022 22:47:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230194AbiKCWrN (ORCPT ); Thu, 3 Nov 2022 18:47:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230376AbiKCWrI (ORCPT ); Thu, 3 Nov 2022 18:47:08 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 541BBDF67; Thu, 3 Nov 2022 15:47:06 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id q1-20020a17090a750100b002139ec1e999so3155697pjk.1; Thu, 03 Nov 2022 15:47:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GzyVxrhxEbz+OkOBW/vELHwjREnaJbPjpbkyciCOuGU=; b=CBNO6vMlSLpNtQN82BjV4VPELjbrs2snmwzEcl47oYPc2n+hYfAIcKkdB0l6nBgtjh Go9XzIiBLTs2l0HOdHuKZaOfToC4MFF1m0PSw0c6j3hSwtmo1zOvBRX0PfxGpBjOyr8L rU3KKM5dj9bX8AKtdL20Oi9dB5slGk+dGny8ei0kc1/sXKr576pYpU2Dpp4BIqcDktVJ x+suUidssIdLmv+Qb4nndRE8SEGarjfdJ3lup7ZAiTwsQ30tq+aQEaVHba8nH2rmYVlE YKon1yYBdSu9l3j0AZ1LOUlluqpZotOksbyhNOEooRtb1CklASwPyrHTV9bGo5hqcHp9 4ovQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GzyVxrhxEbz+OkOBW/vELHwjREnaJbPjpbkyciCOuGU=; b=Mdtl64w9YiIKVZNIHZwME8EdTAbz1htjRU69mueQdylLrExLopfPU1yxpXaEKPGlNO wPk2V+bHNLaHaaEC+8yH/tNyJw1YPDo/lIEW59zJrfu2VlDW1yyLGaYjkP+GMjLz9GMV Vl/hWiJi0WgOcUQP2+yXU5rp+f/BVqv08BTXYgzwd028IrEMo6W0DoiRuDB/eQZrSnV+ HJv/ipA3Wwch4PKvQ7KQnL4yogXp8wkrzEDyFuoNmFuttsgEfc6Jma5rJIllteszpkSB VyA1DzWdfUQ6PWcP7IZ4GfOXypNzHIjzmd/87jnuuDdaBo9+WLB7qM4V9wzMXwvHwyTr jYLg== X-Gm-Message-State: ACrzQf0bvlWHvFZqP4CHG1iavvZc7gnEFQYGM/QzR4b0x35fStMdzwSB 4ZeQSaOGBXQOdw21dB0VLUpjro+rLkM= X-Google-Smtp-Source: AMsMyM6PUokmz2Qi/MEYK1qf/09vcpEWhd8ty8i8xUH+DMkr/eV8/XQjqtWgtesX6MEiaYM3XrbMZQ== X-Received: by 2002:a17:90a:4d08:b0:20b:25f6:3e30 with SMTP id c8-20020a17090a4d0800b0020b25f63e30mr206608pjg.227.1667515625646; Thu, 03 Nov 2022 15:47:05 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:a6ae:11ff:fe11:fcc3]) by smtp.gmail.com with ESMTPSA id g13-20020aa796ad000000b0056be1d7d4a3sm1280421pfk.73.2022.11.03.15.47.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 15:47:05 -0700 (PDT) From: Dmitry Torokhov To: Tomi Valkeinen , Helge Deller , Tony Lindgren , Sebastian Reichel Cc: linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 01/13] omapfb: connector-hdmi: switch to using gpiod API Date: Thu, 3 Nov 2022 15:46:37 -0700 Message-Id: <20221103-omapfb-gpiod-v1-1-c3d53ca7988f@gmail.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog In-Reply-To: <20221103-omapfb-gpiod-v1-0-c3d53ca7988f@gmail.com> References: <20221103-omapfb-gpiod-v1-0-c3d53ca7988f@gmail.com> MIME-Version: 1.0 X-Mailer: b4 0.11.0-dev-5166b Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Switch the driver from legacy gpio API that is deprecated to the newer gpiod API that respects line polarities described in ACPI/DT. Signed-off-by: Dmitry Torokhov --- .../fbdev/omap2/omapfb/displays/connector-hdmi.c | 49 +++++++--------------- 1 file changed, 14 insertions(+), 35 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c b/drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c index 670b9c6eb5a9..8f9ff9fb4ca4 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c @@ -6,11 +6,12 @@ * Author: Tomi Valkeinen */ +#include +#include #include #include #include #include -#include #include @@ -41,7 +42,7 @@ struct panel_drv_data { struct omap_video_timings timings; - int hpd_gpio; + struct gpio_desc *hpd_gpio; }; #define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev) @@ -155,8 +156,8 @@ static bool hdmic_detect(struct omap_dss_device *dssdev) struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *in = ddata->in; - if (gpio_is_valid(ddata->hpd_gpio)) - return gpio_get_value_cansleep(ddata->hpd_gpio); + if (ddata->hpd_gpio) + return gpiod_get_value_cansleep(ddata->hpd_gpio); else return in->ops.hdmi->detect(in); } @@ -197,31 +198,6 @@ static struct omap_dss_driver hdmic_driver = { .set_hdmi_infoframe = hdmic_set_infoframe, }; -static int hdmic_probe_of(struct platform_device *pdev) -{ - struct panel_drv_data *ddata = platform_get_drvdata(pdev); - struct device_node *node = pdev->dev.of_node; - struct omap_dss_device *in; - int gpio; - - /* HPD GPIO */ - gpio = of_get_named_gpio(node, "hpd-gpios", 0); - if (gpio_is_valid(gpio)) - ddata->hpd_gpio = gpio; - else - ddata->hpd_gpio = -ENODEV; - - in = omapdss_of_find_source_for_first_ep(node); - if (IS_ERR(in)) { - dev_err(&pdev->dev, "failed to find video source\n"); - return PTR_ERR(in); - } - - ddata->in = in; - - return 0; -} - static int hdmic_probe(struct platform_device *pdev) { struct panel_drv_data *ddata; @@ -238,15 +214,18 @@ static int hdmic_probe(struct platform_device *pdev) platform_set_drvdata(pdev, ddata); ddata->dev = &pdev->dev; - r = hdmic_probe_of(pdev); + ddata->hpd_gpio = devm_gpiod_get_optional(&pdev->dev, "hpd", GPIOD_IN); + r = PTR_ERR_OR_ZERO(ddata->hpd_gpio); if (r) return r; - if (gpio_is_valid(ddata->hpd_gpio)) { - r = devm_gpio_request_one(&pdev->dev, ddata->hpd_gpio, - GPIOF_DIR_IN, "hdmi_hpd"); - if (r) - goto err_reg; + gpiod_set_consumer_name(ddata->hpd_gpio, "hdmi_hpd"); + + ddata->in = omapdss_of_find_source_for_first_ep(pdev->dev.of_node); + r = PTR_ERR_OR_ZERO(ddata->in); + if (r) { + dev_err(&pdev->dev, "failed to find video source\n"); + return r; } ddata->timings = hdmic_default_timings; From patchwork Thu Nov 3 22:46:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 621656 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92D90C4332F for ; Thu, 3 Nov 2022 22:47:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231180AbiKCWrR (ORCPT ); Thu, 3 Nov 2022 18:47:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230433AbiKCWrM (ORCPT ); Thu, 3 Nov 2022 18:47:12 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 131C320BED; Thu, 3 Nov 2022 15:47:10 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id o7so3022074pjj.1; Thu, 03 Nov 2022 15:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=q3H968a3kOAexewQRFDUs1wm0MYnfXOPTZ0bRBglYYY=; b=FQA5EeiFlAqWxAct5Uxsj1qH07RB6GGA2Q7rr8QNJIeHli213BXWMKcy+fxU0y0pJ7 wpQOp7TEXMk9euGyBKI8vdPTkeyWLX+O2NbYtaKOjMP/bZt0I9yAkeKMp3/pghJVeTuX J1VhyRW/SmYfeg+4aNznKck6Vv9ntl2OxBPikjfpPg2WfyqW6kk7hbrpVuKft8hsMdjy CBw52dcyNoQyo/+cziEsxgm8c9FvAr4YBnSuBumatxFGvkmRXVu68taCy7eYUQ6nMvC8 p/dIKD1CEsWFR12HOyEKD51fmWtCvfxKzCqitufb+vRo5MQsInXfv4HDaSoyp1AsDfby Fbyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q3H968a3kOAexewQRFDUs1wm0MYnfXOPTZ0bRBglYYY=; b=yxIncCb/VzvCw/6bcmh3DgBw7gnRIIjxUYsQiNJ0dmZw04uD8pFzLv+/14Mt+naB+W JkZkCKkXGJcVjg0O9vMh+TbdpxXdfBA5y3nKpxP9hVljN3veefEj+hiMOn0B5XYpyXY3 KaNX3FhmFNUyY6JhD4MnDO0BdOsgEOsu6YS++8Sf7acX0ucY8vLmPdszpURJ6jt+0uMC M6ARyOu97gzjUTfhBslU5GUDTvxHg5QMmXkEawMdQJU+neh3dY/BPD9aj9XpmxR+lh5m JfOAWwE9ouM5bV/ACyGbusMZlAbxzr33ZxQVNouZjifk+sJjgykqKRYEOeljRKFl+PF/ ILIw== X-Gm-Message-State: ACrzQf0NXS5Mhu7V93vgqnxR4lZmBVX5VZjHg6hTO7rOYkTcgqQvs0g9 cvTRurdk4ns24Prh1XXdlpc= X-Google-Smtp-Source: AMsMyM5JjUsssrOSbv9S1ENHH+o31vR3x/luN6lPjE6ImL2y15T2xSjR878+yLJwYqM4PgRRK/BqAQ== X-Received: by 2002:a17:902:8a90:b0:186:b145:f5ec with SMTP id p16-20020a1709028a9000b00186b145f5ecmr32881653plo.103.1667515629418; Thu, 03 Nov 2022 15:47:09 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:a6ae:11ff:fe11:fcc3]) by smtp.gmail.com with ESMTPSA id g13-20020aa796ad000000b0056be1d7d4a3sm1280421pfk.73.2022.11.03.15.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 15:47:08 -0700 (PDT) From: Dmitry Torokhov To: Tomi Valkeinen , Helge Deller , Tony Lindgren , Sebastian Reichel Cc: linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 02/13] omapfb: panel-sony-acx565akm: remove support for platform data Date: Thu, 3 Nov 2022 15:46:39 -0700 Message-Id: <20221103-omapfb-gpiod-v1-2-c3d53ca7988f@gmail.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog In-Reply-To: <20221103-omapfb-gpiod-v1-0-c3d53ca7988f@gmail.com> References: <20221103-omapfb-gpiod-v1-0-c3d53ca7988f@gmail.com> MIME-Version: 1.0 X-Mailer: b4 0.11.0-dev-5166b Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org There are no users of panel_acx565akm_platform_data in the mainline kernel so support for it can be removed from the panel driver. Signed-off-by: Dmitry Torokhov --- .../omap2/omapfb/displays/panel-sony-acx565akm.c | 45 +++------------------- include/video/omap-panel-data.h | 16 -------- 2 files changed, 6 insertions(+), 55 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c index c0965bee12c5..0c81d3ff4197 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c @@ -23,7 +23,6 @@ #include #include