From patchwork Wed Feb 13 08:59:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 10809361 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5075714E1 for ; Wed, 13 Feb 2019 09:00:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C52A2C976 for ; Wed, 13 Feb 2019 09:00:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A2642C97B; Wed, 13 Feb 2019 09:00:46 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham 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 A9C3C2C976 for ; Wed, 13 Feb 2019 09:00:45 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: 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=NQGbAyQZgmLfDO/8Fi0MlhL+mXnROVSnhbE+ITHe5Zo=; b=B3HiKWDuUzloWM Q1MOlWwk9YLfVGF3L+u6PFA103CSK+0UN1liGPC42Q1cjh4omhLZzsc4vqu1pxCDZ8mcjTFiK966S 3xvDrXOycjmHrXuG2fZVvzK4ZzKlveZVDgh4gspvMw/TKXNoYzhvuolXSZiRGHib8RSRo36EuHF6I Cio05AfitIcljiXWctLuUWS4+kZdl8l8Ofc30jqs6EHDm9e+9XVJUYLfdQzqiId6XZdu1yiRSFCBI DVsaElvgMTI9nQJbF5cP7uZMDW4vwriCwJV/O4i9Dt06HcjghvkHDXfTgIDEPbr27mv8JfBFrDJrF l2af4iQqSPS6PTWDYpSA==; 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 1gtqPG-0007Sp-Oi; Wed, 13 Feb 2019 09:00:38 +0000 Received: from esa6.microchip.iphmx.com ([216.71.154.253]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gtqOV-0005Hm-Mr; Wed, 13 Feb 2019 08:59:55 +0000 X-IronPort-AV: E=Sophos;i="5.58,365,1544511600"; d="scan'208";a="23778136" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Feb 2019 01:59:51 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.105) with Microsoft SMTP Server (TLS) id 14.3.352.0; Wed, 13 Feb 2019 01:59:50 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Hc4nV9jdLKYNjIUT+gRpNFusDLGZhRyZ8ciEoFGPcx0=; b=OQymV7ckweMKp+j8tid0b2UoC/XDJpijDFAt3zyxeJVFQiWdqsj361CQuuIKLf9vqx3E2RpUEl5qCwWcZlZbqAql44j/aT+s0TNf2gX6xK1FCyQUiflzAoYt7O69kYtA5JPbHh2BekE+pH5sXTpV26CagcClYwXagHoUJkLW03k= Received: from BN6PR11MB1842.namprd11.prod.outlook.com (10.175.98.146) by BN6PR11MB0019.namprd11.prod.outlook.com (10.161.155.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Wed, 13 Feb 2019 08:59:48 +0000 Received: from BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f]) by BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f%8]) with mapi id 15.20.1601.023; Wed, 13 Feb 2019 08:59:48 +0000 From: To: , , , , , , , , , , , Subject: [PATCH 02/11] memory: atmel-ebi: add generic name for ebi regmap Thread-Topic: [PATCH 02/11] memory: atmel-ebi: add generic name for ebi regmap Thread-Index: AQHUw3p49S/sYBbl10WTjl6hIGDc8A== Date: Wed, 13 Feb 2019 08:59:48 +0000 Message-ID: <20190213085930.31578-3-tudor.ambarus@microchip.com> References: <20190213085930.31578-1-tudor.ambarus@microchip.com> In-Reply-To: <20190213085930.31578-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR08CA0085.eurprd08.prod.outlook.com (2603:10a6:800:d3::11) To BN6PR11MB1842.namprd11.prod.outlook.com (2603:10b6:404:101::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tudor.Ambarus@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.9.5 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ae6e05dd-e7e6-40c8-ef9f-08d691919b13 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020); SRVR:BN6PR11MB0019; x-ms-traffictypediagnostic: BN6PR11MB0019: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; BN6PR11MB0019; 23:557XpDeJbzlhl/SeyL9HDqRRS80Xvci+V6bqinC?= =?iso-8859-1?q?oCwpWXF6bKiFV3s?= =?iso-8859-1?q?OD9aO9kDjdBCngbtnkzm3L80tesAErSbPhByIpbYk+fNppboWGXgVYhhgU7d?= =?iso-8859-1?q?xnc+C+rxiaFaziDHFKKshZCmJa6CXFHDKsuowLN5SCEigv4kCWrzP3BaQNqN?= =?iso-8859-1?q?TIjGyCPQs5ZpR8kn+8ZPsdZz0OzvLfrVVcnPVcB/NILJhfwuNKqDyE+e9aV7?= =?iso-8859-1?q?Ueri5vfq+6ansD4ROuHvYtcOnZ/DIwkx/vNslpZoI1YN1EKZJ6GWEqzoXfyr?= =?iso-8859-1?q?rmoHj/AHtbXfYU7kZdvY0C/0mTv3hnjXPK+vwWQKs9EXXkWJIAKhUVta8oJF?= =?iso-8859-1?q?VjutJ+xyLcmll/cwzOgNYS9ZuRBaEVB+IqvczZ9ngzB8KHbfQcIlChbP5qeF?= =?iso-8859-1?q?gXuHKmQbRrZxuncMQjsene0X2SNskrGBC2rSbn6aeDh0Y6NDfkfBOIGPzgvy?= =?iso-8859-1?q?Ox2jyXPWHTUL0q/fD2FCANR1yo2fD9GucYungafDRVU4HxJfeWKGc4WAlCjL?= =?iso-8859-1?q?ka9l3NW22c7+kn2EFfF/BXScmyN5lxix4IZGZ2kgAhyo1G+ybMQhpnee3Dwv?= =?iso-8859-1?q?KxRdmka+EiBJZu0NsNxYD2P56bGcbPNZ/dxWDyqVgcH/+z/4DdgWmjyb1IZx?= =?iso-8859-1?q?tROyGJV3XQi59LZYJZ4IVpEg6J7Hp+I/BeeDBc3gsbN9Bgu5pRZoRga3GxG3?= =?iso-8859-1?q?WwokVuEkwGb8gH5/2Biq5eoir4n3LHgZ+WoX8QmpUWPEip5M3cBDks6xWPsr?= =?iso-8859-1?q?V5l/0tNcvJ/q469gOYN1scseswZQ+fWoatBHkrAEw0rMDalgQSigRDCdq3YE?= =?iso-8859-1?q?Hgv0Frkwg8oSQSHFOz6zN7ponRm7AsQKwUn/nQ+Jr8YHi5WvZyFAVj7pZrIr?= =?iso-8859-1?q?Mm+3KnmB6IU7TffZzt8FyofuHaZgb0w0sM/jw2/U9NwqaUEeqzfgiUrkLyan?= =?iso-8859-1?q?161jlSLWnGZTZTSXG5Z/4ByCceptFK0VBiIN+i/r/z8QMQSYFkAt49AWIHtr?= =?iso-8859-1?q?087X9bCHRjEYMKancDE5ns/rbKubqgH/Eih9qaRM57ovOaLQdi0R+RsyFwrf?= =?iso-8859-1?q?uoH736lm4rE4gCWL/+xzn/mt33oYw6Sudcb8I2R9q55eR08ithKRM909PL1U?= =?iso-8859-1?q?FLHDKhQvpHQXxcOW8L1qtBMJOAevJmQ4pLrYSjnwkjgd9VhkTmUq0PSrgCNJ?= =?iso-8859-1?q?rf1rGC3hiOyFeuCm01GcljKoxOYVtrpMJJIVNBvoLj34aHJ1EDqlM9e3Ong6?= =?iso-8859-1?q?c64iJMt3m9os/NyUHYQwPHls3KDYl+WMwVvWZSn/MyYwPMjN4tBjWewUcCQc?= =?iso-8859-1?q?pczjehuH2lCvSlPdeGDT5IPvEWYs6zjMnq9JxXUEsgO7xSFLerRA=3D=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 094700CA91 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(366004)(136003)(376002)(39860400002)(189003)(199004)(81166006)(50226002)(106356001)(7416002)(6436002)(54906003)(2201001)(1076003)(81156014)(26005)(110136005)(476003)(102836004)(107886003)(8936002)(6512007)(6486002)(4326008)(446003)(2616005)(316002)(8676002)(105586002)(99286004)(66066001)(486006)(6116002)(3846002)(186003)(11346002)(86362001)(2906002)(72206003)(71190400001)(14454004)(76176011)(53936002)(71200400001)(478600001)(68736007)(6506007)(386003)(2501003)(52116002)(97736004)(14444005)(7736002)(305945005)(256004)(25786009)(36756003)(41533002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR11MB0019; H:BN6PR11MB1842.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 9IhWswPpxidizIm7BL911oEu48ryQUJdhvfB1rQp94+beokjqxVT+EsFRKqDRIOgKW4e3F78KorxMF6V07VgUnIWvuqnOTIyI8jvQ6Vf18tiSNq2eGOiFcxfGTjVWnaR2mnXn74y1drIOGmlHaVgBJzBuM3I2wIaZoq/FjxBeUuk507YZ5KnsFkunM/eLhYXD9LXbqoAvUXGSGPysiaCCzqMoMXavFIozB2AKKcYiR1Tu99x029Id9F81D3BWphqCpQisqgPINjdTFfQdwAR4z3duBgVh9Y9PpkeiuC7DSAzePUMsuhQ00LNUZJEFs4U/uWfk5c42KmCGTsf3G7olz1UQ7EQGNH6SnkWPjR71IIY7eyRmpdHTRQwTX6+fIW4npIxTJ4R/TgdSyu8/Mk5pXDADsYTHK9bd+B47fq2OAM= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ae6e05dd-e7e6-40c8-ef9f-08d691919b13 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Feb 2019 08:59:45.2083 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB0019 X-OriginatorOrg: microchip.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190213_005952_111393_BBBC386B X-CRM114-Status: GOOD ( 14.03 ) 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tudor.Ambarus@microchip.com 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: Tudor Ambarus The sam9x60 board defines the CCFG_EBICSA register under SFR, and not as a MATRIX register, as previous boards do. Add a more generic name for the EBI regmap as a prerequisite for sam9x60 ebi support. Signed-off-by: Tudor Ambarus Acked-by: Alexandre Belloni --- drivers/memory/atmel-ebi.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c index c3748b414c27..b45914cfa212 100644 --- a/drivers/memory/atmel-ebi.c +++ b/drivers/memory/atmel-ebi.c @@ -36,6 +36,7 @@ struct atmel_ebi_dev { struct atmel_ebi_caps { unsigned int available_cs; unsigned int ebi_csa_offs; + const char *regmap_name; void (*get_config)(struct atmel_ebi_dev *ebid, struct atmel_ebi_dev_config *conf); int (*xlate_config)(struct atmel_ebi_dev *ebid, @@ -47,7 +48,7 @@ struct atmel_ebi_caps { struct atmel_ebi { struct clk *clk; - struct regmap *matrix; + struct regmap *regmap; struct { struct regmap *regmap; struct clk *clk; @@ -357,7 +358,7 @@ static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np, * one "atmel,smc-" property is present. */ if (ebi->caps->ebi_csa_offs && apply) - regmap_update_bits(ebi->matrix, + regmap_update_bits(ebi->regmap, ebi->caps->ebi_csa_offs, BIT(cs), 0); @@ -372,6 +373,7 @@ static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np, static const struct atmel_ebi_caps at91sam9260_ebi_caps = { .available_cs = 0xff, .ebi_csa_offs = AT91SAM9260_MATRIX_EBICSA, + .regmap_name = "atmel,matrix", .get_config = at91sam9_ebi_get_config, .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, @@ -380,6 +382,7 @@ static const struct atmel_ebi_caps at91sam9260_ebi_caps = { static const struct atmel_ebi_caps at91sam9261_ebi_caps = { .available_cs = 0xff, .ebi_csa_offs = AT91SAM9261_MATRIX_EBICSA, + .regmap_name = "atmel,matrix", .get_config = at91sam9_ebi_get_config, .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, @@ -388,6 +391,7 @@ static const struct atmel_ebi_caps at91sam9261_ebi_caps = { static const struct atmel_ebi_caps at91sam9263_ebi0_caps = { .available_cs = 0x3f, .ebi_csa_offs = AT91SAM9263_MATRIX_EBI0CSA, + .regmap_name = "atmel,matrix", .get_config = at91sam9_ebi_get_config, .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, @@ -396,6 +400,7 @@ static const struct atmel_ebi_caps at91sam9263_ebi0_caps = { static const struct atmel_ebi_caps at91sam9263_ebi1_caps = { .available_cs = 0x7, .ebi_csa_offs = AT91SAM9263_MATRIX_EBI1CSA, + .regmap_name = "atmel,matrix", .get_config = at91sam9_ebi_get_config, .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, @@ -404,6 +409,7 @@ static const struct atmel_ebi_caps at91sam9263_ebi1_caps = { static const struct atmel_ebi_caps at91sam9rl_ebi_caps = { .available_cs = 0x3f, .ebi_csa_offs = AT91SAM9RL_MATRIX_EBICSA, + .regmap_name = "atmel,matrix", .get_config = at91sam9_ebi_get_config, .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, @@ -412,6 +418,7 @@ static const struct atmel_ebi_caps at91sam9rl_ebi_caps = { static const struct atmel_ebi_caps at91sam9g45_ebi_caps = { .available_cs = 0x3f, .ebi_csa_offs = AT91SAM9G45_MATRIX_EBICSA, + .regmap_name = "atmel,matrix", .get_config = at91sam9_ebi_get_config, .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, @@ -420,6 +427,7 @@ static const struct atmel_ebi_caps at91sam9g45_ebi_caps = { static const struct atmel_ebi_caps at91sam9x5_ebi_caps = { .available_cs = 0x3f, .ebi_csa_offs = AT91SAM9X5_MATRIX_EBICSA, + .regmap_name = "atmel,matrix", .get_config = at91sam9_ebi_get_config, .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, @@ -543,13 +551,14 @@ static int atmel_ebi_probe(struct platform_device *pdev) /* * The sama5d3 does not provide an EBICSA register and thus does need - * to access the matrix registers. + * to access it. */ if (ebi->caps->ebi_csa_offs) { - ebi->matrix = - syscon_regmap_lookup_by_phandle(np, "atmel,matrix"); - if (IS_ERR(ebi->matrix)) - return PTR_ERR(ebi->matrix); + ebi->regmap = + syscon_regmap_lookup_by_phandle(np, + ebi->caps->regmap_name); + if (IS_ERR(ebi->regmap)) + return PTR_ERR(ebi->regmap); } ret = of_property_read_u32(np, "#address-cells", &val);