All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: shmobile: lager: Add internal USB PCI support
Date: Fri, 14 Feb 2014 13:54:46 +0000	[thread overview]
Message-ID: <52FE2026.8040801@cogentembedded.com> (raw)
In-Reply-To: <20140214032948.3287.33351.sendpatchset@w520>

Hello.

On 14-02-2014 7:29, Magnus Damm wrote:

> From: Valentine Barshak <valentine.barshak@cogentembedded.com>

> This adds internal PCI USB host devices to R-Car H2 Lager board.

> Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
> [damm@opensource.se: Rebased and reworked to only include USB1 and USB2]
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---

>   Written against renesas-devel-v3.14-rc2-20140213

>   arch/arm/mach-shmobile/board-lager.c |   50 ++++++++++++++++++++++++++++++++++
>   1 file changed, 50 insertions(+)

> --- 0001/arch/arm/mach-shmobile/board-lager.c
> +++ work/arch/arm/mach-shmobile/board-lager.c	2014-02-14 12:16:26.000000000 +0900
> @@ -638,6 +638,48 @@ static struct resource sdhi2_resources[]
>   	DEFINE_RES_IRQ(gic_spi(167)),
>   };
>
> +/* Internal PCI1 */
> +static const struct resource pci1_resources[] __initconst = {
> +	DEFINE_RES_MEM(0xee0b0000, 0x10000),	/* CFG */
> +	DEFINE_RES_MEM(0xee0a0000, 0x10000),	/* MEM */
> +	DEFINE_RES_IRQ(gic_spi(112)),
> +};
> +
> +static const struct platform_device_info pci1_info __initconst = {
> +	.parent		= &platform_bus,
> +	.name		= "pci-rcar-gen2",
> +	.id		= 1,
> +	.res		= pci1_resources,
> +	.num_res	= ARRAY_SIZE(pci1_resources),
> +	.dma_mask	= DMA_BIT_MASK(32),
> +};
> +
> +static void __init lager_add_usb1_device(void)

    Actually, this adds PCI device, not USB, so the name is strange.
Also, I doubt that such functions are really necessary.

> +{
> +	platform_device_register_full(&pci1_info);
> +}
> +
> +/* Internal PCI2 */
> +static const struct resource pci2_resources[] __initconst = {
> +	DEFINE_RES_MEM(0xee0d0000, 0x10000),	/* CFG */
> +	DEFINE_RES_MEM(0xee0c0000, 0x10000),	/* MEM */
> +	DEFINE_RES_IRQ(gic_spi(113)),
> +};
> +
> +static const struct platform_device_info pci2_info __initconst = {
> +	.parent		= &platform_bus,
> +	.name		= "pci-rcar-gen2",
> +	.id		= 2,
> +	.res		= pci2_resources,
> +	.num_res	= ARRAY_SIZE(pci2_resources),
> +	.dma_mask	= DMA_BIT_MASK(32),
> +};
> +

    I suspect the PCI resources and info could be wrapped by macros and then 
instantiated by using only 2 lines.

WBR, Sergei


WARNING: multiple messages have this Message-ID (diff)
From: sergei.shtylyov@cogentembedded.com (Sergei Shtylyov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: shmobile: lager: Add internal USB PCI support
Date: Fri, 14 Feb 2014 17:54:46 +0400	[thread overview]
Message-ID: <52FE2026.8040801@cogentembedded.com> (raw)
In-Reply-To: <20140214032948.3287.33351.sendpatchset@w520>

Hello.

On 14-02-2014 7:29, Magnus Damm wrote:

> From: Valentine Barshak <valentine.barshak@cogentembedded.com>

> This adds internal PCI USB host devices to R-Car H2 Lager board.

> Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
> [damm at opensource.se: Rebased and reworked to only include USB1 and USB2]
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---

>   Written against renesas-devel-v3.14-rc2-20140213

>   arch/arm/mach-shmobile/board-lager.c |   50 ++++++++++++++++++++++++++++++++++
>   1 file changed, 50 insertions(+)

> --- 0001/arch/arm/mach-shmobile/board-lager.c
> +++ work/arch/arm/mach-shmobile/board-lager.c	2014-02-14 12:16:26.000000000 +0900
> @@ -638,6 +638,48 @@ static struct resource sdhi2_resources[]
>   	DEFINE_RES_IRQ(gic_spi(167)),
>   };
>
> +/* Internal PCI1 */
> +static const struct resource pci1_resources[] __initconst = {
> +	DEFINE_RES_MEM(0xee0b0000, 0x10000),	/* CFG */
> +	DEFINE_RES_MEM(0xee0a0000, 0x10000),	/* MEM */
> +	DEFINE_RES_IRQ(gic_spi(112)),
> +};
> +
> +static const struct platform_device_info pci1_info __initconst = {
> +	.parent		= &platform_bus,
> +	.name		= "pci-rcar-gen2",
> +	.id		= 1,
> +	.res		= pci1_resources,
> +	.num_res	= ARRAY_SIZE(pci1_resources),
> +	.dma_mask	= DMA_BIT_MASK(32),
> +};
> +
> +static void __init lager_add_usb1_device(void)

    Actually, this adds PCI device, not USB, so the name is strange.
Also, I doubt that such functions are really necessary.

> +{
> +	platform_device_register_full(&pci1_info);
> +}
> +
> +/* Internal PCI2 */
> +static const struct resource pci2_resources[] __initconst = {
> +	DEFINE_RES_MEM(0xee0d0000, 0x10000),	/* CFG */
> +	DEFINE_RES_MEM(0xee0c0000, 0x10000),	/* MEM */
> +	DEFINE_RES_IRQ(gic_spi(113)),
> +};
> +
> +static const struct platform_device_info pci2_info __initconst = {
> +	.parent		= &platform_bus,
> +	.name		= "pci-rcar-gen2",
> +	.id		= 2,
> +	.res		= pci2_resources,
> +	.num_res	= ARRAY_SIZE(pci2_resources),
> +	.dma_mask	= DMA_BIT_MASK(32),
> +};
> +

    I suspect the PCI resources and info could be wrapped by macros and then 
instantiated by using only 2 lines.

WBR, Sergei

  reply	other threads:[~2014-02-14 13:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-14  3:29 [PATCH] ARM: shmobile: lager: Add internal USB PCI support Magnus Damm
2014-02-14  3:29 ` Magnus Damm
2014-02-14 13:54 ` Sergei Shtylyov [this message]
2014-02-14 13:54   ` Sergei Shtylyov
2014-02-14 15:30   ` Magnus Damm
2014-02-14 15:30     ` Magnus Damm
2014-02-14 19:03     ` Sergei Shtylyov
2014-02-14 20:03       ` Sergei Shtylyov
2014-02-17  2:52 ` Simon Horman
2014-02-17  2:52   ` Simon Horman

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=52FE2026.8040801@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.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.