Commit 65009d43 authored by Kevin Hilman's avatar Kevin Hilman

Merge tag 'renesas-cleanup2-for-v3.13' of...

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: default avatarKevin Hilman <khilman@linaro.org>

Conflicts:
	arch/arm/mach-shmobile/board-lager.c
parents 54bf93c4 27113d63
...@@ -101,6 +101,12 @@ static struct resource sdhi0_resources[] __initdata = { ...@@ -101,6 +101,12 @@ static struct resource sdhi0_resources[] __initdata = {
DEFINE_RES_IRQ(gic_iid(0x77)), 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 = { static struct sh_eth_plat_data ether_platform_data __initdata = {
.phy = 0x01, .phy = 0x01,
.edmac_endian = EDMAC_LITTLE_ENDIAN, .edmac_endian = EDMAC_LITTLE_ENDIAN,
...@@ -162,10 +168,6 @@ static struct sh_mmcif_plat_data sh_mmcif_plat __initdata = { ...@@ -162,10 +168,6 @@ static struct sh_mmcif_plat_data sh_mmcif_plat __initdata = {
MMC_CAP_NEEDS_POLL, 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 */ /* In the default configuration both decoders reside on I2C bus 0 */
#define BOCKW_CAMERA(idx) \ #define BOCKW_CAMERA(idx) \
static struct i2c_board_info camera##idx##_info = { \ static struct i2c_board_info camera##idx##_info = { \
...@@ -181,6 +183,30 @@ static struct soc_camera_link iclink##idx##_ml86v7667 __initdata = { \ ...@@ -181,6 +183,30 @@ static struct soc_camera_link iclink##idx##_ml86v7667 __initdata = { \
BOCKW_CAMERA(0); BOCKW_CAMERA(0);
BOCKW_CAMERA(1); 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[] = { static const struct pinctrl_map bockw_pinctrl_map[] = {
/* Ether */ /* Ether */
PIN_MAP_MUX_GROUP_DEFAULT("r8a777x-ether", "pfc-r8a7778", PIN_MAP_MUX_GROUP_DEFAULT("r8a777x-ether", "pfc-r8a7778",
...@@ -235,11 +261,17 @@ static void __init bockw_init(void) ...@@ -235,11 +261,17 @@ static void __init bockw_init(void)
r8a7778_clock_init(); r8a7778_clock_init();
r8a7778_init_irq_extpin(1); r8a7778_init_irq_extpin(1);
r8a7778_add_standard_devices(); 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 */ /* VIN1 has a pin conflict with Ether */
if (!IS_ENABLED(CONFIG_SH_ETH)) 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, platform_device_register_data(&platform_bus, "soc-camera-pdrv", 0,
&iclink0_ml86v7667, &iclink0_ml86v7667,
sizeof(iclink0_ml86v7667)); sizeof(iclink0_ml86v7667));
......
...@@ -56,7 +56,7 @@ static struct gpio_led lager_leds[] = { ...@@ -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, .leds = lager_leds,
.num_leds = ARRAY_SIZE(lager_leds), .num_leds = ARRAY_SIZE(lager_leds),
}; };
...@@ -72,7 +72,7 @@ static struct gpio_keys_button gpio_buttons[] = { ...@@ -72,7 +72,7 @@ static struct gpio_keys_button gpio_buttons[] = {
GPIO_KEY(KEY_1, RCAR_GP_PIN(1, 14), "SW2-pin1"), 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, .buttons = gpio_buttons,
.nbuttons = ARRAY_SIZE(gpio_buttons), .nbuttons = ARRAY_SIZE(gpio_buttons),
}; };
...@@ -84,24 +84,24 @@ static struct regulator_consumer_supply fixed3v3_power_consumers[] = ...@@ -84,24 +84,24 @@ static struct regulator_consumer_supply fixed3v3_power_consumers[] =
}; };
/* MMCIF */ /* 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, .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_MEM_NAMED(0xee220000, 0x80, "MMCIF1"),
DEFINE_RES_IRQ(gic_spi(170)), DEFINE_RES_IRQ(gic_spi(170)),
}; };
/* Ether */ /* Ether */
static struct sh_eth_plat_data ether_pdata __initdata = { static const struct sh_eth_plat_data ether_pdata __initconst = {
.phy = 0x1, .phy = 0x1,
.edmac_endian = EDMAC_LITTLE_ENDIAN, .edmac_endian = EDMAC_LITTLE_ENDIAN,
.phy_interface = PHY_INTERFACE_MODE_RMII, .phy_interface = PHY_INTERFACE_MODE_RMII,
.ether_link_active_low = 1, .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_MEM(0xee700000, 0x400),
DEFINE_RES_IRQ(gic_spi(162)), DEFINE_RES_IRQ(gic_spi(162)),
}; };
...@@ -180,7 +180,7 @@ static void __init lager_init(void) ...@@ -180,7 +180,7 @@ static void __init lager_init(void)
phy_register_fixup_for_id("r8a7790-ether-ff:01", lager_ksz8041_fixup); 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", "renesas,lager",
NULL, NULL,
}; };
......
...@@ -23,9 +23,6 @@ ...@@ -23,9 +23,6 @@
extern void r8a7778_add_standard_devices(void); extern void r8a7778_add_standard_devices(void);
extern void r8a7778_add_standard_devices_dt(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_add_dt_devices(void);
extern void r8a7778_init_late(void); extern void r8a7778_init_late(void);
......
...@@ -174,20 +174,6 @@ static struct platform_device_info hci##_info __initdata = { \ ...@@ -174,20 +174,6 @@ static struct platform_device_info hci##_info __initdata = { \
USB_PLATFORM_INFO(ehci); USB_PLATFORM_INFO(ehci);
USB_PLATFORM_INFO(ohci); 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 */ /* PFC/GPIO */
static struct resource pfc_resources[] __initdata = { static struct resource pfc_resources[] __initdata = {
DEFINE_RES_MEM(0xfffc0000, 0x118), DEFINE_RES_MEM(0xfffc0000, 0x118),
...@@ -272,7 +258,7 @@ static struct resource hspi_resources[] __initdata = { ...@@ -272,7 +258,7 @@ static struct resource hspi_resources[] __initdata = {
DEFINE_RES_IRQ(gic_iid(0x75)), 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); BUG_ON(id < 0 || id > 2);
...@@ -281,40 +267,6 @@ void __init r8a7778_register_hspi(int id) ...@@ -281,40 +267,6 @@ void __init r8a7778_register_hspi(int id)
hspi_resources + (2 * id), 2); 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) void __init r8a7778_add_dt_devices(void)
{ {
int i; int i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment