From patchwork Wed Jun 19 10:22:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 13703637 X-Patchwork-Delegate: kieran@bingham.xyz Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C093612F38B for ; Wed, 19 Jun 2024 10:22:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718792563; cv=none; b=PiZJMrfrblx1PAc8wR73chJv6H+6wwTKxGrhUOdcXgfzNxN07BWcC/MjXXaqYJDAVE+49melu5B2LYVfB99Q3GFC3ydP+aPbBYp6zovp60LpIOF42R6zRvXoNuj16o6af5ul6fJYNOpX74us/0P5kNipdiyN1c3w/AYrD1nkzQ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718792563; c=relaxed/simple; bh=s5GeQVun/P8JpAdhwwqNjJn/k36Xql8MREpnjfZaDWM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A9p/ndYkRzUpZJl8OPDsqVuE18mS6Jzm4FZ9wosQU5C/V34lIEq57xsCkg9lUxXOGL1pSJAt+2yqwDKfOreB07TbxQqPvFMpgY0/wQ9LgxCC6R5eoZCwgUF9KsqFFAUrsIg9ItV1j3Mm8Bm2o7GPoc3tJzeUqrncg2kg62aXEjI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=YFnkFLU7; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="YFnkFLU7" Received: from localhost.localdomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E91EEF89; Wed, 19 Jun 2024 12:22:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1718792541; bh=s5GeQVun/P8JpAdhwwqNjJn/k36Xql8MREpnjfZaDWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YFnkFLU7BNBibM/6yGfmWyndxZB/bjjGpVBk59C2nXoaQdUBsCqTchl8xTwNB7mU5 CgGnODCac+v92PJIkxOQ6Bnfq00Vkn44uwcKBgTxBoqpOuiE4aSZx9KnNHUJ6s0te4 sGIYqGbXhtnFndve/QfVytRrTIftwJzI041QkQ+U= From: Jacopo Mondi To: Laurent Pinchart , Kieran Bingham Cc: Jacopo Mondi , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org (open list:DRM DRIVERS FOR RENESAS R-CAR), linux-renesas-soc@vger.kernel.org (open list:DRM DRIVERS FOR RENESAS R-CAR), Takeshi Kihara Subject: [PATCH 1/4] drm: rcar-mipi-dsi: Fix CLOCKSET1_LOCK definition Date: Wed, 19 Jun 2024 12:22:15 +0200 Message-ID: <20240619102219.138927-2-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240619102219.138927-1-jacopo.mondi@ideasonboard.com> References: <20240619102219.138927-1-jacopo.mondi@ideasonboard.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Takeshi Kihara Version 0.51 of the Renesas R-Car Gen4 TRM reports bit 16 of the CLOCKSET1 register of the DSI transmitter module to be a reserved field. Fix this by correcting the CLOCKSET1_LOCK definition to match the TRM and remove the CLOCKSET1_LOCK_PHY definition, as the register is simply called "lock" in the datasheet. Signed-off-by: Takeshi Kihara Signed-off-by: Jacopo Mondi Tested-by: Tomi Valkeinen --- drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi_regs.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi_regs.h b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi_regs.h index f8114d11f2d1..1bf9c4717d5a 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi_regs.h +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi_regs.h @@ -141,8 +141,7 @@ #define PHYSETUP_RSTZ (1 << 0) #define CLOCKSET1 0x101c -#define CLOCKSET1_LOCK_PHY (1 << 17) -#define CLOCKSET1_LOCK (1 << 16) +#define CLOCKSET1_LOCK (1 << 17) #define CLOCKSET1_CLKSEL (1 << 8) #define CLOCKSET1_CLKINSEL_EXTAL (0 << 2) #define CLOCKSET1_CLKINSEL_DIG (1 << 2) From patchwork Wed Jun 19 10:22:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 13703639 X-Patchwork-Delegate: kieran@bingham.xyz Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D4BD82890 for ; Wed, 19 Jun 2024 10:22:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718792567; cv=none; b=lUV6oY7NG7NbsL2rWIy1NMFvt3zECmNvFRm60AlVkarlYOmt+mPoOWxdNxO+24j6PC3Kf6RuoSav4j2N4scuteyxrBSWuOJJ/KUdagHuK23ceQ5QKQOPZmP+VqSD5eXWKOAUEpSIPxCFZEW2yydeVKZZXeBX3C7c0wuHZrvqeKM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718792567; c=relaxed/simple; bh=LkqjVsjra+Xu0oLeFPfT/pyzgjb+wYakW5vKSvgV5w8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ONR5FrVvVLSw3YKeNGvfNqMDVJMD3yJHwrAgDCTBeosOSLxIVH0KmLXZJ/9IIJG2Zs6axgaP4J6DY1XTYPX9waqtasiCETzJYlPU8RsfLHfUolpxqgpBa7WadE8OryEh6QDLXcQL42E2Pi0n+1NNW/WucG9QyjhiqSImdwm42q0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=DcIxatKe; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="DcIxatKe" Received: from localhost.localdomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 90D121011; Wed, 19 Jun 2024 12:22:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1718792542; bh=LkqjVsjra+Xu0oLeFPfT/pyzgjb+wYakW5vKSvgV5w8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DcIxatKe+jmKXmh5aWDJzTJEgJ6o9JqmxDV65kNeh4DyuWcePgquJ9QzebpPGVPex +P5EuHZI01/Cr34hZw8UkqYILhXwly0/YdJy3WJAG1brZNTkTh5y/NZEIrjK0w2DtS en+2mho53FH7ZOPDrfWpUddmnmQ4T6rgo4fkjaRQ= From: Jacopo Mondi To: Laurent Pinchart , Kieran Bingham Cc: Jacopo Mondi , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org (open list:DRM DRIVERS FOR RENESAS R-CAR), linux-renesas-soc@vger.kernel.org (open list:DRM DRIVERS FOR RENESAS R-CAR), Phong Hoang Subject: [PATCH 2/4] drm: ti-sn65dsi86: Check bridge connection failure Date: Wed, 19 Jun 2024 12:22:16 +0200 Message-ID: <20240619102219.138927-3-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240619102219.138927-1-jacopo.mondi@ideasonboard.com> References: <20240619102219.138927-1-jacopo.mondi@ideasonboard.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Phong Hoang Add a check to the register access function when attaching a bridge device. Signed-off-by: Phong Hoang Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/bridge/ti-sn65dsi86.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index 84698a0b27a8..b7df53577987 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -696,6 +696,7 @@ static struct ti_sn65dsi86 *bridge_to_ti_sn65dsi86(struct drm_bridge *bridge) static int ti_sn_attach_host(struct auxiliary_device *adev, struct ti_sn65dsi86 *pdata) { + int ret; int val; struct mipi_dsi_host *host; struct mipi_dsi_device *dsi; @@ -720,8 +721,11 @@ static int ti_sn_attach_host(struct auxiliary_device *adev, struct ti_sn65dsi86 /* check if continuous dsi clock is required or not */ pm_runtime_get_sync(dev); - regmap_read(pdata->regmap, SN_DPPLL_SRC_REG, &val); + ret = regmap_read(pdata->regmap, SN_DPPLL_SRC_REG, &val); pm_runtime_put_autosuspend(dev); + if (ret) + return ret; + if (!(val & DPPLL_CLK_SRC_DSICLK)) dsi->mode_flags |= MIPI_DSI_CLOCK_NON_CONTINUOUS; From patchwork Wed Jun 19 10:22:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 13703638 X-Patchwork-Delegate: kieran@bingham.xyz Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D50082C60 for ; Wed, 19 Jun 2024 10:22:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718792566; cv=none; b=r6PVsMC+t2xZ+rKQXesGiuLypBGRsbhZ/F1q6gerGXDyTMhuMMJwpPmfIg/vtYN/ny7pScrLWXWoNx1pXU/kPYT7HznnmKjVZEQ8bL/6LcRIw4Rrh6fdbnnwhic3QTKN8qnVNzpCujF+W2qO8rScaB1h7RdVr9Ynfa4NI4sNlb4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718792566; c=relaxed/simple; bh=BuSkJfPLrQniOTiukXrLVq1EESPmQIaUh+RhxBypZWQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZoBq5UvG9WBV5wz2KPaT/GjAvXzff1jch/fiqWxdY6NpV2r+hT9UBgASwkaDdXnWW3CLtsAyv3Ms/AGmPL78Bt6hkURX5kXuqMbRiSW6Tuxf8SCqmKmlk7f+sNvYE6w4sWyOdWmyDaRTkUDrSWORXVqF8bBa7djyvBhh450jspo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=H/UR7E2f; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="H/UR7E2f" Received: from localhost.localdomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 37A1D11CF; Wed, 19 Jun 2024 12:22:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1718792542; bh=BuSkJfPLrQniOTiukXrLVq1EESPmQIaUh+RhxBypZWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H/UR7E2f+q7IG1oB4Mk5e/z1vSkv7oiWt41Oc4S6H+NuRLEGjunfzEW7TbesuViCa Tk1+kISIZmyFjRFD/Tm+m8RRSrn4PljyUNmYGg7hYBxD8tjS4iopu2eNOZvVhs9m9O 8kEaxlzNvJIXKSvptjB9OyUo2H/sVSIHHBCm8u3g= From: Jacopo Mondi To: Laurent Pinchart , Kieran Bingham Cc: Jacopo Mondi , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org (open list:DRM DRIVERS FOR RENESAS R-CAR), linux-renesas-soc@vger.kernel.org (open list:DRM DRIVERS FOR RENESAS R-CAR) Subject: [PATCH 3/4] drm: rcar-mipi-dsi: Add support for R8A779H0 Date: Wed, 19 Jun 2024 12:22:17 +0200 Message-ID: <20240619102219.138927-4-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240619102219.138927-1-jacopo.mondi@ideasonboard.com> References: <20240619102219.138927-1-jacopo.mondi@ideasonboard.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add support for R-Car R8A779H0 V4M which has the same characteristics of the already supported R-Car V4H R8A779G0. Signed-off-by: Jacopo Mondi --- BSP patch: https://github.com/renesas-rcar/linux-bsp/commit/61b876a8fa2c5d0f8049ecf29f24e3dd73ba9f8b --- .../devicetree/bindings/display/bridge/renesas,dsi-csi2-tx.yaml | 1 + drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c | 1 + 2 files changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/display/bridge/renesas,dsi-csi2-tx.yaml b/Documentation/devicetree/bindings/display/bridge/renesas,dsi-csi2-tx.yaml index d33026f85e19..c167795c63f6 100644 --- a/Documentation/devicetree/bindings/display/bridge/renesas,dsi-csi2-tx.yaml +++ b/Documentation/devicetree/bindings/display/bridge/renesas,dsi-csi2-tx.yaml @@ -19,6 +19,7 @@ properties: enum: - renesas,r8a779a0-dsi-csi2-tx # for V3U - renesas,r8a779g0-dsi-csi2-tx # for V4H + - renesas,r8a779h0-dsi-csi2-tx # for V4M reg: maxItems: 1 diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c index 2dba7c5ffd2c..d5800ef14a2f 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c @@ -1081,6 +1081,7 @@ static const struct rcar_mipi_dsi_device_info v4h_data = { static const struct of_device_id rcar_mipi_dsi_of_table[] = { { .compatible = "renesas,r8a779a0-dsi-csi2-tx", .data = &v3u_data }, { .compatible = "renesas,r8a779g0-dsi-csi2-tx", .data = &v4h_data }, + { .compatible = "renesas,r8a779h0-dsi-csi2-tx", .data = &v4h_data }, { } }; From patchwork Wed Jun 19 10:22:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 13703640 X-Patchwork-Delegate: kieran@bingham.xyz Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 056CF8287C for ; Wed, 19 Jun 2024 10:22:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718792569; cv=none; b=Bx/RBFt2kwdnTB9PXdJPOkV4JzksMssZ0aIBbNjUIGag4BeIlHqWdeZa/bnJM5S7kjUFyn0Bw8x8Vza/FgzvZH5YeWtqx6g3HN+Z2JATo7HjDlyd997L02ls/C6EpngeLB+YSj7tuiKH0DM57pYsDaPrzRP5A7KFMGGbZwqPP0M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718792569; c=relaxed/simple; bh=xJi0mpw5h2Tl1pzyNtLKb/aNVp40jhtNs1qUQWZHnZw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iqTX5KztRdr5TItmKtvtUVMO92wBi3CLtEIBNumF70fm7BwB+C6f9tVCo4QnIu96MOKxBNCOHGLJlguE1V1d1LeaWImF4zP6kKgAvLf2pvdsexhka6Kb5rhUeZL9DRrv1pfqbOvNwWnmyvnfcHSQAtPsOEuX2tFMKbHUOqJdgGo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=JXNDgq6H; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="JXNDgq6H" Received: from localhost.localdomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D6B8F1207; Wed, 19 Jun 2024 12:22:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1718792543; bh=xJi0mpw5h2Tl1pzyNtLKb/aNVp40jhtNs1qUQWZHnZw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JXNDgq6HzrxvZxLA9AcvgRN9kJoCjvFQIx9on7K60TVgDVEdq0n2H2mEtzg54UDC/ pGR9eheXydcXVUHy2cfIdo01UbiReTweiaOxWJOu+FnbXroXXHkWg3WPRvoZRPETmm N7VJ8gBFDK9n3j1aDgclZHobvCmTgEq8Rhzyi+GY= From: Jacopo Mondi To: Laurent Pinchart , Kieran Bingham Cc: Jacopo Mondi , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org (open list:DRM DRIVERS FOR RENESAS R-CAR), linux-renesas-soc@vger.kernel.org (open list:DRM DRIVERS FOR RENESAS R-CAR) Subject: [PATCH 4/4] drm: rcar-du: Add support for R8A779H0 Date: Wed, 19 Jun 2024 12:22:18 +0200 Message-ID: <20240619102219.138927-5-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240619102219.138927-1-jacopo.mondi@ideasonboard.com> References: <20240619102219.138927-1-jacopo.mondi@ideasonboard.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add support for R-Car R8A779H0 V4M which has similar characteristics as the already supported R-Car V4H R8A779G0, but with a single output channel. Signed-off-by: Jacopo Mondi --- BSP patch https://github.com/renesas-rcar/linux-bsp/commit/f2fc3314dab2052240653c1a31ba3d7c7190038e --- --- .../bindings/display/renesas,du.yaml | 1 + drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c | 18 ++++++++++++++++++ .../gpu/drm/renesas/rcar-du/rcar_du_group.c | 17 ++++++++++++----- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/display/renesas,du.yaml b/Documentation/devicetree/bindings/display/renesas,du.yaml index c5b9e6812bce..d369953f16f7 100644 --- a/Documentation/devicetree/bindings/display/renesas,du.yaml +++ b/Documentation/devicetree/bindings/display/renesas,du.yaml @@ -41,6 +41,7 @@ properties: - renesas,du-r8a77995 # for R-Car D3 compatible DU - renesas,du-r8a779a0 # for R-Car V3U compatible DU - renesas,du-r8a779g0 # for R-Car V4H compatible DU + - renesas,du-r8a779h0 # for R-Car V4M compatible DU reg: maxItems: 1 diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c index dee530e4c8b2..a1d174b0b00b 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c @@ -545,6 +545,23 @@ static const struct rcar_du_device_info rcar_du_r8a779g0_info = { .dsi_clk_mask = BIT(1) | BIT(0), }; +static const struct rcar_du_device_info rcar_du_r8a779h0_info = { + .gen = 4, + .features = RCAR_DU_FEATURE_CRTC_IRQ + | RCAR_DU_FEATURE_VSP1_SOURCE + | RCAR_DU_FEATURE_NO_BLENDING, + .channels_mask = BIT(0), + .routes = { + /* R8A779H0 has a single MIPI DSI output. */ + [RCAR_DU_OUTPUT_DSI0] = { + .possible_crtcs = BIT(0), + .port = 0, + }, + }, + .num_rpf = 5, + .dsi_clk_mask = BIT(0), +}; + static const struct of_device_id rcar_du_of_table[] = { { .compatible = "renesas,du-r8a7742", .data = &rcar_du_r8a7790_info }, { .compatible = "renesas,du-r8a7743", .data = &rzg1_du_r8a7743_info }, @@ -571,6 +588,7 @@ static const struct of_device_id rcar_du_of_table[] = { { .compatible = "renesas,du-r8a77995", .data = &rcar_du_r8a7799x_info }, { .compatible = "renesas,du-r8a779a0", .data = &rcar_du_r8a779a0_info }, { .compatible = "renesas,du-r8a779g0", .data = &rcar_du_r8a779g0_info }, + { .compatible = "renesas,du-r8a779h0", .data = &rcar_du_r8a779h0_info }, { } }; diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c index 2ccd2581f544..361e1d01b817 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c @@ -111,6 +111,8 @@ static void rcar_du_group_setup_didsr(struct rcar_du_group *rgrp) /* * On Gen3 dot clocks are setup through per-group registers, * only available when the group has two channels. + * + * R-Car V4M (R8A779H0) has only one channel, index is == 0. */ rcrtc = &rcdu->crtcs[rgrp->index * 2]; num_crtcs = rgrp->num_crtcs; @@ -185,11 +187,16 @@ static void rcar_du_group_setup(struct rcar_du_group *rgrp) dorcr |= DORCR_PG1T | DORCR_DK1S | DORCR_PG1D_DS1; rcar_du_group_write(rgrp, DORCR, dorcr); - /* Apply planes to CRTCs association. */ - mutex_lock(&rgrp->lock); - rcar_du_group_write(rgrp, DPTSR, (rgrp->dptsr_planes << 16) | - rgrp->dptsr_planes); - mutex_unlock(&rgrp->lock); + /* + * Apply planes to CRTCs association, skip for V4M which has a single + * channel. + */ + if (rcdu->info->gen < 4 || rgrp->num_crtcs > 1) { + mutex_lock(&rgrp->lock); + rcar_du_group_write(rgrp, DPTSR, (rgrp->dptsr_planes << 16) | + rgrp->dptsr_planes); + mutex_unlock(&rgrp->lock); + } } /*