summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mx28
diff options
context:
space:
mode:
authorRichard Zhu <r65037@freescale.com>2010-03-17 15:57:27 +0800
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-05-25 11:17:22 +0200
commit0721e5759a9714c87b0ecb6a793f933a928ed96a (patch)
tree9b23d9791e60c6559f1350e0ce63f9a4ef4b5f93 /arch/arm/mach-mx28
parent5c9c48987d899e6e3862314d2959a72784d5aa98 (diff)
ENGR00121661 [MX28] Fix the CD isn't functional issue on SSP ports
There are IOMUX conflictions between SSP1 and GPMI device, when the GPMI is enabled, and the SSP1 device is not enabled properly. The Card Detect func would be failed. Solution: Just register the functional device into system can solve this problem Signed-off-by: Richard Zhu <r65037@freescale.com> Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'arch/arm/mach-mx28')
-rw-r--r--arch/arm/mach-mx28/device.c37
-rw-r--r--arch/arm/mach-mx28/pinctrl.c14
2 files changed, 31 insertions, 20 deletions
diff --git a/arch/arm/mach-mx28/device.c b/arch/arm/mach-mx28/device.c
index 0b5e440ebc97..429625ed4858 100644
--- a/arch/arm/mach-mx28/device.c
+++ b/arch/arm/mach-mx28/device.c
@@ -39,6 +39,7 @@
#include <mach/lradc.h>
#include <mach/lcdif.h>
#include <mach/ddi_bc.h>
+#include <mach/pinctrl.h>
#include "regs-digctl.h"
#include "device.h"
@@ -574,29 +575,25 @@ static struct resource mmc1_resource[] = {
static void __init mx28_init_mmc(void)
{
- int i;
- struct mxs_dev_lookup *lookup;
struct platform_device *pdev;
- lookup = mxs_get_devices("mxs-mmc");
- if (lookup == NULL || IS_ERR(lookup))
- return;
- for (i = 0; i < lookup->size; i++) {
- pdev = lookup->pdev + i;
- switch (pdev->id) {
- case 0:
- pdev->resource = mmc0_resource;
- pdev->num_resources = ARRAY_SIZE(mmc0_resource);
- pdev->dev.platform_data = &mmc0_data;
- break;
- case 1:
- pdev->resource = mmc1_resource;
- pdev->num_resources = ARRAY_SIZE(mmc1_resource);
- pdev->dev.platform_data = &mmc1_data;
- break;
- default:
+ if (mxs_get_type(PINID_SSP0_CMD) == PIN_FUN1) {
+ pdev = mxs_get_device("mxs-mmc", 0);
+ if (pdev == NULL || IS_ERR(pdev))
return;
- }
+ pdev->resource = mmc0_resource;
+ pdev->num_resources = ARRAY_SIZE(mmc0_resource);
+ pdev->dev.platform_data = &mmc0_data;
+ mxs_add_device(pdev, 2);
+ }
+
+ if (mxs_get_type(PINID_GPMI_RDY1) == PIN_FUN2) {
+ pdev = mxs_get_device("mxs-mmc", 1);
+ if (pdev == NULL || IS_ERR(pdev))
+ return;
+ pdev->resource = mmc1_resource;
+ pdev->num_resources = ARRAY_SIZE(mmc1_resource);
+ pdev->dev.platform_data = &mmc1_data;
mxs_add_device(pdev, 2);
}
}
diff --git a/arch/arm/mach-mx28/pinctrl.c b/arch/arm/mach-mx28/pinctrl.c
index 32c6e1f6177f..296f4036395d 100644
--- a/arch/arm/mach-mx28/pinctrl.c
+++ b/arch/arm/mach-mx28/pinctrl.c
@@ -96,6 +96,19 @@ static void mx28_set_type(struct pin_bank *bank,
__raw_writel(cfg << id, addr + SET_REGISTER);
}
+static int mx28_get_type(struct pin_bank *bank,
+ unsigned int id)
+{
+ void __iomem *addr;
+ int ret;
+ addr = PINCTRL_BASE_ADDR + HW_PINCTRL_MUXSEL0;
+ addr += 0x20 * bank->id + 0x10 * (id >> 4);
+ id &= 0xF;
+ id *= 2;
+ ret = (__raw_readl(addr) >> id) & 0x3;
+ return ret;
+}
+
static struct pin_bank mx28_pin_banks[6] = {
[0] = {
.id = 0,
@@ -132,6 +145,7 @@ static struct pinctrl_chip mx28_pinctrl = {
.set_voltage = mx28_set_voltage,
.set_pullup = mx28_set_pullup,
.set_type = mx28_set_type,
+ .get_type = mx28_get_type,
};
int __init mx28_pinctrl_init(void)