From patchwork Mon Feb 20 17:22:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris BREZILLON X-Patchwork-Id: 9583395 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 2245B6047C for ; Mon, 20 Feb 2017 17:27:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A2EE28549 for ; Mon, 20 Feb 2017 17:27:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E0FE287C7; Mon, 20 Feb 2017 17:27: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=unavailable 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 7BCE228549 for ; Mon, 20 Feb 2017 17:27: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=/9nBoGwwiCIp7SNgaMtDcj+UrUAx/CkH3E9Qm0XxkaU=; b=bAHvNpcVSXXtUEPNZmOkA/wH/2 dujuA2r8fJ/BbusnSYqhhkVAOPejCMoohlnttGmDyJYQK3W++pOB+pYiw6n9iQh0VHSBLqgcXOd4i w/H5Lu9l0qQwBGDtyqz1ia1wCAMUOBAH9sovj2KtkqCvqfETPqQmO0OH/V6Lg47jbIU5KpNfiEljN pwwMn6SJLut9DqdmiggU2AbRTUFjuK8sWuxAbtW3iPwie6P91EcO5Ibw/ZGGsv5cvtkxk0c1sWw1X HVBf7fQl+hVWljqQMXQWAeBpw1UNju2QWcCK7UqV4KSICY0W5LpvfjfjF6MvvBs3QCrZfVFJ0M2HT 8VQ/U36Q==; 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 1cfrkI-0007pk-QN; Mon, 20 Feb 2017 17:27:30 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cfrfd-0003CI-GG; Mon, 20 Feb 2017 17:22:41 +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=7tjeMm3/Zsx5AkbyzVkvULI3FD2PIRkLj92wZ6DyGPs=; b=ABzXucK4A5fPDwtitsqeT93Uy D0aHHHws4q6PUC1dNsvszWYShinYrxdI2wm5F8Yt4KKYpGQfcuK9wht6tFIeTRDm5WdM1kdjqL5Wg jB4L2TXY1ZzU6oOnqw7ptZ1xmCbtgQfqkWFOVUc4dM7ITqq6zZvbQNGcVWajFaU6unx/b1Bgb8yCx TskmIHD+aG9UoUzFPeQmKaO/KGX4+34GBUdR++lXhbDJGUct13T7FkODtnMAAFWs6tluK3zUF1bgZ 99uoNRZn0EChqn7BI66us727M0JtWJ7wpIF7J7WfLcpEuXv0drJMcT/3ClJoo/DoQfJtPWD8GBEc2 6yD9VSyPg==; Received: from mail.free-electrons.com ([62.4.15.54]) by merlin.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cfrfa-0004dO-90; Mon, 20 Feb 2017 17:22:39 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id B21622077D; Mon, 20 Feb 2017 18:22:16 +0100 (CET) Received: from bbrezillon.home (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 57DED207C0; Mon, 20 Feb 2017 18:22:06 +0100 (CET) From: Boris Brezillon To: Boris Brezillon , Richard Weinberger , linux-mtd@lists.infradead.org, Sascha Hauer , Sergio Prado , Marc Gonzalez , Wenyou Yang , Josh Wu Subject: [RESEND PATCH 1/3] memory: atmel-ebi: Change naming scheme Date: Mon, 20 Feb 2017 18:22:00 +0100 Message-Id: <1487611322-12688-2-git-send-email-boris.brezillon@free-electrons.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487611322-12688-1-git-send-email-boris.brezillon@free-electrons.com> References: <1487611322-12688-1-git-send-email-boris.brezillon@free-electrons.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170220_122238_534739_7C63D67E X-CRM114-Status: GOOD ( 18.33 ) 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: linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Marek Vasut , Cyrille Pitchen , Brian Norris , David Woodhouse , 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 EBI block is not only available on at91 SoCs, but also on avr32 ones. Change the structure and function prefixes from at91_ebi to atmel_ebi to match this fact and make the prefix and driver name consistent. Signed-off-by: Boris Brezillon --- drivers/memory/atmel-ebi.c | 120 ++++++++++++++++++++++----------------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c index 6b3c9fc7a602..833af8d02424 100644 --- a/drivers/memory/atmel-ebi.c +++ b/drivers/memory/atmel-ebi.c @@ -18,34 +18,34 @@ #include #include -struct at91_ebi_dev_config { +struct atmel_ebi_dev_config { int cs; struct atmel_smc_cs_conf smcconf; }; -struct at91_ebi; +struct atmel_ebi; -struct at91_ebi_dev { +struct atmel_ebi_dev { struct list_head node; - struct at91_ebi *ebi; + struct atmel_ebi *ebi; u32 mode; int numcs; - struct at91_ebi_dev_config configs[]; + struct atmel_ebi_dev_config configs[]; }; -struct at91_ebi_caps { +struct atmel_ebi_caps { unsigned int available_cs; unsigned int ebi_csa_offs; - void (*get_config)(struct at91_ebi_dev *ebid, - struct at91_ebi_dev_config *conf); - int (*xlate_config)(struct at91_ebi_dev *ebid, + void (*get_config)(struct atmel_ebi_dev *ebid, + struct atmel_ebi_dev_config *conf); + int (*xlate_config)(struct atmel_ebi_dev *ebid, struct device_node *configs_np, - struct at91_ebi_dev_config *conf); - void (*apply_config)(struct at91_ebi_dev *ebid, - struct at91_ebi_dev_config *conf); + struct atmel_ebi_dev_config *conf); + void (*apply_config)(struct atmel_ebi_dev *ebid, + struct atmel_ebi_dev_config *conf); }; -struct at91_ebi { +struct atmel_ebi { struct clk *clk; struct regmap *matrix; struct { @@ -54,7 +54,7 @@ struct at91_ebi { } smc; struct device *dev; - const struct at91_ebi_caps *caps; + const struct atmel_ebi_caps *caps; struct list_head devs; }; @@ -74,15 +74,15 @@ struct atmel_smc_timing_xlate { #define ATMEL_SMC_CYCLE_XLATE(nm, pos) \ { .name = nm, .converter = atmel_smc_cs_conf_set_setup, .shift = pos} -static void at91sam9_ebi_get_config(struct at91_ebi_dev *ebid, - struct at91_ebi_dev_config *conf) +static void at91sam9_ebi_get_config(struct atmel_ebi_dev *ebid, + struct atmel_ebi_dev_config *conf) { atmel_smc_cs_conf_get(ebid->ebi->smc.regmap, conf->cs, &conf->smcconf); } -static void sama5_ebi_get_config(struct at91_ebi_dev *ebid, - struct at91_ebi_dev_config *conf) +static void sama5_ebi_get_config(struct atmel_ebi_dev *ebid, + struct atmel_ebi_dev_config *conf) { atmel_hsmc_cs_conf_get(ebid->ebi->smc.regmap, conf->cs, &conf->smcconf); @@ -105,9 +105,9 @@ static const struct atmel_smc_timing_xlate timings_xlate_table[] = { ATMEL_SMC_CYCLE_XLATE("atmel,smc-nwe-cycle-ns", ATMEL_SMC_NWE_SHIFT), }; -static int at91_ebi_xslate_smc_timings(struct at91_ebi_dev *ebid, - struct device_node *np, - struct atmel_smc_cs_conf *smcconf) +static int atmel_ebi_xslate_smc_timings(struct atmel_ebi_dev *ebid, + struct device_node *np, + struct atmel_smc_cs_conf *smcconf) { unsigned int clk_rate = clk_get_rate(ebid->ebi->clk); unsigned int clk_period_ns = NSEC_PER_SEC / clk_rate; @@ -163,9 +163,9 @@ static int at91_ebi_xslate_smc_timings(struct at91_ebi_dev *ebid, return required; } -static int at91_ebi_xslate_smc_config(struct at91_ebi_dev *ebid, - struct device_node *np, - struct at91_ebi_dev_config *conf) +static int atmel_ebi_xslate_smc_config(struct atmel_ebi_dev *ebid, + struct device_node *np, + struct atmel_ebi_dev_config *conf) { struct atmel_smc_cs_conf *smcconf = &conf->smcconf; bool required = false; @@ -261,7 +261,7 @@ static int at91_ebi_xslate_smc_config(struct at91_ebi_dev *ebid, required = true; } - ret = at91_ebi_xslate_smc_timings(ebid, np, &conf->smcconf); + ret = atmel_ebi_xslate_smc_timings(ebid, np, &conf->smcconf); if (ret) return -EINVAL; @@ -274,27 +274,27 @@ static int at91_ebi_xslate_smc_config(struct at91_ebi_dev *ebid, return required; } -static void at91sam9_ebi_apply_config(struct at91_ebi_dev *ebid, - struct at91_ebi_dev_config *conf) +static void at91sam9_ebi_apply_config(struct atmel_ebi_dev *ebid, + struct atmel_ebi_dev_config *conf) { atmel_smc_cs_conf_apply(ebid->ebi->smc.regmap, conf->cs, &conf->smcconf); } -static void sama5_ebi_apply_config(struct at91_ebi_dev *ebid, - struct at91_ebi_dev_config *conf) +static void sama5_ebi_apply_config(struct atmel_ebi_dev *ebid, + struct atmel_ebi_dev_config *conf) { atmel_hsmc_cs_conf_apply(ebid->ebi->smc.regmap, conf->cs, &conf->smcconf); } -static int at91_ebi_dev_setup(struct at91_ebi *ebi, struct device_node *np, - int reg_cells) +static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np, + int reg_cells) { - const struct at91_ebi_caps *caps = ebi->caps; - struct at91_ebi_dev_config conf = { }; + const struct atmel_ebi_caps *caps = ebi->caps; + struct atmel_ebi_dev_config conf = { }; struct device *dev = ebi->dev; - struct at91_ebi_dev *ebid; + struct atmel_ebi_dev *ebid; unsigned long cslines = 0; int ret, numcs = 0, nentries, i; bool apply = false; @@ -366,70 +366,70 @@ static int at91_ebi_dev_setup(struct at91_ebi *ebi, struct device_node *np, return 0; } -static const struct at91_ebi_caps at91sam9260_ebi_caps = { +static const struct atmel_ebi_caps at91sam9260_ebi_caps = { .available_cs = 0xff, .ebi_csa_offs = AT91SAM9260_MATRIX_EBICSA, .get_config = at91sam9_ebi_get_config, - .xlate_config = at91_ebi_xslate_smc_config, + .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, }; -static const struct at91_ebi_caps at91sam9261_ebi_caps = { +static const struct atmel_ebi_caps at91sam9261_ebi_caps = { .available_cs = 0xff, .ebi_csa_offs = AT91SAM9261_MATRIX_EBICSA, .get_config = at91sam9_ebi_get_config, - .xlate_config = at91_ebi_xslate_smc_config, + .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, }; -static const struct at91_ebi_caps at91sam9263_ebi0_caps = { +static const struct atmel_ebi_caps at91sam9263_ebi0_caps = { .available_cs = 0x3f, .ebi_csa_offs = AT91SAM9263_MATRIX_EBI0CSA, .get_config = at91sam9_ebi_get_config, - .xlate_config = at91_ebi_xslate_smc_config, + .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, }; -static const struct at91_ebi_caps at91sam9263_ebi1_caps = { +static const struct atmel_ebi_caps at91sam9263_ebi1_caps = { .available_cs = 0x7, .ebi_csa_offs = AT91SAM9263_MATRIX_EBI1CSA, .get_config = at91sam9_ebi_get_config, - .xlate_config = at91_ebi_xslate_smc_config, + .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, }; -static const struct at91_ebi_caps at91sam9rl_ebi_caps = { +static const struct atmel_ebi_caps at91sam9rl_ebi_caps = { .available_cs = 0x3f, .ebi_csa_offs = AT91SAM9RL_MATRIX_EBICSA, .get_config = at91sam9_ebi_get_config, - .xlate_config = at91_ebi_xslate_smc_config, + .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, }; -static const struct at91_ebi_caps at91sam9g45_ebi_caps = { +static const struct atmel_ebi_caps at91sam9g45_ebi_caps = { .available_cs = 0x3f, .ebi_csa_offs = AT91SAM9G45_MATRIX_EBICSA, .get_config = at91sam9_ebi_get_config, - .xlate_config = at91_ebi_xslate_smc_config, + .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, }; -static const struct at91_ebi_caps at91sam9x5_ebi_caps = { +static const struct atmel_ebi_caps at91sam9x5_ebi_caps = { .available_cs = 0x3f, .ebi_csa_offs = AT91SAM9X5_MATRIX_EBICSA, .get_config = at91sam9_ebi_get_config, - .xlate_config = at91_ebi_xslate_smc_config, + .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, }; -static const struct at91_ebi_caps sama5d3_ebi_caps = { +static const struct atmel_ebi_caps sama5d3_ebi_caps = { .available_cs = 0xf, .get_config = sama5_ebi_get_config, - .xlate_config = at91_ebi_xslate_smc_config, + .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = sama5_ebi_apply_config, }; -static const struct of_device_id at91_ebi_id_table[] = { +static const struct of_device_id atmel_ebi_id_table[] = { { .compatible = "atmel,at91sam9260-ebi", .data = &at91sam9260_ebi_caps, @@ -465,7 +465,7 @@ static const struct of_device_id at91_ebi_id_table[] = { { /* sentinel */ } }; -static int at91_ebi_dev_disable(struct at91_ebi *ebi, struct device_node *np) +static int atmel_ebi_dev_disable(struct atmel_ebi *ebi, struct device_node *np) { struct device *dev = ebi->dev; struct property *newprop; @@ -487,17 +487,17 @@ static int at91_ebi_dev_disable(struct at91_ebi *ebi, struct device_node *np) return of_update_property(np, newprop); } -static int at91_ebi_probe(struct platform_device *pdev) +static int atmel_ebi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *child, *np = dev->of_node, *smc_np; const struct of_device_id *match; - struct at91_ebi *ebi; + struct atmel_ebi *ebi; int ret, reg_cells; struct clk *clk; u32 val; - match = of_match_device(at91_ebi_id_table, dev); + match = of_match_device(atmel_ebi_id_table, dev); if (!match || !match->data) return -EINVAL; @@ -563,12 +563,12 @@ static int at91_ebi_probe(struct platform_device *pdev) if (!of_find_property(child, "reg", NULL)) continue; - ret = at91_ebi_dev_setup(ebi, child, reg_cells); + ret = atmel_ebi_dev_setup(ebi, child, reg_cells); if (ret) { dev_err(dev, "failed to configure EBI bus for %s, disabling the device", child->full_name); - ret = at91_ebi_dev_disable(ebi, child); + ret = atmel_ebi_dev_disable(ebi, child); if (ret) return ret; } @@ -577,10 +577,10 @@ static int at91_ebi_probe(struct platform_device *pdev) return of_platform_populate(np, NULL, NULL, dev); } -static struct platform_driver at91_ebi_driver = { +static struct platform_driver atmel_ebi_driver = { .driver = { .name = "atmel-ebi", - .of_match_table = at91_ebi_id_table, + .of_match_table = atmel_ebi_id_table, }, }; -builtin_platform_driver_probe(at91_ebi_driver, at91_ebi_probe); +builtin_platform_driver_probe(atmel_ebi_driver, atmel_ebi_probe);