From patchwork Tue Nov 12 14:39:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 1193585 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="dA+gzDkj"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 47C9QB1y2Bz9sPL for ; Wed, 13 Nov 2019 01:40:16 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 45687C21ECF; Tue, 12 Nov 2019 14:40:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A6D9AC21DA2; Tue, 12 Nov 2019 14:40:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 257EFC21DA2; Tue, 12 Nov 2019 14:40:05 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id C6556C21CB1 for ; Tue, 12 Nov 2019 14:40:04 +0000 (UTC) Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xACEbAW5005858; Tue, 12 Nov 2019 15:40:01 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=sycYQY7PMl9T2MwZQKcKGreE983c7OkKIMkTMTn59sE=; b=dA+gzDkjDxAms5poMh3p/zIpUifcA8b2uGL3X27QLldfMBCfJgncVx+eTXdS0wqdbFUv +tVMMzQ4zXu/zFpPPNRKsQp9arkyGSyRORnGaX8hfBAcgJr3OGCfsrJ/lqVZtOFHFb4x x969lGewEmoPUKJ4R23DwaewoG5Z+nCuz2OwEHgqCg2I1yyIV7h7i4LN2zfobSYyzRI8 vsyZcXOVkhT0zjEToaZBcqbA60Ul1ovWy5lPbimWcVv6ffz5U+wMDT0/0AQ9pZE7L0Ri MqPd8/w5H80DNQNmBOaVDnJoh6ROtq3hBGtRpqlcDOToZzOT6GWZwgjVzQFAqFj9Yrse iQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2w7psb2psu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Nov 2019 15:40:01 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E599A100038; Tue, 12 Nov 2019 15:40:00 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id CDDC92C5EB5; Tue, 12 Nov 2019 15:40:00 +0100 (CET) Received: from localhost (10.75.127.45) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 12 Nov 2019 15:40:00 +0100 From: Patrick Delaunay To: Date: Tue, 12 Nov 2019 15:39:58 +0100 Message-ID: <20191112153954.1.Iff44a1504ac7a1605e9ea0706753235c6b9cab15@changeid> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.75.127.45] X-ClientProxiedBy: SFHDAG5NODE3.st.com (10.75.127.15) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95, 18.0.572 definitions=2019-11-12_04:2019-11-11, 2019-11-12 signatures=0 Cc: U-Boot STM32 Subject: [U-Boot] [PATCH] video: stm32: remove the compatible "synopsys, dw-mipi-dsi" support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Remove the compatible "synopsys,dw-mipi-dsi" added in U-Boot (it don't exist in Linux kernel binding); it is only used to bind the generic synopsys UCLASS_DSI_HOST "dw_mipi_dsi" to the driver "stm32-display-dsi" UCLASS_VIDEO_BRIDGE This binding is done in Linux kernel drivers without compatible (dw_mipi_dsi_bind() is called in bind of driver, for example in drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c). This patch does the same in U-Boot driver, the STM32 driver calls during its bind the function device_bind_driver_to_node to bind the generic driver "dw_mipi_dsi" at the same address. This patch reduces the device tree differences between Linux kernel and U-Boot for stm32mp1 platform. Tested with v2020.01-rc1 on STM32MP157C-EV1 and STM32MP157C-DK2. The dependency of driver is clearer and the probe order is guaranteed. STM32MP> dm tree Class Index Probed Driver Name ----------------------------------------------------------- root 0 [ + ] root_driver root_driver sysreset 0 [ ] syscon_reboot |-- reboot simple_bus 0 [ + ] generic_simple_bus |-- soc serial 0 [ + ] serial_stm32 | |-- serial@40010000 ... video_brid 0 [ + ] stm32-display-dsi | |-- dsi@5a000000 dsi_host 0 [ + ] dw_mipi_dsi | | |-- dsihost panel 0 [ + ] rm68200_panel | | `-- panel-dsi@0 ... Signed-off-by: Patrick Delaunay --- arch/arm/dts/stm32mp157c-dk2-u-boot.dtsi | 7 ------- arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi | 5 ----- drivers/video/dw_mipi_dsi.c | 6 ------ drivers/video/stm32/stm32_dsi.c | 15 ++++++++++++++- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/arch/arm/dts/stm32mp157c-dk2-u-boot.dtsi b/arch/arm/dts/stm32mp157c-dk2-u-boot.dtsi index cd9947f166..18ac1e3cb2 100644 --- a/arch/arm/dts/stm32mp157c-dk2-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157c-dk2-u-boot.dtsi @@ -5,13 +5,6 @@ #include "stm32mp157a-dk1-u-boot.dtsi" -/ { - dsi_host: dsi_host { - compatible = "synopsys,dw-mipi-dsi"; - status = "okay"; - }; -}; - &i2c1 { hdmi-transmitter@39 { reset-gpios = <&gpioa 10 GPIO_ACTIVE_LOW>; diff --git a/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi index af5945d20b..ec60486f41 100644 --- a/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi @@ -14,11 +14,6 @@ spi0 = &qspi; usb0 = &usbotg_hs; }; - - dsi_host: dsi_host { - compatible = "synopsys,dw-mipi-dsi"; - status = "okay"; - }; }; &flash0 { diff --git a/drivers/video/dw_mipi_dsi.c b/drivers/video/dw_mipi_dsi.c index 04b07e3a2c..83d7c7b2c0 100644 --- a/drivers/video/dw_mipi_dsi.c +++ b/drivers/video/dw_mipi_dsi.c @@ -816,15 +816,9 @@ static int dw_mipi_dsi_probe(struct udevice *dev) return 0; } -static const struct udevice_id dw_mipi_dsi_ids[] = { - { .compatible = "synopsys,dw-mipi-dsi" }, - { } -}; - U_BOOT_DRIVER(dw_mipi_dsi) = { .name = "dw_mipi_dsi", .id = UCLASS_DSI_HOST, - .of_match = dw_mipi_dsi_ids, .probe = dw_mipi_dsi_probe, .ops = &dw_mipi_dsi_ops, .priv_auto_alloc_size = sizeof(struct dw_mipi_dsi), diff --git a/drivers/video/stm32/stm32_dsi.c b/drivers/video/stm32/stm32_dsi.c index cb89576e1d..12895a8f5d 100644 --- a/drivers/video/stm32/stm32_dsi.c +++ b/drivers/video/stm32/stm32_dsi.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -399,6 +400,18 @@ static int stm32_dsi_set_backlight(struct udevice *dev, int percent) return 0; } +static int stm32_dsi_bind(struct udevice *dev) +{ + int ret; + + ret = device_bind_driver_to_node(dev, "dw_mipi_dsi", "dsihost", + dev_ofnode(dev), NULL); + if (ret) + return ret; + + return dm_scan_fdt_dev(dev); +} + static int stm32_dsi_probe(struct udevice *dev) { struct stm32_dsi_priv *priv = dev_get_priv(dev); @@ -483,7 +496,7 @@ U_BOOT_DRIVER(stm32_dsi) = { .name = "stm32-display-dsi", .id = UCLASS_VIDEO_BRIDGE, .of_match = stm32_dsi_ids, - .bind = dm_scan_fdt_dev, + .bind = stm32_dsi_bind, .probe = stm32_dsi_probe, .ops = &stm32_dsi_ops, .priv_auto_alloc_size = sizeof(struct stm32_dsi_priv),