diff options
author | paul.chen <paul.chen@wtmec.com> | 2013-03-02 14:19:55 +0800 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2019-07-22 19:40:04 +0200 |
commit | e5e59fae58d5566d349870f188637895f3e3b631 (patch) | |
tree | 8bcb6c043318ffa04ce0bb1ea47db00d0bdf9caf | |
parent | a517a7a830469a3d863b5e6f6e76c7a9a4a6611d (diff) | |
download | linux-mmp3-dell-ariel-e5e59fae58d5566d349870f188637895f3e3b631.tar.gz |
Driver/ARCH <input/rtc>
Commit for ENE EC driver
RTC driver init version.
arch/arm/mach-mmp/qseven.c support power off/reboot but need EC firmware
modified: arch/arm/configs/qseven_defconfig
modified: arch/arm/mach-mmp/include/mach/mfp-mmp2.h
modified: arch/arm/mach-mmp/qseven.c
modified: drivers/input/serio/Kconfig
modified: drivers/input/serio/Makefile
modified: drivers/rtc/Kconfig
modified: drivers/rtc/Makefile
Untracked files:
(use "git add <file>..." to include in what will be committed)
drivers/input/serio/eneec.c
drivers/input/serio/eneec_ioc.h
drivers/input/serio/eneec_spi.c
drivers/rtc/rtc-idt1338.c
include/linux/i2c/eneec.h
(cherry picked from commit 6c7d526bb58ebeafee1f2718beecade322eaf12f)
-rw-r--r-- | arch/arm/configs/qseven_defconfig | 15 | ||||
-rw-r--r-- | arch/arm/mach-mmp/include/mach/mfp-mmp2.h | 5 | ||||
-rw-r--r-- | arch/arm/mach-mmp/qseven.c | 94 | ||||
-rw-r--r-- | drivers/input/serio/Kconfig | 19 | ||||
-rw-r--r-- | drivers/input/serio/Makefile | 2 | ||||
-rw-r--r-- | drivers/rtc/Kconfig | 10 | ||||
-rw-r--r-- | drivers/rtc/Makefile | 1 |
7 files changed, 137 insertions, 9 deletions
diff --git a/arch/arm/configs/qseven_defconfig b/arch/arm/configs/qseven_defconfig index ededcb1808745..19e52ae2eca9b 100644 --- a/arch/arm/configs/qseven_defconfig +++ b/arch/arm/configs/qseven_defconfig @@ -770,7 +770,7 @@ CONFIG_WEXT_CORE=y CONFIG_WEXT_PROC=y CONFIG_WEXT_SPY=y CONFIG_WEXT_PRIV=y -CONFIG_CFG80211=y +CONFIG_CFG80211=m # CONFIG_NL80211_TESTMODE is not set # CONFIG_CFG80211_DEVELOPER_WARNINGS is not set # CONFIG_CFG80211_REG_DEBUG is not set @@ -779,16 +779,17 @@ CONFIG_CFG80211_DEFAULT_PS=y # CONFIG_CFG80211_INTERNAL_REGDB is not set CONFIG_CFG80211_WEXT=y CONFIG_WIRELESS_EXT_SYSFS=y -# CONFIG_LIB80211 is not set +CONFIG_LIB80211=y +# CONFIG_LIB80211_DEBUG is not set # CONFIG_CFG80211_ALLOW_RECONNECT is not set -CONFIG_MAC80211=y +CONFIG_MAC80211=m CONFIG_MAC80211_HAS_RC=y CONFIG_MAC80211_RC_MINSTREL=y CONFIG_MAC80211_RC_MINSTREL_HT=y CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" # CONFIG_MAC80211_MESH is not set -# CONFIG_MAC80211_LEDS is not set +CONFIG_MAC80211_LEDS=y # CONFIG_MAC80211_DEBUGFS is not set # CONFIG_MAC80211_DEBUG_MENU is not set # CONFIG_WIMAX is not set @@ -2261,7 +2262,11 @@ CONFIG_EXT2_FS_XATTR=y # CONFIG_EXT2_FS_POSIX_ACL is not set # CONFIG_EXT2_FS_SECURITY is not set # CONFIG_EXT2_FS_XIP is not set -# CONFIG_EXT3_FS is not set +CONFIG_EXT3_FS=y +CONFIG_EXT3_DEFAULTS_TO_ORDERED=y +CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_POSIX_ACL is not set +# CONFIG_EXT3_FS_SECURITY is not set CONFIG_EXT4_FS=y # CONFIG_EXT4_USE_FOR_EXT23 is not set CONFIG_EXT4_FS_XATTR=y diff --git a/arch/arm/mach-mmp/include/mach/mfp-mmp2.h b/arch/arm/mach-mmp/include/mach/mfp-mmp2.h index aa2f0975d789e..49a55e87c1dba 100644 --- a/arch/arm/mach-mmp/include/mach/mfp-mmp2.h +++ b/arch/arm/mach-mmp/include/mach/mfp-mmp2.h @@ -522,7 +522,9 @@ #define HSI_CAFLAG MFP_CFG(GPIO121, AF2) #define HSI_CADATA MFP_CFG(GPIO122, AF2) +#if 0 /*ULPI for QSEVEN rev 1 board*/ + #define ULPI_DATA_0_GPIO_66 MFP_CFG(GPIO66, AF2) #define ULPI_DATA_1_GPIO_65 MFP_CFG(GPIO65, AF2) #define ULPI_DATA_2_GPIO_64 MFP_CFG(GPIO64, AF2) @@ -542,9 +544,12 @@ /* AP CP - Orchid */ #define AP_RESET_OUT_N MFP_CFG(GPIO154, AF1) | MFP_PULL_LOW +#endif /* smart bat - Orchid */ #define SMART_BAT MFP_CFG(GPIO123, AF2) | MFP_PULL_HIGH +/* Ariel ENE EC */ +#define ENE_KB_INT_GPIO_60 MFP_CFG(GPIO60, AF0) #endif /* __ASM_MACH_MFP_MMP2_H */ diff --git a/arch/arm/mach-mmp/qseven.c b/arch/arm/mach-mmp/qseven.c index a82b72681df8a..e83b3ee740ab1 100644 --- a/arch/arm/mach-mmp/qseven.c +++ b/arch/arm/mach-mmp/qseven.c @@ -64,6 +64,7 @@ #include <media/soc_camera.h> #include <mach/mmp3_pm.h> #include <mach/gpio.h> +#include <linux/i2c/eneec.h> #include "common.h" #include "onboard.h" @@ -206,6 +207,9 @@ static unsigned long qseven_pin_config[] __initdata = { GPIO99_LCD_DD21, GPIO100_LCD_DD22, GPIO101_LCD_DD23, + + /* ENE EC */ + ENE_KB_INT_GPIO_60, }; static unsigned long mmc1_pin_config[] __initdata = { @@ -390,10 +394,13 @@ struct tsc2007_platform_data tsc_2007_data = { #endif #endif -#if 0 static struct i2c_board_info qseven_twsi4_info[] = { { + .type = "KB39XX", + .addr = 0x58, + .irq = IRQ_GPIO(mfp_to_gpio(ENE_KB_INT_GPIO_60)), }, +#if 0 #if defined(CONFIG_TOUCHSCREEN_TSC2007) { .type = "tsc2007", @@ -402,8 +409,8 @@ static struct i2c_board_info qseven_twsi4_info[] = { .platform_data = &tsc_2007_data, }, #endif -}; #endif +}; static struct i2c_board_info qseven_twsi3_info[] = { { @@ -472,6 +479,10 @@ static struct i2c_board_info qseven_twsi1_mar88pm867_info[] = { .addr = (0x32>>1), .platform_data = &qseven_mar88pm867_pdata, }, + { + .type = "rtc_idt1338", + .addr = 0x68, + }, }; static struct regulator_consumer_supply qseven_fixed_regulator_supply[] = { @@ -1134,8 +1145,80 @@ static struct mv_cam_pdata mv_cam_data = { }; #endif +/* + * Ariel Power control: ( Power off / Reset ) + * Send 10MHz pulse from GPIO 126 to EC When system ready to power off or reboot. + * Power off : GPIO 127 high + * System reset : GPIO 127 low +*/ +#define EC_PW_OFF 1 +#define EC_PW_RESET 0 +extern int (*board_reset)(char mode, const char *cmd); +static int ariel_board_reset(char mode, const char *cmd) +{ + int off_signal,off_control; + off_signal = mfp_to_gpio(MFP_PIN_GPIO126); + off_control = mfp_to_gpio(MFP_PIN_GPIO127); + if (gpio_request(off_signal, "halt signal")) { + pr_err("Failed to request halt signal gpio\n"); + return -EIO; + } + if (gpio_request(off_control, "halt_reset pin")) { + pr_err("Failed to request halt reset gpio\n"); + return -EIO; + } + gpio_direction_output(off_control, EC_PW_RESET); + while(1){ + gpio_direction_output(off_signal, 0); + mdelay(50); + gpio_direction_output(off_signal, 1); + mdelay(50); + } + /* Rebooting... */ + return 1; +} + +static void ariel_poweroff(void) +{ + int off_signal,off_control; + off_signal = mfp_to_gpio(MFP_PIN_GPIO126); + off_control = mfp_to_gpio(MFP_PIN_GPIO127); + if (gpio_request(off_signal, "halt signal")) { + pr_err("Failed to request halt signal gpio\n"); + return -EIO; + } + if (gpio_request(off_control, "halt_reset pin")) { + pr_err("Failed to request halt reset gpio\n"); + return -EIO; + } + gpio_direction_output(off_control, EC_PW_OFF); + while(1){ + gpio_direction_output(off_signal, 0); + mdelay(50); + gpio_direction_output(off_signal, 1); + mdelay(50); + } + /* Power off... */ +} + +static void eneec_init_gpio_irq(void) +{ + int gpio = mfp_to_gpio(ENE_KB_INT_GPIO_60); + + if (gpio_request(gpio, "ENE EC irq")) { + pr_err("gpio %d request failed\n", gpio); + return -1; + } + gpio_direction_input(gpio); + mdelay(100); + gpio_free(gpio); + return 0; + +} + static void __init qseven_init(void) { + mfp_config(ARRAY_AND_SIZE(qseven_pin_config)); qseven_update_ddr_info(); @@ -1150,6 +1233,8 @@ static void __init qseven_init(void) qseven_power_supply_init(); mmp3_add_twsi(1, NULL, ARRAY_AND_SIZE(qseven_twsi1_mar88pm867_info)); #endif + board_reset = ariel_board_reset; + pm_power_off = ariel_poweroff; #if 0 #if defined(CONFIG_TOUCHSCREEN_TSC2007) @@ -1157,8 +1242,8 @@ static void __init qseven_init(void) #endif #endif -#if 0 mmp3_add_twsi(4, NULL, ARRAY_AND_SIZE(qseven_twsi4_info)); +#if 0 mmp3_add_keypad(&mmp3_keypad_info); #endif @@ -1183,8 +1268,8 @@ static void __init qseven_init(void) /* backlight */ mmp3_add_pwm(3); platform_device_register(&qseven_lcd_backlight_devices); - mmp3_add_thermal(); #endif + mmp3_add_thermal(); #ifdef CONFIG_ANDROID_PMEM pxa_add_pmem(); @@ -1252,6 +1337,7 @@ static void __init qseven_init(void) qseven_regulators(); #endif // pxa_u3d_phy_disable(); //paul disable due to Ariel2 disable USB3 Power + eneec_init_gpio_irq(); } MACHINE_START(QSEVEN, "Qseven") diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig index 55f2c2293ec6a..0595d1a6b7e9a 100644 --- a/drivers/input/serio/Kconfig +++ b/drivers/input/serio/Kconfig @@ -234,4 +234,23 @@ config SERIO_PS2MULT To compile this driver as a module, choose M here: the module will be called ps2mult. +config SERIO_ENEEC_KB3930_I2C + tristate "ENE EC serio driver" + default y + depends on ARM && I2C + help + KB3930 is the chip over which the standard AT keyboard and PS/2 + mouse are connected to the computer. If you use these devices, + you'll need to say Y here. + + If unsure, say Y. + + To compile this driver as a module, choose M here: the + module will be called ennec. + +#config SERIO_ENEEC_KB3930_SPI +# tristate "ENE EC serio driver over SPI" +# default y +# depends on ARM && I2C + endif diff --git a/drivers/input/serio/Makefile b/drivers/input/serio/Makefile index dbbe37616c92e..faa6e20c04903 100644 --- a/drivers/input/serio/Makefile +++ b/drivers/input/serio/Makefile @@ -25,3 +25,5 @@ obj-$(CONFIG_SERIO_RAW) += serio_raw.o obj-$(CONFIG_SERIO_AMS_DELTA) += ams_delta_serio.o obj-$(CONFIG_SERIO_XILINX_XPS_PS2) += xilinx_ps2.o obj-$(CONFIG_SERIO_ALTERA_PS2) += altera_ps2.o +obj-$(CONFIG_SERIO_ENEEC_KB3930_I2C) += eneec.o +obj-$(CONFIG_SERIO_ENEEC_KB3930_SPI) += eneec_spi.o diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index 7b10c6160495b..f6a57d330a754 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -417,6 +417,16 @@ config RTC_DRV_RV3029C2 This driver can also be built as a module. If so, the module will be called rtc-rv3029c2. +config RTC_DRV_IDT1338 + tristate "IDT 1338 RTC driver" + depends on RTC_CLASS && ARCH_MMP + help + If you say yes here you get support for the + IDT 1338 RTC module. + + This drive can also be built as a module. If so, the module + will be called rtc-idt1338 + endif # I2C comment "SPI RTC drivers" diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index ed4194958f3b9..53a9d8f5ec038 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile @@ -114,3 +114,4 @@ obj-$(CONFIG_RTC_DRV_MAX77601) += rtc-max77601.o obj-$(CONFIG_RTC_DRV_MMP) += rtc-mmp.o obj-$(CONFIG_RTC_DRV_88PM860X) += rtc-88pm860x.o obj-$(CONFIG_RTC_DRV_88PM80X) += rtc-88pm80x.o +obj-$(CONFIG_RTC_DRV_IDT1338) += rtc-idt1338.o |