Skip to content

Instantly share code, notes, and snippets.

Created November 1, 2010 12:44
Show Gist options
  • Save anonymous/658104 to your computer and use it in GitHub Desktop.
Save anonymous/658104 to your computer and use it in GitHub Desktop.
diff msm zte -urB -x .git > short.patch
Only in zte/arch/arm/configs: msm7627_blade_P330_defconfig
Only in zte/arch/arm/configs: msm7627_blade_P729B_defconfig
Only in zte/arch/arm/configs: msm7627_joe_defconfig
Only in zte/arch/arm/configs: msm7627_mooncake_P726CU_defconfig
Only in zte/arch/arm/configs: msm7627_mooncake_P726C_defconfig
Only in zte/arch/arm/configs: msm7627_mooncake_P726G_defconfig
Only in zte/arch/arm/configs: msm7627_mooncake_P726N_defconfig
Only in zte/arch/arm/configs: msm7627_mooncake_P726US_defconfig
Only in zte/arch/arm/configs: msm7627_mooncake_P726VV_defconfig
Only in zte/arch/arm/configs: msm7627_mooncake_R750_defconfig
Only in zte/arch/arm/configs: msm7627_mooncake_defconfig
Only in zte/arch/arm/configs: msm7627_r750_defconfig
Only in zte/arch/arm/configs: msm7627_raise_defconfig
Only in zte/arch/arm/configs: msm7627_smooth_P728H_defconfig
Only in zte/arch/arm/kernel: vmlinux.lds
diff -urB -x .git msm/arch/arm/mach-msm/Kconfig zte/arch/arm/mach-msm/Kconfig
--- msm/arch/arm/mach-msm/Kconfig Mon Nov 1 14:42:21 2010
+++ zte/arch/arm/mach-msm/Kconfig Wed Oct 13 18:07:20 2010
@@ -108,6 +108,111 @@
bool "MSM7x27 SURF"
help
Support for the Qualcomm MSM7x27 SURF eval board.
+
+# ZTE_PLATFORM
+config ZTE_PLATFORM
+ depends on ARCH_MSM
+ depends on !MSM_STACKED_MEMORY
+ default y
+ bool "ZTE Platform."
+ help
+ Support for the ZTE Platform.
+
+# ZTE mooncake
+config MACH_MOONCAKE
+ depends on ARCH_MSM
+ depends on !MSM_STACKED_MEMORY
+ default n
+ bool "ZTE mooncake board."
+ help
+ Support for the ZTE mooncake board.
+
+# ZTE blade
+config MACH_BLADE
+ depends on ARCH_MSM
+ depends on !MSM_STACKED_MEMORY
+ default n
+ bool "ZTE blade board."
+ help
+ Support for the ZTE blade board.
+
+# ZTE smooth
+config MACH_SMOOTH
+ depends on ARCH_MSM
+ depends on !MSM_STACKED_MEMORY
+ default n
+ bool "ZTE smooth board."
+ help
+ Support for the ZTE smooth board.
+
+# ZTE raise
+config MACH_RAISE
+ depends on ARCH_MSM
+ depends on !MSM_STACKED_MEMORY
+ default n
+ bool "ZTE raise board."
+ help
+ Support for the ZTE raise board.
+
+# ZTE joe
+config MACH_JOE
+ depends on ARCH_MSM
+ depends on !MSM_STACKED_MEMORY
+ default n
+ bool "ZTE joe board."
+ help
+ Support for the ZTE joe board.
+
+# ZTE R750
+config MACH_R750
+ depends on ARCH_MSM
+ depends on !MSM_STACKED_MEMORY
+ default n
+ bool "ZTE R750 board."
+ help
+ Support for the ZTE R750 board.
+
+# ZTE ZTE_MULTIMODE
+config ZTE_MULTIMODE
+ depends on ARCH_MSM
+ depends on !MSM_STACKED_MEMORY
+ default n
+ bool "ZTE MULTIMODE."
+ help
+ Support for ZTE MULTIMODE.
+
+# ZTE ZTE_CG_MULTIMODE
+config ZTE_CG_MULTIMODE
+ depends on ARCH_MSM
+ depends on !MSM_STACKED_MEMORY
+ default n
+ bool "ZTE CG_MULTIMODE."
+ help
+ Support for ZTE CG_MULTIMODE.
+
+# ZTE ZTE_CDMA_NETWORK_TEST
+config ZTE_CDMA_NETWORK_TEST
+ depends on ARCH_MSM
+ depends on !MSM_STACKED_MEMORY
+ default n
+ bool "ZTE CDMA_NETWORK_TEST."
+ help
+ Support for ZTE CDMA_NETWORK_TEST.
+
+# ZTE ZTE_TELECOM_TEST
+config ZTE_TELECOM_TEST
+ depends on ARCH_MSM
+ depends on !MSM_STACKED_MEMORY
+ default n
+ bool "ZTE TELECOM_TEST."
+ help
+ Support for ZTE TELECOM_TEST.
+
+# ZTE_FTM_FLAG_SUPPORT
+config ZTE_FTM_FLAG_SUPPORT
+ depends on ZTE_PLATFORM
+ default y
+ bool "enable ZTE handset FTM mode detect."
config MACH_MSM7X27_FFA
depends on ARCH_MSM7X27
@@ -235,7 +340,7 @@
config PHYS_OFFSET
hex
- default "0x00200000" if !MSM_STACKED_MEMORY
+ default "0x02A00000" if !MSM_STACKED_MEMORY
default "0x00000000" if ARCH_QSD8X50 && MSM_SOC_REV_A
default "0x20000000" if ARCH_QSD8X50
default "0x10000000"
diff -urB -x .git msm/arch/arm/mach-msm/Makefile zte/arch/arm/mach-msm/Makefile
--- msm/arch/arm/mach-msm/Makefile Mon Nov 1 14:42:21 2010
+++ zte/arch/arm/mach-msm/Makefile Fri Oct 15 17:30:18 2010
@@ -91,7 +92,20 @@
obj-$(CONFIG_TROUT_H2W) += board-trout-h2w.o
obj-$(CONFIG_TROUT_BATTCHG) += htc_battery.o
obj-$(CONFIG_TROUT_PWRSINK) += htc_pwrsink.o
-obj-$(CONFIG_ARCH_MSM7X27) += board-msm7x27.o
+#obj-$(CONFIG_ARCH_MSM7X27) += board-msm7x27.o
+
+obj-$(CONFIG_MACH_MOONCAKE) += board-mooncake.o board-mooncake-keypad.o msm_vibrator.o
+
+obj-$(CONFIG_MACH_R750) += board-r750.o board-r750-keypad.o msm_vibrator.o
+
+obj-$(CONFIG_MACH_BLADE) += board-zte-blade.o board-zte-blade-keypad.o msm_vibrator.o
+
+obj-$(CONFIG_MACH_SMOOTH) += board-zte-smooth.o board-zte-smooth-keypad.o msm_vibrator.o
+
+obj-$(CONFIG_MACH_RAISE) += board-raise.o board-raise-keypad.o msm_vibrator.o
+
+obj-$(CONFIG_MACH_JOE) += board-joe.o board-joe-keypad.o msm_vibrator.o
+
obj-$(CONFIG_ARCH_MSM7X30) += board-msm7x30.o clock-7x30.o
obj-$(CONFIG_ARCH_MSM7X25) += board-msm7x27.o
diff -urB -x .git msm/arch/arm/mach-msm/Makefile.boot zte/arch/arm/mach-msm/Makefile.boot
--- msm/arch/arm/mach-msm/Makefile.boot Mon Nov 1 13:46:21 2010
+++ zte/arch/arm/mach-msm/Makefile.boot Wed Oct 13 18:07:20 2010
@@ -1,31 +1,31 @@
# MSM7x01A
- zreladdr-$(CONFIG_ARCH_MSM7X01A) := 0x10008000
-params_phys-$(CONFIG_ARCH_MSM7X01A) := 0x10000100
-initrd_phys-$(CONFIG_ARCH_MSM7X01A) := 0x10800000
+# zreladdr-$(CONFIG_ARCH_MSM7X01A) := 0x10008000
+#params_phys-$(CONFIG_ARCH_MSM7X01A) := 0x10000100
+#initrd_phys-$(CONFIG_ARCH_MSM7X01A) := 0x10800000
# MSM7x25
- zreladdr-$(CONFIG_ARCH_MSM7X25) := 0x00208000
-params_phys-$(CONFIG_ARCH_MSM7X25) := 0x00200100
-initrd_phys-$(CONFIG_ARCH_MSM7X25) := 0x0A000000
+# zreladdr-$(CONFIG_ARCH_MSM7X25) := 0x00208000
+#params_phys-$(CONFIG_ARCH_MSM7X25) := 0x00200100
+#initrd_phys-$(CONFIG_ARCH_MSM7X25) := 0x0A000000
# MSM7x27
- zreladdr-$(CONFIG_ARCH_MSM7X27) := 0x00208000
-params_phys-$(CONFIG_ARCH_MSM7X27) := 0x00200100
+ zreladdr-$(CONFIG_ARCH_MSM7X27) := 0x02A08000
+params_phys-$(CONFIG_ARCH_MSM7X27) := 0x02A00100
initrd_phys-$(CONFIG_ARCH_MSM7X27) := 0x0A000000
# MSM7x30
- zreladdr-$(CONFIG_ARCH_MSM7X30) := 0x00208000
-params_phys-$(CONFIG_ARCH_MSM7X30) := 0x00200100
-initrd_phys-$(CONFIG_ARCH_MSM7X30) := 0x01200000
+# zreladdr-$(CONFIG_ARCH_MSM7X30) := 0x00208000
+#params_phys-$(CONFIG_ARCH_MSM7X30) := 0x00200100
+#initrd_phys-$(CONFIG_ARCH_MSM7X30) := 0x01200000
-ifeq ($(CONFIG_MSM_SOC_REV_A),y)
+#ifeq ($(CONFIG_MSM_SOC_REV_A),y)
# QSD8X50A
- zreladdr-$(CONFIG_ARCH_QSD8X50) := 0x00008000
-params_phys-$(CONFIG_ARCH_QSD8X50) := 0x00000100
-initrd_phys-$(CONFIG_ARCH_QSD8X50) := 0x04000000
-else
+# zreladdr-$(CONFIG_ARCH_QSD8X50) := 0x00008000
+#params_phys-$(CONFIG_ARCH_QSD8X50) := 0x00000100
+#initrd_phys-$(CONFIG_ARCH_QSD8X50) := 0x04000000
+#else
# QSD8x50
- zreladdr-$(CONFIG_ARCH_QSD8X50) := 0x20008000
-params_phys-$(CONFIG_ARCH_QSD8X50) := 0x20000100
-initrd_phys-$(CONFIG_ARCH_QSD8X50) := 0x24000000
-endif
+# zreladdr-$(CONFIG_ARCH_QSD8X50) := 0x20008000
+#params_phys-$(CONFIG_ARCH_QSD8X50) := 0x20000100
+#initrd_phys-$(CONFIG_ARCH_QSD8X50) := 0x24000000
+#endif
Only in zte/arch/arm/mach-msm: board-joe-keypad.c
Only in zte/arch/arm/mach-msm: board-joe.c
Only in zte/arch/arm/mach-msm: board-mooncake-keypad.c
Only in zte/arch/arm/mach-msm: board-mooncake.c
Only in zte/arch/arm/mach-msm: board-r750-keypad.c
Only in zte/arch/arm/mach-msm: board-r750.c
Only in zte/arch/arm/mach-msm: board-zte-blade-keypad.c
Only in zte/arch/arm/mach-msm: board-zte-blade.c
Only in zte/arch/arm/mach-msm: board-zte-blade.c.bak
Only in zte/arch/arm/mach-msm: debug.c
Only in zte/arch/arm/mach-msm/include/mach: avago_ofn.h
diff -urB -x .git msm/arch/arm/mach-msm/include/mach/camera.h zte/arch/arm/mach-msm/include/mach/camera.h
--- msm/arch/arm/mach-msm/include/mach/camera.h Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/include/mach/camera.h Mon Oct 18 11:03:32 2010
@@ -29,9 +30,18 @@
#include <mach/board.h>
#include <media/msm_camera.h>
+
+#undef CCRT
+#undef CINF
+#undef CDBG
#ifdef CONFIG_MSM_CAMERA_DEBUG
-#define CDBG(fmt, args...) printk(KERN_INFO "msm_camera: " fmt, ##args)
+#define CPREFIX "[jia@msm_camera]"
+#define CCRT(fmt, args...) printk(KERN_CRIT CPREFIX": " fmt, ##args)
+#define CINF(fmt, args...) printk(KERN_CRIT CPREFIX": " fmt, ##args)
+#define CDBG(fmt, args...) printk(KERN_CRIT CPREFIX": " fmt, ##args)
#else
+#define CCRT(fmt, args...) do { } while (0)
+#define CINF(fmt, args...) do { } while (0)
#define CDBG(fmt, args...) do { } while (0)
#endif
@@ -260,6 +270,12 @@
int (*sensor_probe)(const struct msm_camera_sensor_info *,
struct msm_sensor_ctrl *));
+
+#if defined(CONFIG_SENSOR_ADAPTER)
+int msm_camera_dev_start(struct platform_device *dev,
+ int (*sensor_dev_probe)(const struct msm_camera_sensor_info *));
+#endif
+
enum msm_camio_clk_type {
CAMIO_VFE_MDC_CLK,
CAMIO_MDC_CLK,
@@ -309,6 +325,15 @@
enum msm_s_setting {
S_RES_PREVIEW,
S_RES_CAPTURE
+};
+
+
+enum msm_camera_pwr_mode_t {
+ MSM_CAMERA_PWRUP_MODE = 0,
+ MSM_CAMERA_STANDBY_MODE,
+ MSM_CAMERA_NORMAL_MODE,
+ MSM_CAMERA_PWRDWN_MODE,
+ MSM_CAMERA_PWR_MODE_MAX
};
int msm_camio_enable(struct platform_device *dev);
Only in zte/arch/arm/mach-msm/include/mach: fm_si4708.h
Only in zte/arch/arm/mach-msm/include/mach: jogball_key.h
diff -urB -x .git msm/arch/arm/mach-msm/include/mach/memory.h zte/arch/arm/mach-msm/include/mach/memory.h
--- msm/arch/arm/mach-msm/include/mach/memory.h Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/include/mach/memory.h Mon Oct 18 11:04:40 2010
@@ -39,7 +39,7 @@
#include <asm/mach-types.h>
#define arch_barrier_extra() do \
- { if (machine_is_msm7x27_surf() || machine_is_msm7x27_ffa()) \
+ { \
write_to_strongly_ordered_memory(); \
} while (0)
#endif
diff -urB -x .git msm/arch/arm/mach-msm/include/mach/msm_adsp.h zte/arch/arm/mach-msm/include/mach/msm_adsp.h
--- msm/arch/arm/mach-msm/include/mach/msm_adsp.h Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/include/mach/msm_adsp.h Mon Oct 18 11:04:54 2010
@@ -41,6 +42,8 @@
int msm_adsp_disable(struct msm_adsp_module *module);
int adsp_set_clkrate(struct msm_adsp_module *module, unsigned long clk_rate);
int msm_adsp_disable_event_rsp(struct msm_adsp_module *module);
+void resume_prevent_suspend(void);
+void suspend_allow_suspend(void);
/* Write is safe to call from interrupt context.
*/
diff -urB -x .git msm/arch/arm/mach-msm/include/mach/msm_hsusb.h zte/arch/arm/mach-msm/include/mach/msm_hsusb.h
--- msm/arch/arm/mach-msm/include/mach/msm_hsusb.h Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/include/mach/msm_hsusb.h Wed Oct 13 18:07:14 2010
@@ -52,6 +52,7 @@
#ifndef CONFIG_USB_ANDROID
/* platform device data for msm_hsusb driver */
struct usb_composition {
+ __u16 vendor_id;
__u16 product_id;
unsigned long functions;
};
@@ -97,6 +98,7 @@
int vreg5v_required;
u32 swfi_latency;
+ int zte_pid;//hemulu
};
struct msm_otg_platform_data {
diff -urB -x .git msm/arch/arm/mach-msm/include/mach/msm_iomap-7xxx.h zte/arch/arm/mach-msm/include/mach/msm_iomap-7xxx.h
--- msm/arch/arm/mach-msm/include/mach/msm_iomap-7xxx.h Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/include/mach/msm_iomap-7xxx.h Wed Oct 13 18:07:14 2010
@@ -99,4 +99,7 @@
#define MSM_AD5_PHYS 0xAC000000
#define MSM_AD5_SIZE (SZ_1M*13)
+#define MSM_SMEM_RAM_PHYS 0x00200000
+#define MSM_SMEM_RAM_SIZE SZ_1M
+
#endif
diff -urB -x .git msm/arch/arm/mach-msm/include/mach/msm_serial_hs.h zte/arch/arm/mach-msm/include/mach/msm_serial_hs.h
--- msm/arch/arm/mach-msm/include/mach/msm_serial_hs.h Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/include/mach/msm_serial_hs.h Thu Oct 14 14:51:26 2010
@@ -26,6 +26,11 @@
char rx_to_inject;
};
+#ifdef CONFIG_MODEMCTL
+#define MODEMCTL_UARTDM1_UNINIT 2
+unsigned int msm_hs_dm1_tx_empty(void);
+#endif
+
unsigned int msm_hs_tx_empty(struct uart_port *uport);
void msm_hs_request_clock_off(struct uart_port *uport);
void msm_hs_request_clock_on(struct uart_port *uport);
diff -urB -x .git msm/arch/arm/mach-msm/include/mach/rpc_hsusb.h zte/arch/arm/mach-msm/include/mach/rpc_hsusb.h
--- msm/arch/arm/mach-msm/include/mach/rpc_hsusb.h Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/include/mach/rpc_hsusb.h Mon Oct 18 11:05:20 2010
@@ -32,6 +33,7 @@
int msm_hsusb_send_productID(uint32_t product_id);
int msm_hsusb_send_serial_number(char *serial_number);
int msm_hsusb_is_serial_num_null(uint32_t val);
+int msm_hsusb_get_set_usb_conf_nv_value(uint32_t nv_item,uint32_t value,uint32_t is_write);//ZTE-USB-HML-02
int msm_hsusb_reset_rework_installed(void);
int msm_hsusb_enable_pmic_ulpidata0(void);
int msm_hsusb_disable_pmic_ulpidata0(void);
diff -urB -x .git msm/arch/arm/mach-msm/io.c zte/arch/arm/mach-msm/io.c
--- msm/arch/arm/mach-msm/io.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/io.c Mon Oct 18 11:31:16 2010
@@ -46,10 +47,14 @@
int i;
BUG_ON(!size);
- for (i = 0; i < size; i++)
+
+ for (i = 0; i < size; i++) {
if (io_desc[i].virtual == (unsigned long)MSM_SHARED_RAM_BASE)
io_desc[i].pfn = __phys_to_pfn(msm_shared_ram_phys);
+ }
+
+
iotable_init(io_desc, size);
}
@@ -81,6 +86,20 @@
.length = MSM_SHARED_RAM_SIZE,
.type = MT_DEVICE,
},
+
+#if 0
+ {
+ .virtual = (unsigned long) MSM_TRACE_LOG_BASE,
+ .length = MSM_TRACE_LOG_SIZE,
+ .type = MT_DEVICE,
+ },
+
+ {
+ .virtual = (unsigned long) MSM_F3_LOG_BASE,
+ .length = MSM_F3_LOG_SIZE,
+ .type = MT_DEVICE,
+ },
+#endif
};
void __init msm_map_common_io(void)
Only in zte/arch/arm/mach-msm: msm_usb_config.h
diff -urB -x .git msm/arch/arm/mach-msm/msm_vibrator.c zte/arch/arm/mach-msm/msm_vibrator.c
--- msm/arch/arm/mach-msm/msm_vibrator.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/msm_vibrator.c Mon Oct 18 11:32:12 2010
@@ -22,19 +23,27 @@
#include <mach/msm_rpcrouter.h>
-#define PM_LIBPROG 0x30000061
+#define PM_LIBPROG 0x30000061
+#if 1
+#define PM_LIBVERS 0x10001
+#else
#if (CONFIG_MSM_AMSS_VERSION == 6220) || (CONFIG_MSM_AMSS_VERSION == 6225)
-#define PM_LIBVERS 0xfb837d0b
+#define PM_LIBVERS 0xfb837d0b
#else
-#define PM_LIBVERS 0x10001
+#define PM_LIBVERS MSM_RPC_VERS(1,1)
+#endif
#endif
-#define HTC_PROCEDURE_SET_VIB_ON_OFF 21
+#define HTC_PROCEDURE_SET_VIB_ON_OFF 22
#define PMIC_VIBRATOR_LEVEL (3000)
-static struct work_struct work_vibrator_on;
-static struct work_struct work_vibrator_off;
+
+
+
+static struct work_struct vibrator_work;
static struct hrtimer vibe_timer;
+static spinlock_t vibe_lock;
+static int vibe_state;
static void set_pmic_vibrator(int on)
{
@@ -44,6 +53,10 @@
uint32_t data;
} req;
+#ifdef STONE_DEBUG
+ printk("\nstone vib01:0x%x,0x%x\n",on,vib_endpoint);
+#endif
+
if (!vib_endpoint) {
vib_endpoint = msm_rpc_connect(PM_LIBPROG, PM_LIBVERS, 0);
if (IS_ERR(vib_endpoint)) {
@@ -63,41 +75,34 @@
sizeof(req), 5 * HZ);
}
-static void pmic_vibrator_on(struct work_struct *work)
-{
- set_pmic_vibrator(1);
-}
-
-static void pmic_vibrator_off(struct work_struct *work)
+static void update_vibrator(struct work_struct *work)
{
- set_pmic_vibrator(0);
-}
-
-static void timed_vibrator_on(struct timed_output_dev *sdev)
-{
- schedule_work(&work_vibrator_on);
-}
-
-static void timed_vibrator_off(struct timed_output_dev *sdev)
-{
- schedule_work(&work_vibrator_off);
+ set_pmic_vibrator(vibe_state);
}
static void vibrator_enable(struct timed_output_dev *dev, int value)
{
+ unsigned long flags;
+
+ spin_lock_irqsave(&vibe_lock, flags);
hrtimer_cancel(&vibe_timer);
+#ifdef STONE_DEBUG
+ printk("\nstone vib02:0x%x,0x%x\n",dev,value);
+#endif
+
if (value == 0)
- timed_vibrator_off(dev);
+ vibe_state = 0;
else {
- value = (value > 15000 ? 15000 : value);
-
- timed_vibrator_on(dev);
-
+ value = (value > 1000 ? 1000 : value);
+ vibe_state = 1;
hrtimer_start(&vibe_timer,
- ktime_set(value / 1000, (value % 1000) * 1000000),
- HRTIMER_MODE_REL);
+ ktime_set(value / 1000, (value % 1000) * 1000000),
+ HRTIMER_MODE_REL);
}
+ spin_unlock_irqrestore(&vibe_lock, flags);
+
+ schedule_work(&vibrator_work);
}
static int vibrator_get_time(struct timed_output_dev *dev)
@@ -111,7 +116,8 @@
static enum hrtimer_restart vibrator_timer_func(struct hrtimer *timer)
{
- timed_vibrator_off(NULL);
+ vibe_state = 0;
+ schedule_work(&vibrator_work);
return HRTIMER_NORESTART;
}
@@ -123,9 +129,13 @@
void __init msm_init_pmic_vibrator(void)
{
- INIT_WORK(&work_vibrator_on, pmic_vibrator_on);
- INIT_WORK(&work_vibrator_off, pmic_vibrator_off);
+ INIT_WORK(&vibrator_work, update_vibrator);
+
+ printk("\nstone_20100302 vib00:**************************************\n");
+
+ spin_lock_init(&vibe_lock);
+ vibe_state = 0;
hrtimer_init(&vibe_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
vibe_timer.function = vibrator_timer_func;
diff -urB -x .git msm/arch/arm/mach-msm/qdsp5/adsp.c zte/arch/arm/mach-msm/qdsp5/adsp.c
--- msm/arch/arm/mach-msm/qdsp5/adsp.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/qdsp5/adsp.c Mon Oct 18 11:06:28 2010
@@ -36,14 +38,33 @@
#include <linux/wakelock.h>
static struct wake_lock adsp_wake_lock;
+
static inline void prevent_suspend(void)
{
+ if (!wake_lock_active(&adsp_wake_lock))
+ {
wake_lock(&adsp_wake_lock);
}
+}
static inline void allow_suspend(void)
{
+ if (wake_lock_active(&adsp_wake_lock))
+ {
wake_unlock(&adsp_wake_lock);
}
+}
+
+void resume_prevent_suspend(void)
+{
+ prevent_suspend();
+ MM_INFO("patch:resume_prevent_suspend\n");
+}
+void suspend_allow_suspend(void)
+{
+ allow_suspend();
+ MM_INFO("patch:suspend_allow_suspend\n");
+}
+
#include <linux/io.h>
#include <mach/msm_iomap.h>
@@ -427,8 +448,9 @@
while (((ctrl_word = readl(info->write_ctrl)) &
ADSP_RTOS_WRITE_CTRL_WORD_READY_M) !=
ADSP_RTOS_WRITE_CTRL_WORD_READY_V) {
- if (cnt > 50) {
+ if (cnt > (50 * 4)) {
MM_ERR("timeout waiting for DSP write ready\n");
+ MM_ERR("write:write_ctrl = %#x\n", readl(info->write_ctrl));
ret_status = -EIO;
goto fail;
}
@@ -464,8 +486,9 @@
while ((readl(info->write_ctrl) &
ADSP_RTOS_WRITE_CTRL_WORD_MUTEX_M) ==
ADSP_RTOS_WRITE_CTRL_WORD_MUTEX_NAVAIL_V) {
- if (cnt > 2500) {
+ if (cnt > (2500 * 4)) {
MM_ERR("timeout waiting for adsp ack\n");
+ MM_ERR("ack:write_ctrl = %#x\n", readl(info->write_ctrl));
ret_status = -EIO;
goto fail;
}
@@ -985,7 +1008,7 @@
MM_INFO("enable '%s'state[%d] id[%d]\n",
module->name, module->state, module->id);
-
+ MM_INFO("adsp_open_count=%d\n", adsp_open_count);
mutex_lock(&module->lock);
switch (module->state) {
case ADSP_STATE_DISABLED:
@@ -995,9 +1018,16 @@
break;
module->state = ADSP_STATE_ENABLING;
mutex_unlock(&module->lock);
+#if 0
+
rc = wait_event_timeout(module->state_wait,
module->state != ADSP_STATE_ENABLING,
1 * HZ);
+#else
+ rc = wait_event_timeout(module->state_wait,
+ module->state != ADSP_STATE_ENABLING,
+ 5 * HZ);
+#endif
mutex_lock(&module->lock);
if (module->state == ADSP_STATE_ENABLED) {
rc = 0;
@@ -1049,12 +1079,17 @@
{
int rc = 0;
+ MM_INFO("disable_locked:'%s'state[%d]:id[%d]:adsp_open_count=%d\n",
+ module->name, module->state, module->id, adsp_open_count);
+
switch (module->state) {
case ADSP_STATE_DISABLED:
MM_DBG("module '%s' already disabled\n", module->name);
+ MM_INFO("module '%s' already disabled\n", module->name);
break;
case ADSP_STATE_ENABLING:
case ADSP_STATE_ENABLED:
+ MM_INFO("module'%s' to disabled\n", module->name);
rc = rpc_adsp_rtos_app_to_modem(RPC_ADSP_RTOS_CMD_DISABLE,
module->id, module);
module->state = ADSP_STATE_DISABLED;
@@ -1067,6 +1102,7 @@
MM_INFO("disable interrupt\n");
}
mutex_unlock(&adsp_open_lock);
+ MM_INFO("adsp_open_count=%d\n", adsp_open_count);
}
return rc;
}
diff -urB -x .git msm/arch/arm/mach-msm/qdsp5/audio_aac.c zte/arch/arm/mach-msm/qdsp5/audio_aac.c
--- msm/arch/arm/mach-msm/qdsp5/audio_aac.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/qdsp5/audio_aac.c Fri Oct 15 15:35:40 2010
@@ -1482,6 +1484,7 @@
MM_DBG("\n"); /* Macro prints the file name and function */
audaac_post_event(ctl->audio, AUDIO_EVENT_SUSPEND, payload);
+ suspend_allow_suspend();
}
static void audaac_resume(struct early_suspend *h)
@@ -1492,7 +1495,9 @@
MM_DBG("\n"); /* Macro prints the file name and function */
audaac_post_event(ctl->audio, AUDIO_EVENT_RESUME, payload);
+ resume_prevent_suspend();
}
+
#endif
#ifdef CONFIG_DEBUG_FS
diff -urB -x .git msm/arch/arm/mach-msm/qdsp5/audio_amrnb.c zte/arch/arm/mach-msm/qdsp5/audio_amrnb.c
--- msm/arch/arm/mach-msm/qdsp5/audio_amrnb.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/qdsp5/audio_amrnb.c Fri Oct 15 15:35:20 2010
@@ -1280,6 +1282,7 @@
MM_DBG("\n"); /* Macro prints the file name and function */
audamrnb_post_event(ctl->audio, AUDIO_EVENT_SUSPEND, payload);
+ suspend_allow_suspend();
}
static void audamrnb_resume(struct early_suspend *h)
@@ -1290,7 +1293,9 @@
MM_DBG("\n"); /* Macro prints the file name and function */
audamrnb_post_event(ctl->audio, AUDIO_EVENT_RESUME, payload);
+ resume_prevent_suspend();
}
+
#endif
#ifdef CONFIG_DEBUG_FS
diff -urB -x .git msm/arch/arm/mach-msm/qdsp5/audio_amrwb.c zte/arch/arm/mach-msm/qdsp5/audio_amrwb.c
--- msm/arch/arm/mach-msm/qdsp5/audio_amrwb.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/qdsp5/audio_amrwb.c Fri Oct 15 15:41:04 2010
@@ -1361,6 +1361,7 @@
pr_debug("%s()\n", __func__);
audamrwb_post_event(ctl->audio, AUDIO_EVENT_SUSPEND, payload);
+ suspend_allow_suspend();
}
static void audamrwb_resume(struct early_suspend *h)
@@ -1371,6 +1372,7 @@
pr_debug("%s()\n", __func__);
audamrwb_post_event(ctl->audio, AUDIO_EVENT_RESUME, payload);
+ resume_prevent_suspend();
}
#endif
diff -urB -x .git msm/arch/arm/mach-msm/qdsp5/audio_evrc.c zte/arch/arm/mach-msm/qdsp5/audio_evrc.c
--- msm/arch/arm/mach-msm/qdsp5/audio_evrc.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/qdsp5/audio_evrc.c Fri Oct 15 15:41:26 2010
@@ -1272,6 +1273,7 @@
MM_DBG("\n"); /* Macro prints the file name and function */
audevrc_post_event(ctl->audio, AUDIO_EVENT_SUSPEND, payload);
+ suspend_allow_suspend();
}
static void audevrc_resume(struct early_suspend *h)
@@ -1282,6 +1284,7 @@
MM_DBG("\n"); /* Macro prints the file name and function */
audevrc_post_event(ctl->audio, AUDIO_EVENT_RESUME, payload);
+ resume_prevent_suspend();
}
#endif
diff -urB -x .git msm/arch/arm/mach-msm/qdsp5/audio_mp3.c zte/arch/arm/mach-msm/qdsp5/audio_mp3.c
--- msm/arch/arm/mach-msm/qdsp5/audio_mp3.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/qdsp5/audio_mp3.c Fri Oct 15 15:42:14 2010
@@ -1963,6 +1963,7 @@
MM_DBG("\n"); /* Macro prints the file name and function */
audmp3_post_event(ctl->audio, AUDIO_EVENT_SUSPEND, payload);
+ suspend_allow_suspend();
}
static void audmp3_resume(struct early_suspend *h)
@@ -1973,6 +1974,7 @@
MM_DBG("\n"); /* Macro prints the file name and function */
audmp3_post_event(ctl->audio, AUDIO_EVENT_RESUME, payload);
+ resume_prevent_suspend();
}
#endif
diff -urB -x .git msm/arch/arm/mach-msm/qdsp5/audio_pcm.c zte/arch/arm/mach-msm/qdsp5/audio_pcm.c
--- msm/arch/arm/mach-msm/qdsp5/audio_pcm.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/qdsp5/audio_pcm.c Fri Oct 15 15:42:32 2010
@@ -1366,6 +1366,7 @@
MM_DBG("\n"); /* Macro prints the file name and function */
audpcm_post_event(ctl->audio, AUDIO_EVENT_SUSPEND, payload);
+ suspend_allow_suspend();
}
static void audpcm_resume(struct early_suspend *h)
@@ -1376,6 +1377,7 @@
MM_DBG("\n"); /* Macro prints the file name and function */
audpcm_post_event(ctl->audio, AUDIO_EVENT_RESUME, payload);
+ resume_prevent_suspend();
}
#endif
diff -urB -x .git msm/arch/arm/mach-msm/qdsp5/audio_qcelp.c zte/arch/arm/mach-msm/qdsp5/audio_qcelp.c
--- msm/arch/arm/mach-msm/qdsp5/audio_qcelp.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/qdsp5/audio_qcelp.c Fri Oct 15 15:43:02 2010
@@ -1274,6 +1274,7 @@
MM_DBG("\n"); /* Macro prints the file name and function */
audqcelp_post_event(ctl->audio, AUDIO_EVENT_SUSPEND, payload);
+ suspend_allow_suspend();
}
static void audqcelp_resume(struct early_suspend *h)
@@ -1284,6 +1285,7 @@
MM_DBG("\n"); /* Macro prints the file name and function */
audqcelp_post_event(ctl->audio, AUDIO_EVENT_RESUME, payload);
+ resume_prevent_suspend();
}
#endif
diff -urB -x .git msm/arch/arm/mach-msm/qdsp5/audio_wma.c zte/arch/arm/mach-msm/qdsp5/audio_wma.c
--- msm/arch/arm/mach-msm/qdsp5/audio_wma.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/qdsp5/audio_wma.c Fri Oct 15 15:43:20 2010
@@ -1417,6 +1418,7 @@
MM_DBG("\n"); /* Macro prints the file name and function */
audwma_post_event(ctl->audio, AUDIO_EVENT_SUSPEND, payload);
+ suspend_allow_suspend();
}
static void audwma_resume(struct early_suspend *h)
@@ -1427,6 +1429,7 @@
MM_DBG("\n"); /* Macro prints the file name and function */
audwma_post_event(ctl->audio, AUDIO_EVENT_RESUME, payload);
+ resume_prevent_suspend();
}
#endif
diff -urB -x .git msm/arch/arm/mach-msm/qdsp5/audio_wmapro.c zte/arch/arm/mach-msm/qdsp5/audio_wmapro.c
--- msm/arch/arm/mach-msm/qdsp5/audio_wmapro.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/qdsp5/audio_wmapro.c Fri Oct 15 15:43:44 2010
@@ -1414,6 +1415,7 @@
MM_DBG("\n"); /* Macro prints the file name and function */
audwmapro_post_event(ctl->audio, AUDIO_EVENT_SUSPEND, payload);
+ suspend_allow_suspend();
}
static void audwmapro_resume(struct early_suspend *h)
@@ -1424,6 +1426,7 @@
MM_DBG("\n"); /* Macro prints the file name and function */
audwmapro_post_event(ctl->audio, AUDIO_EVENT_RESUME, payload);
+ resume_prevent_suspend();
}
#endif
diff -urB -x .git msm/arch/arm/mach-msm/qdsp5/audmgr.c zte/arch/arm/mach-msm/qdsp5/audmgr.c
--- msm/arch/arm/mach-msm/qdsp5/audmgr.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/qdsp5/audmgr.c Fri Oct 15 15:44:06 2010
@@ -28,6 +28,9 @@
#include "audmgr.h"
+#include <linux/delay.h>
+
+
#define STATE_CLOSED 0
#define STATE_DISABLED 1
#define STATE_ENABLING 2
@@ -270,6 +273,9 @@
amg->ept = NULL;
goto done;
}
+
+ msleep(23);
+
}
/* Initialize session parameters */
diff -urB -x .git msm/arch/arm/mach-msm/qdsp5/audmgr.h zte/arch/arm/mach-msm/qdsp5/audmgr.h
--- msm/arch/arm/mach-msm/qdsp5/audmgr.h Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/qdsp5/audmgr.h Fri Oct 15 15:44:28 2010
@@ -203,8 +204,9 @@
typedef void (*audpp_event_func)(void *private, unsigned id, uint16_t *msg);
typedef void (*audrec_event_func)(void *private, unsigned id, uint16_t *msg);
+
/* worst case delay of 100ms for response */
-#define MSM_AUD_DECODER_WAIT_MS 200
+#define MSM_AUD_DECODER_WAIT_MS 500
#define MSM_AUD_MODE_TUNNEL 0x00000100
#define MSM_AUD_MODE_NONTUNNEL 0x00000200
#define MSM_AUD_DECODER_MASK 0x0000FFFF
diff -urB -x .git msm/arch/arm/mach-msm/qdsp5/snd.c zte/arch/arm/mach-msm/qdsp5/snd.c
--- msm/arch/arm/mach-msm/qdsp5/snd.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/qdsp5/snd.c Fri Oct 15 15:46:14 2010
@@ -30,11 +32,15 @@
#include <mach/board.h>
#include <mach/msm_rpcrouter.h>
+#include <linux/switch.h>
+
struct snd_ctxt {
struct mutex lock;
int opened;
struct msm_rpc_endpoint *ept;
struct msm_snd_endpoints *snd_epts;
+
+ struct switch_dev snd_dev_info;
};
struct snd_sys_ctxt {
@@ -46,6 +52,12 @@
static struct snd_ctxt the_snd;
+#define SND_DEV 0
+#define EAR_MUTE 1
+#define MIC_MUTE 2
+#define SND_DEV_INFO_NUM 3
+static int keep_snd_dev_info[SND_DEV_INFO_NUM] = {0, 0, 0};
+
#define RPC_SND_PROG 0x30000002
#define RPC_SND_CB_PROG 0x31000002
@@ -55,7 +67,9 @@
#define SND_SET_VOLUME_PROC 3
#define SND_AVC_CTL_PROC 29
#define SND_AGC_CTL_PROC 30
-
+ #define SND_AUDIO_LOOPBACK_PROC 37
+ #define SND_HPH_AMP_CTL_PROC 38
+
struct rpc_snd_set_device_args {
uint32_t device;
uint32_t ear_mute;
@@ -86,6 +100,19 @@
uint32_t client_data;
};
+
+struct rpc_snd_lb_ctl_args {
+ uint32_t lb_ctl;
+ uint32_t cb_func;
+ uint32_t client_data;
+};
+
+struct rpc_snd_hph_amp_ctl_args {
+ uint32_t amp_ctl;
+ uint32_t cb_func;
+ uint32_t client_data;
+};
+
struct snd_set_device_msg {
struct rpc_request_hdr hdr;
struct rpc_snd_set_device_args args;
@@ -106,6 +133,17 @@
struct rpc_snd_agc_ctl_args args;
};
+
+struct snd_set_lb_msg {
+ struct rpc_request_hdr hdr;
+ struct rpc_snd_lb_ctl_args args;
+};
+
+struct snd_hph_amp_msg {
+ struct rpc_request_hdr hdr;
+ struct rpc_snd_hph_amp_ctl_args args;
+};
+
struct snd_endpoint *get_snd_endpoints(int *size);
static inline int check_mute(int mute)
@@ -149,6 +187,7 @@
struct snd_set_volume_msg vmsg;
struct snd_avc_ctl_msg avc_msg;
struct snd_agc_ctl_msg agc_msg;
+ struct snd_set_lb_msg lb_msg;
struct msm_snd_device_config dev;
struct msm_snd_volume_config vol;
@@ -156,6 +195,7 @@
int rc = 0;
uint32_t avc, agc;
+ uint32_t set_lb;
mutex_lock(&snd->lock);
switch (cmd) {
@@ -184,6 +224,13 @@
rc = msm_rpc_call(snd->ept,
SND_SET_DEVICE_PROC,
&dmsg, sizeof(dmsg), 5 * HZ);
+
+ if (dev.device != 28)
+ {
+ keep_snd_dev_info[SND_DEV] = dev.device;
+ }
+ keep_snd_dev_info[EAR_MUTE] = dev.ear_mute;
+ keep_snd_dev_info[MIC_MUTE] = dev.mic_mute;
break;
case SND_SET_VOLUME:
@@ -264,6 +311,28 @@
rc = get_endpoint(snd, arg);
break;
+
+ case SND_SET_AUDIO_LOOPBACK:
+ if (get_user(set_lb, (uint32_t __user *) arg)) {
+ rc = -EFAULT;
+ break;
+ } else if ((set_lb != 1) && (set_lb != 0)) {
+ rc = -EINVAL;
+ break;
+ }
+
+ lb_msg.args.lb_ctl = cpu_to_be32(set_lb);
+
+ lb_msg.args.cb_func = -1;
+ lb_msg.args.client_data = 0;
+
+ pr_info("snd_lb_ctl %d\n", set_lb);
+
+ rc = msm_rpc_call(snd->ept,
+ SND_AUDIO_LOOPBACK_PROC,
+ &lb_msg, sizeof(lb_msg), 5 * HZ);
+ break;
+
default:
MM_ERR("unknown command\n");
rc = -EINVAL;
@@ -271,6 +340,8 @@
}
mutex_unlock(&snd->lock);
+ MM_INFO("chenjun:rc = %d\n", rc);
+
return rc;
}
@@ -579,6 +650,29 @@
return status ? : size;
}
+int snd_hph_amp_ctl(uint32_t on)
+{
+ struct snd_ctxt *snd = &the_snd;
+ struct snd_hph_amp_msg hph_amp_msg;
+ int rc = 0;
+
+ pr_info("snd_hph_amp_ctl:%d\n", on);
+
+ mutex_lock(&snd->lock);
+
+ hph_amp_msg.args.amp_ctl = cpu_to_be32(on);
+ hph_amp_msg.args.cb_func = -1;
+ hph_amp_msg.args.client_data = 0;
+
+ rc = msm_rpc_call(snd->ept,
+ SND_HPH_AMP_CTL_PROC,
+ &hph_amp_msg, sizeof(hph_amp_msg), 5 * HZ);
+
+ mutex_unlock(&snd->lock);
+
+ return rc;
+}
+
static DEVICE_ATTR(agc, S_IWUSR | S_IRUGO,
NULL, snd_agc_store);
@@ -591,6 +685,16 @@
static DEVICE_ATTR(volume, S_IWUSR | S_IRUGO,
NULL, snd_vol_store);
+static ssize_t print_snd_dev_name(struct switch_dev *sdev, char *buf)
+{
+ return sprintf(buf, "%s\n", "dev,ear_mute,mic_mute");
+}
+
+static ssize_t print_snd_dev_state(struct switch_dev *sdev, char *buf)
+{
+ return sprintf(buf, "%d,%d,%d\n", keep_snd_dev_info[SND_DEV], keep_snd_dev_info[EAR_MUTE], keep_snd_dev_info[MIC_MUTE]);
+}
+
static int snd_probe(struct platform_device *pdev)
{
struct snd_ctxt *snd = &the_snd;
@@ -639,6 +743,13 @@
&dev_attr_device);
misc_deregister(&snd_misc);
}
+
+ snd->snd_dev_info.name = "snd_debug";
+ snd->snd_dev_info.print_name = print_snd_dev_name;
+ snd->snd_dev_info.print_state = print_snd_dev_state;
+ rc = switch_dev_register(&snd->snd_dev_info);
+ if (rc < 0)
+ switch_dev_unregister(&snd->snd_dev_info);
return rc;
}
diff -urB -x .git msm/arch/arm/mach-msm/rpc_hsusb.c zte/arch/arm/mach-msm/rpc_hsusb.c
--- msm/arch/arm/mach-msm/rpc_hsusb.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/rpc_hsusb.c Mon Oct 18 11:33:10 2010
@@ -47,6 +47,7 @@
unsigned long reset_rework_installed;
unsigned long enable_pmic_ulpi_data0;
unsigned long disable_pmic_ulpi_data0;
+ unsigned long get_usb_conf_nv_value;
};
static struct msm_hsusb_rpc_ids usb_rpc_ids;
@@ -66,6 +67,7 @@
usb_rpc_ids.reset_rework_installed = 17;
usb_rpc_ids.enable_pmic_ulpi_data0 = 18;
usb_rpc_ids.disable_pmic_ulpi_data0 = 19;
+ usb_rpc_ids.get_usb_conf_nv_value = 99;
return 0;
} else if (vers == 0x00010002) {
usb_rpc_ids.prog = 0x30000064;
@@ -79,6 +81,7 @@
usb_rpc_ids.reset_rework_installed = 17;
usb_rpc_ids.enable_pmic_ulpi_data0 = 18;
usb_rpc_ids.disable_pmic_ulpi_data0 = 19;
+ usb_rpc_ids.get_usb_conf_nv_value = 99;
return 0;
} else {
printk(KERN_INFO "%s: no matches found for version\n",
@@ -358,6 +361,51 @@
return rc;
}
EXPORT_SYMBOL(msm_hsusb_is_serial_num_null);
+int msm_hsusb_get_set_usb_conf_nv_value(uint32_t nv_item,uint32_t value,uint32_t is_write)
+{
+ int rc = 0;
+ struct hsusb_phy_start_req {
+ struct rpc_request_hdr hdr;
+ uint32_t nv_item;
+ uint32_t value;
+ uint32_t is_write;
+ } req;
+ struct nv23_value_rep {
+ struct rpc_reply_hdr hdr;
+ int value;
+ } rep;
+ if (!usb_ep || IS_ERR(usb_ep)) {
+ printk(KERN_ERR "%s: rpc connect failed: rc = %ld\n",
+ __func__, PTR_ERR(usb_ep));
+ return -EAGAIN;
+ }
+ if (!usb_rpc_ids.get_usb_conf_nv_value) {
+ printk(KERN_ERR "%s: proc id not supported \n", __func__);
+ return -ENODATA;
+ }
+ req.nv_item = cpu_to_be32(nv_item);
+ req.value = cpu_to_be32(value);
+ req.is_write =cpu_to_be32(is_write);
+ rc = msm_rpc_call_reply(usb_ep, usb_rpc_ids.get_usb_conf_nv_value,
+ &req, sizeof(req),
+ &rep, sizeof(rep),
+ 5 * HZ);
+ printk("======return value=%d \n\n",be32_to_cpu(rep.value));
+ if (rc < 0)
+ {
+ printk(KERN_ERR "%s: rpc call failed! error: %d\n" ,
+ __func__, rc);
+ return rc;
+ }
+ else
+ {
+ printk(KERN_ERR "%s: rpc call success\n" ,
+ __func__);
+ }
+ rc = be32_to_cpu(rep.value);
+ return rc;
+}
+EXPORT_SYMBOL(msm_hsusb_get_set_usb_conf_nv_value);
int msm_chg_usb_charger_connected(uint32_t device)
{
diff -urB -x .git msm/arch/arm/mach-msm/rpc_pmapp.c zte/arch/arm/mach-msm/rpc_pmapp.c
--- msm/arch/arm/mach-msm/rpc_pmapp.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/rpc_pmapp.c Mon Oct 18 11:33:34 2010
@@ -260,10 +260,6 @@
int msm_pm_app_rpc_init(void)
{
- if (!machine_is_qsd8x50_ffa() && !machine_is_qsd8x50a_ffa()
- && !machine_is_msm7x27_ffa())
- return -ENOTSUPP;
-
boost_vreg = vreg_get(NULL, "boost");
if (IS_ERR(boost_vreg)) {
pr_err("%s: boost vreg get failed\n", __func__);
Only in zte/arch/arm/mach-msm: smd_rpc_sym.c
diff -urB -x .git msm/arch/arm/mach-msm/smem_log.c zte/arch/arm/mach-msm/smem_log.c
--- msm/arch/arm/mach-msm/smem_log.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/smem_log.c Mon Oct 18 11:35:16 2010
@@ -72,6 +73,8 @@
#include <linux/sched.h>
#include <linux/wait.h>
#include <linux/delay.h>
+#include <linux/zte_memlog.h>
+#include <linux/vmalloc.h>
#include <mach/msm_iomap.h>
#include <mach/smem_log.h>
@@ -111,7 +114,7 @@
uint32_t data3;
};
-#define SMEM_LOG_NUM_ENTRIES 2000
+#define SMEM_LOG_NUM_ENTRIES 20000
#define SMEM_LOG_EVENTS_SIZE (sizeof(struct smem_log_item) * \
SMEM_LOG_NUM_ENTRIES)
@@ -154,6 +157,27 @@
static struct smem_log_inst inst[NUM];
+typedef struct {
+ uint32_t magic;
+ struct {
+ volatile uint32_t smem_log_write_idx;
+ volatile uint32_t smem_log_write_wrap;
+ } log_area_info[NUM];
+} smem_log_info;
+
+static smem_log_info *log_info;
+
+#define SMEM_LOG_MPROC_OFFSET SMEM_LOG_ENTRY_OFFSET
+#define SMEM_LOG_STATIC_OFFSET (SMEM_LOG_MPROC_OFFSET + SMEM_LOG_EVENTS_SIZE)
+#define SMEM_LOG_POWER_OFFSET (SMEM_LOG_STATIC_OFFSET + SMEM_STATIC_LOG_EVENTS_SIZE)
+static uint32_t log_area_offset[NUM] = {
+ SMEM_LOG_MPROC_OFFSET,
+ SMEM_LOG_STATIC_OFFSET,
+ SMEM_LOG_POWER_OFFSET
+};
+
+#define SMEM_MAGIC 0xdeadbeef
+
#if defined(CONFIG_DEBUG_FS)
#define HSIZE 13
@@ -846,16 +870,19 @@
{
int ret;
- inst[GEN].which_log = GEN;
- inst[GEN].events =
- (struct smem_log_item *)smem_alloc(SMEM_SMEM_LOG_EVENTS,
- SMEM_LOG_EVENTS_SIZE);
- inst[GEN].idx = (uint32_t *)smem_alloc(SMEM_SMEM_LOG_IDX,
- sizeof(uint32_t));
- if (!inst[GEN].events || !inst[GEN].idx) {
- pr_err("%s: no log or log_idx allocated, "
- "smem_log disabled\n", __func__);
+ log_info = (smem_log_info *)ioremap(MSM_SMEM_RAM_PHYS, MSM_SMEM_RAM_SIZE);
+ if (!log_info) {
+ pr_err("can't get remap MSM_RAM_CONSOLE_PHYS\n");
+ return -ENOMEM;
+ }
+ if (log_info->magic != SMEM_MAGIC) {
+ memset(log_info, 0, sizeof(*log_info));
+ log_info->magic = SMEM_MAGIC;
}
+
+ inst[GEN].which_log = GEN;
+ inst[GEN].events = (struct smem_log_item *)((uint32_t)log_info + log_area_offset[GEN]);
+ inst[GEN].idx = (uint32_t *)&(log_info->log_area_info[GEN].smem_log_write_idx);
inst[GEN].num = SMEM_LOG_NUM_ENTRIES;
inst[GEN].read_idx = 0;
inst[GEN].last_read_avail = SMEM_LOG_NUM_ENTRIES;
@@ -863,16 +890,8 @@
inst[GEN].remote_spinlock = &remote_spinlock;
inst[STA].which_log = STA;
- inst[STA].events =
- (struct smem_log_item *)
- smem_alloc(SMEM_SMEM_STATIC_LOG_EVENTS,
- SMEM_STATIC_LOG_EVENTS_SIZE);
- inst[STA].idx = (uint32_t *)smem_alloc(SMEM_SMEM_STATIC_LOG_IDX,
- sizeof(uint32_t));
- if (!inst[STA].events || !inst[STA].idx) {
- pr_err("%s: no static log or log_idx "
- "allocated, smem_log disabled\n", __func__);
- }
+ inst[STA].events = (struct smem_log_item *)((uint32_t)log_info + log_area_offset[STA]);
+ inst[STA].idx = (uint32_t *)&(log_info->log_area_info[STA].smem_log_write_idx);
inst[STA].num = SMEM_LOG_NUM_STATIC_ENTRIES;
inst[STA].read_idx = 0;
inst[STA].last_read_avail = SMEM_LOG_NUM_ENTRIES;
@@ -880,16 +899,8 @@
inst[STA].remote_spinlock = &remote_spinlock_static;
inst[POW].which_log = POW;
- inst[POW].events =
- (struct smem_log_item *)
- smem_alloc(SMEM_SMEM_LOG_POWER_EVENTS,
- SMEM_POWER_LOG_EVENTS_SIZE);
- inst[POW].idx = (uint32_t *)smem_alloc(SMEM_SMEM_LOG_POWER_IDX,
- sizeof(uint32_t));
- if (!inst[POW].events || !inst[POW].idx) {
- pr_err("%s: no power log or log_idx "
- "allocated, smem_log disabled\n", __func__);
- }
+ inst[POW].events = (struct smem_log_item *)((uint32_t)log_info + log_area_offset[POW]);
+ inst[POW].idx = (uint32_t *)&(log_info->log_area_info[POW].smem_log_write_idx);
inst[POW].num = SMEM_LOG_NUM_POWER_ENTRIES;
inst[POW].read_idx = 0;
inst[POW].last_read_avail = SMEM_LOG_NUM_ENTRIES;
@@ -1844,7 +1855,7 @@
return _debug_dump_voters(buf, max);
}
-static char debug_buffer[EVENTS_PRINT_SIZE];
+static char *debug_buffer = NULL;
static ssize_t debug_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
@@ -1852,11 +1863,24 @@
int r;
static int bsize;
int (*fill)(char *, int, uint32_t) = file->private_data;
+
+ /* Use vmalloc, __get_free_pages may fail. */
+ if (!debug_buffer) {
+ debug_buffer = (char *)vmalloc(EVENTS_PRINT_SIZE);
+ if (!debug_buffer)
+ return 0;
+ }
if (!(*ppos))
bsize = fill(debug_buffer, EVENTS_PRINT_SIZE, 0);
DBG("%s: count %d ppos %d\n", __func__, count, (unsigned int)*ppos);
r = simple_read_from_buffer(buf, count, ppos, debug_buffer,
bsize);
+ if (r == 0) {
+ if (debug_buffer) {
+ vfree(debug_buffer);
+ debug_buffer = NULL;
+ }
+ }
return r;
}
diff -urB -x .git msm/arch/arm/mach-msm/socinfo.c zte/arch/arm/mach-msm/socinfo.c
--- msm/arch/arm/mach-msm/socinfo.c Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/socinfo.c Fri Oct 15 17:41:38 2010
@@ -334,6 +334,31 @@
return snprintf(buf, PAGE_SIZE, "%-.32s\n", hw_platform[hw_type]);
}
+#ifdef CONFIG_ZTE_PLATFORM
+#ifdef CONFIG_ZTE_FTM_FLAG_SUPPORT
+static int g_zte_ftm_flag;
+void zte_ftm_set_value(int val)
+{
+ g_zte_ftm_flag = val;
+}
+int zte_get_ftm_flag(void)
+{
+ return g_zte_ftm_flag;
+}
+static ssize_t
+socinfo_show_zte_ftm(struct sys_device *dev,
+ struct sysdev_attribute *attr,
+ char *buf)
+{
+ return snprintf(buf, PAGE_SIZE, "%u\n", g_zte_ftm_flag);
+}
+
+static struct sysdev_attribute socinfo_zte_ftm_files[] = {
+ _SYSDEV_ATTR(zte_ftm_flag, 0444, socinfo_show_zte_ftm, NULL),
+};
+#endif
+#endif
+
static ssize_t
socinfo_show_platform_version(struct sys_device *dev,
struct sysdev_attribute *attr,
@@ -413,6 +438,13 @@
__func__, err);
return;
}
+#ifdef CONFIG_ZTE_PLATFORM
+#ifdef CONFIG_ZTE_FTM_FLAG_SUPPORT
+ socinfo_create_files(&soc_sys_device, socinfo_zte_ftm_files,
+ ARRAY_SIZE(socinfo_zte_ftm_files));
+#endif
+#endif
+
socinfo_create_files(&soc_sys_device, socinfo_v1_files,
ARRAY_SIZE(socinfo_v1_files));
if (socinfo->v1.format < 2)
diff -urB -x .git msm/arch/arm/mach-msm/socinfo.h zte/arch/arm/mach-msm/socinfo.h
--- msm/arch/arm/mach-msm/socinfo.h Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mach-msm/socinfo.h Wed Oct 13 18:07:20 2010
@@ -50,6 +50,11 @@
};
enum msm_cpu socinfo_get_msm_cpu(void);
+#ifdef CONFIG_ZTE_PLATFORM
+#ifdef CONFIG_ZTE_FTM_FLAG_SUPPORT
+void zte_ftm_set_value(int val);
+#endif
+#endif
uint32_t socinfo_get_id(void);
uint32_t socinfo_get_version(void);
char *socinfo_get_build_id(void);
diff -urB -x .git msm/arch/arm/mm/Kconfig zte/arch/arm/mm/Kconfig
--- msm/arch/arm/mm/Kconfig Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/mm/Kconfig Wed Oct 13 18:07:42 2010
@@ -719,7 +719,7 @@
config CACHE_L2X0
bool "Enable the L2x0 outer cache controller"
- depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || REALVIEW_EB_A9MP || MACH_MSM7X27_SURF || MACH_MSM7X27_FFA
+ depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || REALVIEW_EB_A9MP || MACH_MSM7X27_SURF || MACH_MSM7X27_FFA || ZTE_PLATFORM
default y
select OUTER_CACHE
help
diff -urB -x .git msm/arch/arm/tools/mach-types zte/arch/arm/tools/mach-types
--- msm/arch/arm/tools/mach-types Mon Nov 1 13:46:22 2010
+++ zte/arch/arm/tools/mach-types Wed Oct 13 18:07:10 2010
@@ -2140,3 +2140,9 @@
qsd8x50_ffa MACH_QSD8X50_FFA QSD8X50_FFA 1008002
qsd8x50a_surf MACH_QSD8X50A_SURF QSD8X50A_SURF 1008003
qsd8x50a_ffa MACH_QSD8X50A_FFA QSD8X50A_FFA 1008004
+raise MACH_RAISE RAISE 1009001
+mooncake MACH_MOONCAKE MOONCAKE 1009002
+joe MACH_JOE JOE 1009003
+blade MACH_BLADE BLADE 1009004
+smooth MACH_SMOOTH SMOOTH 1009005
+r750 MACH_R750 R750 1009006
Only in zte/drivers/char: consolemap_deftbl.c
Only in zte/drivers/char: defkeymap.c
diff -urB -x .git msm/drivers/char/msm_kgsl/kgsl.c zte/drivers/char/msm_kgsl/kgsl.c
--- msm/drivers/char/msm_kgsl/kgsl.c Mon Nov 1 14:41:52 2010
+++ zte/drivers/char/msm_kgsl/kgsl.c Mon Oct 18 11:37:40 2010
@@ -253,10 +254,6 @@
if (kgsl_driver.clk_freq[KGSL_3D_MIN_FREQ])
clk_set_min_rate(kgsl_driver.yamato_grp_src_clk,
kgsl_driver.clk_freq[KGSL_3D_MIN_FREQ]);
- if ((kgsl_driver.g12_device.hwaccess_blocked ==
- KGSL_TRUE) ||
- (kgsl_driver.power_flags &
- KGSL_PWRFLAGS_G12_CLK_OFF))
pm_qos_update_requirement(
PM_QOS_SYSTEM_BUS_FREQ,
DRIVER_NAME, PM_QOS_DEFAULT_VALUE);
diff -urB -x .git msm/drivers/char/vt.c zte/drivers/char/vt.c
--- msm/drivers/char/vt.c Mon Nov 1 12:09:49 2010
+++ zte/drivers/char/vt.c Mon Oct 18 11:38:14 2010
@@ -1617,7 +1618,7 @@
vc->vc_decscnm = 0;
vc->vc_decom = 0;
vc->vc_decawm = 1;
- vc->vc_deccm = 1;
+ vc->vc_deccm = 0;
vc->vc_decim = 0;
set_kbd(vc, decarm);
diff -urB -x .git msm/drivers/i2c/busses/i2c-gpio.c zte/drivers/i2c/busses/i2c-gpio.c
--- msm/drivers/i2c/busses/i2c-gpio.c Mon Nov 1 12:09:51 2010
+++ zte/drivers/i2c/busses/i2c-gpio.c Fri Oct 15 17:52:16 2010
@@ -128,8 +129,10 @@
else if (pdata->scl_is_output_only)
bit_data->udelay = 50; /* 10 kHz */
else
+ #if 0
bit_data->udelay = 5; /* 100 kHz */
-
+ #endif
+ bit_data->udelay = 2; /* 400 kHz */
if (pdata->timeout)
bit_data->timeout = pdata->timeout;
else
diff -urB -x .git msm/drivers/i2c/busses/i2c-msm.c zte/drivers/i2c/busses/i2c-msm.c
--- msm/drivers/i2c/busses/i2c-msm.c Mon Nov 1 14:29:40 2010
+++ zte/drivers/i2c/busses/i2c-msm.c Mon Oct 18 11:41:24 2010
@@ -601,11 +601,22 @@
ret = -ENOSYS;
goto err_clk_get_failed;
}
- if (!pdata->msm_i2c_config_gpio) {
- dev_err(&pdev->dev, "config_gpio function not initialized\n");
- ret = -ENOSYS;
- goto err_clk_get_failed;
+
+#ifdef CONFIG_ZTE_PLATFORM
+ {
+ printk(KERN_INFO" Warning: msm on-chip aux i2c bus disabled on Board mooncake!\n");
+ }
+#else
+ {
+ if (!pdata->msm_i2c_config_gpio) {
+
+ dev_err(&pdev->dev, "config_gpio function not initialized\n");
+ ret = -ENOSYS;
+ goto err_clk_get_failed;
+ }
}
+#endif
+
/* We support frequencies upto FAST Mode(400KHz) */
if (pdata->clk_freq <= 0 || pdata->clk_freq > 400000) {
dev_err(&pdev->dev, "clock frequency not supported\n");
@@ -666,19 +677,27 @@
goto err_i2c_add_adapter_failed;
}
- i2c_set_adapdata(&dev->adap_aux, dev);
- dev->adap_aux.algo = &msm_i2c_algo;
- strlcpy(dev->adap_aux.name,
- "MSM I2C adapter-AUX",
- sizeof(dev->adap_aux.name));
-
- dev->adap_aux.nr = pdev->id + 1;
- ret = i2c_add_numbered_adapter(&dev->adap_aux);
- if (ret) {
- dev_err(&pdev->dev, "auxiliary i2c_add_adapter failed\n");
- i2c_del_adapter(&dev->adap_pri);
- goto err_i2c_add_adapter_failed;
+
+#ifdef CONFIG_ZTE_PLATFORM
+ {
+ }
+#else
+ {
+ i2c_set_adapdata(&dev->adap_aux, dev);
+ dev->adap_aux.algo = &msm_i2c_algo;
+ strlcpy(dev->adap_aux.name,
+ "MSM I2C adapter-AUX",
+ sizeof(dev->adap_aux.name));
+
+ dev->adap_aux.nr = pdev->id + 1;
+ ret = i2c_add_numbered_adapter(&dev->adap_aux);
+ if (ret) {
+ dev_err(&pdev->dev, "auxiliary i2c_add_adapter failed\n");
+ i2c_del_adapter(&dev->adap_pri);
+ goto err_i2c_add_adapter_failed;
+ }
}
+#endif
ret = request_irq(dev->irq, msm_i2c_interrupt,
IRQF_TRIGGER_RISING, pdev->name, dev);
if (ret) {
@@ -693,10 +712,17 @@
dev->clk_state = 0;
/* Config GPIOs for primary and secondary lines */
pdata->msm_i2c_config_gpio(dev->adap_pri.nr, 1);
- pdata->msm_i2c_config_gpio(dev->adap_aux.nr, 1);
+
+#ifdef CONFIG_ZTE_PLATFORM
+ {
+ }
+#else
+ {
+ pdata->msm_i2c_config_gpio(dev->adap_aux.nr, 1);
+ }
+#endif
clk_disable(dev->clk);
setup_timer(&dev->pwr_timer, msm_i2c_pwr_timer, (unsigned long) dev);
-
return 0;
/* free_irq(dev->irq, dev); */
diff -urB -x .git msm/drivers/i2c/chips/Kconfig zte/drivers/i2c/chips/Kconfig
--- msm/drivers/i2c/chips/Kconfig Mon Nov 1 13:46:22 2010
+++ zte/drivers/i2c/chips/Kconfig Wed Oct 13 18:15:50 2010
@@ -102,11 +102,35 @@
This driver can also be built as a module. If so, the module
will be called tsl2550.
+config SENSORS_TSL2771
+ tristate "Taos TSL2771 ambient light and prox sensor"
+ depends on I2C
+ default n
+ help
+ If you say yes here you get support for the Taos TSL2771
+ ambient light and prox sensor.
+
+config SENSORS_AK8973
+ tristate "AK8973"
+ depends on I2C
+ default n
+ help
+ If you say yes here you get support for Asahi Kasei's
+ orientation sensor AK8973.
+
config SENSORS_AKM8976
tristate "AKM8976 Compass Driver"
depends on I2C
help
AKM8976 Compass Driver implemented by HTC.
+
+config SENSOR_LIS302DL
+ tristate "ST LIS302DL acceleration sensor support"
+ depends on I2C
+ default y
+ help
+ if your say yes here your get support for LIS302
+ acceleration sensor support
config SENSORS_PCA963X
tristate "Philips PCA963X 4-bit I2C-bus LED"
diff -urB -x .git msm/drivers/i2c/chips/Makefile zte/drivers/i2c/chips/Makefile
--- msm/drivers/i2c/chips/Makefile Mon Nov 1 13:46:22 2010
+++ zte/drivers/i2c/chips/Makefile Wed Oct 13 18:15:50 2010
@@ -18,9 +18,12 @@
obj-$(CONFIG_SENSORS_PCF8574) += pcf8574.o
obj-$(CONFIG_PCF8575) += pcf8575.o
obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o
+obj-$(CONFIG_SENSORS_AK8973) += akm8973.o
obj-$(CONFIG_SENSORS_TSL2550) += tsl2550.o
obj-$(CONFIG_SENSORS_MT9T013) += mt9t013.o
+obj-$(CONFIG_SENSOR_LIS302DL) += lis302dl.o
+obj-$(CONFIG_SENSORS_TSL2771) += taos.o
ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
EXTRA_CFLAGS += -DDEBUG
endif
Only in zte/drivers/i2c/chips: akm8973.c
Only in zte/drivers/i2c/chips: lis302dl.c
Only in zte/drivers/i2c/chips: taos.c
Only in zte/drivers/i2c/chips: taos_common.h
diff -urB -x .git msm/drivers/input/misc/gpio_matrix.c zte/drivers/input/misc/gpio_matrix.c
--- msm/drivers/input/misc/gpio_matrix.c Mon Nov 1 13:46:22 2010
+++ zte/drivers/input/misc/gpio_matrix.c Mon Oct 18 11:59:02 2010
@@ -20,6 +20,14 @@
#include <linux/interrupt.h>
#include <linux/wakelock.h>
+#if defined(CONFIG_MACH_R750)
+#define TS_KEY_REPORT
+#endif
+
+#if defined(CONFIG_MACH_SMOOTH)
+#define FLIP_DET
+#endif
+
struct gpio_kp {
struct input_dev *input_dev;
struct gpio_event_matrix_info *keypad_info;
@@ -33,6 +41,55 @@
unsigned long keys_pressed[0];
};
+#ifdef FLIP_DET
+#define FLIP_DET_IRQ MSM_GPIO_TO_INT(49)
+
+static irqreturn_t flip_detect_irq_handler(int irq, void *dev_id)
+{
+ struct gpio_kp *kp = dev_id;
+
+ disable_irq_nosync(irq);
+
+ if(gpio_get_value(49) == 0)
+ {
+ input_report_key(kp->input_dev, KEY_FLIP_DOWN, 1);
+ input_report_key(kp->input_dev, KEY_FLIP_DOWN, 0);
+ }
+ else
+ {
+ input_report_key(kp->input_dev, KEY_FLIP_UP, 1);
+ input_report_key(kp->input_dev, KEY_FLIP_UP, 0);
+ }
+
+ enable_irq(irq);
+ return IRQ_HANDLED;
+}
+
+static int slip_detect_init(struct gpio_kp *kp)
+{
+ int err;
+
+ err = request_irq(FLIP_DET_IRQ, flip_detect_irq_handler, (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING), "gpio-event", kp);//ZTE_KEY_ZT_20100513_003
+ if (err)
+ {
+ pr_err("gpiomatrix: request_irq failed for flip detect\n");
+ goto err_request_irq_failed;
+ }
+
+ err = set_irq_wake(FLIP_DET_IRQ, 1);
+ if (err)
+ {
+ pr_err("gpiomatrix: request_irq failed for flip detect\n");
+ goto err_request_irq_failed;
+ }
+ return 0;
+
+err_request_irq_failed:
+ free_irq(FLIP_DET_IRQ, kp);
+ return 1;
+}
+#endif
+
static void clear_phantom_key(struct gpio_kp *kp, int out, int in)
{
struct gpio_event_matrix_info *mi = kp->keypad_info;
@@ -131,7 +188,11 @@
struct gpio_kp *kp = container_of(timer, struct gpio_kp, timer);
struct gpio_event_matrix_info *mi = kp->keypad_info;
unsigned gpio_keypad_flags = mi->flags;
+#ifdef CONFIG_ZTE_PLATFORM
+ unsigned polarity = !!(gpio_keypad_flags & !GPIOKPF_ACTIVE_HIGH);
+#else
unsigned polarity = !!(gpio_keypad_flags & GPIOKPF_ACTIVE_HIGH);
+#endif
out = kp->current_output;
if (out == mi->noutputs) {
@@ -218,7 +279,12 @@
for (i = 0; i < mi->noutputs; i++) {
if (gpio_keypad_flags & GPIOKPF_DRIVE_INACTIVE)
gpio_set_value(mi->output_gpios[i],
+#ifdef CONFIG_ZTE_PLATFORM
+ (gpio_keypad_flags & GPIOKPF_ACTIVE_HIGH));
+#else
!(gpio_keypad_flags & GPIOKPF_ACTIVE_HIGH));
+#endif
+
else
gpio_direction_input(mi->output_gpios[i]);
}
@@ -246,7 +312,12 @@
request_flags = IRQF_TRIGGER_LOW;
break;
case GPIOKPF_LEVEL_TRIGGERED_IRQ | GPIOKPF_ACTIVE_HIGH:
+#ifdef CONFIG_ZTE_PLATFORM
+ request_flags = IRQF_TRIGGER_LOW;
+#else
request_flags = IRQF_TRIGGER_HIGH;
+#endif
+
break;
}
@@ -261,11 +332,13 @@
"irq %d\n", mi->input_gpios[i], irq);
goto err_request_irq_failed;
}
+#ifndef CONFIG_ZTE_PLATFORM
err = set_irq_wake(irq, 1);
if (err) {
pr_err("gpiomatrix: set_irq_wake failed for input %d, "
"irq %d\n", mi->input_gpios[i], irq);
}
+#endif
disable_irq(irq);
}
return 0;
@@ -279,6 +352,16 @@
return err;
}
+#ifdef TS_KEY_REPORT
+struct input_dev *input_keypad_dev = NULL;
+
+struct input_dev *get_keyinput_dev(void)
+{
+ return input_keypad_dev;
+}
+EXPORT_SYMBOL(get_keyinput_dev);
+#endif
+
int gpio_event_matrix_func(struct input_dev *input_dev,
struct gpio_event_info *info, void **data, int func)
{
@@ -319,6 +402,18 @@
__set_bit(mi->keymap[i], input_dev->keybit);
}
+#ifdef TS_KEY_REPORT
+ __set_bit(KEY_MENU, input_dev->keybit);
+ __set_bit(KEY_HOME, input_dev->keybit);
+ __set_bit(KEY_BACK, input_dev->keybit);
+ input_keypad_dev = kp->input_dev;
+#endif
+
+#ifdef FLIP_DET
+ __set_bit(KEY_FLIP_UP, input_dev->keybit);
+ __set_bit(KEY_FLIP_DOWN, input_dev->keybit);
+#endif
+
for (i = 0; i < mi->noutputs; i++) {
if (gpio_cansleep(mi->output_gpios[i])) {
pr_err("gpiomatrix: unsupported output gpio %d,"
@@ -334,7 +429,11 @@
}
if (mi->flags & GPIOKPF_DRIVE_INACTIVE)
err = gpio_direction_output(mi->output_gpios[i],
+#ifdef CONFIG_ZTE_PLATFORM
+ (mi->flags & GPIOKPF_ACTIVE_HIGH));
+#else
!(mi->flags & GPIOKPF_ACTIVE_HIGH));
+#endif
else
err = gpio_direction_input(mi->output_gpios[i]);
if (err) {
@@ -375,6 +474,11 @@
hrtimer_start(&kp->timer, ktime_set(0, 10000),
HRTIMER_MODE_REL);
+#ifdef FLIP_DET
+ err = slip_detect_init(kp);
+ if (err != 0)
+ pr_info("PIO Matrix Keypad Driver: init for slip detect failed\n");
+#endif
return 0;
}
diff -urB -x .git msm/drivers/input/mouse/Kconfig zte/drivers/input/mouse/Kconfig
--- msm/drivers/input/mouse/Kconfig Mon Nov 1 13:46:22 2010
+++ zte/drivers/input/mouse/Kconfig Fri Oct 15 18:22:42 2010
@@ -321,4 +321,19 @@
help
Say Y here to support PXA930 Trackball mouse.
+config AVAGO_OFN
+ tristate "AVAGO OFN(Optical Finger Navigation)"
+ depends on I2C_MSM && MACH_RAISE
+ default y
+ help
+ Say Y here if you have a ofn attached.
+ To compile this driver as a module, choose M here
+
+config JOGBALL_KEY
+ tristate "JOGBALL UP/DOWN/LEFT/RIGHT"
+ default n
+ help
+ Say Y here if you have a jogball attached.
+ To compile this driver as a module, choose M here
+
endif
diff -urB -x .git msm/drivers/input/mouse/Makefile zte/drivers/input/mouse/Makefile
--- msm/drivers/input/mouse/Makefile Mon Nov 1 13:46:22 2010
+++ zte/drivers/input/mouse/Makefile Fri Oct 15 18:23:00 2010
@@ -21,6 +21,8 @@
obj-$(CONFIG_MOUSE_OFN_ATLAB) += ofn_atlab.o
obj-$(CONFIG_MOUSE_OFN_ATLAB_M33C01) += ofn_m33c01_atlab.o
obj-$(CONFIG_MOUSE_GPIO) += gpio_mouse.o
+obj-$(CONFIG_AVAGO_OFN) += avago_ofn.o
+obj-$(CONFIG_JOGBALL_KEY) += jogball_key.o
psmouse-objs := psmouse-base.o synaptics.o
Only in zte/drivers/input/mouse: avago_ofn.c
Only in zte/drivers/input/mouse: jogball_key.c
diff -urB -x .git msm/drivers/input/touchscreen/Kconfig zte/drivers/input/touchscreen/Kconfig
--- msm/drivers/input/touchscreen/Kconfig Mon Nov 1 13:46:22 2010
+++ zte/drivers/input/touchscreen/Kconfig Sat Oct 16 11:16:26 2010
@@ -1,4 +1,4 @@
-#
+
# Touchscreen driver configuration
#
menuconfig INPUT_TOUCHSCREEN
@@ -201,7 +201,7 @@
config TOUCHSCREEN_MSM
bool "Qualcomm MSM touchscreen controller"
- depends on ARCH_MSM7X30
+#depends on ARCH_MSM7X30
default n
help
Say Y here if you have a 4-wire resistive touchscreen panel
@@ -447,5 +447,9 @@
MSM/QSD based Surf or FFAs. These hacks are required inorder
to Android framework to receive adjusted x, y co-ordinates
until proper calibration framework is in place.
-
+config TOUCHSCREEN_CYPRESS_I2C_RMI
+ tristate "Cypress i2c touchscreen"
+ depends on I2C
+ help
+ This enables support for Cypress RMI over I2C based touchscreens.
endif
diff -urB -x .git msm/drivers/input/touchscreen/Makefile zte/drivers/input/touchscreen/Makefile
--- msm/drivers/input/touchscreen/Makefile Mon Nov 1 13:46:22 2010
+++ zte/drivers/input/touchscreen/Makefile Sat Oct 16 11:15:50 2010
@@ -38,3 +40,4 @@
wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9713) += wm9713.o
obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE) += mainstone-wm97xx.o
obj-$(CONFIG_TOUCHSCREEN_MSM_LEGACY) += msm_touch.o
+obj-$(CONFIG_TOUCHSCREEN_CYPRESS_I2C_RMI) += cypress_i2c_rmi.o
Only in zte/drivers/input/touchscreen: cypress_i2c_rmi.c
diff -urB -x .git msm/drivers/input/touchscreen/msm_ts.c zte/drivers/input/touchscreen/msm_ts.c
--- msm/drivers/input/touchscreen/msm_ts.c Mon Nov 1 13:46:22 2010
+++ zte/drivers/input/touchscreen/msm_ts.c Mon Oct 18 12:10:16 2010
@@ -27,6 +28,7 @@
#include <linux/mfd/marimba-tsadc.h>
#include <mach/msm_ts.h>
+#include <linux/jiffies.h>
#define TSSC_CTL 0x100
#define TSSC_CTL_PENUP_IRQ (1 << 12)
@@ -51,6 +53,7 @@
#define TSSC_TEST_1 0x198
#define TSSC_TEST_1_EN_GATE_DEBOUNCE (1 << 2)
#define TSSC_TEST_2 0x19c
+#define TS_PENUP_TIMEOUT_MS 70 // 20 --> 70
struct msm_ts {
struct msm_ts_platform_data *pdata;
@@ -58,7 +61,7 @@
void __iomem *tssc_base;
uint32_t ts_down:1;
struct ts_virt_key *vkey_down;
- struct marimba_tsadc_client *ts_client;
+ struct timer_list timer;
};
static uint32_t msm_tsdebug;
@@ -70,29 +73,19 @@
static void setup_next_sample(struct msm_ts *ts)
{
uint32_t tmp;
-
- /* 1.2ms debounce time */
- tmp = ((2 << 7) | TSSC_CTL_DEBOUNCE_EN | TSSC_CTL_EN_AVERAGE |
+ /* 3ms debounce time */
+ tmp = ((5 << 7) | TSSC_CTL_DEBOUNCE_EN | TSSC_CTL_EN_AVERAGE |
TSSC_CTL_MODE_MASTER | TSSC_CTL_ENABLE);
tssc_writel(ts, tmp, TSSC_CTL);
}
-static struct ts_virt_key *find_virt_key(struct msm_ts *ts,
- struct msm_ts_virtual_keys *vkeys,
- uint32_t val)
-{
- int i;
-
- if (!vkeys)
- return NULL;
- for (i = 0; i < vkeys->num_keys; ++i)
- if ((val >= vkeys->keys[i].min) && (val <= vkeys->keys[i].max))
- return &vkeys->keys[i];
- return NULL;
+static void ts_timer(unsigned long arg)
+{
+ struct msm_ts *ts = (struct msm_ts *)arg;
+ input_report_key(ts->input_dev, BTN_TOUCH, 0);
+ input_sync(ts->input_dev);
}
-
-
static irqreturn_t msm_ts_irq(int irq, void *dev_id)
{
struct msm_ts *ts = dev_id;
@@ -102,7 +95,8 @@
int x, y, z1, z2;
int was_down;
int down;
-
+ int z=0;
+ del_timer_sync(&ts->timer);
tssc_ctl = tssc_readl(ts, TSSC_CTL);
tssc_status = tssc_readl(ts, TSSC_STATUS);
tssc_avg12 = tssc_readl(ts, TSSC_AVG_12);
@@ -132,71 +126,35 @@
if (msm_tsdebug & 2)
printk("%s: down=%d, x=%d, y=%d, z1=%d, z2=%d, status %x\n",
__func__, down, x, y, z1, z2, tssc_status);
-
- if (!was_down && down) {
- struct ts_virt_key *vkey = NULL;
-
- if (pdata->vkeys_y && (y > pdata->virt_y_start))
- vkey = find_virt_key(ts, pdata->vkeys_y, x);
- if (!vkey && ts->pdata->vkeys_x && (x > pdata->virt_x_start))
- vkey = find_virt_key(ts, pdata->vkeys_x, y);
-
- if (vkey) {
- WARN_ON(ts->vkey_down != NULL);
- if(msm_tsdebug)
- printk("%s: virtual key down %d\n", __func__,
- vkey->key);
- ts->vkey_down = vkey;
- input_report_key(ts->input_dev, vkey->key, 1);
- input_sync(ts->input_dev);
- return IRQ_HANDLED;
+ if (down)
+ {
+ if ( 0 == z1 ) return IRQ_HANDLED;
+ z = ( ( z2 - z1 - 2)*x) / ( z1 + 2 );
+ z = ( 2500 - z ) * 1000 / ( 2500 - 900 );
+ if( z < 0 ) return IRQ_HANDLED;
}
- } else if (ts->vkey_down != NULL) {
- if (!down) {
- if(msm_tsdebug)
- printk("%s: virtual key up %d\n", __func__,
- ts->vkey_down->key);
- input_report_key(ts->input_dev, ts->vkey_down->key, 0);
- input_sync(ts->input_dev);
- ts->vkey_down = NULL;
- }
- return IRQ_HANDLED;
- }
+
- if (down) {
+ if (down)
+ {
input_report_abs(ts->input_dev, ABS_X, x);
input_report_abs(ts->input_dev, ABS_Y, y);
- input_report_abs(ts->input_dev, ABS_PRESSURE, z1);
+ input_report_abs(ts->input_dev, ABS_PRESSURE, z);
}
input_report_key(ts->input_dev, BTN_TOUCH, down);
input_sync(ts->input_dev);
+ if (30 == irq)mod_timer(&ts->timer,jiffies + msecs_to_jiffies(TS_PENUP_TIMEOUT_MS));
return IRQ_HANDLED;
}
-
-static void dump_tssc_regs(struct msm_ts *ts)
-{
-#define __dump_tssc_reg(r) \
- do { printk(#r " %x\n", tssc_readl(ts, (r))); } while(0)
-
- __dump_tssc_reg(TSSC_CTL);
- __dump_tssc_reg(TSSC_OPN);
- __dump_tssc_reg(TSSC_SAMPLING_INT);
- __dump_tssc_reg(TSSC_STATUS);
- __dump_tssc_reg(TSSC_AVG_12);
- __dump_tssc_reg(TSSC_AVG_34);
- __dump_tssc_reg(TSSC_TEST_1);
-#undef __dump_tssc_reg
-}
-
static int __devinit msm_ts_hw_init(struct msm_ts *ts)
{
+#if 0
uint32_t tmp;
/* Enable the register clock to tssc so we can configure it. */
tssc_writel(ts, TSSC_CTL_ENABLE, TSSC_CTL);
/* Enable software reset*/
- tssc_writel(ts, TSSC_CTL_SW_RESET, TSSC_CTL);
/* op1 - measure X, 1 sample, 12bit resolution */
tmp = (TSSC_OPN_4WIRE_X << 16) | (2 << 8) | (2 << 0);
@@ -215,8 +173,7 @@
tssc_writel(ts, 16, TSSC_SAMPLING_INT);
/* Enable gating logic to fix the timing delays caused because of
* enabling debounce logic */
- tssc_writel(ts, TSSC_TEST_1_EN_GATE_DEBOUNCE, TSSC_TEST_1);
-
+#endif
setup_next_sample(ts);
return 0;
@@ -230,8 +187,6 @@
struct resource *irq1_res;
struct resource *irq2_res;
int err = 0;
- int i;
- struct marimba_tsadc_client *ts_client;
tssc_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "tssc");
irq1_res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "tssc1");
@@ -261,7 +216,7 @@
err = -ENOMEM;
goto err_ioremap_tssc;
}
-
+#if 0
ts_client = marimba_tsadc_register(pdev, 1);
if (IS_ERR(ts_client)) {
err = -ENODEV;
@@ -276,7 +231,7 @@
pr_err("%s: Unable to start TSADC\n", __func__);
goto err_start_tsadc;
}
-
+#endif
ts->input_dev = input_allocate_device();
if (ts->input_dev == NULL) {
pr_err("failed to allocate touchscreen input device\n");
@@ -296,19 +251,13 @@
input_set_abs_params(ts->input_dev, ABS_PRESSURE, pdata->min_press,
pdata->max_press, 0, 0);
- for (i = 0; pdata->vkeys_x && (i < pdata->vkeys_x->num_keys); ++i)
- input_set_capability(ts->input_dev, EV_KEY,
- pdata->vkeys_x->keys[i].key);
- for (i = 0; pdata->vkeys_y && (i < pdata->vkeys_y->num_keys); ++i)
- input_set_capability(ts->input_dev, EV_KEY,
- pdata->vkeys_y->keys[i].key);
-
err = input_register_device(ts->input_dev);
if (err != 0) {
pr_err("%s: failed to register input device\n", __func__);
goto err_input_dev_reg;
}
+ setup_timer(&ts->timer, ts_timer, (unsigned long)ts);
msm_ts_hw_init(ts);
err = request_irq(irq1_res->start, msm_ts_irq,
@@ -331,7 +280,6 @@
pr_info("%s: tssc_base=%p irq1=%d irq2=%d\n", __func__,
ts->tssc_base, (int)irq1_res->start, (int)irq2_res->start);
- dump_tssc_regs(ts);
return 0;
err_request_irq2:
@@ -339,6 +287,7 @@
err_request_irq1:
/* disable the tssc */
+ del_timer_sync(&ts->timer);
tssc_writel(ts, TSSC_CTL_ENABLE, TSSC_CTL);
err_input_dev_reg:
@@ -346,17 +295,19 @@
input_free_device(ts->input_dev);
err_alloc_input_dev:
+#if 0
err_start_tsadc:
marimba_tsadc_unregister(ts->ts_client);
err_tsadc_register:
+#endif
iounmap(ts->tssc_base);
err_ioremap_tssc:
kfree(ts);
return err;
}
-
+#if 0
static int __devexit msm_ts_remove(struct platform_device *pdev)
{
struct msm_ts *ts = platform_get_drvdata(pdev);
@@ -376,28 +327,25 @@
return 0;
}
-
+#endif
static struct platform_driver msm_touchscreen_driver = {
.driver = {
.name = "msm_touchscreen",
.owner = THIS_MODULE,
},
.probe = msm_ts_probe,
- .remove = __devexit_p(msm_ts_remove),
};
static int __init msm_ts_init(void)
{
return platform_driver_register(&msm_touchscreen_driver);
}
-
+#if 0
static void __exit msm_ts_exit(void)
{
platform_driver_unregister(&msm_touchscreen_driver);
}
-
+#endif
device_initcall(msm_ts_init);
-module_exit(msm_ts_exit);
MODULE_DESCRIPTION("Qualcomm MSM/QSD Touchscreen controller driver");
MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:msm_touchscreen");
diff -urB -x .git msm/drivers/input/touchscreen/synaptics_i2c_rmi.c zte/drivers/input/touchscreen/synaptics_i2c_rmi.c
--- msm/drivers/input/touchscreen/synaptics_i2c_rmi.c Mon Nov 1 13:46:22 2010
+++ zte/drivers/input/touchscreen/synaptics_i2c_rmi.c Thu Oct 28 12:00:58 2010
@@ -21,33 +21,36 @@
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/io.h>
+#include <linux/proc_fs.h>
#include <linux/platform_device.h>
#include <linux/synaptics_i2c_rmi.h>
-
-#define swap(x, y) do { typeof(x) z = x; x = y; y = z; } while (0)
-
+#if 1
+#include <mach/gpio.h>
+#endif
+unsigned long polling_time = 30000000;
+#if defined(CONFIG_MACH_BLADE)//P729B touchscreen enable
+#define GPIO_TOUCH_EN_OUT 31
+#elif defined(CONFIG_MACH_R750)//R750 touchscreen enable
+#define GPIO_TOUCH_EN_OUT 33
+#else//other projects
+#define GPIO_TOUCH_EN_OUT 31
+#endif
static struct workqueue_struct *synaptics_wq;
+static struct i2c_driver synaptics_ts_driver;
+#define POLL_IN_INT
-struct synaptics_ts_data {
+struct synaptics_ts_data
+{
uint16_t addr;
struct i2c_client *client;
struct input_dev *input_dev;
int use_irq;
struct hrtimer timer;
+ struct hrtimer resume_timer;
struct work_struct work;
uint16_t max[2];
- int snap_state[2][2];
- int snap_down_on[2];
- int snap_down_off[2];
- int snap_up_on[2];
- int snap_up_off[2];
- int snap_down[2];
- int snap_up[2];
- uint32_t flags;
- int (*power)(int on);
struct early_suspend early_suspend;
};
-
#ifdef CONFIG_HAS_EARLYSUSPEND
static void synaptics_ts_early_suspend(struct early_suspend *h);
static void synaptics_ts_late_resume(struct early_suspend *h);
@@ -52,158 +55,149 @@
static void synaptics_ts_early_suspend(struct early_suspend *h);
static void synaptics_ts_late_resume(struct early_suspend *h);
#endif
+static int synaptics_i2c_read(struct i2c_client *client, int reg, u8 * buf, int count)
+{
+ int rc;
+ int ret = 0;
-static int synaptics_init_panel(struct synaptics_ts_data *ts)
+ buf[0] = 0xff;
+ buf[1] = reg >> 8;
+ rc = i2c_master_send(client, buf, 2);
+ if (rc != 2)
{
- int ret;
+ dev_err(&client->dev, "synaptics_i2c_read FAILED: failed of page select %d\n", rc);
+ ret = -1;
+ goto tp_i2c_rd_exit;
+ }
+ buf[0] = 0xff & reg;
+ rc = i2c_master_send(client, buf, 1);
+ if (rc != 1)
+ {
+ dev_err(&client->dev, "synaptics_i2c_read FAILED: read of register %d\n", reg);
+ ret = -1;
+ goto tp_i2c_rd_exit;
+ }
+ rc = i2c_master_recv(client, buf, count);
+ if (rc != count)
+ {
+ dev_err(&client->dev, "synaptics_i2c_read FAILED: read %d bytes from reg %d\n", count, reg);
+ ret = -1;
+ }
- ret = i2c_smbus_write_byte_data(ts->client, 0xff, 0x10); /* page select = 0x10 */
- if (ret < 0) {
- printk(KERN_ERR "i2c_smbus_write_byte_data failed for page select\n");
- goto err_page_select_failed;
+ tp_i2c_rd_exit:
+ return ret;
}
- ret = i2c_smbus_write_byte_data(ts->client, 0x41, 0x04); /* Set "No Clip Z" */
- if (ret < 0)
- printk(KERN_ERR "i2c_smbus_write_byte_data failed for No Clip Z\n");
-
-err_page_select_failed:
- ret = i2c_smbus_write_byte_data(ts->client, 0xff, 0x04); /* page select = 0x04 */
- if (ret < 0)
- printk(KERN_ERR "i2c_smbus_write_byte_data failed for page select\n");
- ret = i2c_smbus_write_byte_data(ts->client, 0xf0, 0x81); /* normal operation, 80 reports per second */
- if (ret < 0)
- printk(KERN_ERR "synaptics_ts_resume: i2c_smbus_write_byte_data failed\n");
+static int synaptics_i2c_write(struct i2c_client *client, int reg, u8 data)
+{
+ u8 buf[2];
+ int rc;
+ int ret = 0;
+
+ buf[0] = 0xff;
+ buf[1] = reg >> 8;
+ rc = i2c_master_send(client, buf, 2);
+ if (rc != 2)
+ {
+ dev_err(&client->dev, "synaptics_i2c_write FAILED: writing to reg %d\n", reg);
+ ret = -1;
+ }
+ buf[0] = 0xff & reg;
+ buf[1] = data;
+ rc = i2c_master_send(client, buf, 2);
+ if (rc != 2)
+ {
+ dev_err(&client->dev, "synaptics_i2c_write FAILED: writing to reg %d\n", reg);
+ ret = -1;
+ }
return ret;
}
+static int proc_read_val(char *page, char **start,
+ off_t off, int count, int *eof, void *data)
+{
+ int len;
+ len = sprintf(page, "%lu\n", polling_time);
+ return len;
+}
+static int proc_write_val(struct file *file, const char *buffer,
+ unsigned long count, void *data)
+{
+ unsigned long val;
+ sscanf(buffer, "%lu", &val);
+ if (val >= 0) {
+ polling_time= val;
+ return count;
+ }
+ return -EINVAL;
+}
static void synaptics_ts_work_func(struct work_struct *work)
{
- int i;
- int ret;
- int bad_data = 0;
- struct i2c_msg msg[2];
- uint8_t start_reg;
- uint8_t buf[15];
+ int ret, x, y, z, finger, w, x2, y2,w2,z2,finger2,pressure,pressure2;
+ uint8_t buf[16];
struct synaptics_ts_data *ts = container_of(work, struct synaptics_ts_data, work);
+ finger=0;
+ ret = synaptics_i2c_read(ts->client, 0x0014, buf, 16);
- msg[0].addr = ts->client->addr;
- msg[0].flags = 0;
- msg[0].len = 1;
- msg[0].buf = &start_reg;
- start_reg = 0x00;
- msg[1].addr = ts->client->addr;
- msg[1].flags = I2C_M_RD;
- msg[1].len = sizeof(buf);
- msg[1].buf = buf;
-
- /* printk("synaptics_ts_work_func\n"); */
- for (i = 0; i < ((ts->use_irq && !bad_data) ? 1 : 10); i++) {
- ret = i2c_transfer(ts->client->adapter, msg, 2);
- if (ret < 0) {
- printk(KERN_ERR "synaptics_ts_work_func: i2c_transfer failed\n");
- bad_data = 1;
- } else {
- /* printk("synaptics_ts_work_func: %x %x %x %x %x %x" */
- /* " %x %x %x %x %x %x %x %x %x, ret %d\n", */
- /* buf[0], buf[1], buf[2], buf[3], */
- /* buf[4], buf[5], buf[6], buf[7], */
- /* buf[8], buf[9], buf[10], buf[11], */
- /* buf[12], buf[13], buf[14], ret); */
- if ((buf[14] & 0xc0) != 0x40) {
- printk(KERN_WARNING "synaptics_ts_work_func:"
- " bad read %x %x %x %x %x %x %x %x %x"
- " %x %x %x %x %x %x, ret %d\n",
- buf[0], buf[1], buf[2], buf[3],
- buf[4], buf[5], buf[6], buf[7],
- buf[8], buf[9], buf[10], buf[11],
- buf[12], buf[13], buf[14], ret);
- if (bad_data)
- synaptics_init_panel(ts);
- bad_data = 1;
- continue;
- }
- bad_data = 0;
- if ((buf[14] & 1) == 0) {
- /* printk("read %d coordinates\n", i); */
- break;
- } else {
- int pos[2][2];
- int f, a;
- int base;
- /* int x = buf[3] | (uint16_t)(buf[2] & 0x1f) << 8; */
- /* int y = buf[5] | (uint16_t)(buf[4] & 0x1f) << 8; */
- int z = buf[1];
- int w = buf[0] >> 4;
- int finger = buf[0] & 7;
-
- /* int x2 = buf[3+6] | (uint16_t)(buf[2+6] & 0x1f) << 8; */
- /* int y2 = buf[5+6] | (uint16_t)(buf[4+6] & 0x1f) << 8; */
- /* int z2 = buf[1+6]; */
- /* int w2 = buf[0+6] >> 4; */
- /* int finger2 = buf[0+6] & 7; */
-
- /* int dx = (int8_t)buf[12]; */
- /* int dy = (int8_t)buf[13]; */
- int finger2_pressed;
-
- /* printk("x %4d, y %4d, z %3d, w %2d, F %d, 2nd: x %4d, y %4d, z %3d, w %2d, F %d, dx %4d, dy %4d\n", */
- /* x, y, z, w, finger, */
- /* x2, y2, z2, w2, finger2, */
- /* dx, dy); */
-
- base = 2;
- for (f = 0; f < 2; f++) {
- uint32_t flip_flag = SYNAPTICS_FLIP_X;
- for (a = 0; a < 2; a++) {
- int p = buf[base + 1];
- p |= (uint16_t)(buf[base] & 0x1f) << 8;
- if (ts->flags & flip_flag)
- p = ts->max[a] - p;
- if (ts->flags & SYNAPTICS_SNAP_TO_INACTIVE_EDGE) {
- if (ts->snap_state[f][a]) {
- if (p <= ts->snap_down_off[a])
- p = ts->snap_down[a];
- else if (p >= ts->snap_up_off[a])
- p = ts->snap_up[a];
- else
- ts->snap_state[f][a] = 0;
- } else {
- if (p <= ts->snap_down_on[a]) {
- p = ts->snap_down[a];
- ts->snap_state[f][a] = 1;
- } else if (p >= ts->snap_up_on[a]) {
- p = ts->snap_up[a];
- ts->snap_state[f][a] = 1;
- }
- }
- }
- pos[f][a] = p;
- base += 2;
- flip_flag <<= 1;
- }
- base += 2;
- if (ts->flags & SYNAPTICS_SWAP_XY)
- swap(pos[f][0], pos[f][1]);
- }
- if (z) {
- input_report_abs(ts->input_dev, ABS_X, pos[0][0]);
- input_report_abs(ts->input_dev, ABS_Y, pos[0][1]);
- }
- input_report_abs(ts->input_dev, ABS_PRESSURE, z);
- input_report_abs(ts->input_dev, ABS_TOOL_WIDTH, w);
- input_report_key(ts->input_dev, BTN_TOUCH, finger);
- finger2_pressed = finger > 1 && finger != 7;
- input_report_key(ts->input_dev, BTN_2, finger2_pressed);
- if (finger2_pressed) {
- input_report_abs(ts->input_dev, ABS_HAT0X, pos[1][0]);
- input_report_abs(ts->input_dev, ABS_HAT0Y, pos[1][1]);
- }
- input_sync(ts->input_dev);
- }
+ if (ret < 0)
+ {
+ printk(KERN_ERR "synaptics_ts_work_func: i2c_transfer failed\n");
+ }
+ else
+ {
+
+ x = (uint16_t) buf[2] << 4| (buf[4] & 0x0f) ;
+ y = (uint16_t) buf[3] << 4| ((buf[4] & 0xf0) >> 4);
+ pressure = buf[6];
+ w = buf[5] >> 4;
+ z = buf[5]&0x0f;
+ finger = buf[1] & 0x3;
+
+ x2 = (uint16_t) buf[7] << 4| (buf[9] & 0x0f) ;
+ y2 = (uint16_t) buf[8] << 4| ((buf[9] & 0xf0) >> 4);
+ pressure2 = buf[11];
+ w2 = buf[10] >> 4;
+ z2 = buf[10] & 0x0f;
+ finger2 = buf[1] & 0xc;
+ #ifdef CONFIG_MACH_JOE//ZTE_TS_ZT_20100520_001
+ y = 2787 - y;
+ y2 = 2787 - y2;
+ #endif
+ if(finger)
+ {
+ input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, pressure);
+ input_report_abs(ts->input_dev, ABS_MT_POSITION_X, x);
+ input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, y);
+ input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, w);
+ input_mt_sync(ts->input_dev);
+ }
+ if(finger2)
+
+ {
+ input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, pressure2);
+ input_report_abs(ts->input_dev, ABS_MT_POSITION_X, x2);
+ input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, y2);
+ input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, w2);
+ input_mt_sync(ts->input_dev);
}
+ input_sync(ts->input_dev);
+ input_report_key(ts->input_dev, BTN_TOUCH, !!finger);
+ input_sync(ts->input_dev);
+
}
+ #ifdef POLL_IN_INT
+ if(finger)
+ {
+ hrtimer_start(&ts->timer, ktime_set(0, polling_time), HRTIMER_MODE_REL);
+ }
+ else
+ {
+ hrtimer_cancel(&ts->timer);
+ enable_irq(ts->client->irq);
+ }
+ #else
if (ts->use_irq)
enable_irq(ts->client->irq);
+ #endif
}
static enum hrtimer_restart synaptics_ts_timer_func(struct hrtimer *timer)
@@ -212,8 +207,24 @@
/* printk("synaptics_ts_timer_func\n"); */
queue_work(synaptics_wq, &ts->work);
+ #ifndef POLL_IN_INT
+ hrtimer_start(&ts->timer, ktime_set(0, polling_time), HRTIMER_MODE_REL);
+ #endif
+ return HRTIMER_NORESTART;
+}
+static enum hrtimer_restart synaptics_ts_resume_func(struct hrtimer *timer)
+{
+
+ #if 0
+ struct synaptics_ts_data *ts = container_of(timer, struct synaptics_ts_data, resume_timer);
+ if (ts->use_irq)
+ enable_irq(ts->client->irq);
+ synaptics_i2c_write(ts->client, 0x0026, 0x07); /* enable abs int */
+ synaptics_i2c_write(ts->client, 0x0031, 0x7F);
+ #else
+ printk("synaptics_ts_resume_func\n");
+ #endif
- hrtimer_start(&ts->timer, ktime_set(0, 12500000), HRTIMER_MODE_REL);
return HRTIMER_NORESTART;
}
@@ -222,8 +233,12 @@
struct synaptics_ts_data *ts = dev_id;
/* printk("synaptics_ts_irq_handler\n"); */
- disable_irq(ts->client->irq);
+ disable_irq_nosync(ts->client->irq);
+ #ifdef POLL_IN_INT
+ hrtimer_start(&ts->timer, ktime_set(0, 0), HRTIMER_MODE_REL);
+ #else
queue_work(synaptics_wq, &ts->work);
+ #endif
return IRQ_HANDLED;
}
@@ -231,28 +246,15 @@
struct i2c_client *client, const struct i2c_device_id *id)
{
struct synaptics_ts_data *ts;
- uint8_t buf0[4];
- uint8_t buf1[8];
- struct i2c_msg msg[2];
+ uint8_t buf1[9];
+ //struct i2c_msg msg[2];
int ret = 0;
uint16_t max_x, max_y;
- int fuzz_x, fuzz_y, fuzz_p, fuzz_w;
- struct synaptics_i2c_rmi_platform_data *pdata;
- int inactive_area_left;
- int inactive_area_right;
- int inactive_area_top;
- int inactive_area_bottom;
- int snap_left_on;
- int snap_left_off;
- int snap_right_on;
- int snap_right_off;
- int snap_top_on;
- int snap_top_off;
- int snap_bottom_on;
- int snap_bottom_off;
- uint32_t panel_version;
-
- if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
+ struct proc_dir_entry *refresh;
+ gpio_direction_output(GPIO_TOUCH_EN_OUT, 1);
+ msleep(250);
+ if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
+ {
printk(KERN_ERR "synaptics_ts_probe: need I2C_FUNC_I2C\n");
ret = -ENODEV;
goto err_check_functionality_failed;
@@ -257,9 +259,9 @@
ret = -ENODEV;
goto err_check_functionality_failed;
}
-
ts = kzalloc(sizeof(*ts), GFP_KERNEL);
- if (ts == NULL) {
+ if (ts == NULL)
+ {
ret = -ENOMEM;
goto err_alloc_data_failed;
}
@@ -266,155 +269,45 @@
INIT_WORK(&ts->work, synaptics_ts_work_func);
ts->client = client;
i2c_set_clientdata(client, ts);
- pdata = client->dev.platform_data;
- if (pdata)
- ts->power = pdata->power;
- if (ts->power) {
- ret = ts->power(1);
- if (ret < 0) {
- printk(KERN_ERR "synaptics_ts_probe power on failed\n");
- goto err_power_failed;
- }
- }
-
- ret = i2c_smbus_write_byte_data(ts->client, 0xf4, 0x01); /* device command = reset */
- if (ret < 0) {
- printk(KERN_ERR "i2c_smbus_write_byte_data failed\n");
- /* fail? */
- }
+ client->driver = &synaptics_ts_driver;
{
- int retry = 10;
- while (retry-- > 0) {
- ret = i2c_smbus_read_byte_data(ts->client, 0xe4);
+ int retry = 3;
+ while (retry-- > 0)
+ {
+
+ ret = synaptics_i2c_read(ts->client, 0x0078, buf1, 9);
+ printk("wly: synaptics_i2c_read, %c, %d,%d,%d,%d,%d,%d,%d,%d\n",
+ buf1[0],buf1[1],buf1[2],buf1[3],buf1[4],buf1[5],buf1[6],buf1[7],buf1[8]);
if (ret >= 0)
break;
- msleep(100);
- }
- }
- if (ret < 0) {
- printk(KERN_ERR "i2c_smbus_read_byte_data failed\n");
- goto err_detect_failed;
- }
- printk(KERN_INFO "synaptics_ts_probe: Product Major Version %x\n", ret);
- panel_version = ret << 8;
- ret = i2c_smbus_read_byte_data(ts->client, 0xe5);
- if (ret < 0) {
- printk(KERN_ERR "i2c_smbus_read_byte_data failed\n");
- goto err_detect_failed;
- }
- printk(KERN_INFO "synaptics_ts_probe: Product Minor Version %x\n", ret);
- panel_version |= ret;
+ msleep(10);
- ret = i2c_smbus_read_byte_data(ts->client, 0xe3);
- if (ret < 0) {
- printk(KERN_ERR "i2c_smbus_read_byte_data failed\n");
- goto err_detect_failed;
}
- printk(KERN_INFO "synaptics_ts_probe: product property %x\n", ret);
-
- if (pdata) {
- while (pdata->version > panel_version)
- pdata++;
- ts->flags = pdata->flags;
- inactive_area_left = pdata->inactive_left;
- inactive_area_right = pdata->inactive_right;
- inactive_area_top = pdata->inactive_top;
- inactive_area_bottom = pdata->inactive_bottom;
- snap_left_on = pdata->snap_left_on;
- snap_left_off = pdata->snap_left_off;
- snap_right_on = pdata->snap_right_on;
- snap_right_off = pdata->snap_right_off;
- snap_top_on = pdata->snap_top_on;
- snap_top_off = pdata->snap_top_off;
- snap_bottom_on = pdata->snap_bottom_on;
- snap_bottom_off = pdata->snap_bottom_off;
- fuzz_x = pdata->fuzz_x;
- fuzz_y = pdata->fuzz_y;
- fuzz_p = pdata->fuzz_p;
- fuzz_w = pdata->fuzz_w;
- } else {
- inactive_area_left = 0;
- inactive_area_right = 0;
- inactive_area_top = 0;
- inactive_area_bottom = 0;
- snap_left_on = 0;
- snap_left_off = 0;
- snap_right_on = 0;
- snap_right_off = 0;
- snap_top_on = 0;
- snap_top_off = 0;
- snap_bottom_on = 0;
- snap_bottom_off = 0;
- fuzz_x = 0;
- fuzz_y = 0;
- fuzz_p = 0;
- fuzz_w = 0;
- }
-
- ret = i2c_smbus_read_byte_data(ts->client, 0xf0);
- if (ret < 0) {
- printk(KERN_ERR "i2c_smbus_read_byte_data failed\n");
+ if (retry < 0)
+ {
+ ret = -1;
goto err_detect_failed;
}
- printk(KERN_INFO "synaptics_ts_probe: device control %x\n", ret);
-
- ret = i2c_smbus_read_byte_data(ts->client, 0xf1);
- if (ret < 0) {
- printk(KERN_ERR "i2c_smbus_read_byte_data failed\n");
- goto err_detect_failed;
- }
- printk(KERN_INFO "synaptics_ts_probe: interrupt enable %x\n", ret);
-
- ret = i2c_smbus_write_byte_data(ts->client, 0xf1, 0); /* disable interrupt */
- if (ret < 0) {
- printk(KERN_ERR "i2c_smbus_write_byte_data failed\n");
- goto err_detect_failed;
- }
-
- msg[0].addr = ts->client->addr;
- msg[0].flags = 0;
- msg[0].len = 1;
- msg[0].buf = buf0;
- buf0[0] = 0xe0;
- msg[1].addr = ts->client->addr;
- msg[1].flags = I2C_M_RD;
- msg[1].len = 8;
- msg[1].buf = buf1;
- ret = i2c_transfer(ts->client->adapter, msg, 2);
- if (ret < 0) {
- printk(KERN_ERR "i2c_transfer failed\n");
- goto err_detect_failed;
- }
- printk(KERN_INFO "synaptics_ts_probe: 0xe0: %x %x %x %x %x %x %x %x\n",
- buf1[0], buf1[1], buf1[2], buf1[3],
- buf1[4], buf1[5], buf1[6], buf1[7]);
-
- ret = i2c_smbus_write_byte_data(ts->client, 0xff, 0x10); /* page select = 0x10 */
- if (ret < 0) {
- printk(KERN_ERR "i2c_smbus_write_byte_data failed for page select\n");
- goto err_detect_failed;
}
- ret = i2c_smbus_read_word_data(ts->client, 0x04);
- if (ret < 0) {
- printk(KERN_ERR "i2c_smbus_read_word_data failed\n");
+ ret = synaptics_i2c_write(ts->client, 0x0025, 0x00);
+ ret = synaptics_i2c_read(ts->client, 0x002D, buf1, 2);
+ if (ret < 0)
+ {
+ printk(KERN_ERR "synaptics_i2c_read failed\n");
goto err_detect_failed;
}
- ts->max[0] = max_x = (ret >> 8 & 0xff) | ((ret & 0x1f) << 8);
- ret = i2c_smbus_read_word_data(ts->client, 0x06);
- if (ret < 0) {
- printk(KERN_ERR "i2c_smbus_read_word_data failed\n");
+ ts->max[0] = max_x = buf1[0] | ((buf1[1] & 0x0f) << 8);
+ ret = synaptics_i2c_read(ts->client, 0x002F, buf1, 2);
+ if (ret < 0)
+ {
+ printk(KERN_ERR "synaptics_i2c_read failed\n");
goto err_detect_failed;
}
- ts->max[1] = max_y = (ret >> 8 & 0xff) | ((ret & 0x1f) << 8);
- if (ts->flags & SYNAPTICS_SWAP_XY)
- swap(max_x, max_y);
-
- ret = synaptics_init_panel(ts); /* will also switch back to page 0x04 */
- if (ret < 0) {
- printk(KERN_ERR "synaptics_init_panel failed\n");
- goto err_detect_failed;
- }
-
+ ts->max[1] = max_y = buf1[0] | ((buf1[1] & 0x0f) << 8);
+ printk("wly: synaptics_ts_probe,max_x=%d, max_y=%d\n", max_x, max_y);
+#if defined(CONFIG_MACH_R750)
+ max_y = 2739;
+#endif
ts->input_dev = input_allocate_device();
if (ts->input_dev == NULL) {
ret = -ENOMEM;
@@ -422,60 +315,49 @@
goto err_input_dev_alloc_failed;
}
ts->input_dev->name = "synaptics-rmi-touchscreen";
+ ts->input_dev->phys = "synaptics-rmi-touchscreen/input0";
+
set_bit(EV_SYN, ts->input_dev->evbit);
set_bit(EV_KEY, ts->input_dev->evbit);
set_bit(BTN_TOUCH, ts->input_dev->keybit);
- set_bit(BTN_2, ts->input_dev->keybit);
set_bit(EV_ABS, ts->input_dev->evbit);
- inactive_area_left = inactive_area_left * max_x / 0x10000;
- inactive_area_right = inactive_area_right * max_x / 0x10000;
- inactive_area_top = inactive_area_top * max_y / 0x10000;
- inactive_area_bottom = inactive_area_bottom * max_y / 0x10000;
- snap_left_on = snap_left_on * max_x / 0x10000;
- snap_left_off = snap_left_off * max_x / 0x10000;
- snap_right_on = snap_right_on * max_x / 0x10000;
- snap_right_off = snap_right_off * max_x / 0x10000;
- snap_top_on = snap_top_on * max_y / 0x10000;
- snap_top_off = snap_top_off * max_y / 0x10000;
- snap_bottom_on = snap_bottom_on * max_y / 0x10000;
- snap_bottom_off = snap_bottom_off * max_y / 0x10000;
- fuzz_x = fuzz_x * max_x / 0x10000;
- fuzz_y = fuzz_y * max_y / 0x10000;
- ts->snap_down[!!(ts->flags & SYNAPTICS_SWAP_XY)] = -inactive_area_left;
- ts->snap_up[!!(ts->flags & SYNAPTICS_SWAP_XY)] = max_x + inactive_area_right;
- ts->snap_down[!(ts->flags & SYNAPTICS_SWAP_XY)] = -inactive_area_top;
- ts->snap_up[!(ts->flags & SYNAPTICS_SWAP_XY)] = max_y + inactive_area_bottom;
- ts->snap_down_on[!!(ts->flags & SYNAPTICS_SWAP_XY)] = snap_left_on;
- ts->snap_down_off[!!(ts->flags & SYNAPTICS_SWAP_XY)] = snap_left_off;
- ts->snap_up_on[!!(ts->flags & SYNAPTICS_SWAP_XY)] = max_x - snap_right_on;
- ts->snap_up_off[!!(ts->flags & SYNAPTICS_SWAP_XY)] = max_x - snap_right_off;
- ts->snap_down_on[!(ts->flags & SYNAPTICS_SWAP_XY)] = snap_top_on;
- ts->snap_down_off[!(ts->flags & SYNAPTICS_SWAP_XY)] = snap_top_off;
- ts->snap_up_on[!(ts->flags & SYNAPTICS_SWAP_XY)] = max_y - snap_bottom_on;
- ts->snap_up_off[!(ts->flags & SYNAPTICS_SWAP_XY)] = max_y - snap_bottom_off;
- printk(KERN_INFO "synaptics_ts_probe: max_x %d, max_y %d\n", max_x, max_y);
- printk(KERN_INFO "synaptics_ts_probe: inactive_x %d %d, inactive_y %d %d\n",
- inactive_area_left, inactive_area_right,
- inactive_area_top, inactive_area_bottom);
- printk(KERN_INFO "synaptics_ts_probe: snap_x %d-%d %d-%d, snap_y %d-%d %d-%d\n",
- snap_left_on, snap_left_off, snap_right_on, snap_right_off,
- snap_top_on, snap_top_off, snap_bottom_on, snap_bottom_off);
- input_set_abs_params(ts->input_dev, ABS_X, -inactive_area_left, max_x + inactive_area_right, fuzz_x, 0);
- input_set_abs_params(ts->input_dev, ABS_Y, -inactive_area_top, max_y + inactive_area_bottom, fuzz_y, 0);
- input_set_abs_params(ts->input_dev, ABS_PRESSURE, 0, 255, fuzz_p, 0);
- input_set_abs_params(ts->input_dev, ABS_TOOL_WIDTH, 0, 15, fuzz_w, 0);
- input_set_abs_params(ts->input_dev, ABS_HAT0X, -inactive_area_left, max_x + inactive_area_right, fuzz_x, 0);
- input_set_abs_params(ts->input_dev, ABS_HAT0Y, -inactive_area_top, max_y + inactive_area_bottom, fuzz_y, 0);
- /* ts->input_dev->name = ts->keypad_info->name; */
+ set_bit(ABS_MT_TOUCH_MAJOR, ts->input_dev->absbit);
+ set_bit(ABS_MT_POSITION_X, ts->input_dev->absbit);
+ set_bit(ABS_MT_POSITION_Y, ts->input_dev->absbit);
+ set_bit(ABS_MT_WIDTH_MAJOR, ts->input_dev->absbit);
+
+ input_set_abs_params(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);
+ input_set_abs_params(ts->input_dev, ABS_MT_POSITION_X, 0, max_x, 0, 0);
+ input_set_abs_params(ts->input_dev, ABS_MT_POSITION_Y, 0, max_y, 0, 0);
+ input_set_abs_params(ts->input_dev, ABS_MT_WIDTH_MAJOR, 0, 255, 0, 0);
ret = input_register_device(ts->input_dev);
- if (ret) {
+ if (ret)
+ {
printk(KERN_ERR "synaptics_ts_probe: Unable to register %s input device\n", ts->input_dev->name);
goto err_input_register_device_failed;
}
- if (client->irq) {
- ret = request_irq(client->irq, synaptics_ts_irq_handler, 0, client->name, ts);
+ hrtimer_init(&ts->resume_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+ ts->resume_timer.function = synaptics_ts_resume_func;
+ #ifdef POLL_IN_INT
+ hrtimer_init(&ts->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+ ts->timer.function = synaptics_ts_timer_func;
+ ret = request_irq(client->irq, synaptics_ts_irq_handler, IRQF_TRIGGER_LOW, "synaptics_touch", ts);
+ if(ret == 0)
+ {
+ ret = synaptics_i2c_write(ts->client, 0x0026, 0x07);
+ if (ret)
+ free_irq(client->irq, ts);
+ }
+ if(ret == 0)
+ ts->use_irq = 1;
+ else
+ dev_err(&client->dev, "request_irq failed\n");
+ #else
+ if (0)
+ {
+ ret = request_irq(client->irq, synaptics_ts_irq_handler, IRQF_TRIGGER_LOW, "synaptics_touch", ts);
if (ret == 0) {
- ret = i2c_smbus_write_byte_data(ts->client, 0xf1, 0x01); /* enable abs int */
+ ret = synaptics_i2c_write(ts->client, 0x0026, 0x07); /* enable abs int */
if (ret)
free_irq(client->irq, ts);
}
@@ -484,18 +366,26 @@
else
dev_err(&client->dev, "request_irq failed\n");
}
- if (!ts->use_irq) {
+ ts->use_irq = 0;
+ if (!ts->use_irq)
+ {
hrtimer_init(&ts->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
ts->timer.function = synaptics_ts_timer_func;
hrtimer_start(&ts->timer, ktime_set(1, 0), HRTIMER_MODE_REL);
}
+ #endif
#ifdef CONFIG_HAS_EARLYSUSPEND
ts->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 1;
ts->early_suspend.suspend = synaptics_ts_early_suspend;
ts->early_suspend.resume = synaptics_ts_late_resume;
register_early_suspend(&ts->early_suspend);
#endif
-
+ refresh = create_proc_entry("ts_poll_freq", 0644, NULL);
+ if (refresh) {
+ refresh->data = NULL;
+ refresh->read_proc = proc_read_val;
+ refresh->write_proc = proc_write_val;
+ }
printk(KERN_INFO "synaptics_ts_probe: Start touchscreen %s in %s mode\n", ts->input_dev->name, ts->use_irq ? "interrupt" : "polling");
return 0;
@@ -505,7 +395,6 @@
err_input_dev_alloc_failed:
err_detect_failed:
-err_power_failed:
kfree(ts);
err_alloc_data_failed:
err_check_functionality_failed:
@@ -522,6 +411,7 @@
hrtimer_cancel(&ts->timer);
input_unregister_device(ts->input_dev);
kfree(ts);
+ gpio_direction_output(GPIO_TOUCH_EN_OUT, 0);
return 0;
}
@@ -537,18 +427,14 @@
ret = cancel_work_sync(&ts->work);
if (ret && ts->use_irq) /* if work was pending disable-count is now 2 */
enable_irq(client->irq);
- ret = i2c_smbus_write_byte_data(ts->client, 0xf1, 0); /* disable interrupt */
+ ret = synaptics_i2c_write(ts->client, 0x0026, 0); /* disable interrupt */
if (ret < 0)
- printk(KERN_ERR "synaptics_ts_suspend: i2c_smbus_write_byte_data failed\n");
+ printk(KERN_ERR "synaptics_ts_suspend: synaptics_i2c_write failed\n");
- ret = i2c_smbus_write_byte_data(client, 0xf0, 0x86); /* deep sleep */
+ ret = synaptics_i2c_write(client, 0x0025, 0x01); /* deep sleep */
if (ret < 0)
- printk(KERN_ERR "synaptics_ts_suspend: i2c_smbus_write_byte_data failed\n");
- if (ts->power) {
- ret = ts->power(0);
- if (ret < 0)
- printk(KERN_ERR "synaptics_ts_resume power off failed\n");
- }
+ printk(KERN_ERR "synaptics_ts_suspend: synaptics_i2c_write failed\n");
+
return 0;
}
@@ -556,23 +442,21 @@
{
int ret;
struct synaptics_ts_data *ts = i2c_get_clientdata(client);
-
- if (ts->power) {
- ret = ts->power(1);
- if (ret < 0)
- printk(KERN_ERR "synaptics_ts_resume power on failed\n");
- }
-
- synaptics_init_panel(ts);
-
+ gpio_direction_output(GPIO_TOUCH_EN_OUT, 1);
+ ret = synaptics_i2c_write(ts->client, 0x0025, 0x00);
+ hrtimer_start(&ts->resume_timer, ktime_set(0, 5000000), HRTIMER_MODE_REL);
+ #if 1
if (ts->use_irq)
enable_irq(client->irq);
if (!ts->use_irq)
hrtimer_start(&ts->timer, ktime_set(1, 0), HRTIMER_MODE_REL);
else
- i2c_smbus_write_byte_data(ts->client, 0xf1, 0x01); /* enable abs int */
-
+ {
+ synaptics_i2c_write(ts->client, 0x0026, 0x07);
+ synaptics_i2c_write(ts->client, 0x0031, 0x7F);
+ }
+ #endif
return 0;
}
diff -urB -x .git msm/drivers/leds/Makefile zte/drivers/leds/Makefile
--- msm/drivers/leds/Makefile Mon Nov 1 13:46:22 2010
+++ zte/drivers/leds/Makefile Sat Oct 16 11:46:40 2010
@@ -23,7 +23,10 @@
obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o
obj-$(CONFIG_LEDS_FSG) += leds-fsg.o
obj-$(CONFIG_LEDS_PCA955X) += leds-pca955x.o
-obj-$(CONFIG_LEDS_MSM_PMIC) += leds-msm-pmic.o
+#support led blink based on msm-pmic-led drivers, -->
+# obj-$(CONFIG_LEDS_MSM_PMIC) += leds-msm-pmic.o
+obj-$(CONFIG_LEDS_MSM_PMIC) += leds-msm-pmic-status.o
+#support led blink based on msm-pmic-led drivers , <--
obj-$(CONFIG_LEDS_DA903X) += leds-da903x.o
obj-$(CONFIG_LEDS_WM8350) += leds-wm8350.o
diff -urB -x .git msm/drivers/leds/leds-cpld.c zte/drivers/leds/leds-cpld.c
--- msm/drivers/leds/leds-cpld.c Mon Nov 1 13:46:22 2010
+++ zte/drivers/leds/leds-cpld.c Wed Oct 13 18:14:56 2010
@@ -26,6 +26,8 @@
#include <linux/io.h>
#include <asm/mach-types.h>
+#define DEBUG_LED_CHANGE 0
+
static int _g_cpld_led_addr;
struct CPLD_LED_data {
@@ -193,8 +195,10 @@
reg_val = brightness;
writeb(0, _g_cpld_led_addr + 0x8);
writeb(reg_val, _g_cpld_led_addr + 0x8);
+#if DEBUG_LED_CHANGE
printk(KERN_INFO "LED change: jogball backlight = %d \n",
reg_val);
+#endif
return;
} else if (!strcmp(led_cdev->name, "red")) {
idx = 0;
@@ -215,9 +219,9 @@
reg_val &= ~(1 << (2 * idx));
writeb(reg_val, _g_cpld_led_addr);
- reg_val = led->brightness / 2;
- writeb(reg_val, _g_cpld_led_addr + 2 * (idx + 1));
- printk(KERN_INFO "LED change: %s = %d \n", led_cdev->name, reg_val);
+#if DEBUG_LED_CHANGE
+ printk(KERN_INFO "LED change: %s = %d \n", led_cdev->name, led->brightness);
+#endif
spin_unlock(&CPLD_LED->data_lock);
}
@@ -279,9 +283,6 @@
memset(CPLD_LED, 0, sizeof(struct CPLD_LED_data));
writeb(0x00, _g_cpld_led_addr);
- writeb(0x00, _g_cpld_led_addr + 0x02);
- writeb(0x00, _g_cpld_led_addr + 0x04);
- writeb(0x00, _g_cpld_led_addr + 0x06);
CPLD_LED->leds[0].name = "red";
CPLD_LED->leds[0].brightness_set = led_brightness_set;
Only in zte/drivers/leds: leds-msm-pmic-status.c
diff -urB -x .git msm/drivers/media/video/msm/Kconfig zte/drivers/media/video/msm/Kconfig
--- msm/drivers/media/video/msm/Kconfig Mon Nov 1 13:46:22 2010
+++ zte/drivers/media/video/msm/Kconfig Fri Oct 29 16:55:34 2010
@@ -2,14 +2,14 @@
config MT9T013
bool "Sensor mt9t013 (BAYER 3M)"
depends on MSM_CAMERA
- default y
+ default n
---help---
MICRON 3M Bayer Sensor with AutoFocus
config MT9D112
bool "Sensor mt9d112 (YUV 2M)"
depends on MSM_CAMERA
- default y
+ default n
---help---
MICRON 2M YUV Sensor
config VX6953
@@ -22,10 +22,34 @@
config MT9P012
bool "Sensor mt9p012 (BAYER 5M)"
depends on MSM_CAMERA
- default y
+ default n
---help---
MICRON 5M Bayer Sensor with Autofocus
-
+
+config MT9V113
+ bool "Sensor mt9v113 (YUV 0.3M)"
+ depends on MSM_CAMERA
+ default n
+ ---help---
+ APTINA 0.3M YUV Sensor
+
+config MT9T11X
+ bool "Sensor mt9t111 or mt9t112 (YUV 3.1M)"
+ depends on MSM_CAMERA
+ default y
+ ---help---
+ APTINA 3.1M YUV Sensor
+
+if MT9T11X
+config MT9T11X_QTECH_MCNEX_FPC
+ bool "Sensor mt9t111 or mt9t112 (YUV 3.1M)"
+ depends on MSM_CAMERA
+ depends on MACH_BLADE || MACH_SMOOTH || MACH_RAISE
+ default y
+ ---help---
+ APTINA 3.1M YUV Sensor
+endif # MT9T11X
+
choice
prompt "AF module"
depends on MT9P012
@@ -46,14 +70,14 @@
config MT9P012_KM
bool "Sensor mt9p012 KM module (BAYER 5M)"
depends on MSM_CAMERA
- default y
+ default n
---help---
MICRON 5M Bayer Sensor KM modules with Autofocus
config S5K3E2FX
bool "Sensor s5k3e2fx (Samsung 5M)"
depends on MSM_CAMERA
- default y
+ default n
---help---
Samsung 5M with Autofocus
@@ -62,11 +86,11 @@
depends on MSM_CAMERA
---help---
5M with flash
-
+
config MSM_CAMERA_FLASH
bool "Qualcomm MSM camera flash support"
depends on MSM_CAMERA
- default y
+ default n
---help---
Enable support for LED flash for msm camera
Only in zte/drivers/media/video/msm: Kconfig.bak
diff -urB -x .git msm/drivers/media/video/msm/Makefile zte/drivers/media/video/msm/Makefile
--- msm/drivers/media/video/msm/Makefile Mon Nov 1 13:46:22 2010
+++ zte/drivers/media/video/msm/Makefile Thu Oct 28 15:28:00 2010
@@ -10,6 +10,8 @@
obj-$(CONFIG_ARCH_QSD8X50) += msm_vfe8x.o msm_vfe8x_proc.o msm_io8x.o
obj-$(CONFIG_MT9T013) += mt9t013.o mt9t013_reg.o
obj-$(CONFIG_MT9D112) += mt9d112.o mt9d112_reg.o
+obj-$(CONFIG_MT9V113) += mt9v113.o mt9v113_reg.o
+obj-$(CONFIG_MT9T11X_QTECH_MCNEX_FPC) += mt9t11x.o mt9t112_reg.o mt9t111_reg.o
obj-$(CONFIG_MT9P012) += mt9p012_reg.o
obj-$(CONFIG_MSM_CAMERA_AF_FOXCONN) += mt9p012_fox.o
obj-$(CONFIG_MSM_CAMERA_AF_BAM) += mt9p012_bam.o
Only in zte/drivers/media/video/msm: mt9t111_reg.c
Only in zte/drivers/media/video/msm: mt9t112_reg.c
Only in zte/drivers/media/video/msm: mt9t11x.c
Only in zte/drivers/media/video/msm: mt9t11x.h
Only in zte/drivers/media/video/msm: mt9v113.c
Only in zte/drivers/media/video/msm: mt9v113.h
Only in zte/drivers/media/video/msm: mt9v113_reg.c
diff -urB -x .git msm/drivers/misc/Kconfig zte/drivers/misc/Kconfig
--- msm/drivers/misc/Kconfig Mon Nov 1 13:46:22 2010
+++ zte/drivers/misc/Kconfig Mon Oct 25 15:33:20 2010
@@ -17,6 +17,9 @@
bool "Android pmem allocator"
default y
+config FM_SI4708
+ bool "Android fm semiconductor si470x from silicon libraries"
+ default y
config ANDROID_PMEM_DEBUG
bool "Android pmem debug"
depends on ANDROID_PMEM
@@ -287,5 +290,7 @@
source "drivers/misc/c2port/Kconfig"
source "drivers/misc/eeprom/Kconfig"
source "drivers/misc/video_core/720p/Kconfig"
+
+#source "drivers/misc/modemctl/Kconfig"
endif # MISC_DEVICES
Only in zte/drivers/misc: Kconfig.bak
diff -urB -x .git msm/drivers/misc/Makefile zte/drivers/misc/Makefile
--- msm/drivers/misc/Makefile Mon Nov 1 13:46:22 2010
+++ zte/drivers/misc/Makefile Mon Oct 18 09:53:16 2010
@@ -21,6 +21,7 @@
obj-$(CONFIG_SGI_XP) += sgi-xp/
obj-$(CONFIG_SGI_GRU) += sgi-gru/
obj-$(CONFIG_HP_ILO) += hpilo.o
+obj-$(CONFIG_FM_SI4708) += fm_si4708.o
obj-$(CONFIG_UID_STAT) += uid_stat.o
obj-$(CONFIG_C2PORT) += c2port/
obj-y += eeprom/
@@ -30,4 +31,7 @@
obj-$(CONFIG_TSIF_CHRDEV) += tsif_chrdev.o
obj-$(CONFIG_PMIC8058_PWM) += pmic8058-pwm.o
+
+obj-$(CONFIG_MODEMCTL) += modemctl/
+
Only in zte/drivers/misc: fm_si4708.c
diff -urB -x .git msm/drivers/mmc/card/block.c zte/drivers/mmc/card/block.c
--- msm/drivers/mmc/card/block.c Mon Nov 1 13:46:22 2010
+++ zte/drivers/mmc/card/block.c Thu Oct 28 11:55:28 2010
@@ -608,12 +608,22 @@
return err;
}
+
+int remove_all_req(struct mmc_queue *mq);
+
static void mmc_blk_remove(struct mmc_card *card)
{
struct mmc_blk_data *md = mmc_get_drvdata(card);
if (md) {
/* Stop new requests from getting into the queue */
+ //ruanmeisi_20100603
+ printk(KERN_ERR"rms:%s %d\n", __FUNCTION__, __LINE__);
+ queue_flag_set_unlocked(QUEUE_FLAG_DEAD,
+ md->queue.queue);
+ remove_all_req(&md->queue);
+ //end
+
del_gendisk(md->disk);
/* Then flush out any already in there */
diff -urB -x .git msm/drivers/mmc/card/queue.c zte/drivers/mmc/card/queue.c
--- msm/drivers/mmc/card/queue.c Mon Nov 1 13:46:22 2010
+++ zte/drivers/mmc/card/queue.c Thu Oct 28 11:55:28 2010
@@ -42,12 +42,39 @@
return BLKPREP_OK;
}
-
+//ruanmeisi_20100603
+int mmc_send_status(struct mmc_card *card, u32 *status);
+
+int remove_all_req(struct mmc_queue *mq)
+{
+ int i = 0;
+ struct request_queue *q = mq->queue;
+ struct request *req = NULL;
+ if (NULL == mq) {
+ return 0;
+ }
+ spin_lock_irq(q->queue_lock);
+ while ((req = elv_next_request(q)) != NULL) {
+ int ret = 0;
+ do {
+ req->cmd_flags |= REQ_QUIET;
+ ret = __blk_end_request(req, -EIO,
+ blk_rq_cur_bytes(req));
+ } while (ret);
+ i ++;
+ }
+ spin_unlock_irq(q->queue_lock);
+
+ printk(KERN_ERR"rms:%s %d req %d\n", __FUNCTION__, __LINE__, i);
+ return i;
+}
static int mmc_queue_thread(void *d)
{
struct mmc_queue *mq = d;
struct request_queue *q = mq->queue;
struct request *req;
+ //ruanmeisi_20100603
+ int issue_ret = 0;
current->flags |= PF_MEMALLOC;
@@ -55,6 +82,12 @@
do {
req = NULL; /* Must be set to NULL at each iteration */
+ //ruanmeisi_20100603
+ if (kthread_should_stop()) {
+ remove_all_req(mq);
+ break;
+ }
+ //end
spin_lock_irq(q->queue_lock);
set_current_state(TASK_INTERRUPTIBLE);
if (!blk_queue_plugged(q))
@@ -106,7 +139,25 @@
mq->check_status = 0;
}
#endif
- mq->issue_fn(mq, req);
+//ruanmeisi_20100529
+ issue_ret = mq->issue_fn(mq, req);
+ //ruanmeisi
+ if (0 == issue_ret) {
+ int err;
+ mmc_claim_host(mq->card->host);
+ err = mmc_send_status(mq->card, NULL);
+ mmc_release_host(mq->card->host);
+ if (err) {
+ printk(KERN_ERR "rms:%s: failed to get status (%d) maybe the card is removed\n",
+ __func__, err);
+ //sdcard is removed?
+ mmc_detect_change(mq->card->host, 0);
+ msleep(500);
+ //set_current_state(TASK_INTERRUPTIBLE);
+ //schedule_timeout(HZ / 2);
+ continue;
+ }
+ }
} while (1);
up(&mq->thread_sem);
diff -urB -x .git msm/drivers/mmc/core/core.c zte/drivers/mmc/core/core.c
--- msm/drivers/mmc/core/core.c Mon Nov 1 13:46:22 2010
+++ zte/drivers/mmc/core/core.c Thu Oct 28 11:55:28 2010
@@ -37,6 +37,10 @@
#include "sd_ops.h"
#include "sdio_ops.h"
+/* ATHENV */
+#define ATH_WIFI_SDCC_INDEX 1
+/* ATHENV */
+
static struct workqueue_struct *workqueue;
static struct wake_lock mmc_delayed_work_wake_lock;
@@ -54,7 +58,9 @@
static int mmc_schedule_delayed_work(struct delayed_work *work,
unsigned long delay)
{
- wake_lock(&mmc_delayed_work_wake_lock);
+//ruanmeisi_20100422
+ //wake_lock(&mmc_delayed_work_wake_lock);
+//end
return queue_delayed_work(workqueue, work, delay);
}
@@ -353,16 +359,33 @@
while (1) {
set_current_state(TASK_UNINTERRUPTIBLE);
stop = abort ? atomic_read(abort) : 0;
+/* ATHENV */
+#if 0
if (stop || !host->claimed)
break;
+#else
+ if (stop || !host->claimed || host->claimer == current)
+ break;
+#endif
+/* ATHENV */
spin_unlock_irqrestore(&host->lock, flags);
schedule();
spin_lock_irqsave(&host->lock, flags);
}
set_current_state(TASK_RUNNING);
+/* ATHENV */
+#if 0
if (!stop)
host->claimed = 1;
else
+#else
+ if (!stop) {
+ host->claimed = 1;
+ host->claimer = current;
+ host->claim_cnt += 1;
+ } else
+#endif
+/* ATHENV */
wake_up(&host->wq);
spin_unlock_irqrestore(&host->lock, flags);
remove_wait_queue(&host->wq, &wait);
@@ -385,11 +408,24 @@
WARN_ON(!host->claimed);
spin_lock_irqsave(&host->lock, flags);
+/* ATHENV */
+#if 0
host->claimed = 0;
spin_unlock_irqrestore(&host->lock, flags);
+ wake_up(&host->wq)
+#else
+ if (--host->claim_cnt) {
+ spin_unlock_irqrestore(&host->lock, flags);
+ } else {
+ host->claimed = 0;
+ host->claimer = NULL;
+ spin_unlock_irqrestore(&host->lock, flags);
wake_up(&host->wq);
}
+#endif
+/* ATHENV */
+}
EXPORT_SYMBOL(mmc_release_host);
@@ -798,7 +834,9 @@
container_of(work, struct mmc_host, detect.work);
u32 ocr;
int err;
-
+ //ruanmeisi_20100422
+ wake_lock(&mmc_delayed_work_wake_lock);
+ //end
mmc_bus_get(host);
#ifdef CONFIG_MMC_AUTO_SUSPEND
@@ -867,7 +905,7 @@
wake_lock_timeout(&mmc_delayed_work_wake_lock, HZ / 2);
if (host->caps & MMC_CAP_NEEDS_POLL)
- mmc_schedule_delayed_work(&host->detect, HZ);
+ mmc_schedule_delayed_work(&host->detect, 2 * HZ);
}
void mmc_start_host(struct mmc_host *host)
@@ -916,13 +954,18 @@
*/
int mmc_suspend_host(struct mmc_host *host, pm_message_t state)
{
+ int err = 0;
cancel_delayed_work(&host->detect);
#ifdef CONFIG_MMC_AUTO_SUSPEND
cancel_delayed_work(&host->auto_suspend);
#endif
+ pr_info("%s index = %d\n", __FUNCTION__, host->index);
+
mmc_flush_scheduled_work();
mmc_bus_get(host);
+/* ATHENV */
+#if 0
if (host->bus_ops && !host->bus_dead) {
if (host->bus_ops->suspend)
host->bus_ops->suspend(host);
@@ -934,10 +977,39 @@
mmc_detach_bus(host);
mmc_release_host(host);
}
+#else
+ if (host->bus_ops && !host->bus_dead) {
+ if (host->bus_ops->suspend)
+ err = host->bus_ops->suspend(host);
+ if (err == -ENOSYS || !host->bus_ops->resume) {
+ /*
+ * We simply "remove" the card in this case.
+ * It will be redetected on resume.
+ */
+ if (host->bus_ops->remove)
+ host->bus_ops->remove(host);
+
+ mmc_claim_host(host);
+ mmc_detach_bus(host);
+ mmc_release_host(host);
+ err = 0;
+ }
+#endif
+/* ATHENV */
}
mmc_bus_put(host);
+/* ATHENV */
+#if 0
mmc_power_off(host);
+
return 0;
+#else
+ if (!err)
+ mmc_power_off(host);
+ host->last_suspend_error = err;
+
+ return err;
+#endif
}
EXPORT_SYMBOL(mmc_suspend_host);
@@ -948,21 +1020,54 @@
*/
int mmc_resume_host(struct mmc_host *host)
{
+/* ATHENV */
+ int err = 0;
+/* ATHENV */
+ pr_info("%s index = %d\n", __FUNCTION__, host->index);
+
mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead) {
mmc_power_up(host);
BUG_ON(!host->bus_ops->resume);
+/* ATHENV */
+#if 0
host->bus_ops->resume(host);
+#else
+ err = host->bus_ops->resume(host);
+ if (err) {
+ printk(KERN_WARNING "%s: error %d during resume "
+ "(card was removed?)\n",
+ mmc_hostname(host), err);
+ if (host->bus_ops->remove)
+ host->bus_ops->remove(host);
+ mmc_claim_host(host);
+ mmc_detach_bus(host);
+ mmc_release_host(host);
+ /* no need to bother upper layers */
+ err = 0;
+ }
+#endif
+/* ATHENV */
}
mmc_bus_put(host);
-
+/* ATHENV */
+ if (host->index == ATH_WIFI_SDCC_INDEX) {
+ pr_info("%s: mmc_resume_host in wifi slot skip cmd7\n", mmc_hostname(host));
+ return err;
+ }
+/* ATHENV */
/*
* We add a slight delay here so that resume can progress
* in parallel.
*/
mmc_detect_change(host, 1);
-
+/* ATHENV */
+#if 0
return 0;
+#else
+ return err;
+#endif
+/* ATHENV */
}
EXPORT_SYMBOL(mmc_resume_host);
@@ -985,6 +1090,25 @@
EXPORT_SYMBOL(mmc_set_embedded_sdio_data);
#endif
+//ruanmeisi_091224
+void mmc_redetect_card(struct mmc_host *host)
+{
+ printk(KERN_ERR"%s:line:%d %s\n", mmc_hostname(host), __LINE__, __FUNCTION__);
+ if (NULL == host) {
+ return ;
+ }
+ mmc_stop_host(host);
+ mmc_start_host(host);
+}
+
+EXPORT_SYMBOL(mmc_redetect_card);
+
+int queue_redetect_work(struct work_struct *work)
+{
+ return queue_work(workqueue, work);
+}
+EXPORT_SYMBOL(queue_redetect_work);
+//end
static int __init mmc_init(void)
{
int ret;
diff -urB -x .git msm/drivers/mmc/core/core.h zte/drivers/mmc/core/core.h
--- msm/drivers/mmc/core/core.h Mon Nov 1 13:46:22 2010
+++ zte/drivers/mmc/core/core.h Thu Oct 28 11:55:28 2010
@@ -18,8 +18,15 @@
struct mmc_bus_ops {
void (*remove)(struct mmc_host *);
void (*detect)(struct mmc_host *);
+/* ATHENV */
+#if 0
void (*suspend)(struct mmc_host *);
void (*resume)(struct mmc_host *);
+#else
+ int (*suspend)(struct mmc_host *);
+ int (*resume)(struct mmc_host *);
+#endif
+/* ATHENV */
};
void mmc_attach_bus(struct mmc_host *host, const struct mmc_bus_ops *ops);
diff -urB -x .git msm/drivers/mmc/core/mmc.c zte/drivers/mmc/core/mmc.c
--- msm/drivers/mmc/core/mmc.c Mon Nov 1 13:46:22 2010
+++ zte/drivers/mmc/core/mmc.c Thu Oct 28 11:55:28 2010
@@ -512,7 +512,13 @@
/*
* Suspend callback from host.
*/
+/* ATHENV */
+#if 0
static void mmc_suspend(struct mmc_host *host)
+#else
+static int mmc_suspend(struct mmc_host *host)
+#endif
+/* ATHENV */
{
BUG_ON(!host);
BUG_ON(!host->card);
@@ -522,6 +528,9 @@
mmc_deselect_cards(host);
host->card->state &= ~MMC_STATE_HIGHSPEED;
mmc_release_host(host);
+/* ATHENV */
+ return 0;
+/* ATHENV */
}
/*
@@ -530,7 +539,13 @@
* This function tries to determine if the same card is still present
* and, if so, restore all state to it.
*/
+/* ATHENV */
+#if 0
static void mmc_resume(struct mmc_host *host)
+#else
+static int mmc_resume(struct mmc_host *host)
+#endif
+/* ATHENV */
{
int err;
@@ -540,7 +555,8 @@
mmc_claim_host(host);
err = mmc_init_card(host, host->ocr, host->card);
mmc_release_host(host);
-
+/* ATHENV */
+#if 0
if (err) {
mmc_remove(host);
@@ -548,7 +564,10 @@
mmc_detach_bus(host);
mmc_release_host(host);
}
-
+#else
+ return err;
+#endif
+/* ATHENV */
}
#else
diff -urB -x .git msm/drivers/mmc/core/sd.c zte/drivers/mmc/core/sd.c
--- msm/drivers/mmc/core/sd.c Mon Nov 1 13:40:28 2010
+++ zte/drivers/mmc/core/sd.c Thu Oct 28 11:55:28 2010
@@ -601,7 +601,13 @@
/*
* Suspend callback from host.
*/
+/* ATHENV */
+#if 0
static void mmc_sd_suspend(struct mmc_host *host)
+#else
+static int mmc_sd_suspend(struct mmc_host *host)
+#endif
+/* ATHENV */
{
BUG_ON(!host);
BUG_ON(!host->card);
@@ -611,6 +617,9 @@
mmc_deselect_cards(host);
host->card->state &= ~MMC_STATE_HIGHSPEED;
mmc_release_host(host);
+/* ATHENV */
+ return 0;
+/* ATHENV */
}
/*
@@ -619,7 +628,12 @@
* This function tries to determine if the same card is still present
* and, if so, restore all state to it.
*/
+/* ATHENV */
+#if 0
static void mmc_sd_resume(struct mmc_host *host)
+#else
+static int mmc_sd_resume(struct mmc_host *host)
+#endif
{
int err;
#ifdef CONFIG_MMC_PARANOID_SD_INIT
@@ -648,7 +662,8 @@
err = mmc_sd_init_card(host, host->ocr, host->card);
#endif
mmc_release_host(host);
-
+/* ATHENV */
+#if 0
if (err) {
mmc_sd_remove(host);
@@ -656,7 +671,10 @@
mmc_detach_bus(host);
mmc_release_host(host);
}
-
+#else
+ return err;
+#endif
+/* ATHENV */
}
#else
diff -urB -x .git msm/drivers/mmc/core/sdio.c zte/drivers/mmc/core/sdio.c
--- msm/drivers/mmc/core/sdio.c Mon Nov 1 13:46:22 2010
+++ zte/drivers/mmc/core/sdio.c Thu Oct 28 11:55:28 2010
@@ -198,6 +198,175 @@
return 0;
}
+/* ATHENV */
+/*
+ * Handle the detection and initialisation of a card.
+ *
+ * In the case of a resume, "oldcard" will contain the card
+ * we're trying to reinitialise.
+ */
+static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
+ struct mmc_card *oldcard)
+{
+ struct mmc_card *card;
+ int err;
+
+ BUG_ON(!host);
+ WARN_ON(!host->claimed);
+
+ {
+ struct mmc_card tempcard;
+ tempcard.host = host;
+ mmc_io_rw_direct(&tempcard, 1, 0, SDIO_CCCR_ABORT, 0x08, NULL);
+ }
+
+ /*
+ * Since we're changing the OCR value, we seem to
+ * need to tell some cards to go back to the idle
+ * state. We wait 1ms to give cards time to
+ * respond.
+ */
+ mmc_go_idle(host);
+
+ /*
+ * Inform the card of the voltage
+ */
+ err = mmc_send_io_op_cond(host, host->ocr, &ocr);
+ if (err)
+ goto err;
+
+ /*
+ * For SPI, enable CRC as appropriate.
+ */
+ if (mmc_host_is_spi(host)) {
+ err = mmc_spi_set_crc(host, use_spi_crc);
+ if (err)
+ goto err;
+ }
+
+ /*
+ * Allocate card structure.
+ */
+ card = mmc_alloc_card(host, NULL);
+ if (IS_ERR(card)) {
+ err = PTR_ERR(card);
+ goto err;
+ }
+
+ card->type = MMC_TYPE_SDIO;
+
+ /*
+ * For native busses: set card RCA and quit open drain mode.
+ */
+ if (!mmc_host_is_spi(host)) {
+ err = mmc_send_relative_addr(host, &card->rca);
+ if (err)
+ goto remove;
+
+ mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL);
+ }
+
+ /*
+ * Select card, as all following commands rely on that.
+ */
+ if (!mmc_host_is_spi(host)) {
+ err = mmc_select_card(card);
+ if (err)
+ goto remove;
+ }
+
+ /*
+ * Read the common registers.
+ */
+#ifdef CONFIG_MMC_EMBEDDED_SDIO
+ if (host->embedded_sdio_data.cccr)
+ memcpy(&card->cccr, host->embedded_sdio_data.cccr,
+ sizeof(struct sdio_cccr));
+ else {
+#endif
+ err = sdio_read_cccr(card);
+ if (err)
+ goto remove;
+
+#ifdef CONFIG_MMC_EMBEDDED_SDIO
+ }
+#endif
+
+#ifdef CONFIG_MMC_EMBEDDED_SDIO
+ if (host->embedded_sdio_data.cis)
+ memcpy(&card->cis, host->embedded_sdio_data.cis,
+ sizeof(struct sdio_cis));
+ else {
+#endif
+ /*
+ * Read the common CIS tuples.
+ */
+ err = sdio_read_common_cis(card);
+ if (err)
+ goto remove;
+
+#ifdef CONFIG_MMC_EMBEDDED_SDIO
+ }
+#endif
+
+ if (oldcard) {
+ int same = (card->cis.vendor == oldcard->cis.vendor &&
+ card->cis.device == oldcard->cis.device);
+ mmc_remove_card(card);
+ if (!same) {
+ err = -ENOENT;
+ goto err;
+ }
+ card = oldcard;
+ }
+
+ /*
+ * Switch to high-speed (if supported).
+ */
+#if 1
+ err = sdio_enable_hs(card);
+ if (err)
+ goto remove;
+
+ /*
+ * Change to the card's maximum speed.
+ */
+ if (mmc_card_highspeed(card)) {
+ /*
+ * The SDIO specification doesn't mention how
+ * the CIS transfer speed register relates to
+ * high-speed, but it seems that 50 MHz is
+ * mandatory.
+ */
+ mmc_set_clock(host, 50000000);
+ } else {
+ mmc_set_clock(host, card->cis.max_dtr);
+ }
+#else
+ (void)&sdio_enable_hs;
+ mmc_set_clock(host, 25000000);
+#endif
+
+ /*
+ * Switch to wider bus (if supported).
+ */
+ err = sdio_enable_wide(card);
+ if (err)
+ goto remove;
+
+ if (!oldcard)
+ host->card = card;
+ return 0;
+
+remove:
+ if (!oldcard)
+ mmc_remove_card(card);
+
+err:
+ return err;
+}
+/* ATHENV */
+
/*
* Host is being removed. Free up the current card.
*/
@@ -247,10 +416,81 @@
}
}
+/* ATHENV */
+/*
+ * SDIO suspend. We need to suspend all functions separately.
+ * Therefore all registered functions must have drivers with suspend
+ * and resume methods. Failing that we simply remove the whole card.
+ */
+static int mmc_sdio_suspend(struct mmc_host *host)
+{
+ int i, err = 0;
+ const struct dev_pm_ops *pmops;
+ for (i = 0; i < host->card->sdio_funcs; i++) {
+ struct sdio_func *func = host->card->sdio_func[i];
+ if (func && sdio_func_present(func) && func->dev.driver) {
+ pmops = func->dev.driver->pm;
+ if (!pmops || !pmops->suspend || !pmops->resume) {
+ /* force removal of entire card in that case */
+ err = -ENOSYS;
+ } else
+ err = pmops->suspend(&func->dev);
+ if (err)
+ break;
+ }
+ }
+ while (err && --i >= 0) {
+ struct sdio_func *func = host->card->sdio_func[i];
+ if (func && sdio_func_present(func) && func->dev.driver) {
+ pmops = func->dev.driver->pm;
+ pmops->resume(&func->dev);
+ }
+ }
+
+ return err;
+}
+
+static int mmc_sdio_resume(struct mmc_host *host)
+{
+ int i, err;
+ const struct dev_pm_ops *pmops;
+ BUG_ON(!host);
+ BUG_ON(!host->card);
+
+ /* Basic card reinitialization. */
+ mmc_claim_host(host);
+ err = mmc_sdio_init_card(host, host->ocr, host->card);
+ mmc_release_host(host);
+
+/*
+ * If the card looked to be the same as before suspending, then
+ * we proceed to resume all card functions. If one of them returns
+ * an error then we simply return that error to the core and the
+ * card will be redetected as new. It is the responsibility of
+ * the function driver to perform further tests with the extra
+ * knowledge it has of the card to confirm the card is indeed the
+ * same as before suspending (same MAC address for network cards,
+ * etc.) and return an error otherwise.
+ */
+ for (i = 0; !err && i < host->card->sdio_funcs; i++) {
+ struct sdio_func *func = host->card->sdio_func[i];
+ if (func && sdio_func_present(func) && func->dev.driver) {
+ pmops = func->dev.driver->pm;
+ err = pmops->resume(&func->dev);
+ }
+ }
+
+ return err;
+}
+/* ATHENV */
static const struct mmc_bus_ops mmc_sdio_ops = {
.remove = mmc_sdio_remove,
.detect = mmc_sdio_detect,
+/* ATHENV */
+ .suspend = mmc_sdio_suspend,
+ .resume = mmc_sdio_resume,
+/* ATHENV */
};
@@ -295,7 +535,8 @@
err = -EINVAL;
goto err;
}
-
+/* ATHENV */
+#if 0
/*
* Inform the card of the voltage
*/
@@ -311,17 +552,34 @@
if (err)
goto err;
}
+#else
+ /*
+ * Detect and init the card.
+ */
+ err = mmc_sdio_init_card(host, host->ocr, NULL);
+ if (err)
+ goto err;
+ card = host->card;
+#endif
+/* ATHENV */
/*
* The number of functions on the card is encoded inside
* the ocr.
*/
+/* ATHENV */
+#if 0
funcs = (ocr & 0x70000000) >> 28;
-
+#else
+ card->sdio_funcs = funcs = (ocr & 0x70000000) >> 28;
+#endif
+/* ATHENV */
#ifdef CONFIG_MMC_EMBEDDED_SDIO
if (host->embedded_sdio_data.funcs)
funcs = host->embedded_sdio_data.num_funcs;
#endif
+/* ATHENV */
+#if 0
/*
* Allocate card structure.
@@ -416,6 +674,8 @@
if (err)
goto remove;
+#endif
+/* ATHENV */
/*
* Initialize (but don't add) all present functions.
*/
diff -urB -x .git msm/drivers/mmc/core/sdio_irq.c zte/drivers/mmc/core/sdio_irq.c
--- msm/drivers/mmc/core/sdio_irq.c Mon Nov 1 12:09:57 2010
+++ zte/drivers/mmc/core/sdio_irq.c Thu Oct 28 11:55:28 2010
@@ -144,7 +144,18 @@
if (host->caps & MMC_CAP_SDIO_IRQ)
host->ops->enable_sdio_irq(host, 0);
- pr_debug("%s: IRQ thread exiting with code %d\n",
+/* ATHENV */
+ /* someone is trying to reclaim it? */
+ while (!kthread_should_stop()) {
+ pr_info("[%s]: [%d], wait for someone to reclaim\n", __func__, current->pid);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout(HZ);
+ set_current_state(TASK_RUNNING);
+ }
+ //wake_unlock(&mmc_sdio_irq_wake_lock);
+/* ATHENV */
+
+ pr_info("[WIFI]_%s: IRQ thread exiting with code %d\n",
mmc_hostname(host), ret);
return ret;
@@ -180,7 +191,21 @@
if (!--host->sdio_irqs) {
atomic_set(&host->sdio_irq_thread_abort, 1);
+ /* ATHENV */
+#if 0
kthread_stop(host->sdio_irq_thread);
+#else
+ if (host->claimed) {
+ pr_info("[%s] host was claimed release it first\n", __FUNCTION__);
+ mmc_release_host(host);
+ kthread_stop(host->sdio_irq_thread);
+ mmc_claim_host(host);
+ } else {
+ kthread_stop(host->sdio_irq_thread);
+ }
+ pr_info("destroy mmc_sdio_irq_wake_lock\n");
+#endif
+/* ATHENV */
}
return 0;
diff -urB -x .git msm/drivers/mmc/host/msm_sdcc.c zte/drivers/mmc/host/msm_sdcc.c
--- msm/drivers/mmc/host/msm_sdcc.c Mon Nov 1 13:46:22 2010
+++ zte/drivers/mmc/host/msm_sdcc.c Thu Oct 28 11:55:28 2010
@@ -14,6 +14,9 @@
* Author: San Mehat (san@android.com)
*
*/
+//ruanmeisi 20100408 ruanmeisi_20100408 p729b sd suport host plug don't shutdown polling
+//ruanmeisi 20100408 ruanmeisi_20100418 add CONFIG_MACH_BLADE macro
+//ruanmeisi 20100510 ruanmeisi_20100510 clean host->pio when stop data
#include <linux/module.h>
#include <linux/moduleparam.h>
@@ -46,15 +49,39 @@
#include <mach/clk.h>
#include <mach/dma.h>
#include <mach/htc_pwrsink.h>
+//ruanmeisi
+#include <linux/proc_fs.h>
+#define ATH_PATCH
#include "msm_sdcc.h"
#define DRIVER_NAME "msm-sdcc"
+//ruanmeisi 20100221
+
+#define T_CARD_DRIVER_ID 1
+
+
+/* #define DBG(host, fmt, args...) \ */
+/* pr_debug("%s: %s: " fmt "\n", mmc_hostname(host->mmc), __func__ , args) */
+
+#define DPRINTK(fmt, args...) \
+ printk(KERN_ERR "mmc:%s: %d: " fmt "", \
+ __FUNCTION__, __LINE__, ## args)
+
#define DBG(host, fmt, args...) \
- pr_debug("%s: %s: " fmt "\n", mmc_hostname(host->mmc), __func__ , args)
+ do { \
+ if(mmc_debug) \
+ printk(KERN_ERR"%s: %s: " fmt "\n", mmc_hostname(host->mmc), __func__ , args) ; \
+ }while(0) \
+
+static struct proc_dir_entry * d_entry;
+int mmc_debug = 0;
+
+int queue_redetect_work(struct work_struct *work);
+void mmc_redetect_card(struct mmc_host *host);
#define IRQ_DEBUG 0
#if defined(CONFIG_DEBUG_FS)
@@ -199,6 +226,12 @@
static void
msmsdcc_stop_data(struct msmsdcc_host *host)
{
+
+ //ruanmeisi_20100510
+ if (T_CARD_DRIVER_ID == host->pdev_id) {
+ memset(&host->pio, 0, sizeof(host->pio));
+ }
+ //end
host->curr.data = NULL;
host->curr.got_dataend = host->curr.got_datablkend = 0;
}
@@ -693,7 +726,59 @@
if (!(status & (MCI_TXFIFOHALFEMPTY | MCI_RXDATAAVLBL)))
break;
+ //ruanmeisi_20100510
+ if(NULL == host->curr.mrq) {
+ pr_info("[rms:sd]:%s pio host->curr.mrq is null\n",
+ mmc_hostname(host->mmc));
+
+ if(status & MCI_RXACTIVE) {
+ int read_cnt = 0;
+ while(readl(base+MMCISTATUS) & MCI_RXDATAAVLBL) {
+ readl(base+MMCIFIFO+(1%MCI_FIFOSIZE));
+ if((read_cnt++) > MCI_FIFOSIZE)
+ break;
+ }
+ writel(0, base + MMCIMASK1);
+ }
+
+ if(status & MCI_TXACTIVE) {
+ writel(0, base + MMCIMASK1);
+ }
+
+ return IRQ_HANDLED;
+ }
+ //ZTE_WIFI_HP_019
+ //hp merge htc patch for pio.sg NULL
+ //here we catch the pio.sg==NULL, and stop current transaction,
+ //let app to handle the error
+ if(host->pio.sg == NULL) {
+ pr_info("[hp@wifi]:%s pio scatter list is null\n",
+ mmc_hostname(host->mmc));
+
+ if(status & MCI_RXACTIVE) {
+ int read_cnt = 0;
+ while(readl(base+MMCISTATUS) & MCI_RXDATAAVLBL) {
+ readl(base+MMCIFIFO+(1%MCI_FIFOSIZE));
+ if((read_cnt++) > MCI_FIFOSIZE)
+ break;
+ }
+ writel(MCI_RXDATAAVLBLMASK, base + MMCIMASK1);
+ }
+
+ if(status & MCI_TXACTIVE) {
+ struct mmc_request *mrq;
+
+ writel(0, base + MMCIMASK1);
+ mrq = host->curr.mrq;
+ mrq->data->error = 1;
+ if(mrq->done)
+ mrq->done(mrq);
+ }
+
+ return IRQ_HANDLED;
+ }
+ //ZTE_WIFI_HP_019 end
/* Map the current scatter buffer */
local_irq_save(flags);
buffer = kmap_atomic(sg_page(host->pio.sg),
@@ -812,7 +897,9 @@
cmd->resp[1] = readl(base + MMCIRESPONSE1);
cmd->resp[2] = readl(base + MMCIRESPONSE2);
cmd->resp[3] = readl(base + MMCIRESPONSE3);
-
+ //ruanmeisi_20100510
+ del_timer(&host->command_timer);
+ //end
if (status & MCI_CMDTIMEOUT) {
#if VERBOSE_COMMAND_TIMEOUTS
pr_err("%s: Command timeout\n",
@@ -996,6 +1083,9 @@
}
msmsdcc_request_start(host, mrq);
+ //ruanmeisi_20100510
+ mod_timer(&host->command_timer, jiffies + HZ);
+ //end
spin_unlock_irqrestore(&host->lock, flags);
}
@@ -1167,6 +1257,46 @@
msmsdcc_check_status((unsigned long) host);
}
+
+/* ruanmeisi_20100510 command timeout handle */
+/*
+ * called when a command expires.
+ * Dump some debugging, and then error
+ * out the transaction.
+ */
+static void
+msmsdcc_command_expired(unsigned long _data)
+{
+ struct msmsdcc_host *host = (struct msmsdcc_host *) _data;
+ struct mmc_request *mrq;
+ unsigned long flags;
+
+ spin_lock_irqsave(&host->lock, flags);
+ mrq = host->curr.mrq;
+
+ if (!mrq) {
+ printk(KERN_INFO "%s: Command expiry misfire\n",
+ mmc_hostname(host->mmc));
+ spin_unlock_irqrestore(&host->lock, flags);
+ return;
+ }
+
+ printk(KERN_ERR "%s: Command timeout [%u] (%p %p %p %p)\n",
+ mmc_hostname(host->mmc), mrq->cmd->opcode, mrq, mrq->cmd,
+ mrq->data, host->dma.sg);
+
+ mrq->cmd->error = -ETIMEDOUT;
+ msmsdcc_stop_data(host);
+
+ writel(0, host->base + MMCICOMMAND);
+
+ host->curr.mrq = NULL;
+ host->curr.cmd = NULL;
+
+ spin_unlock_irqrestore(&host->lock, flags);
+ mmc_request_done(host->mmc, mrq);
+}
+/*ruanmeisi_20100510 end */
static int
msmsdcc_init_dma(struct msmsdcc_host *host)
{
@@ -1250,10 +1380,110 @@
return count;
}
+/* ATHENV +++ */
+static ssize_t
+set_detect_change(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct mmc_host *mmc = dev_get_drvdata(dev);
+ struct msmsdcc_host *host = mmc_priv(mmc);
+ int value;
+ if (sscanf(buf, "%d", &value)==1 && value) {
+ mmc_detect_change(host->mmc, 0);
+ }
+ return count;
+}
+static DEVICE_ATTR(detect_change, S_IRUGO | S_IWUSR,
+ NULL, set_detect_change);
+/* ATHENV --- */
+
+//ruanmeisi_20091224 sysfs interface for debug
+
+void msmsdcc_mmc_redetect(struct work_struct *work)
+{
+ struct msmsdcc_host *msmsdcchost =
+ container_of(work, struct msmsdcc_host, redetect);
+ struct mmc_host *host = msmsdcchost->mmc;
+#ifdef CONFIG_HAS_EARLYSUSPEND
+ if (msmsdcchost->polling_enabled) {
+ unsigned long flags;
+ spin_lock_irqsave(&host->lock, flags);
+ msmsdcchost->mmc->caps |= MMC_CAP_NEEDS_POLL;
+ spin_unlock_irqrestore(&host->lock, flags);
+ }
+#endif
+ mmc_redetect_card(host);
+ return ;
+}
+
+static ssize_t
+show_highspeed(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ struct mmc_host *mmc = dev_get_drvdata(dev);
+ struct msmsdcc_host *host = mmc_priv(mmc);
+ int poll;
+ unsigned long flags;
+
+ spin_lock_irqsave(&host->lock, flags);
+ poll = !!(mmc->caps & MMC_CAP_SD_HIGHSPEED);
+ spin_unlock_irqrestore(&host->lock, flags);
+
+ return snprintf(buf, PAGE_SIZE, "%d\n", poll);
+}
+
+static ssize_t
+set_highspeed(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct mmc_host *mmc = dev_get_drvdata(dev);
+ struct msmsdcc_host *host = mmc_priv(mmc);
+ int value;
+ unsigned long flags;
+
+ sscanf(buf, "%d", &value);
+
+ spin_lock_irqsave(&host->lock, flags);
+ if (value) {
+ mmc->caps |= MMC_CAP_SD_HIGHSPEED;
+ mmc_detect_change(host->mmc, 0);
+ } else {
+ mmc->caps &= ~MMC_CAP_SD_HIGHSPEED;
+ }
+ spin_unlock_irqrestore(&host->lock, flags);
+ return count;
+}
+
+
+static ssize_t
+set_redetect(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct mmc_host *mmc = dev_get_drvdata(dev);
+ struct msmsdcc_host *host = mmc_priv(mmc);
+ queue_redetect_work(&(host->redetect));
+ return count;
+}
+
+
+static DEVICE_ATTR(redetect, S_IRUGO | S_IWUSR,
+ NULL, set_redetect);
+static DEVICE_ATTR(highspeed, S_IRUGO | S_IWUSR,
+ show_highspeed, set_highspeed);
+
+
+//end
+
static DEVICE_ATTR(polling, S_IRUGO | S_IWUSR,
show_polling, set_polling);
static struct attribute *dev_attrs[] = {
&dev_attr_polling.attr,
+/* ATHENV +++ */
+ &dev_attr_detect_change.attr,
+/* ATHENV --- */
+ //ruanmeisi_20091224 debug interface
+ &dev_attr_redetect.attr,
+ &dev_attr_highspeed.attr,
+ //end
NULL,
};
static struct attribute_group dev_attr_grp = {
@@ -1266,7 +1496,13 @@
struct msmsdcc_host *host =
container_of(h, struct msmsdcc_host, early_suspend);
unsigned long flags;
-
+#ifdef CONFIG_MACH_BLADE
+ //ruanmeisi_20100408 p729b sd suport host plug
+ //don't shutdown polling
+ if (T_CARD_DRIVER_ID == host->pdev_id) {
+ return ;
+ }
+#endif
spin_lock_irqsave(&host->lock, flags);
host->polling_enabled = host->mmc->caps & MMC_CAP_NEEDS_POLL;
host->mmc->caps &= ~MMC_CAP_NEEDS_POLL;
@@ -1277,7 +1513,13 @@
struct msmsdcc_host *host =
container_of(h, struct msmsdcc_host, early_suspend);
unsigned long flags;
-
+#ifdef CONFIG_MACH_BLADE
+ //ruanmeisi_20100408 p729b sd suport host plug
+ //don't shutdown polling
+ if (T_CARD_DRIVER_ID == host->pdev_id) {
+ return ;
+ }
+#endif
if (host->polling_enabled) {
spin_lock_irqsave(&host->lock, flags);
host->mmc->caps |= MMC_CAP_NEEDS_POLL;
@@ -1427,7 +1669,11 @@
#ifdef CONFIG_MMC_MSM_SDIO_SUPPORT
mmc->caps |= MMC_CAP_SDIO_IRQ;
#endif
-
+ //ruanmeisi 20100221
+ if (T_CARD_DRIVER_ID == host->pdev_id) {
+ mmc->caps |= MMC_CAP_NEEDS_POLL;
+ }
+ //end
mmc->max_phys_segs = NR_SG;
mmc->max_hw_segs = NR_SG;
mmc->max_blk_size = 4096; /* MCI_DATA_CTL BLOCKSIZE up to 4096 */
@@ -1484,7 +1730,16 @@
disable_irq(host->plat->sdiowakeup_irq);
}
}
+//ruanmeisi_20100510
+/*
+ * Setup a command timer. We currently need this due to
+ * some 'strange' timeout / error handling situations.
+ */
+ init_timer(&host->command_timer);
+ host->command_timer.data = (unsigned long) host;
+ host->command_timer.function = msmsdcc_command_expired;
+//end
ret = request_irq(irqres->start, msmsdcc_irq, IRQF_SHARED,
DRIVER_NAME " (cmd)", host);
if (ret)
@@ -1522,6 +1777,8 @@
host->eject);
pr_info("%s: Power save feature enable = %d\n",
mmc_hostname(mmc), msmsdcc_pwrsave);
+ pr_info("%s: Dummy52 feature enable = %d\n",
+ mmc_hostname(mmc), plat->dummy52_required);
if (host->dma.channel != -1) {
pr_info("%s: DM non-cached buffer at %p, dma_addr 0x%.8x\n",
@@ -1540,6 +1797,8 @@
if (ret)
goto irq_free;
}
+//ruanmeisi
+ INIT_WORK(&host->redetect, msmsdcc_mmc_redetect);
return 0;
irq_free:
free_irq(irqres->start, host);
@@ -1584,6 +1843,9 @@
DBG(host, "Removing SDCC2 device = %d\n", pdev->id);
plat = host->plat;
+ //ruanmeisi_20100510
+ del_timer_sync(&host->command_timer);
+ //end
if (!plat->status_irq)
sysfs_remove_group(&pdev->dev.kobj, &dev_attr_grp);
@@ -1623,6 +1885,46 @@
}
#ifdef CONFIG_PM
+/* ATHENV */
+struct msmsdcc_host *wlan_host;
+void plat_disable_wlan_slot(void)
+{
+ struct msmsdcc_host *host = wlan_host;
+
+ if (host->plat->status_irq)
+ disable_irq(host->plat->status_irq);
+ writel(0, host->base + MMCIMASK0);
+ if (host->clks_on) {
+ clk_disable(host->clk);
+ clk_disable(host->pclk);
+ host->clks_on = 0;
+ }
+ if (host->plat->sdiowakeup_irq)
+ enable_irq(host->plat->sdiowakeup_irq);
+}
+EXPORT_SYMBOL(plat_disable_wlan_slot);
+
+void plat_enable_wlan_slot(void)
+{
+ struct msmsdcc_host *host = wlan_host;
+ unsigned long flags;
+
+ spin_lock_irqsave(&host->lock, flags);
+ if (!host->clks_on) {
+ clk_enable(host->pclk);
+ clk_enable(host->clk);
+ host->clks_on = 1;
+ }
+ writel(host->mci_irqenable, host->base + MMCIMASK0);
+ spin_unlock_irqrestore(&host->lock, flags);
+ if (host->plat->sdiowakeup_irq)
+ disable_irq(host->plat->sdiowakeup_irq);
+ if (host->plat->status_irq)
+ enable_irq(host->plat->status_irq);
+
+}
+EXPORT_SYMBOL(plat_enable_wlan_slot);
+/* ATHENV */
static int
msmsdcc_suspend(struct platform_device *dev, pm_message_t state)
{
@@ -1634,12 +1936,21 @@
if (test_and_set_bit(0, &host->suspended))
return 0;
#endif
+ pr_info("%s pdev_id = %d\n", __FUNCTION__, host->pdev_id);
+
if (mmc) {
if (host->plat->status_irq)
disable_irq(host->plat->status_irq);
-
+#ifdef ATH_PATCH /* ATHENV+++ */
+ rc = mmc_suspend_host(mmc, state);
+ if (rc!=0) {
+ if (host->plat->status_irq)
+ enable_irq(host->plat->status_irq);
+ }
+#else
if (!mmc->card || mmc->card->type != MMC_TYPE_SDIO)
rc = mmc_suspend_host(mmc, state);
+#endif /* ATHENV--- */
if (!rc) {
writel(0, host->base + MMCIMASK0);
@@ -1649,9 +1960,19 @@
host->clks_on = 0;
}
}
-
+#ifdef ATH_PATCH /* ATHENV+++ */
+ if (mmc->last_suspend_error) {
+ /*
+ * save host for WoW mode
+ * Don't enable sdio wakeup irq before system suspend
+ */
+ wlan_host = host;
+ return 0;
+ }
+#else
if (host->plat->sdiowakeup_irq)
enable_irq(host->plat->sdiowakeup_irq);
+#endif /* ATHENV--- */
}
return rc;
}
@@ -1667,7 +1988,16 @@
if (!test_and_clear_bit(0, &host->suspended))
return 0;
#endif
+ pr_info("%s pdev_id = %d\n", __FUNCTION__, host->pdev_id);
+
if (mmc) {
+/* ATHENV+++ */
+ if (mmc->last_suspend_error) {
+ wlan_host = host;
+ mmc->last_suspend_error = 0;
+ return 0;
+ }
+/* ATHENV--- */
spin_lock_irqsave(&host->lock, flags);
if (!host->clks_on) {
clk_enable(host->pclk);
@@ -1678,11 +2008,14 @@
writel(host->mci_irqenable, host->base + MMCIMASK0);
spin_unlock_irqrestore(&host->lock, flags);
-
+#ifdef ATH_PATCH /* ATHENV+++ */
+ if (1) {
+#else
if (host->plat->sdiowakeup_irq)
disable_irq(host->plat->sdiowakeup_irq);
if (!mmc->card || mmc->card->type != MMC_TYPE_SDIO) {
+#endif /* ATHENV--- */
#ifdef CONFIG_MMC_MSM7X00A_RESUME_IN_WQ
schedule_work(&host->resume_task);
#else
@@ -1726,6 +2059,60 @@
},
};
+//ruanmeisi_091224 proc interface
+static int msm_sdcc_read_proc(
+ char *page, char **start, off_t off, int count, int *eof, void *data)
+{
+ int len = 0;
+ len = sprintf(page, "%s\n",
+ !!mmc_debug == 1?"on":"off");
+ return len;
+
+}
+
+static int msm_sdcc_write_proc(struct file *file, const char __user *buffer,
+ unsigned long count, void *data)
+{
+ char tmp[16] = {0};
+ int len = 0;
+ len = count;
+ if (count > sizeof(tmp)) {
+ len = sizeof(tmp) - 1;
+ }
+ if(copy_from_user(tmp, buffer, len))
+ return -EFAULT;
+ if (strstr(tmp, "on")) {
+ mmc_debug = 1;
+ } else if (strstr(tmp, "off")) {
+ mmc_debug = 0;
+ }
+ return count;
+
+}
+
+
+void
+init_mmc_proc(void)
+{
+ d_entry = create_proc_entry("msm_sdcc",
+ 0, NULL);
+ if (d_entry) {
+ d_entry->read_proc = msm_sdcc_read_proc;
+ d_entry->write_proc = msm_sdcc_write_proc;
+ d_entry->data = NULL;
+ }
+
+}
+
+void
+deinit_mmc_proc(void)
+{
+ if (NULL != d_entry) {
+ remove_proc_entry("msm_sdcc", NULL);
+ d_entry = NULL;
+ }
+}
+//end
static int __init msmsdcc_init(void)
{
#if defined(CONFIG_DEBUG_FS)
@@ -1736,11 +2123,17 @@
return ret;
}
#endif
+ //ruanmeisi_091224 proc interface
+ init_mmc_proc();
+ //end
return platform_driver_register(&msmsdcc_driver);
}
static void __exit msmsdcc_exit(void)
{
+ //ruanmeisi_091224 proc interface
+ deinit_mmc_proc();
+ //end
platform_driver_unregister(&msmsdcc_driver);
#if defined(CONFIG_DEBUG_FS)
diff -urB -x .git msm/drivers/mmc/host/msm_sdcc.h zte/drivers/mmc/host/msm_sdcc.h
--- msm/drivers/mmc/host/msm_sdcc.h Mon Nov 1 13:46:22 2010
+++ zte/drivers/mmc/host/msm_sdcc.h Thu Oct 28 11:55:28 2010
@@ -10,6 +10,7 @@
*
* - Based on mmci.h
*/
+/*ruanmeisi 20100510 ruanmeisi_20100510 timer for send command*/
#ifndef _MSM_SDCC_H
#define _MSM_SDCC_H
@@ -266,6 +267,11 @@
unsigned int mci_irqenable;
unsigned int dummy_52_needed;
unsigned int dummy_52_state;
+
+ //ruanmeisi_091224 redetect worker
+ struct work_struct redetect;
+ //ruanmeisi_20100510
+ struct timer_list command_timer;
};
diff -urB -x .git msm/drivers/mtd/devices/msm_nand.c zte/drivers/mtd/devices/msm_nand.c
--- msm/drivers/mtd/devices/msm_nand.c Mon Nov 1 14:21:30 2010
+++ zte/drivers/mtd/devices/msm_nand.c Mon Oct 18 10:12:04 2010
@@ -382,6 +382,11 @@
{0xd580b12c, 0xFFFFFFFF, (128<<20), 1, 2048, (2048<<6), 64, }, /*Micr*/
{0x5580baad, 0xFFFFFFFF, (256<<20), 1, 2048, (2048<<6), 64, }, /*Hynx*/
{0x5510baad, 0xFFFFFFFF, (256<<20), 1, 2048, (2048<<6), 64, }, /*Hynx*/
+
+#ifdef CONFIG_ZTE_PLATFORM
+ {0x5500bcec, 0xFFFFFFFF, (512<<20), 1, 2048, (2048<<6), 64,},
+ {0x5510bcad, 0xFFFFFFFF, (512<<20), 1, 2048, (2048<<6), 64, },
+#endif
/* Note: Width flag is 0 for 8 bit Flash and 1 for 16 bit flash */
/* Note: The First row will be filled at runtime during ONFI probe */
};
diff -urB -x .git msm/drivers/serial/msm_serial_hs.c zte/drivers/serial/msm_serial_hs.c
--- msm/drivers/serial/msm_serial_hs.c Mon Nov 1 13:46:22 2010
+++ zte/drivers/serial/msm_serial_hs.c Mon Oct 18 10:16:50 2010
@@ -528,6 +529,42 @@
return ret;
}
EXPORT_SYMBOL(msm_hs_tx_empty);
+
+#ifdef CONFIG_MODEMCTL
+
+
+unsigned int msm_hs_dm1_tx_empty(void)
+{
+ unsigned int data;
+ unsigned int ret = 0;
+
+
+ struct msm_hs_port *msm_uport = NULL;
+
+ printk(KERN_WARNING "@@@@ msm_hs_dm1_tx_empty++ \n");
+
+ msm_uport = &q_uart_port[1];
+ if(!msm_uport)
+ {
+ printk(KERN_WARNING "@@ Error get the device /dev/ttyHS1--q_uart_port[1], maybe not init \n");
+ return MODEMCTL_UARTDM1_UNINIT;
+ }
+
+ clk_enable(msm_uport->clk);
+
+ data = msm_hs_read(&(msm_uport->uport), UARTDM_SR_ADDR);
+ if (data & UARTDM_SR_TXEMT_BMSK)
+ ret = TIOCSER_TEMT;
+
+ clk_disable(msm_uport->clk);
+
+ printk(KERN_WARNING "@@@@ msm_hs_dm1_tx_empty-- the ret = %d\n", ret);
+
+ return ret;
+}
+EXPORT_SYMBOL(msm_hs_dm1_tx_empty);
+
+#endif
/*
* Standard API, Stop transmitter.
diff -urB -x .git msm/drivers/usb/function/mass_storage.c zte/drivers/usb/function/mass_storage.c
--- msm/drivers/usb/function/mass_storage.c Mon Nov 1 13:46:22 2010
+++ zte/drivers/usb/function/mass_storage.c Thu Oct 28 11:49:56 2010
@@ -43,6 +43,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/* ========================================================================================
+when who what, where, why comment tag
+-------- ---- ----------------------------- ----------------------
+2010-02-02 rms fsg_main_thread exit fail ruanmeisi_100203
+
+==========================================================================================*/
//#define DEBUG
//#define VERBOSE_DEBUG
//#define DUMP_MSGS
@@ -325,6 +331,8 @@
int thread_wakeup_needed;
struct completion thread_notifier;
+ //ruanmeisi_100203
+ struct completion thread_notifier_exit;
struct task_struct *thread_task;
int cmnd_size;
@@ -2475,7 +2483,9 @@
close_all_backing_files(fsg);
/* Let the unbind and cleanup routines know the thread has exited */
- complete_and_exit(&fsg->thread_notifier, 0);
+ //ruanmeisi_100203
+ complete(&fsg->thread_notifier);
+ complete_and_exit(&fsg->thread_notifier_exit, 0);
}
@@ -2705,6 +2715,10 @@
raise_exception(fsg, FSG_STATE_EXIT);
wait_for_completion(&fsg->thread_notifier);
+ /* The cleanup routine waits for this completion also */
+ //ruanmeisi
+ //complete(&fsg->thread_notifier);
+
}
/* Free the data buffers */
@@ -2814,6 +2828,8 @@
fsg->buffhds[NUM_BUFFERS - 1].next = &fsg->buffhds[0];
fsg->state = FSG_STATE_IDLE;
+ //ruanmeisi_100203
+ init_completion(&fsg->thread_notifier_exit);
fsg->thread_task = kthread_create(fsg_main_thread, fsg,
"USB mass_storage");
if (IS_ERR(fsg->thread_task)) {
@@ -2915,6 +2931,8 @@
init_rwsem(&fsg->filesem);
kref_init(&fsg->ref);
init_completion(&fsg->thread_notifier);
+ //ruanmeisi_100203
+ init_completion(&fsg->thread_notifier_exit);
the_fsg = fsg;
return 0;
@@ -2938,6 +2956,8 @@
wake_lock_destroy(&fsg->wake_lock_idle);
switch_dev_unregister(&fsg->sdev);
test_and_clear_bit(REGISTERED, &fsg->atomic_bitflags);
+ //ruanmeisi_100203
+ wait_for_completion(&fsg->thread_notifier_exit);
close_all_backing_files(fsg);
kref_put(&fsg->ref, fsg_release);
diff -urB -x .git msm/drivers/usb/function/msm_hsusb.c zte/drivers/usb/function/msm_hsusb.c
--- msm/drivers/usb/function/msm_hsusb.c Mon Nov 1 13:46:22 2010
+++ zte/drivers/usb/function/msm_hsusb.c Thu Oct 28 11:49:56 2010
@@ -16,6 +16,20 @@
* GNU General Public License for more details.
*
*/
+ /*
+ ========================================================================================
+when who what, where, why comment tag
+---------- ---------- ---------------------------------------------- -----------------
+2010-0528 rms ruanmeisi_20100528 if serial_number is not default,bind in kernel
+2010-04-20 HML config default pid & serialnumber in early-init HML_USB_20100513
+2010-05-06 wzy add pid 1354 1355 ZTE_USB_006
+2010-04-20 HML add bind select HML_USB_005
+2010-03-31 HML delay enum,restore usb mode as composition HML_USB_004
+ switch and modify some hsusb functions attr
+2010-01-21 HML Extend rpc for read/write,and store HML_USB_003
+ config info in nv.
+2010-02-11 HML eclair 5210 usb function modify USB-HML-001
+*/
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
@@ -73,8 +87,34 @@
#define is_phy_45nm() (PHY_MODEL(ui->phy_info) == USB_PHY_MODEL_45NM)
#define is_phy_external() (PHY_TYPE(ui->phy_info) == USB_PHY_EXTERNAL)
-static int pid = 0x9018;
+static int pid = 0x01351;
+//HML_USB_005 add usb bind mode
+enum usb_bind_mode {
+ BIND_IN_KERNEL=0,
+ BIND_IN_USER,
+} ;
+static enum usb_bind_mode g_bind_mode=BIND_IN_KERNEL; //hml
+int g_debug_enabled=0; //hml
+static int use_default_pid=0;
+static enum usb_bind_mode get_bind_mode(void)
+{
+ return g_bind_mode;
+}
+static void set_bind_mode(enum usb_bind_mode mode)
+{
+ g_bind_mode = mode;
+}
+// HML_USB_20100513- debug interface
+int get_debug_enabled(void)
+{
+ return g_debug_enabled;
+}
+EXPORT_SYMBOL(get_debug_enabled);
+void set_debug_enabled(int enabled)
+{
+ g_debug_enabled = enabled;
+}
struct usb_fi_ept {
struct usb_endpoint *ept;
struct usb_endpoint_descriptor desc;
@@ -122,8 +162,9 @@
static void usb_disable_pullup(struct usb_info *ui);
static struct workqueue_struct *usb_work;
+#ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11 //USB-HML-001
static void usb_chg_stop(struct work_struct *w);
-
+#endif
#define USB_STATE_IDLE 0
#define USB_STATE_ONLINE 1
#define USB_STATE_OFFLINE 2
@@ -151,6 +192,32 @@
USB_CHG_TYPE__INVALID
};
+//USB-HML-003 start, add enum type for nv read/write
+enum usb_opt_nv_item
+{
+ NV_BACK_LIGHT_I=77,//nv77 used for config/store usb mode
+ NV_FTM_MODE_I = 453// FTM mode
+};
+enum usb_opt_nv_type
+{
+ NV_READ=0,
+ NV_WRITE
+};
+/* usb mode enum
+*/
+enum usb_conf_mode
+{
+ HSU_CFG_ALL_INTERFACE=0,
+ HSU_CFG_ADB_MS,
+ HSU_CFG_ADB,
+ HSU_CFG_MS,
+ HSU_CFG_DIAG,
+ HSU_CFG_DIAG_NMEA_MODEM
+};
+#define NV_WRITE_SUCCESS 10 //used for rpc call write nv function
+// HML_USB_20100513:take care of the order,the 4th must to be 0x0112 used for test software.
+static int zte_usb_pid[]={0x1350,0x1351,0x1352,0x1353,0x0112,0x0111,0x1354,0x1355};//usb zte pid list
+//USB-HML-003 end
struct usb_info {
/* lock for register/queue/device state changes */
spinlock_t lock;
@@ -285,6 +352,7 @@
return sprintf(buf, "%s\n", (ui->online ? "online" : "offline"));
}
+#ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11 //USB-HML-001
#define USB_WALLCHARGER_CHG_CURRENT 1800
static int usb_get_max_power(struct usb_info *ui)
{
@@ -368,6 +436,7 @@
} else
pr_info("\n%s: Standard Downstream Port\n", __func__);
}
+#endif
int usb_msm_get_next_strdesc_id(char *str)
{
@@ -1589,8 +1658,9 @@
pr_info("hsusb reset interrupt\n");
ui->usb_state = USB_STATE_DEFAULT;
ui->configured = 0;
+ #ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11 //USB-HML-001
schedule_work(&ui->chg_stop);
-
+#endif
writel(readl(USB_ENDPTSETUPSTAT), USB_ENDPTSETUPSTAT);
writel(readl(USB_ENDPTCOMPLETE), USB_ENDPTCOMPLETE);
writel(0xffffffff, USB_ENDPTFLUSH);
@@ -1612,9 +1682,10 @@
if (n & STS_SLI) {
pr_info("hsusb suspend interrupt\n");
ui->usb_state = USB_STATE_SUSPENDED;
-
+#ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11 //USB-HML-001
/* stop usb charging */
schedule_work(&ui->chg_stop);
+#endif
}
if (n & STS_UI) {
@@ -1691,10 +1762,13 @@
ui->setup_req = usb_ept_alloc_req(&ui->ep0in, SETUP_BUF_SIZE);
ui->ep0out_req = usb_ept_alloc_req(&ui->ep0out, ui->ep0out.max_pkt);
+#ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11 //USB-HML-001
INIT_WORK(&ui->chg_stop, usb_chg_stop);
+ INIT_DELAYED_WORK(&ui->chg_legacy_det, usb_chg_legacy_detect);
+#endif
INIT_WORK(&ui->li.wakeup_phy, usb_lpm_wakeup_phy);
INIT_DELAYED_WORK(&ui->work, usb_do_work);
- INIT_DELAYED_WORK(&ui->chg_legacy_det, usb_chg_legacy_detect);
+
}
static int usb_is_online(struct usb_info *ui)
@@ -1969,7 +2043,7 @@
void usb_start(struct usb_info *ui)
{
- int i, ret;
+ int i;
for (i = 0; i < ui->num_funcs; i++) {
struct usb_function_info *fi = ui->func[i];
@@ -1990,6 +2064,7 @@
queue_delayed_work(usb_work, &ui->work, 0);
} else {
/*Initialize pm app RPC */
+ #ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11
ret = msm_pm_app_rpc_init();
if (ret) {
pr_err("%s: pm_app_rpc connect failed\n", __func__);
@@ -2021,6 +2096,12 @@
ui->active = 1;
ui->flags |= (USB_FLAG_START | USB_FLAG_RESET);
queue_delayed_work(usb_work, &ui->work, 0);
+ #else
+ printk("hml usb start !\n");
+ ui->active = 1;
+ ui->flags |= (USB_FLAG_START | USB_FLAG_RESET);
+ queue_delayed_work(usb_work, &ui->work, 0);
+ #endif
}
}
@@ -2049,7 +2130,9 @@
struct usb_info *ui = the_usb_info;
unsigned long enabled_functions = 0;
int i;
-
+ //ruanmeisi_20100513
+ use_default_pid = 0;
+ //end
if (!ui || ui->bound || !ui->pdev || !ui->composition)
return;
@@ -2113,8 +2196,9 @@
fi->func->ep0_out = &ui->ep0out;
fi->func->ep0_in = &ui->ep0in;
pr_info("%s: name = '%s', map = %d\n", __func__, driver->name, index);
-
- usb_try_to_bind();
+
+ if(BIND_IN_KERNEL == get_bind_mode())//HML_USB_005
+ usb_try_to_bind();
fail:
mutex_unlock(&usb_function_list_lock);
return ret;
@@ -2212,7 +2296,7 @@
int i;
unsigned long flags;
-
+ pr_info("%s: usb_switch_composition start pid =%d \n", __func__,pid);
if (!ui->active)
return;
if (!usb_validate_product_id(pid))
@@ -2233,11 +2317,11 @@
disable_irq(ui->gpio_irq[0]);
disable_irq(ui->gpio_irq[1]);
}
-
+#ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11
if (ui->usb_state == USB_STATE_NOTATTACHED
&& ui->vbus_sn_notif)
msm_pm_app_enable_usb_ldo(1);
-
+#endif
usb_lpm_exit(ui);
if (cancel_work_sync(&ui->li.wakeup_phy))
usb_lpm_wakeup_phy(NULL);
@@ -2405,8 +2489,10 @@
if ((flags & USB_FLAG_START) ||
(flags & USB_FLAG_RESET)) {
disable_irq(ui->irq);
+ #ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11 //USB-HML-01
if (ui->vbus_sn_notif)
msm_pm_app_enable_usb_ldo(1);
+ #endif
usb_clk_enable(ui);
usb_vreg_enable(ui);
usb_vbus_online(ui);
@@ -2419,9 +2505,11 @@
msm_hsusb_suspend_locks_acquire(ui, 1);
ui->state = USB_STATE_ONLINE;
usb_enable_pullup(ui);
+ #ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11 //USB-HML-001
schedule_delayed_work(
&ui->chg_legacy_det,
USB_CHG_DET_DELAY);
+ #endif
pr_info("hsusb: IDLE -> ONLINE\n");
} else {
ui->usb_state = USB_STATE_NOTATTACHED;
@@ -2430,8 +2518,10 @@
msleep(500);
usb_lpm_enter(ui);
pr_info("hsusb: IDLE -> OFFLINE\n");
+ #ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11 //USB-HML-01
if (ui->vbus_sn_notif)
msm_pm_app_enable_usb_ldo(0);
+ #endif
}
enable_irq(ui->irq);
break;
@@ -2443,6 +2533,7 @@
* the signal to go offline, we must honor it
*/
if (flags & USB_FLAG_VBUS_OFFLINE) {
+#ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11 //USB-HML-001
enum charger_type temp;
unsigned long f;
@@ -2463,16 +2554,18 @@
msm_chg_usb_i_is_not_available();
msm_chg_usb_charger_disconnected();
}
-
+ #endif
/* reset usb core and usb phy */
disable_irq(ui->irq);
if (ui->in_lpm)
usb_lpm_exit(ui);
usb_vbus_offline(ui);
usb_lpm_enter(ui);
+ #ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11 //USB-HML-01
if ((ui->vbus_sn_notif) &&
(ui->usb_state == USB_STATE_NOTATTACHED))
msm_pm_app_enable_usb_ldo(0);
+ #endif
ui->state = USB_STATE_OFFLINE;
enable_irq(ui->irq);
switch_set_state(&ui->sdev, 0);
@@ -2487,10 +2580,12 @@
}
if ((flags & USB_FLAG_RESUME) ||
(flags & USB_FLAG_CONFIGURE)) {
+ #ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11 //USB-HML-001
int maxpower = usb_get_max_power(ui);
if (maxpower > 0)
msm_chg_usb_i_is_available(maxpower);
+ #endif
if (flags & USB_FLAG_CONFIGURE)
switch_set_state(&ui->sdev, 1);
@@ -2518,9 +2613,11 @@
goto reset;
}
usb_enable_pullup(ui);
+ #ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11 //USB-HML-001
schedule_delayed_work(
&ui->chg_legacy_det,
USB_CHG_DET_DELAY);
+ #endif
pr_info("hsusb: OFFLINE -> ONLINE\n");
enable_irq(ui->irq);
break;
@@ -2546,7 +2643,9 @@
struct usb_info *ui = the_usb_info;
if (ui && online) {
+ #ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11 //USB-HML-01
msm_pm_app_enable_usb_ldo(1);
+ #endif
usb_lpm_exit(ui);
/* Turn on PHY comparators */
if (!(ulpi_read(ui, 0x30) & 0x01))
@@ -2685,6 +2784,7 @@
enable_irq(ui->irq);
}
+#ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11 //USB-HML-001
static void usb_chg_stop(struct work_struct *w)
{
struct usb_info *ui = the_usb_info;
@@ -2698,7 +2798,7 @@
if (temp == USB_CHG_TYPE__SDP)
msm_chg_usb_i_is_not_available();
}
-
+#endif
static void usb_vbus_online(struct usb_info *ui)
{
if (ui->in_lpm) {
@@ -2797,12 +2897,12 @@
struct usb_info *ui = the_usb_info;
/* disable and re-enable the D+ pullup */
- pr_info("hsusb: disable pullup\n");
+ printk("hml: hsusb disable pullup\n");
usb_disable_pullup(ui);
msleep(10);
- pr_info("hsusb: enable pullup\n");
+ printk("hml:hsusb enable pullup\n");
usb_enable_pullup(ui);
}
@@ -2871,7 +2971,7 @@
{
struct usb_info *ui = file->private_data;
unsigned long flags;
-
+ printk("hml: debug_write_reset start \n");
spin_lock_irqsave(&ui->lock, flags);
ui->flags |= USB_FLAG_RESET;
queue_delayed_work(usb_work, &ui->work, 0);
@@ -2992,6 +3092,160 @@
usb_function_enable(name, enable);
return size;
}
+/*
+**HML_USB_004 add sysfs interface
+*/
+static ssize_t msm_hsusb_show_serialnumber(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct usb_info *ui = the_usb_info;
+ int i = 0;
+ if (ui->pdata->serial_number) {
+ i = scnprintf(buf, PAGE_SIZE,
+ "%s\n",
+ ui->pdata->serial_number);
+ }
+ return i;
+}
+
+char g_serial_number[256] = {0};
+
+static ssize_t msm_hsusb_store_serialnumber(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t size)
+{
+ struct usb_info *ui = the_usb_info;
+ // reset iSerialNumber field for device descriptor
+ if (BIND_IN_USER == get_bind_mode()) {
+ strncpy(g_serial_number, buf, sizeof(g_serial_number));
+ g_serial_number[sizeof(g_serial_number) - 1] = 0;
+ ui->pdata->serial_number = g_serial_number;
+ if (ui->bound
+ && (desc_device.iSerialNumber >= 0)
+ && (desc_device.iSerialNumber < MAX_STRDESC_NUM)
+ && (ui->strdesc[desc_device.iSerialNumber])) {
+ char *tmp = kzalloc(strlen(g_serial_number) + 1, GFP_ATOMIC);
+ if(tmp) {
+ kfree(ui->strdesc[desc_device.iSerialNumber]);
+ ui->strdesc[desc_device.iSerialNumber] = tmp;
+ strcpy(ui->strdesc[desc_device.iSerialNumber], g_serial_number);
+ }
+ }
+ usb_try_to_bind();
+ }
+
+ return size;
+}
+//HML_USB_004 end
+/*
+** HML_USB_20100513 debug enable sysfs interface
+*/
+static ssize_t msm_hsusb_show_debug_enable(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ int i = 0;
+ i = scnprintf(buf, PAGE_SIZE,
+ "%d\n",
+ get_debug_enabled());
+
+ return i;
+}
+
+static ssize_t msm_hsusb_store_debug_enable(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t size)
+{
+ unsigned long debug_enable;
+ if (!strict_strtoul(buf, 16, &debug_enable)) {
+ set_debug_enabled((int)debug_enable);
+ pr_info("%s: Requested g_debug_enabled = %d\n", __func__,g_debug_enabled);
+ }
+ else
+ pr_info("%s: strict_strtoul conversion failed\n", __func__);
+
+ return size;
+}
+/*
+** HML_USB_20100513 debug enable sysfs interface
+*/
+static ssize_t msm_hsusb_show_pidnv(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ int i = 0;
+ i = scnprintf(buf, PAGE_SIZE,
+ "nv %d\n",
+ msm_hsusb_get_set_usb_conf_nv_value(NV_BACK_LIGHT_I,0,NV_READ));
+ return i;
+}
+
+static ssize_t msm_hsusb_set_pidnv(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t size)
+{
+ /* int i = 0; */
+ /* i = scnprintf(buf, PAGE_SIZE, */
+ /* "%s\n", */
+ /* use_default_pid?"use default pid":""); */
+
+ /* return i; */
+ int value;
+ sscanf(buf, "%d", &value);
+ msm_hsusb_get_set_usb_conf_nv_value(NV_BACK_LIGHT_I,value,NV_WRITE);
+ return size;
+}
+
+
+
+static ssize_t msm_hsusb_show_default_pid(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ /* int i = 0; */
+ /* i = scnprintf(buf, PAGE_SIZE, */
+ /* "%s\n", */
+ /* use_default_pid?"use default pid":""); */
+
+ /* return i; */
+ return 0;
+}
+
+
+
+static ssize_t msm_hsusb_store_default_pid(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t size)
+{
+ struct usb_info *ui = the_usb_info;
+ unsigned long default_pid;
+ int i;
+ if (1 != use_default_pid || BIND_IN_KERNEL == get_bind_mode() || ui->bound){
+ pr_info("usb:%s: use_default_pid %d bound %d\n", __func__,
+ use_default_pid,
+ ui->bound);
+ return size;
+ }
+ use_default_pid = 0;
+ if (!strict_strtoul(buf, 16, &default_pid)) {
+ //set_default_pid((int)default_pid);
+ pr_info("usb:%s: default_pid 0x%x\n", __func__,
+ (unsigned int)default_pid);
+ for (i = 0; i < ui->pdata->num_compositions; i++) {
+ if (ui->pdata->compositions[i].product_id
+ == default_pid) {
+ ui->composition = &ui->pdata->compositions[i];
+ break;
+ }
+ }
+ } else
+ pr_info("%s: strict_strtoul conversion failed\n", __func__);
+
+ return size;
+}
+
+// HML_USB_20100513 end
static ssize_t msm_hsusb_show_compswitch(struct device *dev,
struct device_attribute *attr,
char *buf)
@@ -3014,11 +3268,22 @@
const char *buf, size_t size)
{
unsigned long pid;
+ int i,temp_pid;
if (!strict_strtoul(buf, 16, &pid)) {
pr_info("%s: Requested New Product id = %lx\n", __func__, pid);
usb_switch_composition((unsigned short)pid);
- } else
+ //HML_USB_004 restore pid in nv77
+ temp_pid = (int)pid;
+ printk("HML: restore pid =0x%x %d\n",temp_pid, ARRAY_SIZE(zte_usb_pid));
+ for(i = 0; i < ARRAY_SIZE(zte_usb_pid); i++){
+ if(temp_pid == zte_usb_pid[i])
+ break;
+ }
+ if(NV_WRITE_SUCCESS == msm_hsusb_get_set_usb_conf_nv_value(NV_BACK_LIGHT_I,i,NV_WRITE))
+ printk("HML: usb config restore successful\n");
+ }
+ else
pr_info("%s: strict_strtoul conversion failed\n", __func__);
return size;
@@ -3082,6 +3347,16 @@
static DEVICE_ATTR(state, 0664, msm_hsusb_show_state, NULL);
static DEVICE_ATTR(lpm, 0664, msm_hsusb_show_lpm, NULL);
static DEVICE_ATTR(speed, 0664, msm_hsusb_show_speed, NULL);
+//HML_USB_004 add sysfs interface
+static DEVICE_ATTR(serialnumber, 0664,
+ msm_hsusb_show_serialnumber, msm_hsusb_store_serialnumber);
+//add debug and default pid interface
+static DEVICE_ATTR(debug_enable, 0664,
+ msm_hsusb_show_debug_enable, msm_hsusb_store_debug_enable);
+static DEVICE_ATTR(default_pid, 0664,
+ msm_hsusb_show_default_pid, msm_hsusb_store_default_pid);
+static DEVICE_ATTR(pidnv, 0664,
+ msm_hsusb_show_pidnv, msm_hsusb_set_pidnv);
static struct attribute *msm_hsusb_attrs[] = {
&dev_attr_composition.attr,
@@ -3090,6 +3365,10 @@
&dev_attr_state.attr,
&dev_attr_lpm.attr,
&dev_attr_speed.attr,
+ &dev_attr_serialnumber.attr,//HML_USB_004 add sysfs interface
+ &dev_attr_debug_enable.attr,//HML_USB_004 add sysfs interface
+ &dev_attr_default_pid.attr,//HML_USB_004 add sysfs interface
+ &dev_attr_pidnv.attr,//HML_USB_004 add sysfs interface
NULL,
};
static struct attribute_group msm_hsusb_attr_grp = {
@@ -3109,13 +3388,14 @@
\
static DEVICE_ATTR(function, S_IRUGO, show_##function, NULL);
+// HML_USB_004: change order of functions, and delete ethernet/rmnet, we don't support now!
msm_hsusb_func_attr(diag, 0);
-msm_hsusb_func_attr(adb, 1);
-msm_hsusb_func_attr(modem, 2);
-msm_hsusb_func_attr(nmea, 3);
-msm_hsusb_func_attr(mass_storage, 4);
-msm_hsusb_func_attr(ethernet, 5);
-msm_hsusb_func_attr(rmnet, 6);
+msm_hsusb_func_attr(modem, 1);
+msm_hsusb_func_attr(nmea, 2);
+msm_hsusb_func_attr(mass_storage, 3);
+msm_hsusb_func_attr(adb, 4);
+//msm_hsusb_func_attr(ethernet, 5);
+//msm_hsusb_func_attr(rmnet, 6);
static struct attribute *msm_hsusb_func_attrs[] = {
&dev_attr_diag.attr,
@@ -3123,8 +3403,8 @@
&dev_attr_modem.attr,
&dev_attr_nmea.attr,
&dev_attr_mass_storage.attr,
- &dev_attr_ethernet.attr,
- &dev_attr_rmnet.attr,
+ //&dev_attr_ethernet.attr,
+ //&dev_attr_rmnet.attr,
NULL,
};
@@ -3132,6 +3412,30 @@
.name = "functions",
.attrs = msm_hsusb_func_attrs,
};
+/*USB-HML-003: function used in usb_probe to indentity usb mode
+ * param:
+ * use_zte_config: if it's using zte signed pid list.
+*/
+static int usb_config_mode_by_nv(int use_zte_config)
+{
+ int usb_conf_nv=0;
+ int rc=0;
+ int *usb_pid;
+ usb_pid = zte_usb_pid;
+
+ usb_conf_nv = msm_hsusb_get_set_usb_conf_nv_value(NV_BACK_LIGHT_I,0,NV_READ);
+ printk("HML usb_probe: usb_conf_nv=%d, %d\n",
+ usb_conf_nv, ARRAY_SIZE(zte_usb_pid));
+ if (0 <= usb_conf_nv && usb_conf_nv < ARRAY_SIZE(zte_usb_pid)){
+ use_default_pid=0;
+ rc = usb_pid[usb_conf_nv];
+ } else {
+ rc = usb_pid[1]; //default adb +u port
+ use_default_pid=1;
+ }
+
+ return rc;
+}
static int __init usb_probe(struct platform_device *pdev)
{
@@ -3184,7 +3488,29 @@
ui->pdev = pdev;
ui->pdata = pdev->dev.platform_data;
-
+
+ //HML_USB_004 add
+ set_bind_mode((0x0112==ui->pdata->zte_pid)? BIND_IN_KERNEL:BIND_IN_USER);
+ //hemulu add to switch usbmode
+ pid = ui->pdata->zte_pid;
+ if(0x112!=pid)//ZTE-USB-HML-02 start: if it is FTM mode do not read usb conf nv
+ {
+ //USB-HML-003 rpc read nv77 value to config usb mode.
+ pid = usb_config_mode_by_nv(1);
+ printk("HML usb_probe: pid=0x%x\n",pid);
+ if(0x0112==pid)//to unify comport number with ftm and download mode
+ {
+ ui->pdata->serial_number = 0;
+ }
+ }
+
+ //ruanmeisi_20100528 if serial_number is not default,bind in kernel
+ if (NULL != ui->pdata->serial_number &&
+ 0 != strcmp(ui->pdata->serial_number, "ZTE-HSUSB")) {
+ set_bind_mode(BIND_IN_KERNEL);
+ }
+ //end
+
for (i = 0; i < ui->pdata->num_compositions; i++)
if (ui->pdata->compositions[i].product_id == pid) {
ui->composition = &ui->pdata->compositions[i];
@@ -3457,7 +3783,9 @@
/* rpc connect for phy_reset */
msm_hsusb_rpc_connect();
/* rpc connect for charging */
+ #ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11 //USB-HML-001
msm_chg_rpc_connect();
+ #endif
return platform_driver_register(&usb_driver);
}
@@ -3509,9 +3837,11 @@
usb_debugfs_uninit();
platform_driver_unregister(&usb_driver);
msm_hsusb_rpc_close();
+ #ifdef CONFIG_HSU_CHARGER_TYPE_DETECT_ON_ARM11 //USB-HML-01
msm_chg_rpc_close();
msm_pm_app_unregister_vbus_sn(&msm_hsusb_set_vbus_state);
msm_pm_app_rpc_deinit();
+ #endif
}
static void __exit usb_module_exit(void)
diff -urB -x .git msm/drivers/video/Kconfig zte/drivers/video/Kconfig
--- msm/drivers/video/Kconfig Mon Nov 1 13:46:22 2010
+++ zte/drivers/video/Kconfig Wed Oct 13 18:13:24 2010
@@ -2254,6 +2254,33 @@
bool
select FB_MSM_LCDC_PANEL
default n
+config FB_MSM_LCDC_HIMAX_WQVGA727
+ bool
+ select FB_MSM_LCDC_PANEL
+config FB_MSM_LCDC_HIMAX_WQVGA722
+ bool
+ select FB_MSM_LCDC_PANEL
+config FB_MSM_LCDC_LEAD_QVGA
+ bool
+ select FB_MSM_LCDC_PANEL
+ default n
+config FB_MSM_LCDC_HIMAX_QVGA
+ bool
+ select FB_MSM_LCDC_PANEL
+ default n
+config FB_MSM_LCDC_SAMSUNG_QVGA
+ bool
+ select FB_MSM_LCDC_PANEL
+ default n
+config FB_MSM_LCDC_OLED_WVGA
+ bool
+ select FB_MSM_LCDC_PANEL
+ default n
+
+config FB_MSM_LCDC_LEAD_HVGA
+ bool
+ select FB_MSM_LCDC_PANEL
+ default n
config FB_MSM_LCDC_SHARP_WVGA_PT
bool
@@ -2265,9 +2292,9 @@
select FB_MSM_LCDC_PANEL
default n
-choice
- prompt "LCD Panel"
- default FB_MSM_MDDI_AUTO_DETECT
+
+menu "LCD Panel"
+# default FB_MSM_MDDI_AUTO_DETECT
config FB_MSM_LCDC_PRISM_WVGA_PANEL
depends on FB_MSM_LCDC_HW
@@ -2282,7 +2309,53 @@
select FB_MSM_LCDC_GORDON_VGA
---help---
Support for LCDC Gordon VGA (480x640) panel
+config FB_MSM_LCDC_HIMAX_WQVGA_PANEL727
+ depends on FB_MSM_LCDC_HW
+ bool "LCDC HiMax WQVGA Panel Joe"
+ select FB_MSM_LCDC_HIMAX_WQVGA727
+ ---help---
+ Support for LCDC HiMax WQVGA (400x240) panel
+config FB_MSM_LCDC_HIMAX_WQVGA_PANEL722
+ depends on FB_MSM_LCDC_HW
+ bool "LCDC HiMax WQVGA Panel Raise"
+ select FB_MSM_LCDC_HIMAX_WQVGA722
+ ---help---
+ Support for LCDC HiMax WQVGA (400x240) panel
+config FB_MSM_LCDC_LEAD_QVGA_PANEL
+ depends on FB_MSM_LCDC_HW
+ bool "LCDC Lead QVGA Panel"
+ select FB_MSM_LCDC_LEAD_QVGA
+ ---help---
+ Support for LCDC Lead QVGA (240x320) panel
+config FB_MSM_LCDC_HIMAX_QVGA_PANEL
+ depends on FB_MSM_LCDC_HW
+ bool "LCDC HIMAX QVGA Panel"
+ select FB_MSM_LCDC_HIMAX_QVGA
+ ---help---
+ Support for LCDC HIMAX QVGA (240x320) panel
+
+config FB_MSM_LCDC_SAMSUNG_QVGA_PANEL
+ depends on FB_MSM_LCDC_HW
+ bool "LCDC SAMSUNG QVGA Panel"
+ select FB_MSM_LCDC_SAMSUNG_QVGA
+ ---help---
+ Support for LCDC SAMSUNG QVGA (240x320) panel
+
+config FB_MSM_LCDC_OLED_WVGA_PANEL
+ depends on FB_MSM_LCDC_HW
+ bool "LCDC Oled WVGA Panel"
+ select FB_MSM_LCDC_OLED_WVGA
+ ---help---
+ Support for LCDC Samsung Oled WVGA (480x800) panel
+
+config FB_MSM_LCDC_LEAD_HVGA_PANEL
+ depends on FB_MSM_LCDC_HW
+ bool "LCDC LEAD HVGA Panel"
+ select FB_MSM_LCDC_LEAD_HVGA
+ ---help---
+ Support for LCDC LEAD TFT HVGA (320x480) panel
+
config FB_MSM_LCDC_TOSHIBA_WVGA_PT_PANEL
depends on FB_MSM_LCDC_HW
bool "LCDC Toshiba WVGA PT Panel"
@@ -2356,7 +2429,7 @@
bool "NONE"
---help---
This will disable LCD panel
-endchoice
+endmenu
choice
prompt "Secondary LCD Panel"
diff -urB -x .git msm/drivers/video/msm/Makefile zte/drivers/video/msm/Makefile
--- msm/drivers/video/msm/Makefile Mon Nov 1 13:46:22 2010
+++ zte/drivers/video/msm/Makefile Wed Oct 13 18:13:22 2010
@@ -35,6 +35,7 @@
obj-y += mdp_dma.o
obj-y += mdp_dma_s.o
obj-y += mdp_vsync.o
+obj-y += mdp_dma_lcdc.o
obj-y += mdp_cursor.o
obj-y += mdp_dma_tv.o
@@ -87,7 +88,15 @@
obj-$(CONFIG_FB_MSM_LCDC_TOSHIBA_WVGA_PT) += lcdc_toshiba_wvga_pt.o
obj-$(CONFIG_FB_MSM_LCDC_SHARP_WVGA_PT) += lcdc_sharp_wvga_pt.o
obj-$(CONFIG_FB_MSM_HDMI_ADV7520_PANEL) += adv7520.o
+obj-$(CONFIG_FB_MSM_LCDC_HIMAX_WQVGA727) += lcdc_panel_wqvga727.o
+obj-$(CONFIG_FB_MSM_LCDC_HIMAX_WQVGA722) += lcdc_panel_wqvga722.o
+obj-$(CONFIG_FB_MSM_LCDC_LEAD_QVGA) += lcdc_panel_qvga_lead.o
+obj-$(CONFIG_FB_MSM_LCDC_HIMAX_QVGA) += lcdc_panel_qvga_himax.o
+obj-$(CONFIG_FB_MSM_LCDC_SAMSUNG_QVGA) += lcdc_panel_qvga_samsung.o
+obj-$(CONFIG_FB_MSM_LCDC_LEAD_HVGA) += lcdc_panel_hvga_lead.o
+
+obj-$(CONFIG_FB_MSM_LCDC_OLED_WVGA) += lcdc_panel_wvga_oled.o
obj-$(CONFIG_FB_MSM_TVOUT_NTSC) += tv_ntsc.o
obj-$(CONFIG_FB_MSM_TVOUT_PAL) += tv_pal.o
diff -urB -x .git msm/drivers/video/msm/lcdc.c zte/drivers/video/msm/lcdc.c
--- msm/drivers/video/msm/lcdc.c Mon Nov 1 14:21:30 2010
+++ zte/drivers/video/msm/lcdc.c Mon Oct 18 10:22:08 2010
@@ -118,8 +119,7 @@
if (lcdc_pdata && lcdc_pdata->lcdc_power_save)
lcdc_pdata->lcdc_power_save(0);
- if (lcdc_pdata && lcdc_pdata->lcdc_gpio_config)
- ret = lcdc_pdata->lcdc_gpio_config(0);
+
pm_qos_update_requirement(PM_QOS_SYSTEM_BUS_FREQ , "lcdc",
PM_QOS_DEFAULT_VALUE);
Only in zte/drivers/video/msm: lcdc_panel_hvga_lead.c
Only in zte/drivers/video/msm: lcdc_panel_qvga_himax.c
Only in zte/drivers/video/msm: lcdc_panel_qvga_lead.c
Only in zte/drivers/video/msm: lcdc_panel_qvga_samsung.c
Only in zte/drivers/video/msm: lcdc_panel_wqvga722.c
Only in zte/drivers/video/msm: lcdc_panel_wqvga727.c
Only in zte/drivers/video/msm: lcdc_panel_wvga_oled.c
diff -urB -x .git msm/drivers/video/msm/logo.c zte/drivers/video/msm/logo.c
--- msm/drivers/video/msm/logo.c Mon Nov 1 13:46:22 2010
+++ zte/drivers/video/msm/logo.c Mon Oct 18 10:34:14 2010
@@ -35,7 +36,7 @@
while (count--)
*ptr++ = val;
}
-
+#ifndef CONFIG_ZTE_PLATFORM
/* 565RLE image format: [count(2 bytes), rle(2 bytes)] */
int load_565rle_image(char *filename)
{
@@ -95,4 +96,68 @@
sys_close(fd);
return err;
}
+#else
+
+int load_565rle_image(char *filename)
+{
+ struct fb_info *info;
+ int fd, err = 0;
+ unsigned count, max;
+ unsigned short *data, *bits, *ptr;
+
+ info = registered_fb[0];
+ if (!info) {
+ printk(KERN_WARNING "%s: Can not access framebuffer\n",
+ __func__);
+ return -ENODEV;
+ }
+
+ fd = sys_open(filename, O_RDONLY, 0);
+ if (fd < 0) {
+ printk(KERN_WARNING "%s: Can not open %s\n",
+ __func__, filename);
+ return -ENOENT;
+ }
+
+ max = fb_width(info) * fb_height(info);
+ printk(KERN_WARNING "LUYA!!!!max=%d\n",max);
+ count = (unsigned)sys_lseek(fd, (off_t)0, 2);
+ printk(KERN_WARNING "LUYA!!!!count=%d\n",count);
+
+ if (count == 0) {
+ sys_close(fd);
+ err = -EIO;
+ goto err_logo_close_file;
+ }
+ sys_lseek(fd, (off_t)0, 0);
+ data = kmalloc(count, GFP_KERNEL);
+ if (!data) {
+ printk(KERN_WARNING "%s: Can not alloc data\n", __func__);
+ err = -ENOMEM;
+ goto err_logo_close_file;
+ }
+ if ((unsigned)sys_read(fd, (char *)data, count) != count) {
+ err = -EIO;
+ goto err_logo_free_data;
+ }
+
+ ptr = data+35;
+ bits = (unsigned short *)(info->screen_base);
+ while (max > 0) {
+
+ memset16(bits, ptr[0], 1 << 1);
+ bits += 1;
+ max -= 1;
+ ptr += 1;
+
+ }
+
+err_logo_free_data:
+ kfree(data);
+err_logo_close_file:
+ sys_close(fd);
+ return err;
+}
+#endif
+
EXPORT_SYMBOL(load_565rle_image);
diff -urB -x .git msm/drivers/video/msm/mdp_dma_lcdc.c zte/drivers/video/msm/mdp_dma_lcdc.c
--- msm/drivers/video/msm/mdp_dma_lcdc.c Mon Nov 1 13:46:22 2010
+++ zte/drivers/video/msm/mdp_dma_lcdc.c Mon Oct 18 10:34:56 2010
@@ -156,12 +157,23 @@
buf = (uint8 *) fbi->fix.smem_start;
buf += fbi->var.xoffset * bpp + fbi->var.yoffset * fbi->fix.line_length;
+#ifdef CONFIG_ZTE_PLATFORM
+ dma2_cfg_reg = DMA_PACK_ALIGN_MSB | DMA_DITHER_EN | DMA_OUT_SEL_LCDC;
+
+#else
dma2_cfg_reg = DMA_PACK_ALIGN_LSB | DMA_DITHER_EN | DMA_OUT_SEL_LCDC;
+#endif
if (mfd->fb_imgType == MDP_BGR_565)
dma2_cfg_reg |= DMA_PACK_PATTERN_BGR;
else
+ {
+ #ifdef CONFIG_FB_MSM_LCDC_OLED_WVGA
+ dma2_cfg_reg |= DMA_PACK_PATTERN_BGR;
+ #else
dma2_cfg_reg |= DMA_PACK_PATTERN_RGB;
+ #endif
+ }
if (bpp == 2)
dma2_cfg_reg |= DMA_IBUF_FORMAT_RGB565;
diff -urB -x .git msm/drivers/video/msm/msm_fb.c zte/drivers/video/msm/msm_fb.c
--- msm/drivers/video/msm/msm_fb.c Mon Nov 1 14:29:40 2010
+++ zte/drivers/video/msm/msm_fb.c Mon Oct 18 10:35:56 2010
@@ -48,7 +48,7 @@
#include "mdp4.h"
#ifdef CONFIG_FB_MSM_LOGO
-#define INIT_IMAGE_FILE "/logo.rle"
+#define INIT_IMAGE_FILE "/logo.bmp"
extern int load_565rle_image(char *filename);
#endif
@@ -237,7 +237,7 @@
return -ENOMEM;
mfd->panel_info.frame_count = 0;
- mfd->bl_level = mfd->panel_info.bl_max;
+ mfd->bl_level = mfd->panel_info.bl_max/4;
#ifdef CONFIG_FB_MSM_OVERLAY
mfd->overlay_play_enable = 1;
#endif
@@ -523,9 +523,9 @@
switch (blank_mode) {
case FB_BLANK_UNBLANK:
if (!mfd->panel_power_on) {
- mdelay(100);
ret = pdata->on(mfd->pdev);
if (ret == 0) {
+ mdelay(30);
mfd->panel_power_on = TRUE;
msm_fb_set_backlight(mfd,
@@ -555,14 +555,13 @@
mfd->op_enable = FALSE;
curr_pwr_state = mfd->panel_power_on;
+ msm_fb_set_backlight(mfd, 0, 0);
mfd->panel_power_on = FALSE;
mdelay(100);
ret = pdata->off(mfd->pdev);
if (ret)
mfd->panel_power_on = curr_pwr_state;
-
- msm_fb_set_backlight(mfd, 0, 0);
mfd->op_enable = TRUE;
}
break;
@@ -871,9 +870,6 @@
is writing directly to fb0, the framebuffer pitch
also needs to be 32 pixel aligned */
- if (mfd->index == 0)
- fix->line_length = ALIGN(panel_info->xres, 32) * bpp;
- else
fix->line_length = panel_info->xres * bpp;
fix->smem_len = fix->line_length * panel_info->yres * mfd->fb_page;
Only in zte/include/asm-arm: mach-types.h
Only in zte/include/linux: compile.h
Only in zte/include/linux/i2c: akm8973.h
diff -urB -x .git msm/include/linux/input.h zte/include/linux/input.h
--- msm/include/linux/input.h Mon Nov 1 13:46:23 2010
+++ zte/include/linux/input.h Mon Oct 18 13:50:40 2010
@@ -374,7 +374,13 @@
#define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */
#define KEY_DISPLAY_OFF 245 /* display device to off state */
-#define KEY_WIMAX 246
+#if defined(CONFIG_MACH_SMOOTH)
+#define KEY_FLIP_UP 246
+#define KEY_FLIP_DOWN 247
+#define KEY_WIMAX 248
+#else
+#define KEY_WIMAX 246
+#endif
/* Range 248 - 255 is reserved for special needs of AT keyboard driver */
Only in zte/include/linux: lis302dl.h
diff -urB -x .git msm/include/linux/mmc/host.h zte/include/linux/mmc/host.h
--- msm/include/linux/mmc/host.h Mon Nov 1 13:46:23 2010
+++ zte/include/linux/mmc/host.h Mon Oct 18 10:47:22 2010
@@ -148,8 +148,10 @@
struct mmc_card *card; /* device attached to this host */
wait_queue_head_t wq;
-
- struct delayed_work detect;
+
+ struct task_struct *claimer;
+ int claim_cnt;
+ struct delayed_work detect;
const struct mmc_bus_ops *bus_ops; /* current bus driver */
unsigned int bus_refs; /* reference counter */
@@ -180,7 +182,8 @@
int idle_timeout;
unsigned long auto_suspend_state;
#endif
- unsigned long private[0] ____cacheline_aligned;
+ int last_suspend_error;
+ unsigned long private[0] ____cacheline_aligned;
};
extern struct mmc_host *mmc_alloc_host(int extra, struct device *);
diff -urB -x .git msm/include/linux/msm_audio.h zte/include/linux/msm_audio.h
--- msm/include/linux/msm_audio.h Mon Nov 1 13:46:23 2010
+++ zte/include/linux/msm_audio.h Mon Oct 18 13:51:30 2010
@@ -227,6 +228,7 @@
#define SND_AVC_CTL _IOW(SND_IOCTL_MAGIC, 6, unsigned *)
#define SND_AGC_CTL _IOW(SND_IOCTL_MAGIC, 7, unsigned *)
+#define SND_SET_AUDIO_LOOPBACK _IOW(SND_IOCTL_MAGIC, 8, unsigned *)
struct msm_audio_pcm_config {
uint32_t pcm_feedback; /* 0 - disable > 0 - enable */
diff -urB -x .git msm/include/linux/netfilter_ipv4/ipt_ecn.h zte/include/linux/netfilter_ipv4/ipt_ecn.h
--- msm/include/linux/netfilter_ipv4/ipt_ecn.h Mon Nov 1 12:10:14 2010
+++ zte/include/linux/netfilter_ipv4/ipt_ecn.h Mon Oct 18 10:48:54 2010
@@ -18,8 +18,7 @@
#define IPT_ECN_OP_MATCH_MASK 0xce
-/* match info */
-struct ipt_ecn_info {
+ struct ipt_ecn_info {
u_int8_t operation;
u_int8_t invert;
u_int8_t ip_ect;
diff -urB -x .git msm/include/linux/netfilter_ipv4/ipt_ttl.h zte/include/linux/netfilter_ipv4/ipt_ttl.h
--- msm/include/linux/netfilter_ipv4/ipt_ttl.h Mon Nov 1 12:10:14 2010
+++ zte/include/linux/netfilter_ipv4/ipt_ttl.h Mon Oct 18 13:49:20 2010
@@ -5,10 +5,10 @@
#define _IPT_TTL_H
enum {
- IPT_TTL_EQ = 0, /* equals */
- IPT_TTL_NE, /* not equals */
- IPT_TTL_LT, /* less than */
- IPT_TTL_GT, /* greater than */
+ IPT_TTL_EQ = 0,
+ IPT_TTL_NE,
+ IPT_TTL_LT,
+ IPT_TTL_GT,
};
diff -urB -x .git msm/include/linux/netfilter_ipv6/ip6t_hl.h zte/include/linux/netfilter_ipv6/ip6t_hl.h
--- msm/include/linux/netfilter_ipv6/ip6t_hl.h Mon Nov 1 12:10:14 2010
+++ zte/include/linux/netfilter_ipv6/ip6t_hl.h Mon Oct 18 10:49:36 2010
@@ -6,10 +6,10 @@
#define _IP6T_HL_H
enum {
- IP6T_HL_EQ = 0, /* equals */
- IP6T_HL_NE, /* not equals */
- IP6T_HL_LT, /* less than */
- IP6T_HL_GT, /* greater than */
+ IP6T_HL_EQ = 0,
+ IP6T_HL_NE,
+ IP6T_HL_LT,
+ IP6T_HL_GT,
};
Only in zte/include/linux: zte_memlog.h
diff -urB -x .git msm/include/media/msm_camera.h zte/include/media/msm_camera.h
--- msm/include/media/msm_camera.h Mon Nov 1 13:46:23 2010
+++ zte/include/media/msm_camera.h Mon Oct 18 10:51:10 2010
@@ -15,6 +15,7 @@
* 02110-1301, USA.
*
*/
+
#ifndef __LINUX_MSM_CAMERA_H
#define __LINUX_MSM_CAMERA_H
@@ -106,6 +107,10 @@
#define MSM_CAM_IOCTL_AF_CTRL_DONE \
_IOW(MSM_CAM_IOCTL_MAGIC, 26, struct msm_ctrl_cmt_t *)
+
+#define MSM_CAM_IOCTL_FLASH_LED_ON_OFF_CFG \
+ _IOW(MSM_CAM_IOCTL_MAGIC, 27, uint32_t *)
+
#define MAX_SENSOR_NUM 3
#define MAX_SENSOR_NAME 32
@@ -175,26 +180,26 @@
void *value;
};
-#define CMD_GENERAL 0
-#define CMD_AXI_CFG_OUT1 1
+#define CMD_GENERAL 0
+#define CMD_AXI_CFG_OUT1 1
#define CMD_AXI_CFG_SNAP_O1_AND_O2 2
-#define CMD_AXI_CFG_OUT2 3
-#define CMD_PICT_T_AXI_CFG 4
-#define CMD_PICT_M_AXI_CFG 5
+#define CMD_AXI_CFG_OUT2 3
+#define CMD_PICT_T_AXI_CFG 4
+#define CMD_PICT_M_AXI_CFG 5
#define CMD_RAW_PICT_AXI_CFG 6
#define CMD_FRAME_BUF_RELEASE 7
-#define CMD_PREV_BUF_CFG 8
+#define CMD_PREV_BUF_CFG 8
#define CMD_SNAP_BUF_RELEASE 9
-#define CMD_SNAP_BUF_CFG 10
-#define CMD_STATS_DISABLE 11
+#define CMD_SNAP_BUF_CFG 10
+#define CMD_STATS_DISABLE 11
#define CMD_STATS_AEC_AWB_ENABLE 12
-#define CMD_STATS_AF_ENABLE 13
+#define CMD_STATS_AF_ENABLE 13
#define CMD_STATS_AEC_ENABLE 14
#define CMD_STATS_AWB_ENABLE 15
-#define CMD_STATS_ENABLE 16
+#define CMD_STATS_ENABLE 16
-#define CMD_STATS_AXI_CFG 17
+#define CMD_STATS_AXI_CFG 17
#define CMD_STATS_AEC_AXI_CFG 18
#define CMD_STATS_AF_AXI_CFG 19
#define CMD_STATS_AWB_AXI_CFG 20
@@ -214,9 +219,9 @@
#define UPDATE_STATS_INVALID 33
#define CMD_AXI_CFG_SNAP_GEMINI 34
-#define CMD_AXI_CFG_SNAP 35
-#define CMD_AXI_CFG_PREVIEW 36
-#define CMD_AXI_CFG_VIDEO 37
+#define CMD_AXI_CFG_SNAP 35
+#define CMD_AXI_CFG_PREVIEW 36
+#define CMD_AXI_CFG_VIDEO 37
#define CMD_STATS_IHIST_ENABLE 38
#define CMD_STATS_RS_ENABLE 39
@@ -381,8 +386,13 @@
#define CFG_GET_PICT_P_PL 25
#define CFG_GET_AF_MAX_STEPS 26
#define CFG_GET_PICT_MAX_EXP_LC 27
+ #define CFG_SET_SATURATION 28
+#define CFG_SET_SHARPNESS 29
+
+#define CFG_SET_AF 30
+#define CFG_SET_ISO 31
+#define CFG_MAX 32
#define CFG_SEND_WB_INFO 28
-#define CFG_MAX 29
#define MOVE_NEAR 0
#define MOVE_FAR 1
@@ -404,7 +414,70 @@
#define CAMERA_EFFECT_WHITEBOARD 6
#define CAMERA_EFFECT_BLACKBOARD 7
#define CAMERA_EFFECT_AQUA 8
-#define CAMERA_EFFECT_MAX 9
+#define CAMERA_EFFECT_BULISH 9
+#define CAMERA_EFFECT_REDDISH 10
+#define CAMERA_EFFECT_GREENISH 11
+#define CAMERA_EFFECT_MAX 12
+
+#define CAMERA_WB_MODE_AWB 1
+#define CAMERA_WB_MODE_CUSTOM 2
+#define CAMERA_WB_MODE_INCANDESCENT 3
+#define CAMERA_WB_MODE_FLUORESCENT 4
+#define CAMERA_WB_MODE_SUNLIGHT 5
+#define CAMERA_WB_MODE_CLOUDY 6
+#define CAMERA_WB_MODE_NIGHT 7
+#define CAMERA_WB_MODE_SHADE 8
+#define CAMERA_WB_MODE_MAX 9
+
+#define CAMERA_BRIGHTNESS_0 0
+#define CAMERA_BRIGHTNESS_1 1
+#define CAMERA_BRIGHTNESS_2 2
+#define CAMERA_BRIGHTNESS_3 3
+#define CAMERA_BRIGHTNESS_4 4
+#define CAMERA_BRIGHTNESS_5 5
+#define CAMERA_BRIGHTNESS_6 6
+#define CAMERA_BRIGHTNESS_MAX 7
+
+#define CAMERA_CONTRAST_0 0
+#define CAMERA_CONTRAST_1 1
+#define CAMERA_CONTRAST_2 2
+#define CAMERA_CONTRAST_3 3
+#define CAMERA_CONTRAST_4 4
+#define CAMERA_CONTRAST_MAX 5
+
+#define CAMERA_SATURATION_0 0
+#define CAMERA_SATURATION_1 1
+#define CAMERA_SATURATION_2 2
+#define CAMERA_SATURATION_3 3
+#define CAMERA_SATURATION_4 4
+#define CAMERA_SATURATION_MAX 5
+
+#define CAMERA_ISO_SET_AUTO 0
+#define CAMERA_ISO_SET_HJR 1
+#define CAMERA_ISO_SET_100 2
+#define CAMERA_ISO_SET_200 3
+#define CAMERA_ISO_SET_400 4
+#define CAMERA_ISO_SET_800 5
+#define CAMERA_ISO_SET_MAX 6
+
+#define CAMERA_ANTIBANDING_SET_OFF 0
+#define CAMERA_ANTIBANDING_SET_60HZ 1
+#define CAMERA_ANTIBANDING_SET_50HZ 2
+#define CAMERA_ANTIBANDING_SET_AUTO 3
+#define CAMERA_ANTIBANDING_MAX 4
+
+#define CAMERA_SHARPNESS_0 0
+#define CAMERA_SHARPNESS_1 1
+#define CAMERA_SHARPNESS_2 2
+#define CAMERA_SHARPNESS_3 3
+#define CAMERA_SHARPNESS_4 4
+#define CAMERA_SHARPNESS_5 5
+#define CAMERA_SHARPNESS_6 6
+#define CAMERA_SHARPNESS_7 7
+#define CAMERA_SHARPNESS_8 8
+#define CAMERA_SHARPNESS_9 9
+#define CAMERA_SHARPNESS_10 10
+#define CAMERA_SHARPNESS_MAX 11
struct sensor_pict_fps {
uint16_t prevfps;
@@ -446,6 +519,17 @@
uint16_t pictp_pl;
uint32_t pict_max_exp_lc;
uint16_t p_fps;
+
+
+ int8_t wb_mode;
+ int8_t brightness;
+ int8_t contrast;
+ int8_t saturation;
+ int8_t sharpness;
+ int8_t iso_val;
+ int8_t antibanding;
+ int8_t lensshading;
+
struct sensor_pict_fps gfps;
struct exp_gain_cfg exp_gain;
struct focus_cfg focus;
Only in zte/kernel: config_data.gz
Only in zte/kernel: config_data.h
Only in zte/kernel: timeconst.h
Only in zte/lib: crc32table.h
Only in zte/lib: gen_crc32table
diff -urB -x .git msm/net/ipv4/netfilter/ipt_ecn.c zte/net/ipv4/netfilter/ipt_ecn.c
--- msm/net/ipv4/netfilter/ipt_ecn.c Mon Nov 1 12:10:18 2010
+++ zte/net/ipv4/netfilter/ipt_ecn.c Mon Oct 18 10:56:38 2010
@@ -35,9 +35,7 @@
struct tcphdr _tcph;
const struct tcphdr *th;
- /* In practice, TCP match does this, so can't fail. But let's
- * be good citizens.
- */
+
th = skb_header_pointer(skb, ip_hdrlen(skb), sizeof(_tcph), &_tcph);
if (th == NULL) {
*hotdrop = false;
diff -urB -x .git msm/net/ipv6/af_inet6.c zte/net/ipv6/af_inet6.c
--- msm/net/ipv6/af_inet6.c Mon Nov 1 13:46:23 2010
+++ zte/net/ipv6/af_inet6.c Mon Oct 18 10:57:36 2010
@@ -88,9 +88,10 @@
}
#ifdef CONFIG_ANDROID_PARANOID_NETWORK
+
static inline int current_has_network(void)
{
- return (!current->euid || in_egroup_p(AID_INET) ||
+ return (!current_euid() || in_egroup_p(AID_INET) ||
in_egroup_p(AID_NET_RAW));
}
static inline int current_has_cap(int cap)
@@ -98,7 +99,7 @@
if (cap == CAP_NET_RAW && in_egroup_p(AID_NET_RAW))
return 1;
return capable(cap);
-}
+}
# else
static inline int current_has_network(void)
{
diff -urB -x .git msm/net/ipv6/netfilter/ip6t_hl.c zte/net/ipv6/netfilter/ip6t_hl.c
--- msm/net/ipv6/netfilter/ip6t_hl.c Mon Nov 1 12:10:18 2010
+++ zte/net/ipv6/netfilter/ip6t_hl.c Mon Oct 18 10:58:26 2010
@@ -1,12 +1,4 @@
-/* Hop Limit matching module */
-/* (C) 2001-2002 Maciej Soltysiak <solt@dns.toxicfilms.tv>
- * Based on HW's ttl module
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
#include <linux/ipv6.h>
#include <linux/module.h>
diff -urB -x .git msm/scripts/Makefile.clean zte/scripts/Makefile.clean
--- msm/scripts/Makefile.clean Mon Nov 1 12:10:20 2010
+++ zte/scripts/Makefile.clean Tue Oct 26 16:54:52 2010
@@ -14,7 +14,8 @@
# The filename Kbuild has precedence over Makefile
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
-include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
+#include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
+include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild)
# Figure out what we need to build from the various variables
# ==========================================================================
Only in zte/scripts: Makefile.clean.bak
Only in zte/scripts/basic: docproc
Only in zte/scripts/basic: fixdep
Only in zte/scripts/basic: hash
Only in zte/scripts: bin2c
Only in zte/scripts: conmakehash
Only in zte/scripts: ihex2fw
Only in zte/scripts: kallsyms
Only in zte/scripts/kconfig: conf
Only in zte/scripts/kconfig: lex.zconf.c
Only in zte/scripts/kconfig: zconf.hash.c
Only in zte/scripts/kconfig: zconf.tab.c
Only in zte/scripts/mod: elfconfig.h
Only in zte/scripts/mod: mk_elfconfig
Only in zte/scripts/mod: modpost
Only in zte/usr: gen_init_cpio
Only in zte/usr: initramfs_data.cpio.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment