From: "shekhar, chandra" <x0044955@ti.com>
To: Tony Lindgren <tony@atomide.com>
Cc: Eduardo Valentin <eduardo.valentin@indt.org.br>,
linux-omap@vger.kernel.org,
"Nikula Jarkko (NRC/Helsinki)" <jarkko.nikula@nokia.com>
Subject: Re: [PATCH 11/21] ARM: OMAP: McBSP: Prepare for splitting intoomap1 and omap2 code
Date: Mon, 23 Jun 2008 16:04:22 +0530 [thread overview]
Message-ID: <071401c8d51c$b5bf8fd0$6ff6180a@ent.ti.com> (raw)
In-Reply-To: 20080623093947.GF7741@atomide.com
Hi,
i was about to send the same patch. it works fine for me.
chandra Shekhar
----- Original Message -----
From: "Tony Lindgren" <tony@atomide.com>
To: "Russell King - ARM Linux" <linux@arm.linux.org.uk>
Cc: <linux-arm-kernel@lists.arm.linux.org.uk>; "Eduardo Valentin"
<eduardo.valentin@indt.org.br>; <linux-omap@vger.kernel.org>; "Nikula Jarkko
(NRC/Helsinki)" <jarkko.nikula@nokia.com>
Sent: Monday, June 23, 2008 3:09 PM
Subject: Re: [PATCH 11/21] ARM: OMAP: McBSP: Prepare for splitting intoomap1
and omap2 code
>* Tony Lindgren <tony@atomide.com> [080617 11:43]:
>> * Russell King - ARM Linux <linux@arm.linux.org.uk> [080614 11:17]:
>> > On Fri, Jun 06, 2008 at 06:30:43PM -0700, Tony Lindgren wrote:
>> > > +#if defined(CONFIG_OMAP_MCBSP) || defined(CONFIG_OMAP_MCBSP_MODULE)
>> > > +
>> > > +static struct platform_device
>> > > omap_mcbsp_devices[OMAP_MAX_MCBSP_COUNT];
>> > > +static int mcbsps_configured;
>> > > +
>> > > +void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data
>> > > *config,
>> > > + int size)
>> > > +{
>> > > + int i;
>> > > +
>> > > + if (size > OMAP_MAX_MCBSP_COUNT) {
>> > > + printk(KERN_WARNING "Registered too many McBSPs platform_data."
>> > > + " Using maximum (%d) available.\n",
>> > > + OMAP_MAX_MCBSP_COUNT);
>> > > + size = OMAP_MAX_MCBSP_COUNT;
>> > > + }
>> > > +
>> > > + for (i = 0; i < size; i++) {
>> > > + struct platform_device *new_mcbsp = &omap_mcbsp_devices[i];
>> >
>> > Any reason this can't use the platform_device_alloc() API rather than
>> > having a static restriction on the number (coupled with the wastage of
>> > space for smaller 'size's ?)
>>
>> I agree, this should be allocated. Eduardo, any comments?
>
> Here's updated patch that uses platform_device_alloc().
>
> Tony
>
--------------------------------------------------------------------------------
> From 53f2999d681669df0645053dc572d97cda69823d Mon Sep 17 00:00:00 2001
> From: Eduardo Valentin <eduardo.valentin@indt.org.br>
> Date: Mon, 23 Jun 2008 12:37:30 +0300
> Subject: [PATCH] ARM: OMAP: McBSP: Prepare for splitting into omap1 and
> omap2 code
>
> This patch transform mcbsp code to use platform data
> from arch/arm/plat-omap/devices.c
>
> It also gets ride of ifdefs on mcbsp.c code.
> To do it, a platform data structure was defined.
>
> Signed-off-by: Eduardo Valentin <eduardo.valentin@indt.org.br>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
>
> diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
> index 4a53f9b..81002b7 100644
> --- a/arch/arm/plat-omap/devices.c
> +++ b/arch/arm/plat-omap/devices.c
> @@ -24,6 +24,7 @@
> #include <asm/arch/mux.h>
> #include <asm/arch/gpio.h>
> #include <asm/arch/menelaus.h>
> +#include <asm/arch/mcbsp.h>
>
> #if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
>
> @@ -145,6 +146,53 @@ static inline void omap_init_kp(void) {}
> #endif
>
> /*-------------------------------------------------------------------------*/
> +#if defined(CONFIG_OMAP_MCBSP) || defined(CONFIG_OMAP_MCBSP_MODULE)
> +
> +static struct platform_device **omap_mcbsp_devices;
> +
> +void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data
> *config,
> + int size)
> +{
> + int i;
> +
> + if (size > OMAP_MAX_MCBSP_COUNT) {
> + printk(KERN_WARNING "Registered too many McBSPs platform_data."
> + " Using maximum (%d) available.\n",
> + OMAP_MAX_MCBSP_COUNT);
> + size = OMAP_MAX_MCBSP_COUNT;
> + }
> +
> + omap_mcbsp_devices = kzalloc(size * sizeof(struct platform_device *),
> + GFP_KERNEL);
> + if (!omap_mcbsp_devices) {
> + printk(KERN_ERR "Could not register McBSP devices\n");
> + return;
> + }
> +
> + for (i = 0; i < size; i++) {
> + struct platform_device *new_mcbsp;
> + int ret;
> +
> + new_mcbsp = platform_device_alloc("omap-mcbsp", i + 1);
> + if (!new_mcbsp)
> + continue;
> + new_mcbsp->dev.platform_data = &config[i];
> + ret = platform_device_add(new_mcbsp);
> + if (ret) {
> + platform_device_put(new_mcbsp);
> + continue;
> + }
> + omap_mcbsp_devices[i] = new_mcbsp;
> + }
> +}
> +
> +#else
> +void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data
> *config,
> + int size)
> +{ }
> +#endif
> +
> +/*-------------------------------------------------------------------------*/
next prev parent reply other threads:[~2008-06-23 10:34 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <omap-upstream-20080607182613-0-21>
2008-06-07 1:30 ` [PATCH 00/21] Omap upstream patches for post 2.6.26 Tony Lindgren
2008-06-07 1:30 ` [PATCH 01/21] ARM: OMAP: DMTimer: Use posted mode Tony Lindgren
2008-06-07 1:30 ` [PATCH 02/21] ARM: OMAP: DMTimer: Optimize by adding load and start Tony Lindgren
2008-06-07 1:30 ` [PATCH 03/21] ARM: OMAP: Add OMAP3430 base defines Tony Lindgren
2008-06-07 1:30 ` [PATCH 04/21] ARM: OMAP: DMA: Make channels dynamic for multi-boot Tony Lindgren
2008-06-07 1:30 ` [PATCH 05/21] ARM: OMAP: DMA: Remove __REG access Tony Lindgren
2008-06-07 1:30 ` [PATCH 06/21] ARM: OMAP: DMA: Clean-up code Tony Lindgren
2008-06-07 1:30 ` [PATCH 07/21] ARM: OMAP: SRAM: Move sram-fn.S from plat-omap to mach-omap1 Tony Lindgren
2008-06-07 1:30 ` [PATCH 08/21] ARM: OMAP: SRAM: Move omap2 sram-fn.S to sram242x.S Tony Lindgren
2008-06-07 1:30 ` [PATCH 09/21] ARM: OMAP: SRAM: Split sram24xx.S into sram242x.S and sram243x.S Tony Lindgren
2008-06-07 1:30 ` [PATCH 10/21] ARM: OMAP: McBSP: Coding style cleanup on arch/arm/plat-omap/mcbsp.c Tony Lindgren
2008-06-07 1:30 ` [PATCH 11/21] ARM: OMAP: McBSP: Prepare for splitting into omap1 and omap2 code Tony Lindgren
2008-06-07 1:30 ` [PATCH 12/21] ARM: OMAP: McBSP: Add support for mcbsp on mach-omap1 Tony Lindgren
2008-06-07 1:30 ` [PATCH 13/21] ARM: OMAP: McBSP: Add support for mcbsp on mach-omap2 Tony Lindgren
2008-06-07 1:30 ` [PATCH 14/21] ARM: OMAP: Clean up interrupt lines to fix warnings for multi-omap Tony Lindgren
2008-06-07 1:30 ` [PATCH 15/21] ARM: OMAP: CLKFW: Initial debugfs support for omap clock framework Tony Lindgren
2008-06-07 1:30 ` [PATCH 16/21] ARM: OMAP: Change omap_cf.c and omap_nor.c to use omap_readw/writew instead of __REG Tony Lindgren
[not found] ` <1212802253-17797-17-git-send-email-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2008-06-07 1:30 ` [PATCH 17/21] ARM: OMAP: USB: Change omap USB code to use omap_read/write " Tony Lindgren
2008-06-07 1:30 ` [PATCH 18/21] ARM: OMAP: Remove __REG access for multi-omap Tony Lindgren
2008-06-07 1:30 ` [PATCH 19/21] ARM: OMAP: Introduce omap_globals and prcm access functions " Tony Lindgren
2008-06-07 1:30 ` [PATCH 20/21] ARM: OMAP: Turn CM and PRM access into functions Tony Lindgren
2008-06-07 1:30 ` [PATCH 21/21] ARM: OMAP: Add OMAP chip type structure; clean up mach-omap2/id.c Tony Lindgren
2008-06-14 9:22 ` Russell King - ARM Linux
2008-06-17 15:43 ` Paul Walmsley
2008-06-14 9:17 ` [PATCH 20/21] ARM: OMAP: Turn CM and PRM access into functions Russell King - ARM Linux
2008-06-14 9:09 ` [PATCH 19/21] ARM: OMAP: Introduce omap_globals and prcm access functions for multi-omap Russell King - ARM Linux
2008-06-17 7:46 ` Tony Lindgren
2008-06-22 14:08 ` Russell King - ARM Linux
2008-06-14 9:06 ` [PATCH 18/21] ARM: OMAP: Remove __REG access " Russell King - ARM Linux
2008-06-14 8:17 ` [PATCH 11/21] ARM: OMAP: McBSP: Prepare for splitting into omap1 and omap2 code Russell King - ARM Linux
2008-06-17 8:41 ` Tony Lindgren
2008-06-23 9:39 ` Tony Lindgren
2008-06-23 10:34 ` shekhar, chandra [this message]
2008-06-14 8:19 ` [PATCH 10/21] ARM: OMAP: McBSP: Coding style cleanup on arch/arm/plat-omap/mcbsp.c Russell King - ARM Linux
2008-06-23 9:02 ` Tony Lindgren
2008-06-14 8:05 ` [PATCH 08/21] ARM: OMAP: SRAM: Move omap2 sram-fn.S to sram242x.S Russell King - ARM Linux
2008-06-17 7:36 ` Tony Lindgren
2008-06-22 14:06 ` Russell King - ARM Linux
2008-06-17 7:34 ` [PATCH 07/21] ARM: OMAP: SRAM: Move sram-fn.S from plat-omap to mach-omap1 Tony Lindgren
2008-06-22 14:06 ` Russell King - ARM Linux
2008-06-14 8:13 ` [PATCH 06/21] ARM: OMAP: DMA: Clean-up code Russell King - ARM Linux
2008-06-17 7:27 ` Tony Lindgren
2008-06-22 14:06 ` Russell King - ARM Linux
2008-06-14 8:04 ` [PATCH 05/21] ARM: OMAP: DMA: Remove __REG access Russell King - ARM Linux
2008-06-17 7:22 ` Tony Lindgren
2008-06-22 14:05 ` Russell King - ARM Linux
2008-06-14 8:03 ` [PATCH 04/21] ARM: OMAP: DMA: Make channels dynamic for multi-boot Russell King - ARM Linux
2008-06-14 8:01 ` [PATCH 03/21] ARM: OMAP: Add OMAP3430 base defines Russell King - ARM Linux
2008-06-17 7:19 ` Tony Lindgren
2008-06-14 8:20 ` [PATCH 02/21] ARM: OMAP: DMTimer: Optimize by adding load and start Russell King - ARM Linux
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='071401c8d51c$b5bf8fd0$6ff6180a@ent.ti.com' \
--to=x0044955@ti.com \
--cc=eduardo.valentin@indt.org.br \
--cc=jarkko.nikula@nokia.com \
--cc=linux-omap@vger.kernel.org \
--cc=tony@atomide.com \
/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