public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <me@felipebalbi.com>
To: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.arm.linux.org.uk,
	linux-omap@vger.kernel.org
Subject: Re: [PATCH 02/10] omap mailbox: add initial omap3 support
Date: Fri, 16 Jan 2009 17:43:58 +0200	[thread overview]
Message-ID: <20090116154357.GE32481@frodo> (raw)
In-Reply-To: <20090116082711.17571.38818.stgit@oreo.research.nokia.com>

Hi Hiroshi,

On Fri, Jan 16, 2009 at 10:27:11AM +0200, Hiroshi DOYU wrote:
>  static inline void omap_init_mbox(void)
>  {
> +	if (cpu_is_omap2420()) {
> +		mbox_device.num_resources = ARRAY_SIZE(omap2_mbox_resources);
> +		mbox_device.resource = omap2_mbox_resources;
> +	} else if (cpu_is_omap3430()) {
> +		mbox_device.num_resources = ARRAY_SIZE(omap3_mbox_resources);
> +		mbox_device.resource = omap3_mbox_resources;
> +	} else {

how about a pr_info() or pr_err() here ?? Something like:
pr_err("%s: platform not supported yet\n", __func__);

> +		return;
> +	}
>  	platform_device_register(&mbox_device);
>  }
>  #else
>  static inline void omap_init_mbox(void) { }
> -#endif
> +#endif /* CONFIG_OMAP_MBOX_FWK */
>  
>  #if defined(CONFIG_OMAP_STI)
>  
> diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
> index 0609e2d..3176bb7 100644
> --- a/arch/arm/mach-omap2/mailbox.c
> +++ b/arch/arm/mach-omap2/mailbox.c
> @@ -30,7 +30,7 @@
>  #define MAILBOX_IRQ_NEWMSG(u)		(1 << (2 * (u)))
>  #define MAILBOX_IRQ_NOTFULL(u)		(1 << (2 * (u) + 1))
>  
> -static unsigned long mbox_base;
> +static void __iomem *mbox_base;
>  
>  struct omap_mbox2_fifo {
>  	unsigned long msg;
> @@ -52,14 +52,14 @@ static struct clk *mbox_ick_handle;
>  static void omap2_mbox_enable_irq(struct omap_mbox *mbox,
>  				  omap_mbox_type_t irq);
>  
> -static inline unsigned int mbox_read_reg(unsigned int reg)
> +static inline unsigned int mbox_read_reg(size_t ofs)
>  {
> -	return __raw_readl(mbox_base + reg);
> +	return __raw_readl(mbox_base + ofs);
>  }
>  
> -static inline void mbox_write_reg(unsigned int val, unsigned int reg)
> +static inline void mbox_write_reg(u32 val, size_t ofs)
>  {
> -	__raw_writel(val, mbox_base + reg);
> +	__raw_writel(val, mbox_base + ofs);
>  }
>  
>  /* Mailbox H/W preparations */
> @@ -208,7 +208,7 @@ struct omap_mbox mbox_dsp_info = {
>  };
>  EXPORT_SYMBOL(mbox_dsp_info);
>  
> -/* IVA */
> +#if defined(CONFIG_ARCH_OMAP2420) /* IVA */

would be nice to have something like if (cpu_has_iva()) { ... } and move
this check to a later location e.g. on probe(), but this wouldn't prevent
this patch from going in now. Just a suggestion for later improvements.

>  static struct omap_mbox2_priv omap2_mbox_iva_priv = {
>  	.tx_fifo = {
>  		.msg		= MAILBOX_MESSAGE(2),
> @@ -229,17 +229,12 @@ static struct omap_mbox mbox_iva_info = {
>  	.ops	= &omap2_mbox_ops,
>  	.priv	= &omap2_mbox_iva_priv,
>  };
> +#endif

[snip]

> -	/* IVA IRQ */
> -	res = platform_get_resource(pdev, IORESOURCE_IRQ, 1);
> -	if (unlikely(!res)) {
> -		dev_err(&pdev->dev, "invalid irq resource\n");
> -		return -ENODEV;
> +	if (ret)
> +		goto err_dsp;
> +
> +#if defined(CONFIG_ARCH_OMAP2420) /* IVA */
> +	if (cpu_is_omap2420()) {
> +		/* IVA IRQ */
> +		res = platform_get_resource(pdev, IORESOURCE_IRQ, 1);

platform_get_irq(pdev, 0) would look more standard, I think.

-- 
balbi

  reply	other threads:[~2009-01-16 15:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16  8:27 [PATCH 00/10] arm: omap mailbox: add omap3 support with some fixes Hiroshi DOYU
2009-01-16  8:27 ` [PATCH 01/10] omap mailbox: cleanup omap2 register definition with macro Hiroshi DOYU
2009-01-16  9:56   ` roel kluin
2009-01-16 12:15     ` Hiroshi DOYU
2009-01-16 13:21       ` Hiroshi DOYU
2009-01-16  8:27 ` [PATCH 02/10] omap mailbox: add initial omap3 support Hiroshi DOYU
2009-01-16 15:43   ` Felipe Balbi [this message]
2009-01-16  8:27 ` [PATCH 03/10] omap mailbox: print hardware revision at startup Hiroshi DOYU
2009-01-16  8:27 ` [PATCH 04/10] omap mailbox: fix empty struct device for omap_mbox Hiroshi DOYU
2009-01-16  8:27 ` [PATCH 05/10] omap mailbox: fix empty struct device for omap1 Hiroshi DOYU
2009-01-28 14:49   ` Russell King - ARM Linux
2009-01-28 15:29     ` Hiroshi DOYU
2009-01-28 17:50       ` Russell King - ARM Linux
2009-01-28 19:21         ` Hiroshi DOYU
2009-01-28 19:41           ` Russell King - ARM Linux
2009-01-16  8:27 ` [PATCH 06/10] omap mailbox: fix empty struct device for omap2 Hiroshi DOYU
2009-01-16  8:27 ` [PATCH 07/10] omap mailbox: add save_/restore_ctx() for PM Hiroshi DOYU
2009-01-17 17:10   ` Russell King - ARM Linux
2009-01-17 17:20     ` Russell King - ARM Linux
2009-01-19 10:36       ` Hiroshi DOYU
2009-01-19 22:00         ` Russell King - ARM Linux
2009-01-16  8:27 ` [PATCH 08/10] omap mailbox: move mailbox.h into mailbox.c Hiroshi DOYU
2009-01-16  8:27 ` [PATCH 09/10] omap mailbox: convert sequence bit checking to module paramter Hiroshi DOYU
2009-01-16  8:27 ` [PATCH 10/10] omap mailbox: remove unnecessary header file inclusion Hiroshi DOYU
2009-01-30 18:57 ` [PATCH 00/10] arm: omap mailbox: add omap3 support with some fixes Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2008-11-25  9:39 [PATCH 0/10] omap mailbox driver update with omap3 support Hiroshi DOYU
2008-11-25  9:39 ` [PATCH 01/10] omap mailbox: cleanup omap2 register definition with macro Hiroshi DOYU
2008-11-25  9:39   ` [PATCH 02/10] omap mailbox: add initial omap3 support Hiroshi DOYU
2008-11-25 21:54     ` Tony Lindgren
2008-11-26  0:10       ` Hiroshi DOYU
2008-11-26 18:36         ` Tony Lindgren
2008-11-27 14:39           ` Hiroshi DOYU
2009-01-21 20:02     ` Kanigeri, Hari
2009-01-21 22:45       ` Hiroshi DOYU
2009-01-22  5:12         ` Ramesh Gupta Guntha
2009-01-22  6:10           ` Hiroshi DOYU

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=20090116154357.GE32481@frodo \
    --to=me@felipebalbi.com \
    --cc=Hiroshi.DOYU@nokia.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox