Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e36e26a8 authored by Russell King's avatar Russell King
Browse files

MFD: mcp-sa11x0: move setup of PPC unit out of mcp-sa11x0.c



Patch taken from af9081ae (ARM: sa1100: Refactor mcp-sa11x0 to use
platform resources.) by Jochen Friedrich <jochen@scram.de>, and
consolidated to use a common function.

Move the setup of the PPC unit out of mcp-sa11x0 into the core SA11x0
code, and call it from each platforms initialization file.  This
centralizes the setup of the PPC unit while not polluting the mcp-sa11x0
driver with these details.

Acked-by: default avatarJochen Friedrich <jochen@scram.de>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 7658e7f9
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -231,6 +231,8 @@ static void __init assabet_init(void)
	PPDR |= PPC_TXD3 | PPC_TXD1;
	PPDR |= PPC_TXD3 | PPC_TXD1;
	PPSR |= PPC_TXD3 | PPC_TXD1;
	PPSR |= PPC_TXD3 | PPC_TXD1;


	sa11x0_ppc_configure_mcp();

	sa1100fb_lcd_power = assabet_lcd_power;
	sa1100fb_lcd_power = assabet_lcd_power;
	sa1100fb_backlight_power = assabet_backlight_power;
	sa1100fb_backlight_power = assabet_backlight_power;


+1 −0
Original line number Original line Diff line number Diff line
@@ -128,6 +128,7 @@ static struct mcp_plat_data cerf_mcp_data = {


static void __init cerf_init(void)
static void __init cerf_init(void)
{
{
	sa11x0_ppc_configure_mcp();
	platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices));
	platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices));
	sa11x0_register_mtd(&cerf_flash_data, &cerf_flash_resource, 1);
	sa11x0_register_mtd(&cerf_flash_data, &cerf_flash_resource, 1);
	sa11x0_register_mcp(&cerf_mcp_data);
	sa11x0_register_mcp(&cerf_mcp_data);
+2 −0
Original line number Original line Diff line number Diff line
@@ -341,6 +341,8 @@ static void __init collie_init(void)


	GPSR |= _COLLIE_GPIO_UCB1x00_RESET;
	GPSR |= _COLLIE_GPIO_UCB1x00_RESET;


	sa11x0_ppc_configure_mcp();



	platform_scoop_config = &collie_pcmcia_config;
	platform_scoop_config = &collie_pcmcia_config;


+10 −0
Original line number Original line Diff line number Diff line
@@ -240,6 +240,16 @@ static struct platform_device sa11x0mcp_device = {
	.resource	= sa11x0mcp_resources,
	.resource	= sa11x0mcp_resources,
};
};


void __init sa11x0_ppc_configure_mcp(void)
{
	/* Setup the PPC unit for the MCP */
	PPDR &= ~PPC_RXD4;
	PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
	PSDR |= PPC_RXD4;
	PSDR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
	PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
}

void sa11x0_register_mcp(struct mcp_plat_data *data)
void sa11x0_register_mcp(struct mcp_plat_data *data)
{
{
	sa11x0_register_device(&sa11x0mcp_device, data);
	sa11x0_register_device(&sa11x0mcp_device, data);
+1 −0
Original line number Original line Diff line number Diff line
@@ -39,4 +39,5 @@ struct irda_platform_data;
void sa11x0_register_irda(struct irda_platform_data *irda);
void sa11x0_register_irda(struct irda_platform_data *irda);


struct mcp_plat_data;
struct mcp_plat_data;
void sa11x0_ppc_configure_mcp(void);
void sa11x0_register_mcp(struct mcp_plat_data *data);
void sa11x0_register_mcp(struct mcp_plat_data *data);
Loading