Second round of Renesas ARM based SoC cleanups for v3.13

* Constify platform data and resources in lager board code
 * Clean up registration of VIN and sh_eth in r8a7778 SoC and
    bockw board code
 * Make r8a7778_register_hspi() static in r8a7778 SoC code
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSU5WFAAoJENfPZGlqN0++v5UP/26wi2e77h/7UMTmMq9HO0R3
 L1LAyITkzFxvm1yiReoVT9ovs9XdxWG0SLhE/H/e8iqnWtNvPfPCVETPeegkCayA
 ELFX+zc+c/dnGXOazY4rK1K+kPeR4aTBPNpkGLcpcxGlnSeBG2s8mpOHLeAMDWcW
 A7iN8S/irWj0dtQ4b9QtrYzkU5mIa7E6vvYmAVWfJiOC5MN1cjMLEgGXm4EgVuwg
 MkG33H8CnytO+QhC4EhAYOjROQ+t4Q0j9fFdq9AAJ5sL9VKm/83PQx198ikQY0yQ
 rNbyn6dIzOp5cSJ1x3DzNegVtp6pCbiBvBjJmhLMX6YITRFEzXolxTSU6jU1+wZg
 6wZ9d62tX8pGBxq/OV6harggZnjJ4jVDiJ72BTQ1R9c1SWcnQDd1/lFC/Xpxu7ku
 dzzFxZnoB3tltkYI+AiJPhow8XsGaQFv22o3DyliHeHw/jBYho3v5/Y5Pzms0bCm
 RwftNJx1FPa6j8MM8PYLnmklogSFSMquMAj8dtLE5w7pKaA1/s9n5KWB3UYagok2
 cLWu7XOo0itw6+E/FMzJY1owvvHPka2F1W+Qad5GOlu8Qcc+Ys79UXd6JELOV8eX
 yXHMqioTY5GWS0tnLAYjocEctHEYAORI7daoAtdGAHEhG93jLC8+Y7+U2h0Fx412
 TdbcRFkrAeKD8T0zLJoy
 =ZNhN
 -----END PGP SIGNATURE-----

Merge tag 'renesas-cleanup2-for-v3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/cleanup

From Simon Horman:
Second round of Renesas ARM based SoC cleanups for v3.13

* Constify platform data and resources in lager board code
* Clean up registration of VIN and sh_eth in r8a7778 SoC and
   bockw board code
* Make r8a7778_register_hspi() static in r8a7778 SoC code

* tag 'renesas-cleanup2-for-v3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: lager: Constify platform data and resources
  ARM: shmobile: r8a7778: r8a7778_register_hspi() become static
  ARM: shmobile: r8a7778: cleanup registration of sh_eth
  ARM: shmobile: r8a7778: cleanup registration of vin

Signed-off-by: Kevin Hilman <khilman@linaro.org>

Conflicts:
	arch/arm/mach-shmobile/board-lager.c
This commit is contained in:
Kevin Hilman 2013-10-10 15:42:03 -07:00
commit 65009d43e7
4 changed files with 47 additions and 66 deletions

View File

@ -101,6 +101,12 @@ static struct resource sdhi0_resources[] __initdata = {
DEFINE_RES_IRQ(gic_iid(0x77)),
};
/* Ether */
static struct resource ether_resources[] __initdata = {
DEFINE_RES_MEM(0xfde00000, 0x400),
DEFINE_RES_IRQ(gic_iid(0x89)),
};
static struct sh_eth_plat_data ether_platform_data __initdata = {
.phy = 0x01,
.edmac_endian = EDMAC_LITTLE_ENDIAN,
@ -162,10 +168,6 @@ static struct sh_mmcif_plat_data sh_mmcif_plat __initdata = {
MMC_CAP_NEEDS_POLL,
};
static struct rcar_vin_platform_data vin_platform_data __initdata = {
.flags = RCAR_VIN_BT656,
};
/* In the default configuration both decoders reside on I2C bus 0 */
#define BOCKW_CAMERA(idx) \
static struct i2c_board_info camera##idx##_info = { \
@ -181,6 +183,30 @@ static struct soc_camera_link iclink##idx##_ml86v7667 __initdata = { \
BOCKW_CAMERA(0);
BOCKW_CAMERA(1);
/* VIN */
static struct rcar_vin_platform_data vin_platform_data __initdata = {
.flags = RCAR_VIN_BT656,
};
#define R8A7778_VIN(idx) \
static struct resource vin##idx##_resources[] __initdata = { \
DEFINE_RES_MEM(0xffc50000 + 0x1000 * (idx), 0x1000), \
DEFINE_RES_IRQ(gic_iid(0x5a)), \
}; \
\
static struct platform_device_info vin##idx##_info __initdata = { \
.parent = &platform_bus, \
.name = "r8a7778-vin", \
.id = idx, \
.res = vin##idx##_resources, \
.num_res = ARRAY_SIZE(vin##idx##_resources), \
.dma_mask = DMA_BIT_MASK(32), \
.data = &vin_platform_data, \
.size_data = sizeof(vin_platform_data), \
}
R8A7778_VIN(0);
R8A7778_VIN(1);
static const struct pinctrl_map bockw_pinctrl_map[] = {
/* Ether */
PIN_MAP_MUX_GROUP_DEFAULT("r8a777x-ether", "pfc-r8a7778",
@ -235,11 +261,17 @@ static void __init bockw_init(void)
r8a7778_clock_init();
r8a7778_init_irq_extpin(1);
r8a7778_add_standard_devices();
r8a7778_add_ether_device(&ether_platform_data);
r8a7778_add_vin_device(0, &vin_platform_data);
platform_device_register_resndata(&platform_bus, "r8a777x-ether", -1,
ether_resources,
ARRAY_SIZE(ether_resources),
&ether_platform_data,
sizeof(ether_platform_data));
platform_device_register_full(&vin0_info);
/* VIN1 has a pin conflict with Ether */
if (!IS_ENABLED(CONFIG_SH_ETH))
r8a7778_add_vin_device(1, &vin_platform_data);
platform_device_register_full(&vin1_info);
platform_device_register_data(&platform_bus, "soc-camera-pdrv", 0,
&iclink0_ml86v7667,
sizeof(iclink0_ml86v7667));

View File

@ -56,7 +56,7 @@ static struct gpio_led lager_leds[] = {
},
};
static __initdata struct gpio_led_platform_data lager_leds_pdata = {
static const struct gpio_led_platform_data lager_leds_pdata __initconst = {
.leds = lager_leds,
.num_leds = ARRAY_SIZE(lager_leds),
};
@ -72,7 +72,7 @@ static struct gpio_keys_button gpio_buttons[] = {
GPIO_KEY(KEY_1, RCAR_GP_PIN(1, 14), "SW2-pin1"),
};
static __initdata struct gpio_keys_platform_data lager_keys_pdata = {
static const struct gpio_keys_platform_data lager_keys_pdata __initconst = {
.buttons = gpio_buttons,
.nbuttons = ARRAY_SIZE(gpio_buttons),
};
@ -84,24 +84,24 @@ static struct regulator_consumer_supply fixed3v3_power_consumers[] =
};
/* MMCIF */
static struct sh_mmcif_plat_data mmcif1_pdata __initdata = {
static const struct sh_mmcif_plat_data mmcif1_pdata __initconst = {
.caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
};
static struct resource mmcif1_resources[] __initdata = {
static const struct resource mmcif1_resources[] __initconst = {
DEFINE_RES_MEM_NAMED(0xee220000, 0x80, "MMCIF1"),
DEFINE_RES_IRQ(gic_spi(170)),
};
/* Ether */
static struct sh_eth_plat_data ether_pdata __initdata = {
static const struct sh_eth_plat_data ether_pdata __initconst = {
.phy = 0x1,
.edmac_endian = EDMAC_LITTLE_ENDIAN,
.phy_interface = PHY_INTERFACE_MODE_RMII,
.ether_link_active_low = 1,
};
static struct resource ether_resources[] __initdata = {
static const struct resource ether_resources[] __initconst = {
DEFINE_RES_MEM(0xee700000, 0x400),
DEFINE_RES_IRQ(gic_spi(162)),
};
@ -180,7 +180,7 @@ static void __init lager_init(void)
phy_register_fixup_for_id("r8a7790-ether-ff:01", lager_ksz8041_fixup);
}
static const char *lager_boards_compat_dt[] __initdata = {
static const char * const lager_boards_compat_dt[] __initconst = {
"renesas,lager",
NULL,
};

View File

@ -23,9 +23,6 @@
extern void r8a7778_add_standard_devices(void);
extern void r8a7778_add_standard_devices_dt(void);
extern void r8a7778_add_ether_device(struct sh_eth_plat_data *pdata);
extern void r8a7778_add_vin_device(int id,
struct rcar_vin_platform_data *pdata);
extern void r8a7778_add_dt_devices(void);
extern void r8a7778_init_late(void);

View File

@ -174,20 +174,6 @@ static struct platform_device_info hci##_info __initdata = { \
USB_PLATFORM_INFO(ehci);
USB_PLATFORM_INFO(ohci);
/* Ether */
static struct resource ether_resources[] __initdata = {
DEFINE_RES_MEM(0xfde00000, 0x400),
DEFINE_RES_IRQ(gic_iid(0x89)),
};
void __init r8a7778_add_ether_device(struct sh_eth_plat_data *pdata)
{
platform_device_register_resndata(&platform_bus, "r8a777x-ether", -1,
ether_resources,
ARRAY_SIZE(ether_resources),
pdata, sizeof(*pdata));
}
/* PFC/GPIO */
static struct resource pfc_resources[] __initdata = {
DEFINE_RES_MEM(0xfffc0000, 0x118),
@ -272,7 +258,7 @@ static struct resource hspi_resources[] __initdata = {
DEFINE_RES_IRQ(gic_iid(0x75)),
};
void __init r8a7778_register_hspi(int id)
static void __init r8a7778_register_hspi(int id)
{
BUG_ON(id < 0 || id > 2);
@ -281,40 +267,6 @@ void __init r8a7778_register_hspi(int id)
hspi_resources + (2 * id), 2);
}
/* VIN */
#define R8A7778_VIN(idx) \
static struct resource vin##idx##_resources[] __initdata = { \
DEFINE_RES_MEM(0xffc50000 + 0x1000 * (idx), 0x1000), \
DEFINE_RES_IRQ(gic_iid(0x5a)), \
}; \
\
static struct platform_device_info vin##idx##_info __initdata = { \
.parent = &platform_bus, \
.name = "r8a7778-vin", \
.id = idx, \
.res = vin##idx##_resources, \
.num_res = ARRAY_SIZE(vin##idx##_resources), \
.dma_mask = DMA_BIT_MASK(32), \
}
R8A7778_VIN(0);
R8A7778_VIN(1);
static struct platform_device_info *vin_info_table[] __initdata = {
&vin0_info,
&vin1_info,
};
void __init r8a7778_add_vin_device(int id, struct rcar_vin_platform_data *pdata)
{
BUG_ON(id < 0 || id > 1);
vin_info_table[id]->data = pdata;
vin_info_table[id]->size_data = sizeof(*pdata);
platform_device_register_full(vin_info_table[id]);
}
void __init r8a7778_add_dt_devices(void)
{
int i;