Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1047064ybm; Wed, 27 May 2020 14:50:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBbsf8qZ1HqJFNde+IK+yRPbbonOOqcwJml/51L601Ne4oPJTtTOAfLDWIFCmENXh1u6iN X-Received: by 2002:a17:906:edb6:: with SMTP id sa22mr314817ejb.393.1590616217666; Wed, 27 May 2020 14:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590616217; cv=none; d=google.com; s=arc-20160816; b=nQcngCy4xPBNEmcEI6pZxfXCukzD/QfwL2W4RTHoD9lDT7T/EXYtQMNK7zF/SyPII6 mLUGWsAZAM6PcD/XwP2NZ7uh10k6qfn9T14R5BLhAS9CoxIFQ+RwSU/ZYf51Gad6l7p0 6LjCSrTWbkIRyrTGzNPYo8sJO6uCIGgWDoGW48mnL2JbsdHxS6gHNXR0yVrt06usAWeQ cilPgjxtNap4AMK3ib+B9DJBCLDDd1x6X9UQ9gOypj6By8JbRiUhXD3NYvzLLkAg+Ft4 puv9bwL9K6HN/CdHLI0bQmAjIdxp+dvj4DwkOxoRFJw7kO0Wb9sBfHW1vIKat9dZQEiF 4hIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=shm6sF87ItrwWYPyqYBMld8xZIeMwBquVqAKxgBoIXQ=; b=xyIpy02PUP6DYfx8Qfajj7UuIU7K3WraUUTp7ZGdguv7HHq4ULm0ZB0FIk+ezepOQD R/El2X5LGxQWdSKNE2phbjckNi1Gaa8uRPLO5Cbt+bmQnGknFw9TKd4dN6Ev/rs+unYb chaWaMbOtsbqF8yUZeDp0CdbPXCs2Oy6hiJnyMf4mFKAMZMEu0c+8Ix95OpCWk8Gwc8p 5oL31JxrgCKPqkjDFmOfa+9d3Y5A3vadYrSx3/WKYCOGa8QhOM9UuhWY7v68f6rCH+Ya aoYYDeXy4nWHh2l8pUU3AkRmT3VeVCXu+96IYnSIo/ydGBFgVhp05Rh22kcn7ViTGr6W 05Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=BENg7e6v; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=CAKyJyM2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx3si2500786edb.547.2020.05.27.14.49.53; Wed, 27 May 2020 14:50:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=BENg7e6v; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=CAKyJyM2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730730AbgE0Pw0 (ORCPT + 98 others); Wed, 27 May 2020 11:52:26 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:42133 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390337AbgE0Pvc (ORCPT ); Wed, 27 May 2020 11:51:32 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 703D4581508; Wed, 27 May 2020 11:51:31 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 27 May 2020 11:51:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=shm6sF87ItrwW YPyqYBMld8xZIeMwBquVqAKxgBoIXQ=; b=BENg7e6v3urgsjSuqUqwxZJY+3dyI /j8mkUWpIiCYDUAv6SW/4wSp3ePTZ0Aa8HpRfGj+d3cp8gGff643zQVs7djH62b1 OoEfEzIUMMPqgjDhBU/S68QKygE7EpRPnjC5XamlXArg2w2mwAbCvAdIq8GtB/Zc VXzLv9iwE8KuvLlXOpjZQEGsE7/++mvRV+2rONoalkS2ePT5aZKvEhu4q2wylmr+ sr/z6chtpjTejBopAi7W5BoOYRtf0iPhYSHqkOSHbdbDKRV0wi39/0OGHevCzpd7 AKzvOBMt/3itWKgr2hnBXe0/O66ocCPQF6m9XPSwloWhdsddRe8r9cgpA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=shm6sF87ItrwWYPyqYBMld8xZIeMwBquVqAKxgBoIXQ=; b=CAKyJyM2 Fkadp4LxQPhMqyik+Vd34ICtXGN0RTJgeXxGGNrf6qVXdV911IXirY2HJdSE18+3 w0j/mvxCCmFGpge2rIZgsgoLHB3zfM/tBZ3W9d8ys6rB/ROU2T28FHtaT6ABHiDa 6wFC+JTGvnfkpiktOXJYW2SwutsYSZWqlecMyLa7CXUhbI/vqowWluNLOqMnVP1j kVVdA+tXONvIM4lYf9jdN3rCdF6OOqbgUZFowQ8zohUKqxFBBHv7LyRkNaA51cSD kulsw46GKZsg4HFR2LhL1A/9Xck4Lucj4gT/ZstqOXsN4d0kn+XGZdtK/OikU2WP FLg2BAb6yIFnag== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddvgedgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgepieefne curfgrrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 0E79330618B7; Wed, 27 May 2020 11:51:30 -0400 (EDT) From: Maxime Ripard To: Nicolas Saenz Julienne , Eric Anholt Cc: dri-devel@lists.freedesktop.org, linux-rpi-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dave Stevenson , Tim Gover , Phil Elwell , Maxime Ripard Subject: [PATCH v3 085/105] drm/vc4: hdmi: Store the encoder type in the variant structure Date: Wed, 27 May 2020 17:48:55 +0200 Message-Id: <8119ef70c9bd73455895b23a039c4ab7360a4922.1590594512.git-series.maxime@cerno.tech> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The vc4 CRTC will use the encoder type to control its output clock muxing. However, this will be different from HDMI0 to HDMI1, so let's store our type in the variant structure so that we can support multiple controllers later on. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++-- drivers/gpu/drm/vc4/vc4_hdmi.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index d63fbc97360e..7542447eb314 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1262,11 +1262,10 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) vc4_hdmi = devm_kzalloc(dev, sizeof(*vc4_hdmi), GFP_KERNEL); if (!vc4_hdmi) return -ENOMEM; - vc4_hdmi->pdev = pdev; variant = of_device_get_match_data(dev); vc4_hdmi->variant = variant; - vc4_hdmi->encoder.base.type = VC4_ENCODER_TYPE_HDMI0; + vc4_hdmi->encoder.base.type = variant->encoder_type; encoder = &vc4_hdmi->encoder.base.base; ret = variant->init_resources(vc4_hdmi); @@ -1428,6 +1427,7 @@ static int vc4_hdmi_dev_remove(struct platform_device *pdev) } static const struct vc4_hdmi_variant bcm2835_variant = { + .encoder_type = VC4_ENCODER_TYPE_HDMI0, .registers = vc4_hdmi_fields, .num_registers = ARRAY_SIZE(vc4_hdmi_fields), diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h index 4a67d62aef53..4240c5ea7fde 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h @@ -27,6 +27,9 @@ struct vc4_hdmi; struct vc4_hdmi_register; struct vc4_hdmi_variant { + /* Encoder Type for that controller */ + enum vc4_encoder_type encoder_type; + /* List of the registers available on that variant */ const struct vc4_hdmi_register *registers; -- git-series 0.9.1