All of lore.kernel.org
 help / color / mirror / Atom feed
From: viresh.kumar@st.com (Viresh KUMAR)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/5] SPEAr3xx: Rework pmx_dev code to remove conflicts
Date: Mon, 14 Jun 2010 10:51:13 +0530	[thread overview]
Message-ID: <4C15BC49.5040105@st.com> (raw)
In-Reply-To: <1275717955-14545-4-git-send-email-ryan@bluewatersys.com>

On 6/5/2010 11:35 AM, Ryan Mallon wrote:
> Prefix the pmx_devs to remove naming conflicts between the three
> SPEAr3xx platforms. Also make pmx_driver static to each platform and
> rework the init code to pass the devices rather than export the
> pmx_driver structure.
> 
> Signed-off-by: Ryan Mallon <ryan@bluewatersys.com>
> ---
>  arch/arm/mach-spear3xx/include/mach/generic.h |  135 ++++++++++++-------------
>  arch/arm/mach-spear3xx/spear300.c             |   39 ++++----
>  arch/arm/mach-spear3xx/spear300_evb.c         |   26 ++---
>  arch/arm/mach-spear3xx/spear310.c             |   29 +++---
>  arch/arm/mach-spear3xx/spear310_evb.c         |   42 ++++-----
>  arch/arm/mach-spear3xx/spear320.c             |   57 ++++++-----
>  arch/arm/mach-spear3xx/spear320_evb.c         |   36 +++----
>  arch/arm/mach-spear3xx/spear3xx.c             |   60 ++++++------
>  8 files changed, 202 insertions(+), 222 deletions(-)
> 
> diff --git a/arch/arm/mach-spear3xx/include/mach/generic.h b/arch/arm/mach-spear3xx/include/mach/generic.h
> index 48dfb9c..408d39f 100644
> --- a/arch/arm/mach-spear3xx/include/mach/generic.h
> +++ b/arch/arm/mach-spear3xx/include/mach/generic.h
> @@ -60,21 +60,21 @@ void spear_pmx_init(struct pmx_driver *pmx_driver, uint base, uint size);
>  #define PMX_TIMER_1_2_MASK	(1 << 0)
>  
>  /* pad mux devices */
> -extern struct pmx_dev pmx_firda;
> -extern struct pmx_dev pmx_i2c;
> -extern struct pmx_dev pmx_ssp_cs;
> -extern struct pmx_dev pmx_ssp;
> -extern struct pmx_dev pmx_mii;
> -extern struct pmx_dev pmx_gpio_pin0;
> -extern struct pmx_dev pmx_gpio_pin1;
> -extern struct pmx_dev pmx_gpio_pin2;
> -extern struct pmx_dev pmx_gpio_pin3;
> -extern struct pmx_dev pmx_gpio_pin4;
> -extern struct pmx_dev pmx_gpio_pin5;
> -extern struct pmx_dev pmx_uart0_modem;
> -extern struct pmx_dev pmx_uart0;
> -extern struct pmx_dev pmx_timer_3_4;
> -extern struct pmx_dev pmx_timer_1_2;
> +extern struct pmx_dev spear3xx_pmx_firda;
> +extern struct pmx_dev spear3xx_pmx_i2c;
> +extern struct pmx_dev spear3xx_pmx_ssp_cs;
> +extern struct pmx_dev spear3xx_pmx_ssp;
> +extern struct pmx_dev spear3xx_pmx_mii;
> +extern struct pmx_dev spear3xx_pmx_gpio_pin0;
> +extern struct pmx_dev spear3xx_pmx_gpio_pin1;
> +extern struct pmx_dev spear3xx_pmx_gpio_pin2;
> +extern struct pmx_dev spear3xx_pmx_gpio_pin3;
> +extern struct pmx_dev spear3xx_pmx_gpio_pin4;
> +extern struct pmx_dev spear3xx_pmx_gpio_pin5;
> +extern struct pmx_dev spear3xx_pmx_uart0_modem;
> +extern struct pmx_dev spear3xx_pmx_uart0;
> +extern struct pmx_dev spear3xx_pmx_timer_3_4;
> +extern struct pmx_dev spear3xx_pmx_timer_1_2;
>  

same here. I don't understand why any conflicts will be there.

[snip...]

