aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/dm365.c
diff options
context:
space:
mode:
authorMiguel Aguilar <miguel.aguilar@ridgerun.com>2009-10-13 15:57:07 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-11-25 13:21:32 -0500
commit990c09d5f5b2079e8bf3c6615c78fa5ed2b97147 (patch)
tree3f1bd62c06d7cdf354a6e0ea34325e8f60853c06 /arch/arm/mach-davinci/dm365.c
parent1ce52121c415457e92c281aaec4b38a864278fa2 (diff)
Davinci: DM365: Enable DaVinci Key Scan support for DM365 EVM
The general structures are defined at DM365 SoC file and the specific platform data structure for the EVM is defined at board file. Signed-off-by: Miguel Aguilar <miguel.aguilar@ridgerun.com>
Diffstat (limited to 'arch/arm/mach-davinci/dm365.c')
-rw-r--r--arch/arm/mach-davinci/dm365.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index 0fbc2f261ee3..c12bb005b90d 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -31,6 +31,7 @@
31#include <mach/serial.h> 31#include <mach/serial.h>
32#include <mach/common.h> 32#include <mach/common.h>
33#include <mach/asp.h> 33#include <mach/asp.h>
34#include <mach/keyscan.h>
34 35
35#include "clock.h" 36#include "clock.h"
36#include "mux.h" 37#include "mux.h"
@@ -530,7 +531,7 @@ MUX_CFG(DM365, EMAC_CRS, 3, 2, 1, 1, false)
530MUX_CFG(DM365, EMAC_MDIO, 3, 1, 1, 1, false) 531MUX_CFG(DM365, EMAC_MDIO, 3, 1, 1, 1, false)
531MUX_CFG(DM365, EMAC_MDCLK, 3, 0, 1, 1, false) 532MUX_CFG(DM365, EMAC_MDCLK, 3, 0, 1, 1, false)
532 533
533MUX_CFG(DM365, KEYPAD, 2, 0, 0x3f, 0x3f, false) 534MUX_CFG(DM365, KEYSCAN, 2, 0, 0x3f, 0x3f, false)
534 535
535MUX_CFG(DM365, PWM0, 1, 0, 3, 2, false) 536MUX_CFG(DM365, PWM0, 1, 0, 3, 2, false)
536MUX_CFG(DM365, PWM0_G23, 3, 26, 3, 3, false) 537MUX_CFG(DM365, PWM0_G23, 3, 26, 3, 3, false)
@@ -849,6 +850,28 @@ static struct map_desc dm365_io_desc[] = {
849 }, 850 },
850}; 851};
851 852
853static struct resource dm365_ks_resources[] = {
854 {
855 /* registers */
856 .start = DM365_KEYSCAN_BASE,
857 .end = DM365_KEYSCAN_BASE + SZ_1K - 1,
858 .flags = IORESOURCE_MEM,
859 },
860 {
861 /* interrupt */
862 .start = IRQ_DM365_KEYINT,
863 .end = IRQ_DM365_KEYINT,
864 .flags = IORESOURCE_IRQ,
865 },
866};
867
868static struct platform_device dm365_ks_device = {
869 .name = "davinci_keyscan",
870 .id = 0,
871 .num_resources = ARRAY_SIZE(dm365_ks_resources),
872 .resource = dm365_ks_resources,
873};
874
852/* Contents of JTAG ID register used to identify exact cpu type */ 875/* Contents of JTAG ID register used to identify exact cpu type */
853static struct davinci_id dm365_ids[] = { 876static struct davinci_id dm365_ids[] = {
854 { 877 {
@@ -948,6 +971,13 @@ void __init dm365_init_asp(struct snd_platform_data *pdata)
948 platform_device_register(&dm365_asp_device); 971 platform_device_register(&dm365_asp_device);
949} 972}
950 973
974void __init dm365_init_ks(struct davinci_ks_platform_data *pdata)
975{
976 davinci_cfg_reg(DM365_KEYSCAN);
977 dm365_ks_device.dev.platform_data = pdata;
978 platform_device_register(&dm365_ks_device);
979}
980
951void __init dm365_init(void) 981void __init dm365_init(void)
952{ 982{
953 davinci_common_init(&davinci_soc_info_dm365); 983 davinci_common_init(&davinci_soc_info_dm365);