summaryrefslogtreecommitdiff
path: root/ANDROID_3.4.5/include
diff options
context:
space:
mode:
Diffstat (limited to 'ANDROID_3.4.5/include')
-rw-r--r--ANDROID_3.4.5/include/asm-generic/errno.h3
-rw-r--r--ANDROID_3.4.5/include/asm-generic/gpio.h1
-rwxr-xr-xANDROID_3.4.5/include/linux/combo_mt66xx.h25
-rwxr-xr-xANDROID_3.4.5/include/linux/decompress/unlz4.h10
-rwxr-xr-xANDROID_3.4.5/include/linux/lz4.h89
-rw-r--r--ANDROID_3.4.5/include/linux/major.h7
-rwxr-xr-xANDROID_3.4.5/include/linux/mfd/vt1603/core.h44
-rw-r--r--ANDROID_3.4.5/include/linux/mmc/host.h19
-rwxr-xr-xANDROID_3.4.5/include/linux/mt5931_6622.h26
-rw-r--r--ANDROID_3.4.5/include/linux/mtd/bbm.h1
-rw-r--r--ANDROID_3.4.5/include/linux/mtd/mtd.h27
-rw-r--r--ANDROID_3.4.5/include/linux/mtd/nand.h159
-rw-r--r--ANDROID_3.4.5/include/linux/mtd/partitions.h2
-rw-r--r--ANDROID_3.4.5/include/linux/mtd/ubi.h25
-rw-r--r--ANDROID_3.4.5/include/linux/nfc/bcm2079x.h45
-rw-r--r--ANDROID_3.4.5/include/linux/nfc/pn544.h17
-rwxr-xr-xANDROID_3.4.5/include/linux/power/wmt_battery.h111
-rw-r--r--ANDROID_3.4.5/include/linux/pwm_backlight.h2
-rw-r--r--ANDROID_3.4.5/include/linux/sha256.h25
-rw-r--r--ANDROID_3.4.5/include/linux/suspend.h2
-rw-r--r--ANDROID_3.4.5/include/linux/usb.h3
-rw-r--r--ANDROID_3.4.5/include/linux/usb/hcd.h21
-rwxr-xr-xANDROID_3.4.5/include/linux/usb/rawbulk.h166
-rwxr-xr-xANDROID_3.4.5/include/linux/videodev2_wmt.h196
-rwxr-xr-xANDROID_3.4.5/include/linux/wmt-efuse-stub.h32
-rwxr-xr-xANDROID_3.4.5/include/linux/wmt-mb.h98
-rwxr-xr-xANDROID_3.4.5/include/linux/wmt-se.h37
-rwxr-xr-xANDROID_3.4.5/include/linux/wmt_battery.h37
-rw-r--r--ANDROID_3.4.5/include/mtd/mtd-abi.h24
-rw-r--r--ANDROID_3.4.5/include/mtd/mtd-user.h1
-rw-r--r--ANDROID_3.4.5/include/mtd/ubi-user.h3
-rw-r--r--ANDROID_3.4.5/include/net/ipv6.h20
-rw-r--r--ANDROID_3.4.5/include/net/ping.h50
-rw-r--r--ANDROID_3.4.5/include/net/transp_v6.h3
-rw-r--r--ANDROID_3.4.5/include/sound/asound.h5
-rw-r--r--ANDROID_3.4.5/include/sound/core.h3
36 files changed, 1320 insertions, 19 deletions
diff --git a/ANDROID_3.4.5/include/asm-generic/errno.h b/ANDROID_3.4.5/include/asm-generic/errno.h
index a1331ce5..3b626c3e 100644
--- a/ANDROID_3.4.5/include/asm-generic/errno.h
+++ b/ANDROID_3.4.5/include/asm-generic/errno.h
@@ -110,4 +110,7 @@
#define EHWPOISON 133 /* Memory page has hardware error */
+
+#define NEED_REPLACEMENT 180 /* nand flash data block need replacement */
+
#endif
diff --git a/ANDROID_3.4.5/include/asm-generic/gpio.h b/ANDROID_3.4.5/include/asm-generic/gpio.h
index 5f52690c..70ed842f 100644
--- a/ANDROID_3.4.5/include/asm-generic/gpio.h
+++ b/ANDROID_3.4.5/include/asm-generic/gpio.h
@@ -152,6 +152,7 @@ extern struct gpio_chip *gpiochip_find(const void *data,
*/
extern int gpio_request(unsigned gpio, const char *label);
extern void gpio_free(unsigned gpio);
+extern int gpio_re_enabled(unsigned gpio);
extern int gpio_direction_input(unsigned gpio);
extern int gpio_direction_output(unsigned gpio, int value);
diff --git a/ANDROID_3.4.5/include/linux/combo_mt66xx.h b/ANDROID_3.4.5/include/linux/combo_mt66xx.h
new file mode 100755
index 00000000..7f46cf7f
--- /dev/null
+++ b/ANDROID_3.4.5/include/linux/combo_mt66xx.h
@@ -0,0 +1,25 @@
+
+
+#ifndef __COMBO_MT66XX_H__
+#define __COMBO_MT66xx_H__
+
+struct mtk_wmt_platform_data {
+ /* GPIO pin config */
+ int pmu;
+ int rst;
+ int bgf_int;
+ int urt_cts;
+ int rtc;
+ int gps_sync;
+ int gps_lna;
+
+ /* kernel launcher parameter. */
+
+};
+
+struct mtk_sdio_eint_platform_data {
+ /* used for sdio eint. */
+ int sdio_eint;
+};
+
+#endif
diff --git a/ANDROID_3.4.5/include/linux/decompress/unlz4.h b/ANDROID_3.4.5/include/linux/decompress/unlz4.h
new file mode 100755
index 00000000..d5b68bf3
--- /dev/null
+++ b/ANDROID_3.4.5/include/linux/decompress/unlz4.h
@@ -0,0 +1,10 @@
+#ifndef DECOMPRESS_UNLZ4_H
+#define DECOMPRESS_UNLZ4_H
+
+int unlz4(unsigned char *inbuf, int len,
+ int(*fill)(void*, unsigned int),
+ int(*flush)(void*, unsigned int),
+ unsigned char *output,
+ int *pos,
+ void(*error)(char *x));
+#endif
diff --git a/ANDROID_3.4.5/include/linux/lz4.h b/ANDROID_3.4.5/include/linux/lz4.h
new file mode 100755
index 00000000..8bd8ad7e
--- /dev/null
+++ b/ANDROID_3.4.5/include/linux/lz4.h
@@ -0,0 +1,89 @@
+#ifndef __LZ4_H__
+#define __LZ4_H__
+/*
+ * LZ4 Kernel Interface
+ *
+ * Copyright (C) 2013, LG Electronics, Kyungsik Lee <kyungsik.lee@lge.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#define LZ4_MEM_COMPRESS (4096 * sizeof(unsigned char *))
+#define LZ4HC_MEM_COMPRESS (65538 * sizeof(unsigned char *))
+
+#define lz4_worst_compress(x) ((x) + ((x) / 255) + 16)
+
+/*
+ * lz4_compressbound()
+ * Provides the maximum size that LZ4 may output in a "worst case" scenario
+ * (input data not compressible)
+ */
+static inline size_t lz4_compressbound(size_t isize)
+{
+ return isize + (isize / 255) + 16;
+}
+
+/*
+ * lz4_compress()
+ * src : source address of the original data
+ * src_len : size of the original data
+ * dst : output buffer address of the compressed data
+ * This requires 'dst' of size LZ4_COMPRESSBOUND.
+ * dst_len : is the output size, which is returned after compress done
+ * workmem : address of the working memory.
+ * This requires 'workmem' of size LZ4_MEM_COMPRESS.
+ * return : Success if return 0
+ * Error if return (< 0)
+ * note : Destination buffer and workmem must be already allocated with
+ * the defined size.
+ */
+int lz4_compress(const unsigned char *src, size_t src_len,
+ unsigned char *dst, size_t *dst_len, void *wrkmem);
+
+ /*
+ * lz4hc_compress()
+ * src : source address of the original data
+ * src_len : size of the original data
+ * dst : output buffer address of the compressed data
+ * This requires 'dst' of size LZ4_COMPRESSBOUND.
+ * dst_len : is the output size, which is returned after compress done
+ * workmem : address of the working memory.
+ * This requires 'workmem' of size LZ4HC_MEM_COMPRESS.
+ * return : Success if return 0
+ * Error if return (< 0)
+ * note : Destination buffer and workmem must be already allocated with
+ * the defined size.
+ */
+int lz4hc_compress(const unsigned char *src, size_t src_len,
+ unsigned char *dst, size_t *dst_len, void *wrkmem);
+
+/*
+ * lz4_decompress()
+ * src : source address of the compressed data
+ * src_len : is the input size, whcih is returned after decompress done
+ * dest : output buffer address of the decompressed data
+ * actual_dest_len: is the size of uncompressed data, supposing it's known
+ * return : Success if return 0
+ * Error if return (< 0)
+ * note : Destination buffer must be already allocated.
+ * slightly faster than lz4_decompress_unknownoutputsize()
+ */
+int lz4_decompress(const unsigned char *src, size_t *src_len,
+ unsigned char *dest, size_t actual_dest_len);
+
+/*
+ * lz4_decompress_unknownoutputsize()
+ * src : source address of the compressed data
+ * src_len : is the input size, therefore the compressed size
+ * dest : output buffer address of the decompressed data
+ * dest_len: is the max size of the destination buffer, which is
+ * returned with actual size of decompressed data after
+ * decompress done
+ * return : Success if return 0
+ * Error if return (< 0)
+ * note : Destination buffer must be already allocated.
+ */
+int lz4_decompress_unknownoutputsize(const unsigned char *src, size_t src_len,
+ unsigned char *dest, size_t *dest_len);
+#endif
diff --git a/ANDROID_3.4.5/include/linux/major.h b/ANDROID_3.4.5/include/linux/major.h
index 6a8ca98c..14706398 100644
--- a/ANDROID_3.4.5/include/linux/major.h
+++ b/ANDROID_3.4.5/include/linux/major.h
@@ -171,7 +171,14 @@
#define VIOTAPE_MAJOR 230
+#define VD_MAJOR 236 /* For all Video Decoders & Encoders */
+#define CIPHER_MAJOR 238 /* For security engine */
+
+#define VID_MAJOR 241 /* For CMOS driver */
+#define MB_MAJOR 242 /* For WMT Memory Block driver */
+
#define BLOCK_EXT_MAJOR 259
#define SCSI_OSD_MAJOR 260 /* open-osd's OSD scsi device */
+#define CEC_MAJOR 261 /* for WMT HDMI CEC driver*/
#endif
diff --git a/ANDROID_3.4.5/include/linux/mfd/vt1603/core.h b/ANDROID_3.4.5/include/linux/mfd/vt1603/core.h
new file mode 100755
index 00000000..3dc639c2
--- /dev/null
+++ b/ANDROID_3.4.5/include/linux/mfd/vt1603/core.h
@@ -0,0 +1,44 @@
+/*++
+ * WonderMedia core driver for VT1603/VT1609
+ *
+ * Copyright c 2010 WonderMedia Technologies, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * WonderMedia Technologies, Inc.
+ * 4F, 533, Chung-Cheng Road, Hsin-Tien, Taipei 231, R.O.C
+--*/
+
+#ifndef __MFD_VT1603_CORE_H__
+#define __MFD_VT1603_CORE_H__
+
+enum vt1603_type {
+ VT1603 = 0,
+ VT1609 = 1,
+};
+
+struct vt1603 {
+ int (*reg_read)(struct vt1603 *vt1603, u8 reg, u8 *val);
+ int (*reg_write)(struct vt1603 *vt1603, u8 reg, u8 val);
+ void *control_data;
+ int type;
+ struct device *dev;
+};
+
+/* Device I/O API */
+int vt1603_reg_write(struct vt1603 *vt1603, u8 reg, u8 val);
+int vt1603_reg_read(struct vt1603 *vt1603, u8 reg, u8 *val);
+void vt1603_regs_dump(struct vt1603 *vt1603);
+
+#endif
diff --git a/ANDROID_3.4.5/include/linux/mmc/host.h b/ANDROID_3.4.5/include/linux/mmc/host.h
index 5674504e..39c2def3 100644
--- a/ANDROID_3.4.5/include/linux/mmc/host.h
+++ b/ANDROID_3.4.5/include/linux/mmc/host.h
@@ -15,6 +15,7 @@
#include <linux/device.h>
#include <linux/fault-inject.h>
#include <linux/wakelock.h>
+#include <linux/semaphore.h>
#include <linux/mmc/core.h>
#include <linux/mmc/pm.h>
@@ -123,6 +124,8 @@ struct mmc_host_ops {
void (*set_ios)(struct mmc_host *host, struct mmc_ios *ios);
int (*get_ro)(struct mmc_host *host);
int (*get_cd)(struct mmc_host *host);
+ int (*get_slot_status)(struct mmc_host *host);
+ void (*dump_host_regs)(struct mmc_host *host);
void (*enable_sdio_irq)(struct mmc_host *host, int enable);
@@ -335,11 +338,24 @@ struct mmc_host {
} embedded_sdio_data;
#endif
+#ifdef CONFIG_MMC_UNSAFE_RESUME
+ /* Use to record if the card attath staus change in suspend mode*/
+ int card_attath_status;
+
+#define card_attach_status_change 1
+#define card_attach_status_unchange 0
+#endif
+ /*Use to enable scan retry when request or cmd fail*/
+ int scan_retry;
+ bool card_scan_status; /*use to record if the card scan have done and card init OK 0:fail 1:OK*/
+ struct semaphore req_sema; /*use to handle request asynchronous, to prevent issue command in the same time*/
+ int wmt_host_index; /*use to identify the host number*/
+
unsigned long private[0] ____cacheline_aligned;
};
extern struct mmc_host *mmc_alloc_host(int extra, struct device *);
-extern int mmc_add_host(struct mmc_host *);
+extern int mmc_add_host(struct mmc_host *, bool);
extern void mmc_remove_host(struct mmc_host *);
extern void mmc_free_host(struct mmc_host *);
@@ -382,6 +398,7 @@ extern int mmc_power_restore_host(struct mmc_host *host);
extern void mmc_detect_change(struct mmc_host *, unsigned long delay);
extern void mmc_request_done(struct mmc_host *, struct mmc_request *);
+extern void mmc_force_remove_card(struct mmc_host *host);
extern int mmc_cache_ctrl(struct mmc_host *, u8);
diff --git a/ANDROID_3.4.5/include/linux/mt5931_6622.h b/ANDROID_3.4.5/include/linux/mt5931_6622.h
new file mode 100755
index 00000000..e7715119
--- /dev/null
+++ b/ANDROID_3.4.5/include/linux/mt5931_6622.h
@@ -0,0 +1,26 @@
+
+
+#ifndef __MT5931__H__
+#define __MT5931__H__
+
+struct mt5931_sdio_eint_platform_data {
+ /* used for sdio eint. */
+ int sdio_eint;
+};
+
+struct mtk_mt5931_platform_data {
+ /* GPIO pin config */
+ int pmu;
+ int rst;
+};
+
+struct mtk_mt6622_platform_data {
+ /* GPIO pin config */
+ int pmu;
+ int rst;
+
+ /* used for bt eint. */
+ int bt_eint;
+};
+
+#endif
diff --git a/ANDROID_3.4.5/include/linux/mtd/bbm.h b/ANDROID_3.4.5/include/linux/mtd/bbm.h
index 650ef352..5bc50e08 100644
--- a/ANDROID_3.4.5/include/linux/mtd/bbm.h
+++ b/ANDROID_3.4.5/include/linux/mtd/bbm.h
@@ -64,6 +64,7 @@ struct nand_bbt_descr {
int maxblocks;
int reserved_block_code;
uint8_t *pattern;
+ int page_offset[2]; /* used to record bad block signature in which pages.*/
};
/* Options for the bad block table descriptors */
diff --git a/ANDROID_3.4.5/include/linux/mtd/mtd.h b/ANDROID_3.4.5/include/linux/mtd/mtd.h
index cf5ea8cd..80affde5 100644
--- a/ANDROID_3.4.5/include/linux/mtd/mtd.h
+++ b/ANDROID_3.4.5/include/linux/mtd/mtd.h
@@ -31,6 +31,7 @@
#define MTD_CHAR_MAJOR 90
#define MTD_BLOCK_MAJOR 31
+#define MAX_MTD_DEVICES 32
#define MTD_ERASE_PENDING 0x01
#define MTD_ERASING 0x02
@@ -146,6 +147,11 @@ struct mtd_info {
uint32_t oobsize; // Amount of OOB data per block (e.g. 16)
uint32_t oobavail; // Available OOB bytes per block
+
+ uint32_t realerasesize; //dan_multi add for multi plane access
+ uint32_t realwritesize;
+ uint32_t realoobsize;
+ int planenum;
/*
* If erasesize is a power of 2 then the shift is stored in
@@ -193,10 +199,13 @@ struct mtd_info {
size_t *retlen, const u_char *buf);
int (*_read_oob) (struct mtd_info *mtd, loff_t from,
struct mtd_oob_ops *ops);
+ int (*read_bbinfo_facmk) (struct mtd_info *mtd, loff_t from,
+ struct mtd_oob_ops *ops); //Vincent 20090526
int (*_write_oob) (struct mtd_info *mtd, loff_t to,
struct mtd_oob_ops *ops);
int (*_get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf,
size_t len);
+ int (*get_para) (struct mtd_info *mtd, int chip);
int (*_read_fact_prot_reg) (struct mtd_info *mtd, loff_t from,
size_t len, size_t *retlen, u_char *buf);
int (*_get_user_prot_info) (struct mtd_info *mtd, struct otp_info *buf,
@@ -241,6 +250,20 @@ struct mtd_info {
struct module *owner;
struct device dev;
int usecount;
+ int blkcnt;
+ int pagecnt;
+ int dwECCBitNum;
+ int dwRetry;
+ int dwRdmz;
+ int dwDDR;
+ int id;
+ int id2;
+ unsigned int spec_clk;
+ int spec_tadl;
+ int bbt_sw_rdmz;
+ uint32_t pageSizek;
+ int ecc_err_cnt;
+ int ecc_err_level;
};
int mtd_erase(struct mtd_info *mtd, struct erase_info *instr);
@@ -358,6 +381,8 @@ static inline int mtd_can_have_bb(const struct mtd_info *mtd)
struct mtd_partition;
struct mtd_part_parser_data;
+extern int add_mtd_device(struct mtd_info *mtd);
+extern int del_mtd_device (struct mtd_info *mtd);
extern int mtd_device_parse_register(struct mtd_info *mtd,
const char **part_probe_types,
@@ -372,6 +397,8 @@ extern int __get_mtd_device(struct mtd_info *mtd);
extern void __put_mtd_device(struct mtd_info *mtd);
extern struct mtd_info *get_mtd_device_nm(const char *name);
extern void put_mtd_device(struct mtd_info *mtd);
+typedef int (*SF_FPTR)(int l);
+extern SF_FPTR wmt_sf_prot;
struct mtd_notifier {
diff --git a/ANDROID_3.4.5/include/linux/mtd/nand.h b/ANDROID_3.4.5/include/linux/mtd/nand.h
index 1482340d..19eb23c1 100644
--- a/ANDROID_3.4.5/include/linux/mtd/nand.h
+++ b/ANDROID_3.4.5/include/linux/mtd/nand.h
@@ -56,8 +56,8 @@ extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
* is supported now. If you add a chip with bigger oobsize/page
* adjust this accordingly.
*/
-#define NAND_MAX_OOBSIZE 576
-#define NAND_MAX_PAGESIZE 8192
+#define NAND_MAX_OOBSIZE 2560
+#define NAND_MAX_PAGESIZE 32768
/*
* Constants for hardware specific CLE/ALE/NCE function
@@ -91,8 +91,11 @@ extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
#define NAND_CMD_RNDIN 0x85
#define NAND_CMD_READID 0x90
#define NAND_CMD_ERASE2 0xd0
+#define NAND_CMD_ERASE3 0xd1
#define NAND_CMD_PARAM 0xec
#define NAND_CMD_RESET 0xff
+#define NAND_CMD_RESET_NO_STATUS_READ 0xFF1
+#define NAND_CMD_HYNIX_RETRY_END 0x38
#define NAND_CMD_LOCK 0x2a
#define NAND_CMD_UNLOCK1 0x23
@@ -122,6 +125,43 @@ extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
#define NAND_CMD_STATUS_RESET 0x7f
#define NAND_CMD_STATUS_CLEAR 0xff
+#define MULTI_READ_1CYCLE 0x200
+#define MULTI_READ_2CYCLE 0x201
+#define MULTI_COPY_1CYCLE 0x202
+#define MULTI_COPY_2CYCLE 0x203
+#define MULTI_COPY_3CYCLE 0x204
+#define COPY_BACK_1CYCLE 0x205
+#define COPY_BACK_2CYCLE 0x206
+
+
+/*
+ * Support Nand special commands
+ */
+#define CACHE_READ (1<<0)
+#define CACHE_PROG (1<<1)
+#define COPY_BACK (1<<2)
+#define INTEL_COPY_BACK (1<<3)
+#define RANDOM_INPUT (1<<4)
+#define RANDOM_OUTPUT (1<<5)
+#define PLANE2_READ (1<<6)
+#define PLANE2_PROG (1<<7)
+#define PLANE2_CACHE_READ (1<<8)
+#define PLANE2_CACHE_PROG (1<<9)
+#define PLANE2_COPY_BACK (1<<10)
+#define PLANE2_INTEL_COPY_BACK (1<<11)
+#define PLANE2_RANDOM_OUTPUT (1<<12)
+#define PLANE2_ERASE (1<<13)
+
+#define PLANE4_READ (1<<16)
+#define PLANE4_PROG (1<<17)
+#define PLANE4_CACHE_READ (1<<18)
+#define PLANE4_CACHE_PROG (1<<19)
+#define PLANE4_COPY_BACK (1<<20)
+#define PLANE4_INTEL_COPY_BACK (1<<21)
+#define PLANE4_RANDOM_OUTPUT (1<<22)
+#define PLANE4_ERASE (1<<23)
+
+
#define NAND_CMD_NONE -1
/* Status bits */
@@ -380,6 +420,10 @@ struct nand_ecc_ctrl {
int sndcmd);
int (*write_oob)(struct mtd_info *mtd, struct nand_chip *chip,
int page);
+ int (*read_bb_oob)(struct mtd_info *mtd,
+ struct nand_chip *chip,
+ int page,
+ int sndcmd);
};
/**
@@ -492,7 +536,7 @@ struct nand_chip {
int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
void (*select_chip)(struct mtd_info *mtd, int chip);
int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip);
- int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
+ int (*block_markbad)(struct mtd_info *mtd, loff_t ofs, int type);
void (*cmd_ctrl)(struct mtd_info *mtd, int dat, unsigned int ctrl);
int (*init_size)(struct mtd_info *mtd, struct nand_chip *this,
u8 *id_data);
@@ -506,12 +550,14 @@ struct nand_chip {
int status, int page);
int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
const uint8_t *buf, int page, int cached, int raw);
+ int (*get_para)(struct mtd_info *mtd, struct nand_chip *chip);
int chip_delay;
unsigned int options;
unsigned int bbt_options;
int page_shift;
+ int pagecnt_shift;
int phys_erase_shift;
int bbt_erase_shift;
int chip_shift;
@@ -542,6 +588,12 @@ struct nand_chip {
struct nand_bbt_descr *bbt_md;
struct nand_bbt_descr *badblock_pattern;
+ struct nand_bbt_descr *retry_pattern;
+ int page_offset[2];
+ struct nand_read_retry_param *cur_chip;
+ int realplanenum;
+ int bbt_plane[2];
+ int status_plane[2];
void *priv;
};
@@ -557,7 +609,11 @@ struct nand_chip {
#define NAND_MFR_STMICRO 0x20
#define NAND_MFR_HYNIX 0xad
#define NAND_MFR_MICRON 0x2c
+#define NAND_MFR_SANDISK 0x45
#define NAND_MFR_AMD 0x01
+#define NAND_MFR_INTEL 0x89
+#define NAND_MFR_MXIC 0xc2
+#define NAND_MFR_MIRA 0x92
#define NAND_MFR_MACRONIX 0xc2
/**
@@ -581,6 +637,74 @@ struct nand_flash_dev {
unsigned long options;
};
+#define BOOT_MAGIC_SIZE 0x8
+struct nand_rdtry_param_hdr {
+ unsigned char magic[BOOT_MAGIC_SIZE];
+ unsigned int nand_id; //nand id
+ unsigned int nand_id_5th; //nand 5th id
+ unsigned int eslc_reg_cnt; // Enhanced SLC register count.
+ unsigned int total_retry_cnt; // total retry count
+ unsigned int retry_reg_cnt; // retry register count
+ //unsigned char eslc[eslc_reg]; //eslc default data.
+ //unsigned char retry_data[total_retry_cnt * retry_reg_cnt]; /* param data */
+};
+//All
+struct nand_read_retry_param {
+ char magic[32];
+ unsigned int nand_id;
+ unsigned int nand_id_5th;
+ unsigned int eslc_reg_num;
+ unsigned char eslc_offset[32];
+ unsigned char eslc_def_value[32];
+ unsigned char eslc_set_value[32];
+ unsigned int retry_reg_num;
+ unsigned char retry_offset[32];
+ unsigned char retry_def_value[32];
+ unsigned char retry_value[256];
+ unsigned int otp_len;
+ unsigned char otp_offset[32];
+ unsigned char otp_data[32];
+ unsigned int total_try_times;
+ int cur_try_times;
+ int (*set_parameter)(struct mtd_info *mtd, int mode, int def_mode);
+ int (*get_parameter)(struct mtd_info *mtd, int mode);
+ int (*get_otp_table)(struct mtd_info *mtd, struct nand_chip *chip);
+ int retry; //1: in retry mode
+};
+/* #define RETRY_DEBUG */
+
+
+/* DannierChen-2009-10-07 add for new nand flash support list */
+#ifndef DWORD
+#define DWORD unsigned int
+#endif
+#define MAX_PRODUCT_NAME_LENGTH 0x20
+struct WMT_nand_flash_dev {
+ DWORD dwFlashID; //composed by 4 bytes of ID. For example:0xADF1801D
+ DWORD dwBlockCount; //block count of one chip. For example: 1024
+ DWORD dwPageSize; //page size. For example:2048(other value can be 512 or 4096)
+ DWORD dwSpareSize; //spare area size. For example:16(almost all kinds of nand is 16)
+ DWORD dwBlockSize; //block size = dwPageSize * PageCntPerBlock. For example:131072
+ DWORD dwAddressCycle; //address cycle 4 or 5
+ DWORD dwBI0Position; //BI0 page postion in block
+ DWORD dwBI1Position; //BI1 page postion in block
+ DWORD dwBIOffset; //BI offset in page
+ DWORD dwDataWidth; //data with X8 or X16
+ DWORD dwPageProgramLimit; //chip can program PAGE_PROGRAM_LIMIT times within the same page
+ DWORD dwSeqRowReadSupport; //whether support sequential row read, 1 = support 0 = not support
+ DWORD dwSeqPageProgram; //chip need sequential page program in a block. 1 = need
+ DWORD dwNandType; //MLC or SLC
+ DWORD dwECCBitNum; //ECC bit number needed
+ DWORD dwRWTimming; //NFC Read Pulse width and Read hold time, write so does. default =0x12101210
+ DWORD dwTadl; //NFC write TADL timeing config
+ DWORD dwDDR; //NFC support toshia ddr(toggle) mode = 1 not support = 0
+ DWORD dwRetry; //NFC Read Retry support = 1 not support = 0
+ DWORD dwRdmz; //NFC Randomizer support = 1 not support = 0
+ DWORD dwFlashID2; //composed by additional 2 bytes of ID from original 4 bytes.
+ DWORD dwSpeedUpCmd; /* supprot speed up nand command ex: 2-plane cache read and so on.. */
+ char ProductName[MAX_PRODUCT_NAME_LENGTH]; //product name. for example "HYNIX_NF_HY27UF081G2A"
+ unsigned long options;
+};
/**
* struct nand_manufacturers - NAND Flash Manufacturer ID Structure
* @name: Manufacturer name
@@ -591,18 +715,43 @@ struct nand_manufacturers {
char *name;
};
+extern struct WMT_nand_flash_dev WMT_nand_flash_ids[];
extern struct nand_flash_dev nand_flash_ids[];
extern struct nand_manufacturers nand_manuf_ids[];
extern int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd);
extern int nand_update_bbt(struct mtd_info *mtd, loff_t offs);
extern int nand_default_bbt(struct mtd_info *mtd);
-extern int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt);
+extern int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt, int allow_readfail);
+extern int nand_isbad_bbt_multi(struct mtd_info *mtd, loff_t offs, int allowbbt, int allow_readfail);
extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
int allowbbt);
extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, uint8_t *buf);
-
+extern struct nand_read_retry_param chip_table[];
+extern int hynix_get_parameter(struct mtd_info *mtd, int mode);
+extern int hynix_set_parameter(struct mtd_info *mtd, int mode, int def_mode);
+extern int hynix_get_otp(struct mtd_info *mtd, struct nand_chip *chip);
+extern int toshiba_get_parameter(struct mtd_info *mtd, int mode);
+extern int toshiba_set_parameter(struct mtd_info *mtd, int mode, int def_mode);
+extern int samsung_get_parameter(struct mtd_info *mtd, int mode);
+extern int samsung_set_parameter(struct mtd_info *mtd, int mode, int def_mode);
+extern int sandisk_get_parameter(struct mtd_info *mtd, int mode);
+extern int sandisk_set_parameter(struct mtd_info *mtd, int mode, int def_mode);
+extern int micron_get_parameter(struct mtd_info *mtd, int mode);
+extern int micron_set_parameter(struct mtd_info *mtd, int mode, int def_mode);
+
+
+
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+#endif
+#define READ_RETRY_CHIP_NUM ARRAY_SIZE(chip_table)
+#define ESLC_MODE 0
+#define READ_RETRY_MODE 1
+#define TEST_MODE 2
+#define DEFAULT_VALUE 0
+#define ECC_ERROR_VALUE 1
/**
* struct platform_nand_chip - chip level device structure
* @nr_chips: max. number of chips to scan for
diff --git a/ANDROID_3.4.5/include/linux/mtd/partitions.h b/ANDROID_3.4.5/include/linux/mtd/partitions.h
index 2475228c..e4f732ae 100644
--- a/ANDROID_3.4.5/include/linux/mtd/partitions.h
+++ b/ANDROID_3.4.5/include/linux/mtd/partitions.h
@@ -83,5 +83,5 @@ int mtd_is_partition(struct mtd_info *mtd);
int mtd_add_partition(struct mtd_info *master, char *name,
long long offset, long long length);
int mtd_del_partition(struct mtd_info *master, int partno);
-
+uint64_t mtd_get_device_size(struct mtd_info *mtd);
#endif
diff --git a/ANDROID_3.4.5/include/linux/mtd/ubi.h b/ANDROID_3.4.5/include/linux/mtd/ubi.h
index db4836be..c2e92b36 100644
--- a/ANDROID_3.4.5/include/linux/mtd/ubi.h
+++ b/ANDROID_3.4.5/include/linux/mtd/ubi.h
@@ -25,6 +25,8 @@
#include <linux/types.h>
#include <mtd/ubi-user.h>
+
+#define UBI_ALL -1
/*
* enum ubi_open_mode - UBI volume open mode constants.
*
@@ -198,6 +200,9 @@ void ubi_get_volume_info(struct ubi_volume_desc *desc,
struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode);
struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name,
int mode);
+
+void ubi_update_volume(struct ubi_volume_desc *desc);
+
struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode);
int ubi_register_volume_notifier(struct notifier_block *nb,
@@ -205,17 +210,27 @@ int ubi_register_volume_notifier(struct notifier_block *nb,
int ubi_unregister_volume_notifier(struct notifier_block *nb);
void ubi_close_volume(struct ubi_volume_desc *desc);
+void ubi_set_volume(struct ubi_volume_desc *desc);
+
int ubi_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset,
int len, int check);
int ubi_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf,
- int offset, int len, int dtype);
+ int offset, int len);
+
+int ubi_leb_read_oob(struct ubi_volume_desc *desc, int lnum, void *buf, int offset,
+ int len, void *spare);
+
+int ubi_leb_write_oob(struct ubi_volume_desc *desc, int lnum, const void *buf, int offset,
+ int len, void *spare, int dtype);
+
int ubi_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf,
- int len, int dtype);
+ int len);
int ubi_leb_erase(struct ubi_volume_desc *desc, int lnum);
int ubi_leb_unmap(struct ubi_volume_desc *desc, int lnum);
-int ubi_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype);
+int ubi_leb_map(struct ubi_volume_desc *desc, int lnum);
int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum);
int ubi_sync(int ubi_num);
+int ubi_flush(int ubi_num, int vol_id, int lnum);
/*
* This function is the same as the 'ubi_leb_read()' function, but it does not
@@ -234,7 +249,7 @@ static inline int ubi_read(struct ubi_volume_desc *desc, int lnum, char *buf,
static inline int ubi_write(struct ubi_volume_desc *desc, int lnum,
const void *buf, int offset, int len)
{
- return ubi_leb_write(desc, lnum, buf, offset, len, UBI_UNKNOWN);
+ return ubi_leb_write(desc, lnum, buf, offset, len);
}
/*
@@ -244,7 +259,7 @@ static inline int ubi_write(struct ubi_volume_desc *desc, int lnum,
static inline int ubi_change(struct ubi_volume_desc *desc, int lnum,
const void *buf, int len)
{
- return ubi_leb_change(desc, lnum, buf, len, UBI_UNKNOWN);
+ return ubi_leb_change(desc, lnum, buf, len);
}
#endif /* !__LINUX_UBI_H__ */
diff --git a/ANDROID_3.4.5/include/linux/nfc/bcm2079x.h b/ANDROID_3.4.5/include/linux/nfc/bcm2079x.h
new file mode 100644
index 00000000..689757aa
--- /dev/null
+++ b/ANDROID_3.4.5/include/linux/nfc/bcm2079x.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2012 Broadcom Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _BCM2079X_H
+#define _BCM2079X_H
+
+#define BCMNFC_MAGIC 0xFA
+
+/*
+ * BCMNFC power control via ioctl
+ * BCMNFC_POWER_CTL(0): power off
+ * BCMNFC_POWER_CTL(1): power on
+ * BCMNFC_WAKE_CTL(0): wake off
+ * BCMNFC_WAKE_CTL(1): wake on
+ */
+#define BCMNFC_POWER_CTL _IO(BCMNFC_MAGIC, 0x01)
+#define BCMNFC_CHANGE_ADDR _IO(BCMNFC_MAGIC, 0x02)
+#define BCMNFC_READ_FULL_PACKET _IO(BCMNFC_MAGIC, 0x03)
+#define BCMNFC_SET_WAKE_ACTIVE_STATE _IO(BCMNFC_MAGIC, 0x04)
+#define BCMNFC_WAKE_CTL _IO(BCMNFC_MAGIC, 0x05)
+#define BCMNFC_READ_MULTI_PACKETS _IO(BCMNFC_MAGIC, 0x06)
+
+struct bcm2079x_platform_data {
+ unsigned int irq_gpio;
+ unsigned int irq_no;
+ unsigned int en_gpio;
+ int wake_gpio;
+};
+
+#endif
diff --git a/ANDROID_3.4.5/include/linux/nfc/pn544.h b/ANDROID_3.4.5/include/linux/nfc/pn544.h
index 7ab8521f..11eb2236 100644
--- a/ANDROID_3.4.5/include/linux/nfc/pn544.h
+++ b/ANDROID_3.4.5/include/linux/nfc/pn544.h
@@ -32,6 +32,18 @@
#define PN544_MAX_I2C_TRANSFER 0x0400
#define PN544_MSG_MAX_SIZE 0x21 /* at normal HCI mode */
+
+#define PN544_MAGIC 0xE9
+
+/*
+ * PN544 power control via ioctl
+ * PN544_SET_PWR(0): power off
+ * PN544_SET_PWR(1): power on
+ * PN544_SET_PWR(2): reset and power on with firmware download enabled
+ */
+#define PN544_SET_PWR _IOW(PN544_MAGIC, 0x01, unsigned int)
+
+
/* ioctl */
#define PN544_CHAR_BASE 'P'
#define PN544_IOR(num, dtype) _IOR(PN544_CHAR_BASE, num, dtype)
@@ -41,6 +53,7 @@
#define PN544_GET_DEBUG PN544_IOW(3, unsigned int)
#define PN544_SET_DEBUG PN544_IOW(4, unsigned int)
+//#define PN544_SET_PWR PN544_IOW(5, unsigned int) //add 2014-7-10
/* Timing restrictions (ms) */
#define PN544_RESETVEN_TIME 30 /* 7 */
#define PN544_PVDDVEN_TIME 0
@@ -91,6 +104,10 @@ struct pn544_nfc_platform_data {
void (*enable) (int fw);
int (*test) (void);
void (*disable) (void);
+ int irq_gpio, ven_gpio, firm_gpio;
+ //int irq_enable, ven_enable, firm_enable;
+ int irq_active, ven_active, firm_active;
+
};
#endif /* __KERNEL__ */
diff --git a/ANDROID_3.4.5/include/linux/power/wmt_battery.h b/ANDROID_3.4.5/include/linux/power/wmt_battery.h
new file mode 100755
index 00000000..e721fa5e
--- /dev/null
+++ b/ANDROID_3.4.5/include/linux/power/wmt_battery.h
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2013 WonderMedia Technologies, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __LINUX_POWER_WMT_BATTERY_H__
+#define __LINUX_POWER_WMT_BATTERY_H__
+
+static inline int prefixcmp(const char *str, const char *prefix)
+{
+ for (; ; str++, prefix++)
+ if (!*prefix)
+ return 0;
+ else if (*str != *prefix)
+ return (unsigned char)*prefix - (unsigned char)*str;
+}
+
+#include <linux/power_supply.h>
+#include <mach/hardware.h>
+
+enum cable_type {
+ CABLE_TYPE_DC,
+ CABLE_TYPE_USB,
+ CABLE_TYPE_UNKNOWN,
+};
+
+enum {
+ CURRENT_SWITCH_DYNAMIC,
+ CURRENT_SWITCH_SLEEP,
+};
+
+enum {
+ PC_CONNECTED_NOT_CHARGING,
+ PC_CONNECTED_CHARGING,
+};
+
+#define USB_BASE_ADD (0xD8007800+WMT_MMAP_OFFSET)
+
+static inline int wmt_is_otg_plugin(void)
+{
+ return !(REG8_VAL(USB_BASE_ADD + 0x7F2) & BIT0);
+}
+
+static inline int wmt_is_dc_plugin(void)
+{
+ return (REG8_VAL(PM_CTRL_BASE_ADDR + 0x005d) & 0x01);
+}
+
+static inline void wmt_dcdet_irq_enable(void)
+{
+ uint32_t val;
+ // dcdet wakeup interrupt
+ PMTC_VAL |= BIT27;
+ val = PMWTC_VAL;
+ val &= ~(0xf << 12);
+ val |= 0x04 << 12;
+ PMWTC_VAL = val;
+ PMWE_VAL |= BIT27;
+
+ // dcdet interrupt
+ /* Register dcdet interrupt, edge trigger */
+ PMCIE_VAL |= BIT27;
+ WK_TRG_EN_VAL |= BIT27;
+ pmc_enable_wakeup_isr(WKS_DCDET, 4);
+}
+
+static inline void wmt_dcdet_irq_disable(void)
+{
+ pmc_disable_wakeup_isr(WKS_DCDET);
+}
+
+static inline int charger_get_status(void)
+{
+ struct power_supply *charger;
+ union power_supply_propval val;
+
+ charger = power_supply_get_by_name("ac");
+ if (!charger) {
+ pr_err("get ac power supply failed\n");
+ return -ENODEV;
+ }
+
+ charger->get_property(charger, POWER_SUPPLY_PROP_STATUS, &val);
+ return val.intval;
+}
+
+static inline int charger_is_full(void)
+{
+ return charger_get_status() == POWER_SUPPLY_STATUS_FULL;
+}
+
+static inline int wmt_charger_is_dc_plugin(void)
+{
+ return power_supply_is_system_supplied();
+}
+
+extern int wmt_is_pc_connected(void);
+extern void wmt_do_pc_connected(void);
+
+extern int parse_charger_led(void);
+extern void led_power_enable(int enable);
+
+#endif
diff --git a/ANDROID_3.4.5/include/linux/pwm_backlight.h b/ANDROID_3.4.5/include/linux/pwm_backlight.h
index 63d2df43..412b70c7 100644
--- a/ANDROID_3.4.5/include/linux/pwm_backlight.h
+++ b/ANDROID_3.4.5/include/linux/pwm_backlight.h
@@ -8,9 +8,11 @@
struct platform_pwm_backlight_data {
int pwm_id;
+ int invert;
unsigned int max_brightness;
unsigned int dft_brightness;
unsigned int lth_brightness;
+ unsigned int hth_brightness;
unsigned int pwm_period_ns;
int (*init)(struct device *dev);
int (*notify)(struct device *dev, int brightness);
diff --git a/ANDROID_3.4.5/include/linux/sha256.h b/ANDROID_3.4.5/include/linux/sha256.h
new file mode 100644
index 00000000..cf883a2e
--- /dev/null
+++ b/ANDROID_3.4.5/include/linux/sha256.h
@@ -0,0 +1,25 @@
+#ifndef _SHA256_H
+#define _SHA256_H
+
+#ifndef uint8
+#define uint8 unsigned char
+#endif
+
+#ifndef uint32
+#define uint32 unsigned long int
+#endif
+
+typedef struct
+{
+ uint32 total[2];
+ uint32 state[8];
+ uint8 buffer[64];
+}
+sha256_context;
+
+void sha256_starts( sha256_context *ctx );
+void sha256_update( sha256_context *ctx, uint8 *input, uint32 length );
+void sha256_finish( sha256_context *ctx, uint8 digest[32] );
+
+#endif /* sha256.h */
+
diff --git a/ANDROID_3.4.5/include/linux/suspend.h b/ANDROID_3.4.5/include/linux/suspend.h
index cd83059f..a79a28f5 100644
--- a/ANDROID_3.4.5/include/linux/suspend.h
+++ b/ANDROID_3.4.5/include/linux/suspend.h
@@ -335,7 +335,7 @@ static inline bool system_entering_hibernation(void) { return false; }
#define PM_POST_SUSPEND 0x0004 /* Suspend finished */
#define PM_RESTORE_PREPARE 0x0005 /* Going to restore a saved image */
#define PM_POST_RESTORE 0x0006 /* Restore failed */
-
+#define PM_HIBERNATION_FINISH 0x0007
extern struct mutex pm_mutex;
#ifdef CONFIG_PM_SLEEP
diff --git a/ANDROID_3.4.5/include/linux/usb.h b/ANDROID_3.4.5/include/linux/usb.h
index 26229fd8..90f35bbe 100644
--- a/ANDROID_3.4.5/include/linux/usb.h
+++ b/ANDROID_3.4.5/include/linux/usb.h
@@ -1018,6 +1018,9 @@ extern int usb_disabled(void);
#define URB_SETUP_MAP_LOCAL 0x00200000 /* HCD-local setup packet */
#define URB_DMA_SG_COMBINED 0x00400000 /* S-G entries were combined */
#define URB_ALIGNED_TEMP_BUFFER 0x00800000 /* Temp buffer was alloc'd */
+/*{CharlesTu, 2010.08.26, for test mode */
+#define URB_HCD_DRIVER_TEST 0xFFFF /* Do NOT hand back or free this URB */
+/*CharlesTu}*/
struct usb_iso_packet_descriptor {
unsigned int offset;
diff --git a/ANDROID_3.4.5/include/linux/usb/hcd.h b/ANDROID_3.4.5/include/linux/usb/hcd.h
index 5de41570..030f3610 100644
--- a/ANDROID_3.4.5/include/linux/usb/hcd.h
+++ b/ANDROID_3.4.5/include/linux/usb/hcd.h
@@ -476,6 +476,27 @@ struct usb_tt_clear {
extern int usb_hub_clear_tt_buffer(struct urb *urb);
extern void usb_ep0_reinit(struct usb_device *);
+/*{CharlesTu, 2010.08.26, for test mode */
+#define USB_PORT_FEAT_INDICATOR 22
+
+/*
+ * Hub Port Test Mode Selector Codes
+ * See USB 2.0 spec Table 11-24
+ */
+#define USB_PORT_TEST_J 0x01
+#define USB_PORT_TEST_K 0x02
+#define USB_PORT_TEST_SE0_NAK 0x03
+#define USB_PORT_TEST_PACKET 0x04
+#define USB_PORT_TEST_FORCE_ENABLE 0x05
+
+/*
+ * This is used for the Hi-Speed Host Electrical Tests
+ * on the root hub. See USB 2.0 spec 7.1.20 and the
+ * Embedded High-speed Host Electrical Test Procedure.
+ */
+#define USB_PORT_TEST_SINGLE_STEP_SET_FEATURE 0x00
+/*CharelsTu} */
+
/* (shifted) direction/type/recipient from the USB 2.0 spec, table 9.2 */
#define DeviceRequest \
((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_DEVICE)<<8)
diff --git a/ANDROID_3.4.5/include/linux/usb/rawbulk.h b/ANDROID_3.4.5/include/linux/usb/rawbulk.h
new file mode 100755
index 00000000..05a22b10
--- /dev/null
+++ b/ANDROID_3.4.5/include/linux/usb/rawbulk.h
@@ -0,0 +1,166 @@
+/*
+ * Rawbulk Driver from VIA Telecom
+ *
+ * Copyright (C) 2011 VIA Telecom, Inc.
+ * Author: Karfield Chen (kfchen@via-telecom.com)
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef __RAWBULK_H__
+#define __RAWBULK_H__
+
+#include <linux/usb.h>
+#include <linux/usb/ch9.h>
+#include <linux/usb/composite.h>
+#include <linux/usb/gadget.h>
+#include <linux/wakelock.h>
+#include <linux/device.h>
+#include <linux/tty.h>
+#include <linux/tty_driver.h>
+
+#define INTF_DESC 0
+#define BULKIN_DESC 1
+#define BULKOUT_DESC 2
+#define MAX_DESC_ARRAY 4
+
+#define NAME_BUFFSIZE 64
+#define MAX_ATTRIBUTES 10
+
+#define MAX_TTY_RX 4
+#define MAX_TTY_RX_PACKAGE 512
+#define MAX_TTY_TX 8
+#define MAX_TTY_TX_PACKAGE 64
+
+struct rawbulk_function {
+ int transfer_id;
+ const char *longname;
+ const char *shortname;
+ struct device *dev;
+
+ /* Controls */
+ spinlock_t lock;
+ int enable: 1;
+ int activated: 1; /* set when usb enabled */
+ int tty_opened: 1;
+
+ struct work_struct activator; /* asynic transaction starter */
+
+ struct wake_lock keep_awake;
+
+ /* USB Gadget related */
+ struct usb_function function;
+ struct usb_composite_dev *cdev;
+ struct usb_ep *bulk_out, *bulk_in;
+
+ int rts_state; /* Handshaking pins (outputs) */
+ int dtr_state;
+ int cts_state; /* Handshaking pins (inputs) */
+ int dsr_state;
+ int dcd_state;
+ int ri_state;
+
+ /* TTY related */
+ struct tty_struct *tty;
+ int tty_minor;
+ struct tty_port port;
+ spinlock_t tx_lock;
+ struct list_head tx_free;
+ struct list_head tx_inproc;
+ spinlock_t rx_lock;
+ struct list_head rx_free;
+ struct list_head rx_inproc;
+ struct list_head rx_throttled;
+ unsigned int last_pushed;
+
+ /* Transfer Controls */
+ int nups;
+ int ndowns;
+ int upsz;
+ int downsz;
+ int splitsz;
+ int autoreconn;
+ int pushable; /* Set to use push-way for upstream */
+
+ /* Descriptors and Strings */
+ struct usb_descriptor_header *fs_descs[MAX_DESC_ARRAY];
+ struct usb_descriptor_header *hs_descs[MAX_DESC_ARRAY];
+ struct usb_string string_defs[2];
+ struct usb_gadget_strings string_table;
+ struct usb_gadget_strings *strings[2];
+ struct usb_interface_descriptor interface;
+ struct usb_endpoint_descriptor fs_bulkin_endpoint;
+ struct usb_endpoint_descriptor hs_bulkin_endpoint;
+ struct usb_endpoint_descriptor fs_bulkout_endpoint;
+ struct usb_endpoint_descriptor hs_bulkout_endpoint;
+
+ /* Sysfs Accesses */
+ int max_attrs;
+ struct device_attribute attr[MAX_ATTRIBUTES];
+};
+
+enum transfer_id {
+ RAWBULK_TID_MODEM,
+ RAWBULK_TID_ETS,
+ RAWBULK_TID_AT,
+ RAWBULK_TID_PCV,
+ RAWBULK_TID_GPS,
+ _MAX_TID
+};
+
+#define RAWBULK_INCEPT_FLAG_ENABLE 0x01
+#define RAWBULK_INCEPT_FLAG_PUSH_WAY 0x02
+typedef int (*rawbulk_intercept_t)(struct usb_interface *interface, unsigned int flags);
+typedef void (*rawbulk_autoreconn_callback_t)(int transfer_id);
+
+struct rawbulk_function *rawbulk_lookup_function(int transfer_id);
+
+/* rawbulk tty io */
+int rawbulk_register_tty(struct rawbulk_function *fn);
+void rawbulk_unregister_tty(struct rawbulk_function *fn);
+
+int rawbulk_tty_stop_io(struct rawbulk_function *fn);
+int rawbulk_tty_start_io(struct rawbulk_function *fn);
+int rawbulk_tty_alloc_request(struct rawbulk_function *fn);
+void rawbulk_tty_free_request(struct rawbulk_function *fn);
+
+/* bind/unbind for gadget */
+int rawbulk_bind_function(int transfer_id, struct usb_function *function,
+ struct usb_ep *bulk_out, struct usb_ep *bulk_in,
+ rawbulk_autoreconn_callback_t autoreconn_callback);
+void rawbulk_unbind_function(int trasfer_id);
+int rawbulk_check_enable(struct rawbulk_function *fn);
+void rawbulk_disable_function(struct rawbulk_function *fn);
+
+/* bind/unbind host interfaces */
+int rawbulk_bind_host_interface(struct usb_interface *interface,
+ rawbulk_intercept_t inceptor);
+void rawbulk_unbind_host_interface(struct usb_interface *interface);
+
+/* operations for transactions */
+int rawbulk_start_transactions(int transfer_id, int nups, int ndowns,
+ int upsz, int downsz, int splitsz, int pushable);
+void rawbulk_stop_transactions(int transfer_id);
+int rawbulk_halt_transactions(int transfer_id);
+int rawbulk_resume_transactions(int transfer_id);
+
+int rawbulk_suspend_host_interface(int transfer_id, pm_message_t message);
+int rawbulk_resume_host_interface(int transfer_id);
+int rawbulk_push_upstream_buffer(int transfer_id, const void *buffer,
+ unsigned int length);
+
+int rawbulk_forward_ctrlrequest(const struct usb_ctrlrequest *ctrl);
+
+/* statics and state */
+int rawbulk_transfer_statistics(int transfer_id, char *buf);
+int rawbulk_transfer_state(int transfer_id);
+
+#endif /* __RAWBULK_HEADER_FILE__ */
diff --git a/ANDROID_3.4.5/include/linux/videodev2_wmt.h b/ANDROID_3.4.5/include/linux/videodev2_wmt.h
new file mode 100755
index 00000000..53d19f51
--- /dev/null
+++ b/ANDROID_3.4.5/include/linux/videodev2_wmt.h
@@ -0,0 +1,196 @@
+#ifndef __LINUX_VIDEODEV2_WMT_H
+#define __LINUX_VIDEODEV2_WMT_H
+
+#include <linux/videodev2.h>
+
+#define WMT_V4L2_CID_CAMERA_SCENEMODE 0
+#define WMT_V4L2_CID_CAMERA_WHITEBALANCE 1
+#define WMT_V4L2_CID_CAMERA_ANTIBANDING 2
+#define WMT_V4L2_CID_CAMERA_FLASH 3
+#define WMT_V4L2_CID_CAMERA_EXPOSURE 4
+#define WMT_V4L2_CID_HFLIP 5
+#define WMT_V4L2_CID_VFLIP 6
+
+/* CID extensions */
+#define V4L2_CID_CAMERA_SCENE_MODE (V4L2_CID_PRIVATE_BASE+0)
+enum v4l2_scene_mode {
+ SCENE_MODE_BASE = 0,
+ SCENE_MODE_AUTO = 0,
+ SCENE_MODE_NIGHTSHOT,
+ SCENE_MODE_PORTRAIT,
+ SCENE_MODE_BACK_LIGHT,
+ SCENE_MODE_LANDSCAPE,
+ SCENE_MODE_SPORTS,
+ SCENE_MODE_PARTY_INDOOR,
+ SCENE_MODE_BEACH_SNOW,
+ SCENE_MODE_SUNSET,
+ SCENE_MODE_DUSK_DAWN,
+ SCENE_MODE_FALL_COLOR,
+ SCENE_MODE_FIREWORKS,
+ SCENE_MODE_TEXT,
+ SCENE_MODE_CANDLE_LIGHT,
+ SCENE_MODE_MAX,
+};
+
+#define V4L2_CID_CAMERA_FLASH_MODE (V4L2_CID_PRIVATE_BASE+1)
+enum v4l2_flash_mode {
+ FLASH_MODE_BASE = 0,
+ FLASH_MODE_OFF = 0,
+ FLASH_MODE_AUTO,
+ FLASH_MODE_ON,
+ FLASH_MODE_TORCH,
+ FLASH_MODE_STROBE,
+ FLASH_MODE_MAX,
+};
+
+#define V4L2_CID_CAMERA_ISO (V4L2_CID_PRIVATE_BASE+2)
+enum v4l2_iso_mode {
+ ISO_AUTO = 0,
+ ISO_50,
+ ISO_100,
+ ISO_200,
+ ISO_400,
+ ISO_800,
+ ISO_1600,
+ ISO_SPORTS,
+ ISO_NIGHT,
+ ISO_MOVIE,
+ ISO_MAX,
+};
+
+#define V4L2_CID_CAMERA_METERING (V4L2_CID_PRIVATE_BASE+3)
+enum v4l2_metering_mode {
+ METERING_BASE = 0,
+ METERING_MATRIX,
+ METERING_CENTER,
+ METERING_SPOT,
+ METERING_MAX,
+};
+
+#define V4L2_CID_CAMERA_WDR (V4L2_CID_PRIVATE_BASE+4)
+enum v4l2_wdr_mode {
+ WDR_OFF,
+ WDR_ON,
+ WDR_MAX,
+};
+
+#define V4L2_CID_CAMERA_ANTI_SHAKE (V4L2_CID_PRIVATE_BASE+5)
+enum v4l2_anti_shake_mode {
+ ANTI_SHAKE_OFF,
+ ANTI_SHAKE_STILL_ON,
+ ANTI_SHAKE_MOVIE_ON,
+ ANTI_SHAKE_MAX,
+};
+
+#define V4L2_CID_CAMERA_FOCUS_MODE (V4L2_CID_PRIVATE_BASE+6)
+enum v4l2_focusmode {
+ FOCUS_MODE_AUTO = 0,
+ FOCUS_MODE_MACRO,
+ FOCUS_MODE_FACEDETECT,
+ FOCUS_MODE_AUTO_DEFAULT,
+ FOCUS_MODE_MACRO_DEFAULT,
+ FOCUS_MODE_FACEDETECT_DEFAULT,
+ FOCUS_MODE_INFINITY,
+ FOCUS_MODE_FIXED,
+ FOCUS_MODE_CONTINUOUS,
+ FOCUS_MODE_CONTINUOUS_PICTURE,
+ FOCUS_MODE_CONTINUOUS_PICTURE_MACRO,
+ FOCUS_MODE_CONTINUOUS_VIDEO,
+ FOCUS_MODE_TOUCH,
+ FOCUS_MODE_MAX,
+ FOCUS_MODE_DEFAULT = (1 << 8),
+};
+
+#define V4L2_CID_CAMERA_AUTO_FOCUS_RESULT (V4L2_CID_PRIVATE_BASE+7)
+enum v4l2_focusresult {
+ FOCUS_RESULT_FOCUSING = 0,
+ FOCUS_RESULT_SUCCEED,
+ FOCUS_RESULT_FAILED,
+};
+
+#define V4L2_CID_CAMERA_FOCUS_POSITION_X (V4L2_CID_PRIVATE_BASE+8)
+#define V4L2_CID_CAMERA_FOCUS_POSITION_Y (V4L2_CID_PRIVATE_BASE+9)
+
+#define V4L2_CID_CAMERA_FLASH_MODE_AUTO (V4L2_CID_PRIVATE_BASE+10)
+
+#define V4L2_CID_CAMERA_ANTI_BANDING (V4L2_CID_PRIVATE_BASE+11)
+enum v4l2_anti_banding{
+ ANTI_BANDING_AUTO = 0,
+ ANTI_BANDING_50HZ = 1,
+ ANTI_BANDING_60HZ = 2,
+ ANTI_BANDING_OFF = 3,
+};
+
+
+// V4L2_CID_BRIGHTNESS
+enum v4l2_ev_mode {
+ EV_MINUS_4 = -4,
+ EV_MINUS_3 = -3,
+ EV_MINUS_2 = -2,
+ EV_MINUS_1 = -1,
+ EV_DEFAULT = 0,
+ EV_PLUS_1 = 1,
+ EV_PLUS_2 = 2,
+ EV_PLUS_3 = 3,
+ EV_PLUS_4 = 4,
+ EV_MAX,
+};
+
+// V4L2_CID_DO_WHITE_BALANCE
+enum v4l2_wb_mode {
+ WHITE_BALANCE_BASE = 0,
+ WHITE_BALANCE_AUTO = 0,
+ WHITE_BALANCE_INCANDESCENCE,
+ WHITE_BALANCE_FLUORESCENT,
+ WHITE_BALANCE_DAYLIGHT,
+ WHITE_BALANCE_CLOUDY,
+ WHITE_BALANCE_TWILIGHT,
+ WHITE_BALANCE_SHADE,
+ WHITE_BALANCE_MAX,
+};
+
+// V4L2_CID_CONTRAST
+enum v4l2_contrast_mode {
+ CONTRAST_MINUS_2 = 0,
+ CONTRAST_MINUS_1,
+ CONTRAST_DEFAULT,
+ CONTRAST_PLUS_1,
+ CONTRAST_PLUS_2,
+ CONTRAST_MAX,
+};
+
+// V4L2_CID_SATURATION
+enum v4l2_saturation_mode {
+ SATURATION_MINUS_2 = 0,
+ SATURATION_MINUS_1,
+ SATURATION_DEFAULT,
+ SATURATION_PLUS_1,
+ SATURATION_PLUS_2,
+ SATURATION_MAX,
+};
+
+// V4L2_CID_SHARPNESS
+enum v4l2_sharpness_mode {
+ SHARPNESS_MINUS_2 = 0,
+ SHARPNESS_MINUS_1,
+ SHARPNESS_DEFAULT,
+ SHARPNESS_PLUS_1,
+ SHARPNESS_PLUS_2,
+ SHARPNESS_MAX,
+};
+
+// V4L2_CID_EXPOSURE
+enum v4l2_exposure_mode {
+ EXPOSURE_MINUS_4,
+ EXPOSURE_MINUS_3,
+ EXPOSURE_MINUS_2 = -2,
+ EXPOSURE_MINUS_1 = -1,
+ EXPOSURE_DEFAULT = 0,
+ EXPOSURE_PLUS_1 = 1,
+ EXPOSURE_PLUS_2 = 2,
+ EXPOSURE_PLUS_3,
+ EXPOSURE_PLUS_4,
+ EXPOSURE_MAX
+};
+
+#endif /* #ifndef __LINUX_VIDEODEV2_WMT_H */
diff --git a/ANDROID_3.4.5/include/linux/wmt-efuse-stub.h b/ANDROID_3.4.5/include/linux/wmt-efuse-stub.h
new file mode 100755
index 00000000..d0111014
--- /dev/null
+++ b/ANDROID_3.4.5/include/linux/wmt-efuse-stub.h
@@ -0,0 +1,32 @@
+/*++
+ *
+ * Copyright c 2014 WonderMedia Technologies, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * WonderMedia Technologies, Inc.
+ * 4F, 533, Chung-Cheng Road, Hsin-Tien, Taipei 231, R.O.C
+--*/
+
+#ifndef WMT_EFUSE_STUB_H
+/* To assert that only one occurrence is included */
+#define WMT_EFUSE_STUB_H
+
+typedef int (*EFUSE_READ_OTP_STUB) (int type, unsigned char *rbuf, int rlen);
+
+extern EFUSE_READ_OTP_STUB wmt_efuse_read_otp;
+
+#endif /* ifndef WMT_EFUSE_STUB */
+
+/*=== END wmt-efuse-stub.h ==========================================================*/
diff --git a/ANDROID_3.4.5/include/linux/wmt-mb.h b/ANDROID_3.4.5/include/linux/wmt-mb.h
new file mode 100755
index 00000000..c5f3ae84
--- /dev/null
+++ b/ANDROID_3.4.5/include/linux/wmt-mb.h
@@ -0,0 +1,98 @@
+/*++
+ * WonderMedia Memory Block driver
+ *
+ * Copyright c 2010 WonderMedia Technologies, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * WonderMedia Technologies, Inc.
+ * 10F, 529, Chung-Cheng Road, Hsin-Tien, Taipei 231, R.O.C
+--*/
+#ifndef MEMBLOCK_H
+#define MEMBLOCK_H
+
+#include <linux/types.h>
+
+struct prdt_struct{
+ unsigned int addr;
+ unsigned short size;
+ unsigned short reserve : 15;
+ unsigned short EDT : 1;
+}__attribute__((packed)) ;
+
+struct mmu_table_info{
+ unsigned int addr;
+ unsigned int size;
+ unsigned int offset;
+}__attribute__((packed)) ;
+
+// 1 presents the task init that would never be released
+#define MB_DEF_TGID 0
+
+#ifdef CONFIG_WMT_MB_RESERVE_FROM_IO
+#define mb_virt_to_phys(v) mb_do_virt_to_phys(v,MB_DEF_TGID,THE_MB_USER)
+#define mb_phys_to_virt(p) mb_do_phys_to_virt(p,MB_DEF_TGID,THE_MB_USER)
+#else
+#define mb_virt_to_phys(v) virt_to_phys(v)
+#define mb_phys_to_virt(p) phys_to_virt(p)
+#endif
+#define mb_user_to_virt(u) mb_do_user_to_virt(u,MB_DEF_TGID,THE_MB_USER)
+#define mb_user_to_phys(u) mb_do_user_to_phys(u,MB_DEF_TGID,THE_MB_USER)
+/* all addresses are physical */
+#define mb_alloc(s) mb_do_alloc(s,MB_DEF_TGID,THE_MB_USER)
+#define mb_free(p) mb_do_free(p,MB_DEF_TGID,THE_MB_USER)
+#define mb_get(p) mb_do_get(p,MB_DEF_TGID,THE_MB_USER)
+#define mb_put(p) mb_do_put(p,MB_DEF_TGID,THE_MB_USER)
+#define mb_counter(p) mb_do_counter(p,THE_MB_USER)
+
+void *mb_do_phys_to_virt(unsigned long phys, pid_t, char *);
+unsigned long mb_do_virt_to_phys(void *virt, pid_t, char *);
+unsigned long mb_do_user_to_virt(unsigned long, pid_t, char *);
+unsigned long mb_do_user_to_phys(unsigned long, pid_t, char *);
+unsigned long mb_do_alloc(unsigned long, pid_t, char *);
+int mb_do_free(unsigned long, pid_t, char *);
+int mb_do_get(unsigned long, pid_t, char *);
+int mb_do_put(unsigned long, pid_t, char *);
+int mb_do_counter(unsigned long, char *);
+
+int user_to_prdt(
+ unsigned long user,
+ unsigned int size,
+ struct prdt_struct *next,
+ unsigned int items);
+
+unsigned int wmt_mmu_table_size(unsigned int size);
+void wmt_mmu_table_dump(struct mmu_table_info *info);
+int wmt_mmu_table_check(
+ unsigned int mmuPhys,
+ unsigned int mmuSize,
+ unsigned int size);
+unsigned int wmt_mmu_table_from_phys(
+ unsigned int mmuPhys,
+ unsigned int mmuSize,
+ unsigned int addr,
+ unsigned int size);
+unsigned int wmt_mmu_table_from_user(
+ unsigned int mmuPhys,
+ unsigned int mmuSize,
+ unsigned int user,
+ unsigned int size);
+unsigned int wmt_mmu_table_create(
+ unsigned int addr,
+ unsigned int size,
+ unsigned int addrType,
+ struct mmu_table_info *info);
+unsigned int wmt_mmu_table_destroy(struct mmu_table_info *info);
+
+#endif
diff --git a/ANDROID_3.4.5/include/linux/wmt-se.h b/ANDROID_3.4.5/include/linux/wmt-se.h
new file mode 100755
index 00000000..41382643
--- /dev/null
+++ b/ANDROID_3.4.5/include/linux/wmt-se.h
@@ -0,0 +1,37 @@
+/*++
+ * WonderMedia cipher driver
+ *
+ * Copyright c 2012 WonderMedia Technologies, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * WonderMedia Technologies, Inc.
+ * 4F, 533, Chung-Cheng Road, Hsin-Tien, Taipei 231, R.O.C
+--*/
+
+#ifndef WMT_SE_H
+/* To assert that only one occurrence is included */
+#define WMT_SE_H
+
+
+typedef int (*SE_FPTR)(unsigned char *buf_in, unsigned char *buf_out, int buf_len);
+
+extern SE_FPTR wmt_se_aes;
+extern SE_FPTR wmt_se_aes_core;
+extern SE_FPTR wmt_se_sha;
+
+
+#endif /* ifndef WMT_SE_H */
+
+/*=== END wmt-se.h ==========================================================*/
diff --git a/ANDROID_3.4.5/include/linux/wmt_battery.h b/ANDROID_3.4.5/include/linux/wmt_battery.h
new file mode 100755
index 00000000..eaca14c1
--- /dev/null
+++ b/ANDROID_3.4.5/include/linux/wmt_battery.h
@@ -0,0 +1,37 @@
+/*++
+linux/arch/arm/mach-wmt/board.c
+
+Copyright (c) 2008 WonderMedia Technologies, Inc.
+
+This program is free software: you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software Foundation,
+either version 2 of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE. See the GNU General Public License for more details.
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>.
+
+WonderMedia Technologies, Inc.
+10F, 529, Chung-Cheng Road, Hsin-Tien, Taipei 231, R.O.C.
+--*/
+#ifndef _LINUX_WMT_BAT_H
+#define _LINUX_WMT_BAT_H
+
+
+struct wmt_battery_info {
+ int batt_aux;
+ int temp_aux;
+ int charge_gpio;
+ int min_voltage;
+ int max_voltage;
+ int batt_div;
+ int batt_mult;
+ int temp_div;
+ int temp_mult;
+ int batt_tech;
+ char *batt_name;
+};
+
+#endif
diff --git a/ANDROID_3.4.5/include/mtd/mtd-abi.h b/ANDROID_3.4.5/include/mtd/mtd-abi.h
index 36eace03..fd098721 100644
--- a/ANDROID_3.4.5/include/mtd/mtd-abi.h
+++ b/ANDROID_3.4.5/include/mtd/mtd-abi.h
@@ -146,6 +146,27 @@ struct otp_info {
__u32 locked;
};
+struct env_info_user {
+ char varname[200];
+ char *varpoint;
+ char varval[512];
+ int varlen;
+};
+
+enum {
+ SIGNED_IMAGE_TYPE_WLOAD,
+ SIGNED_IMAGE_TYPE_UBOOT,
+ SIGNED_IMAGE_TYPE_UBOOT_ENV,
+};
+
+struct write_signed_image {
+ int type;
+ char * img_data;
+ int img_len;
+ char * sig_data;
+ int sig_len;
+ int flags; /* == 0 now */
+};
/*
* Note, the following ioctl existed in the past and was removed:
* #define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo)
@@ -202,6 +223,9 @@ struct otp_info {
* without OOB, e.g., NOR flash.
*/
#define MEMWRITE _IOWR('M', 24, struct mtd_write_req)
+#define MEMGETENV _IOR('M', 128, struct env_info_user)
+#define MEMSETENV _IOR('M', 129, struct env_info_user)
+#define MEM_WRITE_SIGNED_IMAGE _IOR('M', 130, struct write_signed_image)
/*
* Obsolete legacy interface. Keep it in order not to break userspace
diff --git a/ANDROID_3.4.5/include/mtd/mtd-user.h b/ANDROID_3.4.5/include/mtd/mtd-user.h
index 83327c80..d1ddd4a8 100644
--- a/ANDROID_3.4.5/include/mtd/mtd-user.h
+++ b/ANDROID_3.4.5/include/mtd/mtd-user.h
@@ -30,5 +30,6 @@ typedef struct erase_info_user erase_info_t;
typedef struct region_info_user region_info_t;
typedef struct nand_oobinfo nand_oobinfo_t;
typedef struct nand_ecclayout_user nand_ecclayout_t;
+typedef struct env_info_user env_data_t;
#endif /* __MTD_USER_H__ */
diff --git a/ANDROID_3.4.5/include/mtd/ubi-user.h b/ANDROID_3.4.5/include/mtd/ubi-user.h
index 3c410977..ae9230a9 100644
--- a/ANDROID_3.4.5/include/mtd/ubi-user.h
+++ b/ANDROID_3.4.5/include/mtd/ubi-user.h
@@ -267,7 +267,8 @@ struct ubi_attach_req {
__s32 ubi_num;
__s32 mtd_num;
__s32 vid_hdr_offset;
- __s8 padding[12];
+ __s16 max_beb_per1024;
+ __s8 padding[10];
};
/**
diff --git a/ANDROID_3.4.5/include/net/ipv6.h b/ANDROID_3.4.5/include/net/ipv6.h
index e4170a22..a5a9e4df 100644
--- a/ANDROID_3.4.5/include/net/ipv6.h
+++ b/ANDROID_3.4.5/include/net/ipv6.h
@@ -252,6 +252,14 @@ static inline void fl6_sock_release(struct ip6_flowlabel *fl)
atomic_dec(&fl->users);
}
+extern void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info);
+
+int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
+ struct icmp6hdr *thdr, int len);
+
+struct dst_entry *icmpv6_route_lookup(struct net *net, struct sk_buff *skb,
+ struct sock *sk, struct flowi6 *fl6);
+
extern int ip6_ra_control(struct sock *sk, int sel);
extern int ipv6_parse_hopopts(struct sk_buff *skb);
@@ -294,6 +302,18 @@ static inline int ipv6_addr_src_scope(const struct in6_addr *addr)
return __ipv6_addr_src_scope(__ipv6_addr_type(addr));
}
+static inline bool __ipv6_addr_needs_scope_id(int type)
+{
+ return type & IPV6_ADDR_LINKLOCAL ||
+ (type & IPV6_ADDR_MULTICAST &&
+ (type & (IPV6_ADDR_LOOPBACK|IPV6_ADDR_LINKLOCAL)));
+}
+
+static inline __u32 ipv6_iface_scope_id(const struct in6_addr *addr, int iface)
+{
+ return __ipv6_addr_needs_scope_id(__ipv6_addr_type(addr)) ? iface : 0;
+}
+
static inline int ipv6_addr_cmp(const struct in6_addr *a1, const struct in6_addr *a2)
{
return memcmp(a1, a2, sizeof(struct in6_addr));
diff --git a/ANDROID_3.4.5/include/net/ping.h b/ANDROID_3.4.5/include/net/ping.h
index 682b5ae9..b1717ae9 100644
--- a/ANDROID_3.4.5/include/net/ping.h
+++ b/ANDROID_3.4.5/include/net/ping.h
@@ -13,6 +13,7 @@
#ifndef _PING_H
#define _PING_H
+#include <net/icmp.h>
#include <net/netns/hash.h>
/* PING_HTABLE_SIZE must be power of 2 */
@@ -28,6 +29,18 @@
*/
#define GID_T_MAX (((gid_t)~0U) >> 1)
+/* Compatibility glue so we can support IPv6 when it's compiled as a module */
+struct pingv6_ops {
+ int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len);
+ int (*datagram_recv_ctl)(struct sock *sk, struct msghdr *msg,
+ struct sk_buff *skb);
+ int (*icmpv6_err_convert)(u8 type, u8 code, int *err);
+ void (*ipv6_icmp_error)(struct sock *sk, struct sk_buff *skb, int err,
+ __be16 port, u32 info, u8 *payload);
+ int (*ipv6_chk_addr)(struct net *net, const struct in6_addr *addr,
+ struct net_device *dev, int strict);
+};
+
struct ping_table {
struct hlist_nulls_head hash[PING_HTABLE_SIZE];
rwlock_t lock;
@@ -39,10 +52,40 @@ struct ping_iter_state {
};
extern struct proto ping_prot;
+extern struct ping_table ping_table;
+#if IS_ENABLED(CONFIG_IPV6)
+extern struct pingv6_ops pingv6_ops;
+#endif
+struct pingfakehdr {
+ struct icmphdr icmph;
+ struct iovec *iov;
+ sa_family_t family;
+ __wsum wcheck;
+};
-extern void ping_rcv(struct sk_buff *);
-extern void ping_err(struct sk_buff *, u32 info);
+int ping_get_port(struct sock *sk, unsigned short ident);
+void ping_hash(struct sock *sk);
+void ping_unhash(struct sock *sk);
+
+int ping_init_sock(struct sock *sk);
+void ping_close(struct sock *sk, long timeout);
+int ping_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len);
+void ping_err(struct sk_buff *skb, int offset, u32 info);
+void ping_v4_err(struct sk_buff *skb, u32 info);
+int ping_getfrag(void *from, char *to, int offset, int fraglen, int odd,
+ struct sk_buff *);
+
+int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
+ size_t len, int noblock, int flags, int *addr_len);
+int ping_common_sendmsg(int family, struct msghdr *msg, size_t len,
+ void *user_icmph, size_t icmph_len);
+int ping_v4_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
+ size_t len);
+int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
+ size_t len);
+int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
+void ping_rcv(struct sk_buff *skb);
#ifdef CONFIG_PROC_FS
extern int __init ping_proc_init(void);
@@ -50,6 +93,7 @@ extern void ping_proc_exit(void);
#endif
void __init ping_init(void);
-
+int __init pingv6_init(void);
+void pingv6_exit(void);
#endif /* _PING_H */
diff --git a/ANDROID_3.4.5/include/net/transp_v6.h b/ANDROID_3.4.5/include/net/transp_v6.h
index 498433dd..48b42ea9 100644
--- a/ANDROID_3.4.5/include/net/transp_v6.h
+++ b/ANDROID_3.4.5/include/net/transp_v6.h
@@ -11,6 +11,7 @@ extern struct proto rawv6_prot;
extern struct proto udpv6_prot;
extern struct proto udplitev6_prot;
extern struct proto tcpv6_prot;
+extern struct proto pingv6_prot;
struct flowi6;
@@ -21,6 +22,8 @@ extern int ipv6_frag_init(void);
extern void ipv6_frag_exit(void);
/* transport protocols */
+extern int pingv6_init(void);
+extern void pingv6_exit(void);
extern int rawv6_init(void);
extern void rawv6_exit(void);
extern int udpv6_init(void);
diff --git a/ANDROID_3.4.5/include/sound/asound.h b/ANDROID_3.4.5/include/sound/asound.h
index a2e4ff5b..f80c7120 100644
--- a/ANDROID_3.4.5/include/sound/asound.h
+++ b/ANDROID_3.4.5/include/sound/asound.h
@@ -95,9 +95,10 @@ enum {
SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */
SNDRV_HWDEP_IFACE_HDA, /* HD-audio */
SNDRV_HWDEP_IFACE_USB_STREAM, /* direct access to usb stream */
-
+ SNDRV_HWDEP_IFACE_WMT,
/* Don't forget to change the following: */
- SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_USB_STREAM
+ //SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_USB_STREAM
+ SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_WMT
};
struct snd_hwdep_info {
diff --git a/ANDROID_3.4.5/include/sound/core.h b/ANDROID_3.4.5/include/sound/core.h
index bc056687..93896ad1 100644
--- a/ANDROID_3.4.5/include/sound/core.h
+++ b/ANDROID_3.4.5/include/sound/core.h
@@ -132,6 +132,7 @@ struct snd_card {
int shutdown; /* this card is going down */
int free_on_last_close; /* free in context of file_release */
wait_queue_head_t shutdown_sleep;
+ atomic_t refcount; /* refcount for disconnection */
struct device *dev; /* device assigned to this card */
struct device *card_dev; /* cardX object for sysfs */
@@ -189,6 +190,7 @@ struct snd_minor {
const struct file_operations *f_ops; /* file operations */
void *private_data; /* private data for f_ops->open */
struct device *dev; /* device for sysfs */
+ struct snd_card *card_ptr; /* assigned card instance */
};
/* return a device pointer linked to each sound device as a parent */
@@ -295,6 +297,7 @@ int snd_card_info_done(void);
int snd_component_add(struct snd_card *card, const char *component);
int snd_card_file_add(struct snd_card *card, struct file *file);
int snd_card_file_remove(struct snd_card *card, struct file *file);
+void snd_card_unref(struct snd_card *card);
#define snd_card_set_dev(card, devptr) ((card)->dev = (devptr))