From: Tony Lindgren <tony@atomide.com>
To: linux-arm-kernel@lists.infradead.org
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH 5/6] omap2+: Use omap_device_board_data for platform level serial init
Date: Wed, 22 Dec 2010 18:51:10 -0800 [thread overview]
Message-ID: <20101223025110.GJ7771@atomide.com> (raw)
In-Reply-To: <20101203004528.31687.93327.stgit@baageli.muru.com>
* Tony Lindgren <tony@atomide.com> [101202 16:35]:
> This is needed to pass board specific data such as pads used.
Here's this one updated to not use omap_device_build.
Regards,
Tony
Author: Tony Lindgren <tony@atomide.com>
Date: Wed Dec 22 18:42:35 2010 -0800
omap2+: Add struct omap_board_data and use it for platform level serial init
This is needed to pass board specific data such as pads used to the
platform level driver init code.
Signed-off-by: Tony Lindgren <tony@atomide.com>
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index c9ec50d..a4ab17a 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -87,6 +87,20 @@
#define OMAP_MUX_GPIO_IN_MODE3 (1 << 1)
/**
+ * struct omap_board_data - board specific device data
+ * @id: instance id
+ * @flags: additional flags for platform init code
+ * @pads: array of device specific pads
+ * @pads_cnt: ARRAY_SIZE() of pads
+ */
+struct omap_board_data {
+ int id;
+ u32 flags;
+ struct omap_device_pad *pads;
+ int pads_cnt;
+};
+
+/**
* struct mux_partition - contain partition related information
* @name: name of the current partition
* @flags: flags specific to this partition
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index c8740ba..c645788 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -45,6 +45,7 @@
#include "cm2xxx_3xxx.h"
#include "prm-regbits-34xx.h"
#include "control.h"
+#include "mux.h"
#define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV 0x52
#define UART_OMAP_WER 0x17 /* Wake-up enable register */
@@ -694,16 +695,16 @@ void __init omap_serial_early_init(void)
/**
* omap_serial_init_port() - initialize single serial port
- * @port: serial port number (0-3)
+ * @bdata: port specific board data pointer
*
- * This function initialies serial driver for given @port only.
+ * This function initialies serial driver for given port only.
* Platforms can call this function instead of omap_serial_init()
* if they don't plan to use all available UARTs as serial ports.
*
* Don't mix calls to omap_serial_init_port() and omap_serial_init(),
* use only one of the two.
*/
-void __init omap_serial_init_port(int port)
+void __init omap_serial_init_port(struct omap_board_data *bdata)
{
struct omap_uart_state *uart;
struct omap_hwmod *oh;
@@ -721,13 +722,15 @@ void __init omap_serial_init_port(int port)
struct omap_uart_port_info omap_up;
#endif
- if (WARN_ON(port < 0))
+ if (WARN_ON(!bdata))
return;
- if (WARN_ON(port >= num_uarts))
+ if (WARN_ON(bdata->id < 0))
+ return;
+ if (WARN_ON(bdata->id >= num_uarts))
return;
list_for_each_entry(uart, &uart_list, node)
- if (port == uart->num)
+ if (bdata->id == uart->num)
break;
oh = uart->oh;
@@ -799,6 +802,8 @@ void __init omap_serial_init_port(int port)
WARN(IS_ERR(od), "Could not build omap_device for %s: %s.\n",
name, oh->name);
+ oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
+
uart->irq = oh->mpu_irqs[0].irq;
uart->regshift = 2;
uart->mapbase = oh->slaves[0]->addr->pa_start;
@@ -856,7 +861,14 @@ void __init omap_serial_init_port(int port)
void __init omap_serial_init(void)
{
struct omap_uart_state *uart;
+ struct omap_board_data bdata;
- list_for_each_entry(uart, &uart_list, node)
- omap_serial_init_port(uart->num);
+ list_for_each_entry(uart, &uart_list, node) {
+ bdata.id = uart->num;
+ bdata.flags = 0;
+ bdata.pads = NULL;
+ bdata.pads_cnt = 0;
+ omap_serial_init_port(&bdata);
+
+ }
}
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index 19145f5..cec5d56 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -93,9 +93,12 @@
})
#ifndef __ASSEMBLER__
+
+struct omap_board_data;
+
extern void __init omap_serial_early_init(void);
extern void omap_serial_init(void);
-extern void omap_serial_init_port(int port);
+extern void omap_serial_init_port(struct omap_board_data *bdata);
extern int omap_uart_can_sleep(void);
extern void omap_uart_check_wakeup(void);
extern void omap_uart_prepare_suspend(void);
WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] omap2+: Use omap_device_board_data for platform level serial init
Date: Wed, 22 Dec 2010 18:51:10 -0800 [thread overview]
Message-ID: <20101223025110.GJ7771@atomide.com> (raw)
In-Reply-To: <20101203004528.31687.93327.stgit@baageli.muru.com>
* Tony Lindgren <tony@atomide.com> [101202 16:35]:
> This is needed to pass board specific data such as pads used.
Here's this one updated to not use omap_device_build.
Regards,
Tony
Author: Tony Lindgren <tony@atomide.com>
Date: Wed Dec 22 18:42:35 2010 -0800
omap2+: Add struct omap_board_data and use it for platform level serial init
This is needed to pass board specific data such as pads used to the
platform level driver init code.
Signed-off-by: Tony Lindgren <tony@atomide.com>
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index c9ec50d..a4ab17a 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -87,6 +87,20 @@
#define OMAP_MUX_GPIO_IN_MODE3 (1 << 1)
/**
+ * struct omap_board_data - board specific device data
+ * @id: instance id
+ * @flags: additional flags for platform init code
+ * @pads: array of device specific pads
+ * @pads_cnt: ARRAY_SIZE() of pads
+ */
+struct omap_board_data {
+ int id;
+ u32 flags;
+ struct omap_device_pad *pads;
+ int pads_cnt;
+};
+
+/**
* struct mux_partition - contain partition related information
* @name: name of the current partition
* @flags: flags specific to this partition
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index c8740ba..c645788 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -45,6 +45,7 @@
#include "cm2xxx_3xxx.h"
#include "prm-regbits-34xx.h"
#include "control.h"
+#include "mux.h"
#define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV 0x52
#define UART_OMAP_WER 0x17 /* Wake-up enable register */
@@ -694,16 +695,16 @@ void __init omap_serial_early_init(void)
/**
* omap_serial_init_port() - initialize single serial port
- * @port: serial port number (0-3)
+ * @bdata: port specific board data pointer
*
- * This function initialies serial driver for given @port only.
+ * This function initialies serial driver for given port only.
* Platforms can call this function instead of omap_serial_init()
* if they don't plan to use all available UARTs as serial ports.
*
* Don't mix calls to omap_serial_init_port() and omap_serial_init(),
* use only one of the two.
*/
-void __init omap_serial_init_port(int port)
+void __init omap_serial_init_port(struct omap_board_data *bdata)
{
struct omap_uart_state *uart;
struct omap_hwmod *oh;
@@ -721,13 +722,15 @@ void __init omap_serial_init_port(int port)
struct omap_uart_port_info omap_up;
#endif
- if (WARN_ON(port < 0))
+ if (WARN_ON(!bdata))
return;
- if (WARN_ON(port >= num_uarts))
+ if (WARN_ON(bdata->id < 0))
+ return;
+ if (WARN_ON(bdata->id >= num_uarts))
return;
list_for_each_entry(uart, &uart_list, node)
- if (port == uart->num)
+ if (bdata->id == uart->num)
break;
oh = uart->oh;
@@ -799,6 +802,8 @@ void __init omap_serial_init_port(int port)
WARN(IS_ERR(od), "Could not build omap_device for %s: %s.\n",
name, oh->name);
+ oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
+
uart->irq = oh->mpu_irqs[0].irq;
uart->regshift = 2;
uart->mapbase = oh->slaves[0]->addr->pa_start;
@@ -856,7 +861,14 @@ void __init omap_serial_init_port(int port)
void __init omap_serial_init(void)
{
struct omap_uart_state *uart;
+ struct omap_board_data bdata;
- list_for_each_entry(uart, &uart_list, node)
- omap_serial_init_port(uart->num);
+ list_for_each_entry(uart, &uart_list, node) {
+ bdata.id = uart->num;
+ bdata.flags = 0;
+ bdata.pads = NULL;
+ bdata.pads_cnt = 0;
+ omap_serial_init_port(&bdata);
+
+ }
}
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index 19145f5..cec5d56 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -93,9 +93,12 @@
})
#ifndef __ASSEMBLER__
+
+struct omap_board_data;
+
extern void __init omap_serial_early_init(void);
extern void omap_serial_init(void);
-extern void omap_serial_init_port(int port);
+extern void omap_serial_init_port(struct omap_board_data *bdata);
extern int omap_uart_can_sleep(void);
extern void omap_uart_check_wakeup(void);
extern void omap_uart_prepare_suspend(void);
next prev parent reply other threads:[~2010-12-23 2:51 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-03 0:45 [PATCH 0/6] omap: Board specific muxing using hwmod Tony Lindgren
2010-12-03 0:45 ` Tony Lindgren
2010-12-03 0:45 ` [PATCH 1/6] omap2+: Add omap_mux_get_by_name Tony Lindgren
2010-12-03 0:45 ` Tony Lindgren
2010-12-03 0:45 ` [PATCH 2/6] omap2+: Add support for hwmod specific muxing of devices Tony Lindgren
2010-12-03 0:45 ` Tony Lindgren
2010-12-23 2:46 ` Tony Lindgren
2010-12-23 2:46 ` Tony Lindgren
2010-12-03 0:45 ` [PATCH 3/6] omap2+: Allow hwmod state changes to mux pads based on the state changes Tony Lindgren
2010-12-03 0:45 ` Tony Lindgren
2010-12-23 2:48 ` Tony Lindgren
2010-12-23 2:48 ` Tony Lindgren
2010-12-03 0:45 ` [PATCH 4/6] omap2+: Add struct omap_device_board_data and allow omap_device_build initialize pads to mux Tony Lindgren
2010-12-03 0:45 ` Tony Lindgren
2010-12-23 2:49 ` Tony Lindgren
2010-12-23 2:49 ` Tony Lindgren
2010-12-03 0:45 ` [PATCH 5/6] omap2+: Use omap_device_board_data for platform level serial init Tony Lindgren
2010-12-03 0:45 ` Tony Lindgren
2010-12-23 2:51 ` Tony Lindgren [this message]
2010-12-23 2:51 ` Tony Lindgren
2010-12-03 0:45 ` [PATCH 6/6] omap2+: Initialize serial ports for wake-up events for n8x0 Tony Lindgren
2010-12-03 0:45 ` Tony Lindgren
2010-12-14 3:17 ` Kevin Hilman
2010-12-14 3:17 ` Kevin Hilman
2010-12-18 17:53 ` Tony Lindgren
2010-12-18 17:53 ` Tony Lindgren
2010-12-23 2:53 ` Tony Lindgren
2010-12-23 2:53 ` Tony Lindgren
2010-12-21 17:04 ` [PATCH 0/6] omap: Board specific muxing using hwmod Paul Walmsley
2010-12-21 17:04 ` Paul Walmsley
2010-12-23 3:07 ` Tony Lindgren
2010-12-23 3:07 ` Tony Lindgren
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=20101223025110.GJ7771@atomide.com \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.infradead.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 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.