linux-mips
[Top] [All Lists]

Re: [PATCH 7/9] MIPS: BCM63XX: add stub to register the SPI platform dri

To: ralf@linux-mips.org
Subject: Re: [PATCH 7/9] MIPS: BCM63XX: add stub to register the SPI platform driver
From: Florian Fainelli <florian@openwrt.org>
Date: Mon, 21 Nov 2011 11:11:46 +0100
Cc: linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=/j08jdStfL3lTt0T+NmaxUwJKscmaQA4LKob4k7KDc4=; b=qUxR5oTA9ji1oIycDd4cLRHbBzHGCjYY6a17SZV4BDEhCT1tJ5vD1+Vdb5WHEH2jSk TYs5g2lntxzN8USUsVKb38Y98ysaa7hBHCHVgzPtzg421kcotxwKjrwQEplD0V8CCv1U A5SvbK3q1fR1efFwgXqZi9RQ//jNYgx6J7gSc=
In-reply-to: <1321866861-14340-8-git-send-email-florian@openwrt.org>
References: <1321866861-14340-1-git-send-email-florian@openwrt.org> <1321866861-14340-8-git-send-email-florian@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
Hello Ralf,

2011/11/21 Florian Fainelli <florian@openwrt.org>:
> This patch adds the necessary stub to register the SPI platform driver.
> Since the registers are shuffled between the 4 BCM63xx CPUs supported by
> this SPI driver we also need to generate the internal register layout and
> export this layout for the driver to use it properly.
>
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
>  arch/mips/bcm63xx/dev-spi.c                        |  117 
> ++++++++++++++++++++
>  .../include/asm/mach-bcm63xx/bcm63xx_dev_spi.h     |   89 +++++++++++++++
>  2 files changed, 206 insertions(+), 0 deletions(-)
>  create mode 100644 arch/mips/bcm63xx/dev-spi.c
>  create mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h
>
> diff --git a/arch/mips/bcm63xx/dev-spi.c b/arch/mips/bcm63xx/dev-spi.c
> new file mode 100644
> index 0000000..b0faa85
> --- /dev/null
> +++ b/arch/mips/bcm63xx/dev-spi.c
> @@ -0,0 +1,117 @@
> +/*
> + * This file is subject to the terms and conditions of the GNU General Public
> + * License.  See the file "COPYING" in the main directory of this archive
> + * for more details.
> + *
> + * Copyright (C) 2009-2011 Florian Fainelli <florian@openwrt.org>
> + * Copyright (C) 2010 Tanguy Bouzeloc <tanguy.bouzeloc@efixo.com>
> + */
> +
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/export.h>
> +#include <linux/platform_device.h>
> +#include <linux/err.h>
> +#include <linux/clk.h>
> +
> +#include <bcm63xx_cpu.h>
> +#include <bcm63xx_dev_spi.h>
> +#include <bcm63xx_regs.h>
> +
> +#ifdef BCMCPU_RUNTIME_DETECT
> +/*
> + * register offsets
> + */
> +static const unsigned long bcm6338_regs_spi[] = {
> +       __GEN_SPI_REGS_TABLE(6338)
> +};
> +
> +static const unsigned long bcm6348_regs_spi[] = {
> +       __GEN_SPI_REGS_TABLE(6348)
> +};
> +
> +static const unsigned long bcm6358_regs_spi[] = {
> +       __GEN_SPI_REGS_TABLE(6358)
> +};
> +
> +static const unsigned long bcm6368_regs_spi[] = {
> +       __GEN_SPI_REGS_TABLE(6368)
> +};
> +
> +const unsigned long *bcm63xx_regs_spi;
> +EXPORT_SYMBOL(bcm63xx_regs_spi);
> +
> +static __init void bcm63xx_spi_regs_init(void)
> +{
> +       if (BCMCPU_IS_6338())
> +               bcm63xx_regs_spi = bcm6338_regs_spi;
> +       if (BCMCPU_IS_6348())
> +               bcm63xx_regs_spi = bcm6348_regs_spi;
> +       if (BCMCPU_IS_6358())
> +               bcm63xx_regs_spi = bcm6358_regs_spi;
> +       if (BCMCPU_IS_6368())
> +               bcm63xx_regs_spi = bcm6358_regs_spi;

There is a typo here, I will resubmit a version 2 of the patchset.
--
Florian

<Prev in Thread] Current Thread [Next in Thread>