From patchwork Fri Mar 3 14:51:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2764 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id ADBAF44AA6 for ; Fri, 3 Mar 2023 15:52:22 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id t11-20020a170902e84b00b0019e399b2efasf1515803plg.11 for ; Fri, 03 Mar 2023 06:52:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677855141; cv=pass; d=google.com; s=arc-20160816; b=qikGovV2YEqEhdSyZ0rRwJYYke96mACpncL6R1JRDHf/MBQjlZriAVk1duzFSSxtwu Kxa7H5TAnYbDrF6ByYVL2Xgg+TU7bQFSXvy0kW0eKcQFqlkPMVXOZ9EBpf53jjSzkVZX c3FkutDHoZzOsDwpOjl/zZJG7rJHIFYh3W3xllBsk6V4xPul6D1LFm35Nd2ufrAPbNjj pUwZzXIjsxK/es2whty0ymoQojnHYzxV/o4FZlgyeiGVTTh7qfZyce+6PCc3QfkiQml5 K/e3KVyKyttULmakXiV0IYSt3KQO8+kPGJg7cIuI4HDplUB8Y3kKnF8dWqc2Z36nNX+S bQ9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GhR8VPODBWIEp+OeBTXJjaIeKsPqKzQV8Z0splIw1bA=; b=UtO0apBcXV6v5KhuVgMBmsfB6gthA7NZhpHz5MQUU0a7GPVv0cuMsBecmV5tHK4lx5 pu8u7QGnGT3IL3TfmZtExt1n8wT4WjaqCFojVw7ZF24OQR3xuXrSMrd1RhUVAok0WwjX 7AdAw34kKdftVESaSm1DsD7HgZ/5+Bzj5TUY7VZsIcEPymyYPxoZtFqGS7/lzuhC2oSB YHAdOKOWQBrKSWDbYmE9qQwVpXYcwZXvaeh1IT8uhcubWPOGst7Z9Tnx+G/QA4Cjb5aJ d+ttQwL3MAG/P5fGs4N8E5RVCKnQGzZTzz9wfEJYmNT9PkgxNJURP4voU7bmC2Zh2OzA Y6YA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hGkxGdF7; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1677855141; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender: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=GhR8VPODBWIEp+OeBTXJjaIeKsPqKzQV8Z0splIw1bA=; b=JC7WUovUD/BxEGZQVy69xoCxhZUbGGZzxWQOs8As4TRJWFycKsbCl/6UzLGu1kSLTH VWQdG5MCOXb7zXe37051dLN2HIkDM27dQqAGctaS+7OlXx9HESFYNxm+DP+usguL8Hlm XuA1k6bRY3UlnrLo0dCH8mVM/O4wIFDEQ31vI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677855141; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :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=GhR8VPODBWIEp+OeBTXJjaIeKsPqKzQV8Z0splIw1bA=; b=HTSHkSx6YVIUMaVhDS28oUZNSAWXJzlLiIOnZyZ7UwtSEz1VvL8zeUwrM3uckwQul4 y9x8w4A/w89FnKYbklCI0feJVReadaqhe3rFuImzAvtwpYAUhxljsN0cUlxsxuTwFj7E ntt/b4tHa8lPRooKz1PbxSrEYNX/+Hp6eNeO3CYGGWtLyH3oIOwdMgLZaNvBXUZtGj17 aaYCwS51SOZtnTwtyEeDZPDEp/xaATio/sJvWTqicIVM8jOBi92z4ghMI2jR+MIojck5 tCOyIZwyRdq+OJzYhvhK24JMwbNROouhq7/BPWnoZM6NrzxNi0boUT9Z2dqkpRpbJ3q7 JMKw== X-Gm-Message-State: AO0yUKVKnrsV1/zM4iHVJMBV946ZXkQRwkovEF3bFv7/4fmohJXQnePd /74K2axxg7Rmm2Ee7Pzo1DduvCEW X-Google-Smtp-Source: AK7set91Zp1MHIvK4D0IIVfy/eIu0xPKLCKGJowv/chmvwniYzw7qNznalOSx3VRlJYbZTnvMqEkHQ== X-Received: by 2002:a17:903:3249:b0:19b:20a5:c18a with SMTP id ji9-20020a170903324900b0019b20a5c18amr788719plb.12.1677855141302; Fri, 03 Mar 2023 06:52:21 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:7563:b0:225:cae6:ff24 with SMTP id q90-20020a17090a756300b00225cae6ff24ls2753745pjk.2.-pod-preprod-gmail; Fri, 03 Mar 2023 06:52:20 -0800 (PST) X-Received: by 2002:a17:902:e848:b0:19e:6a6a:ddf4 with SMTP id t8-20020a170902e84800b0019e6a6addf4mr2658271plg.51.1677855140290; Fri, 03 Mar 2023 06:52:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677855140; cv=none; d=google.com; s=arc-20160816; b=JI/uEyV6Yc+DgeJP8w32DyvYUxbCerfXgA3oLGD8OC61sAfbIAj3q4u8B7kmDXwZA6 qb0ZmkOunj2bQzbuvX/wV2wZa4tU8Ta6lhkHwmO/sUIGai/4KJVweXfcP+tTgr3249Vq q8MGh7RbV92OQZUVxVJpQ6b6oJR/chm0Ms/lxmqrFr5MrXr5gQJXTUR785Vqj544AuwT Q96Djs9ySYZ8SqwYjPOuWMfraZRlhWwg5cP3muUjup4uUx7DGYbDJyIdlQwvKe9ywdzb TYZHoLk2Xi7X9p0SoY9lsaLqqMCHuIJAwxpG4FQb2/L1el2sCFDvnT2voAO2pGGLHyV7 vwNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=VXMF7IvJ5lsdZk4pO/zptMJoKK8XksLiBme5rkpOyuQ=; b=B3jfCgoXaH87rAIAQ42X1Bk59iGOR5p/xf/Y9hO/kfSd1RodKThsSvOIdH0pbC3Kvh 5DAizppRMUFsmkzHcAY1i6Tm51R1TYBVmZEWcbXXJP3E+XQVZFAaVxA0RTexNLWHfX5z uWmr9NOcqYJg4/f5utF9veGNyZL1KaiXZLKjmenTECVOGMOW3pX/rww12Ea9mOtrTPlS iO72Iyavq4W5PRYW1LTHHBXSdl/8DU96YTyHie5UFJN49SnZ+mh5/lq3jsYifSQRqVaV 7bXBqbnJ+uwN4/i9mT9ABQRFxlXubZLD9pyyga0nba8L4+IkQUAi0BQH2Y88IQlU+v8X sB4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hGkxGdF7; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id p3-20020a170903248300b0019c97fadf44sor1205762plw.15.2023.03.03.06.52.20 for (Google Transport Security); Fri, 03 Mar 2023 06:52:20 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:8f0f:b0:cb:7f0d:e25f with SMTP id b15-20020a056a208f0f00b000cb7f0de25fmr2918924pzk.41.1677855139916; Fri, 03 Mar 2023 06:52:19 -0800 (PST) Received: from localhost.localdomain ([183.83.137.89]) by smtp.gmail.com with ESMTPSA id z4-20020a63e544000000b00502fd70b0bdsm1660856pgj.52.2023.03.03.06.52.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 06:52:19 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Neil Armstrong , Marek Vasut , Maxime Ripard Cc: Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-amarula , Jagan Teki Subject: [PATCH v15 01/16] drm: exynos: dsi: Drop explicit call to bridge detach Date: Fri, 3 Mar 2023 20:21:23 +0530 Message-Id: <20230303145138.29233-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303145138.29233-1-jagan@amarulasolutions.com> References: <20230303145138.29233-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hGkxGdF7; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Exynos DSI already converted into a bridge driver, so bridge detach will suppose happened during bridge chain removal done by the bridge core. Drop the explicit call chain to detach the bridge. Signed-off-by: Jagan Teki Reviewed-by: Marek Vasut --- Changes for v15, v13, v12, v11: - none Changes for v10: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 06d6513ddaae..df15501b1075 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1531,8 +1531,6 @@ static int exynos_dsi_host_detach(struct mipi_dsi_host *host, struct exynos_dsi *dsi = host_to_dsi(host); struct drm_device *drm = dsi->encoder.dev; - if (dsi->out_bridge->funcs->detach) - dsi->out_bridge->funcs->detach(dsi->out_bridge); dsi->out_bridge = NULL; if (drm->mode_config.poll_enabled) From patchwork Fri Mar 3 14:51:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2765 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 9522244AA6 for ; Fri, 3 Mar 2023 15:52:28 +0100 (CET) Received: by mail-pf1-f199.google.com with SMTP id a10-20020a056a000c8a00b005fc6b117942sf1464428pfv.2 for ; Fri, 03 Mar 2023 06:52:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677855147; cv=pass; d=google.com; s=arc-20160816; b=lF4zuCqJ8/lWVAg4tgiu/Aea3FJD3Y46GGI2uplNAJ2so7b2NH5Z2fFU/0z1BCZjJF 1zz1pPaVitIiBK6jwcvwE6cKjviHE5F0umxRw8p9iFD/vR9NDMa+05tDCZjgjQTIWZXN +oSQNcNxi9uZFCQ9houhpRXdQjQxZPBxmKyqhM+uCeM5GSlc33HYiJbFI13MxqD4YtcC Rs2R9+cxBLh1OOD1oKFNM3JrnGI1B5qZf2J/J2wI9Gri1AFtUbhvwzr7Q4WBRtYRe+ad 77zAtR5sK0awxPyPNYEMXx/akRJvVmHEq1xMXLTxZ3D7TubLsT5QMmzhNa31NMlrLdrn LxfQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=11TLyARijp55z/SM3bsSCPN5MrNK7ssrAa6VWn15b48=; b=LcLoahArPtMe9aJmKwSccVY9N2mieofXqo37LYmgGr5lmYhUpfc7Y3KnNBJhfXJiHk eBzXLYuZ7Y1MhrrJs4i6LuycXLzccjqiXwlj7ec8q8cdfkKeVmauqt+B5Ar2e+TvPUm7 NnfXTporbCQbPUJh0ksjR6gjIi62Mjl1rL8XhIgdzi5AJPf7tEfEw72eNA8k7mci47Ld qXmSPqbqkWA5nNA12Axa5+YqBTMvKnRqdGxEHz0quEMdOtl8lK81KjV1GqmnFH2zFJ9d +gsS3sU6g3HzniTd23odarOs3BrJCHgtmvpY6kOw0LVLgUUKD6K6oVj7VWioK4LhLeOf P19g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nwx3nUHw; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1677855147; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender: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=11TLyARijp55z/SM3bsSCPN5MrNK7ssrAa6VWn15b48=; b=gVmYkJRnhrk5ueXfMJ2/LO0OK/gGufhjwx7CwWU7h+aRwf4ZPo7FR0tg7IYaqptCrW djKja0gCnrrWvK6LZ4MRkVRWK621bOIfop7kvmKaBgoEsLG/eH/sI+KMycHM5Ow4b5ay ss8fpElxm+9VqXV+s6t4+8d7QP7Y7zJBoBKhI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677855147; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :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=11TLyARijp55z/SM3bsSCPN5MrNK7ssrAa6VWn15b48=; b=kkbJWriH+raFNTCBO0vk7nYsVdo2Mgup8GbZYG1gd6loqM+9WvRU8f83O3umlLu2kE RHtEnd2mzVTPXn3O0IZBUxolcSW4dS36Gh/9cwoxi+p5XsMV/A/rk6n8qykxtzp2FGr3 tGZHx1gnUuAWSi9dGSK2ej0FLQR+ckEfuoVPay9n9v6sQzhLy8iA3ccn9mkaA91WCXVe +V7jmICz/Ylc0HrHhLhWd1SJUfSqOOFc+3CjFHziwNd0ZXZpCzBEGOtq/svpczV9YuLd 1bvvWCSFkFR/XCiYqYF03HPJgqtpgLC2hTy5kIKnGJ3gnwLkikHIoc5QnvNJaeJs4d3P gA8Q== X-Gm-Message-State: AO0yUKX8FYEQVNl9XQkDWrZA+WTIob5xSxyiOFjPe3f9lflS1JXMoehQ POnCHlmMRWdWdkn9mpB3whn2ud+1 X-Google-Smtp-Source: AK7set+SE6Mpxca1TiukAPUCKe/slJdfQLu5Sn1pEZ9wrK7icIDNsP1rPhx1rH+7DVJMJiXnnzlEfQ== X-Received: by 2002:a63:7512:0:b0:4fb:933a:919 with SMTP id q18-20020a637512000000b004fb933a0919mr577843pgc.3.1677855146835; Fri, 03 Mar 2023 06:52:26 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:c3c5:b0:19e:398b:8d99 with SMTP id j5-20020a170902c3c500b0019e398b8d99ls3200705plj.4.-pod-prod-gmail; Fri, 03 Mar 2023 06:52:26 -0800 (PST) X-Received: by 2002:a17:903:2450:b0:19c:e484:b45 with SMTP id l16-20020a170903245000b0019ce4840b45mr2610037pls.27.1677855145826; Fri, 03 Mar 2023 06:52:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677855145; cv=none; d=google.com; s=arc-20160816; b=BfYVYtR4enbRIzpsD2zEPOccmkrNWq3lWX5+epez9dAzAPREkfChUtGjSLdO0x5R/Q aXIoX0dpCKA1XJrJyBu3wX0s1Dk0l9oiYOZxaeyMuhAGHr+Nw7fjdKDxMCOvyN/jRHdS aLe60nZ6DFTXdM4rGZ3+wZqC8Oan5xoACgcrz1/dOd0LL3grZ9MLZZsLM0NxXhI6giOo J9TKTUlzePbuWFCdxYH0+i1iyKS9pv5AVvLhNahHsxEOWy9+NHD3C1akwXklTvUfPFdZ NYk88qX8nmm8FeHeob8tGYCewBYu0IuN4U9RvhT4hWYtidLbknDXRikQJ1OqngfV4yJs 2G3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=75obg6WaKxGAouYp8L8vU99A5I1ZieLyIbshRx9ot/0=; b=HOXhLmwVsKVWBjcjHzmzHEaHvI7lWHYna5aDg8OVMjthWrlIpHz2IXg/n0iO4bFE2N O35yhDzBVf+zzmodbUQt5wVWVwv00QI594BsaQBzWwGS/S0oPCMw2xql+j2Ewp23lo9J ABe0TIuAp1ALbbngQvzyHlgwkGRpOGo3QMblrBF2BfrfahAgIvHfm+6IS53kKrFSmtCW xmnKXosogn50CnYvMlF5WqFe5/15TJRS5yHrKL6hXtwhzuiLXwmPppBi/zLJX1v5yLhj JHobX98U0qN8K7oAdjbLxc6tnLptZU4MIaQNxqQaLNIlZ9aeesFrR3JxMx4AcFU2e9PZ vVfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nwx3nUHw; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id b7-20020a170902650700b001994928ec9dsor1077956plk.46.2023.03.03.06.52.25 for (Google Transport Security); Fri, 03 Mar 2023 06:52:25 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:5487:b0:c6:d37c:2a62 with SMTP id i7-20020a056a20548700b000c6d37c2a62mr2981782pzk.11.1677855145441; Fri, 03 Mar 2023 06:52:25 -0800 (PST) Received: from localhost.localdomain ([183.83.137.89]) by smtp.gmail.com with ESMTPSA id z4-20020a63e544000000b00502fd70b0bdsm1660856pgj.52.2023.03.03.06.52.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 06:52:24 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Neil Armstrong , Marek Vasut , Maxime Ripard Cc: Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-amarula , Jagan Teki Subject: [PATCH v15 02/16] drm: exynos: dsi: Lookup OF-graph or Child node devices Date: Fri, 3 Mar 2023 20:21:24 +0530 Message-Id: <20230303145138.29233-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303145138.29233-1-jagan@amarulasolutions.com> References: <20230303145138.29233-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nwx3nUHw; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In general, for MIPI DSI there are three ways to represent the pipeline for an upstream bridge to find the connected downstream panel or bridge. 1. Child panel or bridge as a conventional device tree child node. 2. Child panel or bridge as an OF-graph port node. 3. Child panel or bridge as an OF-graph ports node. There are three different downstream panels or bridges that are possible to connect an upstream DSI host bridge - DSI Panel, DSI Bridge, and I2C-Configured DSI bridge. An example of the downstream panel represented as a child node, &dsi { compatible = "samsung,exynos5433-mipi-dsi"; ports { port@0 { reg = <0>; dsi_to_mic: endpoint { remote-endpoint = <&mic_to_dsi>; }; }; }; panel@0 { reg = <0>; }; }; An example of the downstream bridge represented as a port node, &i2c4 { bridge@2c { compatible = "ti,sn65dsi84"; ports { port@0 { reg = <0>; bridge_in_dsi: endpoint { remote-endpoint = <&dsi_out_bridge>; data-lanes = <1 2>; }; }; port@2 { reg = <2>; bridge_out_panel: endpoint { remote-endpoint = <&panel_out_bridge>; }; }; }; }; }; &dsi { compatible = "fsl,imx8mm-mipi-dsim"; port { dsi_in_lcdif: endpoint@0 { reg = <0>; remote-endpoint = <&lcdif_out_dsi>; }; dsi_out_bridge: endpoint@1 { reg = <1>; remote-endpoint = <&bridge_in_dsi>; }; }; }; An example of the downstream bridge represented as a ports node, &dsi { compatible = "fsl,imx8mm-mipi-dsim"; ports { port@0 { reg = <0>; dsi_in_lcdif: endpoint@0 { reg = <0>; remote-endpoint = <&lcdif_out_dsi>; }; }; port@1 { reg = <1>; dsi_out_bridge: endpoint { remote-endpoint = <&bridge_in_dsi>; }; }; }; In, summary it is possible to represent all three downstream slaves devices using OF-graph port or ports node however only DSI Panel and DSI Bridge are possible but not possible to represent I2C-Configured DSI bridge child nodes since I2C-Configure bridges are child of I2C node, not upstream DSI host bridge and it is must represent them endpoint port linking. This indeed means, the OF-graph port or ports representation is mandatory for I2C-Configured DSI bridges. This patch tries to add an OF-graph port or ports representation detection code on top of existing child node detection. It is possible to replace the entire detection code using existing drm_of helper drm_of_find_panel_or_bridge but it will break the Exynos DSI since the pipeline doesn't support OF-graph port or ports node. Overall, this patch has a combination of child and OF-graph pipeline detections in order to support the backward compatibility of Exynos DSI child node and i.MX8M Mini/Nano/Plus OF-graph port or ports node pipelines. This is the first common DSI host bridge driver that needs to support all possible downstream connection pipeline combinations. Signed-off-by: Jagan Teki Reviewed-by: Marek Vasut --- Changes for v15: - droped from drm_of - added in exynos dsi - updated commit messages Changes for v13, v12: - none Changes for v11: - drop extra line Changes for v10: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 38 +++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index df15501b1075..f44a5a702ad5 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1470,18 +1470,52 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, struct device *dev = dsi->dev; struct drm_encoder *encoder = &dsi->encoder; struct drm_device *drm = encoder->dev; + struct device_node *np = dev->of_node; + struct device_node *remote; struct drm_panel *panel; int ret; - panel = of_drm_find_panel(device->dev.of_node); + /** + * Devices can also be child nodes when we also control that device + * through the upstream device (ie, MIPI-DCS for a MIPI-DSI device). + * + * Lookup for a child node of the given parent that isn't either port + * or ports. + */ + for_each_available_child_of_node(np, remote) { + if (of_node_name_eq(remote, "port") || + of_node_name_eq(remote, "ports")) + continue; + + goto of_find_panel_or_bridge; + } + + /* + * of_graph_get_remote_node() produces a noisy error message if port + * node isn't found and the absence of the port is a legit case here, + * so at first we silently check whether graph presents in the + * device-tree node. + */ + if (!of_graph_is_present(np)) + return -ENODEV; + + remote = of_graph_get_remote_node(np, 1, 0); + +of_find_panel_or_bridge: + if (!remote) + return -ENODEV; + + panel = of_drm_find_panel(remote); if (!IS_ERR(panel)) { dsi->out_bridge = devm_drm_panel_bridge_add(dev, panel); } else { - dsi->out_bridge = of_drm_find_bridge(device->dev.of_node); + dsi->out_bridge = of_drm_find_bridge(remote); if (!dsi->out_bridge) dsi->out_bridge = ERR_PTR(-EINVAL); } + of_node_put(remote); + if (IS_ERR(dsi->out_bridge)) { ret = PTR_ERR(dsi->out_bridge); DRM_DEV_ERROR(dev, "failed to find the bridge: %d\n", ret); From patchwork Fri Mar 3 14:51:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2766 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id ECED144AA6 for ; Fri, 3 Mar 2023 15:52:33 +0100 (CET) Received: by mail-pg1-f199.google.com with SMTP id e127-20020a636985000000b004bbc748ca63sf813055pgc.3 for ; Fri, 03 Mar 2023 06:52:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677855152; cv=pass; d=google.com; s=arc-20160816; b=C434PdfYyiwJVUIVB01sMQpVEsRNJZZYvPUDgMD3zjjU2Q1Ryceb7O3XF8YWg51TQI 8mFhgYsZ9+Uypk+ke8oODm/dPlTrIQ6hmp7hGZvp1OXRRZ0QJSRsdVlGYijMkQAZJZZx v+r7+YL2amXOqnQFNejj0Fptawy3lm0eSG7chm4zAYoYSn2PC/EpeaDy59uTREE0QsGh iyt+Q16RCtFU/jySO16vahEzP77poRi+Cg3bt6+DzAcCjwshE+Wo7BM2UCT9zmziVkBm xULcJ/yqDPWxTjHyF5n35bNkf5Q3ZwqM9pTNdlPmCjkbf07frG1DaDHrOfUhdAj8iDqj r5FQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=4X9MB0hbB5UgpJFHiwabTQne2ZFjev+tPYEdg4CA9do=; b=CMijU+JP03k63kik1cVBKpQSBosONkS+7G94eOtI6C2BvX+OA+utAJgiGgXqLxAf/R dbyu45eiSuwMT3me/pIif6YNP8fSZrIeuhxNak5CrUkET1xzzsTt4XhEJ5aSjs6WTeno pjrf0TLfAk9ou5xpxScZtBvwUxqYrA772mYDDKOazp7/v4A4ANKEFm0J2wt1YqcCd17I PdsZFg3Hj6Aw/vdw9cnxPJVyUyNxV+m1oQhnmfTqsHAu9RRTWm0a89aaO3M6AnZ9i8bn 0hWoLxFJC3sflhFjcAPWR1sChAOL6VE5yi2vtpEQ1TuRyslIE9f/R8PVuNk7tkVcbD98 9QrA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=g1hTmqTL; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1677855152; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=4X9MB0hbB5UgpJFHiwabTQne2ZFjev+tPYEdg4CA9do=; b=rch3ixvrt3t4tpRQ1N+6B06RbZePmqv0MCfe0n+y8WVwYqaKSCZqxLuDxWc9g7hA2b a1zFCuLA2H6qjCj871DixqQSInO1yN2I3aJHQm+6EEnO4tIHHwoIvwNLWiWqL/xhVu3p Q/G3IghBWl7fKpmbwueJJWijWrrcGCgusYWeA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677855152; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender: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=4X9MB0hbB5UgpJFHiwabTQne2ZFjev+tPYEdg4CA9do=; b=7JqeEQGGQQ/YIC+9SNZ9rjMgrT/400XQwwEn1VIUEbDGUwPkvWb6RyYFAk13tQvx6F RqAeVDtsayp8hE+3SXDf3LZT63GNLDHIxjgDmvBkrZtkddUZOT6q20Fk1OCMD/bCNDui v48G2SqLFAh++WKC4urdiYKf9e70CF69oLC5A/KAdKcPPHiNqe+Rp7eugtIA7pqRSZvu zMc7rVVcT0TDmz6C6kM2c0QriWWV2ja/uy7CrzmS4phDx79NH3RuIXp1eJ/CFPlGzbn1 qDz+ICVCe9+77AIS+ZA8ksMqmXJnWR0yKl5f/RYS6LaJjAn11E7AfmjD0wlTdbOjOiQj Cz7w== X-Gm-Message-State: AO0yUKUEP+6cn+9M2N47ZGqJqK2Mw0ZpgBBnYkU13+LWMSNaV3dTVjHQ 25OIynMMiUOyctoOFBW52tJ0w3DA X-Google-Smtp-Source: AK7set+70Co0Feh0EYkDp33L/fquUAxUG3C4fiN+KnhMZ7PxVBc/k5BcZgo/9HIWeEbJcqa1JNKL+A== X-Received: by 2002:a63:7f52:0:b0:503:2542:dbaf with SMTP id p18-20020a637f52000000b005032542dbafmr577911pgn.8.1677855152552; Fri, 03 Mar 2023 06:52:32 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:e80b:b0:19c:b122:6f2d with SMTP id u11-20020a170902e80b00b0019cb1226f2dls3213107plg.2.-pod-prod-gmail; Fri, 03 Mar 2023 06:52:31 -0800 (PST) X-Received: by 2002:a17:903:514:b0:19e:68e4:859c with SMTP id jn20-20020a170903051400b0019e68e4859cmr1745522plb.36.1677855151526; Fri, 03 Mar 2023 06:52:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677855151; cv=none; d=google.com; s=arc-20160816; b=uB2mb2IHSfZDV/azg9Em1+zzqGaOImpGskmQxHrrN4h5wo17Nz6Ca4mb4dMNPoEfdi hHYT/t7qR7xjJiQJD4FLzTKTtzNiS37sB/z6Y+AV+72FmpcZBo8HvwqaHorKkjd2hqf8 wJKewiowoNbANP0JFJVcU6U0pp3JV+E0lge0XKO2YDxkFGebjO5fhhqjj9u4oc23ouWr adJFjo1ltCz0IPEYJW/oqiDnLNSXJFPSN7/UgghDxPkXQoJI4Oar6yrZO305JPZcJq0O Kx1i6UpcsGVxOMZe9NyjWfdCjso3GOn5jj8O1YRpO3uA6+VMg9Wyr67HHRseinQosheN ICyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=7tZxKcA0ycBEYEtLsRm0mag1bTn00Dn2OB4UXN+PrCA=; b=RFm08czsrk34T+DOzsutwc7gXqAH+BN6xQNshxXsQ1H1wNMMoGCQBKVNJrJrNSuNBE xLbzmA7YWCxRiJ8ojKzaB+rnfdwBoM98VZc1vft/oV/jmbRi5BM51/btQ17vNXkCM48f BQf16AuJJAgGeSdrBt9eEo5y7Xq8lJWA+oYTQJXGgMxOEdXiy9BTeoEbltij+06KyTJF 7URze7SYkHOk1iEv3N6Ux6V7l/uVwIEgJfowoAu56UpWa6/Gsn1goB8mulJdVsfCtaru zP9sRUnVq6RbHPu7TYibnZE53+xKT110Y4r58AxXX8xD5TNeVcE6N2+8zuwDu//RCzfP nN+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=g1hTmqTL; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id h12-20020a170902680c00b0019c774043e8sor1154103plk.202.2023.03.03.06.52.31 for (Google Transport Security); Fri, 03 Mar 2023 06:52:31 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a21:6da5:b0:cc:46bd:39b0 with SMTP id wl37-20020a056a216da500b000cc46bd39b0mr2717652pzb.56.1677855151204; Fri, 03 Mar 2023 06:52:31 -0800 (PST) Received: from localhost.localdomain ([183.83.137.89]) by smtp.gmail.com with ESMTPSA id z4-20020a63e544000000b00502fd70b0bdsm1660856pgj.52.2023.03.03.06.52.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 06:52:30 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Neil Armstrong , Marek Vasut , Maxime Ripard Cc: Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-amarula , Jagan Teki Subject: [PATCH v15 03/16] drm: exynos: dsi: Mark PHY as optional Date: Fri, 3 Mar 2023 20:21:25 +0530 Message-Id: <20230303145138.29233-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303145138.29233-1-jagan@amarulasolutions.com> References: <20230303145138.29233-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=g1hTmqTL; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The same Samsung MIPI DSIM master can also be used in NXP's i.MX8M Mini/Nano/Plus SoC. In i.MX8M Mini/Nano/Plus SoC the DSI Phy requires a MIPI DPHY bit to reset in order to activate the PHY and that can be done via upstream i.MX8M blk-ctrl driver. So, mark the phy get as optional. Reviewed-by: Frieder Schrempf Reviewed-by: Marek Vasut Signed-off-by: Jagan Teki --- Changes for v15, v13, v12: - none Changes for v11: - collect Frieder RB Changes for v10: - add Plus in commit message - collect Marek RB Changes for v9, v8, v7, v6, v5, v4, v3, v2: - none Changes for v1: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index f44a5a702ad5..af16af404e87 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1732,7 +1732,7 @@ static int exynos_dsi_probe(struct platform_device *pdev) if (IS_ERR(dsi->reg_base)) return PTR_ERR(dsi->reg_base); - dsi->phy = devm_phy_get(dev, "dsim"); + dsi->phy = devm_phy_optional_get(dev, "dsim"); if (IS_ERR(dsi->phy)) { dev_info(dev, "failed to get dsim phy\n"); return PTR_ERR(dsi->phy); From patchwork Fri Mar 3 14:51:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2767 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 960A344AA6 for ; Fri, 3 Mar 2023 15:52:39 +0100 (CET) Received: by mail-pf1-f200.google.com with SMTP id i7-20020a626d07000000b005d29737db06sf1466020pfc.15 for ; Fri, 03 Mar 2023 06:52:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677855158; cv=pass; d=google.com; s=arc-20160816; b=fh0L41utSMaI5HqSJ2ffvhyWJ7aiDf0MSqoBwSgoyK+oRnNElEScX15O3nivDcobCh 0N1p+I0LqbKAKI3qzA8cJzulcGFKBgWY3xVnKrjH4b6tDWSNLpxmQifwYN5oUz2Nhl9Q lGKIC2RtOpG4/WgLwSUXqxAbVxv/aj09lxOR8hVtx54DP46/pDkYiN2MX/92vNMMTCax KtrT5kfdpXhcAWDZvkwpVI2Lsgr8wu9q6hiYT7fbCq8sccB6UfYooRnrsXiFcw2I/0r1 oTZKiWgtjNLJMZu8U00c6efzLB3o+zx0oq/AvtUIKBW+4lhHA9UKX6TZOHnJh+owl8VK y2gw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=w9oTgxbno2bIIYVZCK4FpELF4/vbcrjO4n4QYy9HxPg=; b=Gc3setvyRMGI1rMVt/2E3rRp7tlIdG//2fxCBnmM6ERxih6ixPrU56VnOwJWULF0ss eoRycmD2RyAogVIejNHBDvtRoj1ZQEdGGJtC1nVpfPzG6PF8npjzQy/GhGiw1D0hmOxv rknRFpoRy0i+C7YSMgRdHpzR4NgJ7JYoS8ofAyF4iCYm1MAGGJsiaJuvYs3ldm9XRXLw y8f3vZNp9cJlZPu929FqBG90HtAVg7QlBRm1Rsr46J+2YytakzTLrFwa0pMZpZiKP/Ow wbE4qRw8uBQKXzdqwvxRMRT2u5J3ysboYjunBWwKsSIG+NgbEEmJ7+aeqOWUQcKIcilx fydA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qry+BcDj; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1677855158; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=w9oTgxbno2bIIYVZCK4FpELF4/vbcrjO4n4QYy9HxPg=; b=CWOSJZ57HP/4+OV7OHR5FzXIm/pqj+m3IPqiESoxvwv39T6oAmDV23k4zdEfH3xWi7 uxlDT0R//ph316eNaDFvYQV07z1sOE1VFEVL/akXPm/W/9ad1OCiBUtgjINH2lgPK+k5 3vla+/PJa1BAYhZ5i0U07xFi444lAtxSk2U/g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677855158; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender: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=w9oTgxbno2bIIYVZCK4FpELF4/vbcrjO4n4QYy9HxPg=; b=ERvy49030ZfqOWWKbDJHX6o0jUF27HkgkUm/4qtWvY/O1p2xSnfmqQyHlY3PxVk37v AI6Zq98A7JX8YtFjnzVvuNhvu1ZY6P2JHH2zcMMasHBH5oY18qtqsHufVz2G6Nqmy2Fk +4QLeo/8O5ad8AkoeIhU+klfjMJZFX8TloPYaqU1QauzLcE+QK9Lk4Rl15ET6kZ+3XeF UiqQ79MJcc629EYd9qke2O2zabdjR6k5IfypW1Fg9UXykn1kqhVS4BTg05UG+DbVh5Gj kPAmM716ANMse0begG4v4KiwtfVsYrZuKyHGUqR9RO2Htolsoys6k/hYKrvDg8ej4ZHe Gy7A== X-Gm-Message-State: AO0yUKX7NbqqKqqL2COgjcFCXaBjFgwgJxkOVkTSkhUOEKW7quIiRZda dXQqxLsJFPlHEI8ietchsMtuh0wg X-Google-Smtp-Source: AK7set9E+Hmyph2L1eUPYSrtf68+UcBy3azjANvup8KubID2PmJy4GF9X6vNAwp5hISzK9dtFJIoGA== X-Received: by 2002:a17:902:ef92:b0:19a:8259:c754 with SMTP id iz18-20020a170902ef9200b0019a8259c754mr822177plb.0.1677855158214; Fri, 03 Mar 2023 06:52:38 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:e5d0:b0:198:ddfb:494 with SMTP id u16-20020a170902e5d000b00198ddfb0494ls3174711plf.8.-pod-prod-gmail; Fri, 03 Mar 2023 06:52:37 -0800 (PST) X-Received: by 2002:a17:902:d4cf:b0:19e:500b:517a with SMTP id o15-20020a170902d4cf00b0019e500b517amr2399430plg.69.1677855156963; Fri, 03 Mar 2023 06:52:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677855156; cv=none; d=google.com; s=arc-20160816; b=zdkcL36BHHqIHIP5l3WVnJKEvpQDPGB3dGPXs40C+/ik3v5CW+o5hQH/obBUmCCd+T pXQkx+Cj7edtrM0rM2ik4u6mFClOexPwMIqblzsgtvCNd6fcBas+DlA0yIoh49Bd1Wpd VI7VWlW7qtOil4xvPA9bMlnPnXmtNYg5M78uZfCYWIGlRORlnagb25iiXLmj+2Umclu/ n+RAhvZ3Q0b1mFn6WiW6aLxI4CHEQD3ltiTL4ZhKQqA4/yY5z61QUJprLfde7dyiRvVz d5oq7ID7ckuy1I5E85/1RdFh9wO3Lvo3LUe4KHZsq4qxspYD3OJO0Nmdz6nH+Z+6KFAX ftTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=legzZg2LI260N51ZPIAg5x5sq5D7Y2TMttdY9F/D8O0=; b=y0jfS9Ja/YSnIAp8dhK7qA29wcu6FJFZ0cFuqaP8DfzDn6RkC/knLI0OeSDf5EDqb5 Ypen5IVrOYecvbosKGLDQRubXAnQbo8RJaP7/KkWe2djrl5zQRF7qM5HtCea7pB1faSV 57JCvXvwoIab8qIXZOIGc69IO66DJ5ugPW8MzAYFXgi1ZGe60S3hU5OzJW03wAkiFgsf yKakHxYQeyeT9EOxjWCsdp/Fw1KJ7IRPSCFUg0w5TU8w1VtzyaypxN/nPI+NycrNIsA6 7zoKODW7e5fZTO01Xj/A7KUtb/DEQdatUZC2PN15QFkSxzVLCA7cN90Urd5GuDi214zq EfSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qry+BcDj; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id l2-20020a170903120200b0019c9a655e8esor1034121plh.93.2023.03.03.06.52.36 for (Google Transport Security); Fri, 03 Mar 2023 06:52:36 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:8e02:b0:ce:ca9:ab56 with SMTP id y2-20020a056a208e0200b000ce0ca9ab56mr2921382pzj.34.1677855156554; Fri, 03 Mar 2023 06:52:36 -0800 (PST) Received: from localhost.localdomain ([183.83.137.89]) by smtp.gmail.com with ESMTPSA id z4-20020a63e544000000b00502fd70b0bdsm1660856pgj.52.2023.03.03.06.52.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 06:52:35 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Neil Armstrong , Marek Vasut , Maxime Ripard Cc: Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-amarula , Jagan Teki Subject: [PATCH v15 04/16] drm: exynos: dsi: Add platform PLL_P (PMS_P) offset Date: Fri, 3 Mar 2023 20:21:26 +0530 Message-Id: <20230303145138.29233-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303145138.29233-1-jagan@amarulasolutions.com> References: <20230303145138.29233-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qry+BcDj; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Look like PLL PMS_P offset value varies between platforms that have Samsung DSIM IP. However, there is no clear evidence for it as both Exynos and i.MX 8M Mini Application Processor Reference Manual is still referring the PMS_P offset as 13. The offset 13 is not working for i.MX8M Mini SoCs but the downstream NXP sec-dsim.c driver is using offset 14 for i.MX8M Mini SoC platforms [1] [2]. PMS_P value set in sec_mipi_dsim_check_pll_out using PLLCTRL_SET_P() with offset 13 and then an additional offset of one bit added in sec_mipi_dsim_config_pll via PLLCTRL_SET_PMS(). Not sure whether it is reference manual documentation or something else but this patch trusts the downstream code and handle PLL_P offset via platform driver data so-that imx8mm driver data shall use pll_p_offset to 14. Similar to Mini the i.MX8M Nano/Plus also has P=14, unlike Exynos. [1] https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/gpu/drm/bridge/sec-dsim.c?h=imx_5.4.47_2.2.0#n210 [2] https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/gpu/drm/bridge/sec-dsim.c?h=imx_5.4.47_2.2.0#n211 Reviewed-by: Marek Vasut Signed-off-by: Frieder Schrempf Signed-off-by: Jagan Teki --- Changes for v15, v13, v12, v11, v10, v9: - none Changes for v8: - updated commit message for 8M Nano/Plus Changes for v7, v6: - none Changes for v5: - updated clear commit message Changes for v4, v3, v2: - none Changes for v1: - updated commit message - add downstream driver link drivers/gpu/drm/exynos/exynos_drm_dsi.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index af16af404e87..603fed107fd1 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -194,7 +194,7 @@ /* DSIM_PLLCTRL */ #define DSIM_FREQ_BAND(x) ((x) << 24) #define DSIM_PLL_EN (1 << 23) -#define DSIM_PLL_P(x) ((x) << 13) +#define DSIM_PLL_P(x, offset) ((x) << (offset)) #define DSIM_PLL_M(x) ((x) << 4) #define DSIM_PLL_S(x) ((x) << 1) @@ -263,6 +263,7 @@ struct exynos_dsi_driver_data { unsigned int max_freq; unsigned int wait_for_reset; unsigned int num_bits_resol; + unsigned int pll_p_offset; const unsigned int *reg_values; }; @@ -471,6 +472,7 @@ static const struct exynos_dsi_driver_data exynos3_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, }; @@ -483,6 +485,7 @@ static const struct exynos_dsi_driver_data exynos4_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, }; @@ -493,6 +496,7 @@ static const struct exynos_dsi_driver_data exynos5_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, }; @@ -504,6 +508,7 @@ static const struct exynos_dsi_driver_data exynos5433_dsi_driver_data = { .max_freq = 1500, .wait_for_reset = 0, .num_bits_resol = 12, + .pll_p_offset = 13, .reg_values = exynos5433_reg_values, }; @@ -515,6 +520,7 @@ static const struct exynos_dsi_driver_data exynos5422_dsi_driver_data = { .max_freq = 1500, .wait_for_reset = 1, .num_bits_resol = 12, + .pll_p_offset = 13, .reg_values = exynos5422_reg_values, }; @@ -628,7 +634,8 @@ static unsigned long exynos_dsi_set_pll(struct exynos_dsi *dsi, writel(driver_data->reg_values[PLL_TIMER], dsi->reg_base + driver_data->plltmr_reg); - reg = DSIM_PLL_EN | DSIM_PLL_P(p) | DSIM_PLL_M(m) | DSIM_PLL_S(s); + reg = DSIM_PLL_EN | DSIM_PLL_P(p, driver_data->pll_p_offset) | + DSIM_PLL_M(m) | DSIM_PLL_S(s); if (driver_data->has_freqband) { static const unsigned long freq_bands[] = { From patchwork Fri Mar 3 14:51:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2768 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 2A4CC44AA6 for ; Fri, 3 Mar 2023 15:52:44 +0100 (CET) Received: by mail-pl1-f200.google.com with SMTP id s15-20020a170902ea0f00b0019d0c7a83dfsf1505404plg.14 for ; Fri, 03 Mar 2023 06:52:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677855163; cv=pass; d=google.com; s=arc-20160816; b=GHQsHQReyEIekmDFOseQI9Zz+H/NUgW2Vl5sauCn6KIgle23HdrNOxto5TaboFidai 3j7QqV5hbV/93wiYjzU9GsRkvgAB3fFPZih1fqnsmw++ta9EEtHMwzLhxZOEu1cEXcGs 6/wRl5AUFQUxMpOyEeDIJbCfpTHQDFV2ZEOLWMORAkjAjZbEhuTB3mCs7/jOrb5hZ4H1 TE69z2WXEPr16V38DRTpYWx58QIa7Xic6WHlzPARNkBuLBZTF1fJPisyP80dSuOBPb/1 puDHlmVAXYHJbVUZtdW20bDJVmWHXlH5b4e+nCadzq+VRErV20OlpwOYmytECnz0x+7t s3gw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=TckoKxG0crOmtY67nTkSdWAJlAipCn+32H7SGivffPI=; b=RqqcQawSEvDL5MfJk8+geKsLieaIAD11R+YnLKonFqL114A0XJ8uA3oLI9v8jQfws5 Ro2yHLfjjnagdSmSwzT9Z8l8EwZ7RhhdjmWX2DMDupEh9Q7UH3lpzLSy/CYMG9msX2bf VjtP6sHtvJeIkG2kO7kCG8+ieGWJn76Lclow2Emo4MYyZTaqOQ1kfNNN5P6RfzTPLXZn MMSb57FtJO2x1AOjnIQyMnxbsPsLypounhIbi5E059bZt0uytmTSZfPd2D5f3MtT08V7 +DTKUZjBpyoh8BbaqZwlWtdMZUJiyG27DhQvK4XW82ZZSSiZgQI+3QJnTFa1ws3dPVXv 2J9Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=FhHtWBPo; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1677855163; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=TckoKxG0crOmtY67nTkSdWAJlAipCn+32H7SGivffPI=; b=ALM+F1zu8RFDCp2SPXftZPn5XK+tLQszKEYIcgFlxTTZCgvHViiVFr0Pl9IhLk/RQO zm5GdgtP88YKsyEnDWTo3C1P+5O5GeJuNAc/5GMz785dBH42i2MsKp7jFJuyKgBPSGBM jSdmmHWIzXz5PoE39S7fWJQX8nTwnKgl9JErs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677855163; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender: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=TckoKxG0crOmtY67nTkSdWAJlAipCn+32H7SGivffPI=; b=dvH9A/gpHQgHyUPSgX/3JeCjOb9nPms4UMmdrc/f6tv9nka9oL4xO1LztFa4Iur6mD PDnCppxIiI8vhMLsPiXY0885PPFkyEvRykfxBX2ALXRk/Tig0fplmrkvGh7E7CcL2lAZ G++lX4DWDRnW68VnEFLvf21WQL9RzOlyVZbCCemEovvFMgu0B8JLZq8ceOxL0dC4+SST /DIWFbHL+Gv9/LP54LUZ+/2lC3Ix5C3hM7e8RmVRyBhtmQ7ojFK3qqvafTORFax2XMm1 cpm637WnO63C0hPr2OI6gTSz+G7gJXtqp58szveukgYgRD5kZ5zdNpCOPE8IJnq0JXTv q/pg== X-Gm-Message-State: AO0yUKWSgcztfiyEdjnhL4fWfOcFJul3sZDYlNSSo1KI7V+tOM11bic9 A4v/k779uOaiEj/6/rq9sVoUx12n X-Google-Smtp-Source: AK7set8RM82BTk1E9i6+XdOSVodwZMev273P7rPXYlQYQPQ7EUaJeUu7UIYdIiwI+onZAnBvKG92sA== X-Received: by 2002:a17:90b:2352:b0:230:9de7:1d14 with SMTP id ms18-20020a17090b235200b002309de71d14mr675259pjb.5.1677855162796; Fri, 03 Mar 2023 06:52:42 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:e742:b0:19c:2b1c:4d75 with SMTP id p2-20020a170902e74200b0019c2b1c4d75ls923503plf.0.-pod-prod-gmail; Fri, 03 Mar 2023 06:52:42 -0800 (PST) X-Received: by 2002:a17:903:1cb:b0:19c:eaf0:9859 with SMTP id e11-20020a17090301cb00b0019ceaf09859mr2884726plh.38.1677855161780; Fri, 03 Mar 2023 06:52:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677855161; cv=none; d=google.com; s=arc-20160816; b=sGoAsH1etJoPdsWpAsUrMPGf92Q606veAqCfg2691uqNsBGLZUrGXaHbNoktl6VEJC A9Mq0qD5B3AGly1svQr53Ejt+muIzmjJGr/Mzp//DzKe1bhyoiHGi6ubrZJ5wYl2jPFm iZSSQuIDPvbZdZberPJvqZAldOYIMQOBFkIgDoMYeIBGytinwkGWdrOwocs2BhKduGJX PjvT1fLJp9wD1UkgC4Lob+tg3ShagJqdAy6WWHsMUAB5IYvFQwI7HiTD8LJkcMPOaaJA 1gdhlU6cpiyw8fHaUJiekvNjU/n3tfzT9w+frD85DYpfUUIll65UrLuPEq69zsO/mgCb uwmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=8ZuKEGIK8u3BOHalvqGIm9UnoS+t9+HMUkXfXB/tUbc=; b=PC+/ND9mXEfSGDvVTLNwBsJGMvuTHmMaBjQMcxo88209uEWPvgzMn8u91EoMbTazvD u5OcJtyzEwaN15YsFpjFgq5+8d+19eTlRHKwPirOTX5EIKeRN7Q6YJa/6tCdowU4jinJ nacBzkGSUuRk2w04Yg+Iu/WX/TDxsYU2Hrjhkoj2pV2u+eT2avGLPjXX0WS7blxMZj1v q2G44VGgLvCj5d7T4aKk1Z7hCsogV7eYWcQ0Hb8Nhbb9CR8QiPWzksHyNBohcCFov1Ih dszMbikaKb4lRvRYfC9AtVQPDypxQFt2xisDtoCz71i8UGw1YGdbXQS/roG9rt/5ErOv LUKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=FhHtWBPo; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id iw21-20020a170903045500b0019a9c0b98dcsor1084287plb.85.2023.03.03.06.52.41 for (Google Transport Security); Fri, 03 Mar 2023 06:52:41 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:a8a6:b0:cc:8ac6:90ca with SMTP id ca38-20020a056a20a8a600b000cc8ac690camr2228469pzb.27.1677855161400; Fri, 03 Mar 2023 06:52:41 -0800 (PST) Received: from localhost.localdomain ([183.83.137.89]) by smtp.gmail.com with ESMTPSA id z4-20020a63e544000000b00502fd70b0bdsm1660856pgj.52.2023.03.03.06.52.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 06:52:40 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Neil Armstrong , Marek Vasut , Maxime Ripard Cc: Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-amarula , Jagan Teki Subject: [PATCH v15 05/16] drm: exynos: dsi: Introduce hw_type platform data Date: Fri, 3 Mar 2023 20:21:27 +0530 Message-Id: <20230303145138.29233-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303145138.29233-1-jagan@amarulasolutions.com> References: <20230303145138.29233-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=FhHtWBPo; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Samsung MIPI DSIM controller is common DSI IP that can be used in various SoCs like Exynos, i.MX8M Mini/Nano/Plus. Add hw_type enum via platform_data so that accessing the different controller data between various platforms becomes easy and meaningful. Reviewed-by: Marek Vasut Reviewed-by: Frieder Schrempf Suggested-by: Marek Szyprowski Signed-off-by: Jagan Teki --- Changes for v15, v13: - none Changes for v12: - collect RB from Marek Changes for v11: - collect RB from Frieder - drop extra line Changes for v10: - split from previous series patch "drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge" - update enum type names drivers/gpu/drm/exynos/exynos_drm_dsi.c | 83 ++++++++++++++++++++----- 1 file changed, 68 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 603fed107fd1..64cf69995750 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -254,6 +254,15 @@ struct exynos_dsi_transfer { #define DSIM_STATE_CMD_LPM BIT(2) #define DSIM_STATE_VIDOUT_AVAILABLE BIT(3) +enum exynos_dsi_type { + DSIM_TYPE_EXYNOS3250, + DSIM_TYPE_EXYNOS4210, + DSIM_TYPE_EXYNOS5410, + DSIM_TYPE_EXYNOS5422, + DSIM_TYPE_EXYNOS5433, + DSIM_TYPE_COUNT, +}; + struct exynos_dsi_driver_data { const unsigned int *reg_ofs; unsigned int plltmr_reg; @@ -267,6 +276,10 @@ struct exynos_dsi_driver_data { const unsigned int *reg_values; }; +struct exynos_dsi_plat_data { + enum exynos_dsi_type hw_type; +}; + struct exynos_dsi { struct drm_encoder encoder; struct mipi_dsi_host dsi_host; @@ -297,6 +310,7 @@ struct exynos_dsi { struct list_head transfer_list; const struct exynos_dsi_driver_data *driver_data; + const struct exynos_dsi_plat_data *plat_data; }; #define host_to_dsi(host) container_of(host, struct exynos_dsi, dsi_host) @@ -524,18 +538,13 @@ static const struct exynos_dsi_driver_data exynos5422_dsi_driver_data = { .reg_values = exynos5422_reg_values, }; -static const struct of_device_id exynos_dsi_of_match[] = { - { .compatible = "samsung,exynos3250-mipi-dsi", - .data = &exynos3_dsi_driver_data }, - { .compatible = "samsung,exynos4210-mipi-dsi", - .data = &exynos4_dsi_driver_data }, - { .compatible = "samsung,exynos5410-mipi-dsi", - .data = &exynos5_dsi_driver_data }, - { .compatible = "samsung,exynos5422-mipi-dsi", - .data = &exynos5422_dsi_driver_data }, - { .compatible = "samsung,exynos5433-mipi-dsi", - .data = &exynos5433_dsi_driver_data }, - { } +static const struct exynos_dsi_driver_data * +exynos_dsi_types[DSIM_TYPE_COUNT] = { + [DSIM_TYPE_EXYNOS3250] = &exynos3_dsi_driver_data, + [DSIM_TYPE_EXYNOS4210] = &exynos4_dsi_driver_data, + [DSIM_TYPE_EXYNOS5410] = &exynos5_dsi_driver_data, + [DSIM_TYPE_EXYNOS5422] = &exynos5422_dsi_driver_data, + [DSIM_TYPE_EXYNOS5433] = &exynos5433_dsi_driver_data, }; static void exynos_dsi_wait_for_reset(struct exynos_dsi *dsi) @@ -1468,8 +1477,6 @@ static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { .attach = exynos_dsi_attach, }; -MODULE_DEVICE_TABLE(of, exynos_dsi_of_match); - static int exynos_dsi_host_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { @@ -1704,7 +1711,8 @@ static int exynos_dsi_probe(struct platform_device *pdev) dsi->dsi_host.dev = dev; dsi->dev = dev; - dsi->driver_data = of_device_get_match_data(dev); + dsi->plat_data = of_device_get_match_data(dev); + dsi->driver_data = exynos_dsi_types[dsi->plat_data->hw_type]; dsi->supplies[0].supply = "vddcore"; dsi->supplies[1].supply = "vddio"; @@ -1862,6 +1870,51 @@ static const struct dev_pm_ops exynos_dsi_pm_ops = { pm_runtime_force_resume) }; +static const struct exynos_dsi_plat_data exynos3250_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS3250, +}; + +static const struct exynos_dsi_plat_data exynos4210_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS4210, +}; + +static const struct exynos_dsi_plat_data exynos5410_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS5410, +}; + +static const struct exynos_dsi_plat_data exynos5422_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS5422, +}; + +static const struct exynos_dsi_plat_data exynos5433_dsi_pdata = { + .hw_type = DSIM_TYPE_EXYNOS5433, +}; + +static const struct of_device_id exynos_dsi_of_match[] = { + { + .compatible = "samsung,exynos3250-mipi-dsi", + .data = &exynos3250_dsi_pdata, + }, + { + .compatible = "samsung,exynos4210-mipi-dsi", + .data = &exynos4210_dsi_pdata, + }, + { + .compatible = "samsung,exynos5410-mipi-dsi", + .data = &exynos5410_dsi_pdata, + }, + { + .compatible = "samsung,exynos5422-mipi-dsi", + .data = &exynos5422_dsi_pdata, + }, + { + .compatible = "samsung,exynos5433-mipi-dsi", + .data = &exynos5433_dsi_pdata, + }, + { /* sentinel. */ } +}; +MODULE_DEVICE_TABLE(of, exynos_dsi_of_match); + struct platform_driver dsi_driver = { .probe = exynos_dsi_probe, .remove = exynos_dsi_remove, From patchwork Fri Mar 3 14:51:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2769 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4C49E44AA6 for ; Fri, 3 Mar 2023 15:52:48 +0100 (CET) Received: by mail-pf1-f199.google.com with SMTP id bw25-20020a056a00409900b005a9d0e66a7asf1462824pfb.5 for ; Fri, 03 Mar 2023 06:52:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677855168; cv=pass; d=google.com; s=arc-20160816; b=bAQEoS+c5bwNnArnCsU2pWgGdqAycg9LdahiWEtSa9lTp0CvjpdM9vBZtd+TieSlMt zw7vgX6dHREdeYv5R3csM2Z2Ya4F39nXW3uikE7NtTKnx/w1aLkYk6GHWVsju1y7bIOv 7ADNxoE8BvD/PI1bzwPeiR5IX0d982zk6mCy79hwJNsL0V/KrjQUIyPEoH2dF8jws5NW aewSzdnpiORYdEfiFGklEvSvGhPgXlBYBs7onz5syZAV+3kjx9eb5C3J9E+eRG/JPuHM yI638mf0YHCsMD+I4LWJX8GBaVizD86bJql+uLIiOL4OaK5DS6BVZ42ntLsLPsgrhKea tZtg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=nhqySQxwnU37o42Wo8WUmTicyP1TwbevskFrLsm+eVs=; b=zw8rb7KblL3kM0mh/eg7HXAoZ/dLLzCRYy+F4ZG9dYJeBe7yPTU4OHs0wAIh+b5oc/ TY4zNDsQ1QGC44qxVl4z11DE7F0ymg25rdPIqagGiXeRk/GelNPb7P7bjDr6eRkIGjZ+ xgphLVA6NYQXl0u4EKWB7dvtYD0d939IIAklM1TL2UsNCXoQCXgnEMCb1zNAD2G2LW/N wbFjjEaxy0XEz412rsxMSV2lwkytqb3LDW6TmC8G1ipvMzegMiLNMhMym+6fBy3jpAMX f6rm5lTaWgzmDuGlrK90EpoC91p9a0Gab2V7a2WWlBbWraPFLo/heZzZZ9U7ee070qwK rjsw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rUZCHWJH; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1677855168; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=nhqySQxwnU37o42Wo8WUmTicyP1TwbevskFrLsm+eVs=; b=Bvbsu+KY2f/Gyjx2/8u0pCZmyl3Mess+qVLL3xMOCByO1x+lbgwfKEtFIwYEUHpbiL KeiU2WngG5pYc3Gf4kXy9GkFqERLq/dBBV3t1XcYLk3cZJaS/3KK7ycYHF+d8TKjplb9 FZcrrjmaAPF/DS1O0DCyUVXcV4i7OJSXEKXRs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677855168; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender: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=nhqySQxwnU37o42Wo8WUmTicyP1TwbevskFrLsm+eVs=; b=K8NWA4kIhwkfniC8bp9wwO0/pxXds55t9SN6L1b1mh6+Ib8AaN2okPkLGEU9hSxMgB WPx16ThHFevmYYuBjGKgCCflhDg5U7zUBFejAkcWtq1pFO6HVILwh+Mu+5PMgGuo+DMk MkP59C3ciwYq9Zm6+aQgLCRUvZdRUt8QEMx2zeJt8ztGtg7L175UPDgtUS2aa6a/bAuN ZQ5IZCnGupk/Hcpu5gTO45N25mikNNVYOUp8Y5qVh0IX16+rvnJdR5ABIvwscRuck5ll k3qn56BQWFBKAqZ9AbtE8DcbPExHYhYERIZvQANwyLSbQsYYGmWMnqAg2s0b3w26boIm 7rHg== X-Gm-Message-State: AO0yUKX6YxL5T12qobqEB+mUMZxdo2tPGxnA/aoWxF2/xOVDzom1K3x6 a3hYSlc5Y7sSq5Y21hpujnOzSre0 X-Google-Smtp-Source: AK7set+aVom6nAHzxf07M3vIKn8A/X1dkt/+sufRxZTo0ZpgSFoXeo5udQUCuXbxT+y62wby0LAsBQ== X-Received: by 2002:a63:7512:0:b0:503:77c6:2ca3 with SMTP id q18-20020a637512000000b0050377c62ca3mr576460pgc.5.1677855167901; Fri, 03 Mar 2023 06:52:47 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:cec6:b0:19c:b3c9:49d5 with SMTP id d6-20020a170902cec600b0019cb3c949d5ls3186188plg.6.-pod-prod-gmail; Fri, 03 Mar 2023 06:52:47 -0800 (PST) X-Received: by 2002:a17:902:cec6:b0:19d:1bc8:488a with SMTP id d6-20020a170902cec600b0019d1bc8488amr2669671plg.29.1677855166936; Fri, 03 Mar 2023 06:52:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677855166; cv=none; d=google.com; s=arc-20160816; b=aI+UMDBUMjGQwOa8u/rzUgSJS6NJb8BbzTgKaT14HCwpywsG0SEXTPsUiSs7uH4g10 6ocXRYZdizMo3CQi65wBrX5IlcGNTLX8lKUWHvmIc0QixIm73uKBN3Iy7srPwLAlcPYZ 5W5DRyOHWpIp7CX2FR/KE1slnqtUXIMtbwhs9ZXQ6DAYnKDjYVgFMUwN1p5HyheR/wLg 7zqnyAcB+JzFehyPaG12T72O/zQ5itYQcB0KKVMeeXVGZ8i//K8dxytSt6sStF/bB7ZT L5dlp/O7OrYs0/0NYo/MlHvCyl6wzPxgIXvZzcBc+++byWN/E3hmgoGha8Du1N40bIJn FyOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=6M6pIqw7k0M+vm8dE+QD7gZWyxxkXhmbFOQyY/9HzRQ=; b=wPCIMdcsizKQZK7X00lJLu3Fs2XgHnQ27I/6gf0A9EdwSXprmfF3DSWDbZWRr2tRtJ nLwyDYevzhIcCL311pcNaGcbhzVdYo8Qw7Y5KXdcrCfjZGwyJ8SBmHn1HeTtj2LIHafd WceAVPzVhWoahvYvUxNpBwYg2cQrFzNXLlV132SYnyVweWlI4wjpTJqPIGLhQRhYlDaH 4ZVgP1/20ftqY38rHj+5TdsR9haKfSSUEgYz9Kh2BWyoLYVeYp7wh/1e+oeI2rE4r+TP IY+r5OaZRrUt5RZ18eB/4IMvO3wzvHkbPpN/EVZRxJupMgiIqxdJEqdDVri5Rzwqmy5O +fLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rUZCHWJH; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id p9-20020a170902780900b00194768d4461sor1090894pll.148.2023.03.03.06.52.46 for (Google Transport Security); Fri, 03 Mar 2023 06:52:46 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:12cd:b0:cd:40b4:bc75 with SMTP id v13-20020a056a2012cd00b000cd40b4bc75mr2845320pzg.48.1677855166602; Fri, 03 Mar 2023 06:52:46 -0800 (PST) Received: from localhost.localdomain ([183.83.137.89]) by smtp.gmail.com with ESMTPSA id z4-20020a63e544000000b00502fd70b0bdsm1660856pgj.52.2023.03.03.06.52.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 06:52:45 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Neil Armstrong , Marek Vasut , Maxime Ripard Cc: Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-amarula , Jagan Teki Subject: [PATCH v15 06/16] drm: exynos: dsi: Handle proper host initialization Date: Fri, 3 Mar 2023 20:21:28 +0530 Message-Id: <20230303145138.29233-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303145138.29233-1-jagan@amarulasolutions.com> References: <20230303145138.29233-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rUZCHWJH; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Marek Szyprowski Host transfer() in the DSI master will invoke only when the DSI commands are sent from DSI devices like DSI Panel or DSI bridges and this host the transfer wouldn't invoke for I2C-based-DSI bridge drivers. Handling DSI host initialization in transfer calls misses the controller setup for I2C configured DSI bridges. This patch updates the DSI host initialization by calling host to init from bridge pre_enable as the bridge pre_enable API is invoked by core as it is common across all classes of DSI device drivers. The host init during pre_enable is conditional and not invoked for Exynos as existing downstream drm panels and bridges in Exynos are expecting the host initialization during DSI transfer. Reviewed-by: Marek Vasut Reviewed-by: Frieder Schrempf Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- Changes for v15, v13: - none Changes for v12: - collect RB from Marek Changes for v11: - collect RB from Frieder Changes for v10: - update the to simple logic to handle all platforms Changs for v9 - v8: - none Changes for v2: - check initialized state in samsung_dsim_init Changes for v1: - keep DSI init in host transfer drivers/gpu/drm/exynos/exynos_drm_dsi.c | 27 +++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 64cf69995750..fe195d76ce76 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -254,6 +254,9 @@ struct exynos_dsi_transfer { #define DSIM_STATE_CMD_LPM BIT(2) #define DSIM_STATE_VIDOUT_AVAILABLE BIT(3) +#define exynos_dsi_hw_is_exynos(hw) \ + ((hw) >= DSIM_TYPE_EXYNOS3250 && (hw) <= DSIM_TYPE_EXYNOS5433) + enum exynos_dsi_type { DSIM_TYPE_EXYNOS3250, DSIM_TYPE_EXYNOS4210, @@ -1343,6 +1346,9 @@ static int exynos_dsi_init(struct exynos_dsi *dsi) { const struct exynos_dsi_driver_data *driver_data = dsi->driver_data; + if (dsi->state & DSIM_STATE_INITIALIZED) + return 0; + exynos_dsi_reset(dsi); exynos_dsi_enable_irq(dsi); @@ -1355,6 +1361,8 @@ static int exynos_dsi_init(struct exynos_dsi *dsi) exynos_dsi_set_phy_ctrl(dsi); exynos_dsi_init_link(dsi); + dsi->state |= DSIM_STATE_INITIALIZED; + return 0; } @@ -1410,6 +1418,16 @@ static void exynos_dsi_atomic_pre_enable(struct drm_bridge *bridge, } dsi->state |= DSIM_STATE_ENABLED; + + /* + * For Exynos-DSIM the downstream bridge, or panel are expecting + * the host initialization during DSI transfer. + */ + if (!exynos_dsi_hw_is_exynos(dsi->plat_data->hw_type)) { + ret = exynos_dsi_init(dsi); + if (ret) + return; + } } static void exynos_dsi_atomic_enable(struct drm_bridge *bridge, @@ -1601,12 +1619,9 @@ static ssize_t exynos_dsi_host_transfer(struct mipi_dsi_host *host, if (!(dsi->state & DSIM_STATE_ENABLED)) return -EINVAL; - if (!(dsi->state & DSIM_STATE_INITIALIZED)) { - ret = exynos_dsi_init(dsi); - if (ret) - return ret; - dsi->state |= DSIM_STATE_INITIALIZED; - } + ret = exynos_dsi_init(dsi); + if (ret) + return ret; ret = mipi_dsi_create_packet(&xfer.packet, msg); if (ret < 0) From patchwork Fri Mar 3 14:51:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2770 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 72F0944AA6 for ; Fri, 3 Mar 2023 15:52:54 +0100 (CET) Received: by mail-pj1-f70.google.com with SMTP id u8-20020a17090ae00800b00237e4f46c8bsf1047320pjy.7 for ; Fri, 03 Mar 2023 06:52:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677855173; cv=pass; d=google.com; s=arc-20160816; b=AIlt4lYPUxrBt3kHA5GRyXK9JE4q8tyhSnGCsmlQ2z/pcDgGAvDVXPOHa3jOA1gX/2 tRBCwod4Ymk+VaM5JmVZV0SSMTl4bSju4PgoJhFxGwpsByOX/E5rgd5acOV/+c8F6JA0 84pCqOYNXy8oo67pGbp+qlwynNBm1YKlzOF4DMT0FEv2wLqG2BHN+MuH01Nx9QSoPPxP 3GICRkrOBTenhyzY7v29C6rZHq3N79aNymMAhK7xSD+0I3b2L695XK4lNoiQiIeleTnM OILvoQWjV8QO36w1akpidGQWUBbVKo4QSzxXvXkeVJnjKughoxSGg2SczLzcA/cwr2El Vr8w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=amX+MyFJlf0/6Zp5LaYKz9jzp21ReJLD0x6zxDRM+nA=; b=pBKQWDb3eF9z6DwhebR59WTF3mdRnJaHrJwdFMJn/ov6nHWA8e5Pfj1/Q3sT4OmbKD V9a52/YIm00r8pzziuDg09ZQ/qYL/F0UNEnQZlulOVvEDUmmXUaekAN41NXRF/ZGACdF yCF9vdHQGiXs6kYJvXGetP5hyLX6nPr3Evx2vniI4WmFkjnkFtJyHJOlcNIWa4DP9hfV vmSWo2U4KsLsBqia3cORLLu1AIEd1AEF1/xgJQBpO1+VHsaZe2h3dvb6ZoOr1Y5HcIBT KU/Z7gtmK3yYjveBqUcxGicthPxNW/iq577Ssma4ooLSN5J5OjSQpWZCdVZdYHqAF2gR rN4g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Ssp71cr+; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1677855173; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=amX+MyFJlf0/6Zp5LaYKz9jzp21ReJLD0x6zxDRM+nA=; b=adO9yW0W+5NcwwE39oIWSHWYgZH5ZiB3mAVfgJJzjTwQmAxs/F3qI5DMenSjDZEdpw ih8E9w0WyIkPQ2Vhz/CQ+tdUp+bACeBT1nvkaqkjAxppflYVz95vNOAf4eA2wzpSj/Ix pRAQVyD0SKixA/34mZ5lsYLfE4Pd3U7XB3O1M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677855173; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender: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=amX+MyFJlf0/6Zp5LaYKz9jzp21ReJLD0x6zxDRM+nA=; b=RrXARAeojdLScxddHIbKOxhPu8HHRkHCH52ec7/22flmBp6A5/9vaPpzkTr8KhrNg2 1uO/qfAVKbSBAudmJw/7uyZ7kS+4ACaQgsg53yCq9AwMovQSDHxYF/0lF0/GxZBGKKq7 1GdVJd7oRUSJf44p8XxnJ0QFutrTuWEUioojGnm+xjeMNmogIqHnKsfg9G1DIxP5M2Ue kjXUWRf0t+7ORFUL+H8+l5OS7iREZPv/VJnXBJBMeTGu9kc70zuJQgQGES+h7QxqdTeG rE4hpEEJX0HZFvx9Km9/DM7rp7sFJ+z+cGWL2XalsCX0JOoW3H8U9NFB40utG5HBa4yQ sIxQ== X-Gm-Message-State: AO0yUKV/pVSUWrYT2aEXcMg0zgws6utVZzGijRvjHPkF2U7a1svVYaZI WBwQWh5303F9jbbxHCtXBYScQ2Uj X-Google-Smtp-Source: AK7set/RadwWSNu+pcf7CRo3IbOCuY2BY6GlbyuirxeGvs+Y1hUzjADEFq/nZx1qR0EJEw+8x4dQCQ== X-Received: by 2002:a05:6a00:1d9f:b0:5a8:aaa1:6c05 with SMTP id z31-20020a056a001d9f00b005a8aaa16c05mr2720473pfw.2.1677855173141; Fri, 03 Mar 2023 06:52:53 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90b:2681:b0:234:2ef4:2e9 with SMTP id pl1-20020a17090b268100b002342ef402e9ls3135774pjb.0.-pod-control-gmail; Fri, 03 Mar 2023 06:52:52 -0800 (PST) X-Received: by 2002:a17:90a:7489:b0:230:7a3a:d4cc with SMTP id p9-20020a17090a748900b002307a3ad4ccmr1798442pjk.43.1677855172104; Fri, 03 Mar 2023 06:52:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677855172; cv=none; d=google.com; s=arc-20160816; b=BQUAC99rD4K97u72szZjpuHWWkxUoik3XBeQRkKiwGxSRNeCieMytUZp2CHuTHL46G hFooBNz74oy06h94dApJBPGNc3WkP7Z6vMqa9LGvk+Gd+PqsOM+s/TjUOb8XLNPjONfo AqZSyKLkit6H4NwF26EMT0+kgRdALUL/DE6ubtb0W32DsUQHA3KkYjnWTsgluAysMJ67 cVWfyRVPfjmcFnl24GD7bLq10lGDudtRAWikMurbb/J5Y/lRwBraUp0vm4cbgrOsMwUh BR8DYpUZhDUap7hJb6JYL0TASZwE4ORc8XBlZ54pn9Nwmj58+HEJfk7a3gDBLlcwuGzX B1BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=2GNP64t5VbWNZ3TjO4FhppfcB2OtIjrbdxbfXm3Vv04=; b=WG0gGBW4DyhjXfQcisjQ5yP75HZXiJYxf1ygJde2POQMFXKebTgHsI+Uuo4wsMk3Nn eShREPDKExYjaZEQ3mYk7VzCVARwYbcyEHJLT/Dv6e4+3GQqKCrlNkxZtTCDweo/QKJV TxBoBDNFTy1cRsP7MTsBNugXKdIxRqUgx12QDXdQYzwI3cqqIeeA7KTTj42+o5ZQV+SJ 4d0nmYskrjyiluLauqVJtEzPdEs3nVe3U2IxM3+1n8t2rXakdEXJ3oPUN7HYJhqC0Tk1 xS38nrmOudbfNdZeyWVB2ozbr9zTEjbiXOqnrbeRXyDiuiIFjcJYlI8qvn0auYAw6Kqu vrZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Ssp71cr+; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id bt22-20020a17090af01600b00228e5d8a8fdsor2599386pjb.15.2023.03.03.06.52.52 for (Google Transport Security); Fri, 03 Mar 2023 06:52:52 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:90a:1957:b0:237:659a:a44d with SMTP id 23-20020a17090a195700b00237659aa44dmr2090856pjh.9.1677855171757; Fri, 03 Mar 2023 06:52:51 -0800 (PST) Received: from localhost.localdomain ([183.83.137.89]) by smtp.gmail.com with ESMTPSA id z4-20020a63e544000000b00502fd70b0bdsm1660856pgj.52.2023.03.03.06.52.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 06:52:51 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Neil Armstrong , Marek Vasut , Maxime Ripard Cc: Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-amarula , Jagan Teki Subject: [PATCH v15 07/16] drm: exynos: dsi: Add atomic check Date: Fri, 3 Mar 2023 20:21:29 +0530 Message-Id: <20230303145138.29233-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303145138.29233-1-jagan@amarulasolutions.com> References: <20230303145138.29233-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Ssp71cr+; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Look like an explicit fixing up of mode_flags is required for DSIM IP present in i.MX8M Mini/Nano SoCs. At least the LCDIF + DSIM needs active low sync polarities in order to correlate the correct sync flags of the surrounding components in the chain to make sure the whole pipeline can work properly. On the other hand the i.MX 8M Mini Applications Processor Reference Manual, Rev. 3, 11/2020 says. "13.6.3.5.2 RGB interface Vsync, Hsync, and VDEN are active high signals." i.MX 8M Mini Applications Processor Reference Manual Rev. 3, 11/2020 3.6.3.5.2 RGB interface i.MX 8M Nano Applications Processor Reference Manual Rev. 2, 07/2022 13.6.2.7.2 RGB interface both claim "Vsync, Hsync, and VDEN are active high signals.", the LCDIF must generate inverted HS/VS/DE signals, i.e. active LOW. No clear evidence about whether it can be documentation issues or something, so added proper comments on the code. Comments are suggested by Marek Vasut. Reviewed-by: Marek Vasut Reviewed-by: Frieder Schrempf Signed-off-by: Jagan Teki --- Changes for v15, v13: - none Changes for v12: - collect RB from Marek Changes for v11: - collect RB from Frieder - fix commit message Changes for v10, v9: - none Changes for v8: - update the comments about sync signals polarities - added clear commit message by including i.MX8M Nano details Changes for v7: - fix the hw_type checking logic Changes for v6: - none Changes for v5: - rebase based new bridge changes [mszyprow] - remove DSIM_QUIRK_FIXUP_SYNC_POL - add hw_type check for sync polarities change. Changes for v4: - none Changes for v3: - add DSIM_QUIRK_FIXUP_SYNC_POL to handle mode_flasg fixup Changes for v2: - none Changes for v1: - fix mode flags in atomic_check instead of mode_fixup drivers/gpu/drm/exynos/exynos_drm_dsi.c | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index fe195d76ce76..796480e4a18b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -263,6 +263,7 @@ enum exynos_dsi_type { DSIM_TYPE_EXYNOS5410, DSIM_TYPE_EXYNOS5422, DSIM_TYPE_EXYNOS5433, + DSIM_TYPE_IMX8MM, DSIM_TYPE_COUNT, }; @@ -1465,6 +1466,32 @@ static void exynos_dsi_atomic_post_disable(struct drm_bridge *bridge, pm_runtime_put_sync(dsi->dev); } +static int exynos_dsi_atomic_check(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct exynos_dsi *dsi = bridge_to_dsi(bridge); + struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode; + + /* + * The i.MX8M Mini/Nano glue logic between LCDIF and DSIM + * inverts HS/VS/DE sync signals polarity, therefore, while + * i.MX 8M Mini Applications Processor Reference Manual Rev. 3, 11/2020 + * 13.6.3.5.2 RGB interface + * i.MX 8M Nano Applications Processor Reference Manual Rev. 2, 07/2022 + * 13.6.2.7.2 RGB interface + * both claim "Vsync, Hsync, and VDEN are active high signals.", the + * LCDIF must generate inverted HS/VS/DE signals, i.e. active LOW. + */ + if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) { + adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); + adjusted_mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); + } + + return 0; +} + static void exynos_dsi_mode_set(struct drm_bridge *bridge, const struct drm_display_mode *mode, const struct drm_display_mode *adjusted_mode) @@ -1487,6 +1514,7 @@ static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_reset = drm_atomic_helper_bridge_reset, + .atomic_check = exynos_dsi_atomic_check, .atomic_pre_enable = exynos_dsi_atomic_pre_enable, .atomic_enable = exynos_dsi_atomic_enable, .atomic_disable = exynos_dsi_atomic_disable, From patchwork Fri Mar 3 14:51:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2771 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id F172744AA6 for ; Fri, 3 Mar 2023 15:52:59 +0100 (CET) Received: by mail-pl1-f200.google.com with SMTP id m9-20020a170902db0900b0019ea0e227e4sf32173plx.6 for ; Fri, 03 Mar 2023 06:52:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677855178; cv=pass; d=google.com; s=arc-20160816; b=g0OTqHX6H7BxJhCKRt69VF1vOMIkX11qtNqiba9jVvzNUGYdCz4A8q8PMTREf6sL6W 0Lwun/lon3JIrV1RXd2KIkdh/LtrCTpaJZA4+/bmw/6SIYZ9G5qfDg4k2+fO1WY/F7Oo Sci/epTdCwpH8kEf+ECGd4CSmBoqR4v3jbnLM1d/2ceZfDKhRgPcXEry7eqJURq4Vpun hwhRD7/g+FStt36xQsb9aqmS+fOVoKqD3UnYcQFkX7byRO9skLA8J9V0X5ZHKMg4o2DH lYwu/ZXJ1mxlFCXjCLRS6DvYo+vyEQtcvaf2ft7wWQSFSg9csQnOEliTjdlQcQmry8QV bxqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=KcwRPHodLDSj1JEX9luATO5s2KrQNrovBpjoEOsUqkk=; b=0TYefVh7DcA8sST1yPOjwv/1P82j8XF6LA2+PTK4tYVRIFvF2NrVDJOb+pMQzPCN2k piX92cKqOvARfPCA/5l+wM4YoIYy5ddSvKXh1koS/cX1yBqMPMjJjpsdObOZHhBxGzz6 KhjiWQ9/9fN42x4q/20Q5mYasl9hE04c8XmyWcYbnF2XA66r213rikSxAXUJsKLaaJSh KDS3hZdpoBz8cptIDfJXXyS8MbF5dJ7sZgmhjZr9BVAwHjqOSA46uM0yCqenoVLWfPGa iADDs58uNKXqxxjQDolgY5hV0UmI9WGwUU1US+p/KSWZ/kduLOQtIkxsRf8yt5rZA5n3 QYoQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=cbJxdKLy; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1677855178; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=KcwRPHodLDSj1JEX9luATO5s2KrQNrovBpjoEOsUqkk=; b=QsNerUxeyLYfM2PAb+jP98DvrHHzzfNNHAOMI0xHVnJ3+HY81tpwyqVo5PVDTlCVLd 3xGco/JoGqMZYxJHZLNDvH9fBZQzNbxoFwb66T5+47Brk9tE00pFqnxTQULzCKxXzsNA XonAi94mPWfd09NvP8Ly1Cw413ydammNESxlE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677855178; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender: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=KcwRPHodLDSj1JEX9luATO5s2KrQNrovBpjoEOsUqkk=; b=hhkjv4CREN/vbW+VY2K8eWTKUAdj0+UMpPu2p4CPWXC79QH4qZ6YtvKJWOIC2CbTnA rDGLNLsX9lHlVhyrpyicyVLkacUDi7Ca/wawi8dWjXXqWyAwta1tovgl1cu0inGyG8F2 mMaDao22UkLVVJVPZOjTyFeu7PJDogn2mAKuEennZyLvevL8HtXVVqRAcN64D1WgqRxU IyDoiN0uqqg66qkCFisnTRS52ov8/htQ7dPssfcK09CBKjoEEDH/ankwaAVfnsqzrFEk KT+zWnCQXEBuiKXzXM/o2YIdW47abPU5FJCqaGxkAEspdaSJ3bYc3E6KExtG5iiOjT+6 aoZg== X-Gm-Message-State: AO0yUKWrhPxpi44ifuXaa5B8iT+oS7nvJ/UqVMNXT+oGVcQWHsNScXCs t49ek46oBdZR86FLXlt1OtMhaIXN X-Google-Smtp-Source: AK7set+XWPQn7WbLw/5ee1PaA7Hf2dGG9VEfTzk/bg86LWKmHF/IIVO1kao2xcdZQIZ7Nqa6cuKq4Q== X-Received: by 2002:a62:828e:0:b0:593:da6f:fb1c with SMTP id w136-20020a62828e000000b00593da6ffb1cmr1015011pfd.4.1677855178657; Fri, 03 Mar 2023 06:52:58 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90b:3890:b0:237:7ef0:5b8 with SMTP id mu16-20020a17090b389000b002377ef005b8ls6512043pjb.3.-pod-canary-gmail; Fri, 03 Mar 2023 06:52:58 -0800 (PST) X-Received: by 2002:a17:902:ea02:b0:19d:2a3:f017 with SMTP id s2-20020a170902ea0200b0019d02a3f017mr2403658plg.62.1677855177652; Fri, 03 Mar 2023 06:52:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677855177; cv=none; d=google.com; s=arc-20160816; b=P3sIS3rxBGciunzXWIjX45/8fjmjggAC3S5ZVCAbK90ClmTvoAL+5unP26qOJMXZ6D e9dduGBKqM/hKImNxTtCMsfWdHAGGpvZ3aHFDdjQXxg8caNNG7xfum5enhD3kQrKm22f 4+1kjad+ZJ+y3/kanBDeG3rwMAzSMZt+jKktvM2a/kS9VXEU+tRgthCxvW3tSmKVTC6z oBql5pS7sqk6ERS9BF6afLeErHE2j32MCZALUccEwMMTmZJN1wuNK9E1jYnAD4aaj3bE kDrQvjsMaUiCfcspbVyYgp3Y4YXSndeWO35NMg/V0M02yBgWacex03pie+CF7VY0rDVp 2zRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=GpBHKg2Gosb5BLI0oOYz0OdhN4+kHsJSwAsQE5BDZyI=; b=IGPAMTkxApA42FUvof+8r4FQ19sR32n45ItVJdxlT/w35KMxWru2HkhIMv9Y+2ALRD UMsLHQzbPBbdjvJSvoCJK9GP7QCJo8AxRVeuwCR+Sy78JK/eVYgUbP29kByMCGpnKX5/ Scq0TsJLv80zjZ3bof8Qg4kwrWLb0wTS+yrk/LAdto28JFnT5v65AJ3bnP9RJ+7wZHFH qJ1V+pYsEWBQ2Oz8NzBPYlt98U5Eg8myTKc1jLyEPATyjKEnIpjQFcZxTMUFGu3DmByM MSJngHZ0R+nWXeTM5+KwoeGsdsSex4WQwowlqY8dZZ5QvUbOiAWdKuGa8sCrTr7NZ39L 5t/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=cbJxdKLy; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id p5-20020a170902780500b0019a7a239ea7sor1172619pll.71.2023.03.03.06.52.57 for (Google Transport Security); Fri, 03 Mar 2023 06:52:57 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:c510:b0:cc:5917:c4ec with SMTP id gm16-20020a056a20c51000b000cc5917c4ecmr1900370pzb.23.1677855177350; Fri, 03 Mar 2023 06:52:57 -0800 (PST) Received: from localhost.localdomain ([183.83.137.89]) by smtp.gmail.com with ESMTPSA id z4-20020a63e544000000b00502fd70b0bdsm1660856pgj.52.2023.03.03.06.52.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 06:52:56 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Neil Armstrong , Marek Vasut , Maxime Ripard Cc: Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-amarula , Jagan Teki Subject: [PATCH v15 08/16] drm: exynos: dsi: Add input_bus_flags Date: Fri, 3 Mar 2023 20:21:30 +0530 Message-Id: <20230303145138.29233-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303145138.29233-1-jagan@amarulasolutions.com> References: <20230303145138.29233-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=cbJxdKLy; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , LCDIF-DSIM glue logic inverts the HS/VS/DE signals and expecting the i.MX8M Mini/Nano DSI host to add additional Data Enable signal active low (DE_LOW). This makes the valid data transfer on each horizontal line. So, add additional bus flags DE_LOW setting via input_bus_flags for i.MX8M Mini/Nano platforms. Reviewed-by: Marek Vasut Reviewed-by: Frieder Schrempf Suggested-by: Marek Vasut Signed-off-by: Jagan Teki --- Changes for v15, v13: - none Changes for v12: - collect RB from Marek Changes for v11: - collect RB from Frieder Changes for v10, v9: - none Changes for v8: - add DE_LOW for i.MX8M Mini/Nano platforms. Changes for v7, v6: - none Changes for v5: - rebased based on updated bridge changes Changes for v4 - v1: - none drivers/gpu/drm/exynos/exynos_drm_dsi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 796480e4a18b..5d971b607e1a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1736,6 +1736,10 @@ static const struct component_ops exynos_dsi_component_ops = { .unbind = exynos_dsi_unbind, }; +static const struct drm_bridge_timings dsim_bridge_timings_de_low = { + .input_bus_flags = DRM_BUS_FLAG_DE_LOW, +}; + static int exynos_dsi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -1822,6 +1826,10 @@ static int exynos_dsi_probe(struct platform_device *pdev) dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; dsi->bridge.pre_enable_prev_first = true; + /* DE_LOW: i.MX8M Mini/Nano LCDIF-DSIM glue logic inverts HS/VS/DE */ + if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) + dsi->bridge.timings = &dsim_bridge_timings_de_low; + ret = component_add(dev, &exynos_dsi_component_ops); if (ret) goto err_disable_runtime; From patchwork Fri Mar 3 14:51:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2772 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D8B7B44AA6 for ; Fri, 3 Mar 2023 15:53:04 +0100 (CET) Received: by mail-pl1-f199.google.com with SMTP id l10-20020a17090270ca00b0019caa6e6bd1sf1509336plt.2 for ; Fri, 03 Mar 2023 06:53:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677855183; cv=pass; d=google.com; s=arc-20160816; b=BWktcYnBN65CiFWtVjgMBUbcKXKxWSe4wl5mqaJsw0x2D8UR4sRhx1cE7Xsp+f0iqe Bf0UYIkA6LHyOCRtOFMeXInQnns4X6hpXaCSgpDHsBXs4KL1iVsQk4jPTw5aZw9Br7G+ 91CcF30gyrR1/pfqv1abZckSk5OMeUzDzCMBwiYk+ywsMsWwleLQrDlXyfp2xNIgkTlj fWdpolbx+o6FMWLbymglckyU62JfoSweVgshRKfXFxMZ4qjK4Cgy7BRYevDTJwKQoKVx 6wTHKKgYEP0FFjqXxK2DG7hQDk1+rq+Z1pUTEAfYQqUcYzb6hmC9iAg7v758STFI+CW9 yjKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=2YQSUPIosxFuU9oJeY7Oh+VpIStUgNHhScC26obmszs=; b=JapNLHLQBjmgq3KOVhahs8ucO8qju2YdzXgwihsMOOUfXDSOCQUw5iWVtA3UctzL6a WOgBGjo3y/bW3b552FWkaMWOa29PmqcPY5yP/9V2zVHcH32NsdVVVdvQSgib7Y/Sgjqe aMLEJdkZ7+N5HyLdhg8eRgNwfS1pFlw7u2BS+j8q0/5S1sLZnbQE/9aQd5QZ90qTO6jT /IH4wI/XCv0TpTkXv+i3BvuZLtjKdJNhka+XsdgWzsUINRNKVsIJw2jf6I4kBKcj65of JWlEOSrOfGTmPMZUCu7FkGxvQZSmHdEOcuHBll9zO6iRzV+fDv2XVf/qMBpgnyUaWHih 7xOA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kxNMkEPN; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1677855183; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=2YQSUPIosxFuU9oJeY7Oh+VpIStUgNHhScC26obmszs=; b=kUgaX8DhEK6uJpoiDoZAfPGO/2dOP5qiHuKy1LqrJkvVTtwXMTLkCnegLNA04grEr8 Tb0u5gGitfCUXqI6c5U+oGYZSZf+a3/zyYB0NuaYYYOVBVJQIzFt0X8INFUQ2tF9W5fC p02vXgyYyoJTcUS20KrxWHVcW2nKakgb2nRWg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677855183; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender: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=2YQSUPIosxFuU9oJeY7Oh+VpIStUgNHhScC26obmszs=; b=splLhhT1wEARSZDqagTzQMX9KQor0G1B3IHq8FmjdeSwin5BA5y4IuP3vDkkRY3+UP owkQq6jPUvytdkajIzPW+8kfdmDZr5dOc3YOKGZJlBiJSJBsi/PRLsJDiKdM2AveUGy7 B/ZhSdoUR74EjzhZ+KreRhbwum6USy0q5cUUJDgjXRDo2kImKUKrdcx6aYj7k6GUG03t aX8ycjdRTFJb5Wi1Tzi6uza8MRKQgN2MRHVQvtDm8Sr5+38JzhO+RQ71/mXN84UycdsV PDdiBmde99uakqcK83OCnA8VIujcC4Y01EPScFiWv5g2cE5FP29/yYP/UWM5kYMcInL2 2ANA== X-Gm-Message-State: AO0yUKXCwlaVI77aW32cU4NzbgGo8466K6If0KLU5nhcQW5sXH5jVaTK zdFQFyoq3aM5HWF6S1wzFJv0Hsir X-Google-Smtp-Source: AK7set9wdDiR7/CRnl/9TABBp9sTjta5n0WlwunHtHIgR2Z0BniY3HmrjeLC0scH/hqcLSgEGm7g3A== X-Received: by 2002:a62:d154:0:b0:5a9:9713:1dc with SMTP id t20-20020a62d154000000b005a9971301dcmr1024571pfl.6.1677855183548; Fri, 03 Mar 2023 06:53:03 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:e742:b0:19c:2b1c:4d75 with SMTP id p2-20020a170902e74200b0019c2b1c4d75ls924100plf.0.-pod-prod-gmail; Fri, 03 Mar 2023 06:53:02 -0800 (PST) X-Received: by 2002:a17:903:283:b0:19c:fbdb:43cb with SMTP id j3-20020a170903028300b0019cfbdb43cbmr2530100plr.51.1677855182607; Fri, 03 Mar 2023 06:53:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677855182; cv=none; d=google.com; s=arc-20160816; b=0OT/VJLKZW3vnYcdrd+RdjdtZFVIzXsUtlxe4GaMAMDqEVyxHOa5nAzHZ63hRdeaL/ H4z/LQIqEtvsHGbIIS3F0t6ihoGa6T0X3WemKkK5zXSLZcIQ8RdKA6b6Z/IU0rK0f/SC Y4iW1MUVfiU/3M4k1YqtLzpkSbxJZuKeFyImTqrsfRwLpFlMF2ff4yTMtZ1zjWSr7r+4 TT7Ur4DDWJdk3pvfHbkcuPS8/JDZpLnK+yWzSxz/IjTPF/JiyiYZgVQ0Idh5pH2G8BKG qXFqmQO7C9yVUOEkpgg71lU4FS2Rz67PAAqlWOoiRva3Q5W2pRbGp7WUPbICUnWUnJKL hwRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=PGJGqhl3LEdXBGmIvlrEtV96J1iyv0EV2tG0O2KrmWU=; b=T3ckitPljS0y9GZjCHRSJIDUBqr0sA125Mszg/8qmisnvg8jrdBq9UgLmHFKXzzxeO DunrHpnYL5dnNVGmbPGke7FwlEVrGmIF2/PTXbUbtqgye6yJV1UlzwvxdT3JB8XCG+ol deZqunEv0CMpXD5hXTnJAzWI4vytIJzfjShHnRuza9giQWpcku4CFni0dBP9MV785LnR YwHEbXeuUXBa8hLJIwcSwMjlqDTTJzh2q0j0w7z3xwxwyRuFN7Y5c3dZoheCFaUxJs0w LoxMclt037eRPQQiIvHhCLEYX6P7tY9SUHh33dtw0vuQ0YIJ7y1LYPibQ3SdsunrB+u2 bU9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kxNMkEPN; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id j8-20020a17090276c800b0019c725e79e0sor1245411plt.31.2023.03.03.06.53.02 for (Google Transport Security); Fri, 03 Mar 2023 06:53:02 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:394e:b0:bc:333f:b958 with SMTP id r14-20020a056a20394e00b000bc333fb958mr2791368pzg.30.1677855182228; Fri, 03 Mar 2023 06:53:02 -0800 (PST) Received: from localhost.localdomain ([183.83.137.89]) by smtp.gmail.com with ESMTPSA id z4-20020a63e544000000b00502fd70b0bdsm1660856pgj.52.2023.03.03.06.52.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 06:53:01 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Neil Armstrong , Marek Vasut , Maxime Ripard Cc: Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-amarula , Jagan Teki Subject: [PATCH v15 09/16] drm: exynos: dsi: Add atomic_get_input_bus_fmts Date: Fri, 3 Mar 2023 20:21:31 +0530 Message-Id: <20230303145138.29233-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303145138.29233-1-jagan@amarulasolutions.com> References: <20230303145138.29233-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kxNMkEPN; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Finding the right input bus format throughout the pipeline is hard so add atomic_get_input_bus_fmts callback and initialize with the proper input format from list of supported output formats. This format can be used in pipeline for negotiating bus format between the DSI-end of this bridge and the other component closer to pipeline components. List of Pixel formats are taken from, AN13573 i.MX 8/RT MIPI DSI/CSI-2, Rev. 0, 21 March 2022 3.7.4 Pixel formats Table 14. DSI pixel packing formats Reviewed-by: Marek Vasut Reviewed-by: Frieder Schrempf Tested-by: Marek Szyprowski Signed-off-by: Jagan Teki --- Changes for v15: - collect RB from Marek Changes for v12: - update the logic suggested by Marek Changes for v11: - collect RB from Frieder - drop extra line Changes for v10: - none Changes for v9: - added MEDIA_BUS_FMT_FIXED - return MEDIA_BUS_FMT_RGB888_1X24 output_fmt if supported output_fmt list is unsupported. - added MEDIA_BUS_FMT_YUYV10_1X20, MEDIA_BUS_FMT_YUYV12_1X24 Changes for v8: - added pixel formats supported by NXP AN13573 i.MX 8/RT MIPI DSI/CSI-2 Changes for v7 - v4: - none Changes for v3: - include media-bus-format.h Changes for v2: - none Changes for v1: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 62 +++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 5d971b607e1a..c8829f33f36e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -1466,6 +1467,66 @@ static void exynos_dsi_atomic_post_disable(struct drm_bridge *bridge, pm_runtime_put_sync(dsi->dev); } +/* + * This pixel output formats list referenced from, + * AN13573 i.MX 8/RT MIPI DSI/CSI-2, Rev. 0, 21 March 2022 + * 3.7.4 Pixel formats + * Table 14. DSI pixel packing formats + */ +static const u32 exynos_dsi_pixel_output_fmts[] = { + MEDIA_BUS_FMT_YUYV10_1X20, + MEDIA_BUS_FMT_YUYV12_1X24, + MEDIA_BUS_FMT_UYVY8_1X16, + MEDIA_BUS_FMT_RGB101010_1X30, + MEDIA_BUS_FMT_RGB121212_1X36, + MEDIA_BUS_FMT_RGB565_1X16, + MEDIA_BUS_FMT_RGB666_1X18, + MEDIA_BUS_FMT_RGB888_1X24, +}; + +static bool exynos_dsi_pixel_output_fmt_supported(u32 fmt) +{ + int i; + + if (fmt == MEDIA_BUS_FMT_FIXED) + return false; + + for (i = 0; i < ARRAY_SIZE(exynos_dsi_pixel_output_fmts); i++) { + if (exynos_dsi_pixel_output_fmts[i] == fmt) + return true; + } + + return false; +} + +static u32 * +exynos_dsi_atomic_get_input_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + u32 output_fmt, + unsigned int *num_input_fmts) +{ + u32 *input_fmts; + + input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + if (!exynos_dsi_pixel_output_fmt_supported(output_fmt)) + /* + * Some bridge/display drivers are still not able to pass the + * correct format, so handle those pipelines by falling back + * to the default format till the supported formats finalized. + */ + output_fmt = MEDIA_BUS_FMT_RGB888_1X24; + + input_fmts[0] = output_fmt; + *num_input_fmts = 1; + + return input_fmts; +} + static int exynos_dsi_atomic_check(struct drm_bridge *bridge, struct drm_bridge_state *bridge_state, struct drm_crtc_state *crtc_state, @@ -1514,6 +1575,7 @@ static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_reset = drm_atomic_helper_bridge_reset, + .atomic_get_input_bus_fmts = exynos_dsi_atomic_get_input_bus_fmts, .atomic_check = exynos_dsi_atomic_check, .atomic_pre_enable = exynos_dsi_atomic_pre_enable, .atomic_enable = exynos_dsi_atomic_enable, From patchwork Fri Mar 3 14:51:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2773 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 09F2C44AA6 for ; Fri, 3 Mar 2023 15:53:10 +0100 (CET) Received: by mail-pf1-f198.google.com with SMTP id y35-20020a056a00182300b005e8e2c6afe2sf1469366pfa.12 for ; Fri, 03 Mar 2023 06:53:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677855188; cv=pass; d=google.com; s=arc-20160816; b=uy4G7G6GQNDBwz1YrK13i0hMnt44/3tg+tphUJqhofIOrg3h0d/qn2SDmBHcoztiOt Zp6sVKNFF5WcV4ndCLiutjWSj4Ph6CNKs+B/51FVkynSTkn52y89R8Xwgi2HG3fpwKOm zEjgXeZliB6kwpYOJSwDu1FMwZvQBDubCwnLRgfilmNhB2rlntFg7sDIY+tBFYslT2Xp EZk8+8hq1zIuvxgr4RcH5q92v3TIB4A1GmwFaGMViLl3s3k+WwmD4ueAO/Ra763F7FBK SkmlFy7TR/CTVDVHOfvP0ppCu77vp+b/zN7Ig0reCob1Ox8rZtJ1K17FMSHnOKbNQCIs zfNw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PgL+yJXjuBKhsa38TUPJ5D6UxS3ecNDACpeknNu6RQs=; b=RjYKHvTaDZpE7we2PeIF8DtW80pOWiYLl9KewCSkCdzs7LOGcaoClbaYAKAU7I///j 535BlV/zrlxU5bX2wQeYpxqZVXluq1XEstsBQ/2apokJt2kGk5/sJKl3e06WZE7flRnM KO4ksQN6SWNXYOjNdxDN8pJNg1/oODfFdxJJ6h3jy+b0pLZ10dYgB0U1knnrSw278Ne5 95xx2vafUt9033Awzu43ikrJxAqdi19Z1DV2P/vDeVTekRumclitdgngkEqUGIZsRu4O 42frbajLZPKBmwom5qHU2itQtJMGTefXmChURLm9UlWjv6Nf9c1S/uviN8xCW1/fpMkE 3VWA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UXnLPNPA; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1677855188; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender: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=PgL+yJXjuBKhsa38TUPJ5D6UxS3ecNDACpeknNu6RQs=; b=hkLSOK5hylI3snxSYdWB/0Q6Z3YT4xlieeoza4w1zrux37pYMspOhBy/4YpRgkzKaV h+4KwSqmmEdd683jN327ble/7Cm3q7LekkuRr+HD8ocVoqR42bnzNyH1glWDi5sYsz7b bx8f3gQ+pNC/e/9BS8X2Kg9kd2h12O8L9f62E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677855188; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :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=PgL+yJXjuBKhsa38TUPJ5D6UxS3ecNDACpeknNu6RQs=; b=10bNIUi7a7uVG+KNBz4nP42W/9LvB/sllatn4RriKHVRuz1fy1Pn+/+Zib2lF3+0Vo TNsGa/L7T9r5A8csP3xs1nQR3C2wCa0cnjNgF5TkB56z0+NijbZvn9yJDC/46QDD8SFx mpeyhtjIF862PgrpjwXaL2r1ztjjwxm3hV6G8JPP7hWh0aETsYjl3+4QHpfOiXt2rbXX gFQF5WhRXqXVsndIXUqrJ7nc3n5jDPer9vTyuPgLIKgrfcSICt5AY002zBE0TgSRmDGL 1O3zDgOhl4iVhOgVvSWjPgGhapyhC3+zqUzjHd7z6LEv46MugvYKZ2zKaVz7Gal8gqYT evyw== X-Gm-Message-State: AO0yUKVYhj93kV2ww80t4X3NjYPv8A1L9fUyrFuBGQBrdUVJZP7zKYtw zK56MYW4uI3niA/nwdaBL4cw+Vru X-Google-Smtp-Source: AK7set+W8tGJL2kPF4YvtJKKNJc0xH2d2BZXXI1Td0lsOk8ZUimkICb4QLTRfMGvha+/8ECcYvdG6Q== X-Received: by 2002:a17:903:428a:b0:19e:651b:9429 with SMTP id ju10-20020a170903428a00b0019e651b9429mr797583plb.3.1677855188790; Fri, 03 Mar 2023 06:53:08 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:e742:b0:19c:2b1c:4d75 with SMTP id p2-20020a170902e74200b0019c2b1c4d75ls924283plf.0.-pod-prod-gmail; Fri, 03 Mar 2023 06:53:08 -0800 (PST) X-Received: by 2002:a17:902:d381:b0:19a:b033:2bb1 with SMTP id e1-20020a170902d38100b0019ab0332bb1mr1951567pld.44.1677855187738; Fri, 03 Mar 2023 06:53:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677855187; cv=none; d=google.com; s=arc-20160816; b=GNX78yxNPINVshJWGXJ84pHfxMUogR3WZPtJmZ4fbFPJGc6BroNKI+rdcm2/Hd794P rHvKw3GO7+w9CSl+4nhzf1HExUiQQ/SFTnSiN0wtxYNUYUcWX4SvwS6cXdQjSqiINbyj e2BimB3wfqGTSyxKXdqXdJJfdFd4NGOyROY+Esbvwca3fgNMvE/Z4ZrsFx2BzttubeRN uJUZ+1Pfiz/luH6HC1ISoFdug9IbqxPKHBrvCFhHHNqhs3BKytHBI2an0udFFXG0nrPo qewD4TFhMAIWm6LOiNn2m8nwXnp/w9iKf1aL9kA7ALYHmtRTbpOPVv3xSt3eJGeAigPC xv2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=KpLWAK14peIKe8R0E4tzY6GUsUPXTajM4OP5jILu6lM=; b=JX+cNvyR1AiegSGK99XKUSSqSNPNz/+i90+/uTh9RDC7n5sL+zaKPIvxhrXQfbW1Ld sDbxI5wQnYt8VwTdBUdnOTRXSRQgD36BHlSEn7Q+c/7MElyo0j80FnBQcgpsxe45SiDt AnQ5VScDFnVpbbhVjIPwc4lR075ij7NaX4FuCJCUBhNy6LJAUEdfc46PHH5WWoNRXXCu QaLzG1Hwp/WbDlIARB+Y2lG7ww090zE0IcWhzlePFbW4YJXZ385Am3RxdiRSPGvhaN3P ycGsWcjaXxiqDN3lDrFp7+Kerzt+OJW9g70GIm8wtZXevgmVoP1HRpnIuy5fk0RNBSpE R/RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UXnLPNPA; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id f17-20020a170902ab9100b0019bb4f93fa8sor1088706plr.116.2023.03.03.06.53.07 for (Google Transport Security); Fri, 03 Mar 2023 06:53:07 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a21:32a2:b0:cb:8d74:112e with SMTP id yt34-20020a056a2132a200b000cb8d74112emr2340673pzb.45.1677855187397; Fri, 03 Mar 2023 06:53:07 -0800 (PST) Received: from localhost.localdomain ([183.83.137.89]) by smtp.gmail.com with ESMTPSA id z4-20020a63e544000000b00502fd70b0bdsm1660856pgj.52.2023.03.03.06.53.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 06:53:06 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Neil Armstrong , Marek Vasut , Maxime Ripard Cc: Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-amarula , Jagan Teki Subject: [PATCH v15 10/16] drm: exynos: dsi: Consolidate component and bridge Date: Fri, 3 Mar 2023 20:21:32 +0530 Message-Id: <20230303145138.29233-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303145138.29233-1-jagan@amarulasolutions.com> References: <20230303145138.29233-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UXnLPNPA; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , DSI host registration, attach and detach operations are quite different for the component and bridge-based DRM drivers.  Supporting generic bridge driver to use both component and bridge based DRM drivers can be tricky and would require additional host related operation hooks. Add host operation hooks for registering and unregistering Exynos and generic drivers, where Exynos hooks are used in existing Exynos component based DRM drivers and generic hooks are used in i.MX8M bridge based DRM drivers.  Add host attach and detach operation hooks for Exynos component DRM drivers and those get invoked while DSI core host attach and detach gets called. Reviewed-by: Marek Vasut Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- Changes for v15: - remove leading underscores in function names Changes for v13: - none Changes for v12: - fix unneeded decleration - collect RB from Marek Changes for v11: - none Changes for v10: - split from previous series patch "drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge" drivers/gpu/drm/exynos/exynos_drm_dsi.c | 169 +++++++++++++++++++----- 1 file changed, 134 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index c8829f33f36e..afe2d293c785 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -283,10 +283,10 @@ struct exynos_dsi_driver_data { struct exynos_dsi_plat_data { enum exynos_dsi_type hw_type; + const struct exynos_dsim_host_ops *host_ops; }; struct exynos_dsi { - struct drm_encoder encoder; struct mipi_dsi_host dsi_host; struct drm_bridge bridge; struct drm_bridge *out_bridge; @@ -316,6 +316,19 @@ struct exynos_dsi { const struct exynos_dsi_driver_data *driver_data; const struct exynos_dsi_plat_data *plat_data; + + void *priv; +}; + +struct exynos_dsim_host_ops { + int (*register_host)(struct exynos_dsi *dsim); + void (*unregister_host)(struct exynos_dsi *dsim); + int (*attach)(struct exynos_dsi *dsim, struct mipi_dsi_device *device); + int (*detach)(struct exynos_dsi *dsim, struct mipi_dsi_device *device); +}; + +struct exynos_dsi_enc { + struct drm_encoder encoder; }; #define host_to_dsi(host) container_of(host, struct exynos_dsi, dsi_host) @@ -1320,7 +1333,8 @@ static irqreturn_t exynos_dsi_irq(int irq, void *dev_id) static irqreturn_t exynos_dsi_te_irq_handler(int irq, void *dev_id) { struct exynos_dsi *dsi = (struct exynos_dsi *)dev_id; - struct drm_encoder *encoder = &dsi->encoder; + struct exynos_dsi_enc *dsi_enc = dsi->priv; + struct drm_encoder *encoder = &dsi_enc->encoder; if (dsi->state & DSIM_STATE_VIDOUT_AVAILABLE) exynos_drm_crtc_te_handler(encoder->crtc); @@ -1589,9 +1603,8 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { struct exynos_dsi *dsi = host_to_dsi(host); + const struct exynos_dsi_plat_data *pdata = dsi->plat_data; struct device *dev = dsi->dev; - struct drm_encoder *encoder = &dsi->encoder; - struct drm_device *drm = encoder->dev; struct device_node *np = dev->of_node; struct device_node *remote; struct drm_panel *panel; @@ -1648,35 +1661,15 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, drm_bridge_add(&dsi->bridge); - drm_bridge_attach(encoder, &dsi->bridge, - list_first_entry_or_null(&encoder->bridge_chain, - struct drm_bridge, - chain_node), 0); - - /* - * This is a temporary solution and should be made by more generic way. - * - * If attached panel device is for command mode one, dsi should register - * TE interrupt handler. - */ - if (!(device->mode_flags & MIPI_DSI_MODE_VIDEO)) { - ret = exynos_dsi_register_te_irq(dsi, &device->dev); - if (ret) + if (pdata->host_ops && pdata->host_ops->attach) { + ret = pdata->host_ops->attach(dsi, device); + if (ret < 0) return ret; } - mutex_lock(&drm->mode_config.mutex); - dsi->lanes = device->lanes; dsi->format = device->format; dsi->mode_flags = device->mode_flags; - exynos_drm_crtc_get_by_type(drm, EXYNOS_DISPLAY_TYPE_LCD)->i80_mode = - !(dsi->mode_flags & MIPI_DSI_MODE_VIDEO); - - mutex_unlock(&drm->mode_config.mutex); - - if (drm->mode_config.poll_enabled) - drm_kms_helper_hotplug_event(drm); return 0; } @@ -1685,14 +1678,16 @@ static int exynos_dsi_host_detach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { struct exynos_dsi *dsi = host_to_dsi(host); - struct drm_device *drm = dsi->encoder.dev; + const struct exynos_dsi_plat_data *pdata = dsi->plat_data; + int ret; dsi->out_bridge = NULL; - if (drm->mode_config.poll_enabled) - drm_kms_helper_hotplug_event(drm); - - exynos_dsi_unregister_te_irq(dsi); + if (pdata->host_ops && pdata->host_ops->detach) { + ret = pdata->host_ops->detach(dsi, device); + if (ret < 0) + return ret; + } drm_bridge_remove(&dsi->bridge); @@ -1766,11 +1761,67 @@ static int exynos_dsi_parse_dt(struct exynos_dsi *dsi) return 0; } +static int exynos_dsim_host_attach(struct exynos_dsi *dsim, + struct mipi_dsi_device *device) +{ + struct exynos_dsi_enc *dsi_enc = dsim->priv; + struct drm_encoder *encoder = &dsi_enc->encoder; + struct drm_device *drm = encoder->dev; + int ret; + + drm_bridge_attach(encoder, &dsim->bridge, + list_first_entry_or_null(&encoder->bridge_chain, + struct drm_bridge, + chain_node), 0); + + /* + * This is a temporary solution and should be made by more generic way. + * + * If attached panel device is for command mode one, dsi should register + * TE interrupt handler. + */ + if (!(device->mode_flags & MIPI_DSI_MODE_VIDEO)) { + ret = exynos_dsi_register_te_irq(dsim, &device->dev); + if (ret) + return ret; + } + + mutex_lock(&drm->mode_config.mutex); + + dsim->lanes = device->lanes; + dsim->format = device->format; + dsim->mode_flags = device->mode_flags; + exynos_drm_crtc_get_by_type(drm, EXYNOS_DISPLAY_TYPE_LCD)->i80_mode = + !(dsim->mode_flags & MIPI_DSI_MODE_VIDEO); + + mutex_unlock(&drm->mode_config.mutex); + + if (drm->mode_config.poll_enabled) + drm_kms_helper_hotplug_event(drm); + + return 0; +} + +static int exynos_dsim_host_detach(struct exynos_dsi *dsim, + struct mipi_dsi_device *device) +{ + struct exynos_dsi_enc *dsi_enc = dsim->priv; + struct drm_device *drm = dsi_enc->encoder.dev; + + if (drm->mode_config.poll_enabled) + drm_kms_helper_hotplug_event(drm); + + exynos_dsi_unregister_te_irq(dsim); + + return 0; +} + static int exynos_dsi_bind(struct device *dev, struct device *master, void *data) { struct exynos_dsi *dsi = dev_get_drvdata(dev); - struct drm_encoder *encoder = &dsi->encoder; + struct exynos_dsi_enc *dsi_enc = dsi->priv; + struct drm_encoder *encoder = &dsi_enc->encoder; struct drm_device *drm_dev = data; int ret; @@ -1788,7 +1839,7 @@ static void exynos_dsi_unbind(struct device *dev, struct device *master, { struct exynos_dsi *dsi = dev_get_drvdata(dev); - exynos_dsi_atomic_disable(&dsi->bridge, NULL); + dsi->bridge.funcs->atomic_disable(&dsi->bridge, NULL); mipi_dsi_host_unregister(&dsi->dsi_host); } @@ -1798,6 +1849,40 @@ static const struct component_ops exynos_dsi_component_ops = { .unbind = exynos_dsi_unbind, }; +static int exynos_dsi_register_host(struct exynos_dsi *dsim) +{ + struct exynos_dsi_enc *dsi_enc; + + dsi_enc = devm_kzalloc(dsim->dev, sizeof(*dsi_enc), GFP_KERNEL); + if (!dsi_enc) + return -ENOMEM; + + dsim->priv = dsi_enc; + dsim->bridge.pre_enable_prev_first = true; + + return component_add(dsim->dev, &exynos_dsi_component_ops); +} + +static void exynos_dsi_unregister_host(struct exynos_dsi *dsim) +{ + component_del(dsim->dev, &exynos_dsi_component_ops); +} + +static int generic_dsim_register_host(struct exynos_dsi *dsim) +{ + return mipi_dsi_host_register(&dsim->dsi_host); +} + +static void generic_dsim_unregister_host(struct exynos_dsi *dsim) +{ + mipi_dsi_host_unregister(&dsim->dsi_host); +} + +static const struct exynos_dsim_host_ops generic_dsim_host_ops = { + .register_host = generic_dsim_register_host, + .unregister_host = generic_dsim_unregister_host, +}; + static const struct drm_bridge_timings dsim_bridge_timings_de_low = { .input_bus_flags = DRM_BUS_FLAG_DE_LOW, }; @@ -1892,7 +1977,9 @@ static int exynos_dsi_probe(struct platform_device *pdev) if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) dsi->bridge.timings = &dsim_bridge_timings_de_low; - ret = component_add(dev, &exynos_dsi_component_ops); + if (dsi->plat_data->host_ops && dsi->plat_data->host_ops->register_host) + ret = dsi->plat_data->host_ops->register_host(dsi); + if (ret) goto err_disable_runtime; @@ -1983,24 +2070,36 @@ static const struct dev_pm_ops exynos_dsi_pm_ops = { pm_runtime_force_resume) }; +static const struct exynos_dsim_host_ops exynos_dsi_host_ops = { + .register_host = exynos_dsi_register_host, + .unregister_host = exynos_dsi_unregister_host, + .attach = exynos_dsim_host_attach, + .detach = exynos_dsim_host_detach, +}; + static const struct exynos_dsi_plat_data exynos3250_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS3250, + .host_ops = &exynos_dsi_host_ops, }; static const struct exynos_dsi_plat_data exynos4210_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS4210, + .host_ops = &exynos_dsi_host_ops, }; static const struct exynos_dsi_plat_data exynos5410_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS5410, + .host_ops = &exynos_dsi_host_ops, }; static const struct exynos_dsi_plat_data exynos5422_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS5422, + .host_ops = &exynos_dsi_host_ops, }; static const struct exynos_dsi_plat_data exynos5433_dsi_pdata = { .hw_type = DSIM_TYPE_EXYNOS5433, + .host_ops = &exynos_dsi_host_ops, }; static const struct of_device_id exynos_dsi_of_match[] = { From patchwork Fri Mar 3 14:51:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2774 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 3495B44AA6 for ; Fri, 3 Mar 2023 15:53:15 +0100 (CET) Received: by mail-pj1-f71.google.com with SMTP id m18-20020a17090a7f9200b002375a3cbc9bsf1299239pjl.9 for ; Fri, 03 Mar 2023 06:53:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677855194; cv=pass; d=google.com; s=arc-20160816; b=WRaHxW6g5UPXGcHJN8lZJTJWdgsOZfuIW92AstNKFyL/wnyC1wkUkCv9emlHJEzUyr 5qG3Yu3XHztOTcvMmXuGGVb5wP3DDq4kdyhkRfeGZoCryOSbc+mYd/KNSN/6bhpbggvA qNW+TgH/ZWJe0ONFDeT4hnMJmGy2OIJsKd0+kHT83uUCEYyo2sMXOmYTB6HAl3PlLPcP RZqptKP6sCYiW9W5tCsxQF9Y7zQANDXrLKEjnDa+0kMPMSnLTmpxkUkBvw3iInQHkrwJ 5ZjfEUkCcuoniEuIRwklvW4LtroktfIOlZfp6zi8G9IBF4txOv9nSe07X3KDYu74HUAV ylZw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=04dYGxSKIKNWdyEzietfYpJQpfbzh8aGP2Kw5A4LN1Q=; b=g3JUZoD1QckZIyYnyf4ruY2v1+Wi5tHgigRFFM3Hg0cjSKba/gF8bD+IS3xqUKALt+ CMYq4YJKgsEFhGe1VhTLbYZFPOdA2K1/Fe9cyaad5oslqZIqxudQp15pQ3jVMokCF8jj yPZIkZ8VCl21jcoqrVkz1jAcl6JrQXGLm3uvfvZsF+sPPXoMVSJ1N7KAvBnKDTmQQgD+ yKkJyiHj7hKpbTY2aHaHgG/tw3O/6OtfKy7moGq65Su/qmfe9T/V279FJC3uh2guM0XL cUKSOz0KbXEl6EA+WhJWIbnKjDUp3c8/HzmgwXNMnu48bm+iWJ1I+DEvSEKLcyzVjKnv vpsw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MECwk9Yw; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1677855194; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender: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=04dYGxSKIKNWdyEzietfYpJQpfbzh8aGP2Kw5A4LN1Q=; b=mfsnxkzdb3AVWgTB5SPHEYg8ZMauhJy7g9i/fSib0XFtetprcJCIyoTS2Ax3B8XG5z bwwA+HUtb0oWcMm2oBgpwMCvC9cjywg+7wgjcJAOapR25I2cehZfWa6tizqxxgBU/8Vs u0EsZIK/lflv22QetINbfHin3aUiXdcZ/FEYc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677855194; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :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=04dYGxSKIKNWdyEzietfYpJQpfbzh8aGP2Kw5A4LN1Q=; b=Z/b+0e9aRaJr4wCW+ck6gOosDz1DrkuJj1zR6GkWJSkqGRoYkQqo+8bqoihzbqKMbI 4130IudekJK6fV/vzfnanjVlfTHEGUiugdY3kSe38KucNpIP+aJ4NcCIy6/79Yv8rD8o EFU9HzgmN/WZ+swSbfF1Qpe6Tbw2XOTZw2RDNPuWVpLbqZGk8ywZwld3YZ/VYYdFPiwg 1h1bZgPZazPFLBDjWmGlsY2op6pRmItU+lhme58R7esUdJbTJybis99ISqcJAS+zm/7J RcFO1RxFI8UE09mNqDwUMph4+8Hh8oWjhDahI2jr5pjZoYISuMUamqktjqYstqWAc44f XEug== X-Gm-Message-State: AO0yUKW2rDNNLdR+/79NzP3AFF/8tJiP86Qxewmxava6S4tk16YJ3AzK 9e1s2nTSJsc0gXmsMfjdw19VCDcO X-Google-Smtp-Source: AK7set8lKk9mtPrTPkXdNE+4Xs/F0sUnE0Dsxybm6pt1ik2qowrwNpz6ycAbgNDk33JBVkhIsJfQPA== X-Received: by 2002:a17:903:281:b0:19a:fdca:e3f1 with SMTP id j1-20020a170903028100b0019afdcae3f1mr840336plr.3.1677855193957; Fri, 03 Mar 2023 06:53:13 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:7043:b0:199:182b:34bf with SMTP id h3-20020a170902704300b00199182b34bfls3208738plt.3.-pod-prod-gmail; Fri, 03 Mar 2023 06:53:13 -0800 (PST) X-Received: by 2002:a17:90b:4c88:b0:237:7acf:8649 with SMTP id my8-20020a17090b4c8800b002377acf8649mr2058433pjb.13.1677855192925; Fri, 03 Mar 2023 06:53:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677855192; cv=none; d=google.com; s=arc-20160816; b=m8HaymmNsPdXW9icm3CwHiVsYttWV3etSO0/TnNEZ04eKk16S/BxEPYC4rWW6ffcLw e2BYcaarr6Iy2QLYX92qE7IOV8FN0syjHlXABLpOZGpZc4gL+ZKDSIGHjL4cTeTdbPr0 FzXP/iTyogRKOotbxQJu5BsbCu03OXyrfRR9+pxpWOytZ+V+oTMmslsRbZHqjWC1Rjzx xQmhg4jlIzy5vJhzuoz06DhsreqJKAczumKBhdQt7uJq8sRG59F5V8q+pNnBukDv9YNi 2CaGdtmZEeahnVFqsdcE8oywRjE2vKzEcHt0vSYrv9BTk/NY+zHbEQTNGpplOT+otmvi XkLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=jZ7rcemt848q2zQcT+lSKMTmWxXIUz+vskppcEdmPWE=; b=BZIzmkQ6xKY9ehlmgLpFGZKudIQGt8Dsv6ZT2EXQynfN3T4bsWqGSZWhsv1uYWp+6X /LgiQtUK6SExoYlFqGh9+V5o4SxMMX4107w2ke1/nccHdbnlrcozUa8LIXyZ1iLSImKA xub1WqgMpHhdP5YbHJkq7L3GsFpK9yD7uU9d+Yi4dGqe2vnlrgZBdK/Y2m86zH4s4gjK 0ObrPGkumCeijRxb9WZp8P1uCd8hHj+AE76S7j26hwuU4tE6v7XCA2bHpAL0tLZcWLE1 unEQAqiQ+HhUM9d9GKhTeVshHHEZJXiCtpqdhfD5LPNoq2ZnXPn2LH3RAN17kb9VyCOb 6Blw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MECwk9Yw; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id j1-20020a170903024100b001947221dc94sor1033554plh.153.2023.03.03.06.53.12 for (Google Transport Security); Fri, 03 Mar 2023 06:53:12 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:9386:b0:cc:d762:64a with SMTP id x6-20020a056a20938600b000ccd762064amr3085837pzh.8.1677855192602; Fri, 03 Mar 2023 06:53:12 -0800 (PST) Received: from localhost.localdomain ([183.83.137.89]) by smtp.gmail.com with ESMTPSA id z4-20020a63e544000000b00502fd70b0bdsm1660856pgj.52.2023.03.03.06.53.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 06:53:12 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Neil Armstrong , Marek Vasut , Maxime Ripard Cc: Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-amarula , Jagan Teki Subject: [PATCH v15 11/16] drm: exynos: dsi: Add host helper for te_irq_handler Date: Fri, 3 Mar 2023 20:21:33 +0530 Message-Id: <20230303145138.29233-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303145138.29233-1-jagan@amarulasolutions.com> References: <20230303145138.29233-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MECwk9Yw; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , IRQ handler for te-gpio seems to be common across DSIM host. However, Exynos is handling this via CRTC drivers but there is no clear evidence on how the same has been handled in i.MX8MM. Keeping the handler as-it-is can be a viable option but adding DSIM bridge core in upcoming patches is not possible to call Exynos CRTC handler as DSIM bridge has to be common across DRM bridge core instead of platform specific DRM drivers like Exynos here. So, this patch handles the handler via platform host helper, so-that handling platform specific hook across Exynos and generic can be reasonable till it makes it generic across all platforms. Reviewed-by: Marek Vasut Signed-off-by: Jagan Teki --- Changes for v15: - remove leading underscores in function names - collect RB from Marek Changes for v13: - none Changes for v12: - updated patch - suggested by Marek V Changes for v11: - none Changes for v10: - split from previous series patch "drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge" drivers/gpu/drm/exynos/exynos_drm_dsi.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index afe2d293c785..2fc166ebe3c7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -325,6 +325,7 @@ struct exynos_dsim_host_ops { void (*unregister_host)(struct exynos_dsi *dsim); int (*attach)(struct exynos_dsi *dsim, struct mipi_dsi_device *device); int (*detach)(struct exynos_dsi *dsim, struct mipi_dsi_device *device); + irqreturn_t (*te_irq_handler)(struct exynos_dsi *dsim); }; struct exynos_dsi_enc { @@ -1333,11 +1334,10 @@ static irqreturn_t exynos_dsi_irq(int irq, void *dev_id) static irqreturn_t exynos_dsi_te_irq_handler(int irq, void *dev_id) { struct exynos_dsi *dsi = (struct exynos_dsi *)dev_id; - struct exynos_dsi_enc *dsi_enc = dsi->priv; - struct drm_encoder *encoder = &dsi_enc->encoder; + const struct exynos_dsi_plat_data *pdata = dsi->plat_data; - if (dsi->state & DSIM_STATE_VIDOUT_AVAILABLE) - exynos_drm_crtc_te_handler(encoder->crtc); + if (pdata->host_ops && pdata->host_ops->te_irq_handler) + return pdata->host_ops->te_irq_handler(dsi); return IRQ_HANDLED; } @@ -1761,6 +1761,17 @@ static int exynos_dsi_parse_dt(struct exynos_dsi *dsi) return 0; } +static irqreturn_t exynos_dsim_te_irq_handler(struct exynos_dsi *dsim) +{ + struct exynos_dsi_enc *dsi_enc = dsim->priv; + struct drm_encoder *encoder = &dsi_enc->encoder; + + if (dsim->state & DSIM_STATE_VIDOUT_AVAILABLE) + exynos_drm_crtc_te_handler(encoder->crtc); + + return IRQ_HANDLED; +} + static int exynos_dsim_host_attach(struct exynos_dsi *dsim, struct mipi_dsi_device *device) { @@ -2075,6 +2086,7 @@ static const struct exynos_dsim_host_ops exynos_dsi_host_ops = { .unregister_host = exynos_dsi_unregister_host, .attach = exynos_dsim_host_attach, .detach = exynos_dsim_host_detach, + .te_irq_handler = exynos_dsim_te_irq_handler, }; static const struct exynos_dsi_plat_data exynos3250_dsi_pdata = { From patchwork Fri Mar 3 14:51:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2775 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id B74D044AA6 for ; Fri, 3 Mar 2023 15:53:21 +0100 (CET) Received: by mail-pl1-f200.google.com with SMTP id a9-20020a170902b58900b0019e2eafafddsf1503552pls.7 for ; Fri, 03 Mar 2023 06:53:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677855200; cv=pass; d=google.com; s=arc-20160816; b=B3gSAnksS/dUQD1rwvMxTGVWTumKrOAOvfiBR2H/fHfOi6qXi3cfeoRnXO2nSeO4fC nuDtFRfNgReEVEIO30JSBAstknWvmU1KBS/ezrR5DSrt5sdicPACJPcziSnyN1yH85U0 gbKkDxhboYTKuAw46bQ8y8HphcXLz/cxcreQqvgxijrKvc8BTnEJcmhB/+U9lMcqn9uY XWkrQy33oonh1QfdBC+FwuH7+UGh2GDXlcqJyHWac8y/yP66OzYrckhLz5ZQ3ploh9jS g4ipW0dLllajHpUQPHrXZbmvBmit9BZfIMrN6N8w9RDmNVZDjRQyM6zES2bNbL9rYkUg qjmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=2DqQj9LJQ8AwpGI0nhB8Ui2YtkNvkM/R4omuQSaK4nc=; b=YUZHhXbyYOQZdymw86NcoijuZEz/fHw69UcAVuvA2hQanM5Z6gnyoTUNUqOe1jDVCb OVzrKlCNPkk5o4vu//qUHLK6KIsVcOkVSZKyDrDtAihXoCQAcqgZOPuruMVIx2A1dMrG 5o8kww7JJT3WrrQOHOL9IsvLg4B8U2z+fXEKpgwfyT49nAGRdjOB9G4QIpFmVT3w8B+B iNEOj+8IFOf82b/r+W9uXK1dRhKTOlJC8Z3PFFeIVZAZPlN16PiRdDdfbOX+X6RN+Us3 shgCV52TugixpyRgPFrDcumMRCZaNrbuSIESzivewH5QJyAhWdmOCx53s/GSSHolfuzL 4f3A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rgWm2wDS; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1677855200; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=2DqQj9LJQ8AwpGI0nhB8Ui2YtkNvkM/R4omuQSaK4nc=; b=m/ehkf3yAFIT0L6osZOLcClLm14zV27FE/PesOVw4swWQprtCYftABQRYVduhXBuq2 2R4s0JVs9Z3vai6Sb6XYHs5AnnXWp2K0YVgM4OwDDbVkalDcf9z12Cl8noON28XtpJpo 48aCeHcnL/8S67hZx/CP3pUR8bgN3X+35IjM8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677855200; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender: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=2DqQj9LJQ8AwpGI0nhB8Ui2YtkNvkM/R4omuQSaK4nc=; b=Kso8ZecmgP/IjWTHENRUP7nveS/lBSPevpyHpadpvWUWtNJ01Nb/nTdaIUrPg9UXJR ZRaGRrbzQ+R+5NjbNlcqGoWkWPrZvtNpHiGNYo1Tf5sX7i67FxvlWtWC4yRJkDQScEa4 1Kko4GuYbxHCW5x9jH/yowGvP5UqjtQE1OF5MC5ggfw9HetcBKP7u8pjhjVdTSPTYO74 +HfBMczub6cYlu1GdlOT6/VNuYZXzxiF19X2YXoDqd4MpDGbBNK/twvEJLeFNofrJnLz BcKh/eVBfbz9D+02Jadcslh8PcGf7uMgnGJ+idVeLn7m5oUKxRIoVAeRZP/aZ7x27vJ8 xsJQ== X-Gm-Message-State: AO0yUKW5Xep/+05NxXogOntMorcFfhWJyaCHgJm0k6tSm5WbdyK3Ta2V z049D55M2fO8xuDIe03H0RRDAcuN X-Google-Smtp-Source: AK7set8KVgumZ9ne5a1+Ib1Tf4AzgtzOBFrmR9MCr1NH9vqbnpzFWbCNJtJuxvHEa3rC/+rPRvg/gg== X-Received: by 2002:a62:828e:0:b0:593:da6f:fb1c with SMTP id w136-20020a62828e000000b00593da6ffb1cmr1015626pfd.4.1677855200422; Fri, 03 Mar 2023 06:53:20 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:f092:b0:230:cffb:708e with SMTP id cn18-20020a17090af09200b00230cffb708els2777047pjb.0.-pod-preprod-gmail; Fri, 03 Mar 2023 06:53:19 -0800 (PST) X-Received: by 2002:a17:90b:3a92:b0:237:6d4b:7cb7 with SMTP id om18-20020a17090b3a9200b002376d4b7cb7mr1857377pjb.41.1677855199108; Fri, 03 Mar 2023 06:53:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677855199; cv=none; d=google.com; s=arc-20160816; b=zcMCmFulA7QH04ZoB3tlalbmuKbREcbTZSGT3VWRyDORMLjlvbLNG/JxEU9MnTkR7G VAC/4zK4I9NPMnyvjvBNpFdAl2nacJDKQ+AuANzQ6ueynAhqJrpkQAviG7bXQtwfCCUn IA40I/OvBwDoOg4LecUXZhs22tvABRtT+uD40qjPUgdRIm+IfvPvwDL1DIY1/EdIrkT5 p6zMeJFQcxD2Cq9UIfstonfc9ubt+rG8odhy6qPR/FiL4CkxEPjBLbBuq7LKN5C/jlv8 uXv2IoBPqVrxzIxC40XKMUF6hRVvtuK/4vFbD/7SrgIs0QY4HjREW2+FY25kCQ6lRXD1 PkSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=AUDhv2F2gloyZVsSFnMj8a6i3CQwzzAovnYe5a/5BOo=; b=uxKfqBPkZ+AT9xuZg99aooQ5L27aY4oRH82ZSVrA7EXQ4oULoQHu6j0MJj1UY2J4s1 YTqjY9V8gQzt4Zv/t3+955j337gffrEK3lMQjmh/SsGifhUFSrYJzPNIgsDKyJwb7OCJ zKhLLj6lR9lptLrMlkOQz/Cw5gpCc+C7wlSNtaObs+oOqCWkczj6ElmrOgVJyZ8pKzWu Mfo2pbmO4lEbsDFdp1H4qJ/h2dqcHv+iIITZ+hMf5y4q363UhqyXSti4KortAoTfNcR6 vyEX/aIRlkc06G/DQsnwpmEfOjZHrUHLtqHBL8Ns2ZFMIMbbOgbPwgnrd3QYQcWjgu4o rO5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rgWm2wDS; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id y15-20020a17090a600f00b0023500af35c6sor1058428pji.17.2023.03.03.06.53.19 for (Google Transport Security); Fri, 03 Mar 2023 06:53:19 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:90b:4d11:b0:23a:4875:6e07 with SMTP id mw17-20020a17090b4d1100b0023a48756e07mr1801373pjb.40.1677855198199; Fri, 03 Mar 2023 06:53:18 -0800 (PST) Received: from localhost.localdomain ([183.83.137.89]) by smtp.gmail.com with ESMTPSA id z4-20020a63e544000000b00502fd70b0bdsm1660856pgj.52.2023.03.03.06.53.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 06:53:17 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Neil Armstrong , Marek Vasut , Maxime Ripard Cc: Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-amarula , Jagan Teki Subject: [PATCH v15 12/16] drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge Date: Fri, 3 Mar 2023 20:21:34 +0530 Message-Id: <20230303145138.29233-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303145138.29233-1-jagan@amarulasolutions.com> References: <20230303145138.29233-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rgWm2wDS; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Samsung MIPI DSIM controller is common DSI IP that can be used in various SoCs like Exynos, i.MX8M Mini/Nano. In order to access this DSI controller between various platform SoCs, the ideal way to incorporate this in the drm stack is via the drm bridge driver. We already have a consolidated code for supporting component and bridge based DRM drivers, so keep the exynos component based code in existing exynos_drm_dsi.c and move generic bridge code as part of samsung-dsim.c Reviewed-by: Marek Vasut Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- Changes for v15: - drop redundent dsim->bridge.funcs->atomic_disable(&dsim->bridge, NULL); Changes for v13: - none Changes for v11: - sort MAINTAINERS list - collect RB from Marek Changes for v11: - fix BIT macro replacements - fix checkpatch --strict warnings Changes for v10: - don't add new code - move the files and update samsung_dsim names - update commit message Changes for v9: - drop the bridge attach fix for Exynos Changes for v8: - update the commit message head Changes for v7: - fix the drm bridge attach chain for exynos drm dsi driver - fix the hw_type checking logic Changes for v6: - handle previous bridge pointer for exynos dsi Changes for v5: - [mszyprow] reworked driver initialization using the same approach as in drivers/gpu/drm/{exynos/exynos_dp.c, bridge/analogix/analogix_dp_core.c}, removed weak functions, moved exynos_dsi_driver back to exynos_drm_dsi.c and restored integration with exynos_drm custom initialization. - updated the commit message [Jagan] Changes for v4: - include Inki Dae in MAINTAINERS - remove dsi_driver probe in exynos_drm_drv to support multi-arch build Changes for v3: - restore gpio related fixes - restore proper bridge chain - rework initialization issue - fix header includes in proper way Changes for v2: - fixed exynos dsi driver conversion (Marek Szyprowski) - updated commit message - updated MAINTAINERS file Changes for v1: - don't maintain component_ops in bridge driver - don't maintain platform glue code in bridge driver - add platform-specific glue code and make a common bridge MAINTAINERS | 9 + drivers/gpu/drm/bridge/Kconfig | 12 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/samsung-dsim.c | 1898 +++++++++++++++++++++ drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2051 +---------------------- include/drm/bridge/samsung-dsim.h | 114 ++ 7 files changed, 2079 insertions(+), 2007 deletions(-) create mode 100644 drivers/gpu/drm/bridge/samsung-dsim.c create mode 100644 include/drm/bridge/samsung-dsim.h diff --git a/MAINTAINERS b/MAINTAINERS index 97d814a19475..f604c36b31bf 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6737,6 +6737,15 @@ T: git git://anongit.freedesktop.org/drm/drm-misc F: Documentation/devicetree/bindings/display/panel/samsung,lms397kf04.yaml F: drivers/gpu/drm/panel/panel-samsung-db7430.c +DRM DRIVER FOR SAMSUNG MIPI DSIM BRIDGE +M: Inki Dae +M: Jagan Teki +M: Marek Szyprowski +S: Maintained +T: git git://anongit.freedesktop.org/drm/drm-misc +F: drivers/gpu/drm/bridge/samsung-dsim.c +F: include/drm/bridge/samsung-dsim.h + DRM DRIVER FOR SAMSUNG S6D27A1 PANELS M: Markuss Broks S: Maintained diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index 8b2226f72b24..e9d00bcf2d5c 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -220,6 +220,18 @@ config DRM_PARADE_PS8640 The PS8640 is a high-performance and low-power MIPI DSI to eDP converter +config DRM_SAMSUNG_DSIM + tristate "Samsung MIPI DSIM bridge driver" + depends on COMMON_CLK + depends on OF && HAS_IOMEM + select DRM_KMS_HELPER + select DRM_MIPI_DSI + select DRM_PANEL_BRIDGE + help + The Samsung MIPI DSIM bridge controller driver. + This MIPI DSIM bridge can be found it on Exynos SoCs and + NXP's i.MX8M Mini/Nano. + config DRM_SIL_SII8620 tristate "Silicon Image SII8620 HDMI/MHL bridge" depends on OF diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index 52f6e8b4a821..2b892b7ed59e 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -14,6 +14,7 @@ obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o obj-$(CONFIG_DRM_PARADE_PS8640) += parade-ps8640.o +obj-$(CONFIG_DRM_SAMSUNG_DSIM) += samsung-dsim.o obj-$(CONFIG_DRM_SIL_SII8620) += sil-sii8620.o obj-$(CONFIG_DRM_SII902X) += sii902x.o obj-$(CONFIG_DRM_SII9234) += sii9234.o diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c new file mode 100644 index 000000000000..42e3536cb2fc --- /dev/null +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -0,0 +1,1898 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Samsung MIPI DSIM bridge driver. + * + * Copyright (C) 2021 Amarula Solutions(India) + * Copyright (c) 2014 Samsung Electronics Co., Ltd + * Author: Jagan Teki + * + * Based on exynos_drm_dsi from + * Tomasz Figa + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include