public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/5] HDQ: OMAP: Add HDQ Device
@ 2008-10-08  7:23 Gadiyar, Anand
  2008-10-10 20:42 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Gadiyar, Anand @ 2008-10-08  7:23 UTC (permalink / raw)
  To: johnpol@2ka.mipt.ru
  Cc: linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	Chikkature Rajashekar, Madhusudhan

From: Madhusudhan Chikkature <madhu.cr@ti.com>

Device registeration for the TI OMAP2430/3430 HDQ driver.

Signed-off-by: Madhusudhan Chikkature <madhu.cr@ti.com>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Acked-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
---
 arch/arm/mach-omap2/devices.c          |   33 +++++++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/mach/irqs.h |    1 +
 2 files changed, 34 insertions(+)

Index: linux-2.6/arch/arm/mach-omap2/devices.c
===================================================================
--- linux-2.6.orig/arch/arm/mach-omap2/devices.c	2008-09-19 13:39:38.000000000 +0530
+++ linux-2.6/arch/arm/mach-omap2/devices.c	2008-09-30 10:07:51.000000000 +0530
@@ -201,6 +201,38 @@ static void omap_init_mcspi(void)
 static inline void omap_init_mcspi(void) {}
 #endif
 
+#if defined(CONFIG_HDQ_MASTER_OMAP) || defined(CONFIG_HDQ_MASTER_OMAP_MODULE)
+#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430)
+#define OMAP_HDQ_BASE		0x480B2000
+#endif
+static struct resource omap_hdq_resources[] = {
+	{
+		.start		= OMAP_HDQ_BASE,
+		.end		= OMAP_HDQ_BASE + 0x1C,
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		.start		= INT_24XX_HDQ_IRQ,
+		.flags		= IORESOURCE_IRQ,
+	},
+};
+static struct platform_device omap_hdq_dev = {
+	.name		= "omap_hdq",
+	.id = 0,
+	.dev = {
+		.platform_data = NULL,
+	},
+	.num_resources		= ARRAY_SIZE(omap_hdq_resources),
+	.resource		= omap_hdq_resources,
+};
+static inline void omap_hdq_init(void)
+{
+	(void) platform_device_register(&omap_hdq_dev);
+}
+#else
+static inline void omap_hdq_init(void) {}
+#endif
+
 /*-------------------------------------------------------------------------*/
 
 static int __init omap2_init_devices(void)
@@ -212,6 +244,7 @@ static int __init omap2_init_devices(voi
 	omap_init_mbox();
 	omap_init_mcspi();
 	omap_init_sti();
+	omap_hdq_init();
 
 	return 0;
 }
Index: linux-2.6/arch/arm/plat-omap/include/mach/irqs.h
===================================================================
--- linux-2.6.orig/arch/arm/plat-omap/include/mach/irqs.h	2008-09-26 14:34:25.000000000 +0530
+++ linux-2.6/arch/arm/plat-omap/include/mach/irqs.h	2008-09-26 14:55:19.000000000 +0530
@@ -265,6 +265,7 @@
 #define INT_24XX_GPTIMER12	48
 #define INT_24XX_I2C1_IRQ	56
 #define INT_24XX_I2C2_IRQ	57
+#define INT_24XX_HDQ_IRQ	58
 #define INT_24XX_MCBSP1_IRQ_TX	59
 #define INT_24XX_MCBSP1_IRQ_RX	60
 #define INT_24XX_MCBSP2_IRQ_TX	62

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/5] HDQ: OMAP: Add HDQ Device
  2008-10-08  7:23 [PATCH 3/5] HDQ: OMAP: Add HDQ Device Gadiyar, Anand
@ 2008-10-10 20:42 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2008-10-10 20:42 UTC (permalink / raw)
  To: Gadiyar, Anand; +Cc: johnpol, linux-kernel, linux-omap, madhu.cr

On Wed, 8 Oct 2008 12:53:57 +0530
"Gadiyar, Anand" <gadiyar@ti.com> wrote:

> From: Madhusudhan Chikkature <madhu.cr@ti.com>
> 
> Device registeration for the TI OMAP2430/3430 HDQ driver.
> 
> Signed-off-by: Madhusudhan Chikkature <madhu.cr@ti.com>
> Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
> Acked-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
> ---
>  arch/arm/mach-omap2/devices.c          |   33 +++++++++++++++++++++++++++++++++
>  arch/arm/plat-omap/include/mach/irqs.h |    1 +
>  2 files changed, 34 insertions(+)
> 
> Index: linux-2.6/arch/arm/mach-omap2/devices.c
> ===================================================================
> --- linux-2.6.orig/arch/arm/mach-omap2/devices.c	2008-09-19 13:39:38.000000000 +0530
> +++ linux-2.6/arch/arm/mach-omap2/devices.c	2008-09-30 10:07:51.000000000 +0530
> @@ -201,6 +201,38 @@ static void omap_init_mcspi(void)
>  static inline void omap_init_mcspi(void) {}
>  #endif
>  
> +#if defined(CONFIG_HDQ_MASTER_OMAP) || defined(CONFIG_HDQ_MASTER_OMAP_MODULE)
> +#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430)

gad.

> +#define OMAP_HDQ_BASE		0x480B2000
> +#endif
> +static struct resource omap_hdq_resources[] = {
> +	{
> +		.start		= OMAP_HDQ_BASE,
> +		.end		= OMAP_HDQ_BASE + 0x1C,
> +		.flags		= IORESOURCE_MEM,
> +	},
> +	{
> +		.start		= INT_24XX_HDQ_IRQ,
> +		.flags		= IORESOURCE_IRQ,
> +	},
> +};
> +static struct platform_device omap_hdq_dev = {
> +	.name		= "omap_hdq",
> +	.id = 0,
> +	.dev = {
> +		.platform_data = NULL,
> +	},
> +	.num_resources		= ARRAY_SIZE(omap_hdq_resources),
> +	.resource		= omap_hdq_resources,
> +};
> +static inline void omap_hdq_init(void)
> +{
> +	(void) platform_device_register(&omap_hdq_dev);
> +}

The (void) thing is frowned upon.

Failing to check the return value from registration functions is also
frowned upon!



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-10 20:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-08  7:23 [PATCH 3/5] HDQ: OMAP: Add HDQ Device Gadiyar, Anand
2008-10-10 20:42 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox