From patchwork Fri Feb 16 11:25:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 128541 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp453447ljc; Fri, 16 Feb 2018 03:25:30 -0800 (PST) X-Google-Smtp-Source: AH8x2249XyqqZ+7sl2mYaGS1Iqnpn6TsNvt0I0RFgHlcsomTW2br2VKt2D3kF0m4UG8UzI1F3CF3 X-Received: by 2002:a17:902:a985:: with SMTP id bh5-v6mr5543593plb.230.1518780329914; Fri, 16 Feb 2018 03:25:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518780329; cv=none; d=google.com; s=arc-20160816; b=A5BpwmAHsNvgExbhM3fK1ZX4q25AJRHJd33KssZWv/x1+lywE16JwwxBDQyin8Mck8 dJfC+UsJJblAQpWd4PYgt/MkiBanospQEHUvM8+UpgadERBQ3xP5ta/X1dBWaVdtUqFw Un40huDPa2ZQYzLSQL7D0YyGaLStgNecQVi5mEdJEO4Mpiod4/wnDZ99I9kxeeqblsR1 6+7bkLzqcdeFHSPk1paCK9rUrxdXIZTxyUgpWPfE+HRsgkCFpZSIm1C8HW9l3QbhTyN3 96u7T1YEi1wH7yfsF7kylf/msSWqGNat/r7kw/pp9aHGvFXE+kylSHA9cZTJxmSDGntx MUEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=ISO+AS+2OSsSMOsMkHq12vBY2a/iCyZmpU8ZLXNkIW0=; b=EfzWYlBkl6YlNeCyKXZAa2dko8fmjT0HhZecPp/QwP5P3FDNZa+TMR+nFUqxHx08aZ e6NRpv5gBiumORrI0+CVvdE06ElQsRWHPcMJJgCrpMU6vIrcWuDWWmO5HkACWdm+hGF9 BHXehtDrXl1Baul0m6Ki8UjI55TLo+EffwiZA/TxgFXIYJXdbpfa7mIVmZQgLzn1MLCw YRIZbT/quEMUKqNrHXv6e1QqHRnZVtLf9obX4JA5oPUXKzXOmvg/yMkngvoWpUPxmUhx LCElaIiI2WgLGmyFKtyEysRDy6m2omUmVzqgjqfEXkawegiXbH5XV/h6b0QEfWL2pCjE UqUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=TvG1zJIR; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id y14si3114985pfl.356.2018.02.16.03.25.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2018 03:25:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=TvG1zJIR; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 848346E618; Fri, 16 Feb 2018 11:25:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelnx194.ext.ti.com (lelnx194.ext.ti.com [198.47.27.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id 329F06E616 for ; Fri, 16 Feb 2018 11:25:24 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w1GBPLbA018181; Fri, 16 Feb 2018 05:25:21 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1518780321; bh=jk/3oyia8x5DU/Yq40VJBzaAgrEQqR32P7pSkdsxUnI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=TvG1zJIRIyMrnXWbSTVNU9XPDBpYUEEFjo3+EP+N2drRpXPh5Ldhoq8gICwPLGd3r seRzQ604ll3tIZwpyYaZxA5Y92dqoRhPHv6s4RhjHM6yXA0Vt1bXfjfPT0Y1cFjXHl fp1xWYQK/B0mq2X2Rk/QA9CHxVko1VYlB+2NMEOk= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1GBPLvO003661; Fri, 16 Feb 2018 05:25:21 -0600 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Fri, 16 Feb 2018 05:25:21 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Fri, 16 Feb 2018 05:25:21 -0600 Received: from jadmar.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1GBPCih028841; Fri, 16 Feb 2018 05:25:20 -0600 From: Jyri Sarha To: , , Subject: [PATCH RFC 5/9] drm/omap: move common stuff from dss.h to omapdss.h Date: Fri, 16 Feb 2018 13:25:06 +0200 Message-ID: <45b04d201270b47cc790c3994ea7edb820a152d6.1518780268.git.jsarha@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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: Jyri Sarha Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The new DSS6 driver needs some structs and defines which are currently in dss.h, which is for the old DSS driver. Move the required structs and defines from dss.h to omapdss.h. Signed-off-by: Tomi Valkeinen Signed-off-by: Jyri Sarha --- drivers/gpu/drm/omapdrm/dss/dss.h | 41 ++--------------------------------- drivers/gpu/drm/omapdrm/dss/omapdss.h | 37 +++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dss.h b/drivers/gpu/drm/omapdrm/dss/dss.h index 434262a..fa206ca 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.h +++ b/drivers/gpu/drm/omapdrm/dss/dss.h @@ -70,14 +70,6 @@ struct seq_file; pr_warn("omapdss: " format, ##__VA_ARGS__) #endif -/* OMAP TRM gives bitfields as start:end, where start is the higher bit - number. For example 7:0 */ -#define FLD_MASK(start, end) (((1 << ((start) - (end) + 1)) - 1) << (end)) -#define FLD_VAL(val, start, end) (((val) << (end)) & FLD_MASK(start, end)) -#define FLD_GET(val, start, end) (((val) & FLD_MASK(start, end)) >> (end)) -#define FLD_MOD(orig, val, start, end) \ - (((orig) & ~FLD_MASK(start, end)) | FLD_VAL(val, start, end)) - enum dss_model { DSS_MODEL_OMAP2, DSS_MODEL_OMAP3, @@ -86,12 +78,6 @@ enum dss_model { DSS_MODEL_DRA7, }; -enum dss_io_pad_mode { - DSS_IO_PAD_MODE_RESET, - DSS_IO_PAD_MODE_RFBI, - DSS_IO_PAD_MODE_BYPASS, -}; - enum dss_hdmi_venc_clk_source_select { DSS_VENC_TV_CLK = 0, DSS_HDMI_M_PCLK = 1, @@ -215,34 +201,11 @@ struct dss_reg_field { u8 start, end; }; -struct dispc_clock_info { - /* rates that we get with dividers below */ - unsigned long lck; - unsigned long pck; - - /* dividers */ - u16 lck_div; - u16 pck_div; -}; - -struct dss_lcd_mgr_config { - enum dss_io_pad_mode io_pad_mode; - - bool stallmode; - bool fifohandcheck; - - struct dispc_clock_info clock_info; - - int video_port_width; - - int lcden_sig_polarity; -}; - -#define DSS_SZ_REGS SZ_512 +#define DSS_SZ_REGS SZ_512 struct dss_device { struct platform_device *pdev; - void __iomem *base; + void __iomem *base; struct regmap *syscon_pll_ctrl; u32 syscon_pll_ctrl_offset; diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 493237e..9d789c2 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -647,6 +647,43 @@ static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev) struct omap_dss_device * omapdss_of_find_source_for_first_ep(struct device_node *node); +/* OMAP TRM gives bitfields as start:end, where start is the higher bit + number. For example 7:0 */ +#define FLD_MASK(start, end) (((1 << ((start) - (end) + 1)) - 1) << (end)) +#define FLD_VAL(val, start, end) (((val) << (end)) & FLD_MASK(start, end)) +#define FLD_GET(val, start, end) (((val) & FLD_MASK(start, end)) >> (end)) +#define FLD_MOD(orig, val, start, end) \ + (((orig) & ~FLD_MASK(start, end)) | FLD_VAL(val, start, end)) + +enum dss_io_pad_mode { + DSS_IO_PAD_MODE_RESET, + DSS_IO_PAD_MODE_RFBI, + DSS_IO_PAD_MODE_BYPASS, +}; + +struct dispc_clock_info { + /* rates that we get with dividers below */ + unsigned long lck; + unsigned long pck; + + /* dividers */ + u16 lck_div; + u16 pck_div; +}; + +struct dss_lcd_mgr_config { + enum dss_io_pad_mode io_pad_mode; + + bool stallmode; + bool fifohandcheck; + + struct dispc_clock_info clock_info; + + int video_port_width; + + int lcden_sig_polarity; +}; + struct device_node *dss_of_port_get_parent_device(struct device_node *port); u32 dss_of_port_get_port_number(struct device_node *port);