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: 10414185 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 68A18600CC for ; Mon, 21 May 2018 08:26:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A324287AE for ; Mon, 21 May 2018 08:26:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4ED19287BD; Mon, 21 May 2018 08:26:20 +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=-3.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, URIBL_BLACK autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 809EA287AE for ; Mon, 21 May 2018 08:26:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 052056E362; Mon, 21 May 2018 08:20:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 117426ECD8 for ; Fri, 18 May 2018 09:46:32 +0000 (UTC) Received: by mail-pl0-x243.google.com with SMTP id e6-v6so4276493plt.11 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=pAUKZ9YUQvvM5kHpew5VHaeW32U43EXhjoud7kMcAkpmlVywygJIsu66ioiqR7ZQ94 yF/3rRIP0sxqg4DnpYwease8vpDv7w0WUcWRgyb9fN04ACKYmheyOs6JY07cyHjHMcr2 iUcUdLl33/gp6Jy0RYJ5cc9wdofP/SkfF8GuQLwSW+UUAu9568kLFLlZsmkC0JGLBUij ixr8Y0dDDjUFrNuIcuHqkT3mRLhdSST8iKXBxKog4m8bMW+xy7d+S6wvLaSFZAqGAMTi 6Eyfm+Gq6//rWmZEzbnr0VbP7on6gEWUzZoPosv4YKpDGo8HLT5VQ0pg//YRQgborVwB d2aw== X-Gm-Message-State: ALKqPwexNfliAv1/UR7+FkahEVh6L5HnYwWcpt63vCVPeX9GnBvSy+yl WonC+JJJuzXD1GarpFD8noUexA== 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-Mailman-Approved-At: Mon, 21 May 2018 08:18:09 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 {