From patchwork Fri Apr 21 08:38:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 9692165 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 420AD60328 for ; Fri, 21 Apr 2017 08:43:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37A2028617 for ; Fri, 21 Apr 2017 08:43:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B91428619; Fri, 21 Apr 2017 08:43:33 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 B439128617 for ; Fri, 21 Apr 2017 08:43:32 +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=8NJdm2kL6oeWjA61W1GVG4dBGV1dxxSFzm5Cs+lNtvo=; b=XDXqyo6ndhJgRRtbU9QsCETTFJ SjgLOHQqTyhKJC54ykIjt4CsZJJpbVDdzsiIzejsHzrM7w1ke02Uj3KAc5jD5AOQmsudMztw9YaJo RJwBx01ZPsoHjtzqwgfuip4YBziqN/PY1ZtlVfUm1eMbeqZuJbrIhawRPdnXCTs8yr022fyqSGZfE l+OZHpFU3Z3CpDzzmkk2QRYsGgI6Ne6a7K+55zq1mxx45Du4m2o5Ji9DEW0CVnCw58uEmSG2kr+R1 to27LCtbEMH7yKmc3FJafGmkH+12LY617vZT5ucFCObqGiSkVNeWbPqTOBpDDD0tcdUTF4vabFimR uMIKFn7w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d1UA7-0004zz-D1; Fri, 21 Apr 2017 08:43:31 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d1U87-0002yc-L4 for linux-arm-kernel@bombadil.infradead.org; Fri, 21 Apr 2017 08:41:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=coO7hqqnzUaZjwmjP9en3kZqMzYhdQkvEjCEWbRdtWs=; b=AMcAQevp2eM7dBDH74r6MXBG7 1boWfD5H+t+TppScOkOAwa0yp5hoopqtkyR6G/YlY2JK2sE/6FazBGg/CasUjvZJ80W/yjlrYe4DV 87O+XNHeIi4/OwQIwxssNYRSex4ptaNcI6SCSsMcDfetTnBKn8/5/FOeufBI7et7kCBExwLiCLUAz S2n7QuB2pZ/yDXMUA122I7k5pTxoHyyOtSvcSGW5d/jcGdLl5eSmiuYjxDunc8/i01p0R50J8v+yx HF4AxxvLA+wnCkyOr6VicE9A1ztDzl6NGKKbp1cu/+az5geEcvYAjAObR3wQaQXH+GVkUwEu2BClZ 6GqGuJDWQ==; Received: from mirror2.csie.ntu.edu.tw ([140.112.30.76] helo=wens.csie.org) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d1U85-0005Wd-8I for linux-arm-kernel@lists.infradead.org; Fri, 21 Apr 2017 08:41:26 +0000 Received: by wens.csie.org (Postfix, from userid 1000) id 673C75FDE8; Fri, 21 Apr 2017 16:38:58 +0800 (CST) From: Chen-Yu Tsai To: Maxime Ripard , David Airlie , Rob Herring , Mark Rutland Subject: [PATCH v2 7/9] drm/sun4i: tcon: Copy ID from associated backend Date: Fri, 21 Apr 2017 16:38:55 +0800 Message-Id: <20170421083857.29636-8-wens@csie.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170421083857.29636-1-wens@csie.org> References: <20170421083857.29636-1-wens@csie.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170421_044125_902176_9DBA059D X-CRM114-Status: GOOD ( 10.49 ) 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: devicetree@vger.kernel.org, linux-sunxi@googlegroups.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org 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 The tcons and backends have a one-to-one relationship. Their IDs, or indexes in the documentation, are also the same. Copy the ID from the associated backend and save it in the tcon structure. This will later be used when we add support for the output data path muxes. Signed-off-by: Chen-Yu Tsai --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 1 + drivers/gpu/drm/sun4i/sun4i_tcon.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index 4409e7b6c74d..8301389c411d 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -540,6 +540,7 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, dev_set_drvdata(dev, tcon); tcon->drm = drm; tcon->dev = dev; + tcon->id = backend->id; tcon->quirks = of_device_get_match_data(dev); tcon->lcd_rst = devm_reset_control_get(dev, "lcd"); diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.h b/drivers/gpu/drm/sun4i/sun4i_tcon.h index 1bda4d183eec..d37e1e2ed60e 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.h +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.h @@ -174,6 +174,8 @@ struct sun4i_tcon { /* Associated crtc */ struct sun4i_crtc *crtc; + int id; + /* TCON list management */ struct list_head list; };