diff options
author | Terry Lv <r65388@freescale.com> | 2011-08-16 16:04:44 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-01-09 20:23:16 +0800 |
commit | 8dc22327a10b45896f630a4868b82417a8cb3f55 (patch) | |
tree | 055ce33b043b49533a3615ebc249f1dc20c9dc99 /arch/arm/plat-mxc/devices/platform-imx-viim.c | |
parent | cb9b8a45b67baef7020575ef0e7699078d569d05 (diff) |
ENGR00154889-1: Add virtual iim driver to imx5 and imx6 platform
This patch adds platform changes to system files, including:
1. Add viim platform deivce.
2. Add viim menu.
Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'arch/arm/plat-mxc/devices/platform-imx-viim.c')
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-imx-viim.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/devices/platform-imx-viim.c b/arch/arm/plat-mxc/devices/platform-imx-viim.c new file mode 100644 index 000000000000..1abc2acb0fdd --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-imx-viim.c @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. + * + * 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 <mach/hardware.h> +#include <mach/devices-common.h> +#include <linux/fsl_devices.h> + +#ifdef CONFIG_SOC_IMX51 +#define GPT_REG_BASE_ADDR (MX50_GPT1_BASE_ADDR) +const struct imx_viim_data imx50_viim_data = { + .iobase = MX50_OCOTP_CTRL_BASE_ADDR, +}; +#endif + +#ifdef CONFIG_SOC_IMX6Q +#define GPT_REG_BASE_ADDR (GPT_BASE_ADDR) +const struct imx_viim_data imx6q_viim_data = { + .iobase = OCOTP_BASE_ADDR, +}; +#endif + +struct platform_device *__init imx_add_viim( + const struct imx_viim_data *data) +{ + struct resource res[] = { + [0] = { + .start = GPT_REG_BASE_ADDR, + .end = GPT_REG_BASE_ADDR + PAGE_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = data->iobase, + .end = data->iobase + PAGE_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + }; + + return imx_add_platform_device("mxs-viim", 0, + res, ARRAY_SIZE(res), NULL, 0); +} + |