From patchwork Sun Mar 31 20:29:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13612296 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6A60FCD128D for ; Sun, 31 Mar 2024 20:30:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=f1v8Edoqpxd5D+dKU5hTYS8055bGcmmXIigSZB/NW0o=; b=rzeAjhw33RPuYq xejy6yjrJlQsV7cQWNNGFa27JFwDzRn1OhRY8BkvXxfBYdYRJ3AiFy0s8zTtBcsi94B2rmSSDiy8n OgVWElXm9P46FiiWzxwKbZguW6IfoG10La98GZYSOYUBY9JJTamNQz3u5yGvxeXm4ZuXd/Y1CdJ+q I0NGo7bEv45uDNNl+8TzZetis/VzyfqXsLQQ8SgnDiGk3So4uO0x5HPb1F/V5dO1+3rk51gk102kP HGpd4uzQ9OOfulEPpgjP5+KODcYlvm9BYTnxOcQLdegl9klH8axLpsI99UTxYWHBhr7Ss1aIU+j33 /IgPQCjJu52TtvTVBNxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rr1oV-00000006GFv-0oG1; Sun, 31 Mar 2024 20:29:59 +0000 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rr1nl-00000006Fpk-3peo for linux-arm-kernel@lists.infradead.org; Sun, 31 Mar 2024 20:29:17 +0000 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2d52e65d4a8so48553411fa.0 for ; Sun, 31 Mar 2024 13:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711916951; x=1712521751; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=hSjZJV2J4iFvn9E2c3TLDDuj0HnPcaUsZUNdMjQiU+w=; b=EBrkIbeNIAZDqGk8Ijj1xx4pC44S+KpNq45dxLtV+5x3JmKYQlKOMZVSaODY8H8wA+ nXarf2yaZoKqY9WevSD8/IJu15s5npBhi2Frziw7nJn4Z/EUD01GoH/UGecXNkQP373Y pCg1ic08+HpkMc0bTatlDO8ryVj9CMhf7WA3C7D5gh8fQg+Tvm3TnLSpqz0v2dzzCVe0 r98ViAK08WXtJyOL2M1h7LaYfT8tkfqM5ahD6uww/39L/LKeShb39qnBPX9dYgxgU86v etLwi/wkFwvPkQt/eoi/c8BDkhDM6YzfEBAJTyQN3Qvc8rkvuv7z4mvvRpb5S2pcgCGk LXEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711916951; x=1712521751; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hSjZJV2J4iFvn9E2c3TLDDuj0HnPcaUsZUNdMjQiU+w=; b=B4F09il59Z9VQD/e0VffOxdTNXTdF4qDquQpoiUpiOXjBG1gPaI4X/5X4Hc523m68L 6dlI0EtFMw/tdm31syAZ8EY0uefaviR5jFXQ+xtPZRo0p/IBr+s0+aa82Yjhjky5IFpu 95gXS6GGvFSfuobM/ramCoTvcZOoCNpcOxab0MVLQMdVZj7iKRrnGzm9uRUswXeGJ1Fw +fmPxGsCX7kujwzTRygLRCBXkz5PbK2jxHf/IWEy70eH79seACiwAqRCth8YYWvTLa6Y dY/HHUHtmt4qlS6401rqTGipII3VCaaznqZDvCJBicz8750ZF3Hosiz+dKX3zvdEgtlu uoCA== X-Forwarded-Encrypted: i=1; AJvYcCW1rO791psKJJbfE4D1tNtK6DK2O16DIyfdCu5UdVTdPeol3FLO78SIXmmbs/iwQs37pldpoAMI9Tjb26CTKg8dRbAINSFAqUD9wB+apGgHO7O37dA= X-Gm-Message-State: AOJu0Yx/sD4V5sPc2Qmvrh818q1tDGnJE8iM7yurYa9i+HBwtpEEOjJK zNYnYNjyk7r758kQtE1eZvHrr1F1YmMd8z442r+o/r6/r5wnSNL7fBf8yFvXRCLjl/G12iqCxEr o X-Google-Smtp-Source: AGHT+IGqWCIntvZiDosEJKnaReDexnGbEOGV3zzmMDNnyKgFK5V75oXRqdmj5ESqD0OGA1YI49V6rg== X-Received: by 2002:ac2:4145:0:b0:516:9f4d:1fc4 with SMTP id c5-20020ac24145000000b005169f4d1fc4mr2503140lfi.49.1711916950855; Sun, 31 Mar 2024 13:29:10 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id y25-20020a197519000000b00513cfc2a7aesm1237276lfe.71.2024.03.31.13.29.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 13:29:10 -0700 (PDT) From: Dmitry Baryshkov Date: Sun, 31 Mar 2024 23:29:03 +0300 Subject: [PATCH v2 06/12] drm/imx: ldb: drop custom DDC bus support MIME-Version: 1.0 Message-Id: <20240331-drm-imx-cleanup-v2-6-d81c1d1c1026@linaro.org> References: <20240331-drm-imx-cleanup-v2-0-d81c1d1c1026@linaro.org> In-Reply-To: <20240331-drm-imx-cleanup-v2-0-d81c1d1c1026@linaro.org> To: Philipp Zabel , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: Chris Healy , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3942; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=m11CFuEduJHyQCwHyCLs0Yco+X7++CQ3XEHXdiz1Oro=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmCceP6jh5TC7QL9R2rkAKAR3NbgOh5kblFwSSO NB3cIuFeTOJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgnHjwAKCRCLPIo+Aiko 1Sn/B/4rtFlV/3QWDuIppX9zgfbSNwSC+NhwTRudvbiadZy5sknecwH7XCIyNEg3mhrf1G12oXq aIiyOr0cJBSMYa7TfCGSTN5CESr+cKDJ1WqKhLVAh5KalY6304ITWgCQnCnvnS/5j+cm8cZuoFz 2rdF0h073DMilAaoCko5laOPnvkuot3ZG1KYLPy3BZQWn+mTL0NT9/O1xZOnBKXb2rJyv9XR3gP ZU8zMokbcM4DF22m1TahdWnyO9AnKVtk+96WHD9XGwORBorkXnTRb1svaVfzizSVaHcPBEdmHVP EHyhHEt16GVtCxcctL3wZ2DCfiHjttm/DLtmibsaCllST2ce X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240331_132914_360098_4700FA1C X-CRM114-Status: GOOD ( 19.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org None of the boards ever supported by the upstream kernel used the custom DDC bus support with the LDB connector. If a need arises to do so, one should use panel-simple and its DDC bus code. Drop ddc-i2c-bus support from the imx-ldb driver. Signed-off-by: Dmitry Baryshkov Reviewed-by: Philipp Zabel --- drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 72 ++++++------------------------------- 1 file changed, 10 insertions(+), 62 deletions(-) diff --git a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c index 1924d8921c62..380edc1c4507 100644 --- a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c +++ b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c @@ -70,7 +70,6 @@ struct imx_ldb_channel { struct drm_bridge *bridge; struct device_node *child; - struct i2c_adapter *ddc; int chno; struct drm_display_mode mode; int mode_valid; @@ -141,18 +140,6 @@ static int imx_ldb_connector_get_modes(struct drm_connector *connector) if (num_modes > 0) return num_modes; - if (imx_ldb_ch->ddc) { - const struct drm_edid *edid = drm_edid_read_ddc(connector, - imx_ldb_ch->ddc); - - if (edid) { - drm_edid_connector_update(connector, edid); - drm_edid_free(edid); - - return drm_edid_connector_add_modes(connector); - } - } - if (imx_ldb_ch->mode_valid) { struct drm_display_mode *mode; @@ -481,10 +468,9 @@ static int imx_ldb_register(struct drm_device *drm, */ drm_connector_helper_add(connector, &imx_ldb_connector_helper_funcs); - drm_connector_init_with_ddc(drm, connector, - &imx_ldb_connector_funcs, - DRM_MODE_CONNECTOR_LVDS, - imx_ldb_ch->ddc); + drm_connector_init(drm, connector, + &imx_ldb_connector_funcs, + DRM_MODE_CONNECTOR_LVDS); drm_connector_attach_encoder(connector, encoder); } @@ -551,39 +537,6 @@ static const struct of_device_id imx_ldb_dt_ids[] = { }; MODULE_DEVICE_TABLE(of, imx_ldb_dt_ids); -static int imx_ldb_panel_ddc(struct device *dev, - struct imx_ldb_channel *channel, struct device_node *child) -{ - struct device_node *ddc_node; - int ret; - - ddc_node = of_parse_phandle(child, "ddc-i2c-bus", 0); - if (ddc_node) { - channel->ddc = of_find_i2c_adapter_by_node(ddc_node); - of_node_put(ddc_node); - if (!channel->ddc) { - dev_warn(dev, "failed to get ddc i2c adapter\n"); - return -EPROBE_DEFER; - } - } - - if (!channel->ddc) { - /* if no DDC available, fallback to hardcoded EDID */ - dev_dbg(dev, "no ddc available\n"); - - if (!channel->panel) { - /* fallback to display-timings node */ - ret = of_get_drm_display_mode(child, - &channel->mode, - &channel->bus_flags, - OF_USE_NATIVE_MODE); - if (!ret) - channel->mode_valid = 1; - } - } - return 0; -} - static int imx_ldb_bind(struct device *dev, struct device *master, void *data) { struct drm_device *drm = data; @@ -694,11 +647,15 @@ static int imx_ldb_probe(struct platform_device *pdev) if (ret && ret != -ENODEV) goto free_child; - /* panel ddc only if there is no bridge */ - if (!channel->bridge) { - ret = imx_ldb_panel_ddc(dev, channel, child); + if (!channel->bridge && !channel->panel) { + ret = of_get_drm_display_mode(child, + &channel->mode, + &channel->bus_flags, + OF_USE_NATIVE_MODE); if (ret) goto free_child; + + channel->mode_valid = 1; } bus_format = of_get_bus_format(dev, child); @@ -732,15 +689,6 @@ static int imx_ldb_probe(struct platform_device *pdev) static void imx_ldb_remove(struct platform_device *pdev) { - struct imx_ldb *imx_ldb = platform_get_drvdata(pdev); - int i; - - for (i = 0; i < 2; i++) { - struct imx_ldb_channel *channel = &imx_ldb->channel[i]; - - i2c_put_adapter(channel->ddc); - } - component_del(&pdev->dev, &imx_ldb_ops); }