Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp232972pxb; Mon, 7 Feb 2022 10:00:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJygBFbqwN4yj/PMaMCJ9nvxElgEkSAfGeWebK0mTxlTp1Oj0yjaGY7mX/MoHty826GCl6P3 X-Received: by 2002:a17:90b:4a41:: with SMTP id lb1mr82456pjb.151.1644256854935; Mon, 07 Feb 2022 10:00:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644256854; cv=none; d=google.com; s=arc-20160816; b=K2SLyYXzSMPzs4+JCIn7ywwSD85sR7/FtZU3HBg27QDAzsmg/B76OHEjQc/yLeaMVT i8bQTFEP0yG3CblWI6lh/CS8PcCGBIx0BNRGl4UsAUKeR1fnZNzsn9W5SDtpoCFWptlH fH1znmCIc0iz7VIyj0ejmtalCVMAb/sjlbu9PiOYe4Z2NGb+MDTJE/k/2wkUuyCaRvU5 OwMnjFr4r8IdcfimUN4bthZT+fmxNiz2ciJt1FO6M633LQbxeowsWLMzR+ur3DokZWdT rqyKC9H6yEY3zbSr3xc8R4/7xwoBSJ+8q7UwnXhjvFSus61Bt6Fun09aVL4ZzwLbI8d/ iiBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Mkmqidx/oPx8b5KIx4I1UJMvTrD2DJPEkqRTiAlWLI4=; b=wRCkgKl97cliu8zJ+C5/HRccNTBxtCN4cOSFZw3j1lSQWfVdVogfuQFsTlPsx0FSER B1RQOWCBgX2ACzRnApfwdQlXJgDkpKT0a2Kr2QfOnstR9QPrBH0W7GftqcHHyY50t6WI US40ZD3J0k5dkg54PW3OkfEeuV4RVklhuZm+p/rDJ6cLtZz0PJixX0+UjuVL7UMRceV9 SY6C0VBfAOI6+/SNAhJfniBzoo0sYG+XunLAATo5BFTkF/Wxek+Yi6GA0i3Oh/tC2hA9 o+57L4siKJVhoES1IZtdDlN2b/uFfHI/BTxSVjT+6jf0pojbkM7AmMD9rkhKWcwdR85x 0vzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=pL2NRA8p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 66si10456080pgc.688.2022.02.07.10.00.42; Mon, 07 Feb 2022 10:00:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=pL2NRA8p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345852AbiBBQbf (ORCPT + 99 others); Wed, 2 Feb 2022 11:31:35 -0500 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.81]:38747 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240502AbiBBQbe (ORCPT ); Wed, 2 Feb 2022 11:31:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1643819486; s=strato-dkim-0002; d=goldelico.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=Mkmqidx/oPx8b5KIx4I1UJMvTrD2DJPEkqRTiAlWLI4=; b=pL2NRA8pXXHDB9Nt2XfJb3F8d70/vsHsVl305JGQgqdxFXQ44Hqh7DhfnQxlBm2Ri7 FquQKsQat4TI1GATIxL+r2viAXnYR2234qb7ajMu5Wf5HEGHiCY+HjZLRiqzZ8RPeDMJ O7YScEpziwabQvs5WHkFw68dlEvoOXAfxyKRt8FVQ+t7bCeimUwqImiXvFsB03HA6Ew/ CwHqfHVr+pL0JZzPKjdwPD2pbpfYOuHW7r9xnKGMAlcSin0rghdSYTU45ZRTQ+bLyByF 5Jf8MOpjIlN9+HpLsZINMI+Zu2esrLIR0ExkwMXQMLi0RoCWYK3K2DGTJh6lCuFAAXBE 1KxA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o1OAA2UMf2MwPVbjc9Y=" X-RZG-CLASS-ID: mo00 Received: from iMac.fritz.box by smtp.strato.de (RZmta 47.39.0 DYNA|AUTH) with ESMTPSA id L29417y12GVPBmj (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 2 Feb 2022 17:31:25 +0100 (CET) From: "H. Nikolaus Schaller" To: Paul Cercueil , Rob Herring , Mark Rutland , Thomas Bogendoerfer , "H. Nikolaus Schaller" , Geert Uytterhoeven , Kees Cook , "Eric W. Biederman" , Miquel Raynal , David Airlie , Daniel Vetter , Neil Armstrong , Robert Foss , Laurent Pinchart , Jernej Skrabec , Harry Wentland , Sam Ravnborg , Maxime Ripard , Hans Verkuil , Liam Girdwood , Mark Brown , Paul Boddie , Andrzej Hajda , Kieran Bingham Cc: devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, Jonas Karlman , dri-devel@lists.freedesktop.org Subject: [PATCH v13 1/9] drm/ingenic: prepare ingenic drm for later addition of JZ4780 Date: Wed, 2 Feb 2022 17:31:15 +0100 Message-Id: <1195fd6c18a8a68209709656f38745db0e5c3389.1643819482.git.hns@goldelico.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This changes the way the regmap is allocated to prepare for the later addition of the JZ4780 which has more registers and bits than the others. Therefore we make the regmap as big as the reg property in the device tree tells. Suggested-by: Paul Cercueil Signed-off-by: H. Nikolaus Schaller --- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index b4943a56be09b..9c60fc4605e4b 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -173,7 +173,6 @@ static const struct regmap_config ingenic_drm_regmap_config = { .val_bits = 32, .reg_stride = 4, - .max_register = JZ_REG_LCD_SIZE1, .writeable_reg = ingenic_drm_writeable_reg, }; @@ -1011,6 +1010,8 @@ static int ingenic_drm_bind(struct device *dev, bool has_components) struct ingenic_drm_bridge *ib; struct drm_device *drm; void __iomem *base; + struct resource *res; + struct regmap_config regmap_config; long parent_rate; unsigned int i, clone_mask = 0; int ret, irq; @@ -1056,14 +1057,16 @@ static int ingenic_drm_bind(struct device *dev, bool has_components) drm->mode_config.funcs = &ingenic_drm_mode_config_funcs; drm->mode_config.helper_private = &ingenic_drm_mode_config_helpers; - base = devm_platform_ioremap_resource(pdev, 0); + base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(base)) { dev_err(dev, "Failed to get memory resource\n"); return PTR_ERR(base); } + regmap_config = ingenic_drm_regmap_config; + regmap_config.max_register = res->end - res->start; priv->map = devm_regmap_init_mmio(dev, base, - &ingenic_drm_regmap_config); + ®map_config); if (IS_ERR(priv->map)) { dev_err(dev, "Failed to create regmap\n"); return PTR_ERR(priv->map); -- 2.33.0