From patchwork Wed Mar 8 16:39:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2781 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 12D8F414B5 for ; Wed, 8 Mar 2023 17:40:30 +0100 (CET) Received: by mail-pl1-f197.google.com with SMTP id l10-20020a17090270ca00b0019caa6e6bd1sf9586550plt.2 for ; Wed, 08 Mar 2023 08:40:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678293629; cv=pass; d=google.com; s=arc-20160816; b=L8DjfHQwBjrni4TkF3rOqRZZOX8Vo0hFIWf0l15XSeiHjSZP+JmvG56yiVKItr7rse QNNQxmMNhgckRNh+noHQbOsAbFYAe9jznYF+BGITrmEaUXKPTZVwsW3xLGRY6G5vqaMY JTOzBiOBQ5d1vV/sPCvQFU4Kra5Z7WqE1SvJTBvsTDRYbr20OtVtd9czj+eIk9KAH8AK ro2WIyckM4GYkcJ1f5Xb2OFnWQxt3NNDP5S478kJCDzvE/g848CmIhgSGkcuDytnrlq0 1Ap3C2rULhhhP1lLuOg7d5RNWojnEpcTK3Zuj/7HV9xqKiitsOL2l1AqG63cTlN6HUbw WdHw== 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=YHsI6lM+3bRddb4xGz8QpdCTJMA7SmfUQzWypZKnKHA=; b=Hql4lKiAUqPEOgqQF4XMt/T5vSWqjSdk9dNc1rLgV/8qDQa0VzPfCb4J8gkIemv3Vl Xl+o9QkuWmOxsOer4qL8rdRnyQ+IDoT9xErzanCwZOYF/s8KdmthukYtWgx6OpjIjUu9 m4UUAaHfxa6k1xftflb2SIehjSjM6RxI1uyduiJ1PkKYvjZFvENm1PQK2zyDSHtcpQcf T4LrsbVzJc17EB/4tuSEG/Xso5D1EtyrgBa15ejw1MkgGbA7bnzT0w+2R4SBW422FCdu UC8wHqFLk8W+GiBZtvzbyVXcS+Y4i1A7FuTV83ls9op4c4W/26V/4Ff1lsb3yqp2rxkO oj3A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="K//Wls+M"; 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=1678293629; 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=YHsI6lM+3bRddb4xGz8QpdCTJMA7SmfUQzWypZKnKHA=; b=Q8nRzf2rp3WcxSeGtBArg22CEA35CFipmRgfQXVXDRJpSm6Slk4oNSeP5AW4Bv2R1x CZGsZvZ5EPbHrnBfQJ+8rwOIdLTr1tbtd/6nM/1LP+XWiHTFULEKbS6Z61iCcAIpl54R DBkp9qMPfakKQy0MhWLzifxnwkQ7XNTtmneIM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678293629; 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=YHsI6lM+3bRddb4xGz8QpdCTJMA7SmfUQzWypZKnKHA=; b=NhLTHUprFo0Z7tCYKKnZ0yfG5pyW2/L0pFnhtyAxlYRabW2POqDdcBeg7QZvA8Hqzg g7N5HiuCRGHFq3qDRh1+UU3YK1ppPerY4MiMZGuyXJD3KEkDqYPugLi1TxeK/KZo/NJL ZbLt6f3hCUX91pHnP7ja4bWxtwYwyYHUoVsTiZJxJBV11mn8TUVI4GMsfD+IlBJsVs9D E4Vtk49tHOVkxVYJ+lIlUdqgJk2QFcoT2qTzyNaDCmejh8BdHKZ9Kqqihx/yFPdnZ4Sa syqI6yVHGb5P0zx11JsSwle9Xn1yWQCzdTWKKk4MlH1YwN2AE1k+3qnBGnt6pUS8n+kw mm4w== X-Gm-Message-State: AO0yUKX2gvuFpJkU1hBI+3xd9Vd7rTgs/CevTLQnOjFmZAJBNr0XQ74w 4ePSGUxy82xw3dxb1vE+WIyv0FGt X-Google-Smtp-Source: AK7set+J13MO5Yy0xXSJ835QfCU2ERQWf0n7ggh1HdXcFC/S11J96TIAEX4pI7PoouMUdYN5bD+TaA== X-Received: by 2002:a63:780e:0:b0:507:46cb:f457 with SMTP id t14-20020a63780e000000b0050746cbf457mr3853651pgc.11.1678293628581; Wed, 08 Mar 2023 08:40:28 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:c3c5:b0:19e:398b:8d99 with SMTP id j5-20020a170902c3c500b0019e398b8d99ls16370230plj.4.-pod-prod-gmail; Wed, 08 Mar 2023 08:40:26 -0800 (PST) X-Received: by 2002:a17:902:ed49:b0:19c:ac9d:f682 with SMTP id y9-20020a170902ed4900b0019cac9df682mr17403298plb.25.1678293626494; Wed, 08 Mar 2023 08:40:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678293626; cv=none; d=google.com; s=arc-20160816; b=qagXw/RRQT8FN2GNtktyaMFs9vEymUM8AgvaKbGcWHj78mYeyKY8uTKGdQo196WnNQ Ts3EL7QG6K694dRvfWiLZQ+VQ5vEdAu8pKNMYp55LU6ZeJkquC5HLJS2mSXW0C8FUhH2 kwcWG3vzeVJAlJN5in6puwLKQFqzLKbFr8uw0By6kUv+wf8uSHjmFxWoiuORzfYYgW52 2UlvLv5B6XHpf6GlmrtVnlCUlpHUizqm/A+eFN1Sasl1Y4GjR30RsiGtRk9nKMB3ujqO cbSvJzcZKKCiGyplTxKd/AJ1nJK/O6rKo/KsLbAavTV4vl067GCoxJf4IxpoFVCakAkV iBNA== 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=90yBjB56MdOW/HpXbxKsjmjXCQmWwrP8jEp2gzu937o=; b=Pd8/5do+Zy4W3qgSJgaJLAvHW7axTA9YYx8Kd8JiTWyTY2m4Ch7WZi2GLUUtoQ8cNL gx4IHMU2t2kzp6B75kw5MjWqRN2GApynOAuI3+Awlzc67fM6rgzBwV9ghp95wmmJ+TQ7 18lONZlPQzqQhAV5AOVVQcc9luadyBZx5osPXwU/MliyWkJaWkDcgiNLgQdaKCkBI2h2 CQj0kWEh5ml5ehlN3XA47EcXZL0KajSkdrPe+vsu9huLLsyYeJ1TZyeWAOD9I1GyVzk9 Mwl/uFWSWDQTsxOGNyzltHn2MBqhjRNqCLZc276HmWJvxIx2wd2kGJuC02fuh/cqhx1E S3ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="K//Wls+M"; 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 a4-20020a170902710400b0019ad489ef7dsor7193195pll.84.2023.03.08.08.40.26 for (Google Transport Security); Wed, 08 Mar 2023 08:40:26 -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:902:e741:b0:19e:7bd2:a224 with SMTP id p1-20020a170902e74100b0019e7bd2a224mr23700768plf.62.1678293626167; Wed, 08 Mar 2023 08:40:26 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a8a1:b545:91cc:80b2:f9fe]) by smtp.gmail.com with ESMTPSA id kq3-20020a170903284300b0019b9a075f1fsm10046540plb.80.2023.03.08.08.40.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 08:40:25 -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 v16 01/16] drm: exynos: dsi: Drop explicit call to bridge detach Date: Wed, 8 Mar 2023 22:09:38 +0530 Message-Id: <20230308163953.28506-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308163953.28506-1-jagan@amarulasolutions.com> References: <20230308163953.28506-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="K//Wls+M"; 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. Tested-by: Marek Szyprowski Reviewed-by: Marek Vasut Signed-off-by: Jagan Teki --- Changes for v16: - collect TB from Marek S - collect RB from Marek V 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 Wed Mar 8 16:39:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2782 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 5B56F414B5 for ; Wed, 8 Mar 2023 17:40:34 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id s15-20020a170902ea0f00b0019d0c7a83dfsf9669592plg.14 for ; Wed, 08 Mar 2023 08:40:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678293633; cv=pass; d=google.com; s=arc-20160816; b=xPT2LHsv79U+eECXxl7Nea2twoKkBzqrjKfMu6Cm3RS58efg2gH7e67UzMncYmrNoC xi4nQNiQ0SC4uW7DdVOOrNEO/nfPHVjx4vfMRjtBdEAXIVRriF9VKxmzDVoYIItJMtB3 y3WzsWROfjo6/+VokccADsZX466vqqvCQlxOUuVAQg6wqLUPx/v/DSxJ45KRTKUpPOcT L7pIprHny3brAMH9WBsUWsS3suI8f8yy0I47+1/lSwvFps2AkFbev35ZE+FkYAfiSZ8t BSeuqi83p2yzlTrX42GwWkwI13cPfra/tGo18+94gGX8hzGJ3qZgh9+q/dougqqH3a/X z9qw== 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=oqO6kdLYLiKwIN2mhp2W73KhQkznPxv5i7sdeBaIgZY=; b=zHEi66kA8E2ui2ZR7kfz5LY7iTmsc45cmYKOZ8eV32yV0OT9+rW8FBGTeZkJ3L2HcX AfsSJi81WCt8T3cO9cXYMhITZm24hFKPGH9HnYNKnRt0bqi3JB1A62tiHxnfQMVagBQq /FGPeFIeknAa4lg5wzMg/hwjsUjDaEW6AtHQLU5a1UKeSTUBmfjXdrXKDfMkJkAVXNdM hiBb1slZqArensvPJTmyv6DsHzqaQfkFnoL475/bbxaSRUfwgwca3A+nh+xZwbZFWQa3 T7ERlYmP5EV9GH6sG8EFUKLk1bEwbBDf4YWRVvfp2NrpqcyF7SfXhBsExeSMQQkoMdON CxyA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PqE7wz15; 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=1678293633; 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=oqO6kdLYLiKwIN2mhp2W73KhQkznPxv5i7sdeBaIgZY=; b=dpwRqp0yDFHfPW/1/uZjh4jbACkZZXH8ygCjIvgcSK0ze118sGqxewJYMHVGfWcz2O FUd615b0PtCgIOFCb+8cIz4j4aVUc8g3gD2q/SVNI/rgL+mE40zpZFkqA+6IEeqmohPp i8Km+T6vo35NjwdHZRRBrrgROXdCX+vh6XiZs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678293633; 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=oqO6kdLYLiKwIN2mhp2W73KhQkznPxv5i7sdeBaIgZY=; b=mKn7u6atGX2CCMNAXMdUfxuIJ5VmD8jswdQeIx6kTnATGSBubAlvSek/qGH/xO4RxA tQydZjFNKYv/s+4mi4aZoGmJ0E8Z9bcwGS7OdPPcewGHhFsuOUL2eS/oAKyFSkA8M0MC UNcLINnp2KX9nJnmwiHxJcRgWj0TsgtfBRArhVM3nIUGPKq/RTNRPFGN6apokd5yh2tz UTojtguMJwc8T/xmqCHet8RAEMOGHp0HE3eNkEOEeqG3V8nfT5TrieDfzXIDMmdwsI31 2VdfbhkvVjg0fls/ZtNsBWf3deX4CLTjPUCF9Bgesan89V0f91BE2eZlcy6VGHqWmr+i bsWg== X-Gm-Message-State: AO0yUKXnEVx0APPb+RmzDOangOpm71VY1lrv5sXvjZBZVTFf82vtajjK 0RWhnsNbV4yODaMlZ2JzdDj+c1Gf X-Google-Smtp-Source: AK7set+byKquiVtCafZPBVAwycVxhpL08VRH5eVI/EsNrsmpR7JukAPcp7XyJUG9JBFqyHgsGh0wRw== X-Received: by 2002:a17:902:9a03:b0:19a:afc4:2300 with SMTP id v3-20020a1709029a0300b0019aafc42300mr7534336plp.6.1678293633063; Wed, 08 Mar 2023 08:40:33 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:903:2441:b0:194:d87a:ffa6 with SMTP id l1-20020a170903244100b00194d87affa6ls16406089pls.1.-pod-prod-gmail; Wed, 08 Mar 2023 08:40:32 -0800 (PST) X-Received: by 2002:a17:902:f54c:b0:19c:a9b8:4349 with SMTP id h12-20020a170902f54c00b0019ca9b84349mr23186187plf.32.1678293632094; Wed, 08 Mar 2023 08:40:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678293632; cv=none; d=google.com; s=arc-20160816; b=t/ncbZAYMFzu4wy+fwoI6Tg/OEO7E/G0NVA3ugGx0ygvq8pnjXgNzESV2nWJgIzawp oA9hDhkOqKB4FIYAB5Vvivcx7YPMzeNoG0iBfM7ffXaBI8HpS5NjWj4EWIlOu8CIYdns D4/IpkkAaViIW3fOwfbY1jhLwaHPDjop0nxeJAQ+DXGxyniIjDEJAjb8kWbLgV8QGVnQ rUSc1GFTTHI8EwVfTVn5QEnt9yHGcDuNaGG7NmrCMm+/pg7SnDeCfvlBZII18+ocDjf6 BnyCWyvwSYq2feSmflojk6UqEo9920gu3E/l4uS176bYqI7Z4PVHBkmU6LEapy1uMJ/N 9VTg== 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=+udTIu1ct3G8jeCaDXjf5KrilADcli7EoE7on9WYgu0=; b=m2faup0UK7KdsRqYnbLrvP1s5k5AuC7qOEE/MSF2rDUSv5DwOn4WLlvve+51Q/27m0 k+ESU3AHYgZnzj8Pc+DZa9sksosHjsu4DH5WOlpdECJztFHgisJa+CDOtQ1MqKd/L49G gYXXxxeBAscv/ejLMBTmU8je2G1PQkREl0xQxKUSyPMPXlHQGTy4ul0XAoiIvpVIZWad E5bNOJlWR3lJnTvySYGEl3rPzR+IK+42zNHP7jmhcNkOW4VxXDAE1Rw5I2T7+0l7PLFB knBHv5rFrffZ/FsgNUHGJ5Ym9l5dI3nC+n3QUMAL77eTQp5offgt9gekdXg5swV8oXme aBXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PqE7wz15; 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 t4-20020a1709028c8400b0019a94423454sor5649873plo.101.2023.03.08.08.40.32 for (Google Transport Security); Wed, 08 Mar 2023 08:40:32 -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:902:ea11:b0:19c:e05a:ea6 with SMTP id s17-20020a170902ea1100b0019ce05a0ea6mr22145963plg.56.1678293631715; Wed, 08 Mar 2023 08:40:31 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a8a1:b545:91cc:80b2:f9fe]) by smtp.gmail.com with ESMTPSA id kq3-20020a170903284300b0019b9a075f1fsm10046540plb.80.2023.03.08.08.40.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 08:40:31 -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 v16 02/16] drm: exynos: dsi: Lookup OF-graph or Child node devices Date: Wed, 8 Mar 2023 22:09:39 +0530 Message-Id: <20230308163953.28506-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308163953.28506-1-jagan@amarulasolutions.com> References: <20230308163953.28506-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=PqE7wz15; 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. Tested-by: Marek Szyprowski Reviewed-by: Marek Vasut Signed-off-by: Jagan Teki --- Changes for v16: - collect TB from Marek S - collect RB from Marek V - fix multiline comment 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..bb0d2502ea02 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 Wed Mar 8 16:39:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2783 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 21041414B5 for ; Wed, 8 Mar 2023 17:40:40 +0100 (CET) Received: by mail-pg1-f197.google.com with SMTP id d34-20020a630e22000000b005039e28b68csf4061103pgl.13 for ; Wed, 08 Mar 2023 08:40:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678293639; cv=pass; d=google.com; s=arc-20160816; b=lK7jcC0R5SOZ4lg42wnBKZkDfQplynboTWxAZ3RRTVWTfrjA6SKbQUgYxIsFtizwnQ jXfDL442uhEzWmBfQK1m6tQ2kzi+h08MktZAhsOjgTzJBQ1R3C1Ro3GtKR3NM9KL65eY Bo0KO5zj9/taxRftseO+mjkmsgw5mBFMpNmic8j08bkmW5nrGAg1AqXstBc6R3HHQaQC dNb2eic/Xf6xGK09Pw6CDL0EabAui0UDYLmLGRp3enMiIi/GxmdrIEeUrHqG8Q84HiBw OegIWwokvpCLYbyjA4IYIBHh7cQxo2E+ZoeIklD05A0lORCimDoAW6saVuPPThRWfQG2 qq7A== 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=BJVkRwLcXpnJxjgrufq0p3p/LpUw4XOzSvn6komzOng=; b=L0bj5Bvti5IZRZjA1hktOOJUSBxzeAKx9Wn1p0z5RwORubXESKiqFmIo/6Ut/PEaCv 4mOye0UeG+O/GhGSYKlwOAcI5FZbqUhNJxMVUyrXQX+vett23JqvQ+03d9v3OpUvZ2k+ Y3Fvft7QBu4Jcl6bIIHkXBwCL/976dV8pj1wO8rzDql5wr+0+j32E+/xaYLOusAZl1Ir UglFClGKYr6mzpEju7u4Q7PWcvvXEM+/YZxG6PB9vglWS1BS7kC9J++JU/0Mt+Mwao1E XC+4KaFJzG/sPVJqg6u12p5ZKPusp//uOipSGIlYsfmpYGR/QKxpahe14cYOJHTErCRf OzBw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lAOGtJmg; 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=1678293639; 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=BJVkRwLcXpnJxjgrufq0p3p/LpUw4XOzSvn6komzOng=; b=CEip1nr/pyfEmSU45PwhwRBJyMNkbQd70QaNWQ/RE1cFy+U1XmF/SqJnHeLkfxFfyn ihnsv9Vtiw8GbiMKkv/mir1xpivRlo0h44/de9UXT9eKt1Jv8rHxVEtYKV6qxvAnYs7V 0DYxAPL71+IMst484iOZiDZZJ589BfGS87ZXg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678293639; 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=BJVkRwLcXpnJxjgrufq0p3p/LpUw4XOzSvn6komzOng=; b=cIVv3yhtfVp4/yojyYMFWxZp/on7+8xOzAT8HLLSktKlA6E5KNWl40VNR7MznGlNXN 9+qeLMTJ/Ak3/UTFvam5Zm7rJmRF/0Io1gSUvrWGvo4JdIQFQEybVotirVOf9FhSKQ9a CyxasLjlPK/t7/JQ1TD4fur3IUnbX4ZEzTyTGVAhjdO+dKaurUk8ICAv01ue6bWhgmep dCN8pDZLqypZrRtd623EzPHIYgY55aY1NGkZcTSIFM5eEFzlmJI2SGGjK/K89pQ0koh6 qyuG0RABGjQp4Mw47H5O5VMd1jpoJWkkp4HL9dEOYLUtur+ecVsserRDB7kTuPHliVja EVTQ== X-Gm-Message-State: AO0yUKXB/kAuY7PiD1P3vAKXpIiZ7Ad4ohD6LkZDbBVhZvwv9cTMWhSh ddfyBwa7ZOgpRmdehVbS2Xi0jSV8 X-Google-Smtp-Source: AK7set9azmWpyd4kfSGdDjW6VDT9RhsY+usOhD9bUnBKboZ+MlGstMaCxCH20aZNnmRgIjI5ViIb4g== X-Received: by 2002:a17:90a:7064:b0:230:3b84:9169 with SMTP id f91-20020a17090a706400b002303b849169mr6992526pjk.2.1678293638786; Wed, 08 Mar 2023 08:40:38 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:bf06:b0:196:751e:4f6e with SMTP id bi6-20020a170902bf0600b00196751e4f6els16334850plb.10.-pod-prod-gmail; Wed, 08 Mar 2023 08:40:38 -0800 (PST) X-Received: by 2002:a17:902:d50f:b0:19c:d6fe:39c7 with SMTP id b15-20020a170902d50f00b0019cd6fe39c7mr22614225plg.41.1678293637625; Wed, 08 Mar 2023 08:40:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678293637; cv=none; d=google.com; s=arc-20160816; b=XnBHtJoa0PIprasB0Ym8bpgM9MhmjYDTikj7PiXDctMe5dDQmmimsMjlwUkbUkdvNZ Xd9VilJer7O1o1TmadFtsY3sDm8/YvYMLWHS0PDKfkxcQpwcrQAUAyPwZvwXFjQkcYuw pXXbh+NjWm7u2KFdlohtEAJux/9J6BhasXLOp5GxEhuqKzGfz8KZBNtctEC35KHj2LNt 4sI7N3x01B6AUUR632jgl3c9ChvZsWYWrYH+ue7Zf/OQwJw3L2nOtbULSfjXwFmZ1XSR uTzzeHxbqYCLSs6k6QCjhjdwaoUcR7c6KOQYBFB7HE5IYdbc0gsjAhAHr7BpHXsqOlnT yLdw== 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=jgeRTDzvWlcFd73t/ENW9C7L9wpwOwUrVmn255HzLjQ=; b=bsLKPzx9gQTSDh2N4D4x9Gv/El1QU5Qt6eP/nueIyTNBabDlU+XIMxO6+HFbih5h8l YuSIXlAiiPtibxBW1mnT/h4YNGGxFaGwlzkNdoGOMdSjHtZtZNtw0vbqEp1meE/xJsMJ gAy89ANEmWoavOpeiUWRpTUfC8OfB4jcicpPVDm1qABxYzq6SBuES8+B5oySrompDmXT Uz64ocq45gUp+NYGMfrhxQVJjfVd/o7dmFhXKE4uCfIqBgsnZrQSDzkFCOA1J9UTzGqo ZqkXH4F56zz3t9xcL7p1nzwCDCQonJTukGOVcT7HgIh45GuDTPOfyeFsws4JLnVWg5pT FLeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lAOGtJmg; 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 u8-20020a170902714800b00192fc271788sor7393503plm.69.2023.03.08.08.40.37 for (Google Transport Security); Wed, 08 Mar 2023 08:40:37 -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:903:2446:b0:19e:2c25:d65e with SMTP id l6-20020a170903244600b0019e2c25d65emr23524048pls.42.1678293637260; Wed, 08 Mar 2023 08:40:37 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a8a1:b545:91cc:80b2:f9fe]) by smtp.gmail.com with ESMTPSA id kq3-20020a170903284300b0019b9a075f1fsm10046540plb.80.2023.03.08.08.40.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 08:40:36 -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 v16 03/16] drm: exynos: dsi: Mark PHY as optional Date: Wed, 8 Mar 2023 22:09:40 +0530 Message-Id: <20230308163953.28506-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308163953.28506-1-jagan@amarulasolutions.com> References: <20230308163953.28506-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=lAOGtJmg; 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. Tested-by: Marek Szyprowski Reviewed-by: Frieder Schrempf Reviewed-by: Marek Vasut Signed-off-by: Jagan Teki --- Changes for v16: - collect TB from Marek S 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 bb0d2502ea02..1615640e25d6 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 Wed Mar 8 16:39:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2784 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 335FC414B5 for ; Wed, 8 Mar 2023 17:40:45 +0100 (CET) Received: by mail-pj1-f71.google.com with SMTP id h19-20020a17090aa89300b0023a9e52c40dsf4613966pjq.0 for ; Wed, 08 Mar 2023 08:40:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678293644; cv=pass; d=google.com; s=arc-20160816; b=Fgp1PIHhjNpRLCYh5NkwuR4vF9uCRU1qOE+Sig6W2rxI/uId3Xwpm0ZdcqdwbIIgbk Xmu6N6JvMhb0RKTEWtbw1vO8V/9z6JWghktMZA2ixVGBtsHnuFqmescSeK9DhiJHWuIl KjqlTrCZoaWBFS3MncVGGlKY3AgfnxoLCf8y0VcsbopNBsYihvI48XssFoxP0Bw5B35U EVMTy58ZpYiqvxvgEN0vW4dv7cKrK9nmO2VHndhBkHRBT9HwQVC4KZB4NXqGgvOGp1i1 oyREdOBcwnqjjId01G1coQKTItsjKtCTrmx2ps3pEYEmbB+w3pzw7Mxfm7WW+360DjQK VCBw== 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=qlPVFHfdYruQqriYps7QnWzI8Q6XLTKR0xj6d2XABPw=; b=cMLQ8d/hbMp/9nwS090zaNvFOYRk01Tb8aN69020zc9b91C5XIrV8WZOqahnfjGpgn JvXfW+Ggqe/bvxycL0S+nA+wrgJ8awe0Jd6S2VaxN51hw1uA6deyMNEOMiFgAcW2XFbz KWLJt+/zThf1tykjrCWocjcBa2/Gx7QYgpimo66qVRcjIOiX5mIoZK+B4PlSTQpFxOvi 32z/q6UElo8J/i0xRjSkCnte6PUJK2Un3BKMd1RQ4Iob1hUp/kME5sxleNq0CcQeg66k PjcacPeCholWNVEgc9FXB1z/3xS1mH5lr35JODmfsHcwekSYS+gy+oMm6sr/dsMieaTZ eHLQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SV94dmfQ; 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=1678293644; 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=qlPVFHfdYruQqriYps7QnWzI8Q6XLTKR0xj6d2XABPw=; b=XXWZtPQICxblSmwUB9JTqsGH9RfV1TvEBK/VIZRva3PwguDYukmQTU8cpbjFDnEEoz QR5rK7mW4MnpgRx5fgA9+DPVY/bOeVJ2KYTYEIgkmyy9vENinBTpfU6JQ9qUeBZtcfpz zplUOU9ivU2mcif4xO0TdwbyDOZ4j2AbUSjWM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678293644; 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=qlPVFHfdYruQqriYps7QnWzI8Q6XLTKR0xj6d2XABPw=; b=30kQ6N9JBGKqbXDYFXPQrXzeKXZt2HrFeiH/P10NOGyMxu8oKH4XL2QWpsHxQ537H2 iPU+5cVboU56qszARaS8ps40MN9k+/3lrvICCVdMHcJsutNE0SQwjN5UUavBm+Icw48g OGOHB+dwWxmm6ZEVOAg1dhcDH15uVAS1srFko+qYAhEC7sVRz0NlyItr69OS6wOIjUqt eOPPNzY6xgNECVPs1qCgTHKO0SbSG51XAwcwLj1jG+6aCvaxhN3iWZ3PjC+g+MjcZYYc Gn7oPRH5xioLX+GZC84g7uzmeIZa8XiXMIWM7NUzwbK10G+zH92iIUjciPUkIhj9OphH fjgQ== X-Gm-Message-State: AO0yUKU6jDu6wdoew7iwYPsuAw2/mgdFXGEBWE2Y6LriO+YDsBv8geLo bGRg9Eu4V4qyGKQ7Jg/VU6DJz9Ee X-Google-Smtp-Source: AK7set8/KJMm2CrDiT0ne0f6CzH6iEQij82V9BIxryHIi0jBAeSXNRvacxTx+SB0n5T5rCiDF85FZg== X-Received: by 2002:a17:90a:f404:b0:234:b29d:3319 with SMTP id ch4-20020a17090af40400b00234b29d3319mr6929079pjb.8.1678293643803; Wed, 08 Mar 2023 08:40:43 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:be18:b0:199:50f5:6729 with SMTP id r24-20020a170902be1800b0019950f56729ls16323111pls.11.-pod-prod-gmail; Wed, 08 Mar 2023 08:40:43 -0800 (PST) X-Received: by 2002:a17:903:41c3:b0:19c:e449:bbaa with SMTP id u3-20020a17090341c300b0019ce449bbaamr22572549ple.28.1678293642808; Wed, 08 Mar 2023 08:40:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678293642; cv=none; d=google.com; s=arc-20160816; b=qmFMAtSCzijbWz1KcraF8zstKKYTEZFlYJXJEwjwURVyK6kCQ6IgtZK7sfmtPSmNZN aId44D17x/1y7LnamC3HIfv6XYXD96tdQjR7gENdh43JLbH7f/uxxpTQboeUTEFY4Emd sv0Ddn7Pvb2X6MJpWhWJmxgwQwvzpOmKUfxL+rFghnyvODAFI1QIwVo2VEQze2foxTHd QnkxgvYzrJyW4Y1gHdUjOW8HYg1cUaOTNLbDEjZeHfQB9CrA34gRrbAx7usGWRJ9ouz1 ymOCcgJPo8fsJ8t7Bf4/CDN5sH0TZw1byyh9Swbz+XjeMMw9WUZ3quu1CwsDn+iH21Kv YxoQ== 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=4/ZpRoWlscQf7x650G5ocJj9fBh6agMK8aXNyTthMvo=; b=t2W7ANraVNMet+JhUl8QjnWsXchzIlGjWjhEjmyi+xvT67LaL4OQtuDZZwyG5axtyU kG4LAANFrRjIC7glmC4+uD3D08Vr1vvlyyEH64kQYPJxbsuAnijrRUlTdKtki2dYi1AL N3Elm4SPxupD3hBe2DhIuS2aTXm2h3d5oAEtC34550TeJDjVLulLP8k28L5hRpvzVT8k IsFnbaF1GXH+cIoe/YCHut4X5tF4C9Z8/rhYkbI2Zhbvoce0ZZRaBq1m24hyrHxlTwXy HIEVAslkUngvgg3rDPJbUor6QytboEv/wHmBcHemtJc9KiNAJZR4jMScsw+XPI1iif/q iwtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SV94dmfQ; 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 ix13-20020a170902f80d00b00195ffe06442sor7998120plb.2.2023.03.08.08.40.42 for (Google Transport Security); Wed, 08 Mar 2023 08:40:42 -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:902:d353:b0:19e:2e6b:142e with SMTP id l19-20020a170902d35300b0019e2e6b142emr18567080plk.63.1678293642497; Wed, 08 Mar 2023 08:40:42 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a8a1:b545:91cc:80b2:f9fe]) by smtp.gmail.com with ESMTPSA id kq3-20020a170903284300b0019b9a075f1fsm10046540plb.80.2023.03.08.08.40.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 08:40:41 -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 v16 04/16] drm: exynos: dsi: Add platform PLL_P (PMS_P) offset Date: Wed, 8 Mar 2023 22:09:41 +0530 Message-Id: <20230308163953.28506-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308163953.28506-1-jagan@amarulasolutions.com> References: <20230308163953.28506-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=SV94dmfQ; 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 Tested-by: Marek Szyprowski Reviewed-by: Marek Vasut Signed-off-by: Frieder Schrempf Signed-off-by: Jagan Teki --- Changes for v16: - collect TB from Marek S 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 1615640e25d6..90ff40af005c 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 Wed Mar 8 16:39:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2785 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 D8218414B5 for ; Wed, 8 Mar 2023 17:40:50 +0100 (CET) Received: by mail-pl1-f200.google.com with SMTP id c3-20020a170902724300b0019d1ffec36dsf9602926pll.9 for ; Wed, 08 Mar 2023 08:40:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678293649; cv=pass; d=google.com; s=arc-20160816; b=c/OQhLnswsXf/FEv5sVduGWgQmScC9HQZcf9skcSj6kbGmHdr5uJNgOZE9FRVmRIen J/emjJHOOvIskV6Jqt2RUCLe5i3f54XMpak3iln/yRFifBquK2babmpq6zKSZ2ROZ0Wi Z2Uds8I1d3I7Y9GyIM1KPFIoopJ2bT1L3uy9GbKQTJ3xisat26+DHQ08XjgkAfyOmEYO 1bK33utnMmOv8VzWsqBesMjwHk4bOCbanw3Glq7SKrEpSKra0XFY3ZIs4eOf2tbIJjRx wT1iCPHfZzyori1SQXDDgCN2kYQ/t/CehMu2HFEzkY+/lPQERaJBniABuoOSsu5Bfazh fNcg== 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=Y0bRP8DTxcmThovQjA8al6368BjsrxCNZORvQM4clbo=; b=Qsb0WTlsGZKJvL9NavNiRDhFNADfzrV1vZ/xkn6s4DMdANhrkLdnfocowyY+jEOCkH ruQ8UlbyfjRApGnUk97smzUX5iCHcXMQL2JLhGrduLqsed7/9vgzsnZEFCVj4E/zdecB k7TY5uh3+1sCeVmd+c8x9Kv8MmK+/2ezZl1AM6UxgFFebTfzpNbFHm6ZuZEOH0Bodwci Qg3Y6NBwL5K4lMAeJz10Q0O9Ez2rKbJhutk7Dj1PwKzqUmdSseBww5EALN+pvb61LRnF 5yk0i0h5rT5qObQHE6bJdz2zkZQKnCNm3tf0rXvpiY5L+v0fut8uyEX00l+xMi15oxL3 eX4Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=cdcXoPOG; 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=1678293649; 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=Y0bRP8DTxcmThovQjA8al6368BjsrxCNZORvQM4clbo=; b=i8pQK6l6j7VJ6FK9m7P4T0wIGEqDsIE3RKssbQCcsVTm1QaV6ZGwXyAT+Ka1jUxdIN UXeq2B2by+iYM84Xdz7+68sHz4AToznxTDQpSEsxH5Cs42AqLCTpIINNwmwlN7xAJ5HY 77J8wQj0FzImDi72HNiYdbHaIeC5faH+a5dz0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678293649; 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=Y0bRP8DTxcmThovQjA8al6368BjsrxCNZORvQM4clbo=; b=aXassOrTT4Q5jIO4Jqx7LbwC5aDcXEKuT10xLQvtosYxbZva55bQO/8J/Zq2dqsPvr iHUtb/x96yjBlwR3qHpErtb28LbjnfGyUbE49tF582B16lVfUq1OLqlOCCRx2FuZ8rur i20whjBHLkH7z4nCzRE4n5GnFqfA4A3ju61tjk6mrY6sMF3RLmIX+jRZ50DWFsrhyAH4 /oszoTrrvm/kDDmThtdlHVjPlbr62ost4kx7VnpYM5AFUg6IaI/cs8FTDUT9fO6WnFtN iRVD/GaivtO3nz7a7VV0ZF/5DvmFqJLEmWiCLK3aN2eQqCrRsVrVEF5cEyqqgvsAZMee VioA== X-Gm-Message-State: AO0yUKUsYuZveBzPdTmGMabbWtuu+fA/WH1DNdXpnhHthq7hJkkLqqZz ckppiv1W6cknrmlwvwCScv3Ft4I+nOZC6c2w X-Google-Smtp-Source: AK7set+Xc3qDgE3S64huoPaj/Vy9Z8dICGV+qSfaTpWIuFTpok90MVvH3Izm5Pyd/6r/AiHH0ZOQwg== X-Received: by 2002:a63:9c0a:0:b0:502:e4df:5f3f with SMTP id f10-20020a639c0a000000b00502e4df5f3fmr6178258pge.6.1678293649659; Wed, 08 Mar 2023 08:40:49 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:5ac7:b0:237:7ef0:5b8 with SMTP id n65-20020a17090a5ac700b002377ef005b8ls1992848pji.3.-pod-canary-gmail; Wed, 08 Mar 2023 08:40:49 -0800 (PST) X-Received: by 2002:a17:902:c40d:b0:19e:6955:36af with SMTP id k13-20020a170902c40d00b0019e695536afmr23882253plk.26.1678293648677; Wed, 08 Mar 2023 08:40:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678293648; cv=none; d=google.com; s=arc-20160816; b=hwYdsCsTILYPc0t0tLH3rT+A1qO10Fv3quG5J2jYS1EY3nLy4sbSPem4fNSUYUi52o GWGCVgLALGQtVte6ERnDWdvEaIzI/kBpYRKZ/0F2mCJQtHLIJNjKKAfjE7spKOzkkHmm Uv5XsU/f7aKzbVkI02x/rVtrnZhgzU02gGoA0zMHnzBOUUh5vP5OPnfmI6aGc2cHJ8DA RAGakmod7JiWeXAw+5p6lMpBUYVu0nDH67p55eVgvDgDRS2dEdY6wzSGa2ZVPpwEXovV VbcWeiGYpur8z327IErrsbWFHvQS4QbjBErzHEXy30kfJWOaoP4ZEImfU35W05aXJoiY tKJQ== 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=zuaaNlwtvX1EiEc/sO04f/d6DRUpib29L7439uIhr/E=; b=KcGHzwH95dY27SXq87Dv9KtUme+QSM5wj2zPI5hwoOvW0z1x10ST24qUvTPSQCteWs R+8nO+NznLkQQBsCW8Z1olWangKAnXE5V/RTIcrb52JIgaV+PA3XYZYh7cjP/fxmK5Js hVZHjZwPlFR50FhYl9S24GUaxtAv9QpJmhDIvgZOwDMYCJRDEJ7SCRS+4a/AxeMM9Zkp +tYrQUOxvx0fsY3EJW87Wxk/DbzDsrHg6VsXOiFfWdvTunDmsLp2CxV7ymZmc2dyXRvT SdjIL5KJacN2cm6bpYomHXsZufNp/SSa6C7e2F69tHSyMiJPxJujYfYPHyPJ+fVxI4dH 2qwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=cdcXoPOG; 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 q17-20020a170902edd100b0019cc2c4a107sor6768911plk.135.2023.03.08.08.40.48 for (Google Transport Security); Wed, 08 Mar 2023 08:40:48 -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:903:41c4:b0:19c:c184:d208 with SMTP id u4-20020a17090341c400b0019cc184d208mr22161867ple.66.1678293648307; Wed, 08 Mar 2023 08:40:48 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a8a1:b545:91cc:80b2:f9fe]) by smtp.gmail.com with ESMTPSA id kq3-20020a170903284300b0019b9a075f1fsm10046540plb.80.2023.03.08.08.40.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 08:40:47 -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 v16 05/16] drm: exynos: dsi: Introduce hw_type platform data Date: Wed, 8 Mar 2023 22:09:42 +0530 Message-Id: <20230308163953.28506-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308163953.28506-1-jagan@amarulasolutions.com> References: <20230308163953.28506-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=cdcXoPOG; 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. Tested-by: Marek Szyprowski Reviewed-by: Marek Vasut Reviewed-by: Frieder Schrempf Suggested-by: Marek Szyprowski Signed-off-by: Jagan Teki --- Changes for v16: - collect TB from Marek S 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 90ff40af005c..0f0834ebbdf3 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 Wed Mar 8 16:39:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2786 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id F1E95414B5 for ; Wed, 8 Mar 2023 17:40:55 +0100 (CET) Received: by mail-pg1-f197.google.com with SMTP id y1-20020a631801000000b00503696ca95dsf4015098pgl.1 for ; Wed, 08 Mar 2023 08:40:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678293654; cv=pass; d=google.com; s=arc-20160816; b=gAQlx5V9pnqJlEmaaoZmNigBUb9fafNxG5ATeyzf9R5jP90RTryQNETokEyHeMGPii qFH4oQeIIJD4MgqiLNbh6oUc9Fs76/wG93Arbvyv30qSWLnVRK4p06F8YnwyHXZNVNIf dwQ6y8xTlh1HlsANUcpwVQaOdxALEY/hiaGHIPI4i5QLr29jv/NkLFAAmSQzKntRLor1 1boa5SldOvzceb1G8vCiPbD/PMDvoXQgtHxntu7UIHjZi21QbZTjd3gFGqnvaKUCizF5 LMNsFLJeHixHqgCPx9MOssTZM5k9m0eK1Sei1JeMI+/JVwvToNwNZct156rNpAH0qZqg RuoA== 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=spQPQPBt4UjX5mrX4vKCwqJNPcszIfK86qhrpYbhjao=; b=lzLzG5/eRBY65dOPI+jGzFJJFMUydFKVWexU9bYFcVQ0PHedItIPrjy4RIY9BueDGc kQjWMe1h/ERcdSfCb8PpIs+qB8gF/m0o7hkrcjWN0F6vc1k56LPjisnHzfJgjsE5CT9b WHJ1VhAh1fD1zK3P7Z+Woj2aMMC8eicu2/N31MuIo9COKQn40G9p7AmZa5Kbcrq/wWj1 s+re5bXkA7mQ5lGLi+88Q3KoXrNPTAzUK4dD0EavduHxxlOZlFuUt/JsANPfVVFkeF6r /sUUZKwCcsrc18wflyvM0uPUIOqRpkv4/PV/rkpQl7c4x8LSMVK4IjCxOWuat2DaVsU1 6rHQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JkACBPEA; 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=1678293654; 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=spQPQPBt4UjX5mrX4vKCwqJNPcszIfK86qhrpYbhjao=; b=WvZ3w0RObJzy0zJc5H+nd4AhojGRKzFw/Ag56rYnDlM64RMqBVoFsO8WMNyI9CD+RC B4lIwsGmUwsTPL6cP6C/KrQX/XJYAt2BFeWnutWuFpUiFcPkQKaSy50nhTPmqTGkrqHc M08b1PRgZTphVRepeX0Q+zid2vidN1UvwjMK8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678293654; 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=spQPQPBt4UjX5mrX4vKCwqJNPcszIfK86qhrpYbhjao=; b=L5S/jPgmQqdQRXsDF0LnWBsuOpNVSVs/V3P8fGre6KZox7Rrw4pjyRGTg1obCPHmWw pVlENvdaFuAiM8mo/cZ3pAU34HOGFIm0gGA+IJE995IZFHeWaPKH3x1fK1cqSucljFxI N0NlGI1pe58u4qRI1ozzHh/VARtBnYvJ7m6/20hn0AWAFN7WC/HKu+ZGPCD9rS31jKC2 lxjTTw0oio7cNc5T7Cue+aEqan7m+ioIDKYTmAscWc6D+I6MlIIUhARQfe4DGsdfYXOH iGZ51dSefGy0oXJq0NHLEf797vTUzIsBv/eOnBzhc1bEjUGmMIqKh+sL/8/UMauBeB13 xUNg== X-Gm-Message-State: AO0yUKWEgLChb0kIaaEdkQPBqgfXkuQD5349TuQXFsVUcoy2zmNGTNlr nkpJhXtL7ljttFFlO3PtvCbvrZCU X-Google-Smtp-Source: AK7set/VCgNZ2dqbXb5rKVnIbT6tt2USJMCb9ToDoWONOhNb1m1/g6zQi10sE/neaRolOwi+oqIYnQ== X-Received: by 2002:a17:903:280f:b0:19e:f660:81ee with SMTP id kp15-20020a170903280f00b0019ef66081eemr1158656plb.2.1678293654708; Wed, 08 Mar 2023 08:40:54 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:cec6:b0:19c:b3c9:49d5 with SMTP id d6-20020a170902cec600b0019cb3c949d5ls16356206plg.6.-pod-prod-gmail; Wed, 08 Mar 2023 08:40:54 -0800 (PST) X-Received: by 2002:a17:903:260a:b0:19e:6bd5:7ab6 with SMTP id jd10-20020a170903260a00b0019e6bd57ab6mr16515786plb.14.1678293653861; Wed, 08 Mar 2023 08:40:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678293653; cv=none; d=google.com; s=arc-20160816; b=gcA0fuRxuaIFlu3sDoc8GJNJotvp/px6LNmNhuAO7wz8ZRyrluWlhBfXUv3o51SFRc m1g9I5f6KWxvQzQRJ//MwXmK/0m7ZNgZzJ+jemQn9WverQRnRYl4kVVhfp2ygb+VI0Tj rpoLllO6DyZsWTUUN+h67rvRuY5OgEPSLGCxK93+Fd4fleeDKvxbvIwIDYUpE3KiIUXi DcTwfW3nb2e4u8xSS8l8KXQjmf5zrP+GczQwXpJead1OWO1lei4B9DziLDC9N9T693Ln nR3IKphsmBTtqnJZd3IGqiTkRNXc0qa2GbVmg7MGOQ7RJmBZS5htalx2E2exQHoryPVN AfjA== 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=aMsPp2VhhzL5Iehbwf/OplfTAN7PVsKpf6p+LnZMlVY=; b=Gl+Uw32lXA0ihI7z+4GHVSt/pp0KyV4F1/+gLrePEiHJeqg2SoOR405nCtVTSinh/n BedLlMU35IfvhGsG4nOdvLpvCmpeNgBqnVo3V5SWOsmios/+ExM57izT6Y3mF8YNF5rf hG3fWmd1Cr5ZiS9cPoRjMWjhs8GUnJTPMHmIWethlXeOQ7wVeXNCRSoUTZEQ1sQwXSUX IV1VP1y1UrRUcS1MygwcuYpXGRof9r8biUUdRE4e3DQ2LSb6OSydrvV0UBrIYkhnwdSe WQbKcMrkjoxTJbONnz1qcx0xw+qIMMYPmcSENQ4fifqqxSioRFztiL/NnwnQyAPrqLyj agsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JkACBPEA; 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 v16-20020a170902e8d000b0019c94b26500sor4874531plg.129.2023.03.08.08.40.53 for (Google Transport Security); Wed, 08 Mar 2023 08:40:53 -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:903:25c2:b0:19c:b7da:a880 with SMTP id jc2-20020a17090325c200b0019cb7daa880mr17234523plb.11.1678293653524; Wed, 08 Mar 2023 08:40:53 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a8a1:b545:91cc:80b2:f9fe]) by smtp.gmail.com with ESMTPSA id kq3-20020a170903284300b0019b9a075f1fsm10046540plb.80.2023.03.08.08.40.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 08:40:52 -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 v16 06/16] drm: exynos: dsi: Handle proper host initialization Date: Wed, 8 Mar 2023 22:09:43 +0530 Message-Id: <20230308163953.28506-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308163953.28506-1-jagan@amarulasolutions.com> References: <20230308163953.28506-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=JkACBPEA; 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 v16, 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 0f0834ebbdf3..eb33c2bcac16 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 Wed Mar 8 16:39:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2787 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 7935C414B5 for ; Wed, 8 Mar 2023 17:41:01 +0100 (CET) Received: by mail-pf1-f199.google.com with SMTP id n17-20020a056a000d5100b005e5e662a4ccsf9106765pfv.4 for ; Wed, 08 Mar 2023 08:41:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678293660; cv=pass; d=google.com; s=arc-20160816; b=gyamlQ6FWqox0IUFkswDtEhyh6UMmzrDEbgOC6KuFym4BRAkQXjwXkmlIbrFkyBSwG A7V/PLtBCc3HRWGHu990MaK5kQgk/dEAOVOWNZvpsayU3aiLIKzZ9ydmyrlOnc1g6tJy BCi7dabz4DgfLO1ADDUCB5byrGKi8XUDge9PdN4b87kfpDPQdVCbuFu9yUe4Vg15/t4t 2EdTjMnd5A3t1lYKSfDUMetuLoMvR+kNTLEm7YLRwG6YYoTh66Lt/G74jSFUhQ8MAumE Eb0k9kvnJgErketymZgVDuNpnPlpRgeEZU0A8ZnONdOu/VRRXHceoLXPAQMt0K5xPNeA 1xhg== 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=BTcWeJYBdFrJjKCrI0IqOJBHavPqbyYvSuMV+LCGjKw=; b=NvXk7M4T1MjDf1TzehsZfkKbsBukhjt5JPS0M2Oay+/P58JZ95Lc+ra3HGTV+IKudX i/vmXmTK46Y3wfdADn73YT6/6spm83gPlXfTYP9C/WISb6fXQD1TrlE3P8+9XbQPbdGg XL61wbqyIVePHMs1HQY/uo0EX0k5te3V0WcUaakY6uTcrrTPcn9rPqiy0y4N7WLxWWHP Pbtl1h1AFF8PYOHgQVzaal8BoiTGN9N2OUmt7ji6rju6K/HgbzrnwCeZsnS8gd1+voE2 YFpn5dgEotb0XKY3cHT4o1qgeu0XvYhnCDe/4vHHgWJp3EWjbs0EffZegidepdUIUZ/W e5CQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qvZ2QewJ; 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=1678293660; 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=BTcWeJYBdFrJjKCrI0IqOJBHavPqbyYvSuMV+LCGjKw=; b=l3vk4c44BxeTmIRm6CM1UVZlnI41AOZWljFKF8u9yRCkUkXwsM+IuO4peC7qO2gGgl 0qzc8XPOTQs+2POREuv2RVgVzBeAdrpljspoa/eAR42A51/yH89mg48KOQc876ZJZMbB Li/lYY++WnQYPOKvBNWrEiBMJfU1uI+0Mp/F8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678293660; 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=BTcWeJYBdFrJjKCrI0IqOJBHavPqbyYvSuMV+LCGjKw=; b=p+7GQHU0PSb44jyAK///7VfeFLB3JHuKDdxr0riu+ajL2mg/Al+rDQ1aNOVUnCOLUK +SZDjGflrJpsuMmxQAEO7fFxxQDAcW6qUW0dzADjrb+PYT6SJD/DF9wv1RR5yXQYt5yP A7kpQ8i77uKaT9052TUNrwzJ7PRHtMMFQspk1HrE76LgW8bLWDtnN6LbloB9CcjiiT87 EK8B8ld/z16Dn1Z+7Bclj+5RD6ZaJJJKEEqhYgNNAycDpG2CPe0OOof2d4fPKeCGqarW mz5LYUQvPqUY/PhNmjBvj85veip/n3U+e+vc3p+1IOt8MtswwgGdDrR/ixI8gH4tGe2Q MveA== X-Gm-Message-State: AO0yUKWrC3WCwKIP8RKWNkYhU1qf4g0VfrURW7C5STS6GqezeaYEKQ2v Kbw+OMKVf3c8W7R568B+2sxyK5+r X-Google-Smtp-Source: AK7set9Crr8PYinFl8ZzvOlunZ7X2cxzLsXaaT9Rlo7lDWjmPJ/WpG1gzlhQ7+8oGWu5KxCLf7JQgg== X-Received: by 2002:a17:903:449:b0:19a:87dd:9206 with SMTP id iw9-20020a170903044900b0019a87dd9206mr7199722plb.0.1678293660219; Wed, 08 Mar 2023 08:41:00 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:f7c2:b0:19c:b41a:3d75 with SMTP id h2-20020a170902f7c200b0019cb41a3d75ls16359295plw.7.-pod-prod-gmail; Wed, 08 Mar 2023 08:40:59 -0800 (PST) X-Received: by 2002:a17:902:e54f:b0:19d:d14:d48a with SMTP id n15-20020a170902e54f00b0019d0d14d48amr22581037plf.3.1678293659291; Wed, 08 Mar 2023 08:40:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678293659; cv=none; d=google.com; s=arc-20160816; b=obFDoWDiW6XDmgAztZtWzG5jm9LrOeHULsSIneYaB17+0UagCsrTKEDB1l9CiJx6SS 9UmaOHk5szYzazvOiy4pxuTYgoNBW3TMwJDNMtJNpraMcNyZO70AvjhwdusroGGmcZRB Bd96kI/KU5IPeGmj0QyQfKw7UAqfmJkDMlFdki9LNnk+Eqil0JFdaDXTsolv0BimNkcQ 2Kp/17f9nEgCW9wiWR2+/20uGapITxrTThJq8RkCT+2BxyUIEB9+Lvt94msPHy7Vg0D7 lJuV58HkvVZntthiTPeX9Zp11pEjzCgRU00Kf6R/JRGPofNmws8jIdgK14ehUPh9BCcB +1QQ== 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=aOdTRCNR5Lf/ceaTUFSrm5IHZuRCLptqla9LZq74Fpo=; b=u/H1sWelQeu8HwRxIilmfXtNs2INAbKbEFSLuh441op7oXww1amtOYFRXjy0JX2nV1 1U+ToJrcFFyQL09+4f/RU6zU9pvCyuhW13rXcqBQuJw6KrAPzkF1JKtPPjDBeUzbfU76 i7N15Zoj2fKYmUsaJbh14gfLJseMD13qf334HzgVMawZ7sttjE68e6935F63Dm7Puj2D 1s9kJCTzGHKNgT+ORVnH1d7d8V0JWQ+FN8sz9PUfQhOaGB4/LR8WnZw2iGKfAVLzu60W 7/eJbsLZe7riiNIPKPwOSz/o4ZaTdhvOpBaye0oIGVe4L+iVpC5kPXBb+BnSfR36eVq/ 5pjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qvZ2QewJ; 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 ij9-20020a170902ab4900b0019c911e1dfasor5924921plb.48.2023.03.08.08.40.59 for (Google Transport Security); Wed, 08 Mar 2023 08:40:59 -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:902:778f:b0:19e:6760:305b with SMTP id o15-20020a170902778f00b0019e6760305bmr15440925pll.47.1678293659004; Wed, 08 Mar 2023 08:40:59 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a8a1:b545:91cc:80b2:f9fe]) by smtp.gmail.com with ESMTPSA id kq3-20020a170903284300b0019b9a075f1fsm10046540plb.80.2023.03.08.08.40.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 08:40:58 -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 v16 07/16] drm: exynos: dsi: Add atomic check Date: Wed, 8 Mar 2023 22:09:44 +0530 Message-Id: <20230308163953.28506-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308163953.28506-1-jagan@amarulasolutions.com> References: <20230308163953.28506-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=qvZ2QewJ; 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. Tested-by: Marek Szyprowski Reviewed-by: Marek Vasut Reviewed-by: Frieder Schrempf Signed-off-by: Jagan Teki --- Changes for v16: - collect TB from Marek S 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 eb33c2bcac16..df4d95ae8aad 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 Wed Mar 8 16:39:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2788 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 3D17F414B5 for ; Wed, 8 Mar 2023 17:41:06 +0100 (CET) Received: by mail-pj1-f71.google.com with SMTP id h19-20020a17090aa89300b0023a9e52c40dsf4614440pjq.0 for ; Wed, 08 Mar 2023 08:41:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678293666; cv=pass; d=google.com; s=arc-20160816; b=Uq5cXlWG9QSBbGVRcveslTtVQ0EA2IGJmVrL9C8gC43Hs/Oukdl93McevjQ4M4sHIA YmEE5E7Coop1QdSZvtJ5PKMD2YQVXwDgJMR+9seUvQMMX3/rXzuGtOyID4S2HXN6mHz3 UWKstViNbLw0aoP1XETfrYygRVOEpFHFAvKk+3Jyl0hpLT8M66hJ3Qm2Lh51w/XT7ZBg CUhebp8w85NSJha7wZ7A8pFiomybJNQZfrOVR5Fdp0e9xit4vqpHRnzwAoSCCR3w4SEf rghBZ52L79yy+obWEL77g4QR4Ria925IJIymtQ7H30MI+IPBFM58RKf79iyU5Jos0DuM r3Bw== 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=7ZUzDWmTPyLoImxt97TDVcWq3DTszaUcTSuoVvS87pc=; b=LFaLpqS9HNA/Vp6Qu4UgJ1mfRpdUc0FHCZTOWpkjZQULf3T2dLWhMRPPqX2vw5VUu9 o+RAEOGUpaKCvPA49w+lMkJeGkxCwmDyoeSntonDcEKTH/E+xnCLMJRfZR78iFxn2MUU ryhZzzuyxKeyziWXurkzyg2Gd0Ql0LIBiP6LzTuP3OezYufru5qKVPSPXfufVPmGMvCv Y0wp4CQszqHBu2mYAO+m4PM+cy1olrMXM5af0PXOm4t/jZIPPV5ltlp2eLmuJZx0dHPe B1vkw9gcz+Go06qyyB84Z9m2c6+w+qdQwR0eTzkiQQSFvI+87bUqn4ef4B3Ye2XiOHPU l5ow== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gLVZ9B2i; 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=1678293666; 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=7ZUzDWmTPyLoImxt97TDVcWq3DTszaUcTSuoVvS87pc=; b=Ko5RzAq/xGsWlPKzXkQjM+JN675K6fZ80zs1iDhWqR9n90zu4byz5bpsNrCcGhb/xB N7YgQ/oGWMOM0DxoHfrKZPKqu3O9fQpfr2h3XNZAynDpbcw8S7TiznYF5LY0nCm+cMFb f67khVcJQeP5AgN2jWS5PbPc2/BCXtnxwqTy0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678293666; 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=7ZUzDWmTPyLoImxt97TDVcWq3DTszaUcTSuoVvS87pc=; b=FXK7Z0YMYXfuK1fME4IONCSFgJ1poj4JNGdQ02j3NDQhJUKxh19XrM3VfGmhcd9DGT aCvU/sGDDHg99+N6cMjJdqmMj43lGIDCFiqoij+flgsgXUV1arpWOBVEaCuch1j7Efte wmoulvdeS7HFsdvVoYx2+IYuDb+pdCh5Ge7qrXEZdphJmIS8FBKw225iBdMun+l901IF gsc97JZv6abo8BlEhrOrOlDfTKFDBSt2NKv0evSpZBcsOOKdk7AcMqanTbf0VTEEYs6j s+LZv7gBJwRxO2P12BMLJKJWHdBfML93KwbgqPnygFdL9rzIBaV5un3eQ0FgCyONJYS2 3+/g== X-Gm-Message-State: AO0yUKXPrlrPVtl/YP5XCVD9dGsPshlrkIk963XVDWYnmD6uik1mYqwb +r92athKLa0qBTZBIYQlgy6UKTtd X-Google-Smtp-Source: AK7set+wg+33FsjsSdusdTxUpmc7D/qIAnjr5p/Q7sBDcJHbQTvyxNlRHUHV61dVrwBm4RtNXK9Rpw== X-Received: by 2002:a17:902:f7cf:b0:19a:7c89:c63 with SMTP id h15-20020a170902f7cf00b0019a7c890c63mr7126060plw.9.1678293665763; Wed, 08 Mar 2023 08:41:05 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90b:908:b0:234:a618:558a with SMTP id bo8-20020a17090b090800b00234a618558als2006869pjb.1.-pod-control-gmail; Wed, 08 Mar 2023 08:41:05 -0800 (PST) X-Received: by 2002:a17:902:d4c8:b0:19e:7bce:cc65 with SMTP id o8-20020a170902d4c800b0019e7bcecc65mr20683002plg.66.1678293664755; Wed, 08 Mar 2023 08:41:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678293664; cv=none; d=google.com; s=arc-20160816; b=l3/HO/B9d2Luo532dKu3TNKuI4V2sTvHkK6QIawf9kUeXyH4cU89ToKU9bMKm4/FiU sCaOUJfpYIbsiV8ZVaK6O4ZpEqN2Bu5AH3myLeSOboMlkXakC7xs7je+Uy6fUjTiHY9J hFcvUK4iNg98kb6orskvvyJLUEHdkb1WAB/VERBOZxgxabs0/O1PG0Y/hCllowJ1GaIc zIqkhFNbQZFOepN5CO+zoyDKXFPaON7b2jKKR39+/EfkE+yHNNWKKrZ+2hrIiqFcATNN QfOOj4Kr4XXYEC1U5+AfyNJfZiZvUDJ8EyKk0BGROcKFW3TLcSAQb70eSPIpfbQ3YfoX EUmA== 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=5uifEp0NbegnY+0fHyacboXPZ1//0/dD+ZvuB6kybZM=; b=Ye6cT5TYKx+QjEt95afaTlIeLz+WVaAwx6TIYA5mCWTMqzxo2ANN1u1KsEkwzhFOnL FjIZ+hF+ATobwMpOlU7JGzotzuUvvrdm5HjHbeV/02pT5l4+RhKFLVrh1bjwt0xIipSG A91kuPkgZpDibJDB/Ou49oefUZWo7KiJFeL2XAQ0i3G8LJfFjwnG5N1Vx2gA8jAGMz+j 0oazu+nk17gFapH1XAFooMGUVG520ee5w6xS8SvQzoEon8YBbA9ZloaZSduw8MuILAWG xCO19S9yQ3VphODBLho6xEm0gMa8F3lXkuhUBN2tIvAHLzs77EDJXyrwoIQuQtO49YYL MCrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gLVZ9B2i; 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 jb1-20020a170903258100b0019e21d2ed28sor7234124plb.199.2023.03.08.08.41.04 for (Google Transport Security); Wed, 08 Mar 2023 08:41:04 -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:903:24f:b0:19e:7a2c:78a7 with SMTP id j15-20020a170903024f00b0019e7a2c78a7mr20928369plh.57.1678293664454; Wed, 08 Mar 2023 08:41:04 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a8a1:b545:91cc:80b2:f9fe]) by smtp.gmail.com with ESMTPSA id kq3-20020a170903284300b0019b9a075f1fsm10046540plb.80.2023.03.08.08.40.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 08:41:03 -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 v16 08/16] drm: exynos: dsi: Add input_bus_flags Date: Wed, 8 Mar 2023 22:09:45 +0530 Message-Id: <20230308163953.28506-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308163953.28506-1-jagan@amarulasolutions.com> References: <20230308163953.28506-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=gLVZ9B2i; 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. Tested-by: Marek Szyprowski Reviewed-by: Marek Vasut Reviewed-by: Frieder Schrempf Suggested-by: Marek Vasut Signed-off-by: Jagan Teki --- Changes for v16: - collect TB from Marek S 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 df4d95ae8aad..0c480be5f070 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 Wed Mar 8 16:39:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2789 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 18A4B414B5 for ; Wed, 8 Mar 2023 17:41:12 +0100 (CET) Received: by mail-pf1-f200.google.com with SMTP id z19-20020a056a001d9300b005d8fe305d8bsf9262193pfw.22 for ; Wed, 08 Mar 2023 08:41:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678293671; cv=pass; d=google.com; s=arc-20160816; b=M52B4M5YG3Bo4blhngyYs4cU2LdlRDNkouh0V9TOMye1XRzY4nWYWvx8OcDQd7e0kr 8pBcNxRKhWwEvcOnXI2MHRZ2LGzwpSN/pAIkHuw+9YKfM5AfU3aMOm6S5Lzc9TiwDqPQ 8+FSwqUZejSqshFbHGoR69asjJpx1ofotQHmVHtAhtPA1UW/XR+TbwOYMPiDZcqTHR5m fwOtaONjD3dswimUz2/p3mW6CoKdBIOC6dlgTrko0h00m2164PJEz1qjkljSlMsJDLet xXStqEKU/yZHT2sN4YpTRFMghVFERJ0A5YBd99xpXKtVLvt/uDpUsvtGNT1TMVX59fWE AcRQ== 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=Ay2sxI29qtApbMwJYujpUDEekfQsGMlwwWNW1QdlgR0=; b=sqtN6PcKV63dpSYUiqvy6LQ14HeuRUeszTYydbO1UXuJ5BkoQU+UGC0XrrhblzAUzV XYZkARtBT1LQCgRmNit0BtCdgr4cdYP22AnfDLSlcqEWVygaTVrIpU9smahzXzoB2Si0 Q+SRNftvZU65tn2/E/e7Lnp9EBgxJoYbnWInnEyf+xOPO4ih3VsrQLsh+s15+7vrY/KN tGcOIud4cHiQfWt+FOL5nAFQUpwELILXoLX+EPdrjQ+BhskzkmnMRb9MZ9ozu3bhJo5X ca5nyE9pE8olyLvBvQWcZYmJcGMl0nUH1Cecf6rTOm7PnJJU85PTargd+mC8QUOgiqFV OsHQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=EKUzQ+uf; 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=1678293671; 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=Ay2sxI29qtApbMwJYujpUDEekfQsGMlwwWNW1QdlgR0=; b=MSxhXFEXRmUp3rEEulE1n6qziCwTwVMP9o/20jkBV50QGwbAZL+bp6DBJjKpft/apq Kfja4o5YC3TR04dyYElQ2NRpO9sE8Kez7nxXUTGqw0RP9dW5rFwSSbkwaz9OlcUW250G aiLM2riGzYSimfLWoBmO5qrwkwLhqHLe4YJew= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678293671; 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=Ay2sxI29qtApbMwJYujpUDEekfQsGMlwwWNW1QdlgR0=; b=15G76axBGnzTJ6vMkMIEtuu+Pru5BW1w4Inh21I0AmtLPvW8+pkcyD8LHfY+feBDlK R/Nxo9uQTbddAPTCb7nkOX/FW29JVoJk6Suld1mXfx8e4dU/H5jXhVg5j/m/U4iSZMrr lkgcfllTqbRWengzGIapWdGUhM99QxkF3VbtTfzCxF98U0Tvsk4HcHb6Y1ItV8htBarB vg3XNiaETfhc/Ynel+/LmgvD8Bxv+eHZ4R2RqKxyszIYQxjdlqK69IDXuYMScmeJ/G3S kHoblrzQCvhL9ky0UmlyRvy/QY/HhZ8k7WErSgBL1Mhiw+mPkzYZ88E6ylQ4OHVY8tuu GjEw== X-Gm-Message-State: AO0yUKU5YabGsEauEXO+JHj/jXn2Mwx/NguPAD0SX3gmNhSqp1AlvWFF hgEYdq0y5eIDd6g8MFsL1NUhBCQI X-Google-Smtp-Source: AK7set89JjSIeE6UYQ8bgUJMMH6Q2KDA9AB8an+i2QR+OGLwfjxwHF8DjSYvg7C9okpPgzmn22stkQ== X-Received: by 2002:a17:902:efcf:b0:19b:373:94ad with SMTP id ja15-20020a170902efcf00b0019b037394admr7065705plb.3.1678293670908; Wed, 08 Mar 2023 08:41:10 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:7043:b0:199:182b:34bf with SMTP id h3-20020a170902704300b00199182b34bfls16381093plt.3.-pod-prod-gmail; Wed, 08 Mar 2023 08:41:10 -0800 (PST) X-Received: by 2002:a17:902:aa4a:b0:19e:3922:b7d8 with SMTP id c10-20020a170902aa4a00b0019e3922b7d8mr15388466plr.12.1678293669926; Wed, 08 Mar 2023 08:41:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678293669; cv=none; d=google.com; s=arc-20160816; b=Ubu+8eBu08uOrZvCh6FZeR9KKxZoQx2FdEYTCSe752EyI4gApnaW6ieSo5HpXLeHdY Nor8BLy7pz7VTlB/n8MUaQn8qa/DOf8z+XVKdS2vx1FaGIOthwIxG/EO10bSUPiD4QXy Vhcfa3yYvT/wpM+hCYKUFVjwWMatDEJcCzC6ZUIWiOPT0PO5OObirTWWT+4aKhhVLXSk 7pbX2rxOsv96n0QlCdV+TjHxGElI105O16oH3Ogat+V9+YctRavUolrQmQl9gz0eFzPy PkY1SFfxRjn8WaMI/9xqocpKzBuJ8zIhC8deP6xlEWEMHBFYsOaxCgYaQETpFBnvEVDf 9qFw== 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=UsgY6N6catKRCRfBq6xxwmLwSB7PaDK4tqNXn1E6zOw=; b=i4xIplGo4cLUg7cXTx54nOgkdPSo560cVbPH0U+HhWzgndO102uvy+7/BrcFFKPhBb pKLG/vzWao5fDKV+dDACmhO8g0E50YqmoarLvqRhSsiHeytr8E3tjJi9GLKYghW3Uyt/ W20PN11GH1dEDin3bEPsW8d30yEuqkZyaXQWGW0QJqJ7GDGpfrpTzgdEiJJbZFmBVprS fZSa0ICplj25ScdEtiSVGVhmZdM/rRahMidwlHtuNXsoZQ3w5DqymgnZCxwd86aeLMNe K4WldQokpNhff5iT4eepw3rw5dUboHAo7ZR0VHkD1QXSdMGmJbx1912KQaFXeqo1ZKPu iDVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=EKUzQ+uf; 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 jk4-20020a170903330400b0019c94cf7697sor6170442plb.133.2023.03.08.08.41.09 for (Google Transport Security); Wed, 08 Mar 2023 08:41:09 -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:903:244b:b0:19c:c9da:a62e with SMTP id l11-20020a170903244b00b0019cc9daa62emr22126627pls.54.1678293669560; Wed, 08 Mar 2023 08:41:09 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a8a1:b545:91cc:80b2:f9fe]) by smtp.gmail.com with ESMTPSA id kq3-20020a170903284300b0019b9a075f1fsm10046540plb.80.2023.03.08.08.41.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 08:41:09 -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 v16 09/16] drm: exynos: dsi: Add atomic_get_input_bus_fmts Date: Wed, 8 Mar 2023 22:09:46 +0530 Message-Id: <20230308163953.28506-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308163953.28506-1-jagan@amarulasolutions.com> References: <20230308163953.28506-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=EKUzQ+uf; 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 v16: - none 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 0c480be5f070..bd3bb8622ca3 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 Wed Mar 8 16:39:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2790 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 9DAD9414B5 for ; Wed, 8 Mar 2023 17:41:17 +0100 (CET) Received: by mail-pf1-f199.google.com with SMTP id a23-20020a62bd17000000b0058db55a8d7asf9268427pff.21 for ; Wed, 08 Mar 2023 08:41:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678293676; cv=pass; d=google.com; s=arc-20160816; b=QzW633mU09JOClvkqlyxRgyk92bZQlW0Hk7ss29zYrFvz+T0cX+inyg0Yj5CnXssHg 3PQPnkZrpsnCMRB33AiOPtcXguhvXOq/RDAHWW4U8PJkKN9Ovkre0uNqLlBAS6NPTANW xnV3j0gBQ1X/IB5eSbljDNsmCcoZINAlW2k3mT5KFbKp594BR2g6LKsJRFj+cqd18acb F1OZc2y5Tj7Cr+dtJanxeKsZAJr+aEHOsHY8YtIlOETO1fbKK+uDBukrT6/qfkMQsQUq 6DI04af+qDkSCq7NHO0kv1ovviwVj0lJhszfxazB7d0rNZ4bhwioX0asNJE7rSQWaoPh 9xSw== 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=5EtoY7aHv0PaBdMVUpWPQDkHsj7vOyeLEjg7Rh1tbPs=; b=F6yz7sH9ztxH+9CjkpVu1BPtUPSquSfKGvrsfTtByMvTrgp86r02QGUV9PXsF0SCYV RjH2vZIV+TNXqHU+Uz3QPr1WBQ2M67cst4r56kahw1qjjPTm9up7Pwm+RjIh0C1ANBr3 YggYl4IiDGgu9YsIqsHdxUraM3bLJi2cmJPEPI/HsE24e38UZcWyH/wnAnUI4Wqv0NP0 6wMPmECgWLUQUKUeM8EIFDu//sSucz+V2fPfbW6wBMlZa+U6inP4nH4wZdnRntovFzBP uXtVwubdaL6Pf8QT4L63dxDjeOYq3icPWFX+MFG7HWSUuttmpFv6kk3SgUZJrnEADgQk QJOQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=T6TdM3TJ; 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=1678293676; 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=5EtoY7aHv0PaBdMVUpWPQDkHsj7vOyeLEjg7Rh1tbPs=; b=U3sDSpn137y1NGW8VXqtfXqmbosS+gSkVsg+Day+wEawMY/BtYsx/oM8P6P/RN/UUN SooDqiXbQRf0HDxHT80kDye7nJrohlJlS/vehYuopva25Et3uA8Zkf4WHe/FiTvRyDjR oweq/M5PMQIYiwSzKuXScasT73FtCs/aeDckk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678293676; 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=5EtoY7aHv0PaBdMVUpWPQDkHsj7vOyeLEjg7Rh1tbPs=; b=yiSaTawIquOpsb8+/jQPtHUBeShm3Pk7RtKvhoy21UwaxPYPgco3IO7ghUi00r5uOL hM80JoqgC6REjAHF40A8Mn80dR7nbl+bdtbd91vD7vWSDWp2Rxvz3oCFKqkWCT2Xi2JB gCChmfnZmZIGTYc1Lewu1/QVhxJJStdLLnpDXldT2gYAPdWy4tQxIv4uqDZ0QYrFMJOJ nZ06LTvi4hStENUChOm+4skPAZ0AT/8yYfaAGYQshIC5ib2gJh1nH1oj/O5twUj/P7HA 22PkQ62CVXAoru7l8IIkg5lSmKRuJGZxx3Ss7MWiCVAw4jHq2vhFeAkgNbVYZOkxuf56 VeWg== X-Gm-Message-State: AO0yUKVcA9V//6tyHhks8xaRKNdnT8034exuoIfLIl6vYwXy4gyIYcUK iZi1RbxD/zXBU6K6Nq+KwK0vKKqJ X-Google-Smtp-Source: AK7set91jcFPw1wqFtJwppPaQhL6dS9wNs2AAnlNhuzeSQCDVtMfuDtbWlBkO+9XcYZfwG26LGB4Sg== X-Received: by 2002:a17:902:a3c6:b0:19b:8cbb:30fe with SMTP id q6-20020a170902a3c600b0019b8cbb30femr7239358plb.13.1678293676438; Wed, 08 Mar 2023 08:41:16 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:e742:b0:19c:2b1c:4d75 with SMTP id p2-20020a170902e74200b0019c2b1c4d75ls14100344plf.0.-pod-prod-gmail; Wed, 08 Mar 2023 08:41:15 -0800 (PST) X-Received: by 2002:a17:902:e745:b0:19c:eaab:653d with SMTP id p5-20020a170902e74500b0019ceaab653dmr22482952plf.15.1678293675362; Wed, 08 Mar 2023 08:41:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678293675; cv=none; d=google.com; s=arc-20160816; b=QWWvCG47k3plAga4rWMPV4Zde5Fk4B4SOqS5pVKsSaroe+9dsaOVVP8A69Mm9WhHn+ jtM1ZKZUVHn6ylpSr4SCkOhA/iSWWbZtsDA9fgPN3A4Tc6wrIb9+YJ4TDAqvTr/PIogl KW6f72C5mDDej8iyGIhyABxgTSQ9qrQa9G5AmSE+jNxVam+yUhl85m5LH51s1FniIr9v Dv0gj1WY8IpfFiZ+WdRZsuxgStz5ek3HJxhHk78nzb0aY0hdiSCTfbtoCZMYzTSzRDmV bedjpGY7AvgY8vAVW7UkAz8ZVZI+t19sATedEO2U3ZSl1nMj4Z0bFiYzhBu37oKLqo7q 5+yA== 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=choR+RZaYvHjo7lhSR6XLRS+PkEWQioBLGP3Z4YHgOU=; b=hMw/fwr2KwmS/kABnsrx1QokS1Al/3bsqYToyfNjxsVUp7WCXPeIUoQAog0lNWKxPL NNjKqrE5hMJz1WNzo5vpd6YyqSOwo7XZf4jGOImkhNK7WKwfFuHzjddCIOVEEEgvyZHa BaSukWGSnHNMxEiRv1Jq1mBZjnE6NzkrE2FItVCGwELcAXjnKwrbPKyPnIxsLtQLCnlM zY7obE8+PFZoS/9dP4Le8Xg5ygzjy2dTOP0FQgNK4Lt5W495k2UFxtvHgkYNKpqcYYpv YXnrnoJXNjAoNZ6er3TkQueAWYWyV3ewy/xcUzMDD4ZgScPeFACn5KGsrPaOsTv9gx6C 0/Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=T6TdM3TJ; 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 f7-20020a170902684700b0019c38c79dd4sor7551353pln.89.2023.03.08.08.41.15 for (Google Transport Security); Wed, 08 Mar 2023 08:41:15 -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:903:32d2:b0:199:1160:956c with SMTP id i18-20020a17090332d200b001991160956cmr19166520plr.31.1678293674999; Wed, 08 Mar 2023 08:41:14 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a8a1:b545:91cc:80b2:f9fe]) by smtp.gmail.com with ESMTPSA id kq3-20020a170903284300b0019b9a075f1fsm10046540plb.80.2023.03.08.08.41.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 08:41:14 -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 v16 10/16] drm: exynos: dsi: Consolidate component and bridge Date: Wed, 8 Mar 2023 22:09:47 +0530 Message-Id: <20230308163953.28506-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308163953.28506-1-jagan@amarulasolutions.com> References: <20230308163953.28506-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=T6TdM3TJ; 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. Tested-by: Marek Szyprowski Reviewed-by: Marek Vasut Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- Changes for v16: - fix TE_GPIO handling - collect TB from Marek S 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 | 138 ++++++++++++++++++++---- 1 file changed, 115 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index bd3bb8622ca3..01ed1677a4fd 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); + void (*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,11 +1661,6 @@ 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. * @@ -1665,18 +1673,15 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, return ret; } - mutex_lock(&drm->mode_config.mutex); + if (pdata->host_ops && pdata->host_ops->attach) { + ret = pdata->host_ops->attach(dsi, device); + if (ret) + return ret; + } 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,12 +1690,12 @@ 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; dsi->out_bridge = NULL; - if (drm->mode_config.poll_enabled) - drm_kms_helper_hotplug_event(drm); + if (pdata->host_ops && pdata->host_ops->detach) + pdata->host_ops->detach(dsi, device); exynos_dsi_unregister_te_irq(dsi); @@ -1766,11 +1771,50 @@ 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; + + drm_bridge_attach(encoder, &dsim->bridge, + list_first_entry_or_null(&encoder->bridge_chain, + struct drm_bridge, + chain_node), 0); + + 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 void 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); +} + 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 +1832,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 +1842,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 +1970,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 +2063,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 Wed Mar 8 16:39:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2791 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 EFF3B414B5 for ; Wed, 8 Mar 2023 17:41:22 +0100 (CET) Received: by mail-pj1-f71.google.com with SMTP id d3-20020a17090acd0300b00237659aae8dsf1278206pju.1 for ; Wed, 08 Mar 2023 08:41:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678293681; cv=pass; d=google.com; s=arc-20160816; b=vHWlqUPhjtFW/daQimsCf4CO62l7ejLUtD41+KaM+FBU5WQxhE9rQpbCv/DISO331k 0IPkdRZwOGy/s7q/mD0qiN2qXckF3haq6DHHn7N+fJFDi2DWJZw12Ld57KeT9atOjDTn tjkZABIs0k134NaxT2GpeWP/UTYT85iwqs4cYTUxXqbVWHudnS4vcn8U0nqN4LpFHyCU lU2iAXXsSjuVQggO4gGRnuF7ynLBt9fgQ3x998R0J2dS5ECLUxDIlSKC0QUWL3w86K04 T/dRzXg4F/yEYTl7gq1lNpsBfxO7vbo5KfzlOxoKmefYvZg05JuOdAlOjx1bfYquZfTs xz2Q== 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=l+VuiLg+BcM0IMBzlKbvIEY58x3JBRHMfphOxUVU1Ac=; b=jO1Pgdu9g+MuLcDNOrIC5LILtf0m/EiWD4Jp7Lho483JRIxYkajFpyL/4m5k/LDQ89 yvb+ty/31bO+tpQVOfIWw4WOFp+Fa53JtQ+a6xMYGtpj8hd0TN/JRDNsqscsbk0YVgAz u713if6hxIE+VuDmPLtaOzLjWAcTpPxTXpq9EmKt72r6POzTvWjquV+Uc6lNErieXDeS buHGjj03GaRxPhehjWIpODcV/HyO1kh4kZqkznJfGtgAd4IbrijswMwuIt4BZ3DQpv4F d2aGJD8+sOumuCGpJGxvvTyrDxfgvA/KBMUIiHwz/p+4PWwN6gn4NgLdal3yoA+4+4T0 H5Cw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=o3ke2KJZ; 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=1678293681; 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=l+VuiLg+BcM0IMBzlKbvIEY58x3JBRHMfphOxUVU1Ac=; b=fE89repzZgNI1X/BBBvEMC85LrX7uicT30RHhdz72ZRWejEvKoq2pwpA1igAElqjCP 5zGezg+5MDumNZvkeTzxRrzYg+8/Du/N2nO4nUblTYMGX6bhuKCJ7PNgvy6P6gaffEqT c0dHzOikN+IpnSVbyPkTacBxH9P5A4YNeZHnk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678293681; 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=l+VuiLg+BcM0IMBzlKbvIEY58x3JBRHMfphOxUVU1Ac=; b=IiAGsMqFwsOsPo3NpzAxLxhVScPTeO91+H4qG/i2R4vWy1QrFf1xnV545Lua0pLsBE EPSWqcPtFYaSzl1zSBDgMzBlk2OPvZ/3BO5qREShVe1+uycIjpozYJSsWtnO7qTvyWE0 TQ2jEpwWq8gk3DtvDJO2sWfNVd/e3UGWqRrlOWBSEFijmkuDk5BW5exWBQEiwzdEOx7g LLxXtNWzGehIhGuPdTOX5ZWJC1pDiSTGRHRtLPnu7SLArcoAic1YUBuv3QgOJtwkFHgE I35UtfKuG9W/OND/RR5mTxGIdZyx9lxA3AluscWbVug16eBzmugIKem+FJrXpHR9Ck6y 0aDA== X-Gm-Message-State: AO0yUKUC379QMbEHK/826CeC3TjAxAK9S4Q0ghl5kFFgEq2bayKjFxqt 86LrzAdZOtiys+QupLqKd5CxFjaK X-Google-Smtp-Source: AK7set+SP3kPcyja8ggPIHQzynzPZpi1wP6ngnR+YhBWugQBovFNfDbYbgNvMO2DMbtX4aMvwHY4cw== X-Received: by 2002:a17:90a:1c02:b0:234:bed1:1012 with SMTP id s2-20020a17090a1c0200b00234bed11012mr6761390pjs.6.1678293681753; Wed, 08 Mar 2023 08:41:21 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:be18:b0:199:50f5:6729 with SMTP id r24-20020a170902be1800b0019950f56729ls16325308pls.11.-pod-prod-gmail; Wed, 08 Mar 2023 08:41:21 -0800 (PST) X-Received: by 2002:a17:902:7807:b0:19c:e0fe:ed2b with SMTP id p7-20020a170902780700b0019ce0feed2bmr14089392pll.54.1678293680826; Wed, 08 Mar 2023 08:41:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678293680; cv=none; d=google.com; s=arc-20160816; b=dPWzkOBaPWWREROOFn9Bn19vYxAajYaKs+Ll/QK2BkQebjsdV83TTIoYg7T9fCaJEg O2i1yQKsaR+SPxBSEIK/us1Cz3LRYwWaAl9Zv4r0CEsqUxPaq7bezBjWEm1B7S8yt+Bw b68A8L9V7No5ihecx6h0cisZDG8+CjoGBaeEPw8l8bT3ohggy7xNXj7d6cOSKvSdg/gs NIIhDRTD6YqsAxmjbX8btyK2hfiBtkFlAFmOz3j27Cw55d8wjtEshojUHMdCpRRW8qUE uc6iQYU7dKm+ya+LDMzdE16daHO2T3M7KAC5lINhshzrck8urE1gpSIDpzjK0Vua9h+M FO/g== 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=nxcRYcAFiM6jXzQsrD3xe+grt23Ypaeq7iGojFVEogQ=; b=I9uaTOW2+0tiUZfeTCdwESKIcGI1m6T3fNyIVrwk2s9nfXHHEtYWM3FrKLMDxtw7Jb vBn5+qb7KE1Sf8j5IpUi7I+aviOhMTLGBuNqlEOBE+6uvMjbDbe1Mw4mfac7aFIxh/B4 M6gIZsq7EqJ9uz3vmGMKWixpCcAR/60bXk+/wCvxGanQxZtrvGkh4YvB/yu73r6Jck8q AT3lyMOvnDavzvM8g2cP6v0S0tbcOeDYvhvfnesKmdiIUWXsXtCSMXe+7dfRTaxoZCWH fqWlmKXd1wnBUuvHmOz1iNtrKfO9Q83WTtPHuGOA+UZRiBaa08AI0C/AC7kPDOBt0FMo u6tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=o3ke2KJZ; 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 t13-20020a1709027fcd00b0019a8a067bb5sor6481216plb.106.2023.03.08.08.41.20 for (Google Transport Security); Wed, 08 Mar 2023 08:41: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:a17:902:eb81:b0:19a:b6bf:1df6 with SMTP id q1-20020a170902eb8100b0019ab6bf1df6mr19864921plg.20.1678293680536; Wed, 08 Mar 2023 08:41:20 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a8a1:b545:91cc:80b2:f9fe]) by smtp.gmail.com with ESMTPSA id kq3-20020a170903284300b0019b9a075f1fsm10046540plb.80.2023.03.08.08.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 08:41: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 v16 11/16] drm: exynos: dsi: Add host helper for te_irq_handler Date: Wed, 8 Mar 2023 22:09:48 +0530 Message-Id: <20230308163953.28506-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308163953.28506-1-jagan@amarulasolutions.com> References: <20230308163953.28506-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=o3ke2KJZ; 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. Tested-by: Marek Szyprowski Reviewed-by: Marek Vasut Signed-off-by: Jagan Teki --- Changes for v16: - collect TB from Marek S 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 01ed1677a4fd..b75b5cc88bc8 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); void (*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; } @@ -1771,6 +1771,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) { @@ -2068,6 +2079,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 Wed Mar 8 16:39:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2792 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 3ED9A414B5 for ; Wed, 8 Mar 2023 17:41:30 +0100 (CET) Received: by mail-pj1-f70.google.com with SMTP id p9-20020a17090a930900b00237a7f862dfsf1276801pjo.2 for ; Wed, 08 Mar 2023 08:41:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678293689; cv=pass; d=google.com; s=arc-20160816; b=PzyhLj6OsrmNIge2yMnN71Goa6tNzziTOqVKUUfXl7KmTsJ7pOUMHHUPUm9Nqy1D/0 XsGqDBK5VS69LVxussyO4lnyw1xkAqPrYdJd8OUTCJJDlqnrWeEC0qdsetSpDuKInhAF EjOpb8ee00mKkwdmkwHi9zQVvHnz+QtDjtDPyP/lPxOgXNzemEaYgB5R/bLrklXXi/xM 0EgsQTAviJHGxgX9ckNuOGfVBG+9/US9sJpb+GctPjo2f20R2zgMVbqY3nfRk3zRxpSA ukfiLoXtt0lrPUSCcFH8N8pSTojtHidgytPS8fIlf4642lPFvXGc9W3EfOrqJPX8KnSo XvzQ== 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=FnoJXyV5iZjoLlRs/66ci5CsCbP9JSArpPLN/4vGJ7A=; b=WOQZssDl5hkNLONR33ubmJJa+DWxC9jBP+yAapbr0HvDRVK/QCxOogN6CS647QEfhp FXR1ptn1WKFbzzZm1erDrxEFECyj86TCynFRHB6dbC0yRwAOZM+Gb8DxRDjW9mo+m66b 9tm2AV+OdHpwyCaa/dBqH1fgKl9Wixb7PDgM2Ee1NBoW03ZAQnBQADMkNIoGDLHzIXxm SumSarZ+FjmXF6vdDrBqLdYXgasXuvYkqCgaQGTSo2ZOGDDyTFCbl/OjirTrjHDBhBJ+ Yyg55zct7kdI9t1KBdS6XH9NY57vwlZOqlLXHxm8/tF0RtpnKpiBBV9Ses6jcBRZzoQK fGQQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=B+B3Fk3v; 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=1678293689; 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=FnoJXyV5iZjoLlRs/66ci5CsCbP9JSArpPLN/4vGJ7A=; b=kW4gAFVTHDH47HI49L4kIvEi//rcaPaxodCWq/NXlB5e4e9HoIC2xq7MgU5h1rbUJY blVNBUJ+gdFygUSLXpMFgc2jabWDHAAmm3RW7Q74rmODUySzdFnJhvjDYbWilThSkB8f DWEYcGC8p9x28HmClHWflWBA7NmkXwXfZtwBA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678293689; 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=FnoJXyV5iZjoLlRs/66ci5CsCbP9JSArpPLN/4vGJ7A=; b=1cAh3qr3c1kLdB0JpbFQfu7rc8HTbAhx1av6jfyfeIU2XnhAhinjgPM7q4G1YysZ07 1pJOd6wHLnLad+ewDZ++UFD76ESr7UkaUR509KrKlOWFuUK9Qub8Kxv5cPT+QJN8M1WV q9zpX0YRSrQL/W7h6oL3jNtnMTq5hcoPSjRPeARZfVTv22IIYmiitpohje3Gy0aSk9YI 0mMyQF9tj9bwk6kUzsDLmHj/4T53HJHRg9wRoL8fzzVuYJZs3+IEOCFqa4Wd+yIT8YPf /8zB8nqJq5rpCXaAb5PP6OGJ/v02ztlUz2OI1XcBomo4aU7F8TDbjUFdYrDqTj8NY/l2 NZXw== X-Gm-Message-State: AO0yUKV2tUEKJD1pwhkcaZI3rXa4wvgKpqEL9N3wS06dqwCuGLB3fHma S072vGLZH1Vp1c6DTNtoxpHP2Pwy X-Google-Smtp-Source: AK7set/1yvJQfVhox/Oat1ryUdsYWplfDMNEZzJCfUhjXa7dz1lNODNlRZa1N2t4gfhXxSpY2q/VPw== X-Received: by 2002:a63:b253:0:b0:503:20c2:1752 with SMTP id t19-20020a63b253000000b0050320c21752mr6567144pgo.1.1678293688738; Wed, 08 Mar 2023 08:41:28 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:be18:b0:199:50f5:6729 with SMTP id r24-20020a170902be1800b0019950f56729ls16325589pls.11.-pod-prod-gmail; Wed, 08 Mar 2023 08:41:28 -0800 (PST) X-Received: by 2002:a17:902:c1cd:b0:19e:32da:e458 with SMTP id c13-20020a170902c1cd00b0019e32dae458mr15395510plc.63.1678293687566; Wed, 08 Mar 2023 08:41:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678293687; cv=none; d=google.com; s=arc-20160816; b=cFw6rzdIEZmXz6rtUERW4yIrZLsXseHjaARI8EK92hbnVXQqXzsqM1NJQh53fOkf5P n93Y0iKXQYBRNlTawLSh10lzD3E4k537MSmsCyN76pyjBrC1yjyinBU7n7KAd1Dgp931 fw69w5oTg8GZAS30uyxCsHDug2TLEkmnJOmWU1JmOF/pLW84/mdS7QS6uXmWAk7v8p2v Kyn6qsoRkCGu2W2CxCFlr4aAAQ+UeggEk4dLD4lIchBjJksSRT8BrCpOX0jH2V2siYn7 kCKbX7Z68qUy62GEHVcdyDn6fcEwy4CtW/paNqbz8lAZyY3cM37cqXAtUEPQCbWYvw/f hEFg== 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=JPgmICzpMw0fHaUCdRORd0zN0giN1zt/Jwczrt2kTI4=; b=QwxbFgGGZAusTjVBCfvGhuiIGOAVUqUJtG8YDZMcuDoy6ldFKXtBKMonrmx1ncWlPw NSZDciPENfKkOt85telD11K9TzgR8gUna58Rx+nwiSKQmIgQ1IZteqko6OtX0jcO73jX SsNpHXHtlANjMuIEkxjYvLe79aP20el99sez1HsJPGeRoYTkLAN5Cw5o94bN8xzwTLaG rweiXPDEPxPM6d3uzVqCrdhZsfmK77Knd07xg+uyyCuMYfThnwrGhgmoRbqjzNKSUAVr Qu36hYZebmrqSB8VvqFqDcC7JarFxa8JAOpVt/qAkF8vF61oP8kHxStMh1KtSlDRyuZf +5uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=B+B3Fk3v; 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 w15-20020a1709026f0f00b0019ea6406ddbsor5361342plk.196.2023.03.08.08.41.27 for (Google Transport Security); Wed, 08 Mar 2023 08:41:27 -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:902:740a:b0:19c:bcb1:d75c with SMTP id g10-20020a170902740a00b0019cbcb1d75cmr16047060pll.30.1678293686520; Wed, 08 Mar 2023 08:41:26 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a8a1:b545:91cc:80b2:f9fe]) by smtp.gmail.com with ESMTPSA id kq3-20020a170903284300b0019b9a075f1fsm10046540plb.80.2023.03.08.08.41.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 08:41:25 -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 v16 12/16] drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge Date: Wed, 8 Mar 2023 22:09:49 +0530 Message-Id: <20230308163953.28506-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308163953.28506-1-jagan@amarulasolutions.com> References: <20230308163953.28506-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=B+B3Fk3v; 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 Tested-by: Marek Szyprowski Reviewed-by: Marek Vasut Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- Changes for v16: - drop explicit bridge detach - collect TB from Marek S 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 | 1900 +++++++++++++++++++++ drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2060 +---------------------- include/drm/bridge/samsung-dsim.h | 114 ++ 7 files changed, 2090 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..f9a5e69a0fcd --- /dev/null +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -0,0 +1,1900 @@ +// 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