diff options
Diffstat (limited to 'include/linux')
87 files changed, 4109 insertions, 185 deletions
diff --git a/include/linux/android_alarm.h b/include/linux/android_alarm.h index 68c9b0f..4c93791 100644 --- a/include/linux/android_alarm.h +++ b/include/linux/android_alarm.h @@ -76,6 +76,8 @@ ktime_t alarm_get_elapsed_realtime(void); int alarm_set_rtc(const struct timespec ts); #if defined(CONFIG_RTC_ALARM_BOOT) int alarm_set_alarm_boot(char *alarm_data); +#elif defined(CONFIG_RTC_POWER_OFF) +int alarm_set_alarm_poweroff(char *alarm_data); #endif #endif @@ -102,9 +104,11 @@ enum android_alarm_return_flags { #define ANDROID_ALARM_SET(type) ALARM_IOW(2, type, struct timespec) #define ANDROID_ALARM_SET_AND_WAIT(type) ALARM_IOW(3, type, struct timespec) #define ANDROID_ALARM_GET_TIME(type) ALARM_IOW(4, type, struct timespec) -#define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec) +#define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec) #if defined(CONFIG_RTC_ALARM_BOOT) -#define ANDROID_ALARM_SET_ALARM_BOOT _IOW('a', 7, struct timespec) +#define ANDROID_ALARM_SET_ALARM_BOOT _IOW('a', 7, struct timespec) +#elif defined(CONFIG_RTC_POWER_OFF) +#define ANDROID_ALARM_SET_ALARM_POWEROFF _IOW('a', 8, struct timespec) #endif #define ANDROID_ALARM_BASE_CMD(cmd) (cmd & ~(_IOC(0, 0, 0xf0, 0))) #define ANDROID_ALARM_IOCTL_TO_TYPE(cmd) (_IOC_NR(cmd) >> 4) diff --git a/include/linux/battery/samsung_battery.h b/include/linux/battery/samsung_battery.h index ea6d515..f58c839 100644 --- a/include/linux/battery/samsung_battery.h +++ b/include/linux/battery/samsung_battery.h @@ -19,11 +19,21 @@ #include <linux/delay.h> #include <linux/power_supply.h> #include <linux/android_alarm.h> +#if defined(CONFIG_S3C_ADC) +#include <plat/adc.h> +#endif +#if defined(CONFIG_STMPE811_ADC) +#include <linux/stmpe811-adc.h> +#endif + /* macro */ #define MAX(x, y) ((x) > (y) ? (x) : (y)) #define MIN(x, y) ((x) < (y) ? (x) : (y)) #define ABS(x) ((x) < 0 ? (-1 * (x)) : (x)) +#define INRANGE(val, x, y) (((x <= val) && (val <= y)) || \ + ((y <= val) && (val <= x)) ? 1 : 0) + /* common */ enum { @@ -79,6 +89,7 @@ struct battery_info { unsigned int charge_virt_state; unsigned int charge_type; unsigned int charge_current; + int charge_current_avg; unsigned int input_current; /* battery state */ @@ -91,6 +102,7 @@ struct battery_info { unsigned int battery_raw_soc; int battery_r_s_delta; int battery_full_soc; + int battery_vf_adc; /* temperature */ int battery_temper; @@ -101,6 +113,8 @@ struct battery_info { /* cable type */ unsigned int cable_type; + unsigned int cable_sub_type; + unsigned int cable_pwr_type; /* For SAMSUNG charge spec */ unsigned int vf_state; @@ -109,24 +123,44 @@ struct battery_info { unsigned int freezed_state; unsigned int full_charged_state; unsigned int abstimer_state; + unsigned int abstimer_active; unsigned int recharge_phase; unsigned int recharge_start; unsigned int health_state; - unsigned int lpm_state; + /* SIOP */ unsigned int siop_state; unsigned int siop_charge_current; + unsigned int siop_lv; + + /* etc... */ + unsigned int lpm_state; unsigned int led_state; + unsigned int slate_mode; /* ambiguous state */ unsigned int ambiguous_state; + /* event sceanario */ + unsigned int event_state; + unsigned int event_type; + /* time management */ unsigned int charge_start_time; - struct alarm alarm; + struct timespec current_time; + struct alarm monitor_alarm; + struct alarm event_alarm; bool slow_poll; ktime_t last_poll; + /* irq */ + int batdet_gpio; + int batdet_irq; + bool batdet_irq_st; + + /* adc power */ + bool adc_pwr_st; + struct proc_dir_entry *entry; /* For debugging */ @@ -136,6 +170,11 @@ struct battery_info { /* factory mode */ bool factory_mode; +#if defined(CONFIG_TARGET_LOCALE_KOR) + /* error test charging off mode */ + bool errortest_stopcharging; +#endif + #if defined(CONFIG_TARGET_LOCALE_KOR) || defined(CONFIG_MACH_M0_CTC) bool is_unspec_phase; bool is_unspec_recovery; @@ -150,6 +189,29 @@ struct battery_info { /* jig state */ extern bool is_jig_attached; +/* charger detect source */ +#if defined(CONFIG_MACH_C1_KOR_SKT) || \ + defined(CONFIG_MACH_C1_KOR_KT) || defined(CONFIG_MACH_C1_KOR_LGT) || \ + defined(CONFIG_MACH_BAFFIN) +#undef USE_CHGIN_INTR +#else +#define USE_CHGIN_INTR +#endif + +/* extended online type */ +#if defined(CONFIG_MACH_T0) +#define EXTENDED_ONLINE_TYPE +#else +#undef EXTENDED_ONLINE_TYPE +#endif + +/* use 2step charge termination */ +#if defined(CONFIG_MACH_T0) +#define USE_2STEP_TERM +#else +#undef USE_2STEP_TERM +#endif + /* * Use for charger */ @@ -180,6 +242,13 @@ enum soc_type { /* * Use for battery */ + +enum status_full_type { + STATUS_NOT_FULL = 0, + STATUS_1ST_FULL, + STATUS_2ND_FULL, +}; + #define OFF_CURR 0 /* charger off current */ #define KEEP_CURR -1 /* keep previous current */ @@ -198,14 +267,24 @@ enum soc_type { #define ADC_ERR_CNT 5 #define ADC_ERR_DELAY 200 +/* WORKAROUND: define audio dock current */ +#define DOCK_TYPE_AUDIO_CURR 1000 +#define DOCK_TYPE_SMART_NOTG_CURR 1700 +#define DOCK_TYPE_SMART_OTG_CURR 1000 +#define DOCK_TYPE_LOW_CURR 475 + /* voltage diff for recharge voltage calculation */ -#if defined(CONFIG_TARGET_LOCALE_KOR) +#if defined(CONFIG_TARGET_LOCALE_KOR) || defined(CONFIG_MACH_M0_CTC) /* KOR model spec : max-voltage minus 60mV */ #define RECHG_DROP_VALUE 60000 #else #define RECHG_DROP_VALUE 50000 /* 4300mV */ #endif +/* power off condition, low %duV than VOLTAGE_MIN_DESIGN & SOC 0% */ +#define PWROFF_MARGIN 100000 +#define PWROFF_SOC 0 + enum { CHARGE_DISABLE = 0, CHARGE_ENABLE, @@ -235,12 +314,29 @@ enum { TEMPER_UNKNOWN, }; +/* vf detect source */ +enum { + VF_DET_ADC = 0, + VF_DET_CHARGER, + VF_DET_GPIO, + + VF_DET_UNKNOWN, +}; + + /* siop state */ enum { SIOP_DEACTIVE = 0, SIOP_ACTIVE, }; +enum siop_level { + SIOP_LV0 = 0, + SIOP_LV1, + SIOP_LV2, + SIOP_LV3, +}; + /* monitoring mode */ enum { MONITOR_CHNG = 0, @@ -278,6 +374,31 @@ enum led_pattern { BATT_LED_PATT_NOT_CHG, }; +/* event case */ +enum event_type { + EVENT_TYPE_WCDMA_CALL = 0, + EVENT_TYPE_GSM_CALL, + EVENT_TYPE_CALL, + EVENT_TYPE_VIDEO, + EVENT_TYPE_MUSIC, + EVENT_TYPE_BROWSER, + EVENT_TYPE_HOTSPOT, + EVENT_TYPE_CAMERA, + EVENT_TYPE_DATA_CALL, + EVENT_TYPE_GPS, + EVENT_TYPE_LTE, + EVENT_TYPE_WIFI, + EVENT_TYPE_USE, + + EVENT_TYPE_MAX, +}; + +enum event_state { + EVENT_STATE_CLEAR = 0, + EVENT_STATE_IN_TIMER, + EVENT_STATE_SET, +}; + /** * struct sec_bat_plaform_data - init data for sec batter driver * @fuel_gauge_name: power supply name of fuel gauge @@ -301,6 +422,9 @@ struct samsung_battery_platform_data { unsigned int chg_curr_wpc; unsigned int chg_curr_dock; unsigned int chg_curr_etc; + unsigned int chg_curr_siop_lv1; + unsigned int chg_curr_siop_lv2; + unsigned int chg_curr_siop_lv3; /* variable monitoring interval */ unsigned int chng_interval; @@ -327,13 +451,36 @@ struct samsung_battery_platform_data { int freeze_stop_temp; int freeze_recovery_temp; - /* Temperature source 0: fuelgauge, 1: ap adc, 2: ex. adc */ + /* CTIA spec */ + bool ctia_spec; + + /* event sceanario */ + unsigned int event_time; + + /* CTIA temperature */ + int event_overheat_stop_temp; + int event_overheat_recovery_temp; + int event_freeze_stop_temp; + int event_freeze_recovery_temp; + int lpm_overheat_stop_temp; + int lpm_overheat_recovery_temp; + int lpm_freeze_stop_temp; + int lpm_freeze_recovery_temp; + + /* temperature source 0: fuelgauge, 1: ap adc, 2: ex. adc */ int temper_src; int temper_ch; #ifdef CONFIG_S3C_ADC int (*covert_adc) (int, int); #endif + /* battery vf source 0: adc(polling), 1: charger(interrupt) */ + int vf_det_src; + int vf_det_ch; + int vf_det_th_l; + int vf_det_th_h; + int batt_present_gpio; + /* suspend in charging */ bool suspend_chging; diff --git a/include/linux/compaction.h b/include/linux/compaction.h index cc9f7a4..10cd674 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h @@ -24,8 +24,10 @@ extern unsigned long try_to_compact_pages(struct zonelist *zonelist, int order, gfp_t gfp_mask, nodemask_t *mask, bool sync); extern unsigned long compaction_suitable(struct zone *zone, int order); +#ifndef CONFIG_DMA_CMA extern unsigned long compact_zone_order(struct zone *zone, int order, gfp_t gfp_mask, bool sync); +#endif /* Do not skip compaction more than 64 times */ #define COMPACT_MAX_DEFER_SHIFT 6 diff --git a/include/linux/cpufreq_pegasusq.h b/include/linux/cpufreq_pegasusq.h index ed48127..6c2d82b 100644 --- a/include/linux/cpufreq_pegasusq.h +++ b/include/linux/cpufreq_pegasusq.h @@ -19,4 +19,7 @@ int cpufreq_pegasusq_cpu_lock(int num_core); int cpufreq_pegasusq_cpu_unlock(int num_core); +void cpufreq_pegasusq_min_cpu_lock(unsigned int num_core); +void cpufreq_pegasusq_min_cpu_unlock(void); + #endif diff --git a/include/linux/devfreq/exynos4_display.h b/include/linux/devfreq/exynos4_display.h deleted file mode 100644 index 8a4b957..0000000 --- a/include/linux/devfreq/exynos4_display.h +++ /dev/null @@ -1,28 +0,0 @@ -/* include/linux/devfreq/exynos4_display.h - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. - * http://www.samsung.com/ - * - * Chanwoo Choi <cw00.choi@samsung.com> - * Myungjoo Ham <myungjoo.ham@samsung.com> - * Kyungmin Park <kyungmin.park@samsung.com> - * - * EXYNOS4 - Dynamic LCD refresh rate support - * - * 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. -*/ - -#ifndef __ASM_ARCH_EXYNOS4_DISPLAY_H -#define __ASM_ARCH_EXYNOS4_DISPLAY_H __FILE__ - -#define EXYNOS4_DISPLAY_LV_HF 60 -#define EXYNOS4_DISPLAY_LV_LF 40 -#define EXYNOS4_DISPLAY_LV_DEFAULT EXYNOS4_DISPLAY_LV_HF - -/* Register/unregister display client to exynos4_display */ -extern int exynos4_display_register_client(struct notifier_block *nb); -extern int exynos4_display_unregister_client(struct notifier_block *nb); - -#endif /* __ASM_ARCH_EXYNOS4_DISPLAY_H */ diff --git a/include/linux/device.h b/include/linux/device.h index 69b6a9d..2db1abf 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -588,6 +588,10 @@ struct device { struct dma_coherent_mem *dma_mem; /* internal for coherent mem override */ +#ifdef CONFIG_DMA_CMA + struct cma *cma_area; /* contiguous memory area for dma + allocation */ +#endif /* arch specific additions */ struct dev_archdata archdata; diff --git a/include/linux/diagchar.h b/include/linux/diagchar.h new file mode 100644 index 0000000..026290b --- /dev/null +++ b/include/linux/diagchar.h @@ -0,0 +1,700 @@ +/* Copyright (c) 2008-2012, Code Aurora Forum. 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 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef DIAGCHAR_SHARED +#define DIAGCHAR_SHARED + +#define MSG_MASKS_TYPE 1 +#define LOG_MASKS_TYPE 2 +#define EVENT_MASKS_TYPE 4 +#define PKT_TYPE 8 +#define DEINIT_TYPE 16 +#define USER_SPACE_LOG_TYPE 32 +#define USB_MODE 1 +#define MEMORY_DEVICE_MODE 2 +#define NO_LOGGING_MODE 3 +#define UART_MODE 4 + +/* different values that go in for diag_data_type */ +#define DATA_TYPE_EVENT 0 +#define DATA_TYPE_F3 1 +#define DATA_TYPE_LOG 2 +#define DATA_TYPE_RESPONSE 3 + +/* Different IOCTL values */ +#define DIAG_IOCTL_COMMAND_REG 0 +#define DIAG_IOCTL_SWITCH_LOGGING 7 +#define DIAG_IOCTL_GET_DELAYED_RSP_ID 8 +#define DIAG_IOCTL_LSM_DEINIT 9 + +/* PC Tools IDs */ +#define APQ8060_TOOLS_ID 4062 +#define AO8960_TOOLS_ID 4064 +#define APQ8064_TOOLS_ID 4072 +#define MSM8625_TOOLS_ID 4075 +#define MSM8930_TOOLS_ID 4076 +#define MSM8630_TOOLS_ID 4077 +#define MSM8230_TOOLS_ID 4078 +#define APQ8030_TOOLS_ID 4079 +#define MSM8627_TOOLS_ID 4080 +#define MSM8227_TOOLS_ID 4081 +#define MSM8974_TOOLS_ID 4072 + +#define MSG_MASK_0 (0x00000001) +#define MSG_MASK_1 (0x00000002) +#define MSG_MASK_2 (0x00000004) +#define MSG_MASK_3 (0x00000008) +#define MSG_MASK_4 (0x00000010) +#define MSG_MASK_5 (0x00000020) +#define MSG_MASK_6 (0x00000040) +#define MSG_MASK_7 (0x00000080) +#define MSG_MASK_8 (0x00000100) +#define MSG_MASK_9 (0x00000200) +#define MSG_MASK_10 (0x00000400) +#define MSG_MASK_11 (0x00000800) +#define MSG_MASK_12 (0x00001000) +#define MSG_MASK_13 (0x00002000) +#define MSG_MASK_14 (0x00004000) +#define MSG_MASK_15 (0x00008000) +#define MSG_MASK_16 (0x00010000) +#define MSG_MASK_17 (0x00020000) +#define MSG_MASK_18 (0x00040000) +#define MSG_MASK_19 (0x00080000) +#define MSG_MASK_20 (0x00100000) +#define MSG_MASK_21 (0x00200000) +#define MSG_MASK_22 (0x00400000) +#define MSG_MASK_23 (0x00800000) +#define MSG_MASK_24 (0x01000000) +#define MSG_MASK_25 (0x02000000) +#define MSG_MASK_26 (0x04000000) +#define MSG_MASK_27 (0x08000000) +#define MSG_MASK_28 (0x10000000) +#define MSG_MASK_29 (0x20000000) +#define MSG_MASK_30 (0x40000000) +#define MSG_MASK_31 (0x80000000) + +/* These masks are to be used for support of all legacy messages in the sw. +The user does not need to remember the names as they will be embedded in +the appropriate macros. */ +#define MSG_LEGACY_LOW MSG_MASK_0 +#define MSG_LEGACY_MED MSG_MASK_1 +#define MSG_LEGACY_HIGH MSG_MASK_2 +#define MSG_LEGACY_ERROR MSG_MASK_3 +#define MSG_LEGACY_FATAL MSG_MASK_4 + +/* Legacy Message Priorities */ +#define MSG_LVL_FATAL (MSG_LEGACY_FATAL) +#define MSG_LVL_ERROR (MSG_LEGACY_ERROR | MSG_LVL_FATAL) +#define MSG_LVL_HIGH (MSG_LEGACY_HIGH | MSG_LVL_ERROR) +#define MSG_LVL_MED (MSG_LEGACY_MED | MSG_LVL_HIGH) +#define MSG_LVL_LOW (MSG_LEGACY_LOW | MSG_LVL_MED) + +#define MSG_LVL_NONE 0 + +/* This needs to be modified manually now, when we add + a new RANGE of SSIDs to the msg_mask_tbl */ +#define MSG_MASK_TBL_CNT 23 +#define EVENT_LAST_ID 0x083F + +#define MSG_SSID_0 0 +#define MSG_SSID_0_LAST 90 +#define MSG_SSID_1 500 +#define MSG_SSID_1_LAST 506 +#define MSG_SSID_2 1000 +#define MSG_SSID_2_LAST 1007 +#define MSG_SSID_3 2000 +#define MSG_SSID_3_LAST 2008 +#define MSG_SSID_4 3000 +#define MSG_SSID_4_LAST 3014 +#define MSG_SSID_5 4000 +#define MSG_SSID_5_LAST 4010 +#define MSG_SSID_6 4500 +#define MSG_SSID_6_LAST 4526 +#define MSG_SSID_7 4600 +#define MSG_SSID_7_LAST 4612 +#define MSG_SSID_8 5000 +#define MSG_SSID_8_LAST 5029 +#define MSG_SSID_9 5500 +#define MSG_SSID_9_LAST 5516 +#define MSG_SSID_10 6000 +#define MSG_SSID_10_LAST 6072 +#define MSG_SSID_11 6500 +#define MSG_SSID_11_LAST 6521 +#define MSG_SSID_12 7000 +#define MSG_SSID_12_LAST 7003 +#define MSG_SSID_13 7100 +#define MSG_SSID_13_LAST 7111 +#define MSG_SSID_14 7200 +#define MSG_SSID_14_LAST 7201 +#define MSG_SSID_15 8000 +#define MSG_SSID_15_LAST 8000 +#define MSG_SSID_16 8500 +#define MSG_SSID_16_LAST 8523 +#define MSG_SSID_17 9000 +#define MSG_SSID_17_LAST 9008 +#define MSG_SSID_18 9500 +#define MSG_SSID_18_LAST 9509 +#define MSG_SSID_19 10200 +#define MSG_SSID_19_LAST 10210 +#define MSG_SSID_20 10251 +#define MSG_SSID_20_LAST 10255 +#define MSG_SSID_21 10300 +#define MSG_SSID_21_LAST 10300 +#define MSG_SSID_22 10350 +#define MSG_SSID_22_LAST 10361 + +struct diagpkt_delay_params { + void *rsp_ptr; + int size; + int *num_bytes_ptr; +}; + +static const uint32_t msg_bld_masks_0[] = { + MSG_LVL_LOW, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_ERROR, + MSG_LVL_LOW, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_HIGH, + MSG_LVL_ERROR, + MSG_LVL_LOW, + MSG_LVL_ERROR, + MSG_LVL_ERROR, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_LOW, + MSG_LVL_ERROR, + MSG_LVL_LOW, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_LOW, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED|MSG_MASK_7 | \ + MSG_MASK_8|MSG_MASK_9|MSG_MASK_10|MSG_MASK_11|MSG_MASK_12 | \ + MSG_MASK_13|MSG_MASK_14|MSG_MASK_15|MSG_MASK_16 | \ + MSG_MASK_17|MSG_MASK_18|MSG_MASK_19|MSG_MASK_20|MSG_MASK_21, + MSG_LVL_MED|MSG_MASK_5 | \ + MSG_MASK_6|MSG_MASK_7|MSG_MASK_8|MSG_MASK_9|MSG_MASK_10| \ + MSG_MASK_11|MSG_MASK_12|MSG_MASK_13|MSG_MASK_14| \ + MSG_MASK_15|MSG_MASK_16|MSG_MASK_17, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED|MSG_MASK_5 | \ + MSG_MASK_6|MSG_MASK_7|MSG_MASK_8, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_MED, + MSG_LVL_MED|MSG_MASK_5 | \ + MSG_MASK_6|MSG_MASK_7|MSG_MASK_8|MSG_MASK_9|MSG_MASK_10| \ + MSG_MASK_11|MSG_MASK_12|MSG_MASK_13|MSG_MASK_14|MSG_MASK_15| \ + MSG_MASK_16|MSG_MASK_17|MSG_MASK_18|MSG_MASK_19|MSG_MASK_20| \ + MSG_MASK_21|MSG_MASK_22|MSG_MASK_23|MSG_MASK_24|MSG_MASK_25, + MSG_LVL_MED|MSG_MASK_5 | \ + MSG_MASK_6|MSG_MASK_7|MSG_MASK_8|MSG_MASK_9|MSG_MASK_10, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_LOW, + MSG_LVL_MED, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_HIGH, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW | MSG_MASK_5 | \ + MSG_MASK_6 | MSG_MASK_7 | MSG_MASK_8, + MSG_LVL_LOW | MSG_MASK_5 | \ + MSG_MASK_6, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_LOW, + MSG_LVL_MED | MSG_MASK_5 | \ + MSG_MASK_6|MSG_MASK_7|MSG_MASK_8|MSG_MASK_9|MSG_MASK_10| \ + MSG_MASK_11|MSG_MASK_12|MSG_MASK_13|MSG_MASK_14|MSG_MASK_15 | \ + MSG_MASK_16|MSG_MASK_17|MSG_MASK_18|MSG_MASK_19|MSG_MASK_20, + MSG_LVL_LOW, + MSG_LVL_MED, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW|MSG_LVL_MED|MSG_LVL_HIGH|MSG_LVL_ERROR|MSG_LVL_FATAL, + MSG_LVL_MED, + MSG_LVL_LOW|MSG_LVL_MED|MSG_LVL_HIGH|MSG_LVL_ERROR|MSG_LVL_FATAL, + MSG_LVL_LOW, + MSG_LVL_MED, + MSG_LVL_LOW +}; + +static const uint32_t msg_bld_masks_1[] = { + MSG_LVL_MED, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_LOW, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH +}; + +static const uint32_t msg_bld_masks_2[] = { + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED|MSG_MASK_5, + MSG_LVL_MED, + MSG_LVL_MED +}; + +static const uint32_t msg_bld_masks_3[] = { + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED +}; + +static const uint32_t msg_bld_masks_4[] = { + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_LOW, + MSG_LVL_LOW +}; + +static const uint32_t msg_bld_masks_5[] = { + MSG_LVL_HIGH, + MSG_LVL_MED, + MSG_LVL_HIGH, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED|MSG_LVL_MED|MSG_MASK_5|MSG_MASK_6|MSG_MASK_7| \ + MSG_MASK_8|MSG_MASK_9, + MSG_LVL_MED +}; + +static const uint32_t msg_bld_masks_6[] = { + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW +}; + +static const uint32_t msg_bld_masks_7[] = { + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_LOW +}; + +static const uint32_t msg_bld_masks_8[] = { + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED +}; + +static const uint32_t msg_bld_masks_9[] = { + MSG_LVL_MED|MSG_MASK_5, + MSG_LVL_MED|MSG_MASK_5, + MSG_LVL_MED|MSG_MASK_5, + MSG_LVL_MED|MSG_MASK_5, + MSG_LVL_MED|MSG_MASK_5, + MSG_LVL_MED|MSG_MASK_5, + MSG_LVL_MED|MSG_MASK_5, + MSG_LVL_MED|MSG_MASK_5, + MSG_LVL_MED|MSG_MASK_5, + MSG_LVL_MED|MSG_MASK_5, + MSG_LVL_MED|MSG_MASK_5, + MSG_LVL_MED|MSG_MASK_5, + MSG_LVL_MED|MSG_MASK_5, + MSG_LVL_MED|MSG_MASK_5, + MSG_LVL_MED|MSG_MASK_5, + MSG_LVL_MED|MSG_MASK_5, + MSG_LVL_MED|MSG_MASK_5 +}; + +static const uint32_t msg_bld_masks_10[] = { + MSG_LVL_MED, + MSG_LVL_ERROR, + MSG_LVL_LOW, + MSG_LVL_LOW|MSG_MASK_5 | \ + MSG_MASK_6|MSG_MASK_7|MSG_MASK_8|MSG_MASK_9|MSG_MASK_10| \ + MSG_MASK_11|MSG_MASK_12|MSG_MASK_13|MSG_MASK_14|MSG_MASK_15| \ + MSG_MASK_16|MSG_MASK_17|MSG_MASK_18|MSG_MASK_19|MSG_MASK_20| \ + MSG_MASK_21|MSG_MASK_22, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW, + MSG_LVL_MED, + MSG_LVL_HIGH, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW|MSG_MASK_5, + MSG_LVL_LOW|MSG_MASK_0 | MSG_MASK_1 | MSG_MASK_2 | \ + MSG_MASK_3 | MSG_MASK_4 | MSG_MASK_5 | MSG_MASK_6, + MSG_LVL_HIGH, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_LOW +}; + +static const uint32_t msg_bld_masks_11[] = { + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, +}; + +static const uint32_t msg_bld_masks_12[] = { + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, +}; + +static const uint32_t msg_bld_masks_13[] = { + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, +}; + +static const uint32_t msg_bld_masks_14[] = { + MSG_LVL_MED, + MSG_LVL_MED, +}; + +static const uint32_t msg_bld_masks_15[] = { + MSG_LVL_MED +}; + +static const uint32_t msg_bld_masks_16[] = { + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, +}; + +static const uint32_t msg_bld_masks_17[] = { + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED, + MSG_LVL_MED | MSG_MASK_6 | \ + MSG_MASK_7 | MSG_MASK_8 | MSG_MASK_9, + MSG_LVL_MED | MSG_MASK_5 | \ + MSG_MASK_6 | MSG_MASK_7 | MSG_MASK_8 | MSG_MASK_9 | \ + MSG_MASK_10 | MSG_MASK_11 | MSG_MASK_12 | MSG_MASK_13 | \ + MSG_MASK_14 | MSG_MASK_15 | MSG_MASK_16 | MSG_MASK_17, + MSG_LVL_MED, + MSG_LVL_MED | MSG_MASK_5 | \ + MSG_MASK_6 | MSG_MASK_7 | MSG_MASK_8 | MSG_MASK_9 | \ + MSG_MASK_10 | MSG_MASK_11 | MSG_MASK_12 | MSG_MASK_13 | \ + MSG_MASK_14 | MSG_MASK_15 | MSG_MASK_16 | MSG_MASK_17 | \ + MSG_MASK_18 | MSG_MASK_19 | MSG_MASK_20 | MSG_MASK_21 | \ + MSG_MASK_22, + MSG_LVL_MED, + MSG_LVL_MED, +}; + +static const uint32_t msg_bld_masks_18[] = { + MSG_LVL_LOW, + MSG_LVL_LOW | MSG_MASK_8 | MSG_MASK_9 | MSG_MASK_10 | \ + MSG_MASK_11|MSG_MASK_12|MSG_MASK_13|MSG_MASK_14|MSG_MASK_15 | \ + MSG_MASK_16|MSG_MASK_17|MSG_MASK_18|MSG_MASK_19|MSG_MASK_20, + MSG_LVL_LOW | MSG_MASK_5 | MSG_MASK_6, + MSG_LVL_LOW | MSG_MASK_5, + MSG_LVL_LOW | MSG_MASK_5 | MSG_MASK_6, + MSG_LVL_LOW, + MSG_LVL_LOW | MSG_MASK_5 | \ + MSG_MASK_6 | MSG_MASK_7 | MSG_MASK_8 | MSG_MASK_9, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW +}; + +static const uint32_t msg_bld_masks_19[] = { + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW +}; + +static const uint32_t msg_bld_masks_20[] = { + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW, + MSG_LVL_LOW +}; + +static const uint32_t msg_bld_masks_21[] = { + MSG_LVL_HIGH +}; + +static const uint32_t msg_bld_masks_22[] = { + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH, + MSG_LVL_HIGH +}; + +/* LOG CODES */ + +#define LOG_0 0x0 +#define LOG_1 0x15A7 +#define LOG_2 0x0 +#define LOG_3 0x0 +#define LOG_4 0x4910 +#define LOG_5 0x5420 +#define LOG_6 0x0 +#define LOG_7 0x74FF +#define LOG_8 0x0 +#define LOG_9 0x0 +#define LOG_10 0xA38A +#define LOG_11 0xB201 +#define LOG_12 0x0 +#define LOG_13 0x0 +#define LOG_14 0x0 +#define LOG_15 0x0 + +#define LOG_GET_ITEM_NUM(xx_code) (xx_code & 0x0FFF) + +#endif diff --git a/include/linux/dma-contiguous.h b/include/linux/dma-contiguous.h new file mode 100644 index 0000000..0cc6b4f --- /dev/null +++ b/include/linux/dma-contiguous.h @@ -0,0 +1,119 @@ +#ifndef __LINUX_DMA_CONTIGUOUS_H +#define __LINUX_DMA_CONTIGUOUS_H + +/* + * Contiguous Memory Allocator for DMA mapping framework + * Copyright (c) 2010-2011 by Samsung Electronics. + * Written by: + * Marek Szyprowski <m.szyprowski@samsung.com> + * Michal Nazarewicz <mina86@mina86.com> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License or (at your optional) any later version of the license. + */ + +/* + * Contiguous Memory Allocator + * + * The Contiguous Memory Allocator (CMA) makes it possible to + * allocate big contiguous chunks of memory after the system has + * booted. + * + * Why is it needed? + * + * Various devices on embedded systems have no scatter-getter and/or + * IO map support and require contiguous blocks of memory to + * operate. They include devices such as cameras, hardware video + * coders, etc. + * + * Such devices often require big memory buffers (a full HD frame + * is, for instance, more then 2 mega pixels large, i.e. more than 6 + * MB of memory), which makes mechanisms such as kmalloc() or + * alloc_page() ineffective. + * + * At the same time, a solution where a big memory region is + * reserved for a device is suboptimal since often more memory is + * reserved then strictly required and, moreover, the memory is + * inaccessible to page system even if device drivers don't use it. + * + * CMA tries to solve this issue by operating on memory regions + * where only movable pages can be allocated from. This way, kernel + * can use the memory for pagecache and when device driver requests + * it, allocated pages can be migrated. + * + * Driver usage + * + * CMA should not be used by the device drivers directly. It is + * only a helper framework for dma-mapping subsystem. + * + * For more information, see kernel-docs in drivers/base/dma-contiguous.c + */ + +#ifdef __KERNEL__ + +struct cma; +struct page; +struct device; + +#ifdef CONFIG_DMA_CMA + +/* + * There is always at least global CMA area and a few optional device + * private areas configured in kernel .config. + */ +#define MAX_CMA_AREAS (1 + CONFIG_CMA_AREAS) + +extern struct cma *dma_contiguous_default_area; + +void dma_contiguous_reserve(phys_addr_t addr_limit); +int dma_declare_contiguous(struct device *dev, unsigned long size, + phys_addr_t base, phys_addr_t limit); + +int dma_prepare_alloc_from_contiguous(struct device *dev, int count, + unsigned int order); +struct page *dma_alloc_from_contiguous(struct device *dev, int count, + unsigned int order); +bool dma_release_from_contiguous(struct device *dev, struct page *pages, + int count); + +#else + +#define MAX_CMA_AREAS (0) + +static inline void dma_contiguous_reserve(phys_addr_t limit) { } + +static inline +int dma_declare_contiguous(struct device *dev, unsigned long size, + phys_addr_t base, phys_addr_t limit) +{ + return -ENOSYS; +} + +static inline +int dma_prepare_alloc_from_contiguous(struct device *dev, int count, + unsigned int order) +{ + return -ENOSYS; +} + +static inline +struct page *dma_alloc_from_contiguous(struct device *dev, int count, + unsigned int order) +{ + return NULL; +} + +static inline +bool dma_release_from_contiguous(struct device *dev, struct page *pages, + int count) +{ + return false; +} + +#endif + +#endif + +#endif diff --git a/include/linux/earlysuspend.h b/include/linux/earlysuspend.h index 336a07b..336a07b 100755..100644 --- a/include/linux/earlysuspend.h +++ b/include/linux/earlysuspend.h diff --git a/include/linux/extcon.h b/include/linux/extcon.h index f912294..71b2b2e 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h @@ -72,6 +72,7 @@ enum extcon_cable_name { EXTCON_SPDIF_OUT, EXTCON_VIDEO_IN, EXTCON_VIDEO_OUT, + EXTCON_MECHANICAL, }; extern const char *extcon_cable_name[]; diff --git a/include/linux/exynos_audio.h b/include/linux/exynos_audio.h new file mode 100644 index 0000000..b510119 --- /dev/null +++ b/include/linux/exynos_audio.h @@ -0,0 +1,55 @@ +/* + * exynos_sound.h - audio platform data for exynos + * + * Copyright (C) 2012 Samsung Electrnoics + * Uk Kim <w0806.kim@samsung.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _LINUX_EXYNOS_T0_SOUND_H +#define _LINUX_EXYNOS_T0_SOUND_H + +struct exynos_sound_platform_data { + void (*set_lineout_switch) (int on); + void (*set_ext_main_mic) (int on); + void (*set_ext_sub_mic) (int on); + int (*get_ground_det_value) (void); + int (*get_ground_det_irq_num) (void); +#if defined(CONFIG_SND_DUOS_MODEM_SWITCH) + void (*set_modem_switch) (int on); +#endif + int dcs_offset_l; + int dcs_offset_r; +}; + +#ifdef CONFIG_EXYNOS_SOUND_PLATFORM_DATA + +int exynos_sound_set_platform_data( + const struct exynos_sound_platform_data *data); + +#else + +static inline +int exynos_sound_set_platform_data( + const struct exynos_sound_platform_data *data) +{ + return -ENOSYS; +} + +#endif + +const struct exynos_sound_platform_data *exynos_sound_get_platform_data(void); +#endif diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index f0c0e8a..9da5dad 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -351,8 +351,12 @@ static inline void __ftrace_enabled_restore(int enabled) extern void trace_preempt_on(unsigned long a0, unsigned long a1); extern void trace_preempt_off(unsigned long a0, unsigned long a1); #else - static inline void trace_preempt_on(unsigned long a0, unsigned long a1) { } - static inline void trace_preempt_off(unsigned long a0, unsigned long a1) { } +/* + * Use defines instead of static inlines because some arches will make code out + * of the CALLER_ADDR, when we really want these to be a real nop. + */ +# define trace_preempt_on(a0, a1) do { } while (0) +# define trace_preempt_off(a0, a1) do { } while (0) #endif #ifdef CONFIG_FTRACE_MCOUNT_RECORD diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 15c2623..7b37966 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -23,6 +23,9 @@ struct vm_area_struct; #define ___GFP_REPEAT 0x400u #define ___GFP_NOFAIL 0x800u #define ___GFP_NORETRY 0x1000u +#ifdef CONFIG_DMA_CMA +#define ___GFP_CMA 0x2000u +#endif #define ___GFP_COMP 0x4000u #define ___GFP_ZERO 0x8000u #define ___GFP_NOMEMALLOC 0x10000u @@ -50,7 +53,13 @@ struct vm_area_struct; #define __GFP_HIGHMEM ((__force gfp_t)___GFP_HIGHMEM) #define __GFP_DMA32 ((__force gfp_t)___GFP_DMA32) #define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /* Page is movable */ +#ifndef CONFIG_DMA_CMA #define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE) +#else +#define __GFP_CMA ((__force gfp_t)___GFP_CMA) +#define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE| \ + __GFP_CMA) +#endif /* * Action modifiers - doesn't change the zoning * @@ -122,7 +131,11 @@ struct vm_area_struct; #endif /* This mask makes up all the page movable related flags */ +#ifndef CONFIG_DMA_CMA #define GFP_MOVABLE_MASK (__GFP_RECLAIMABLE|__GFP_MOVABLE) +#else +#define GFP_MOVABLE_MASK (__GFP_RECLAIMABLE|__GFP_MOVABLE|__GFP_CMA) +#endif /* Control page allocator reclaim behavior */ #define GFP_RECLAIM_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\ @@ -155,8 +168,14 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags) return MIGRATE_UNMOVABLE; /* Group based on mobility */ +#ifndef CONFIG_DMA_CMA return (((gfp_flags & __GFP_MOVABLE) != 0) << 1) | ((gfp_flags & __GFP_RECLAIMABLE) != 0); +#else + return (((gfp_flags & __GFP_MOVABLE) != 0) << 1) | + (((gfp_flags & __GFP_CMA) != 0) << 1) | + ((gfp_flags & __GFP_RECLAIMABLE) != 0); +#endif } #ifdef CONFIG_HIGHMEM @@ -374,4 +393,13 @@ extern gfp_t gfp_allowed_mask; extern void pm_restrict_gfp_mask(void); extern void pm_restore_gfp_mask(void); +#ifdef CONFIG_DMA_CMA +/* The below functions must be run on a range from a single zone. */ +extern int alloc_contig_range(unsigned long start, unsigned long end, + unsigned migratetype); +extern void free_contig_range(unsigned long pfn, unsigned nr_pages); +/* CMA stuff */ +extern void init_cma_reserved_pageblock(struct page *page); +#endif + #endif /* __LINUX_GFP_H */ diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 3a93f73..d6a3a55 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -175,9 +175,24 @@ static inline struct page * alloc_zeroed_user_highpage_movable(struct vm_area_struct *vma, unsigned long vaddr) { +#ifndef CONFIG_DMA_CMA return __alloc_zeroed_user_highpage(__GFP_MOVABLE, vma, vaddr); +#else + return __alloc_zeroed_user_highpage(__GFP_MOVABLE|__GFP_CMA, vma, + vaddr); +#endif } +#ifdef CONFIG_DMA_CMA +static inline struct page * +alloc_zeroed_user_highpage_movable_cma(struct vm_area_struct *vma, + unsigned long vaddr) +{ + return __alloc_zeroed_user_highpage(__GFP_MOVABLE|__GFP_CMA, vma, + vaddr); +} +#endif + static inline void clear_highpage(struct page *page) { void *kaddr = kmap_atomic(page, KM_USER0); diff --git a/include/linux/i2c/fm34_we395.h b/include/linux/i2c/fm34_we395.h index 718209d..25de511 100644 --- a/include/linux/i2c/fm34_we395.h +++ b/include/linux/i2c/fm34_we395.h @@ -22,7 +22,7 @@ #ifndef __FEM34_WE395_PDATA_H__ #define __FM34_WE395_PDATA_H__ -#if defined(CONFIG_MACH_C1_KOR_LGT) || defined(CONFIG_MACH_C1VZW) +#if defined(CONFIG_MACH_C1_KOR_LGT) int fm34_set_mode(int mode); #endif diff --git a/include/linux/i2c/mxt1664s.h b/include/linux/i2c/mxt1664s.h index e8795af..4211787 100644 --- a/include/linux/i2c/mxt1664s.h +++ b/include/linux/i2c/mxt1664s.h @@ -88,6 +88,10 @@ enum { RESERVED_T0 = 0, RESERVED_T255 = 255, }; +struct mxt_callbacks { + void (*inform_charger)(struct mxt_callbacks *, bool); +}; + struct mxt_platform_data { int max_finger_touches; int gpio_read_done; @@ -102,7 +106,10 @@ struct mxt_platform_data { int max_w; int (*power_on) (void); int (*power_off) (void); + int (*power_reset) (void); + u8 *(*register_cb)(struct mxt_callbacks *); u8 boot_address; + const char *config_version; }; #endif /* */ diff --git a/include/linux/i2c/mxt224_grande.h b/include/linux/i2c/mxt224_grande.h new file mode 100644 index 0000000..ffea3f1 --- /dev/null +++ b/include/linux/i2c/mxt224_grande.h @@ -0,0 +1,194 @@ +/* + * Copyright (C) 2010, Samsung Electronics Co. Ltd. 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 as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef __MXT224_H__ +#define __MXT224_H__ + +//#define MXT224_DEV_NAME "Atmel MXT224" + +#define MXT224_DEV_NAME "qt602240_ts" + + +#define MXT224_THRESHOLD 40 +#define MXT224E_THRESHOLD 50 +#define MXT224_MAX_MT_FINGERS 10 + +#define MXT_OREINT 10 +#define MXT224_ORIENT_SWAP_NN 1 +#define MXT224_ORIENT_SWAP_XY 7 + + + +#ifdef CONFIG_TOUCHSCREEN_MXT768E +enum { + RESERVED_T0 = 0, + RESERVED_T1, + DEBUG_DELTAS_T2, + DEBUG_REFERENCES_T3, + DEBUG_SIGNALS_T4, + GEN_MESSAGEPROCESSOR_T5, + GEN_COMMANDPROCESSOR_T6, + GEN_POWERCONFIG_T7, + GEN_ACQUISITIONCONFIG_T8, + TOUCH_MULTITOUCHSCREEN_T9, + TOUCH_SINGLETOUCHSCREEN_T10, + TOUCH_XSLIDER_T11, + TOUCH_YSLIDER_T12, + TOUCH_XWHEEL_T13, + TOUCH_YWHEEL_T14, + TOUCH_KEYARRAY_T15, + PROCG_SIGNALFILTER_T16, + PROCI_LINEARIZATIONTABLE_T17, + SPT_COMCONFIG_T18, + RESERVED_T19, + RESERVED_T20, + RESERVED_T21, + RESERVED_T22, + RESERVED_T23, + PROCI_ONETOUCHGESTUREPROCESSOR_T24, + SPT_SELFTEST_T25, + DEBUG_CTERANGE_T26, + PROCI_TWOTOUCHGESTUREPROCESSOR_T27, + RESERVED_T28, + SPT_GPI_T29, + SPT_GATE_T30, + TOUCH_KEYSET_T31, + TOUCH_XSLIDERSET_T32, + RESERVED_T33, + GEN_MESSAGEBLOCK_T34, + SPT_GENERICDATA_T35, + RESERVED_T36, + DEBUG_DIAGNOSTIC_T37, + SPARE_T38, + SPARE_T39, + PROCI_GRIPSUPPRESSION_T40, + SPARE_T41, + PROCI_TOUCHSUPPRESSION_T42, + SPT_DIGITIZER_T43, + SPARE_T44, + SPARE_T45, + SPT_CTECONFIG_T46, + SPARE_T47, + PROCG_NOISESUPPRESSION_T48, + SPARE_T49, + SPARE_T50, + RESERVED_T255 = 255, +}; +#else +enum { + RESERVED_T0 = 0, + RESERVED_T1, + DEBUG_DELTAS_T2, + DEBUG_REFERENCES_T3, + DEBUG_SIGNALS_T4, + GEN_MESSAGEPROCESSOR_T5, + GEN_COMMANDPROCESSOR_T6, + GEN_POWERCONFIG_T7, + GEN_ACQUISITIONCONFIG_T8, + TOUCH_MULTITOUCHSCREEN_T9, + TOUCH_SINGLETOUCHSCREEN_T10, + TOUCH_XSLIDER_T11, + TOUCH_YSLIDER_T12, + TOUCH_XWHEEL_T13, + TOUCH_YWHEEL_T14, + TOUCH_KEYARRAY_T15, + PROCG_SIGNALFILTER_T16, + PROCI_LINEARIZATIONTABLE_T17, + SPT_COMCONFIG_T18, + SPT_GPIOPWM_T19, + PROCI_GRIPFACESUPPRESSION_T20, + RESERVED_T21, + PROCG_NOISESUPPRESSION_T22, + TOUCH_PROXIMITY_T23, + PROCI_ONETOUCHGESTUREPROCESSOR_T24, + SPT_SELFTEST_T25, + DEBUG_CTERANGE_T26, + PROCI_TWOTOUCHGESTUREPROCESSOR_T27, + SPT_CTECONFIG_T28, + SPT_GPI_T29, + SPT_GATE_T30, + TOUCH_KEYSET_T31, + TOUCH_XSLIDERSET_T32, + RESERVED_T33, + GEN_MESSAGEBLOCK_T34, + SPT_GENERICDATA_T35, + RESERVED_T36, + DEBUG_DIAGNOSTIC_T37, + SPT_USERDATA_T38, + SPARE_T39, + PROCI_GRIPSUPPRESSION_T40, + SPARE_T41, + PROCI_TOUCHSUPPRESSION_T42, + SPARE_T43, + SPARE_T44, + SPARE_T45, + SPT_CTECONFIG_T46, + PROCI_STYLUS_T47, + PROCG_NOISESUPPRESSION_T48, + SPARE_T49, + SPARE_T50, + RESERVED_T255 = 255, +}; +#endif + +struct mxt224_platform_data { + int max_finger_touches; + const u8 **config; + const u8 **config_e; + const u8 *t46_ta_cfg; + const u8 *t48_ta_cfg; + int gpio_read_done; + int min_x; + int max_x; + int min_y; + int max_y; + int min_z; + int max_z; + int min_w; + int max_w; + void (*power_on)(void); + void (*power_off)(void); + void (*register_cb)(void*); + void (*read_ta_status)(void*); +// void (*orient_barnch)(int orient_swap);/*TSP TA noise 201107251133*/ +}; + + +typedef enum +{ + QT_PAGE_UP = 0x01, + QT_PAGE_DOWN = 0x02, + QT_DELTA_MODE = 0x10, + QT_REFERENCE_MODE = 0x11, + QT_CTE_MODE = 0x31 +}diagnostic_debug_command; + + +//110927 gumi noise +typedef struct +{ + bool median_on_flag; + bool mferr_setting; + uint8_t mferr_count; + uint8_t t46_actvsyncsperx_for_mferr; + uint8_t t48_mfinvlddiffthr_for_mferr; + uint8_t t48_mferrorthr_for_mferr; + uint8_t t48_thr_for_mferr; + uint8_t t48_movfilter_for_mferr; +}__packed t48_median_config_t; + + + +#endif diff --git a/include/linux/i2c/mxt224s_grande.h b/include/linux/i2c/mxt224s_grande.h new file mode 100644 index 0000000..b7d0938 --- /dev/null +++ b/include/linux/i2c/mxt224s_grande.h @@ -0,0 +1,163 @@ +/* + * Copyright (C) 2010, Samsung Electronics Co. Ltd. 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 as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef __MXT_H__ +#define __MXT_H__ + +#define MXT224_MAX_MT_FINGERS 10 +#define MXT_DEV_NAME "Atmel MXT224S" +#define CHECK_ANTITOUCH 1 + +enum { RESERVED_T0 = 0, + RESERVED_T1, + DEBUG_DELTAS_T2, + DEBUG_REFERENCES_T3, + DEBUG_SIGNALS_T4, + GEN_MESSAGEPROCESSOR_T5, + GEN_COMMANDPROCESSOR_T6, + GEN_POWERCONFIG_T7, + GEN_ACQUISITIONCONFIG_T8, + TOUCH_MULTITOUCHSCREEN_T9, + TOUCH_SINGLETOUCHSCREEN_T10, + TOUCH_XSLIDER_T11, + TOUCH_YSLIDER_T12, + TOUCH_XWHEEL_T13, + TOUCH_YWHEEL_T14, + TOUCH_KEYARRAY_T15, + PROCG_SIGNALFILTER_T16, + PROCI_LINEARIZATIONTABLE_T17, + SPT_COMCONFIG_T18, + SPT_GPIOPWM_T19, + PROCI_GRIPFACESUPPRESSION_T20, + RESERVED_T21, + PROCG_NOISESUPPRESSION_T22, + TOUCH_PROXIMITY_T23, + PROCI_ONETOUCHGESTUREPROCESSOR_T24, + SPT_SELFTEST_T25, + DEBUG_CTERANGE_T26, + PROCI_TWOTOUCHGESTUREPROCESSOR_T27, + SPT_CTECONFIG_T28, + SPT_GPI_T29, + SPT_GATE_T30, + TOUCH_KEYSET_T31, + TOUCH_XSLIDERSET_T32, + RESERVED_T33, + GEN_MESSAGEBLOCK_T34, + SPT_GENERICDATA_T35, + RESERVED_T36, + DEBUG_DIAGNOSTIC_T37, + SPT_USERDATA_T38, + SPARE_T39, + PROCI_GRIPSUPPRESSION_T40, + SPARE_T41, + PROCI_TOUCHSUPPRESSION_T42, + SPT_DIGITIZER_T43, + MESSAGECOUNT_T44, + SPARE_T45, + SPT_CTECONFIG_T46, + PROCI_STYLUS_T47, + PROCG_NOISESUPPRESSION_T48, + SPARE_T49, + SPARE_T50, + SPARE_T51, + TOUCH_PROXIMITY_KEY_T52, + GEN_DATASOURCE_T53, + SPARE_T54, + PROCI_ADAPTIVETHRESHOLD_T55, + PROCI_SHIELDLESS_T56, + PROCI_EXTRATOUCHSCREENDATA_T57, + SPARE_T58, + SPARE_T59, + SPARE_T60, + SPT_TIMER_T61, + PROCG_NOISESUPPRESSION_T62, + RESERVED_T255 = 255, +}; +struct mxt224s_platform_data { + int max_finger_touches; + const u8 **config; + const u8 **config_e; + int gpio_read_done; + int min_x; + int max_x; + int min_y; + int max_y; + int min_z; + int max_z; + int min_w; + int max_w; + u8 chrgtime_batt; + u8 chrgtime_charging; + u8 atchcalst; + u8 atchcalsthr; + u8 tchthr_batt; + u8 tchthr_charging; + u8 tchthr_batt_e; + u8 tchthr_charging_e; + u8 calcfg_batt_e; + u8 calcfg_charging_e; + u8 atchcalsthr_e; + u8 atchfrccalthr_e; + u8 atchfrccalratio_e; + u8 idlesyncsperx_batt; + u8 idlesyncsperx_charging; + u8 actvsyncsperx_batt; + u8 actvsyncsperx_charging; + u8 idleacqint_batt; + u8 idleacqint_charging; + u8 actacqint_batt; + u8 actacqint_charging; + u8 xloclip_batt; + u8 xloclip_charging; + u8 xhiclip_batt; + u8 xhiclip_charging; + u8 yloclip_batt; + u8 yloclip_charging; + u8 yhiclip_batt; + u8 yhiclip_charging; + u8 xedgectrl_batt; + u8 xedgectrl_charging; + u8 xedgedist_batt; + u8 xedgedist_charging; + u8 yedgectrl_batt; + u8 yedgectrl_charging; + u8 yedgedist_batt; + u8 yedgedist_charging; + u8 tchhyst_batt; + u8 tchhyst_charging; +#if CHECK_ANTITOUCH + u8 check_antitouch; + u8 check_timer; + u8 check_autocal; + u8 check_calgood; +#endif + const u8 *t9_config_batt; + const u8 *t9_config_chrg; + const u8 *t56_config_batt; + const u8 *t56_config_chrg; + const u8 *t62_config_batt; + const u8 *t62_config_chrg; + void (*power_on) (void); + void (*power_off) (void); + void (*register_cb) (void *); + void (*read_ta_status) (void *); + const u8 *config_fw_version; +}; +typedef enum + { MXT_PAGE_UP = 0x01, MXT_PAGE_DOWN = 0x02, MXT_DELTA_MODE = + 0x10, MXT_REFERENCE_MODE = 0x11, MXT_CTE_MODE = 0x31 +} diagnostic_debug_command; + +#endif /* */ diff --git a/include/linux/i2c/mxt540e.h b/include/linux/i2c/mxt540e.h index 6c34a39..38094c8 100644 --- a/include/linux/i2c/mxt540e.h +++ b/include/linux/i2c/mxt540e.h @@ -129,5 +129,7 @@ enum { int get_tsp_status(void); extern struct class *sec_class; - +#if defined(CONFIG_MACH_T0) +extern bool is_cable_attached; +#endif #endif diff --git a/include/linux/i2c/mxt540s.h b/include/linux/i2c/mxt540s.h new file mode 100644 index 0000000..ba687ed --- /dev/null +++ b/include/linux/i2c/mxt540s.h @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2012, Samsung Electronics Co. Ltd. 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 as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef __MXT_H__ +#define __MXT_H__ + +#define MXT_DEV_NAME "Atmel MXT540S" + +#define MXT_540S_SW_RESET_TIME 300 /* msec */ +#define MXT_540S_HW_RESET_TIME 300 /* msec */ +#define MXT_540S_FW_RESET_TIME 500 /* msec */ + +enum { RESERVED_T0 = 0, + RESERVED_T1, + DEBUG_DELTAS_T2, + DEBUG_REFERENCES_T3, + DEBUG_SIGNALS_T4, + GEN_MESSAGEPROCESSOR_T5, + GEN_COMMANDPROCESSOR_T6, + GEN_POWERCONFIG_T7, + GEN_ACQUISITIONCONFIG_T8, + TOUCH_MULTITOUCHSCREEN_T9, + TOUCH_SINGLETOUCHSCREEN_T10, + TOUCH_XSLIDER_T11, + TOUCH_YSLIDER_T12, + TOUCH_XWHEEL_T13, + TOUCH_YWHEEL_T14, + TOUCH_KEYARRAY_T15, + PROCG_SIGNALFILTER_T16, + PROCI_LINEARIZATIONTABLE_T17, + SPT_COMCONFIG_T18, + SPT_GPIOPWM_T19, + PROCI_GRIPFACESUPPRESSION_T20, + RESERVED_T21, + PROCG_NOISESUPPRESSION_T22, + TOUCH_PROXIMITY_T23, + PROCI_ONETOUCHGESTUREPROCESSOR_T24, + SPT_SELFTEST_T25, + DEBUG_CTERANGE_T26, + PROCI_TWOTOUCHGESTUREPROCESSOR_T27, + SPT_CTECONFIG_T28, + SPT_GPI_T29, + SPT_GATE_T30, + TOUCH_KEYSET_T31, + TOUCH_XSLIDERSET_T32, + RESERVED_T33, + GEN_MESSAGEBLOCK_T34, + SPT_GENERICDATA_T35, + RESERVED_T36, + DEBUG_DIAGNOSTIC_T37, + SPT_USERDATA_T38, + SPARE_T39, + PROCI_GRIPSUPPRESSION_T40, + SPARE_T41, + PROCI_TOUCHSUPPRESSION_T42, + SPT_DIGITIZER_T43, + SPARE_T44, + SPARE_T45, + SPT_CTECONFIG_T46, + PROCI_STYLUS_T47, + PROCG_NOISESUPPRESSION_T48, + SPARE_T49, + SPARE_T50, + SPARE_T51, + TOUCH_PROXIMITY_KEY_T52, + GEN_DATASOURCE_T53, + SPARE_T54, + ADAPTIVE_T55, + PROCI_SHIELDLESS_T56, + PROCI_EXTRATOUCHSCREENDATA_T57, + SPARE_T58, + SPARE_T59, + SPARE_T60, + SPT_TIMER_T61, + PROCG_NOISESUPPRESSION_T62, + PROCI_ACTIVESTYLUS_T63, + RESERVED_T255 = 255, +}; + +struct mxt_callbacks { + void (*inform_charger)(struct mxt_callbacks *, bool); +}; + +struct mxt_platform_data { + int max_finger_touches; + int gpio_read_done; + const u8 **config; + int min_x; + int max_x; + int min_y; + int max_y; + int min_z; + int max_z; + int min_w; + int max_w; + int (*power_on) (void); + int (*power_off) (void); + int (*power_reset) (void); + void (*register_cb) (void *); + u8 boot_address; + const char *firmware_name; +}; + +#endif /* */ diff --git a/include/linux/i2c/si47xx_common.h b/include/linux/i2c/si47xx_common.h new file mode 100644 index 0000000..456e623 --- /dev/null +++ b/include/linux/i2c/si47xx_common.h @@ -0,0 +1,60 @@ +/* + * Si47xx_common.h -- Si47xx FM Radio driver + * + * 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. + */ + +#ifndef _COMMON_H +#define _COMMON_H + +#include <linux/kernel.h> +#include <linux/types.h> +#include <linux/slab.h> +#include <mach/gpio.h> + +#define error(fmt, arg...) printk(KERN_CRIT fmt "\n", ##arg) + +#ifdef Si47xx_DEBUG +#define debug(fmt, arg...) printk(KERN_CRIT "--------" fmt "\n", ##arg) +#else +#define debug(fmt, arg...) +#endif + +#define FM_PORT "GPX13" + +#define SI47XX_VOLUME_NUM 16 + +struct si47xx_platform_data { + u16 rx_vol[SI47XX_VOLUME_NUM]; + void (*power) (int on); +}; + +struct Si47xx_data { + struct si47xx_platform_data *pdata; + struct i2c_client *client; + struct device *dev; +}; + + +/* VNVS:28-OCT'09 : For testing FM tune and seek operation status */ +#define TEST_FM + +/* VNVS:7-JUNE'10 : RDS Interrupt ON Always */ +/* (Enabling interrupt when RDS is enabled) */ +#define RDS_INTERRUPT_ON_ALWAYS + +/* VNVS:18-JUN'10 : For testing RDS */ +/* Enable only for debugging RDS */ +/* #define RDS_TESTING */ +#ifdef RDS_TESTING +#define debug_rds(fmt, arg...) printk(KERN_CRIT "--------" fmt "\n", ##arg) +#define GROUP_TYPE_2A (2 * 2 + 0) +#define GROUP_TYPE_2B (2 * 2 + 1) +#else +#define debug_rds(fmt, arg...) +#endif + +extern wait_queue_head_t Si47xx_waitq; +#endif diff --git a/include/linux/i2c/touchkey_i2c.h b/include/linux/i2c/touchkey_i2c.h index addd763..71ec0b1 100644 --- a/include/linux/i2c/touchkey_i2c.h +++ b/include/linux/i2c/touchkey_i2c.h @@ -29,7 +29,8 @@ || defined(CONFIG_TARGET_LOCALE_NA)\ || defined(CONFIG_MACH_M0)\ || defined(CONFIG_MACH_C1)\ - || defined(CONFIG_MACH_C1VZW) + || defined(CONFIG_MACH_M3)\ + || defined(CONFIG_MACH_T0) #define TK_CMD_LED_ON 0x10 #define TK_CMD_LED_OFF 0x20 #else @@ -50,36 +51,36 @@ #elif defined(CONFIG_MACH_C1_NA_USCC_REV05) #define TK_FIRMWARE_VER 0x0E #define TK_MODULE_VER 0x08 -#elif defined(CONFIG_MACH_M0) || defined(CONFIG_MACH_C1VZW)\ - || defined(CONFIG_MACH_C1) +#elif defined(CONFIG_MACH_M0)\ + || defined(CONFIG_MACH_C1)\ + || defined(CONFIG_MACH_M3) #define TK_FIRMWARE_VER 0x06 #define TK_MODULE_VER 0x05 -#elif defined(CONFIG_MACH_S2PLUS) -#define TK_FIRMWARE_VER 0x04 -#define TK_MODULE_VER 0x00 +#elif defined(CONFIG_MACH_T0) +#define TK_FIRMWARE_VER 0x11 +#define TK_MODULE_VER 0x08 #else #define TK_FIRMWARE_VER 0x04 #define TK_MODULE_VER 0x00 #endif /* LDO Regulator */ -#if defined(CONFIG_MACH_S2PLUS) -#define TK_REGULATOR_NAME "3_touch_1.8v" -#elif defined(CONFIG_MACH_M0)\ +#if defined(CONFIG_MACH_M0)\ || defined(CONFIG_MACH_C1)\ - || defined(CONFIG_MACH_C1VZW) + || defined(CONFIG_MACH_M3)\ + || defined(CONFIG_MACH_T0) #define TK_REGULATOR_NAME "touchkey" #else #define TK_REGULATOR_NAME "touch" #endif /* LED LDO Type*/ -#if defined(CONFIG_MACH_S2PLUS) \ - || defined(CONFIG_MACH_M0)\ +#if defined(CONFIG_MACH_M0)\ || defined(CONFIG_MACH_C1_KOR_SKT)\ || defined(CONFIG_MACH_C1_KOR_KT)\ - || defined(CONFIG_MACH_C1VZW)\ - || defined(CONFIG_MACH_C1) + || defined(CONFIG_MACH_M3)\ + || defined(CONFIG_MACH_C1)\ + || defined(CONFIG_MACH_T0) #define LED_LDO_WITH_EN_PIN #else #define LED_LDO_WITH_REGULATOR @@ -91,13 +92,16 @@ || defined(CONFIG_MACH_Q1_BD)\ || defined(CONFIG_MACH_M0)\ || defined(CONFIG_MACH_C1)\ - || defined(CONFIG_MACH_C1VZW) + || defined(CONFIG_MACH_M3)\ + || defined(CONFIG_MACH_T0) #define TK_HAS_AUTOCAL #endif /* Generalized SMBus access */ -#if defined(CONFIG_MACH_M0) || defined(CONFIG_MACH_C1VZW)\ - || defined(CONFIG_MACH_C1) +#if defined(CONFIG_MACH_M0)\ + || defined(CONFIG_MACH_M3)\ + || defined(CONFIG_MACH_C1)\ + || defined(CONFIG_MACH_T0) #define TK_USE_GENERAL_SMBUS #endif @@ -107,16 +111,42 @@ || defined(CONFIG_TARGET_LOCALE_NA)\ || defined(CONFIG_MACH_M0)\ || defined(CONFIG_MACH_C1)\ - || defined(CONFIG_MACH_C1VZW) + || defined(CONFIG_MACH_M3)\ + || defined(CONFIG_MACH_T0) #define TK_HAS_FIRMWARE_UPDATE #endif -#if defined(CONFIG_MACH_M0_CHNOPEN) || defined(CONFIG_MACH_M0_HKTW) +#if defined(CONFIG_TARGET_LOCALE_NAATT) +#define TK_USE_4KEY_TYPE_ATT +#elif defined(CONFIG_MACH_LOCALE_NA) \ + || defined(CONFIG_MACH_U1_NA_SPR) \ + || defined(CONFIG_MACH_U1_NA_USCC) +#define TK_USE_4KEY_TYPE_NA +#elif defined(CONFIG_MACH_M0) \ + || defined(CONFIG_MACH_C1) \ + || defined(CONFIG_MACH_M3)\ + || defined(CONFIG_MACH_T0) +#define TK_USE_2KEY_TYPE_M0 +#else +#define TK_USE_2KEY_TYPE_U1 +#endif + +#if defined(TK_USE_4KEY_TYPE_ATT)\ + || defined(TK_USE_4KEY_TYPE_NA) +#define TK_USE_4KEY +#elif defined(TK_USE_2KEY_TYPE_M0)\ + || defined(TK_USE_2KEY_TYPE_U1) +#define TK_USE_2KEY +#endif + +#if defined(CONFIG_MACH_M0_CHNOPEN)\ + || defined(CONFIG_MACH_M0_HKTW) #define TOUCHKEY_FW_UPDATEABLE_HW_REV 10 #elif defined(CONFIG_MACH_M0) #define TOUCHKEY_FW_UPDATEABLE_HW_REV 11 #elif defined(CONFIG_MACH_C1) -#if defined(CONFIG_MACH_C1_KOR_SKT) || defined(CONFIG_MACH_C1_KOR_KT) +#if defined(CONFIG_MACH_C1_KOR_SKT)\ + || defined(CONFIG_MACH_C1_KOR_KT) #define TOUCHKEY_FW_UPDATEABLE_HW_REV 8 #elif defined(CONFIG_MACH_C1_KOR_LGT) #define TOUCHKEY_FW_UPDATEABLE_HW_REV 5 diff --git a/include/linux/init.h b/include/linux/init.h index 9146f39..5e869b7 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -199,6 +199,10 @@ extern int initcall_debug; #define postcore_initcall_sync(fn) __define_initcall("2s",fn,2s) #define arch_initcall(fn) __define_initcall("3",fn,3) #define arch_initcall_sync(fn) __define_initcall("3s",fn,3s) +#ifdef CONFIG_FAST_RESUME +#define beforeresume_initcall(fn) __define_initcall("bresume",fn,bresume) +#define resume_initcall(fn) __define_initcall("resume",fn,resume) +#endif #define subsys_initcall(fn) __define_initcall("4",fn,4) #define subsys_initcall_sync(fn) __define_initcall("4s",fn,4s) #define fs_initcall(fn) __define_initcall("5",fn,5) diff --git a/include/linux/input.h b/include/linux/input.h index 92d2741..d75f6f5 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -129,6 +129,9 @@ struct input_keymap_entry { #define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */ +#define EVIOCGSUSPENDBLOCK _IOR('E', 0x91, int) /* get suspend block enable */ +#define EVIOCSSUSPENDBLOCK _IOW('E', 0x91, int) /* set suspend block enable */ + /* * Device properties and quirks */ @@ -438,6 +441,14 @@ struct input_keymap_entry { #define KEY_WIMAX 246 #define KEY_RFKILL 247 /* Key that controls all radios */ +#define KEY_POUND 248 +#define KEY_STAR 249 +#define KEY_NETWORK 250 + +#define KEY_FOLDER_OPEN 251 /*only use Grande CHN CTC */ +#define KEY_FOLDER_CLOSE 252 /*only use Grande CHN CTC */ +#define KEY_3G 253 /*only use Grande CHN CTC */ + /* Code 255 is reserved for special needs of AT keyboard driver */ #define BTN_MISC 0x100 @@ -673,6 +684,14 @@ struct input_keymap_entry { #define KEY_CAMERA_LEFT 0x219 #define KEY_CAMERA_RIGHT 0x21a +#define KEY_DMB_ANT_DET_UP 0x21b +#define KEY_DMB_ANT_DET_DOWN 0x21c + +#define KEY_PEN_PDCT 0x230 /* E-PEN PDCT flag*/ + +#define KEY_FAKE_PWR 0x240 /* Fake Power off flag*/ + + #define BTN_TRIGGER_HAPPY 0x2c0 #define BTN_TRIGGER_HAPPY1 0x2c0 #define BTN_TRIGGER_HAPPY2 0x2c1 @@ -816,6 +835,7 @@ struct input_keymap_entry { #define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ #define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ +#define SW_PEN_INSERT 0x0e /* set = pen out */ #define SW_MAX 0x0f #define SW_CNT (SW_MAX+1) diff --git a/include/linux/input/sec-input-bridge.h b/include/linux/input/sec-input-bridge.h new file mode 100644 index 0000000..0e5aa59 --- /dev/null +++ b/include/linux/input/sec-input-bridge.h @@ -0,0 +1,36 @@ +#ifndef LINUX_INPUT_SEC_INPUT_BRIDGE_H +#define LINUX_INPUT_SEC_INPUT_BRIDGE_H + +#include <linux/kobject.h> + +enum mkey_check_option { + MKEY_CHECK_AUTO, + MKEY_CHECK_AWAYS +}; + +struct sec_input_bridge_mkey { + unsigned int type; + unsigned int code; + enum mkey_check_option option; +}; + +struct sec_input_bridge_mmap { + const struct sec_input_bridge_mkey *mkey_map; + unsigned int num_mkey; + const char *uevent_env_str; + const char *uevent_env_value; + const unsigned char enable_uevent; + void (*pre_event_func)(void *event_data); + enum kobject_action uevent_action; +}; + +struct sec_input_bridge_platform_data { + void *event_data; + + const struct sec_input_bridge_mmap *mmap; + unsigned int num_map; + void (*lcd_warning_func)(void); +}; + +#endif /* LINUX_INPUT_SEC_INPUT_BRIDGE_H */ + diff --git a/include/linux/ir_remote_con_mc96.h b/include/linux/ir_remote_con_mc96.h new file mode 100644 index 0000000..8ab2430 --- /dev/null +++ b/include/linux/ir_remote_con_mc96.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2012 Samsung Electronics + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _IR_REMOTE_CON_H_ +#define _IR_REMOTE_CON_H_ + +struct mc96_platform_data { + int str1; + int str2; + char char_name; + void (*ir_wake_en)(bool onoff); + void (*ir_remote_init) (void); + void(*ir_vdd_onoff)(bool onoff); +}; + +extern struct class *sec_class; + +#endif /* _IR_REMOTE_CON_H_ */ diff --git a/include/linux/k3g.h b/include/linux/k3g.h new file mode 100644 index 0000000..636fbe2 --- /dev/null +++ b/include/linux/k3g.h @@ -0,0 +1,263 @@ +/* + * k3g.h - ST Microelectronics three-axis gyroscope sensor + * + * Copyright (c) 2010 Samsung Eletronics + * Donggeun Kim <dg77.kim@samsung.com> + * + * 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. + */ + +#ifndef _K3G_H_ +#define _K3G_H_ + +#define K3G_WHO_AM_I 0x0f +#define K3G_CTRL_REG1 0x20 +#define K3G_CTRL_REG2 0x21 +#define K3G_CTRL_REG3 0x22 +#define K3G_CTRL_REG4 0x23 +#define K3G_CTRL_REG5 0x24 +#define K3G_REFERENCE 0x25 +#define K3G_OUT_TEMP 0x26 +#define K3G_STATUS_REG 0x27 +#define K3G_OUT_X_L 0x28 +#define K3G_OUT_X_H 0x29 +#define K3G_OUT_Y_L 0x2a +#define K3G_OUT_Y_H 0x2b +#define K3G_OUT_Z_L 0x2c +#define K3G_OUT_Z_H 0x2d +#define K3G_FIFO_CTRL_REG 0x2e +#define K3G_FIFO_SRC_REG 0x2f +#define K3G_INT1_CFG_REG 0x30 +#define K3G_INT1_SRC_REG 0x31 +#define K3G_INT1_THS_XH 0x32 +#define K3G_INT1_THS_XL 0x33 +#define K3G_INT1_THS_YH 0x34 +#define K3G_INT1_THS_YL 0x35 +#define K3G_INT1_THS_ZH 0x36 +#define K3G_INT1_THS_ZL 0x37 +#define K3G_INT1_DURATION_REG 0x38 + +#define K3G_MULTI_OUT_X_L 0xa8 + +#define K3G_DATA_RATE_SHIFT 6 +#define K3G_DATA_RATE_105HZ ((0x0) << K3G_DATA_RATE_SHIFT) +#define K3G_DATA_RATE_210HZ ((0x1) << K3G_DATA_RATE_SHIFT) +#define K3G_DATA_RATE_420HZ ((0x2) << K3G_DATA_RATE_SHIFT) +#define K3G_DATA_RATE_840HZ ((0x3) << K3G_DATA_RATE_SHIFT) +#define K3G_BANDWIDTH_SHIFT 4 +#define K3G_BANDWIDTH_MASK ((0x3) << K3G_BANDWIDTH_SHIFT) +#define K3G_POWERDOWN_SHIFT 3 +#define K3G_POWERDOWN_POWER_DOWN ((0x0) << K3G_POWERDOWN_SHIFT) +#define K3G_POWERDOWN_NORMAL ((0x1) << K3G_POWERDOWN_SHIFT) +#define K3G_POWERDOWN_MASK ((0x1) << K3G_POWERDOWN_SHIFT) +#define K3G_Z_EN_SHIFT 2 +#define K3G_Z_EN ((0x1) << K3G_Z_EN_SHIFT) +#define K3G_Y_EN_SHIFT 1 +#define K3G_Y_EN ((0x1) << K3G_Y_EN_SHIFT) +#define K3G_X_EN_SHIFT 0 +#define K3G_X_EN ((0x1) << K3G_X_EN_SHIFT) + +#define K3G_HIGH_PASS_FILTER_SHIFT 4 +#define K3G_HIGH_PASS_FILTER_NORMAL_MODE_RESET_READING \ + ((0x0) << K3G_HIGH_PASS_FILTER_SHIFT) +#define K3G_HIGH_PASS_FILTER_REFERENCE_SIGNAL \ + ((0x1) << K3G_HIGH_PASS_FILTER_SHIFT) +#define K3G_HIGH_PASS_FILTER_NORMAL_MODE \ + ((0x2) << K3G_HIGH_PASS_FILTER_SHIFT) +#define K3G_HIGH_PASS_FILTER_AUTORESET_ON_INTERRUPT \ + ((0x3) << K3G_HIGH_PASS_FILTER_SHIFT) +#define K3G_HIGH_PASS_FILTER_CUTOFF_FREQ_SHIFT 0 +#define K3G_HIGH_PASS_FILTER_CUTOFF_FREQ_MASK \ + ((0xf) << K3G_HIGH_PASS_FILTER_CUTOFF_FREQ_SHIFT) + +#define K3G_INT1_EN_SHIFT 7 +#define K3G_INT1_EN ((0x1) << K3G_INT1_EN_SHIFT) +#define K3G_INT1_BOOT_SHIFT 6 +#define K3G_INT1_BOOT ((0x1) << K3G_INT1_BOOT_SHIFT) +#define K3G_INT1_ACTIVE_SHIFT 5 +#define K3G_INT1_ACTIVE_HIGH ((0x0) << K3G_INT1_ACTIVE_SHIFT) +#define K3G_INT1_ACTIVE_LOW ((0x1) << K3G_INT1_ACTIVE_SHIFT) +#define K3G_INT_PUSH_PULL_OPEN_DRAIN_SHIFT 4 +#define K3G_INT_PUSH_PULL \ + ((0x0) << K3G_INT_PUSH_PULL_OPEN_DRAIN_SHIFT) +#define K3G_INT_OPEN_DRAIN \ + ((0x1) << K3G_INT_PUSH_PULL_OPEN_DRAIN_SHIFT) +#define K3G_INT2_SRC_SHIFT 0 +#define K3G_INT2_SRC_MASK ((0x0f) << K3G_INT2_SRC_SHIFT) +#define K3G_INT2_DATA_READY_SHIFT 3 +#define K3G_INT2_DATA_READY ((0x1) << K3G_INT2_DATA_READY_SHIFT) +#define K3G_INT2_WATERMARK_SHIFT 2 +#define K3G_INT2_WATERMARK ((0x1) << K3G_INT2_WATERMARK_SHIFT) +#define K3G_INT2_OVERRUN_SHIFT 1 +#define K3G_INT2_OVERRUN ((0x1) << K3G_INT2_OVERRUN_SHIFT) +#define K3G_INT2_EMPTY_SHIFT 0 +#define K3G_INT2_EMPTY ((0x1) << K3G_INT2_EMPTY_SHIFT) + +#define K3G_BLOCK_DATA_UPDATE_SHIFT 7 +#define K3G_BLOCK_DATA_UPDATE \ + ((0x1) << K3G_BLOCK_DATA_UPDATE_SHIFT) +#define K3G_BIG_LITTLE_ENDIAN_SHIFT 6 +#define K3G_BIG_ENDIAN ((0x0) << K3G_BIG_LITTLE_ENDIAN_SHIFT) +#define K3G_LITTLE_ENDIAN ((0x1) << K3G_BIG_LITTLE_ENDIAN_SHIFT) +#define K3G_FULL_SCALE_SHIFT 4 +#define K3G_FULL_SCALE_250DPS ((0x0) << K3G_FULL_SCALE_SHIFT) +#define K3G_FULL_SCALE_500DPS ((0x1) << K3G_FULL_SCALE_SHIFT) +#define K3G_FULL_SCALE_2000DPS ((0x2) << K3G_FULL_SCALE_SHIFT) +#define K3G_SELF_TEST_SHIFT 1 +#define K3G_SELF_TESET_NORMAL ((0x0) << K3G_SELF_TEST_SHIFT) +#define K3G_SELF_TESET_0 ((0x1) << K3G_SELF_TEST_SHIFT) +#define K3G_SELF_TESET_1 ((0x3) << K3G_SELF_TEST_SHIFT) +#define K3G_SPI_MODE_SHIFT 0 +#define K3G_SPI_FOUR_WIRE ((0x0) << K3G_SPI_MODE_SHIFT) +#define K3G_SPI_THREE_WIRE ((0x1) << K3G_SPI_MODE_SHIFT) + +#define K3G_REBOOT_SHIFT 7 +#define K3G_REBOOT ((0x1) << K3G_REBOOT_SHIFT) +#define K3G_FIFO_EN_SHIFT 6 +#define K3G_FIFO_EN ((0x1) << K3G_FIFO_EN_SHIFT) +#define K3G_HIGH_PASS_FILTER_EN_SHIFT 4 +#define K3G_HIGH_PASS_FILTER_EN \ + ((0x1) << K3G_HIGH_PASS_FILTER_EN_SHIFT) +#define K3G_INT1_SELECTION_SHIFT 2 +#define K3G_INT1_SELECTION ((0x3) << K3G_INT1_SELECTION_SHIFT) +#define K3G_OUT_SELECTION_SHIFT 0 +#define K3G_OUT_SELECTION ((0x3) << K3G_OUT_SELECTION_SHIFT) + +#define K3G_ZYX_OVERRUN_SHIFT 7 +#define K3G_ZYX_OVERRUN ((0x1) << K3G_ZYX_OVERRUN_SHIFT) +#define K3G_Z_OVERRUN_SHIFT 6 +#define K3G_Z_OVERRUN ((0x1) << K3G_Z_OVERRUN_SHIFT) +#define K3G_Y_OVERRUN_SHIFT 5 +#define K3G_Y_OVERRUN ((0x1) << K3G_Y_OVERRUN_SHIFT) +#define K3G_X_OVERRUN_SHIFT 4 +#define K3G_X_OVERRUN ((0x1) << K3G_X_OVERRUN_SHIFT) +#define K3G_ZYX_DATA_AVAILABLE_SHIFT 3 +#define K3G_ZYX_DATA_AVAILABEL \ + ((0x1) << K3G_ZYX_DATA_AVAILABLE_SHIFT) +#define K3G_Z_DATA_AVAILABLE_SHIFT 2 +#define K3G_Z_DATA_AVAILABLE ((0x1) << K3G_Z_DATA_AVAILABLE_SHIFT) +#define K3G_Y_DATA_AVAILABLE_SHIFT 1 +#define K3G_Y_DATA_AVAILABLE ((0x1) << K3G_Y_DATA_AVAILABLE_SHIFT) +#define K3G_X_DATA_AVAILABLE_SHIFT 0 +#define K3G_X_DATA_AVAILABLE ((0x1) << K3G_X_DATA_AVAILABLE_SHIFT) + +#define K3G_FIFO_MODE_SHIFT 5 +#define K3G_FIFO_BYPASS_MODE ((0x0) << K3G_FIFO_MODE_SHIFT) +#define K3G_FIFO_FIFO_MODE ((0x1) << K3G_FIFO_MODE_SHIFT) +#define K3G_FIFO_STREAM_MODE ((0x2) << K3G_FIFO_MODE_SHIFT) +#define K3G_FIFO_STREAM_TO_FIFO_MODE ((0x3) << K3G_FIFO_MODE_SHIFT) +#define K3G_FIFO_BYPASS_TO_STREAM_MODE ((0x4) << K3G_FIFO_MODE_SHIFT) +#define K3G_FIFO_MODE_MASK ((0x7) << K3G_FIFO_MODE_SHIFT) +#define K3G_WATERMARK_THRES_SHIFT 0 +#define K3G_WATERMARK_THRES_MASK ((0x1f) << K3G_WATERMARK_THRES_SHIFT) + +#define K3G_WATERMARK_SHIFT 7 +#define K3G_WATERMARK ((0x1) << K3G_WATERMARK_SHIFT) +#define K3G_OVERRUN_SHIFT 6 +#define K3G_OVERRUN ((0x1) << K3G_OVERRUN_SHIFT) +#define K3G_EMPTY_SHIFT 5 +#define K3G_EMPTY ((0x1) << K3G_EMPTY_SHIFT) +#define K3G_FIFO_STORED_SHIFT 0 +#define K3G_FIFO_STORED_MASK ((0x1f) << K3G_FIFO_STORED_SHIFT) + +#define K3G_AND_OR_COMBINATION_SHIFT 7 +#define K3G_OR_COMBINATION ((0x0) << K3G_AND_OR_COMBINATION_SHIFT) +#define K3G_AND_COMBINATION ((0x1) << K3G_AND_OR_COMBINATION_SHIFT) +#define K3G_LATCH_INTERRUPT_SHIFT 6 +#define K3G_INTERRUPT_NO_LATCHED ((0x0) << K3G_LATCH_INTERRUPT_SHIFT) +#define K3G_INTERRUPT_LATCHED ((0x1) << K3G_LATCH_INTERRUPT_SHIFT) +#define K3G_Z_HIGH_INT_EN_SHIFT 5 +#define K3G_Z_HIGH_INT_EN ((0x1) << K3G_Z_HIGH_INT_EN_SHIFT) +#define K3G_Z_LOW_INT_EN_SHIFT 4 +#define K3G_Z_LOW_INT_EN ((0x1) << K3G_Z_LOW_INT_EN_SHIFT) +#define K3G_Y_HIGH_INT_EN_SHIFT 3 +#define K3G_Y_HIGH_INT_EN ((0x1) << K3G_Y_HIGH_INT_EN_SHIFT) +#define K3G_Y_LOW_INT_EN_SHIFT 2 +#define K3G_Y_LOW_INT_EN ((0x1) << K3G_Y_LOW_INT_EN_SHIFT) +#define K3G_X_HIGH_INT_EN_SHIFT 1 +#define K3G_X_HIGH_INT_EN ((0x1) << K3G_X_HIGH_INT_EN_SHIFT) +#define K3G_X_LOW_INT_EN_SHIFT 0 +#define K3G_X_LOW_INT_EN ((0x1) << K3G_X_LOW_INT_EN_SHIFT) + +#define K3G_INTERRUPT_ACTIVE_SHIFT 6 +#define K3G_INTERRUPT_ACTIVE ((0x1) << K3G_INTERRUPT_ACTIVE_SHIFT) +#define K3G_Z_HIGH_SHIFT 5 +#define K3G_Z_HIGH ((0x1) << K3G_Z_HIGH_SHIFT) +#define K3G_Z_LOW_SHIFT 4 +#define K3G_Z_LOW ((0x1) << K3G_Z_LOW_SHIFT) +#define K3G_Y_HIGH_SHIFT 3 +#define K3G_Y_HIGH ((0x1) << K3G_Y_HIGH_SHIFT) +#define K3G_Y_LOW_SHIFT 2 +#define K3G_Y_LOW ((0x1) << K3G_Y_LOW_SHIFT) +#define K3G_X_HIGH_SHIFT 1 +#define K3G_X_HIGH ((0x1) << K3G_X_HIGH_SHIFT) +#define K3G_X_LOW_SHIFT 0 +#define K3G_X_LOW ((0x1) << K3G_X_LOW_SHIFT) + +#define K3G_INT1_WAIT_EN_SHIFT 7 +#define K3G_INT1_WAIT_EN ((0x1) << K3G_INT1_WAIT_EN_SHIFT) +#define K3G_INT1_DURATION_SHIFT 0 +#define K3G_INT1_DURATION_MASK ((0x7f) << K3G_INT1_DURATION_SHIFT) + +#define K3G_TEMP_SHIFT 0 +#define K3G_TEMP_MASK ((0xff) << K3G_TEMP_SHIFT) + +#define K3G_DEV_ID 0xd3 + +struct k3g_platform_data { + int irq2; + u8 data_rate; + u8 bandwidth; + u8 powerdown; + u8 zen; + u8 yen; + u8 xen; + u8 hpmode; + u8 hpcf; + u8 int1_enable; + u8 int1_boot; + u8 int1_hl_active; + u8 int_pp_od; + u8 int2_src; + u8 block_data_update; + u8 endian; + u8 fullscale; + u8 selftest; + u8 spi_mode; + u8 reboot; + u8 fifo_enable; + u8 hp_enable; + u8 int1_sel; + u8 out_sel; + u8 fifo_mode; + u8 fifo_threshold; + u8 int1_combination; + u8 int1_latch; + u8 int1_z_high_enable; + u8 int1_z_low_enable; + u8 int1_y_high_enable; + u8 int1_y_low_enable; + u8 int1_x_high_enable; + u8 int1_x_low_enable; + u8 int1_wait_enable; + u8 int1_wait_duration; + u16 int1_z_threshold; + u16 int1_y_threshold; + u16 int1_x_threshold; +}; + +struct k3g_chip { + struct i2c_client *client; + struct iio_dev *indio_dev; + struct work_struct work_thresh; + struct work_struct work_fifo; + struct iio_trigger *trig; + s64 last_timestamp; + struct mutex lock; + struct mutex ring_lock; + struct k3g_platform_data *pdata; +}; + +#endif diff --git a/include/linux/kernel_sec_common.h b/include/linux/kernel_sec_common.h new file mode 100644 index 0000000..5e500f6 --- /dev/null +++ b/include/linux/kernel_sec_common.h @@ -0,0 +1,205 @@ +#ifndef _KERNEL_SEC_COMMON_H_ +#define _KERNEL_SEC_COMMON_H_ + +#include <asm/io.h> +#include <linux/module.h> +#include <linux/delay.h> +#include <mach/map.h> +#include <mach/regs-clock.h> +#include <linux/sched.h> + +/* MAGIC_CODE in LOKE + you have to use this vitrual address with consideration */ +/*#define LOKE_BOOT_USB_DWNLD_V_ADDR 0xC1000000*/ +#define LOKE_BOOT_USB_DWNLD_V_ADDR 0xD1000000 +#define LOKE_BOOT_USB_DWNLDMAGIC_NO 0x66262564 + +/* AP -> CP : AP Crash Ind */ +#define KERNEL_SEC_DUMP_AP_DEAD_INDICATOR 0xABCD00C9 +/* CP -> AP : CP ready for uplaod mode */ +#define KERNEL_SEC_DUMP_AP_DEAD_ACK 0xCACAEDED + +/*it's longer than DPRAM_ERR_MSG_LEN, in dpram.h */ +#define KERNEL_SEC_DEBUG_CAUSE_STR_LEN 65 +#define KERNEL_SEC_DEBUG_LEVEL_LOW (0x574F4C44) +#define KERNEL_SEC_DEBUG_LEVEL_MID (0x44494D44) +#define KERNEL_SEC_DEBUG_LEVEL_HIGH (0x47494844) + +/* INFORMATION REGISTER */ +/* +#define S5P_INFORM0 S5P_CLKREG(0xF000) +#define S5P_INFORM1 S5P_CLKREG(0xF004) +#define S5P_INFORM2 S5P_CLKREG(0xF008) +#define S5P_INFORM3 S5P_CLKREG(0xF00C) +#define S5P_INFORM4 S5P_CLKREG(0xF010) +#define S5P_INFORM5 S5P_CLKREG(0xF014) +#define S5P_INFORM6 S5P_CLKREG(0xF018) /*Magic code for upload cause.*/ +#define S5P_INFORM7 S5P_CLKREG(0xF01C) + +/* WDOG register */ +/*#define (S3C_PA_WDT) 0xE2700000 */ + +#if 1 /* dpram Physical address for the internal DPRAM in S5PC210 */ +#define IDPRAM_PHYSICAL_ADDR S5P_PA_MODEMIF +#endif +/* klaatu - schedule log */ +/* #define SCHED_LOG_MAX 1000 */ + +typedef struct { + void *dummy; + void *fn; +} irq_log_t; + +typedef union { + char task[TASK_COMM_LEN]; + irq_log_t irq; +} task_log_t; + +typedef struct { + unsigned long long time; + task_log_t log; +} sched_log_t; + +/* extern sched_log_t gExcpTaskLog[SCHED_LOG_MAX]; */ +extern unsigned int gExcpTaskLogIdx; + +typedef struct tag_mmu_info { + int SCTLR; + int TTBR0; + int TTBR1; + int TTBCR; + int DACR; + int DFSR; + int DFAR; + int IFSR; + int IFAR; + int DAFSR; + int IAFSR; + int PMRRR; + int NMRRR; + int FCSEPID; + int CONTEXT; + int URWTPID; + int UROTPID; + int POTPIDR; +} t_kernel_sec_mmu_info; + +/*ARM CORE regs mapping structure*/ +typedef struct { + /* COMMON */ + unsigned int r0; + unsigned int r1; + unsigned int r2; + unsigned int r3; + unsigned int r4; + unsigned int r5; + unsigned int r6; + unsigned int r7; + unsigned int r8; + unsigned int r9; + unsigned int r10; + unsigned int r11; + unsigned int r12; + + /* SVC */ + unsigned int r13_svc; + unsigned int r14_svc; + unsigned int spsr_svc; + + /* PC & CPSR */ + unsigned int pc; + unsigned int cpsr; + + /* USR/SYS */ + unsigned int r13_usr; + unsigned int r14_usr; + + /* FIQ */ + unsigned int r8_fiq; + unsigned int r9_fiq; + unsigned int r10_fiq; + unsigned int r11_fiq; + unsigned int r12_fiq; + unsigned int r13_fiq; + unsigned int r14_fiq; + unsigned int spsr_fiq; + + /* IRQ */ + unsigned int r13_irq; + unsigned int r14_irq; + unsigned int spsr_irq; + + /* MON */ + unsigned int r13_mon; + unsigned int r14_mon; + unsigned int spsr_mon; + + /* ABT */ + unsigned int r13_abt; + unsigned int r14_abt; + unsigned int spsr_abt; + + /* UNDEF */ + unsigned int r13_und; + unsigned int r14_und; + unsigned int spsr_und; + +} t_kernel_sec_arm_core_regsiters; + +typedef enum { + UPLOAD_CAUSE_INIT = 0x00000000, + UPLOAD_CAUSE_KERNEL_PANIC = 0x000000C8, + UPLOAD_CAUSE_FORCED_UPLOAD = 0x00000022, + UPLOAD_CAUSE_CP_ERROR_FATAL = 0x000000CC, + UPLOAD_CAUSE_USER_FAULT = 0x0000002F, +#if 1 /* dpram */ + UPLOAD_CAUSE_CDMA_ERROR = 0x000000F1, + UPLOAD_CAUSE_CDMA_TIMEOUT = 0x000000F2, + UPLOAD_CAUSE_CDMA_RESET = 0x000000F3, +#endif + BLK_UART_MSG_FOR_FACTRST_2ND_ACK = 0x00000088, +} kernel_sec_upload_cause_type; + +#define KERNEL_SEC_UPLOAD_CAUSE_MASK 0x000000FF +#define KERNEL_SEC_UPLOAD_AUTOTEST_BIT 31 +#define KERNEL_SEC_UPLOAD_AUTOTEST_MASK (1<<KERNEL_SEC_UPLOAD_AUTOTEST_BIT) + +#define KERNEL_SEC_DEBUG_LEVEL_BIT 29 +#define KERNEL_SEC_DEBUG_LEVEL_MASK (3<<KERNEL_SEC_DEBUG_LEVEL_BIT) + +extern void __iomem *kernel_sec_viraddr_wdt_reset_reg; +extern void kernel_sec_map_wdog_reg(void); + +extern void kernel_sec_set_cp_upload(void); +extern void kernel_sec_set_cp_ack(void); +extern void kernel_sec_set_upload_magic_number(void); +extern void kernel_sec_set_upload_cause \ + (kernel_sec_upload_cause_type uploadType); +extern void kernel_sec_set_cause_strptr(unsigned char *str_ptr, int size); +extern void kernel_sec_set_autotest(void); +extern void kernel_sec_clear_upload_magic_number(void); +extern void kernel_sec_set_build_info(void); + +extern void kernel_sec_hw_reset(bool bSilentReset); +extern void kernel_sec_init(void); + +extern void kernel_sec_get_core_reg_dump(t_kernel_sec_arm_core_regsiters *regs); +extern int kernel_sec_get_mmu_reg_dump(t_kernel_sec_mmu_info *mmu_info); +extern void kernel_sec_save_final_context(void); + +extern bool kernel_set_debug_level(int level); +extern int kernel_get_debug_level(void); +extern int kernel_get_debug_state(void); + +extern bool kernel_sec_set_debug_level(int level); +extern int kernel_sec_get_debug_level_from_param(void); +extern int kernel_sec_get_debug_level(void); + +#if 1 /* dpram */ +extern void kernel_sec_cdma_dpram_dump(void); +#endif + +#define KERNEL_SEC_LEN_BUILD_TIME 16 +#define KERNEL_SEC_LEN_BUILD_DATE 16 + +#endif /* _KERNEL_SEC_COMMON_H_ */ diff --git a/include/linux/kr3dh.h b/include/linux/kr3dh.h new file mode 100644 index 0000000..48f8466 --- /dev/null +++ b/include/linux/kr3dh.h @@ -0,0 +1,122 @@ +/* + * kr3dh.c - ST Microelectronics three-axes accelerometer + * + * Copyright (C) 2010 Samsung Electronics + * Donggeun Kim <dg77.kim@samsung.com> + * + * 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. + */ + +#ifndef _KR3DH_H_ +#define _KR3DH_H_ + +enum kr3dh_ouput_data_rate { + KR3DH_ODR_50HZ, + KR3DH_ODR_100HZ, + KR3DH_ODR_400HZ, + KR3DH_ODR_1000HZ, +}; + +enum kr3dh_power_mode { + KR3DH_POWER_DOWN, + KR3DH_NORMAL_MODE, + KR3DH_LOW_POWER_ONE_HALF_HZ, + KR3DH_LOW_POWER_1HZ, + KR3DH_LOW_POWER_2HZ, + KR3DH_LOW_POWER_5HZ, + KR3DH_LOW_POWER_10HZ, +}; + +enum kr3dh_int_hl_active { + KR3DH_HIGH, + KR3DH_LOW, +}; + +enum kr3dh_int_pp_od { + KR3DH_PUSH_PULL, + KR3DH_OPEN_DRAIN, +}; + +enum kr3dh_int_cfg { + KR3DH_INT_SOURCE, + KR3DH_INT_SOURCE_OR, + KR3DH_DATA_READY, + KR3DH_BOOT_RUNNING, +}; + +enum kr3dh_spi_mode { + KR3DH_FOUR_WIRE, + KR3DH_THREE_WIRE, +}; + +enum kr3dh_scale_range { + KR3DH_RANGE_2G, + KR3DH_RANGE_4G, + KR3DH_RANGE_8G = 3, +}; + +enum kr3dh_turn_on_mode { + KR3DH_SLEEP_TO_WAKE_DISABLE, + KR3DH_SLEEP_TO_WAKE_ENABLE = 3, +}; + +enum kr3dh_int_combination { + KR3DH_OR_COMBINATION, + KR3DH_AND_COMBINATION, +}; + +struct kr3dh_platform_data { + int irq2; + int negate_x; + int negate_y; + int negate_z; + int change_xy; + u8 power_mode; + u8 data_rate; + u8 zen; + u8 yen; + u8 xen; + u8 reboot; + u8 hpmode; + u8 filter_sel; + u8 hp_enable_1; + u8 hp_enable_2; + u8 hpcf; + u8 int_hl_active; + u8 int_pp_od; + u8 int2_latch; + u8 int2_cfg; + u8 int1_latch; + u8 int1_cfg; + u8 block_data_update; + u8 endian; + u8 fullscale; + u8 selftest_sign; + u8 selftest; + u8 spi_mode; + u8 turn_on_mode; + u8 int1_combination; + u8 int1_6d_enable; + u8 int1_z_high_enable; + u8 int1_z_low_enable; + u8 int1_y_high_enable; + u8 int1_y_low_enable; + u8 int1_x_high_enable; + u8 int1_x_low_enable; + u8 int1_threshold; + u8 int1_duration; + u8 int2_combination; + u8 int2_6d_enable; + u8 int2_z_high_enable; + u8 int2_z_low_enable; + u8 int2_y_high_enable; + u8 int2_y_low_enable; + u8 int2_x_high_enable; + u8 int2_x_low_enable; + u8 int2_threshold; + u8 int2_duration; +}; + +#endif diff --git a/include/linux/lcd-property.h b/include/linux/lcd-property.h new file mode 100644 index 0000000..4c83076 --- /dev/null +++ b/include/linux/lcd-property.h @@ -0,0 +1,35 @@ +/* + * LCD panel property definitions. + * + * Copyright (c) 2012 Samsung Electronics + * + * Joongmock Shin <jmock.shin@samsung.com> + * Eunchul Kim <chulspro.kim@samsung.com> + * + * 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. +*/ +#ifndef LCD_PROPERTY_H +#define LCD_PROPERTY_H + +/* definition of flip */ +enum lcd_property_flip { + LCD_PROPERTY_FLIP_NONE = (0 << 0), + LCD_PROPERTY_FLIP_VERTICAL = (1 << 0), + LCD_PROPERTY_FLIP_HORIZONTAL = (1 << 1), +}; + +/* + * A structure for lcd property. + * + * @flip: flip information for each lcd. + * @dynamic_refresh: enable/disable dynamic refresh. + */ +struct lcd_property { + enum lcd_property_flip flip; + bool dynamic_refresh; +}; + +#endif /* LCD_PROPERTY_H */ + diff --git a/include/linux/ld9040.h b/include/linux/ld9040.h index 88bdf56..6fb3377 100644 --- a/include/linux/ld9040.h +++ b/include/linux/ld9040.h @@ -43,3 +43,10 @@ struct spi_ops { #define LCDTYPE_M2 (1) #define LCDTYPE_SM2_A1 (0) #define LCDTYPE_SM2_A2 (2) + +enum { + ACL_STATUS_0P = 0, + ACL_STATUS_40P, + ACL_STATUS_50P, + ACL_STATUS_MAX +}; diff --git a/include/linux/leds-lp5521.h b/include/linux/leds-lp5521.h index 0d72c7f..3f071ec 100644 --- a/include/linux/leds-lp5521.h +++ b/include/linux/leds-lp5521.h @@ -5,8 +5,6 @@ * * Contact: Samu Onkalo <samu.p.onkalo@nokia.com> * - * Updated: Milo(Woogyom) Kim <milo.kim@ti.com> - * * 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. @@ -34,6 +32,15 @@ struct lp5521_led_config { u8 max_current; }; +struct lp5521_led_pattern { + u8 *r; + u8 *g; + u8 *b; + u8 size_r; + u8 size_g; + u8 size_b; +}; + #define LP5521_CLOCK_AUTO 0 #define LP5521_CLOCK_INT 1 #define LP5521_CLOCK_EXT 2 @@ -54,11 +61,13 @@ struct lp5521_platform_data { struct lp5521_led_config *led_config; u8 num_channels; u8 clock_mode; - u8 update_config; int (*setup_resources)(void); void (*release_resources)(void); void (*enable)(bool state); const char *label; + u8 update_config; + struct lp5521_led_pattern *patterns; + int num_patterns; }; #endif /* __LINUX_LP5521_H */ diff --git a/include/linux/leds.h b/include/linux/leds.h index dcc1d70..3a278a2 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -24,7 +24,7 @@ struct device; enum led_brightness { LED_OFF = 0, -#if defined(CONFIG_MACH_Q1_BD) +#if defined(CONFIG_MACH_Q1_BD) || defined(CONFIG_MACH_U1_NA_USCC) LED_BRIGHTNESS_LEVEL1 = 1, LED_BRIGHTNESS_LEVEL2 = 2, LED_BRIGHTNESS_LEVEL3 = 3, diff --git a/include/linux/mdm_hsic_pm.h b/include/linux/mdm_hsic_pm.h new file mode 100644 index 0000000..6388074 --- /dev/null +++ b/include/linux/mdm_hsic_pm.h @@ -0,0 +1,45 @@ +#ifndef __MDM_HSIC_PM_H__ +#define __MDM_HSIC_PM_H__ +#include <linux/usb.h> + +enum pwr_stat { + POWER_OFF, + POWER_ON, +}; + +void request_active_lock_set(const char *name); +void request_active_lock_release(const char *name); +void request_boot_lock_set(const char *name); +void request_boot_lock_release(const char *name); +void set_host_stat(const char *name, enum pwr_stat status); +int wait_dev_pwr_stat(const char *name, enum pwr_stat status); +int check_udev_suspend_allowed(const char *name); +bool check_request_blocked(const char *name); + +/*add wakelock interface for fast dormancy*/ +#ifdef CONFIG_HAS_WAKELOCK +void fast_dormancy_wakelock(const char *name); +#else +void fast_dormancy_wakelock(const char *name) {} +#endif + +/** + * register_udev_to_pm_dev - called at interface driver probe function + * + * @name: name of pm device to register usb device + * @udev: pointer of udev to register + */ +int register_udev_to_pm_dev(const char *name, struct usb_device *udev); + +/** + * unregister_udev_from_pm_dev - called at interface driver disconnect function + * + * @name: name of pm device to unregister usb device + * @udev: pointer of udev to unregister + */ +void unregister_udev_from_pm_dev(const char *name, struct usb_device *udev); + +extern struct blocking_notifier_head mdm_reset_notifier_list; +extern void mdm_force_fatal(void); +extern bool lpa_handling; +#endif /* __MDM_HSIC_PM_H__ */ diff --git a/include/linux/melfas_mms_ts.h b/include/linux/melfas_mms_ts.h new file mode 100644 index 0000000..a98ff97 --- /dev/null +++ b/include/linux/melfas_mms_ts.h @@ -0,0 +1,79 @@ +/* + * include/linux/mms144.h - platform data structure for MCS Series sensor + * + * Copyright (C) 2010 Melfas, Inc. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _LINUX_MELFAS_TS_H +#define _LINUX_MELFAS_TS_H + +#define MELFAS_TS_NAME "melfas_ts" +#define MELFAS_DEV_ADDR 0x48 + +extern struct class *sec_class; + +struct melfas_mms_platform_data { + int max_x; + int max_y; + + bool invert_x; + bool invert_y; + + int gpio_int; + int gpio_sda; + int gpio_scl; + int (*power) (int on); + int (*mux_fw_flash) (bool to_gpios); + int (*is_vdd_on) (void); + void (*input_event) (void *data); + void (*register_cb) (void *); +}; + +enum eISCRet_t { + ISC_NONE = -1, + ISC_SUCCESS = 0, + ISC_FILE_OPEN_ERROR, + ISC_FILE_CLOSE_ERROR, + ISC_FILE_FORMAT_ERROR, + ISC_WRITE_BUFFER_ERROR, + ISC_I2C_ERROR, + ISC_UPDATE_MODE_ENTER_ERROR, + ISC_CRC_ERROR, + ISC_VALIDATION_ERROR, + ISC_COMPATIVILITY_ERROR, + ISC_UPDATE_SECTION_ERROR, + ISC_SLAVE_ERASE_ERROR, + ISC_SLAVE_DOWNLOAD_ERROR, + ISC_DOWNLOAD_WHEN_SLAVE_IS_UPDATED_ERROR, + ISC_INITIAL_PACKET_ERROR, + ISC_NO_NEED_UPDATE_ERROR, + ISC_LIMIT +}; + +enum eSectionType_t { + SEC_NONE = -1, + SEC_BOOTLOADER = 0, + SEC_CORE, + SEC_PRIVATE_CONFIG, + SEC_PUBLIC_CONFIG, + SEC_LIMIT +}; + +struct tISCFWInfo_t { + unsigned char version; + unsigned char compatible_version; + unsigned char start_addr; + unsigned char end_addr; +}; + +#endif /* _LINUX_MELFAS_TS_H */ diff --git a/include/linux/melfas_ts.h b/include/linux/melfas_ts.h index 4805ce8..8f43384 100644 --- a/include/linux/melfas_ts.h +++ b/include/linux/melfas_ts.h @@ -38,7 +38,7 @@ struct melfas_tsi_platform_data { struct notifier_block fb_notif; #endif -#if defined(CONFIG_MACH_C1CTC) || defined(CONFIG_MACH_M0_CHNOPEN) ||\ +#if defined(CONFIG_MACH_M0_CHNOPEN) || \ defined(CONFIG_MACH_M0_CMCC) || defined(CONFIG_MACH_M0_CTC) int (*lcd_type)(void); #endif diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h index ff0b1a2..7a2c536 100644 --- a/include/linux/mfd/max77693-private.h +++ b/include/linux/mfd/max77693-private.h @@ -177,9 +177,11 @@ enum max77693_haptic_reg { /* MAX77693 STATUS2 register */ #define STATUS2_CHGTYP_SHIFT 0 #define STATUS2_CHGDETRUN_SHIFT 3 +#define STATUS2_DXOVP_SHIFT 5 #define STATUS2_VBVOLT_SHIFT 6 #define STATUS2_CHGTYP_MASK (0x7 << STATUS2_CHGTYP_SHIFT) #define STATUS2_CHGDETRUN_MASK (0x1 << STATUS2_CHGDETRUN_SHIFT) +#define STATUS2_DXOVP_MASK (0x1 << STATUS2_DXOVP_SHIFT) #define STATUS2_VBVOLT_MASK (0x1 << STATUS2_VBVOLT_SHIFT) /* MAX77693 CDETCTRL1 register */ @@ -232,7 +234,12 @@ enum max77693_reg_ctrl1_val { MAX77693_MUIC_CTRL1_BIN_6_110 = 0x06, MAX77693_MUIC_CTRL1_BIN_7_111 = 0x07, }; - +#if defined(CONFIG_SWITCH_DUAL_MODEM) +enum max77693_switch_sel_val { + MAX77693_SWITCH_SEL_1st_BIT_USB = 0x3 << 0, + MAX77693_SWITCH_SEL_2nd_BIT_UART = 0x3 << 2, +}; +#else enum max77693_switch_sel_val { MAX77693_SWITCH_SEL_1st_BIT_USB = 0x1 << 0, MAX77693_SWITCH_SEL_2nd_BIT_UART = 0x1 << 1, @@ -240,6 +247,7 @@ enum max77693_switch_sel_val { MAX77693_SWITCH_SEL_3rd_BIT_LTE_UART = 0x1 << 2, #endif }; +#endif enum max77693_reg_ctrl1_type { CTRL1_AP_USB = @@ -349,6 +357,10 @@ enum max77693_types { TYPE_MAX77693, }; +#ifdef CONFIG_FAST_BOOT +extern bool fake_shut_down; +#endif + extern struct device *switch_dev; extern int max77693_irq_init(struct max77693_dev *max77693); extern void max77693_irq_exit(struct max77693_dev *max77693); @@ -385,6 +397,12 @@ enum cable_type_muic { CABLE_TYPE_MHL_MUIC, CABLE_TYPE_MHL_VB_MUIC, CABLE_TYPE_SMARTDOCK_MUIC, + CABLE_TYPE_SMARTDOCK_TA_MUIC, + CABLE_TYPE_SMARTDOCK_USB_MUIC, + CABLE_TYPE_AUDIODOCK_MUIC, +#if defined(CONFIG_MUIC_DET_JACK) + CABLE_TYPE_EARJACK_MUIC, +#endif CABLE_TYPE_UNKNOWN_MUIC }; @@ -392,6 +410,10 @@ enum { AP_USB_MODE = 0, CP_USB_MODE, AUDIO_MODE, +#if defined(CONFIG_SWITCH_DUAL_MODEM) + CP_ESC_USB_MODE, +#endif + }; enum { @@ -400,6 +422,10 @@ enum { #ifdef CONFIG_LTE_VIA_SWITCH UART_PATH_LTE, #endif +#if defined(CONFIG_SWITCH_DUAL_MODEM) + UART_PATH_CP_ESC, +#endif + }; #endif /* CONFIG_MFD_MAX77693 */ diff --git a/include/linux/mfd/max77693.h b/include/linux/mfd/max77693.h index 07f2162..274693a 100644 --- a/include/linux/mfd/max77693.h +++ b/include/linux/mfd/max77693.h @@ -35,6 +35,14 @@ enum { MAX77693_MUIC_ATTACHED }; +enum { + MAX77693_MUIC_DOCK_DETACHED = 0, + MAX77693_MUIC_DOCK_DESKDOCK, + MAX77693_MUIC_DOCK_CARDOCK, + MAX77693_MUIC_DOCK_AUDIODOCK = 7, + MAX77693_MUIC_DOCK_SMARTDOCK = 8 +}; + /* MAX77686 regulator IDs */ enum max77693_regulators { MAX77693_ESAFEOUT1 = 0, @@ -63,6 +71,7 @@ struct max77693_charger_platform_data { #ifdef CONFIG_VIBETONZ #define MAX8997_MOTOR_REG_CONFIG2 0x2 #define MOTOR_LRA (1<<7) +#define MOTOR_ERM (0<<7) #define MOTOR_EN (1<<6) #define EXT_PWM (0<<5) #define DIVIDER_128 (1<<1) @@ -117,14 +126,17 @@ struct max77693_muic_data { void (*usb_cb) (u8 attached); void (*uart_cb) (u8 attached); int (*charger_cb) (enum cable_type_muic); - void (*deskdock_cb) (bool attached); - void (*cardock_cb) (bool attached); + void (*dock_cb) (int type); void (*mhl_cb) (int attached); void (*init_cb) (void); int (*set_safeout) (int path); bool(*is_mhl_attached) (void); int (*cfg_uart_gpio) (void); void (*jig_uart_cb) (int path); +#if defined(CONFIG_MUIC_DET_JACK) + void (*earjack_cb) (int attached); + void (*earjackkey_cb) (int pressed, unsigned int code); +#endif int (*host_notify_cb) (int enable); int gpio_usb_sel; int sw_path; @@ -135,7 +147,11 @@ struct max77693_muic_data { }; #if defined(CONFIG_MACH_M0_CTC) -int max7693_muic_cp_usb_state(void); +extern int max7693_muic_cp_usb_state(void); #endif +#if defined(CONFIG_MUIC_MAX77693_SUPPORT_OTG_AUDIO_DOCK) +extern void max77693_muic_attach_audio_dock(void); +#endif /* CONFIG_MUIC_MAX77693_SUPPORT_OTG_AUDIO_DOCK */ + #endif /* __LINUX_MFD_MAX77693_H */ diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h index 256ed57..0658eba 100644 --- a/include/linux/mfd/max8997.h +++ b/include/linux/mfd/max8997.h @@ -24,8 +24,7 @@ #define __LINUX_MFD_MAX8997_H #include <linux/regulator/machine.h> - -#if defined(CONFIG_MACH_Q1_BD) +#if defined(CONFIG_MACH_Q1_BD) || defined(CONFIG_MACH_U1_NA_USCC) #define MAX8997_SUPPORT_TORCH #endif /* CONFIG_MACH_Q1_BD */ @@ -125,6 +124,35 @@ enum { UART_PATH_AP, }; +enum { + USB_SEL_IF = 0, + USB_SEL_CP, +}; + +enum muic_acc_type { + MUIC_ACC_TYPE_NONE = 0, + MUIC_ACC_TYPE_OTG, + MUIC_ACC_TYPE_MHL, + MUIC_ACC_TYPE_STATION, + MUIC_ACC_TYPE_JIG_USB_OFF, + MUIC_ACC_TYPE_JIG_USB_ON, + MUIC_ACC_TYPE_DESKDOCK, + MUIC_ACC_TYPE_JIG_UART_OFF, + MUIC_ACC_TYPE_JIG_UART_ON, + MUIC_ACC_TYPE_CARDOCK, + MUIC_ACC_TYPE_TA, + MUIC_ACC_TYPE_USB, + MUIC_ACC_TYPE_UNKNOWN +}; + +enum muic_chg_type { + MUIC_CHG_TYPE_NONE = 0, + MUIC_CHG_TYPE_USB, + MUIC_CHG_TYPE_TA, + MUIC_CHG_TYPE_MHL_VB, + MUIC_CHG_TYPE_UNKNOWN +}; + enum cable_type { CABLE_TYPE_NONE = 0, CABLE_TYPE_USB, @@ -153,18 +181,13 @@ struct max8997_muic_data { void (*init_cb) (void); int (*set_safeout) (int path); bool (*is_mhl_attached) (void); -#if !defined(CONFIG_MACH_U1CAMERA_BD) int (*cfg_uart_gpio) (void); -#endif /* CONFIG_MACH_U1CAMERA_BD */ void (*jig_uart_cb) (int path); int (*host_notify_cb) (int enable); -#if !defined(CONFIG_MACH_U1CAMERA_BD) int gpio_usb_sel; -#endif /* CONFIG_MACH_U1CAMERA_BD */ - int sw_path; -#if !defined(CONFIG_MACH_U1CAMERA_BD) + int gpio_uart_sel; + int usb_path; int uart_path; -#endif /* CONFIG_MACH_U1CAMERA_BD */ }; struct max8997_buck1_dvs_funcs { diff --git a/include/linux/mfd/s5m87xx/s5m-core.h b/include/linux/mfd/s5m87xx/s5m-core.h index 5afc005..5ba71a2 100644 --- a/include/linux/mfd/s5m87xx/s5m-core.h +++ b/include/linux/mfd/s5m87xx/s5m-core.h @@ -145,6 +145,7 @@ enum s5m8767_reg { S5M8767_REG_LDO26CTRL, S5M8767_REG_LDO27CTRL, S5M8767_REG_LDO28CTRL, + S5M8767_REG_BUCK1DVS2 = 0xE2, }; /* S5M8763 registers */ @@ -377,6 +378,7 @@ struct s5m_platform_data { bool wtsr_smpl; + int buck1_init; int buck2_init; int buck3_init; int buck4_init; diff --git a/include/linux/migrate.h b/include/linux/migrate.h index e39aeec..95323a6 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h @@ -12,9 +12,15 @@ typedef struct page *new_page_t(struct page *, unsigned long private, int **); extern void putback_lru_pages(struct list_head *l); extern int migrate_page(struct address_space *, struct page *, struct page *); +#ifndef CONFIG_DMA_CMA extern int migrate_pages(struct list_head *l, new_page_t x, unsigned long private, bool offlining, bool sync); +#else +extern int migrate_pages(struct list_head *l, new_page_t x, + unsigned long private, bool offlining, + bool sync, int tries); +#endif extern int migrate_huge_pages(struct list_head *l, new_page_t x, unsigned long private, bool offlining, bool sync); @@ -34,9 +40,15 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping, #define PAGE_MIGRATION 0 static inline void putback_lru_pages(struct list_head *l) {} +#ifndef CONFIG_DMA_CMA static inline int migrate_pages(struct list_head *l, new_page_t x, unsigned long private, bool offlining, bool sync) { return -ENOSYS; } +#else +static inline int migrate_pages(struct list_head *l, new_page_t x, + unsigned long private, bool offlining, + bool sync, int tries) { return -ENOSYS; } +#endif static inline int migrate_huge_pages(struct list_head *l, new_page_t x, unsigned long private, bool offlining, bool sync) { return -ENOSYS; } diff --git a/include/linux/mm.h b/include/linux/mm.h index f59179b..2ce8e03 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -448,7 +448,11 @@ void put_page(struct page *page); void put_pages_list(struct list_head *pages); void split_page(struct page *page, unsigned int order); +#ifndef CONFIG_DMA_CMA int split_free_page(struct page *page); +#else +int split_free_page(struct page *page, bool for_cma); +#endif /* * Compound pages have a destructor function. Provide a @@ -1603,6 +1607,9 @@ int in_gate_area_no_mm(unsigned long addr); #define in_gate_area(mm, addr) ({(void)mm; in_gate_area_no_mm(addr);}) #endif /* __HAVE_ARCH_GATE_AREA */ +#ifdef CONFIG_DMA_CMA +void perform_drop_caches(unsigned int mode); +#endif int drop_caches_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); unsigned long shrink_slab(struct shrink_control *shrink, diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 059839c..0f230ce 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -198,6 +198,9 @@ struct vm_area_struct { #ifdef CONFIG_NUMA struct mempolicy *vm_policy; /* NUMA policy for the VMA */ #endif +#ifdef CONFIG_ZRAM_FOR_ANDROID + int vma_swap_done; +#endif /* CONFIG_ZRAM_FOR_ANDROID */ }; struct core_thread { @@ -330,6 +333,9 @@ struct mm_struct { #ifdef CONFIG_CPUMASK_OFFSTACK struct cpumask cpumask_allocation; #endif +#ifdef CONFIG_ZRAM_FOR_ANDROID + int mm_swap_done; +#endif /* CONFIG_ZRAM_FOR_ANDROID */ }; static inline void mm_init_cpumask(struct mm_struct *mm) diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 6ca73e3..942cd59 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -206,6 +206,8 @@ struct mmc_card { #define MMC_QUIRK_DISABLE_CD (1<<5) /* disconnect CD/DAT[3] resistor */ #define MMC_QUIRK_INAND_CMD38 (1<<6) /* iNAND devices have broken CMD38 */ #define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ +/* MoviNAND secure issue */ +#define MMC_QUIRK_MOVINAND_SECURE (1<<8) unsigned int poweroff_notify_state; /* eMMC4.5 notify feature */ #define MMC_NO_POWER_NOTIFICATION 0 diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index c5105b9..ad75fd5 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -255,7 +255,7 @@ struct mmc_host { #define MMC_CAP2_HS200_1_2V_SDR (1 << 8) /* can support */ #define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \ MMC_CAP2_HS200_1_2V_SDR) - +#define MMC_CAP2_ADAPT_PACKED (1 << 9) /* Disable packed write adaptively */ mmc_pm_flag_t pm_caps; /* supported pm features */ unsigned int power_notify_type; #define MMC_HOST_PW_NOTIFY_NONE 0 diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 5b5350a..bc047b4 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h @@ -279,6 +279,7 @@ struct _mmc_csd { #define EXT_CSD_PACKED_CMD_STATUS 36 /* RO */ #define EXT_CSD_EXP_EVENTS_STATUS 54 /* RO, 2 bytes */ #define EXT_CSD_EXP_EVENTS_CTRL 56 /* R/W, 2 bytes */ +#define EXT_CSD_VENDOR_SPECIFIC_FIELD 64 /* RO, 64bytes */ #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ #define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ #define EXT_CSD_HPI_MGMT 161 /* R/W */ diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h index 39016ed..39016ed 100755..100644 --- a/include/linux/mmc/sdio_func.h +++ b/include/linux/mmc/sdio_func.h diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 9f7c3eb..e5dcd07 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -35,6 +35,8 @@ */ #define PAGE_ALLOC_COSTLY_ORDER 3 +#ifndef CONFIG_DMA_CMA + #define MIGRATE_UNMOVABLE 0 #define MIGRATE_RECLAIMABLE 1 #define MIGRATE_MOVABLE 2 @@ -43,6 +45,37 @@ #define MIGRATE_ISOLATE 4 /* can't allocate from here */ #define MIGRATE_TYPES 5 +#else +enum { + MIGRATE_UNMOVABLE, + MIGRATE_RECLAIMABLE, + MIGRATE_MOVABLE, + MIGRATE_PCPTYPES, /* the number of types on the pcp lists */ + MIGRATE_RESERVE = MIGRATE_PCPTYPES, + /* + * MIGRATE_CMA migration type is designed to mimic the way + * ZONE_MOVABLE works. Only movable pages can be allocated + * from MIGRATE_CMA pageblocks and page allocator never + * implicitly change migration type of MIGRATE_CMA pageblock. + * + * The way to use it is to change migratetype of a range of + * pageblocks to MIGRATE_CMA which can be done by + * __free_pageblock_cma() function. What is important though + * is that a range of pageblocks must be aligned to + * MAX_ORDER_NR_PAGES should biggest page be bigger then + * a single pageblock. + */ + MIGRATE_CMA, + MIGRATE_ISOLATE, /* can't allocate from here */ + MIGRATE_TYPES +}; + +bool is_cma_pageblock(struct page *page); +#define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA) +#define cma_wmark_pages(zone) (zone->min_cma_pages) + +#endif + #define for_each_migratetype_order(order, type) \ for (order = 0; order < MAX_ORDER; order++) \ for (type = 0; type < MIGRATE_TYPES; type++) @@ -115,6 +148,9 @@ enum zone_stat_item { NUMA_OTHER, /* allocation from other node */ #endif NR_ANON_TRANSPARENT_HUGEPAGES, +#ifdef CONFIG_DMA_CMA + NR_FREE_CMA_PAGES, +#endif NR_VM_ZONE_STAT_ITEMS }; /* @@ -316,6 +352,14 @@ struct zone { /* see spanned/present_pages for more description */ seqlock_t span_seqlock; #endif +#ifdef CONFIG_DMA_CMA + /* + * CMA needs to increase watermark levels during the allocation + * process to make sure that the system is not starved. + */ + unsigned long min_cma_pages; + bool cma_alloc; +#endif struct free_area free_area[MAX_ORDER]; #ifndef CONFIG_SPARSEMEM diff --git a/include/linux/msm_charm.h b/include/linux/msm_charm.h index 779fd38..3695643 100644 --- a/include/linux/msm_charm.h +++ b/include/linux/msm_charm.h @@ -10,6 +10,11 @@ #define NORMAL_BOOT_DONE _IOW(CHARM_CODE, 5, int) #define RAM_DUMP_DONE _IOW(CHARM_CODE, 6, int) #define WAIT_FOR_RESTART _IOR(CHARM_CODE, 7, int) +#define SILENT_RESET_CONTROL _IOR(CHARM_CODE, 8, int) +#define AUTOPM_LOCK _IOW(CHARM_CODE, 9, int) +#define GET_BOOT_PROTOCOL _IOW(CHARM_CODE, 10, int) +#define GET_FORCE_RAMDUMP _IOW(CHARM_CODE, 11, int) +#define WAIT_FOR_ERROR _IOW(CHARM_CODE, 12, int) enum charm_boot_type { CHARM_NORMAL_BOOT = 0, diff --git a/include/linux/netfilter/xt_IDLETIMER.h b/include/linux/netfilter/xt_IDLETIMER.h index 208ae93..faaa28b 100644 --- a/include/linux/netfilter/xt_IDLETIMER.h +++ b/include/linux/netfilter/xt_IDLETIMER.h @@ -4,6 +4,7 @@ * Header file for Xtables timer target module. * * Copyright (C) 2004, 2010 Nokia Corporation + * * Written by Timo Teras <ext-timo.teras@nokia.com> * * Converted to x_tables and forward-ported to 2.6.34 @@ -32,12 +33,19 @@ #include <linux/types.h> #define MAX_IDLETIMER_LABEL_SIZE 28 +#define NLMSG_MAX_SIZE 64 + +#define NL_EVENT_TYPE_INACTIVE 0 +#define NL_EVENT_TYPE_ACTIVE 1 struct idletimer_tg_info { __u32 timeout; char label[MAX_IDLETIMER_LABEL_SIZE]; + /* Use netlink messages for notification in addition to sysfs */ + __u8 send_nl_msg; + /* for kernel module internal use only */ struct idletimer_tg *timer __attribute__((aligned(8))); }; diff --git a/include/linux/netlink.h b/include/linux/netlink.h index a9dd895..e8e9cc3 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -26,6 +26,7 @@ #define NETLINK_ECRYPTFS 19 #define NETLINK_RDMA 20 + #define MAX_LINKS 32 struct sockaddr_nl { diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index dca6723..4ba9276 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h @@ -745,8 +745,14 @@ enum nl80211_commands { * * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with * a single scan request, a wiphy attribute. + * @NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS: number of SSIDs you can + * scan with a single scheduled scan request, a wiphy attribute. * @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements * that can be added to a scan request + * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information + * elements that can be added to a scheduled scan request + * @NL80211_ATTR_MAX_MATCH_SETS: maximum number of sets that can be + * used with @NL80211_ATTR_SCHED_SCAN_MATCH, a wiphy attribute. * * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive @@ -987,6 +993,24 @@ enum nl80211_commands { * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan * cycles, in msecs. + + * @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more + * sets of attributes to match during scheduled scans. Only BSSs + * that match any of the sets will be reported. These are + * pass-thru filter rules. + * For a match to succeed, the BSS must match all attributes of a + * set. Since not every hardware supports matching all types of + * attributes, there is no guarantee that the reported BSSs are + * fully complying with the match sets and userspace needs to be + * able to ignore them by itself. + * Thus, the implementation is somewhat hardware-dependent, but + * this is only an optimization and the userspace application + * needs to handle all the non-filtered results anyway. + * If the match attributes don't make sense when combined with + * the values passed in @NL80211_ATTR_SCAN_SSIDS (eg. if an SSID + * is included in the probe request, but the match attributes + * will never let it go through), -EINVAL may be returned. + * If ommited, no filtering is done. * * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported * interface combinations. In each nested item, it contains attributes @@ -1194,6 +1218,26 @@ enum nl80211_attrs { NL80211_ATTR_INTERFACE_COMBINATIONS, NL80211_ATTR_SOFTWARE_IFTYPES, + NL80211_ATTR_REKEY_DATA, + + NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS, + NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN, + + NL80211_ATTR_SCAN_SUPP_RATES, + + NL80211_ATTR_HIDDEN_SSID, + + NL80211_ATTR_IE_PROBE_RESP, + NL80211_ATTR_IE_ASSOC_RESP, + + NL80211_ATTR_STA_WME, + NL80211_ATTR_SUPPORT_AP_UAPSD, + + NL80211_ATTR_ROAM_SUPPORT, + + NL80211_ATTR_SCHED_SCAN_MATCH, + NL80211_ATTR_MAX_MATCH_SETS, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, @@ -1654,6 +1698,26 @@ enum nl80211_reg_rule_attr { }; /** + * enum nl80211_sched_scan_match_attr - scheduled scan match attributes + * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved + * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching, + * only report BSS with matching SSID. + * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter + * attribute number currently defined + * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use + */ +enum nl80211_sched_scan_match_attr { + __NL80211_SCHED_SCAN_MATCH_ATTR_INVALID, + + NL80211_ATTR_SCHED_SCAN_MATCH_SSID, + + /* keep last */ + __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST, + NL80211_SCHED_SCAN_MATCH_ATTR_MAX = + __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1 +}; + +/** * enum nl80211_reg_rule_flags - regulatory rule flags * * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 6081493..9a63bd6 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -131,6 +131,54 @@ enum pageflags { #ifndef __GENERATING_BOUNDS_H +#ifdef CONFIG_DMA_CMA +struct page; +extern struct page *migrate_pages_current; + +/* + * Macros to create function definitions for page flags + */ +#define TESTPAGEFLAG(uname, lname) \ +static inline int Page##uname(struct page *page) \ + { do { } while (0); return test_bit(PG_##lname, &page->flags); } + +#define SETPAGEFLAG(uname, lname) \ +static inline void SetPage##uname(struct page *page) \ + { WARN_ON(0 && page == migrate_pages_current); \ + set_bit(PG_##lname, &page->flags); } + +#define CLEARPAGEFLAG(uname, lname) \ +static inline void ClearPage##uname(struct page *page) \ + { WARN_ON(0 && page == migrate_pages_current); \ + clear_bit(PG_##lname, &page->flags); } + +#define __SETPAGEFLAG(uname, lname) \ +static inline void __SetPage##uname(struct page *page) \ + { WARN_ON(0 && page == migrate_pages_current); \ + __set_bit(PG_##lname, &page->flags); } + +#define __CLEARPAGEFLAG(uname, lname) \ +static inline void __ClearPage##uname(struct page *page) \ + { WARN_ON(0 && page == migrate_pages_current); \ + __clear_bit(PG_##lname, &page->flags); } + +#define TESTSETFLAG(uname, lname) \ +static inline int TestSetPage##uname(struct page *page) \ + { WARN_ON(0 && page == migrate_pages_current); \ + return test_and_set_bit(PG_##lname, &page->flags); } + +#define TESTCLEARFLAG(uname, lname) \ +static inline int TestClearPage##uname(struct page *page) \ + { WARN_ON(0 && page == migrate_pages_current); \ + return test_and_clear_bit(PG_##lname, &page->flags); } + +#define __TESTCLEARFLAG(uname, lname) \ +static inline int __TestClearPage##uname(struct page *page) \ + { WARN_ON(0 && page == migrate_pages_current); \ + return __test_and_clear_bit(PG_##lname, &page->flags); } + +#else + /* * Macros to create function definitions for page flags */ @@ -166,6 +214,8 @@ static inline int TestClearPage##uname(struct page *page) \ static inline int __TestClearPage##uname(struct page *page) \ { return __test_and_clear_bit(PG_##lname, &page->flags); } +#endif + #define PAGEFLAG(uname, lname) TESTPAGEFLAG(uname, lname) \ SETPAGEFLAG(uname, lname) CLEARPAGEFLAG(uname, lname) diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h index 051c1b1..4502fdc 100644 --- a/include/linux/page-isolation.h +++ b/include/linux/page-isolation.h @@ -1,6 +1,7 @@ #ifndef __LINUX_PAGEISOLATION_H #define __LINUX_PAGEISOLATION_H +#ifndef CONFIG_DMA_CMA /* * Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE. * If specified range includes migrate types other than MOVABLE, @@ -33,5 +34,38 @@ test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn); extern int set_migratetype_isolate(struct page *page); extern void unset_migratetype_isolate(struct page *page); +#else +/* + * Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE. + * If specified range includes migrate types other than MOVABLE or CMA, + * this will fail with -EBUSY. + * + * For isolating all pages in the range finally, the caller have to + * free all pages in the range. test_page_isolated() can be used for + * test it. + */ +extern int +start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, + unsigned migratetype); + +/* + * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. + * target range is [start_pfn, end_pfn) + */ +extern int +undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, + unsigned migratetype); + +/* + * Test all pages in [start_pfn, end_pfn) are isolated or not. + */ +int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn); + +/* + * Internal functions. Changes pageblock's migrate type. + */ +extern int set_migratetype_isolate(struct page *page); +extern void unset_migratetype_isolate(struct page *page, unsigned migratetype); +#endif #endif diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 716875e..7933b74 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -205,7 +205,11 @@ extern struct page *__page_cache_alloc(gfp_t gfp); #else static inline struct page *__page_cache_alloc(gfp_t gfp) { +#ifndef CONFIG_DMA_CMA return alloc_pages(gfp, 0); +#else + return alloc_pages(gfp & ~__GFP_MOVABLE, 0); +#endif } #endif diff --git a/include/linux/platform_data/cypress_cyttsp4.h b/include/linux/platform_data/cypress_cyttsp4.h new file mode 100644 index 0000000..03819d6 --- /dev/null +++ b/include/linux/platform_data/cypress_cyttsp4.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2010 Motorola Mobility, Inc. + * Modified by Cypress Semiconductor 2011-2012 + * - increase touch_settings.size from uint8_t to uint32_t + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + * 02111-1307, USA + */ + +/* Defines generic platform structures for touch drivers */ +#ifndef _LINUX_TOUCH_PLATFORM_H +#define _LINUX_TOUCH_PLATFORM_H + +#include <linux/types.h> + +enum { + GPIO_TOUCH_nINT = 0, + GPIO_TOUCH_EN, + GPIO_TOUCH_SCL, + GPIO_TOUCH_SDA +}; + +struct touch_settings { + const uint8_t *data; + uint32_t size; + uint8_t tag; +} __attribute__ ((packed)); + +struct touch_firmware { + const uint8_t *img; + uint32_t size; + const uint8_t *ver; + uint8_t vsize; +} __attribute__ ((packed)); + +struct touch_framework { + const uint16_t *abs; + uint8_t size; + uint8_t enable_vkeys; +} __attribute__ ((packed)); + +struct touch_platform_data { + struct touch_settings *sett[256]; + struct touch_firmware *fw; + struct touch_framework *frmwrk; + + uint8_t addr[2]; + uint16_t flags; + + int (*hw_reset)(void); + int (*hw_power)(int); + int (*hw_recov)(int); + int (*irq_stat)(void); +} __attribute__ ((packed)); + +#endif /* _LINUX_TOUCH_PLATFORM_H */ diff --git a/include/linux/platform_data/lte_modem_bootloader.h b/include/linux/platform_data/lte_modem_bootloader.h index 27a0450..893a1aa 100644 --- a/include/linux/platform_data/lte_modem_bootloader.h +++ b/include/linux/platform_data/lte_modem_bootloader.h @@ -21,12 +21,8 @@ #define IOCTL_LTE_MODEM_XMIT_BOOT _IOW('o', 0x23, unsigned int) #define IOCTL_LTE_MODEM_LTE2AP_STATUS _IOR('o', 0x24, unsigned int) -#define AIRPLAIN_MODE_TEST - -#ifdef AIRPLAIN_MODE_TEST -#define IOCTL_LTE_MODEM_AIRPLAIN_ON _IOWR('o', 0x25, unsigned int) -#define IOCTL_LTE_MODEM_AIRPLAIN_OFF _IOWR('o', 0x26, unsigned int) -#endif +#define IOCTL_LTE_MODEM_FACTORY_MODE_ON _IOWR('o', 0x25, unsigned int) +#define IOCTL_LTE_MODEM_FACTORY_MODE_OFF _IOWR('o', 0x26, unsigned int) struct lte_modem_bootloader_param { char __user *buf; diff --git a/include/linux/platform_data/mms152_ts.h b/include/linux/platform_data/mms152_ts.h new file mode 100644 index 0000000..29ddd48 --- /dev/null +++ b/include/linux/platform_data/mms152_ts.h @@ -0,0 +1,46 @@ +/* + * mms_ts.h - Platform data for Melfas MMS-series touch driver + * + * Copyright (C) 2011 Google Inc. + * Author: Dima Zavin <dima@android.com> + * + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + */ + +#ifndef _LINUX_MMS_TOUCH_H +#define _LINUX_MMS_TOUCH_H +#define MELFAS_TS_NAME "melfas-ts" + +struct melfas_tsi_platform_data { + int max_x; + int max_y; + + bool invert_x; + bool invert_y; + + int gpio_int; + int gpio_sda; + int gpio_scl; + int (*mux_fw_flash) (bool to_gpios); + int (*power) (bool on); + int (*is_vdd_on) (void); + const char *fw_name; + bool use_touchkey; + const u8 *touchkey_keycode; + const u8 *config_fw_version; +#ifdef CONFIG_INPUT_FBSUSPEND + struct notifier_block fb_notif; +#endif + void (*input_event) (void *data); + int (*lcd_type) (void); + void (*register_cb) (void *); +}; +extern struct class *sec_class; +void tsp_charger_infom(bool en); + +#endif /* _LINUX_MMS_TOUCH_H */ diff --git a/include/linux/platform_data/mms_ts.h b/include/linux/platform_data/mms_ts.h index 8c51e58..a8448a6 100644 --- a/include/linux/platform_data/mms_ts.h +++ b/include/linux/platform_data/mms_ts.h @@ -27,7 +27,7 @@ struct melfas_tsi_platform_data { int gpio_sda; int gpio_scl; int (*mux_fw_flash) (bool to_gpios); - int (*power) (int on); + int (*power) (bool on); int (*is_vdd_on) (void); const char *fw_name; bool use_touchkey; diff --git a/include/linux/platform_data/mms_ts_gc.h b/include/linux/platform_data/mms_ts_gc.h index 318dadf..76a383e 100644 --- a/include/linux/platform_data/mms_ts_gc.h +++ b/include/linux/platform_data/mms_ts_gc.h @@ -28,7 +28,11 @@ struct melfas_tsi_platform_data { int gpio_scl; int (*mux_fw_flash)(bool to_gpios); int (*power)(int on); - const char *fw_name; + u8 *tsp_vendor; + u8 *tsp_ic; + int tsp_tx; + int tsp_rx; + int fw_version; const u8 *config_fw_version; void (*input_event)(void *data); void (*register_cb)(void *); diff --git a/include/linux/platform_data/modem.h b/include/linux/platform_data/modem.h index d66af9f..8eb949c 100644 --- a/include/linux/platform_data/modem.h +++ b/include/linux/platform_data/modem.h @@ -23,7 +23,10 @@ enum modem_t { VIA_CBP72, SEC_CMC221, QC_MDM6600, + QC_ESC6270, + SPRD_SC8803, DUMMY, + MAX_MODEM_TYPE }; enum dev_format { @@ -36,7 +39,8 @@ enum dev_format { IPC_RAMDUMP, MAX_DEV_FORMAT, }; -#define MAX_IPC_DEV (IPC_RFS + 1) +#define MAX_IPC_DEV (IPC_RFS + 1) /* FMT, RAW, RFS */ +#define MAX_SIPC5_DEV (IPC_RAW + 1) /* FMT, RAW */ enum modem_io { IODEV_MISC, @@ -52,6 +56,7 @@ enum modem_link { LINKDEV_USB, LINKDEV_HSIC, LINKDEV_C2C, + LINKDEV_PLD, LINKDEV_MAX, }; #define LINKTYPE(modem_link) (1u << (modem_link)) @@ -59,6 +64,7 @@ enum modem_link { enum modem_network { UMTS_NETWORK, CDMA_NETWORK, + TDSCDMA_NETWORK, LTE_NETWORK, }; @@ -108,15 +114,20 @@ struct modemlink_pm_data { unsigned gpio_link_hostwake; unsigned gpio_link_slavewake; int (*link_reconnect)(void); + + /* usb hub only */ int (*port_enable)(int, int); - int *p_hub_status; + int (*hub_standby)(void *); + void *hub_pm_data; bool has_usbhub; + /* cpu/bus frequency lock */ atomic_t freqlock; - int (*cpufreq_lock)(void); - int (*cpufreq_unlock)(void); + int (*freq_lock)(struct device *dev); + int (*freq_unlock)(struct device *dev); int autosuspend_delay_ms; /* if zero, the default value is used */ + void (*ehci_reg_dump)(struct device *); }; struct modemlink_pm_link_activectl { @@ -124,14 +135,25 @@ struct modemlink_pm_link_activectl { int gpio_request_host_active; }; +#define RES_CP_ACTIVE_IRQ_ID 0 +#define RES_DPRAM_MEM_ID 1 +#define RES_DPRAM_IRQ_ID 2 +#define RES_DPRAM_SFR_ID 3 + enum dpram_type { EXT_DPRAM, - CP_IDPRAM, AP_IDPRAM, - C2C_DPRAM, + CP_IDPRAM, + SHM_DPRAM, MAX_DPRAM_TYPE }; +#define DPRAM_SIZE_8KB 0x02000 +#define DPRAM_SIZE_16KB 0x04000 +#define DPRAM_SIZE_32KB 0x08000 +#define DPRAM_SIZE_64KB 0x10000 +#define DPRAM_SIZE_128KB 0x20000 + enum dpram_speed { DPRAM_SPEED_LOW, DPRAM_SPEED_MID, @@ -159,6 +181,19 @@ struct dpram_ipc_device { }; struct dpram_ipc_map { +#if defined(CONFIG_LINK_DEVICE_PLD) + u16 __iomem *mbx_ap2cp; + u16 __iomem *magic_ap2cp; + u16 __iomem *access_ap2cp; + + u16 __iomem *mbx_cp2ap; + u16 __iomem *magic_cp2ap; + u16 __iomem *access_cp2ap; + + struct dpram_ipc_device dev[MAX_IPC_DEV]; + + u16 __iomem *address_buffer; +#else u16 __iomem *magic; u16 __iomem *access; @@ -166,75 +201,38 @@ struct dpram_ipc_map { u16 __iomem *mbx_cp2ap; u16 __iomem *mbx_ap2cp; +#endif }; struct modemlink_dpram_control { void (*reset)(void); - void (*setup_speed)(enum dpram_speed); - int (*wakeup)(void); - void (*sleep)(void); - void (*clear_intr)(void); - u16 (*recv_intr)(void); + u16 (*recv_intr)(void); void (*send_intr)(u16); - u16 (*recv_msg)(void); + u16 (*recv_msg)(void); void (*send_msg)(u16); - u16 (*get_magic)(void); - void (*set_magic)(u16); - - u16 (*get_access)(void); - void (*set_access)(u16); - - u32 (*get_tx_head)(int); - u32 (*get_tx_tail)(int); - void (*set_tx_head)(int, u32); - void (*set_tx_tail)(int, u32); - u8 __iomem * (*get_tx_buff)(int); - u32 (*get_tx_buff_size)(int); - u16 (*get_mask_req_ack)(int); - u16 (*get_mask_res_ack)(int); - u16 (*get_mask_send)(int); - - u32 (*get_rx_head)(int); - u32 (*get_rx_tail)(int); - void (*set_rx_head)(int, u32); - void (*set_rx_tail)(int, u32); - u8 __iomem * (*get_rx_buff)(int); - u32 (*get_rx_buff_size)(int); - - void (*log_disp)(struct modemlink_dpram_control *dpctl); - int (*cpupload_step1)(struct modemlink_dpram_control *dpctl); - int (*cpupload_step2)(void *arg, struct modemlink_dpram_control *dpctl); - int (*cpimage_load_prepare)(struct modemlink_dpram_control *dpctl); - int (*cpimage_load)(void *arg, struct modemlink_dpram_control *dpctl); - int (*nvdata_load)(void *arg, struct modemlink_dpram_control *dpctl); - int (*phone_boot_start)(struct modemlink_dpram_control *dpctl); - int (*phone_boot_start_post_process)(void); - void (*phone_boot_start_handler)(struct modemlink_dpram_control *dpctl); - void (*dload_cmd_hdlr)( - struct modemlink_dpram_control *dpctl, u16 cmd); - void (*bt_map_init)(struct modemlink_dpram_control *dpctl); - void (*load_init)(struct modemlink_dpram_control *dpctl); -#if defined(CONFIG_MACH_M0_CTC) - void (*terminate_link)(struct modemlink_dpram_control *dpctl); -#endif - u8 __iomem *dp_base; - u32 dp_size; - enum dpram_type dp_type; /* DPRAM type */ - int aligned; /* If aligned access is required, ... */ + int (*wakeup)(void); + void (*sleep)(void); - int dpram_irq; - unsigned long dpram_irq_flags; - char *dpram_irq_name; - char *dpram_wlock_name; + void (*setup_speed)(enum dpram_speed); - int max_ipc_dev; + enum dpram_type dp_type; /* DPRAM type */ + int aligned; /* aligned access is required */ + u8 __iomem *dp_base; + u32 dp_size; + int dpram_irq; + unsigned long dpram_irq_flags; + + int max_ipc_dev; struct dpram_ipc_map *ipc_map; -}; -#define DPRAM_MAGIC_CODE 0xAA + unsigned boot_size_offset; + unsigned boot_tag_offset; + unsigned boot_count_offset; + unsigned max_boot_frame_size; +}; /* platform data */ struct modem_data { @@ -255,10 +253,22 @@ struct modem_data { #endif unsigned gpio_cp_warm_reset; unsigned gpio_sim_detect; -#ifdef CONFIG_LINK_DEVICE_DPRAM +#if defined(CONFIG_LINK_DEVICE_DPRAM) || defined(CONFIG_LINK_DEVICE_PLD) unsigned gpio_dpram_int; #endif +#ifdef CONFIG_LINK_DEVICE_PLD + unsigned gpio_fpga1_creset; + unsigned gpio_fpga1_cdone; + unsigned gpio_fpga1_rst_n; + unsigned gpio_fpga1_cs_n; + + unsigned gpio_fpga2_creset; + unsigned gpio_fpga2_cdone; + unsigned gpio_fpga2_rst_n; + unsigned gpio_fpga2_cs_n; +#endif + #ifdef CONFIG_LTE_MODEM_CMC221 unsigned gpio_dpram_status; unsigned gpio_dpram_wakeup; @@ -275,6 +285,21 @@ struct modem_data { struct regulator *cp_vbus; #endif +#ifdef CONFIG_TDSCDMA_MODEM_SPRD8803 + unsigned gpio_ipc_mrdy; + unsigned gpio_ipc_srdy; + unsigned gpio_ipc_sub_mrdy; + unsigned gpio_ipc_sub_srdy; + unsigned gpio_ap_cp_int1; + unsigned gpio_ap_cp_int2; +#endif + +#ifdef CONFIG_SEC_DUAL_MODEM_MODE + unsigned gpio_sim_io_sel; + unsigned gpio_cp_ctrl1; + unsigned gpio_cp_ctrl2; +#endif + /* Switch with 2 links in a modem */ unsigned gpio_dynamic_switching; @@ -283,7 +308,7 @@ struct modem_data { enum modem_t modem_type; enum modem_link link_types; char *link_name; -#ifdef CONFIG_LINK_DEVICE_DPRAM +#if defined(CONFIG_LINK_DEVICE_DPRAM) || defined(CONFIG_LINK_DEVICE_PLD) /* Link to DPRAM control functions dependent on each platform */ struct modemlink_dpram_control *dpram_ctl; #endif @@ -306,6 +331,8 @@ struct modem_data { /* Debugging option */ bool use_mif_log; + /* SIM Detect polarity */ + bool sim_polarity; }; #define LOG_TAG "mif: " diff --git a/include/linux/platform_data/modem_na.h b/include/linux/platform_data/modem_na.h new file mode 100644 index 0000000..1fafcdb --- /dev/null +++ b/include/linux/platform_data/modem_na.h @@ -0,0 +1,171 @@ +/* + * Copyright (C) 2010 Google, Inc. + * Copyright (C) 2010 Samsung Electronics. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef __MODEM_IF_H__ +#define __MODEM_IF_H__ + +enum modem_t { + IMC_XMM6260, + VIA_CBP71, + SEC_CMC221, + SEC_CMC220, +}; + +enum dev_format { + IPC_FMT, + IPC_RAW, + IPC_RFS, + IPC_CMD, + IPC_BOOT, + IPC_MULTI_RAW, + IPC_RAMDUMP, +}; + +enum modem_io { + IODEV_MISC, + IODEV_NET, + IODEV_DUMMY, +}; + +enum modem_link { + LINKDEV_MIPI, + LINKDEV_DPRAM, + LINKDEV_SPI, + LINKDEV_USB, + LINKDEV_MAX, +}; + +enum modem_network { + UMTS_NETWORK, + CDMA_NETWORK, + LTE_NETWORK, +}; + +/* This structure is used in board-tuna-modem.c */ +struct modem_io_t { + char *name; + int id; + enum dev_format format; + enum modem_io io_type; + enum modem_link link; +}; + +struct modemlink_pm_data { + char *name; + /* link power contol 2 types : pin & regulator control */ + int (*link_ldo_enable)(bool); + unsigned gpio_link_enable; + unsigned gpio_link_active; + unsigned gpio_link_hostwake; + unsigned gpio_link_slavewake; + int (*link_reconnect)(void); + int (*port_enable)(int, int); + int *p_hub_status; + bool has_usbhub; + + atomic_t freqlock; + int (*cpufreq_lock)(void); + int (*cpufreq_unlock)(void); + + int autosuspend_delay_ms; /* if zero, the default value is used */ +}; + +struct modemlink_pm_link_activectl { + int gpio_initialized; + int gpio_request_host_active; +}; + +/* dpram specific struct */ +struct modemlink_shared_channel { + char *name; + unsigned out_offset; + unsigned out_size; + unsigned in_offset; + unsigned in_size; +}; + +struct modemlink_memmap { + unsigned magic_offset; + unsigned magic_size; + unsigned access_offset; + unsigned access_size; + unsigned in_box_offset; + unsigned in_box_size; + unsigned out_box_offset; + unsigned out_box_size; + + unsigned num_shared_map; + struct modemlink_shared_channel *shared_map; + + /*for interanl dpram interrupt clear*/ + void (*vendor_clear_irq)(void); + int (*board_ota_reset)(void); +}; + +/* platform data */ +struct modem_data { + char *name; + + unsigned gpio_cp_on; + unsigned gpio_cp_off; + unsigned gpio_reset_req_n; + unsigned gpio_cp_reset; + unsigned gpio_pda_active; + unsigned gpio_phone_active; + unsigned gpio_cp_dump_int; + unsigned gpio_flm_uart_sel; + unsigned gpio_cp_warm_reset; + unsigned gpio_ap_wakeup; +#if defined(CONFIG_LTE_MODEM_CMC221) || defined(CONFIG_LTE_MODEM_CMC220) + unsigned gpio_slave_wakeup; + unsigned gpio_host_wakeup; + unsigned gpio_host_active; + int irq_host_wakeup; +#endif + /* modem component */ + enum modem_t modem_type; + enum modem_link link_type; + enum modem_network modem_net; + unsigned num_iodevs; + struct modem_io_t *iodevs; + void *modemlink_extension; + void (*clear_intr)(void); + int (*ota_reset)(void); +#ifdef CONFIG_INTERNAL_MODEM_IF + void (*sfr_init)(void); + unsigned gpio_mbx_intr; +#endif + + /* Modem link PM support */ + struct modemlink_pm_data *link_pm_data; + /* Align mit mask used to adjust IPC RAW and MULTI_RAW HDLC + Packets from interndal dpram */ + unsigned char align; +}; + +/* DEBUG */ +#define LOG_TAG "mif: " + +#define mif_err(fmt, ...) \ + pr_err(LOG_TAG "%s: " pr_fmt(fmt), __func__, ##__VA_ARGS__) +#define mif_debug(fmt, ...) \ + pr_debug(LOG_TAG "%s: " pr_fmt(fmt), __func__, ##__VA_ARGS__) +#define mif_info(fmt, ...) \ + pr_info(LOG_TAG "%s: " pr_fmt(fmt), __func__, ##__VA_ARGS__) +#define mif_trace(fmt, ...) \ + printk(KERN_DEBUG "mif: %s: %d: called(%pF): " fmt, \ + __func__, __LINE__, __builtin_return_address(0), ##__VA_ARGS__) + +#endif diff --git a/include/linux/platform_data/usb3503_otg_conn.h b/include/linux/platform_data/usb3503_otg_conn.h new file mode 100644 index 0000000..224a87e --- /dev/null +++ b/include/linux/platform_data/usb3503_otg_conn.h @@ -0,0 +1,22 @@ +#ifndef USB3503_H +#define USB3503_H + +#define USB3503_I2C_NAME "usb3503" +int usb3503_set_mode(int mode); + +enum { + USB_3503_MODE_HUB = 0, + USB_3503_MODE_STANDBY = 1, +}; + +struct usb3503_platform_data { + bool init_needed; + bool es_ver; + char inital_mode; + int (*hw_config)(void); + int (*reset_n)(int); + int (*port_enable)(int, int); +}; + +#endif + diff --git a/include/linux/power/max17042_fuelgauge_px.h b/include/linux/power/max17042_fuelgauge_px.h index c02aabb..11e8ce8 100644 --- a/include/linux/power/max17042_fuelgauge_px.h +++ b/include/linux/power/max17042_fuelgauge_px.h @@ -12,6 +12,10 @@ #ifndef _MAX17042_BATTERY_H #define _MAX17042_BATTERY_H +#if defined(CONFIG_TARGET_LOCALE_KOR) +#include <linux/power_supply.h> +#endif /* CONFIG_TARGET_LOCALE_KOR */ + /* Register address */ #define STATUS_REG 0x00 #define VALRT_THRESHOLD_REG 0x01 @@ -36,6 +40,10 @@ #define REMCAP_AV_REG 0x1F #define FULLCAP_NOM_REG 0x23 #define MISCCFG_REG 0x2B +#if defined(CONFIG_TARGET_LOCALE_KOR) +#define FILTERCFG_REG 0x29 +#define CGAIN_REG 0x2E +#endif /* CONFIG_TARGET_LOCALE_KOR */ #define RCOMP_REG 0x38 #define FSTAT_REG 0x3D #define DQACC_REG 0x45 @@ -62,10 +70,13 @@ struct max17042_platform_data { int sdi_capacity; int sdi_vfcapacity; + int sdi_low_bat_comp_start_vol; int atl_capacity; int atl_vfcapacity; - int sdi_low_bat_comp_start_vol; int atl_low_bat_comp_start_vol; + int byd_capacity; + int byd_vfcapacity; + int byd_low_bat_comp_start_vol; int fuel_alert_line; int (*check_jig_status) (void); @@ -96,11 +107,15 @@ struct fuelgauge_info { int low_batt_comp_cnt[LOW_BATT_COMP_RANGE_NUM][LOW_BATT_COMP_LEVEL_NUM]; int check_start_vol; int low_batt_comp_flag; + int psoc; }; struct max17042_chip { struct i2c_client *client; struct max17042_platform_data *pdata; +#if defined(CONFIG_TARGET_LOCALE_KOR) + struct power_supply battery; +#endif /* CONFIG_TARGET_LOCALE_KOR */ struct fuelgauge_info info; struct mutex fg_lock; }; @@ -200,6 +215,27 @@ struct max17042_chip { #define ATL_Range2_3_Slope 111 #define ATL_Range1_1_Slope 0 #define ATL_Range1_3_Slope 0 +/* BYD type low battery compensation offset */ +#define BYD_Range5_1_Offset 3318 +#define BYD_Range5_3_Offset 3383 +#define BYD_Range4_1_Offset 3451 +#define BYD_Range4_3_Offset 3618 +#define BYD_Range3_1_Offset 3453 +#define BYD_Range3_3_Offset 3615 +#define BYD_Range2_1_Offset 3447 +#define BYD_Range2_3_Offset 3606 +#define BYD_Range1_1_Offset 3438 +#define BYD_Range1_3_Offset 3591 +#define BYD_Range5_1_Slope 0 +#define BYD_Range5_3_Slope 0 +#define BYD_Range4_1_Slope 53 +#define BYD_Range4_3_Slope 94 +#define BYD_Range3_1_Slope 54 +#define BYD_Range3_3_Slope 92 +#define BYD_Range2_1_Slope 45 +#define BYD_Range2_3_Slope 78 +#define BYD_Range1_1_Slope 0 +#define BYD_Range1_3_Slope 0 #elif defined(CONFIG_MACH_P8) || defined(CONFIG_MACH_P8LTE) /* Current range for P8(not dependent on battery type */ #define CURRENT_RANGE1 0 @@ -307,6 +343,7 @@ enum { UNKNOWN_TYPE = 0, SDI_BATTERY_TYPE, ATL_BATTERY_TYPE, + BYD_BATTERY_TYPE, }; #ifdef CONFIG_MACH_P8LTE @@ -339,5 +376,5 @@ extern void fg_fullcharged_compensation(u32 is_recharging, u32 pre_update); extern void fg_check_vf_fullcap_range(void); extern int fg_check_cap_corruption(void); extern void fg_set_full_charged(void); - +extern void fg_reset_fullcap_in_fullcharge(void); #endif diff --git a/include/linux/power/max17042_fuelgauge_u1.h b/include/linux/power/max17042_fuelgauge_u1.h index 9ce423d..6686fef 100644 --- a/include/linux/power/max17042_fuelgauge_u1.h +++ b/include/linux/power/max17042_fuelgauge_u1.h @@ -14,7 +14,7 @@ #define __MAX17042_BATTERY_H_ /*#define NO_READ_I2C_FOR_MAXIM */ -#if !defined(CONFIG_MACH_Q1_BD) +#if !defined(CONFIG_MACH_Q1_BD) && !defined(CONFIG_MACH_TRATS) #define RECAL_SOC_FOR_MAXIM #endif /*#define LOG_REG_FOR_MAXIM */ diff --git a/include/linux/power/sec_battery_px.h b/include/linux/power/sec_battery_px.h index 6497f53..7b8dadc 100644 --- a/include/linux/power/sec_battery_px.h +++ b/include/linux/power/sec_battery_px.h @@ -62,6 +62,12 @@ enum capacity_type { CAPACITY_TYPE_REP, }; +enum dock_type { + DOCK_NONE = 0, + DOCK_DESK, + DOCK_KEYBOARD, +}; + extern int low_batt_compensation(int fg_soc, int fg_vcell, int fg_current); extern void reset_low_batt_comp_cnt(void); extern int get_fuelgauge_value(int data); diff --git a/include/linux/power/sec_battery_u1.h b/include/linux/power/sec_battery_u1.h index cbd635e..1d214c9 100644 --- a/include/linux/power/sec_battery_u1.h +++ b/include/linux/power/sec_battery_u1.h @@ -27,8 +27,8 @@ #define HWREV_FOR_BATTERY 0x06 #elif defined(CONFIG_MACH_Q1_BD) #define HWREV_FOR_BATTERY 0x02 -#elif defined(CONFIG_MACH_U1CAMERA_BD) -#define HWREV_FOR_BATTERY 0x00 +#elif defined(CONFIG_MACH_TRATS) +#define HWREV_FOR_BATTERY 0x02 #else /*U1 EUR OPEN */ #define HWREV_FOR_BATTERY 0x08 #endif diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 6347fd9..c5b958b 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -110,6 +110,9 @@ enum power_supply_property { POWER_SUPPLY_PROP_ENERGY_NOW, POWER_SUPPLY_PROP_ENERGY_AVG, POWER_SUPPLY_PROP_CAPACITY, /* in percents! */ +#ifdef CONFIG_SLP + POWER_SUPPLY_PROP_CAPACITY_RAW, +#endif POWER_SUPPLY_PROP_CAPACITY_LEVEL, POWER_SUPPLY_PROP_TEMP, POWER_SUPPLY_PROP_TEMP_AMBIENT, @@ -146,6 +149,40 @@ enum { POWER_SUPPLY_VBUS_GOOD, }; +/* + * EXTENDED_ONLINE_TYPE + * - support various charger cable type + * - set type from each accessory driver(muic, host, mhl, etc,,,) + * + * - type format + * | 31-24: RSVD | 23-16: MAIN TYPE | 15-8: SUB TYPE | 7-0: POWER TYPE | + */ +#define ONLINE_TYPE_RSVD_SHIFT 24 +#define ONLINE_TYPE_RSVD_MASK (0xF << ONLINE_TYPE_RSVD_SHIFT) +#define ONLINE_TYPE_MAIN_SHIFT 16 +#define ONLINE_TYPE_MAIN_MASK (0xF << ONLINE_TYPE_MAIN_SHIFT) +#define ONLINE_TYPE_SUB_SHIFT 8 +#define ONLINE_TYPE_SUB_MASK (0xF << ONLINE_TYPE_SUB_SHIFT) +#define ONLINE_TYPE_PWR_SHIFT 0 +#define ONLINE_TYPE_PWR_MASK (0xF << ONLINE_TYPE_PWR_SHIFT) + +enum online_sub_type { + ONLINE_SUB_TYPE_UNKNOWN = 0, + ONLINE_SUB_TYPE_MHL, + ONLINE_SUB_TYPE_AUDIO, + ONLINE_SUB_TYPE_DESK, + ONLINE_SUB_TYPE_SMART_NOTG, + ONLINE_SUB_TYPE_SMART_OTG, +}; + +enum online_power_type { + ONLINE_POWER_TYPE_UNKNOWN = 0, + ONLINE_POWER_TYPE_BATTERY, + ONLINE_POWER_TYPE_TA, + ONLINE_POWER_TYPE_USB, +}; +/* EXTENDED_ONLINE_TYPE */ + union power_supply_propval { int intval; const char *strval; diff --git a/include/linux/regulator/lp8720.h b/include/linux/regulator/lp8720.h new file mode 100644 index 0000000..e95a424 --- /dev/null +++ b/include/linux/regulator/lp8720.h @@ -0,0 +1,101 @@ +/* + * National Semiconductors LP8720 PMIC chip client interface + * + * Based on lp3971.h + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __LINUX_REGULATOR_LP8720_H +#define __LINUX_REGULATOR_LP8720_H + +#include <linux/regulator/machine.h> + +/* LP8720 regulator ids */ +enum { + LP8720_LDO1 = 0, + LP8720_LDO2, + LP8720_LDO3, + LP8720_LDO4, + LP8720_LDO5, + LP8720_BUCK_V1, + LP8720_BUCK_V2, + LP8720_REG_MAX, +}; + +#define LP8720_LDO1_EN BIT(0) +#define LP8720_LDO2_EN BIT(1) +#define LP8720_LDO3_EN BIT(2) +#define LP8720_LDO4_EN BIT(3) +#define LP8720_LDO5_EN BIT(4) +#define LP8720_BUCK_V1_EN BIT(5) +#define LP8720_BUCK_V2_EN BIT(5) + +#define LP8720_LDO1_REG (0x01) +#define LP8720_LDO2_REG (0x02) +#define LP8720_LDO3_REG (0x03) +#define LP8720_LDO4_REG (0x04) +#define LP8720_LDO5_REG (0x05) +#define LP8720_BUCK_V1_REG (0x06) +#define LP8720_BUCK_V2_REG (0x07) + +/* LP8720 PMIC Registers. */ +#define LP8720_GENERAL_SETTINGsS_REG (0x00) +#define LP8720_LDO1_SETTINGS_REG (0x01) +#define LP8720_LDO2_SETTINGS_REG (0x02) +#define LP8720_LDO3_SETTINGS_REG (0x03) +#define LP8720_LDO4_SETTINGS_REG (0x04) +#define LP8720_LDO5_SETTINGS_REG (0x05) +#define LP8720_BUCK_SETTINGS1_REG (0x06) +#define LP8720_BUCK_SETTINGS2_REG (0x07) +#define LP8720_ENABLE_REG (0x08) +#define LP8720_PULLDOWN_REG (0x09) +#define LP8720_STATUS_REG (0x0A) +#define LP8720_INTERRUPT_REG (0x0B) +#define LP8720_INTERRUPTM_REG (0x0C) + +#define LP8720_LDOV_SHIFT (0) +#define LP8720_LDOT_SHIFT (5) +#define LP8720_BUCK_SHIFT (0) +#define LP8720_LDOV_MASK (0x1F << LP8720_LDOV_SHIFT) +#define LP8720_LDOT_MASK (0x7 << LP8720_LDOT_SHIFT) +#define LP8720_BUCK_MASK (0x1F << LP8720_BUCK_SHIFT) + +#define LP8720_LDO_VOL_CONTR_BASE 0x01 +#define LP8720_LDO_VOL_CONTR_REG(x) (LP8720_LDO_VOL_CONTR_BASE + (x)) + +#define LP8720_BUCK_VOL_CONTR_BASE 0x06 +#define LP8720_BUCK_VOL_CONTR_REG(x) (LP8720_BUCK_VOL_CONTR_BASE + (x)) + +struct lp8720 { + struct device *dev; + struct mutex io_lock; + struct i2c_client *i2c; + int num_regulators; + struct regulator_dev **rdev; +}; + +struct lp8720_regulator_subdev { + int id; + struct regulator_init_data *initdata; +}; + +struct lp8720_platform_data { + char *name; + unsigned int en_pin; + int num_regulators; + struct lp8720_regulator_subdev *regulators; +}; +#endif /* __LINUX_REGULATOR_LP8720_H */ diff --git a/include/linux/rtc.h b/include/linux/rtc.h index ceeb53c..8394141 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h @@ -150,6 +150,8 @@ struct rtc_class_ops { int (*set_alarm)(struct device *, struct rtc_wkalrm *); #if defined(CONFIG_RTC_ALARM_BOOT) int (*set_alarm_boot)(struct device *, struct rtc_wkalrm *); +#elif defined(CONFIG_RTC_POWER_OFF) + int (*set_alarm_poweroff)(struct device *, struct rtc_wkalrm *); #endif int (*proc)(struct device *, struct seq_file *); int (*set_mmss)(struct device *, unsigned long secs); @@ -236,10 +238,13 @@ extern int rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alrm); #if defined(CONFIG_RTC_ALARM_BOOT) extern int rtc_set_alarm_boot(struct rtc_device *rtc, - struct rtc_wkalrm *alarm); + struct rtc_wkalrm *alarm); +#elif defined(CONFIG_RTC_POWER_OFF) +extern int rtc_set_alarm_poweroff(struct rtc_device *rtc, + struct rtc_wkalrm *alarm); #endif extern int rtc_initialize_alarm(struct rtc_device *rtc, - struct rtc_wkalrm *alrm); + struct rtc_wkalrm *alrm); extern void rtc_update_irq(struct rtc_device *rtc, unsigned long num, unsigned long events); diff --git a/include/linux/sensor/ak8963.h b/include/linux/sensor/ak8963.h new file mode 100644 index 0000000..6d525d4 --- /dev/null +++ b/include/linux/sensor/ak8963.h @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2010 Samsung Electronics. 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ +#ifndef AKM8963_H +#define AKM8963_H + +#include <linux/ioctl.h> + +#define AKM8963_I2C_NAME "ak8963" + +/* Rx buffer size, i.e from ST1 to ST2 */ +#define SENSOR_DATA_SIZE 8 +#define AKMIO 0xA1 + +/* IOCTLs for AKM library */ +/* WRITE and READ sizes don't include data. On WRITE, the first value is data + * size plus one and the second value is the register address. On READ + * the first value is the data size and second value is the register + * address and the data is written back into the buffer starting at + * the second byte (the length is unchanged). + */ +#define ECS_IOCTL_READ _IOWR(AKMIO, 0x01, char*) +#define ECS_IOCTL_WRITE _IOW(AKMIO, 0x02, char*) +#define ECS_IOCTL_SET_MODE _IOW(AKMIO, 0x03, short) +#define ECS_IOCTL_GETDATA _IOR(AKMIO, 0x04, char[SENSOR_DATA_SIZE]) +#define ECS_IOCTL_SET_YPR _IOW(AKMIO, 0x05, int[YPR_DATA_SIZE]) +#define ECS_IOCTL_GET_OPEN_STATUS _IOR(AKMIO, 0x06, int) +#define ECS_IOCTL_GET_CLOSE_STATUS _IOR(AKMIO, 0x07, int) +#define ECS_IOCTL_GET_DELAY _IOR(AKMIO, 0x08, long long int[AKM_NUM_SENSORS]) +#define ECS_IOCTL_GET_LAYOUT _IOR(AKMIO, 0x09, char) +#define ECS_IOCTL_GET_OUTBIT _IOR(AKMIO, 0x0B, char) +#define ECS_IOCTL_RESET _IO(AKMIO, 0x0C) +#define ECS_IOCTL_GET_ACCEL _IOR(AKMIO, 0x30, short[3]) + + /* IOCTLs for APPs */ +#define ECS_IOCTL_APP_SET_MODE _IOW(AKMIO, 0x10, short) +#define ECS_IOCTL_APP_SET_MFLAG _IOW(AKMIO, 0x11, short) +#define ECS_IOCTL_APP_GET_MFLAG _IOR(AKMIO, 0x12, short) +#define ECS_IOCTL_APP_SET_AFLAG _IOW(AKMIO, 0x13, short) +#define ECS_IOCTL_APP_GET_AFLAG _IOR(AKMIO, 0x14, short) +#define ECS_IOCTL_APP_SET_TFLAG _IOW(AKMIO, 0x15, short) +#define ECS_IOCTL_APP_GET_TFLAG _IOR(AKMIO, 0x16, short) +#define ECS_IOCTL_APP_RESET_PEDOMETER _IO(AKMIO, 0x17) +#define ECS_IOCTL_APP_SET_DELAY _IOW(AKMIO, 0x18, int64_t) +#define ECS_IOCTL_APP_GET_DELAY ECS_IOCTL_GET_DELAY + + + +/* Set raw magnetic vector flag */ +#define ECS_IOCTL_APP_SET_MVFLAG _IOW(AKMIO, 0x19, short) + +/* Get raw magnetic vector flag */ +#define ECS_IOCTL_APP_GET_MVFLAG _IOR(AKMIO, 0x1A, short) + +#ifdef __KERNEL__ +struct akm8963_platform_data { + int gpio_data_ready_int; + char layout; + char outbit; + int gpio_RST; +}; +#endif + +#endif diff --git a/include/linux/sensor/gp2a.h b/include/linux/sensor/gp2a.h index 7900203..4b2b62c 100644 --- a/include/linux/sensor/gp2a.h +++ b/include/linux/sensor/gp2a.h @@ -64,5 +64,6 @@ int is_gp2a030a(void); struct gp2a_platform_data { int (*gp2a_led_on) (bool); int p_out; /* proximity-sensor-output gpio */ + unsigned long (*gp2a_get_threshold)(void); }; #endif diff --git a/include/linux/sensor/sensors_core.h b/include/linux/sensor/sensors_core.h index ef90dd9..969e460 100644 --- a/include/linux/sensor/sensors_core.h +++ b/include/linux/sensor/sensors_core.h @@ -22,4 +22,13 @@ struct accel_platform_data { * or if it is false, driver reports original axis-raw-data */ bool axis_adjust; }; + +struct gyro_platform_data { + int (*gyro_get_position) (void); + /* Change axis or not for user-level + * If it is true, driver reports adjusted axis-raw-data + * to user-space based on gyro_get_position() value, + * or if it is false, driver reports original axis-raw-data */ + bool axis_adjust; +}; #endif /* __LINUX_SENSORS_CORE_H_INCLUDED */ diff --git a/include/linux/sii9234.h b/include/linux/sii9234.h index f15bfa3..cb61906 100755..100644 --- a/include/linux/sii9234.h +++ b/include/linux/sii9234.h @@ -26,6 +26,7 @@ struct sii9234_platform_data { u8 power_state; u8 swing_level; + u8 factory_test; int ddc_i2c_num; void (*init)(void); void (*mhl_sel)(bool enable); @@ -37,6 +38,10 @@ struct sii9234_platform_data { #else void (*vbus_present)(bool on); #endif +#ifdef CONFIG_SAMSUNG_MHL_UNPOWERED + int (*get_vbus_status)(void); + void (*sii9234_otg_control)(bool onoff); +#endif struct i2c_client *mhl_tx_client; struct i2c_client *tpi_client; struct i2c_client *hdmi_rx_client; @@ -50,8 +55,15 @@ struct sii9234_platform_data { extern u8 mhl_onoff_ex(bool onoff); #endif +#if defined(__MHL_NEW_CBUS_MSC_CMD__) +#if defined(CONFIG_MFD_MAX77693) +extern void max77693_muic_usb_cb(u8 usb_mode); +#endif +#endif + #ifdef CONFIG_SAMSUNG_WORKAROUND_HPD_GLANCE extern void mhl_hpd_handler(bool onoff); +extern bool (*is_mhl_power_state_on)(void); #endif #ifdef CONFIG_SAMSUNG_USE_11PIN_CONNECTOR @@ -66,4 +78,9 @@ extern int max77693_muic_get_status1_adc_value(void); extern void sii9234_wake_lock(void); extern void sii9234_wake_unlock(void); #endif + +#ifdef CONFIG_JACK_MON +extern void jack_event_handler(const char *name, int value); +#endif + #endif /* _SII9234_H_ */ diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index f13b52b..bdef082 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -511,8 +511,8 @@ extern struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t priority); extern struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t priority); -extern struct sk_buff *pskb_copy(struct sk_buff *skb, - gfp_t gfp_mask); +extern struct sk_buff *__pskb_copy(struct sk_buff *skb, + int headroom, gfp_t gfp_mask); extern int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, gfp_t gfp_mask); @@ -1614,6 +1614,12 @@ static inline void netdev_free_page(struct net_device *dev, struct page *page) __free_page(page); } +static inline struct sk_buff *pskb_copy(struct sk_buff *skb, + gfp_t gfp_mask) +{ + return __pskb_copy(skb, skb_headroom(skb), gfp_mask); +} + /** * skb_clone_writable - is the header of a clone writable * @skb: buffer to check diff --git a/include/linux/ssp_platformdata.h b/include/linux/ssp_platformdata.h new file mode 100644 index 0000000..80d8501 --- /dev/null +++ b/include/linux/ssp_platformdata.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2011 Samsung Electronics. 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef _SSP_PLATFORMDATA_H_ +#define _SSP_PLATFORMDATA_H_ + +struct ssp_platform_data { + int (*wakeup_mcu)(void); + int (*check_mcu_ready)(void); + int (*check_mcu_busy)(void); + int (*set_mcu_reset)(int); + int (*check_ap_rev)(void); +}; +#endif diff --git a/include/linux/synaptics_s7301.h b/include/linux/synaptics_s7301.h index 7af78ae..09284a0 100644 --- a/include/linux/synaptics_s7301.h +++ b/include/linux/synaptics_s7301.h @@ -37,9 +37,10 @@ #if defined(CONFIG_SEC_TOUCHSCREEN_DVFS_LOCK) #include <mach/cpufreq.h> #include <mach/dev.h> -#define SEC_DVFS_LOCK_TIMEOUT 100 +#define SEC_DVFS_LOCK_TIMEOUT 200 #define SEC_DVFS_LOCK_FREQ 800000 #define SEC_BUS_LOCK_FREQ 267160 +#define SEC_BUS_LOCK_FREQ2 400200 #endif #define MAX_TOUCH_NUM 10 @@ -163,6 +164,7 @@ struct synaptics_drv_data { bool dvfs_lock_status; #endif bool ready; + bool input_open; bool charger_connection; bool drawing_mode; bool suspend; @@ -175,19 +177,20 @@ struct synaptics_drv_data { u8 firm_version[4]; u8 firm_config[13]; u8 *cmd_temp; + u8 *references; u8 *tx_to_tx; u8 *tx_to_gnd; u16 x_line; u16 y_line; u16 refer_max; u16 refer_min; - u16 *references; u16 rx_to_rx[42][42]; unsigned long func_bit[BITS_TO_LONGS(MAX_FUNC+1)]; }; extern struct class *sec_class; extern int set_tsp_sysfs(struct synaptics_drv_data *data); +extern void remove_tsp_sysfs(struct synaptics_drv_data *data); extern int synaptics_fw_updater(struct synaptics_drv_data *data, u8 *fw_data); extern void forced_fw_upload(struct synaptics_drv_data *data); diff --git a/include/linux/tty.h b/include/linux/tty.h index 1ff6b62..5c31cd6 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -218,7 +218,7 @@ struct tty_port_operations { /* Called on the final put of a port */ void (*destruct)(struct tty_port *port); }; - + struct tty_port { struct tty_struct *tty; /* Back pointer */ const struct tty_port_operations *ops; /* Port operations */ @@ -294,7 +294,11 @@ struct tty_struct { void *driver_data; struct list_head tty_files; +#ifdef CONFIG_MDM_HSIC_PM +#define N_TTY_BUF_SIZE 16384 +#else #define N_TTY_BUF_SIZE 4096 +#endif /* * The following is data for the N_TTY line discipline. For diff --git a/include/linux/usb/android_composite.h b/include/linux/usb/android_composite.h index 886bd78..ccbb19b 100644 --- a/include/linux/usb/android_composite.h +++ b/include/linux/usb/android_composite.h @@ -72,6 +72,8 @@ struct android_usb_platform_data { * (anywhere from 1 to FSG_MAX_LUNS which is 8). */ unsigned int nluns; + /* cdfs supprot : verizon require */ + unsigned int cdfs_support; }; /* Platform data for "usb_mass_storage" driver. */ @@ -97,4 +99,12 @@ struct acm_platform_data { u8 num_inst; }; +#ifdef CONFIG_USB_ANDROID_SAMSUNG_COMPOSITE +int register_usb_composite_notifier(struct notifier_block *notifier); +int unregister_usb_composite_notifier(struct notifier_block *notifier); +#else +#define register_usb_composite_notifier NULL +#define unregister_usb_composite_notifier NULL +#endif + #endif /* __LINUX_USB_ANDROID_H */ diff --git a/include/linux/usb/f_accessory.h b/include/linux/usb/f_accessory.h index 5b2dcf9..61ebe0a 100644 --- a/include/linux/usb/f_accessory.h +++ b/include/linux/usb/f_accessory.h @@ -36,13 +36,15 @@ #define ACCESSORY_STRING_URI 4 #define ACCESSORY_STRING_SERIAL 5 -/* Control request for retrieving device's protocol version (currently 1) +/* Control request for retrieving device's protocol version * * requestType: USB_DIR_IN | USB_TYPE_VENDOR * request: ACCESSORY_GET_PROTOCOL * value: 0 * index: 0 * data version number (16 bits little endian) + * 1 for original accessory support + * 2 adds HID and device to host audio support */ #define ACCESSORY_GET_PROTOCOL 51 @@ -70,6 +72,65 @@ */ #define ACCESSORY_START 53 +/* Control request for registering a HID device. + * Upon registering, a unique ID is sent by the accessory in the + * value parameter. This ID will be used for future commands for + * the device + * + * requestType: USB_DIR_OUT | USB_TYPE_VENDOR + * request: ACCESSORY_REGISTER_HID_DEVICE + * value: Accessory assigned ID for the HID device + * index: total length of the HID report descriptor + * data none + */ +#define ACCESSORY_REGISTER_HID 54 + +/* Control request for unregistering a HID device. + * + * requestType: USB_DIR_OUT | USB_TYPE_VENDOR + * request: ACCESSORY_REGISTER_HID + * value: Accessory assigned ID for the HID device + * index: 0 + * data none + */ +#define ACCESSORY_UNREGISTER_HID 55 + +/* Control request for sending the HID report descriptor. + * If the HID descriptor is longer than the endpoint zero max packet size, + * the descriptor will be sent in multiple ACCESSORY_SET_HID_REPORT_DESC + * commands. The data for the descriptor must be sent sequentially + * if multiple packets are needed. + * + * requestType: USB_DIR_OUT | USB_TYPE_VENDOR + * request: ACCESSORY_SET_HID_REPORT_DESC + * value: Accessory assigned ID for the HID device + * index: offset of data in descriptor + * (needed when HID descriptor is too big for one packet) + * data the HID report descriptor + */ +#define ACCESSORY_SET_HID_REPORT_DESC 56 + +/* Control request for sending HID events. + * + * requestType: USB_DIR_OUT | USB_TYPE_VENDOR + * request: ACCESSORY_SEND_HID_EVENT + * value: Accessory assigned ID for the HID device + * index: 0 + * data the HID report for the event + */ +#define ACCESSORY_SEND_HID_EVENT 57 + +/* Control request for setting the audio mode. + * + * requestType: USB_DIR_OUT | USB_TYPE_VENDOR + * request: ACCESSORY_SET_AUDIO_MODE + * value: 0 - no audio + * 1 - device to host, 44100 16-bit stereo PCM + * index: 0 + * data none + */ +#define ACCESSORY_SET_AUDIO_MODE 58 + /* ioctls for retrieving strings set by the host */ #define ACCESSORY_GET_STRING_MANUFACTURER _IOW('M', 1, char[256]) #define ACCESSORY_GET_STRING_MODEL _IOW('M', 2, char[256]) @@ -79,5 +140,7 @@ #define ACCESSORY_GET_STRING_SERIAL _IOW('M', 6, char[256]) /* returns 1 if there is a start request pending */ #define ACCESSORY_IS_START_REQUESTED _IO('M', 7) +/* returns audio mode (set via the ACCESSORY_SET_AUDIO_MODE control request) */ +#define ACCESSORY_GET_AUDIO_MODE _IO('M', 8) #endif /* __LINUX_USB_F_ACCESSORY_H */ diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 605b0aa..76f4396 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h @@ -191,7 +191,8 @@ extern void usbnet_cdc_status(struct usbnet *, struct urb *); enum skb_state { illegal = 0, tx_start, tx_done, - rx_start, rx_done, rx_cleanup + rx_start, rx_done, rx_cleanup, + unlink_start }; struct skb_data { /* skb->cb is one of these */ diff --git a/include/linux/usb3803.h b/include/linux/usb3803.h new file mode 100644 index 0000000..6cf247d --- /dev/null +++ b/include/linux/usb3803.h @@ -0,0 +1,23 @@ +#ifndef USB3803_H +#define USB3803_H + +#define USB3803_I2C_NAME "usb3803" +int usb3803_set_mode(int mode); + +enum { + USB_3803_MODE_HUB = 0, + USB_3803_MODE_BYPASS = 1, + USB_3803_MODE_STANDBY = 2, +}; + +struct usb3803_platform_data { + bool init_needed; + bool es_ver; + char inital_mode; + int (*hw_config)(void); + int (*reset_n)(int); + int (*bypass_n)(int); + int (*clock_en)(int); +}; + +#endif diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 687fb11..9e4b356 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -33,6 +33,10 @@ struct vm_struct { unsigned int nr_pages; phys_addr_t phys_addr; void *caller; +#ifdef CONFIG_DEBUG_VMALLOC + unsigned int pid; + unsigned char *task_name; +#endif }; /* diff --git a/include/linux/wacom_i2c.h b/include/linux/wacom_i2c.h index 209fe53..2d9ad6e 100644 --- a/include/linux/wacom_i2c.h +++ b/include/linux/wacom_i2c.h @@ -22,12 +22,22 @@ #define NAMEBUF 12 #define WACNAME "WAC_I2C_EMR" #define WACFLASH "WAC_I2C_FLASH" + +#ifdef CONFIG_EPEN_WACOM_G9PM +#define WACOM_FW_SIZE 61440 +#else #define WACOM_FW_SIZE 32768 +#endif /*Wacom Command*/ -#define COM_COORD_NUM 7 -#define COM_QUERY_NUM 9 +#if defined(CONFIG_MACH_T0) +#define COM_COORD_NUM 8 +#else +#define COM_COORD_NUM 7 +#endif +#define COM_QUERY_NUM 9 +#define COM_SAMPLERATE_STOP 0x30 #define COM_SAMPLERATE_40 0x33 #define COM_SAMPLERATE_80 0x32 #define COM_SAMPLERATE_133 0x31 @@ -57,60 +67,217 @@ #define WACOM_DELAY_FOR_RST_RISING 200 /* #define INIT_FIRMWARE_FLASH */ +#define WACOM_PDCT_WORK_AROUND + /*PDCT Signal*/ #define PDCT_NOSIGNAL 1 #define PDCT_DETECT_PEN 0 -#define WACOM_PDCT_WORK_AROUND + +#define WACOM_PRESSURE_MAX 255 + +/*Digitizer Type*/ +#define EPEN_DTYPE_B660 1 +#define EPEN_DTYPE_B713 2 +#define EPEN_DTYPE_B746 3 #if defined(CONFIG_MACH_P4NOTE) || defined(CONFIG_MACH_P4) +#define WACOM_DVFS_LOCK_FREQ 800000 #ifdef CONFIG_SEC_TOUCHSCREEN_DVFS_LOCK #define SEC_BUS_LOCK #endif +#if defined(CONFIG_QC_MODEM) +#define WACOM_HAVE_FWE_PIN +#endif +#define BATTERY_SAVING_MODE +#define WACOM_CONNECTION_CHECK #define WACOM_HAVE_RESET_CONTROL 0 #define WACOM_POSX_MAX 21866 #define WACOM_POSY_MAX 13730 #define WACOM_POSX_OFFSET 170 #define WACOM_POSY_OFFSET 170 +#define WACOM_MAX_PRESSURE 0x3FF #define WACOM_IRQ_WORK_AROUND +#define WACOM_PEN_DETECT +#define WACOM_MAX_COORD_X WACOM_POSX_MAX +#define WACOM_MAX_COORD_Y WACOM_POSY_MAX + #elif defined(CONFIG_MACH_Q1_BD) -#define BOARD_Q1C210 + #define COOR_WORK_AROUND #define WACOM_IMPORT_FW_ALGO +#define WACOM_USE_OFFSET_TABLE +#define WACOM_USE_AVERAGING +#define WACOM_USE_TILT_OFFSET + #define WACOM_SLEEP_WITH_PEN_SLP #define WACOM_HAVE_RESET_CONTROL 1 #define CONFIG_SEC_TOUCHSCREEN_DVFS_LOCK +#define WACOM_DVFS_LOCK_FREQ 500000 -#if defined(BOARD_P4ADOBE) && defined(COOR_WORK_AROUND) - #define COOR_WORK_AROUND_X_MAX 0x54C0 - #define COOR_WORK_AROUND_Y_MAX 0x34F8 - #define COOR_WORK_AROUND_PRESSURE_MAX 0xFF -#elif (defined(BOARD_Q1OMAP4430) || defined(BOARD_Q1C210))\ - && defined(COOR_WORK_AROUND) - #define COOR_WORK_AROUND_X_MAX 0x2C80 - #define COOR_WORK_AROUND_Y_MAX 0x1BD0 - #define COOR_WORK_AROUND_PRESSURE_MAX 0xFF -#endif +#define COOR_WORK_AROUND_X_MAX 0x2C80 +#define COOR_WORK_AROUND_Y_MAX 0x1BD0 +#define COOR_WORK_AROUND_PRESSURE_MAX 0xFF #define WACOM_I2C_TRANSFER_STYLE #if !defined(WACOM_I2C_TRANSFER_STYLE) #define WACOM_I2C_RECV_SEND_STYLE #endif -#ifdef CONFIG_MACH_Q1_BD +#define WACOM_MAX_COORD_X 11392 +#define WACOM_MAX_COORD_Y 7120 +#define WACOM_MAX_PRESSURE 0xFF + /* For Android origin */ -#define WACOM_POSX_MAX 7120 -#define WACOM_POSY_MAX 11392 -#define WACOM_PRESSURE_MAX 255 +#define WACOM_POSX_MAX WACOM_MAX_COORD_Y +#define WACOM_POSY_MAX WACOM_MAX_COORD_X #define MAX_ROTATION 4 #define MAX_HAND 2 -#endif /* CONFIG_MACH_Q1_BD */ -#endif /* !defined(WACOM_P4) */ + +#elif defined(CONFIG_MACH_T0) + +#define WACOM_MAX_COORD_X 12288 +#define WACOM_MAX_COORD_Y 6912 +#define WACOM_MAX_PRESSURE 0xFF + +/* For Android origin */ +#define WACOM_POSX_MAX WACOM_MAX_COORD_Y +#define WACOM_POSY_MAX WACOM_MAX_COORD_X + +#define COOR_WORK_AROUND +#define WACOM_IMPORT_FW_ALGO +#define WACOM_USE_OFFSET_TABLE +#define WACOM_USE_AVERAGING +#define WACOM_USE_BOXFILTER +#define WACOM_USE_TILT_OFFSET + +#define MAX_ROTATION 4 +#define MAX_HAND 2 + +#define WACOM_PEN_DETECT + +/* origin offset */ +#define EPEN_B660_ORG_X 456 +#define EPEN_B660_ORG_Y 504 + +#define EPEN_B713_ORG_X 676 +#define EPEN_B713_ORG_Y 724 + +/*Box Filter Parameters*/ +#define X_INC_S1 1500 +#define X_INC_E1 (WACOM_MAX_COORD_X - 1500) +#define Y_INC_S1 1500 +#define Y_INC_E1 (WACOM_MAX_COORD_Y - 1500) + +#define Y_INC_S2 700 +#define Y_INC_E2 (WACOM_MAX_COORD_Y - 700) +#define Y_INC_S3 900 +#define Y_INC_E3 (WACOM_MAX_COORD_Y - 900) + +#define CONFIG_SEC_TOUCHSCREEN_DVFS_LOCK +#define WACOM_DVFS_LOCK_FREQ 800000 +#define BATTERY_SAVING_MODE + +/*HWID to distinguish Detect Switch*/ +#if defined(CONFIG_MACH_T0_EUR_LTE) \ + || defined(CONFIG_MACH_T0_EUR_OPEN) \ + || defined(CONFIG_MACH_T0_USA_ATT) \ + || defined(CONFIG_MACH_T0_USA_VZW) \ + || defined(CONFIG_MACH_T0_USA_SPR) \ + || defined(CONFIG_MACH_T0_USA_TMO) \ + || defined(CONFIG_MACH_T0GQ_JPN_LTE_DCM) \ + || defined(CONFIG_MACH_T0_JPN_LTE_DCM) \ + || defined(CONFIG_MACH_T0_CHN_OPEN) \ + || defined(CONFIG_MACH_T0_CHN_CU) \ + || defined(CONFIG_MACH_T0_CHN_CU_DUOS) \ + || defined(CONFIG_MACH_T0_CHN_CMCC) \ + || defined(CONFIG_MACH_T0_CHN_CTC) \ + || defined(CONFIG_MACH_T0_CHN_OPEN_DUOS) +#define WACOM_DETECT_SWITCH_HWID 7 + +#elif defined(CONFIG_MACH_T0_KOR_SKT) \ + || defined(CONFIG_MACH_T0_KOR_LGT) \ + || defined(CONFIG_MACH_T0_KOR_KT) +#define WACOM_DETECT_SWITCH_HWID 6 + +#elif defined(CONFIG_MACH_T0_USA_USCC) + #define WACOM_DETECT_SWITCH_HWID 8 + +#else + +#define WACOM_DETECT_SWITCH_HWID 0xFFFF +#endif + +/*HWID to distinguish FWE1*/ +#if defined(CONFIG_MACH_T0_EUR_LTE) \ + || defined(CONFIG_MACH_T0_EUR_OPEN) \ + || defined(CONFIG_MACH_T0_USA_ATT) \ + || defined(CONFIG_MACH_T0_USA_VZW) \ + || defined(CONFIG_MACH_T0_USA_SPR) \ + || defined(CONFIG_MACH_T0_USA_TMO) \ + || defined(CONFIG_MACH_T0_USA_USCC) \ + || defined(CONFIG_MACH_T0_KOR_SKT) \ + || defined(CONFIG_MACH_T0_KOR_KT) \ + || defined(CONFIG_MACH_T0_KOR_LGT) \ + || defined(CONFIG_MACH_T0GQ_JPN_LTE_DCM) \ + || defined(CONFIG_MACH_T0_JPN_LTE_DCM) \ + || defined(CONFIG_MACH_T0_CHN_OPEN) \ + || defined(CONFIG_MACH_T0_CHN_CU) \ + || defined(CONFIG_MACH_T0_CHN_CU_DUOS) \ + || defined(CONFIG_MACH_T0_CHN_CMCC) \ + || defined(CONFIG_MACH_T0_CHN_CTC) \ + || defined(CONFIG_MACH_T0_CHN_OPEN_DUOS) +#define WACOM_FWE1_HWID 8 + +#else +#define WACOM_FWE1_HWID 0xFFFF + +#endif + +/*HWID to distinguish B713 Digitizer*/ +#define WACOM_DTYPE_B713_HWID 4 +/*HWID to distinguish B746 Digitizer*/ +#if defined(CONFIG_MACH_T0_CHN_CMCC) +#define WACOM_DTYPE_B746_HWID 8 + +#elif defined(CONFIG_MACH_T0_EUR_LTE) \ + || defined(CONFIG_MACH_T0_EUR_OPEN) \ + || defined(CONFIG_MACH_T0_USA_ATT) \ + || defined(CONFIG_MACH_T0_USA_VZW) \ + || defined(CONFIG_MACH_T0_USA_SPR) \ + || defined(CONFIG_MACH_T0_KOR_SKT) \ + || defined(CONFIG_MACH_T0_KOR_LGT) \ + || defined(CONFIG_MACH_T0_KOR_KT) \ + || defined(CONFIG_MACH_T0_CHN_OPEN) \ + || defined(CONFIG_MACH_T0_CHN_CU) \ + || defined(CONFIG_MACH_T0_CHN_CU_DUOS) \ + || defined(CONFIG_MACH_T0_CHN_CTC) \ + || defined(CONFIG_MACH_T0_CHN_OPEN_DUOS) +#define WACOM_DTYPE_B746_HWID 9 + +#elif defined(CONFIG_MACH_T0_USA_TMO) \ + || defined(CONFIG_MACH_T0_USA_USCC) \ + || defined(CONFIG_MACH_T0_JPN_LTE_DCM) +#define WACOM_DTYPE_B746_HWID 10 + +#else +#define WACOM_DTYPE_B746_HWID 0xFFFF + +#endif + + +#endif /*End of Model config*/ #if !defined(WACOM_SLEEP_WITH_PEN_SLP) #define WACOM_SLEEP_WITH_PEN_LDO_EN #endif +#ifdef BATTERY_SAVING_MODE +#ifndef WACOM_PEN_DETECT +#define WACOM_PEN_DETECT +#endif +#endif + /*Parameters for wacom own features*/ struct wacom_features { int x_max; @@ -161,6 +328,12 @@ struct wacom_g5_platform_data { int max_pressure; int min_pressure; int gpio_pendct; +#ifdef WACOM_PEN_DETECT + int gpio_pen_insert; +#endif +#ifdef WACOM_HAVE_FWE_PIN + int gpio_fwe; +#endif int (*init_platform_hw)(void); int (*exit_platform_hw)(void); int (*suspend_platform_hw)(void); @@ -174,6 +347,7 @@ struct wacom_g5_platform_data { /*Parameters for i2c driver*/ struct wacom_i2c { struct i2c_client *client; + struct i2c_client *client_boot; struct input_dev *input_dev; struct early_suspend early_suspend; struct mutex lock; @@ -182,6 +356,7 @@ struct wacom_i2c { int irq; #ifdef WACOM_PDCT_WORK_AROUND int irq_pdct; + bool rdy_pdct; #endif int pen_pdct; int gpio; @@ -190,12 +365,29 @@ struct wacom_i2c { int pen_pressed; int side_pressed; int tool; + u16 last_x; + u16 last_y; +#ifdef WACOM_PEN_DETECT + struct delayed_work pen_insert_dwork; + bool pen_insert; + int gpio_pen_insert; +#ifdef CONFIG_MACH_T0 + int invert_pen_insert; +#endif +#endif +#ifdef WACOM_HAVE_FWE_PIN + int gpio_fwe; +#endif +#ifdef WACOM_IMPORT_FW_ALGO + bool use_offset_table; + bool use_box_filter; +#endif + bool checksum_result; const char name[NAMEBUF]; struct wacom_features *wac_feature; struct wacom_g5_platform_data *wac_pdata; struct wacom_g5_callbacks callbacks; int (*power)(int on); - struct work_struct update_work; struct delayed_work resume_work; #ifdef WACOM_IRQ_WORK_AROUND struct delayed_work pendct_dwork; @@ -204,10 +396,20 @@ struct wacom_i2c { unsigned int cpufreq_level; bool dvfs_lock_status; struct delayed_work dvfs_work; -#if defined(CONFIG_MACH_P4NOTE) struct device *bus_dev; #endif +#ifdef CONFIG_MACH_P4NOTE + bool pen_type; +#endif +#ifdef WACOM_CONNECTION_CHECK + bool connection_check; +#endif +#ifdef BATTERY_SAVING_MODE + bool battery_saving_mode; #endif + bool power_enable; + bool boot_mode; + bool query_status; }; #endif /* _LINUX_WACOM_I2C_H */ diff --git a/include/linux/wakelock.h b/include/linux/wakelock.h index a9407fe..a9407fe 100755..100644 --- a/include/linux/wakelock.h +++ b/include/linux/wakelock.h diff --git a/include/linux/wimax/samsung/max8893.h b/include/linux/wimax/samsung/max8893.h new file mode 100644 index 0000000..9c7a4ec --- /dev/null +++ b/include/linux/wimax/samsung/max8893.h @@ -0,0 +1,72 @@ +/* +* +* MAX8893 PMIC driver for WiMAX with CMC732. +* This is not a regulator driver. +*/ + +#ifndef MAX8893_H +#define MAX8993_H __FILE__ +/* +* +* +* Default/Reset values of MAX8893C registers +* +* +* +*/ +/* +#define DEF_VAL_MAX8893_REG_ONOFF 0x01 +#define DEF_VAL_MAX8893_REG_DISCHARGE 0xff +#define DEF_VAL_MAX8893_REG_LSTIME 0x08 +#define DEF_VAL_MAX8893_REG_DVSRAMP 0x09 +#define DEF_VAL_MAX8893_REG_BUCK 0x02 +#define DEF_VAL_MAX8893_REG_LDO1 0x02 +#define DEF_VAL_MAX8893_REG_LDO2 0x0e +#define DEF_VAL_MAX8893_REG_LDO3 0x11 +#define DEF_VAL_MAX8893_REG_LDO4 0x19 +#define DEF_VAL_MAX8893_REG_LDO5 0x16 +*/ +/* +* +* Register address of MAX8893 A/B/C +* BUCK is marked as LDO "-1" +*/ + +#define BUCK (-1) +#define LDO1 1 +#define LDO2 2 +#define LDO3 3 +#define LDO4 4 +#define LDO5 5 +#define DISABLE_USB 6 +#define MAX8893_REG_ONOFF 0x00 +#define MAX8893_REG_DISCHARGE 0x01 +#define MAX8893_REG_LSTIME 0x02 +#define MAX8893_REG_DVSRAMP 0x03 +#define MAX8893_REG_LDO(x) ((x+1) ? (4+x) : 4) +#define ON 1 +#define OFF 0 + +/* +* The maximum and minimum voltage an LDO can provide +* Buck, x = -1 +*/ + +#define MAX_VOLTAGE(x) ((x+1) ? 3300 : 2400) +#define MIN_VOLTAGE(x) ((0x04&x) ? 800 : ((0x01&x) ? 1600 : 1200)) +/* +* +* +*ENABLE_LDO(x) generates a mask which needs +*to be ORed with the contents of onoff reg +* +*DISABLE_LDO(x) generates a mask which needs +*to be ANDed with contents of the off reg +* +*For BUCK, x=-1 +*/ +#define ENABLE_LDO(x) (0x80>>(x+1)) +#define DISABLE_LDO(x) (~(0x80>>(x+1))) + +int wimax_pmic_set_voltage(void); +#endif diff --git a/include/linux/wimax/samsung/wimax732.h b/include/linux/wimax/samsung/wimax732.h new file mode 100644 index 0000000..d7d395a --- /dev/null +++ b/include/linux/wimax/samsung/wimax732.h @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2008 Samsung Electronics, Inc. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ +#include <linux/miscdevice.h> +#include <linux/wakelock.h> +#include <linux/notifier.h> +#include <linux/mutex.h> +#include <asm/byteorder.h> + +#ifndef __WIMAX_CMC732_H +#define __WIMAX_CMC732_H + +#ifdef __KERNEL__ + +#define WIMAX_POWER_SUCCESS 0 +#define WIMAX_ALREADY_POWER_ON -1 +#define WIMAX_POWER_FAIL -2 +#define WIMAX_ALREADY_POWER_OFF -3 + +/* wimax mode */ +enum { + SDIO_MODE = 0, + WTM_MODE, + MAC_IMEI_WRITE_MODE, + USIM_RELAY_MODE, + DM_MODE, + USB_MODE, + AUTH_MODE +}; + +/* wimax power state */ +enum { + CMC_POWER_OFF = 0, + CMC_POWER_ON, + CMC_POWERING_OFF, + CMC_POWERING_ON +}; + +/* wimax state */ +enum { + WIMAX_STATE_NOT_READY, + WIMAX_STATE_READY, + WIMAX_STATE_VIRTUAL_IDLE, + WIMAX_STATE_NORMAL, + WIMAX_STATE_IDLE, + WIMAX_STATE_RESET_REQUESTED, + WIMAX_STATE_RESET_ACKED, + WIMAX_STATE_AWAKE_REQUESTED, +}; + +struct wimax_cfg { + struct wake_lock wimax_driver_lock; /* resume wake lock */ + struct mutex power_mutex; /*serialize power on/off*/ + struct mutex suspend_mutex; + struct work_struct shutdown; + struct wimax732_platform_data *pdata; + struct notifier_block pm_notifier; + u8 power_state; + /* wimax mode (SDIO, USB, etc..) */ + u8 wimax_mode; +}; + +struct wimax732_platform_data { + int (*power) (int); + void (*detect) (int); + void (*set_mode) (void); + void (*signal_ap_active) (int); + int (*get_sleep_mode) (void); + int (*is_modem_awake) (void); + void (*wakeup_assert) (int); + struct wimax_cfg *g_cfg; + struct miscdevice swmxctl_dev; + int wimax_int; + void *adapter_data; + void (*restore_uart_path) (void); + int uart_sel; + int uart_sel1; +}; + +void s3c_bat_use_wimax(int onoff); + +#endif + +#endif |