From patchwork Tue Dec 19 17:00:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181102 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2078644dyi; Tue, 19 Dec 2023 09:02:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGnBhcvOKfV+E3l2jd+TdcDRMwpRRCvm50K2TVqVLxcb+0zofkaHUrELsj/Gn7/8SB4fL0 X-Received: by 2002:a05:6102:150e:b0:466:b8f7:11e9 with SMTP id f14-20020a056102150e00b00466b8f711e9mr460280vsv.19.1703005336351; Tue, 19 Dec 2023 09:02:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005336; cv=none; d=google.com; s=arc-20160816; b=01UHWUivpXh6D7LI5wehoh7z7WFhXjAwXfayOfw99lAOQsuN7Zde60f3/Nv+Esnq0j iTXUNhmg8B5zRO4QWol5n7vJJJzMxr3GqHmKTkOWVDASzXRMvpSf2SpcW6HGyESg0ZZY vVwWV0fMPui42EfRSQM9rH9Mwjg5XPwYGn4TmULqac2xjh1/H6KaOefROnNSkwl/Y7J3 FMsB/mXC/BaA0B/OOCFQLN3vG+c6sr4V/SjMnwR30YSFV6RjAq1YZbtmxd7t+P7IolI4 lKLi7ha4p/Za9s5OEngSkIMoQLMq0L37zMS4FQSddkNGPZmeUbKarBZKBabzbSsllUT/ JxOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=tvxDLNOYjKdWlkXmI7fVu1cGUQmdpgYMh9GlbetV5JM=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=TRjd5/DVfVIzFGUD4tHiAvKmUBAkZ4u1rD76sfqLbu/Vm+xRYWC0VoMjTLaWcb0QxP b/yQ6lQQoIg/nfGmIl04EC8v6HclsBYgvxvYxnqGct4bVp4AqfkepkYDRYC2biwGZEJa o0pV7G1TZsHdTQcKiYOU3UwGJh9LVVq8n4LXkOolR5M3hPUqKAqONXX1rEz9YCZTlFiW K1HUjdHw57tSdob1VvZj76UwptWZfw8WTjC1B2AKamNzYPL7Wo1OvJ/2gcs9dYWtfnXh HG7bGwew1ir6ZBC43rirwEDZIe/Ww2fhnL716V+TjSJsMGAetofdCNHL6p5WqQci4EcK w44Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Co3vCXU7; spf=pass (google.com: domain of linux-kernel+bounces-5620-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5620-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l22-20020a056102051600b00466952db989si819883vsa.703.2023.12.19.09.02.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:02:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5620-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Co3vCXU7; spf=pass (google.com: domain of linux-kernel+bounces-5620-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5620-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id F227D1C24CA5 for ; Tue, 19 Dec 2023 17:02:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 307FC347B2; Tue, 19 Dec 2023 17:01:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Co3vCXU7" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E6C235282; Tue, 19 Dec 2023 17:01:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40c3fe6c1b5so52521435e9.2; Tue, 19 Dec 2023 09:01:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005269; x=1703610069; 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=tvxDLNOYjKdWlkXmI7fVu1cGUQmdpgYMh9GlbetV5JM=; b=Co3vCXU7dJYa1o7tTkeZLSAlruhBwV0IYqLPnN9vesnMrvLbO/EjzMkEjR/JgaUpyy BFyHy+gHl6YyJEsKjHtnXiCIwwylNXygeYYPj5Z8/mRlZ7ob9EYxP0ykRZdWE/gx/Xgs TEc8zYvzVihsF/tglIFfK79slhw5O28p3fPBRPJRWy9IjhVS6Xi+/uHH+ivTM/Fu2dWs g7K8Nevf2YrXoiOI5oKndxrtGLyWcLlAo52pgjBs5qcuBE1jx53IhPqBQz699OKmz1Rk 4dypbTbXdKjrrbHDvYhaZED6PX/iBFatbTNOHWL4YCYxQoygJgpyesehBmKvVu2tCD8y l4TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005269; x=1703610069; 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=tvxDLNOYjKdWlkXmI7fVu1cGUQmdpgYMh9GlbetV5JM=; b=wFVchY4bumpzVka9ynjajLQYxeKuD9Q95LnlnFUoDlxYvWQDlA8LHgDOl821lRM4n+ If3wGPqnH4P8Z3dtOIv2W4ERrZ/Pmt+Zdau3Glv3fe85OVn5z+SZ1qD1KXVwEc+kfGHG NYcAmzpEKwJtgIbDKOH05HYq3M646rAcXq8ufPn9JQ4Ze2pjdba6Lae8Jhy79w6rEhg9 aIdFcNMyossnqhM3O1QSUBSppymJg4webSYD2C/EmWSlQlqTfMq4K0dGasIVySpPFKpx 9CScz7G0wWsLambMQEgzm7l2gPhaWcR1OKyXV0738SpM+r6YNiUOBJqK8H2f6+3DxFbp OaVQ== X-Gm-Message-State: AOJu0YzA2+oTDqMd+VmZ3Suns+fPdjI7Xf1+Bm92hVOLWKcNpQ3nUjer xRxk2d4Q7yuTGp6qIW7fCA== X-Received: by 2002:a05:600c:1d1f:b0:40c:f7b:67e5 with SMTP id l31-20020a05600c1d1f00b0040c0f7b67e5mr8969956wms.37.1703005268722; Tue, 19 Dec 2023 09:01:08 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:08 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 02/29] drm/rockchip: vop: Add output selection registers for RK312x Date: Tue, 19 Dec 2023 18:00:32 +0100 Message-ID: <20231219170100.188800-3-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785730523678939036 X-GMAIL-MSGID: 1785730523678939036 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 splits output from RK3036 and defines an separate one for RK3126 with the registers required to enable the appropriate output and setup the correct polarity. Signed-off-by: Alex Bee --- changes in v2: - rephrase commit message changes in v3: - none 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