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

Commit 92b118f6 authored by Maurus Cuelenaere's avatar Maurus Cuelenaere Committed by Ben Dooks
Browse files

ARM: S3C64XX: add HSMMC2 support



This adds support for the third SDHCI controller.

Signed-off-by: default avatarMaurus Cuelenaere <mcuelenaere@gmail.com>
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent 6a88e983
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ void __init s3c6400_map_io(void)

	s3c6400_default_sdhci0();
	s3c6400_default_sdhci1();
	s3c6400_default_sdhci2();

	/* the i2c devices are directly compatible with s3c2440 */
	s3c_i2c0_setname("s3c2440-i2c");
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ void __init s3c6410_map_io(void)
	/* initialise device information early */
	s3c6410_default_sdhci0();
	s3c6410_default_sdhci1();
	s3c6410_default_sdhci2();

	/* the i2c devices are directly compatible with s3c2440 */
	s3c_i2c0_setname("s3c2440-i2c");
+5 −0
Original line number Diff line number Diff line
@@ -178,6 +178,11 @@ config S3C_DEV_HSMMC1
	help
	  Compile in platform device definitions for HSMMC channel 1

config S3C_DEV_HSMMC2
	bool
	help
	  Compile in platform device definitions for HSMMC channel 2

config S3C_DEV_I2C1
	bool
	help
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ obj-$(CONFIG_HAVE_PWM) += pwm.o

obj-$(CONFIG_S3C_DEV_HSMMC)	+= dev-hsmmc.o
obj-$(CONFIG_S3C_DEV_HSMMC1)	+= dev-hsmmc1.o
obj-$(CONFIG_S3C_DEV_HSMMC2)	+= dev-hsmmc2.o
obj-y				+= dev-i2c0.o
obj-$(CONFIG_S3C_DEV_I2C1)	+= dev-i2c1.o
obj-$(CONFIG_S3C_DEV_FB)	+= dev-fb.o
+69 −0
Original line number Diff line number Diff line
/* linux/arch/arm/plat-s3c/dev-hsmmc2.c
 *
 * Copyright (c) 2009 Maurus Cuelenaere
 *
 * Based on arch/arm/plat-s3c/dev-hsmmc1.c
 * original file Copyright (c) 2008 Simtec Electronics
 *
 * S3C series device definition for hsmmc device 2
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
*/

#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/mmc/host.h>

#include <mach/map.h>
#include <plat/sdhci.h>
#include <plat/devs.h>
#include <plat/cpu.h>

#define S3C_SZ_HSMMC	(0x1000)

static struct resource s3c_hsmmc2_resource[] = {
	[0] = {
		.start = S3C_PA_HSMMC2,
		.end   = S3C_PA_HSMMC2 + S3C_SZ_HSMMC - 1,
		.flags = IORESOURCE_MEM,
	},
	[1] = {
		.start = IRQ_HSMMC2,
		.end   = IRQ_HSMMC2,
		.flags = IORESOURCE_IRQ,
	}
};

static u64 s3c_device_hsmmc2_dmamask = 0xffffffffUL;

struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata = {
	.max_width	= 4,
	.host_caps	= (MMC_CAP_4_BIT_DATA |
			   MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
};

struct platform_device s3c_device_hsmmc2 = {
	.name		= "s3c-sdhci",
	.id		= 2,
	.num_resources	= ARRAY_SIZE(s3c_hsmmc2_resource),
	.resource	= s3c_hsmmc2_resource,
	.dev		= {
		.dma_mask		= &s3c_device_hsmmc2_dmamask,
		.coherent_dma_mask	= 0xffffffffUL,
		.platform_data		= &s3c_hsmmc2_def_platdata,
	},
};

void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
{
	struct s3c_sdhci_platdata *set = &s3c_hsmmc2_def_platdata;

	set->max_width = pd->max_width;

	if (pd->cfg_gpio)
		set->cfg_gpio = pd->cfg_gpio;
	if (pd->cfg_card)
		set->cfg_card = pd->cfg_card;
}
Loading