>  
>  /* pmx driver structure */
> -struct pmx_driver pmx_driver = {
> +static struct pmx_driver pmx_driver = {
>  	.mode_reg = {.offset = MODE_CONFIG_REG, .mask = 0x00000007},
>  	.mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff},
>  };
> @@ -511,7 +511,8 @@ static struct spear_shirq shirq_intrcomm_ras = {
>  };
>  
>  /* spear320 routines */
> -void __init spear320_init(void)
> +void __init spear320_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
> +			  u8 pmx_dev_count)
>  {
>  	void __iomem *base;
>  	int ret = 0;
> @@ -540,10 +541,10 @@ void __init spear320_init(void)
>  		if (ret)
>  			printk(KERN_ERR "Error registering Shared IRQ 4\n");
>  	}
> -}
>  
> -void spear320_pmx_init(void)
> -{
> +	pmx_driver.mode = pmx_mode;
> +	pmx_driver.devs = pmx_devs;
> +	pmx_driver.devs_count = pmx_dev_count;
>  	spear_pmx_init(&pmx_driver, SPEAR320_SOC_CONFIG_BASE,
> -			SPEAR320_SOC_CONFIG_SIZE);
> +		       SPEAR320_SOC_CONFIG_SIZE);
>  }

This part looks fine.

> diff --git a/arch/arm/mach-spear3xx/spear320_evb.c b/arch/arm/mach-spear3xx/spear320_evb.c
> index 62ac685..4969fa9 100644
> --- a/arch/arm/mach-spear3xx/spear320_evb.c
> +++ b/arch/arm/mach-spear3xx/spear320_evb.c
> @@ -19,22 +19,22 @@
>  
>  static struct amba_device *amba_devs[] __initdata = {
> @@ -56,13 +56,7 @@ static void __init spear320_evb_init(void)
>  	unsigned int i;
>  
>  	/* call spear320 machine init function */
> -	spear320_init();
> -
> -	/* padmux initialization */
> -	pmx_driver.mode = &auto_net_mii_mode;
> -	pmx_driver.devs = pmx_devs;
> -	pmx_driver.devs_count = ARRAY_SIZE(pmx_devs);
> -	spear320_pmx_init();
> +	spear320_init(&auto_net_mii_mode, pmx_devs, ARRAY_SIZE(pmx_devs));

this is also fine.

  reply	other threads:[~2010-06-14  5:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-05  6:05 [PATCH 0/5] SPEAr3xx: Unify build of SPEAr3xx platforms Ryan Mallon
2010-06-05  6:05 ` [PATCH 1/5] SPEAr3xx: Make local structres static Ryan Mallon
2010-06-14  5:16   ` Viresh KUMAR
2010-06-14  5:31     ` Ryan Mallon
2010-06-14  5:41       ` Viresh KUMAR
2010-06-05  6:05 ` [PATCH 2/5] SPEAR3xx: Rename register/irq defines to remove naming conflicts Ryan Mallon
2010-06-14  5:18   ` Viresh KUMAR
2010-06-14  5:36     ` Ryan Mallon
2010-06-14  5:46       ` Viresh KUMAR
2010-06-14 10:17         ` Ryan Mallon
2010-08-10  5:12   ` viresh kumar
2010-08-10 20:50     ` Ryan Mallon
2010-08-11  9:14       ` viresh kumar
2010-08-11 20:43         ` Ryan Mallon
2010-08-12  4:40           ` viresh kumar
2010-06-05  6:05 ` [PATCH 3/5] SPEAr3xx: Rework pmx_dev code to remove conflicts Ryan Mallon
2010-06-14  5:21   ` Viresh KUMAR [this message]
2010-06-05  6:05 ` [PATCH 4/5] SPEAr3xx: Rework KConfig to allow all boards to be compiled in Ryan Mallon
2010-06-05  6:05 ` [PATCH 5/5] SPEAr3xx: Replace defconfigs with single unfied defconfig Ryan Mallon
2010-06-13 22:51 ` [PATCH 0/5] SPEAr3xx: Unify build of SPEAr3xx platforms Ryan Mallon
2010-06-15  5:32 ` Viresh KUMAR
2010-06-15  6:49   ` Ryan Mallon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C15BC49.5040105@st.com \
    --to=viresh.kumar@st.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.