From patchwork Wed Dec 13 19:51:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 178274 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8030348dys; Wed, 13 Dec 2023 11:51:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHP/nuKRLgejuCYEmHxVteuu7ncuWq8cDbWBCKnP6hJtjLQp+qOySxv7jIWu9GFm+PlXGfl X-Received: by 2002:a17:90a:e544:b0:28a:d241:eea9 with SMTP id ei4-20020a17090ae54400b0028ad241eea9mr2137244pjb.82.1702497111282; Wed, 13 Dec 2023 11:51:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702497111; cv=none; d=google.com; s=arc-20160816; b=N4q2pixXlL5vo2D4j/qjldnKlbp8jXdocVXZ+IjV4w5oeO4C3iGDrrXmUytdBMZ1D9 LpRM3K3sG4QTzLrSvI6GRV7rvX+xlFy4dp/GA5bBn66QxgIzxSwZ4GrFBwn7R2whgKbk /H4faegxFXH0lod+yM0vf/DvUTd/voLMpzNJ2XYzoWQ6vpcOPcASJvT2YaIDG1neWlh1 0UFtbuVCQiLlFrFHY9LJ7sarOjLQqProchRVWdu0hbWGtWalBSnFa9WIoKYFvRuwCTSV OQXpYhkKL493N9r2F6ZR+WQ49mBXH8habZEak/RcUuhIWGJn1jVZYHVlgHce7TsdrR7t wZSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FrtW0qmKYRNQLQV31syGJ5EsohgiI927CfneGFLgIjg=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=fsepPoJnCKdLeUO4F2IV11hyfbcqYlLR+aTryloPs8su/wo7Fukab/wZJFGoNx7JJ5 E2Jtw69YNRMLi9AmUrI4AYLEWkD4+oRmGLI2RVDHELqeg3x0og/wSF+DPwGQxhkFGriZ b2qwACKSY37Ps+xSScNeaGm790KB+3xtsCrX9bvtA/JzyXqWGpPxYnQPgp+GlLX+OqI2 v7RPBB+e1GmDosQCZCzrX3I1UYl0Ue5N1ktKntz/DQNdLTx53bSDP8urlK8WJUywmLjj qqGKsLV0N8+HcDKOq0qEoKu1XE8ER5JeYHnMBpKOp1JskyXjup3flytX5Wk7IwAUy+h2 BK+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Mrd6M3Pt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id k12-20020a17090a9d8c00b0028afdc9d4e1si416786pjp.61.2023.12.13.11.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 11:51:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Mrd6M3Pt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 16C3E81C19F6; Wed, 13 Dec 2023 11:51:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379049AbjLMTv2 (ORCPT + 99 others); Wed, 13 Dec 2023 14:51:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233660AbjLMTvX (ORCPT ); Wed, 13 Dec 2023 14:51:23 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0D61B7; Wed, 13 Dec 2023 11:51:29 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40c38de1ee4so51156695e9.0; Wed, 13 Dec 2023 11:51:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702497088; x=1703101888; darn=vger.kernel.org; h=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=FrtW0qmKYRNQLQV31syGJ5EsohgiI927CfneGFLgIjg=; b=Mrd6M3PtKXTd0ng8eiCEMBUxMQUmPVZ/y8nUgKWJenZd2PzXe4LYGK8S9HyKnwF8pR c6kUp3E3iUtCd6NqpAE4jUNJ/cZ7xy3SRj31sheg3T9LERQhNW6DAjeayk3YOYjaxA21 Yr+GzmSupmRMyVcXUmac0GqPn0dByfgTvgJdH2ycBoS0J+sc1J+YJVucnX5hw9Zc69iD fvf2BA8ss3KlNZ9ZjcwRf7r+E+3SNq/ffY+dCyv7QhqYI5OAF5d2QCRW6JCO3xaOzKon tq46AQQq4QRfVHy8av5gV0whXaF4QCA95xywVVIg9uPcSJXPyAEDnd8RJohn23jx9EtG Y6qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702497088; x=1703101888; h=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=FrtW0qmKYRNQLQV31syGJ5EsohgiI927CfneGFLgIjg=; b=jCJZmMN4QUBrFPfasECXaY3pA8l8RF8h6xxjk6tDbxhfMSGFp4k1CwUYSO01TvsUYQ opv+Sm6v2NWNv6U6he8V/eAS9a7Dhm3MvOFz+zLizGAhoVaRokGS3LsT/D8EXi7tOdnW Rhy+7MOHuihRpXyAjOez85Z9dzcUrTsrUC0/mq8r++4tQXe3sVs5ZywPzDYjvi32vdO4 EfqqDQggTMC8GtbnsoNsZMCAPCLNmfL/rMYkXPEj1ADjCApFN93dNEc4tWHzaqf5DLvW k+yz0P/qrjd10qAP6KyWg0dPvXf+HlFHzhInZkdWSl+FVm+iNkxp3fOh3WYcyKq4SIkS bPVQ== X-Gm-Message-State: AOJu0YyuaGtbw0VKjOqEpnXJ8pkxtBQs61PYctSIBm8xgSjEdHs7xVkD RMI3hVOlELLH8cAXaRL5nQ== X-Received: by 2002:a05:600c:3b29:b0:40c:3290:7b80 with SMTP id m41-20020a05600c3b2900b0040c32907b80mr4610268wms.138.1702497088224; Wed, 13 Dec 2023 11:51:28 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:92dc:8b1c:e01c:b93c]) by smtp.gmail.com with ESMTPSA id fm14-20020a05600c0c0e00b00407b93d8085sm24050698wmb.27.2023.12.13.11.51.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 11:51:27 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH 02/11] drm/rockchip: vop: Add output selection registers for RK312x Date: Wed, 13 Dec 2023 20:51:16 +0100 Message-ID: <20231213195125.212923-3-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231213195125.212923-1-knaerzche@gmail.com> References: <20231213195125.212923-1-knaerzche@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 13 Dec 2023 11:51:46 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785197610890140272 X-GMAIL-MSGID: 1785197610890140272 In contrast to RK3036, RK312x SoCs have multiple output channels such as RGB (i.e. LVDS TTL), LVDS, DSI and HDMI. In order to support that, this adds a new vop_output struct for rk3126_vop with the registers required to enable the appropriate output and setup the correct polarity. Signed-off-by: Alex Bee --- drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 13 ++++++++++++- drivers/gpu/drm/rockchip/rockchip_vop_reg.h | 3 +++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c index c51ca82320cb..b9ee02061d5b 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c @@ -227,11 +227,22 @@ static const struct vop_win_data rk3126_vop_win_data[] = { .type = DRM_PLANE_TYPE_CURSOR }, }; +static const struct vop_output rk3126_output = { + .pin_pol = VOP_REG(RK3036_DSP_CTRL0, 0xf, 4), + .hdmi_pin_pol = VOP_REG(RK3126_INT_SCALER, 0x7, 4), + .hdmi_en = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 22), + .hdmi_dclk_pol = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 23), + .rgb_en = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 24), + .rgb_dclk_pol = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 25), + .mipi_en = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 28), + .mipi_dclk_pol = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 29), +}; + static const struct vop_data rk3126_vop = { .intr = &rk3036_intr, .common = &rk3036_common, .modeset = &rk3036_modeset, - .output = &rk3036_output, + .output = &rk3126_output, .win = rk3126_vop_win_data, .win_size = ARRAY_SIZE(rk3126_vop_win_data), .max_output = { 1920, 1080 }, diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.h b/drivers/gpu/drm/rockchip/rockchip_vop_reg.h index 406e981c75bd..fbf1bcc68625 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.h +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.h @@ -872,6 +872,9 @@ /* rk3036 register definition end */ /* rk3126 register definition */ +#define RK3126_INT_SCALER 0x0c + +/* win1 register */ #define RK3126_WIN1_MST 0x4c #define RK3126_WIN1_DSP_INFO 0x50 #define RK3126_WIN1_DSP_ST 0x54