From patchwork Fri May 18 09:45:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10409333 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7D9B360230 for ; Fri, 18 May 2018 09:54:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B973288F8 for ; Fri, 18 May 2018 09:54:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5EE15288F9; Fri, 18 May 2018 09:54:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, URIBL_BLACK autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A138928901 for ; Fri, 18 May 2018 09:54:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Q1WbYRM6NcLYrqxyDZ1bVBPuYJJYxLFcvEKTH2seiJQ=; b=EG8XU5w0aWTY4T4vNMWn315ubH TUU84W//8k5tvpwX5STLhGVOvP9lxHOPK4QKOc7vNUMrJsHo24bZm0Eaf5sJJ/m0YWk3DB7gg3B4M QLfk5dvgGHD1QTAKLLp3fX//vPf4dg+imFaKgxU2QiDX/2O4XHSKHSMpiKzIztYMbxQ5siW/18ooe /hlwKNpYymXypNMlPO4ASdVqdEQqRGR6VQajUMLO5WwP8ETLjXIEteXrUE+/bHFjYkzCvGaUqW7zF cjtcpkPl2n9hTtmMHCQN0eo7jLv/JE49IpwuGAjGEuw+dVfV8owY3sZsldBagNE7L8mcycdG4XSWH E1EgUHgg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJc5j-0003Nx-Od; Fri, 18 May 2018 09:54:27 +0000 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJbyE-0007ti-Ug for linux-arm-kernel@lists.infradead.org; Fri, 18 May 2018 09:47:03 +0000 Received: by mail-pl0-x241.google.com with SMTP id w19-v6so4287444plq.4 for ; Fri, 18 May 2018 02:46:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BgCx350OC/hevr1enbMukUj29Ndx67PBZ8JUPaFepCc=; b=FC4jAg8lV1Xv90VQmKjRxGhqgYv7J+NF7LXHFkQrbu1CZpRDwAqtjXAt86TfYl9kH8 bUwe1j76UB/Z0o+Q4I5Gzf7VVjefIuoDXxrK0xVQ+nKoZ+C9xq6QDipnCdJuabMgc7iG CnkB93BekGn44AJLHaSEBL/thW/7KnKnujGI0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BgCx350OC/hevr1enbMukUj29Ndx67PBZ8JUPaFepCc=; b=UEvaS+tWCUP9B8J0t/LavLQvqocOQEVPic05Y3JjRwlceHw6hXyyEUKjBd7NLmrz/O DE8O7yFT8/q1FAVszASBEAWf9bciHFhV2Unzfu+PPiovwWwDSYgICwowu0s414pWlk7n ReP3LTBLlKDLA3SFIp8tK5c0aNzXA5qHnhOmk8Pyo6XIhFz4IdiHT9g/4z/CN6VNyqm+ b4rwRMN1gCHQf57G5nJuDO4sQqtVCX8W51VW7vb3AVzequ3nQJyFUahVGGCm7QlU7vdH 1PRgTVXayDeqlblBiXJFRZ+uxPPXBzEYgPkp5q/8B73JxIat3+YU2eZ55yNDt0EqdhVw h3hA== X-Gm-Message-State: ALKqPwfL32W1bUAiQAl9qWYi5H46AYQzvas0ed4+r7TA2UJUkikJFWOO DjtvUmYjdWX7Aol07UAYbnp5gA== X-Google-Smtp-Source: AB8JxZqutsJCs06Kv5KXOp9A0JIecqZZAXrhy7+8tR6PsZYgzveJOABUOFNvP6WlfKodLmwtiq1uaA== X-Received: by 2002:a17:902:4464:: with SMTP id k91-v6mr8641094pld.219.1526636791605; Fri, 18 May 2018 02:46:31 -0700 (PDT) Received: from localhost.localdomain ([183.82.227.74]) by smtp.gmail.com with ESMTPSA id j11-v6sm12694097pff.64.2018.05.18.02.46.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 May 2018 02:46:31 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v2 05/26] drm/sun4i: DE2 mixer: Add index quirk Date: Fri, 18 May 2018 15:15:15 +0530 Message-Id: <20180518094536.17201-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180518094536.17201-1-jagan@amarulasolutions.com> References: <20180518094536.17201-1-jagan@amarulasolutions.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180518_024643_007187_8F38089E X-CRM114-Status: GOOD ( 17.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jernej Skrabec When TCON set up TCON TOP, it needs to know mixer index. Here we do that by setting engine ID to number provided in mixer index quirk. Signed-off-by: Jernej Skrabec Signed-off-by: Jagan Teki --- Changes for v2: - New patch drivers/gpu/drm/sun4i/sun8i_mixer.c | 4 ++-- drivers/gpu/drm/sun4i/sun8i_mixer.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c index 126899d6f0d3..36d90c76317a 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -353,13 +353,13 @@ static int sun8i_mixer_bind(struct device *dev, struct device *master, dev_set_drvdata(dev, mixer); mixer->engine.ops = &sun8i_engine_ops; mixer->engine.node = dev->of_node; - /* The ID of the mixer currently doesn't matter */ - mixer->engine.id = -1; mixer->cfg = of_device_get_match_data(dev); if (!mixer->cfg) return -EINVAL; + mixer->engine.id = mixer->cfg->index; + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); regs = devm_ioremap_resource(dev, res); if (IS_ERR(regs)) diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.h b/drivers/gpu/drm/sun4i/sun8i_mixer.h index f34e70c42adf..aeda6e9a7627 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.h +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.h @@ -123,6 +123,7 @@ struct de2_fmt_info { * are invalid. * @mod_rate: module clock rate that needs to be set in order to have * a functional block. + * @index: mixer index, needed to properly set TCON TOP */ struct sun8i_mixer_cfg { int vi_num; @@ -130,6 +131,7 @@ struct sun8i_mixer_cfg { int scaler_mask; int ccsc; unsigned long mod_rate; + int index; }; struct sun8i_mixer {