diff options
Diffstat (limited to 'include/linux')
28 files changed, 826 insertions, 18 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 73b45225..7ba489ce 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -208,6 +208,8 @@ void block_invalidatepage(struct page *page, unsigned int offset, unsigned int length); int block_write_full_page(struct page *page, get_block_t *get_block, struct writeback_control *wbc); +int block_write_full_page_endio(struct page *page, get_block_t *get_block, + struct writeback_control *wbc, bh_end_io_t *handler); int block_read_full_page(struct page*, get_block_t*); int block_is_partially_uptodate(struct page *page, unsigned long from, unsigned long count); diff --git a/include/linux/epl8802.h b/include/linux/epl8802.h new file mode 100644 index 00000000..4488b7c0 --- /dev/null +++ b/include/linux/epl8802.h @@ -0,0 +1,348 @@ +#ifndef __ELAN_EPL8802__ +#define __ELAN_EPL8802__ + +#define ELAN_IOCTL_MAGIC 'c' +#define ELAN_EPL8800_IOCTL_GET_PFLAG _IOR(ELAN_IOCTL_MAGIC, 1, int *) +#define ELAN_EPL8800_IOCTL_GET_LFLAG _IOR(ELAN_IOCTL_MAGIC, 2, int *) +#define ELAN_EPL8800_IOCTL_ENABLE_PFLAG _IOW(ELAN_IOCTL_MAGIC, 3, int *) +#define ELAN_EPL8800_IOCTL_ENABLE_LFLAG _IOW(ELAN_IOCTL_MAGIC, 4, int *) +#define ELAN_EPL8800_IOCTL_GETDATA _IOR(ELAN_IOCTL_MAGIC, 5, int *) + +/*LEADCORE*/ +/* Magic number for MPU Iocts */ +#define LIGHT_IOCTL (0x82) +/* IOCTL commands for /dev/lights */ + +#define PROXIMITY_IOCTL (0x83) +/* IOCTL commands for /dev/proximity */ + +/*light and proximity ioctl*/ +#define LIGHT_SET_DELAY _IOW(LIGHT_IOCTL, 0x1, unsigned long) +#define LIGHT_SET_ENALBE _IOR(LIGHT_IOCTL, 0x2, unsigned long) +#define PROXIMITY_SET_DELAY _IOR(PROXIMITY_IOCTL, 0x3, unsigned long) +#define PROXIMITY_SET_ENALBE _IOW(PROXIMITY_IOCTL, 0x4, unsigned long) + +#define LIGHT_DEFAULT_DELAY 200 /* 200 ms */ +#define LIGHT_MAX_DELAY 2000 /* 2000 ms */ +#define LIGHT_MIN_DELAY 100 /*100 ms*/ + +#define PROXIMITY_DEFAULT_DELAY 200 /* 200 ms */ +#define PROXIMITY_MAX_DELAY 2000 /* 2000 ms */ +#define PROXIMITY_MIN_DELAY 100 /*100 ms*/ + +/*MARVELL*/ +#define LTR_IOCTL_MAGIC 0x1C +#define LTR_IOCTL_GET_PFLAG _IOR(LTR_IOCTL_MAGIC, 1, int) +#define LTR_IOCTL_GET_LFLAG _IOR(LTR_IOCTL_MAGIC, 2, int) +#define LTR_IOCTL_SET_PFLAG _IOW(LTR_IOCTL_MAGIC, 3, int) +#define LTR_IOCTL_SET_LFLAG _IOW(LTR_IOCTL_MAGIC, 4, int) +#define LTR_IOCTL_GET_DATA _IOW(LTR_IOCTL_MAGIC, 5, unsigned char) + +/************************************************************************************/ + +#define MODE_IDLE (0) +#define MODE_ALS (1) +#define MODE_PS (2) +#define MODE_PS_ALS (5) + +#define EPL_MODE_IDLE (0x00) +#define EPL_MODE_ALS (0x01) +#define EPL_MODE_PS (0x02) +#define EPL_MODE_ALS_PS (0x03) + +#define POWER_DOWN (1) +#define POWER_WAKE (0) + +#define RESET (0<<1) +#define RUN (1<<1) + + +#define EPL_ALS_INTT_2 (0<<2) +#define EPL_ALS_INTT_4 (1<<2) +#define EPL_ALS_INTT_8 (2<<2) +#define EPL_ALS_INTT_16 (3<<2) +#define EPL_ALS_INTT_32 (4<<2) +#define EPL_ALS_INTT_64 (5<<2) +#define EPL_ALS_INTT_128 (6<<2) +#define EPL_ALS_INTT_256 (7<<2) +#define EPL_ALS_INTT_512 (8<<2) +#define EPL_ALS_INTT_768 (9<<2) +#define EPL_ALS_INTT_1024 (10<<2) +#define EPL_ALS_INTT_2048 (11<<2) +#define EPL_ALS_INTT_4096 (12<<2) +#define EPL_ALS_INTT_6144 (13<<2) +#define EPL_ALS_INTT_8192 (14<<2) +#define EPL_ALS_INTT_10240 (15<<2) +static int als_intt_value[] = {2, 4, 8, 16, 32, 64, 128, 256, 512, 768, 1024, 2048, 4096, 6144, 8192, 10240}; + +#define EPL_PS_INTT_4 (0<<2) +#define EPL_PS_INTT_8 (1<<2) +#define EPL_PS_INTT_16 (2<<2) +#define EPL_PS_INTT_24 (3<<2) +#define EPL_PS_INTT_32 (4<<2) +#define EPL_PS_INTT_48 (5<<2) +#define EPL_PS_INTT_80 (6<<2) +#define EPL_PS_INTT_144 (7<<2) +#define EPL_PS_INTT_272 (8<<2) +#define EPL_PS_INTT_384 (9<<2) +#define EPL_PS_INTT_520 (10<<2) +#define EPL_PS_INTT_784 (11<<2) +#define EPL_PS_INTT_1040 (12<<2) +#define EPL_PS_INTT_2064 (13<<2) +#define EPL_PS_INTT_4112 (14<<2) +#define EPL_PS_INTT_6160 (15<<2) +static int ps_intt_value[] = {4, 8, 16, 24, 32, 48, 80, 144, 272, 384, 520, 784, 1040, 2064, 4112, 6160}; + +#define EPL_WAIT_0_MS (0x0<<4) +#define EPL_WAIT_2_MS (0x1<<4) +#define EPL_WAIT_4_MS (0x2<<4) +#define EPL_WAIT_8_MS (0x3<<4) +#define EPL_WAIT_12_MS (0x4<<4) +#define EPL_WAIT_20_MS (0x5<<4) +#define EPL_WAIT_30_MS (0x6<<4) +#define EPL_WAIT_40_MS (0x7<<4) +#define EPL_WAIT_50_MS (0x8<<4) +#define EPL_WAIT_75_MS (0x9<<4) +#define EPL_WAIT_100_MS (0xA<<4) +#define EPL_WAIT_150_MS (0xB<<4) +#define EPL_WAIT_200_MS (0xC<<4) +#define EPL_WAIT_300_MS (0xD<<4) +#define EPL_WAIT_400_MS (0xE<<4) +#define EPL_WAIT_SINGLE (0x0F << 4) + +static int wait_value[] = {0, 2, 4, 8, 12, 20, 30, 40, 50, 75, 100, 150, 200, 300, 400}; +int wait_len = sizeof(wait_value)/sizeof(int); + +#define EPL_GAIN_HIGH (0x00) +#define EPL_GAIN_MID (0x01) +#define EPL_GAIN_LOW (0x03) + +#define EPL_PSALS_ADC_11 (0x00 << 3) +#define EPL_PSALS_ADC_12 (0x01 << 3) +#define EPL_PSALS_ADC_13 (0x02 << 3) +#define EPL_PSALS_ADC_14 (0x03 << 3) +static int adc_value[] = {128, 256, 512, 1024}; + +#define EPL_CYCLE_1 (0x00) +#define EPL_CYCLE_2 (0x01) +#define EPL_CYCLE_4 (0x02) +#define EPL_CYCLE_8 (0x03) +#define EPL_CYCLE_16 (0x04) +#define EPL_CYCLE_32 (0x05) +#define EPL_CYCLE_64 (0x06) +static int cycle_value[] = {1, 2, 4, 8, 16, 32, 64}; + +#define EPL_IR_ON_CTRL_OFF (0x00 << 5) +#define EPL_IR_ON_CTRL_ON (0x01 << 5) + +#define EPL_IR_MODE_CURRENT (0x00 << 4) +#define EPL_IR_MODE_VOLTAGE (0x01 << 4) + +#define EPL_IR_DRIVE_200 (0x00) +#define EPL_IR_DRIVE_100 (0x01) +#define EPL_IR_DRIVE_50 (0x02) +#define EPL_IR_DRIVE_10 (0x03) + + +#define EPL_INT_CTRL_ALS_OR_PS (0x00 << 4) +#define EPL_INT_CTRL_ALS (0x01 << 4) +#define EPL_INT_CTRL_PS (0x02 << 4) + +#define EPL_PERIST_1 (0x00 << 2) +#define EPL_PERIST_4 (0x01 << 2) +#define EPL_PERIST_8 (0x02 << 2) +#define EPL_PERIST_16 (0x03 << 2) + +#define EPL_INTTY_DISABLE (0x00) +#define EPL_INTTY_BINARY (0x01) +#define EPL_INTTY_ACTIVE (0x02) +#define EPL_INTTY_FRAME (0x03) + +#define EPL_RESETN_RESET (0x00 << 1) +#define EPL_RESETN_RUN (0x01 << 1) + +#define EPL_POWER_OFF (0x01) +#define EPL_POWER_ON (0x00) + +#define EPL_ALS_INT_CHSEL_0 (0x00 << 4) +#define EPL_ALS_INT_CHSEL_1 (0x01 << 4) + +#define EPL_SATURATION (0x01 << 5) +#define EPL_SATURATION_NOT (0x00 << 5) + +#define EPL_CMP_H_TRIGGER (0x01 << 4) +#define EPL_CMP_H_CLEAR (0x00 << 4) + +#define EPL_CMP_L_TRIGGER (0x01 << 3) +#define EPL_CMP_L_CLEAR (0x00 << 3) + +#define EPL_INT_TRIGGER (0x01 << 2) +#define EPL_INT_CLEAR (0x00 << 2) + +#define EPL_CMP_RESET (0x00 << 1) +#define EPL_CMP_RUN (0x01 << 1) + +#define EPL_LOCK (0x01) +#define EPL_UN_LOCK (0x00) + +#define EPL_OSC_SEL_1MHZ (0x07) + +#define EPL_REVNO (0x81) + +#define EPL_A_D (0x7 << 4) + +#define EPL_NORMAL (0 << 3) +#define EPL_BYBASS (1 << 3) + +#define EPL_GFIN_DISABLE (0 << 2) +#define EPL_GFIN_ENABLE (1 << 2) + +#define EPL_VOS_DISABLE (0 << 1) +#define EPL_VOS_ENABLE (1 << 1) + +#define EPL_DOC_OFF (0) +#define EPL_DOC_ON (1) + +#define EPL_SENSOR_PINCTRL_STATE_SLEEP "epl8802_suspend" +#define EPL_SENSOR_PINCTRL_STATE_DEFAULT "epl8802_default" + +struct _ps_data { + u16 ir_data; + u16 data; +}; + +struct _ges_data { + u16 ir_data; + u16 data; +}; + +struct _ps_factory { + bool calibration_enable; + bool calibrated; + u16 cancelation; + u16 high_threshold; + u16 low_threshold; +}; + +#define ALS_CHANNEL_SIZE 2 +struct _als_data { + u16 channels[ALS_CHANNEL_SIZE]; + u16 lux; +}; + +struct _als_factory { + bool calibration_enable; + bool calibrated; + u16 lux_per_count; +}; +struct _hs_setting { + bool dynamic_intt; + u8 integration_time; + u8 integration_time_max; + u8 integration_time_min; + u8 gain; + u8 adc; + u8 cycle; + u8 compare_reset; + u8 ir_on_control; + u8 ir_mode; + u8 ir_driver; + u8 lock; + u16 low_threshold; + u16 mid_threshold; + u16 high_threshold; + u16 raw; + u16 raws_count; + u16 raws[200]; +}; + +struct _ps_setting { + bool polling_mode; + u8 integration_time; + u8 gain; + u8 adc; + u8 cycle; + u16 high_threshold; + u16 low_threshold; + u8 ir_on_control; + u8 ir_mode; + u8 ir_drive; + u8 persist; + u8 interrupt_type; + u8 saturation; + u8 compare_high; + u8 compare_low; + u8 interrupt_flag; + u8 compare_reset; + u8 lock; + u16 cancelation; + struct _ps_data data; + struct _ps_factory factory; +}; + +struct _ges_setting { + bool polling_mode; + u8 integration_time; + u8 gain; + u8 adc; + u8 cycle; + u16 high_threshold; + u16 low_threshold; + u8 ir_on_control; + u8 ir_mode; + u8 ir_drive; + u8 persist; + u8 interrupt_type; + u8 saturation; + u8 compare_high; + u8 compare_low; + u8 interrupt_flag; + u8 compare_reset; + u8 lock; + u16 cancelation; + struct _ges_data data; +}; + +struct _als_setting { + bool polling_mode; + u8 report_type; + u8 lsrc_type; + u16 report_count; + u8 integration_time; + u8 gain; + u8 adc; + u8 cycle; + u16 high_threshold; + u16 low_threshold; + u8 persist; + u8 interrupt_type; + u8 saturation; + u8 compare_high; + u8 compare_low; + u8 interrupt_flag; + u8 compare_reset; + u8 lock; + u8 interrupt_channel_select; + u16 dyn_intt_raw; + struct _als_data data; + struct _als_factory factory; +}; + +typedef struct _sensor { + u8 wait; + u8 mode; + bool enable_factory_calibration; + u8 early_suspend_mode; + u8 osc_sel; + u8 interrupt_control; + u8 reset; + u8 power; + struct _hs_setting hs; + struct _ps_setting ps; + struct _als_setting als; + struct _ges_setting ges; + u16 revno; +} epl_optical_sensor; + + +#endif diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h index 860313a3..374e1515 100644 --- a/include/linux/f2fs_fs.h +++ b/include/linux/f2fs_fs.h @@ -448,4 +448,4 @@ enum { F2FS_FT_MAX }; -#endif /* _LINUX_F2FS_FS_H */ +#endif /* _LINUX_F2FS_FS_H */
\ No newline at end of file diff --git a/include/linux/fb.h b/include/linux/fb.h index 3cde50f1..08cc4bae 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -162,7 +162,9 @@ struct fb_cursor_user { #define FB_EARLY_EVENT_BLANK 0x10 /* A hardware display blank revert early change occured */ #define FB_R_EARLY_EVENT_BLANK 0x11 - +/*lenovo-sw wengjun1 add for event blank 20160315 begin*/ +#define FB_IN_PROGRESS_EVENT_BLANK 0x12 +/*lenovo-sw wengjun1 add for event blank 20160315 end*/ struct fb_event { struct fb_info *info; void *data; diff --git a/include/linux/i2c-dev.h b/include/linux/i2c-dev.h index 79727144..1a0bdd42 100644 --- a/include/linux/i2c-dev.h +++ b/include/linux/i2c-dev.h @@ -25,4 +25,6 @@ #include <uapi/linux/i2c-dev.h> #define I2C_MAJOR 89 /* Device major number */ + +#define ENABLE_MI2S_CLK 0x0709 /* lenovo-sw zhouwl, 2014-05-27, add for control mi2s clock */ #endif /* _LINUX_I2C_DEV_H */ diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 6c17af80..e80e8295 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -277,7 +277,11 @@ static inline bool iio_channel_has_info(const struct iio_chan_spec *chan, **/ static inline s64 iio_get_time_ns(void) { - return ktime_get_real_ns(); + struct timespec ts; + + get_monotonic_boottime(&ts); + + return timespec_to_ns(&ts); } /* Device operating modes */ diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 4a2af8ad..1caf954e 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h @@ -30,6 +30,12 @@ enum iio_chan_type { IIO_CCT, IIO_PRESSURE, IIO_HUMIDITYRELATIVE, + IIO_SIGN_MOTION, + IIO_STEP_DETECTOR, + IIO_STEP_COUNTER, + IIO_TILT, + IIO_TAP, + IIO_TAP_TAP, }; enum iio_modifier { @@ -68,6 +74,7 @@ enum iio_event_type { IIO_EV_TYPE_ROC, IIO_EV_TYPE_THRESH_ADAPTIVE, IIO_EV_TYPE_MAG_ADAPTIVE, + IIO_EV_TYPE_FIFO_FLUSH, }; enum iio_event_info { @@ -81,6 +88,8 @@ enum iio_event_direction { IIO_EV_DIR_EITHER, IIO_EV_DIR_RISING, IIO_EV_DIR_FALLING, + IIO_EV_DIR_FIFO_EMPTY, + IIO_EV_DIR_FIFO_DATA, }; #define IIO_VAL_INT 1 diff --git a/include/linux/input/synaptics_rmi_dsx.h b/include/linux/input/synaptics_rmi_dsx.h new file mode 100644 index 00000000..a4dc94a3 --- /dev/null +++ b/include/linux/input/synaptics_rmi_dsx.h @@ -0,0 +1,78 @@ +/* + * Synaptics DSX touchscreen driver + * + * Copyright (C) 2012 Synaptics Incorporated + * + * Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com> + * Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _SYNAPTICS_DSX_H_ +#define _SYNAPTICS_DSX_H_ + +/* + * struct synaptics_dsx_cap_button_map - 0d button map + * @nbuttons: number of 0d buttons + * @map: pointer to array of button types + */ +struct synaptics_dsx_cap_button_map { + unsigned char nbuttons; + unsigned char *map; +}; + +/* + * struct synaptics_dsx_platform_data - dsx platform data + * @x_flip: x flip flag + * @y_flip: y flip flag + * @i2c_pull_up: pull up i2c bus with regulator + * @power_down_enable: enable complete regulator shutdown in suspend + * @irq_gpio: attention interrupt gpio + * @irq_flags: flags used by the irq + * @reset_flags: flags used by reset line + * @reset_gpio: reset gpio + * @disp_maxx: display panel maximum values on the x + * @disp_maxy: display panel maximum values on the y + * @disp_minx: display panel minimum values on the x + * @disp_miny: display panel minimum values on the y + * @panel_maxx: touch panel maximum values on the x + * @panel_maxy: touch panel maximum values on the y + * @panel_minx: touch panel minimum values on the x + * @panel_miny: touch panel minimum values on the y + * @reset_delay: reset delay + * @gpio_config: pointer to gpio configuration function + * @cap_button_map: pointer to 0d button map + */ +struct synaptics_dsx_platform_data { + bool x_flip; + bool y_flip; + bool i2c_pull_up; + bool power_down_enable; + bool disable_gpios; + bool do_lockdown; + bool regulator_en; + unsigned irq_gpio; + unsigned long irq_flags; + unsigned reset_gpio; + unsigned panel_minx; + unsigned panel_miny; + unsigned panel_maxx; + unsigned panel_maxy; + unsigned disp_minx; + unsigned disp_miny; + unsigned reset_delay; + int (*gpio_config)(struct synaptics_dsx_platform_data *pdata, + bool configure); + struct synaptics_dsx_cap_button_map *cap_button_map; +}; + +#endif diff --git a/include/linux/irqchip/qpnp-int.h b/include/linux/irqchip/qpnp-int.h index 614165eb..131aa6e3 100644 --- a/include/linux/irqchip/qpnp-int.h +++ b/include/linux/irqchip/qpnp-int.h @@ -125,7 +125,11 @@ int qpnpint_show_irq(struct spmi_controller *spmi_ctrl, static inline bool qpnpint_show_resume_irq(void) { + #ifdef CONFIG_LENOVO_PM_LOG + return true; + #else return false; + #endif } #endif /* CONFIG_MSM_QPNP_INT */ #endif /* QPNPINT_H */ diff --git a/include/linux/leds-aw2015.h b/include/linux/leds-aw2015.h new file mode 100644 index 00000000..afc176dc --- /dev/null +++ b/include/linux/leds-aw2015.h @@ -0,0 +1,27 @@ + +#ifndef __LINUX_AW2015_LED_H__ +#define __LINUX_AW2015_LED_H__ + +/* The definition of each time described as shown in figure. + * /-----------\ + * / | \ + * /| | |\ + * / | | | \----------- + * |hold_time_ms | | + * | | | + * rise_time_ms fall_time_ms | + * off_time_ms + */ + +struct aw2015_platform_data { + int max_current; + int rise_time_ms; + int hold_time_ms; + int fall_time_ms; + int off_time_ms; + int pwm_duty; + int mode; + struct aw2015_led *led; +}; + +#endif diff --git a/include/linux/mm.h b/include/linux/mm.h index 7a345e6a..b6b3d75a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2055,6 +2055,7 @@ static inline struct page *follow_page(struct vm_area_struct *vma, #define FOLL_NUMA 0x200 /* force NUMA hinting page fault */ #define FOLL_MIGRATION 0x400 /* wait for page to replace migration entry */ #define FOLL_TRIED 0x800 /* a retry, previous pass started an IO */ +#define FOLL_COW 0x4000 /* internal GUP flag */ typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, void *data); diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 43c952e5..1646f7c1 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -87,6 +87,8 @@ struct mmc_ext_csd { bool hpi_en; /* HPI enablebit */ bool hpi; /* HPI support bit */ unsigned int hpi_cmd; /* cmd used as HPI */ + bool ffu_capable; /* FFU support */ + bool ffu_mode_op; /* FFU mode operation */ bool bkops; /* background support bit */ u8 bkops_en; /* background enable */ unsigned int data_sector_size; /* 512 bytes or 4KB */ diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 24f6b228..fe75403e 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h @@ -209,6 +209,14 @@ extern int mmc_flush_cache(struct mmc_card *); extern int mmc_cache_barrier(struct mmc_card *); extern int mmc_detect_card_removed(struct mmc_host *host); +extern void mmc_prepare_mrq(struct mmc_card *card, + struct mmc_request *mrq, struct scatterlist *sg, unsigned sg_len, + unsigned dev_addr, unsigned blocks, unsigned blksz, int write); +extern int mmc_wait_busy(struct mmc_card *card); +extern int mmc_check_result(struct mmc_request *mrq); +extern int mmc_simple_transfer(struct mmc_card *card, + struct scatterlist *sg, unsigned sg_len, unsigned dev_addr, + unsigned blocks, unsigned blksz, int write); extern void mmc_blk_init_bkops_statistics(struct mmc_card *card); @@ -233,4 +241,25 @@ struct device_node; extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max); extern int mmc_of_parse_voltage(struct device_node *np, u32 *mask); +/* + * eMMC5.0 Field Firmware Update (FFU) opcodes +*/ +#define MMC_FFU_INVOKE_OP 302 + +#define MMC_FFU_MODE_SET 0x1 +#define MMC_FFU_MODE_NORMAL 0x0 +#define MMC_FFU_INSTALL_SET 0x2 + +#ifdef CONFIG_MMC_FFU +#define MMC_FFU_FEATURES 0x1 +#define FFU_FEATURES(ffu_features) (ffu_features & MMC_FFU_FEATURES) + +int mmc_ffu_invoke(struct mmc_card *card, const char *name); + +#else +static inline int mmc_ffu_invoke(struct mmc_card *card, const char *name) +{ + return -ENOSYS; +} +#endif #endif /* LINUX_MMC_CORE_H */ diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index ed6638ab..b8dbfc91 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h @@ -224,6 +224,9 @@ struct _mmc_csd { */ #define EXT_CSD_CMDQ 15 /* R/W */ +#define EXT_CSD_FFU_STATUS 26 /* R */ +#define EXT_CSD_MODE_OPERATION_CODES 29 /* W */ +#define EXT_CSD_MODE_CONFIG 30 /* R/W */ #define EXT_CSD_BARRIER_CTRL 31 /* R/W */ #define EXT_CSD_FLUSH_CACHE 32 /* W */ #define EXT_CSD_CACHE_CTRL 33 /* R/W */ @@ -244,6 +247,7 @@ struct _mmc_csd { #define EXT_CSD_SANITIZE_START 165 /* W */ #define EXT_CSD_WR_REL_PARAM 166 /* RO */ #define EXT_CSD_RPMB_MULT 168 /* RO */ +#define EXT_CSD_FW_CONFIG 169 /* R/W */ #define EXT_CSD_BOOT_WP 173 /* R/W */ #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ #define EXT_CSD_PART_CONFIG 179 /* R/W */ @@ -284,9 +288,14 @@ struct _mmc_csd { #define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ #define EXT_CSD_PWR_CL_DDR_200_360 253 /* RO */ #define EXT_CSD_FW_VERSION 254 /* RO */ +#define EXT_CSD_NUM_OF_FW_SEC_PROG 302 /* RO, 4 bytes */ #define EXT_CSD_CMDQ_DEPTH 307 /* RO */ #define EXT_CSD_CMDQ_SUPPORT 308 /* RO */ #define EXT_CSD_BARRIER_SUPPORT 486 /* RO */ +#define EXT_CSD_FFU_ARG 487 /* RO, 4 bytes */ +#define EXT_CSD_OPERATION_CODE_TIMEOUT 491 /* RO */ +#define EXT_CSD_FFU_FEATURES 492 /* RO */ +#define EXT_CSD_SUPPORTED_MODE 493 /* RO */ #define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */ #define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */ #define EXT_CSD_MAX_PACKED_WRITES 500 /* RO */ diff --git a/include/linux/mmi_hall_notifier.h b/include/linux/mmi_hall_notifier.h new file mode 100644 index 00000000..8eee7765 --- /dev/null +++ b/include/linux/mmi_hall_notifier.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2014 Motorola Mobility, LLC + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __MMI_HALL_NOTIFIER_H__ +#define __MMI_HALL_NOTIFIER_H__ + +#include <linux/notifier.h> + +/* Hall effect sensor type is a position of the */ +/* bit representing its state. For example, */ +/* MMI_HALL_FOLIO 0 */ +/* MMI_HALL_SECOND 1 */ +/* MMI_HALL_THIRD 2 */ +#define MMI_HALL_FOLIO 0 +#define MMI_HALL_MAX 8 + +struct mmi_hall_data { + unsigned int enabled; + unsigned int state; + struct blocking_notifier_head nhead[MMI_HALL_MAX]; +}; + +#ifdef CONFIG_MMI_HALL_NOTIFICATIONS +struct mmi_hall_data *mmi_hall_init(void); +void mmi_hall_free(struct mmi_hall_data *data); +int mmi_hall_register_notifier(struct notifier_block *nb, + unsigned long type, bool report); +int mmi_hall_unregister_notifier(struct notifier_block *nb, + unsigned long type); +void mmi_hall_notify(unsigned long type, int data); +#else +#include <linux/errno.h> +static inline struct mmi_hall_data *mmi_hall_init(void) +{ + return NULL; +} +static inline void mmi_hall_free(struct mmi_hall_data *data) {} +static inline int mmi_hall_register_notifier(struct notifier_block *nb, + unsigned long type, bool report) +{ + return -ENOSYS; +} +static inline int mmi_hall_unregister_notifier(struct notifier_block *nb, + unsigned long type) +{ + return -ENOSYS; +} +static inline void mmi_hall_notify(unsigned long type, int data) {} +#endif +#endif + diff --git a/include/linux/msm_bus_rules.h b/include/linux/msm_bus_rules.h index e6142bfc..dda8610b 100644 --- a/include/linux/msm_bus_rules.h +++ b/include/linux/msm_bus_rules.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -39,15 +39,18 @@ struct rule_apply_rcm_info { struct bus_rule_type { int num_src; - int *src_id; - int src_field; - int op; - u64 thresh; + int combo_op; + int num_thresh; int num_dst; - int *dst_node; u64 dst_bw; int mode; + u64 curr_bw; void *client_data; + int *src_id; + int *src_field; + int *op; + u64 *thresh; + int *dst_node; }; #if (defined(CONFIG_BUS_TOPOLOGY_ADHOC)) @@ -61,6 +64,8 @@ bool msm_rule_update(struct bus_rule_type *old_rule, void msm_rule_evaluate_rules(int node); void print_rules_buf(char *buf, int count); bool msm_rule_are_rules_registered(void); +int msm_rule_query_bandwidth(struct bus_rule_type *rule, + u64 *bw, struct notifier_block *nb); #else static inline void msm_rule_register(int num_rules, struct bus_rule_type *rule, struct notifier_block *nb) @@ -87,5 +92,10 @@ static inline bool msm_rule_update(struct bus_rule_type *old_rule, static inline void msm_rule_evaluate_rules(int node) { } +static inline int msm_rule_query_bandwidth(struct bus_rule_type *rule, + u64 *bw, struct notifier_block *nb) +{ + return false; +} #endif /* defined(CONFIG_BUS_TOPOLOGY_ADHOC) */ #endif /* _ARCH_ARM_MACH_MSM_BUS_RULES_H */ diff --git a/include/linux/namei.h b/include/linux/namei.h index c9ad7a10..c4e750f4 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h @@ -55,6 +55,15 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; #define LOOKUP_JUMPED 0x1000 #define LOOKUP_ROOT 0x2000 #define LOOKUP_EMPTY 0x4000 +/*2015.1.28 add begin for sdcardfs support case-insensitive search*/ +#ifdef CONFIG_SDCARD_FS_CI_SEARCH +#define LOOKUP_CASE_INSENSITIVE 0x8000 +#endif +/*2015.1.28 add end*/ + +#ifdef CONFIG_F2FS_FS +#define LOOKUP_NOCASE 0x8000 +#endif extern int user_path_at(int, const char __user *, unsigned, struct path *); extern int user_path_at_empty(int, const char __user *, unsigned, struct path *, int *empty); diff --git a/include/linux/nfc/bcm2079x.h b/include/linux/nfc/bcm2079x.h new file mode 100644 index 00000000..b0364e44 --- /dev/null +++ b/include/linux/nfc/bcm2079x.h @@ -0,0 +1,46 @@ +/* + * 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) +#define BCMNFC_READ_MODE _IO(BCMNFC_MAGIC, 0x08) +#define READ_RAW_PACKET 1 + +struct bcm2079x_platform_data { + unsigned int irq_gpio; + unsigned int en_gpio; + int wake_gpio; +}; + +#endif diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 5627a26a..c1a2bd14 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -458,11 +458,6 @@ struct perf_event { #endif /* CONFIG_PERF_EVENTS */ }; -enum perf_event_context_type { - task_context, - cpu_context, -}; - /** * struct perf_event_context - event context structure * @@ -470,7 +465,6 @@ enum perf_event_context_type { */ struct perf_event_context { struct pmu *pmu; - enum perf_event_context_type type; /* * Protect the states of the events in the list, * nr_active, and the list: @@ -753,6 +747,11 @@ extern int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write, loff_t *ppos); +static inline bool perf_paranoid_any(void) +{ + return sysctl_perf_event_paranoid > 2; +} + static inline bool perf_paranoid_tracepoint_raw(void) { return sysctl_perf_event_paranoid > -1; diff --git a/include/linux/perftags.h b/include/linux/perftags.h new file mode 100644 index 00000000..11c74139 --- /dev/null +++ b/include/linux/perftags.h @@ -0,0 +1,9 @@ +#ifndef __PERF_TAGS_H__ +#define __PERF_TAGS_H__ + +#include <linux/types.h> + +extern ssize_t perftags_write(const char* buf); + +#endif + diff --git a/include/linux/platform_data/lis2dg.h b/include/linux/platform_data/lis2dg.h new file mode 100644 index 00000000..016ca07d --- /dev/null +++ b/include/linux/platform_data/lis2dg.h @@ -0,0 +1,38 @@ +/******************** (C) COPYRIGHT 2015 STMicroelectronics ******************** +* +* File Name : lis2dg.h +* Authors : AMS - VMU - Application Team +* : Giuseppe Barba <giuseppe.barba@st.com> +* : Author is willing to be considered the contact and update +* : point for the driver. +* Version : V.1.0.0 +* Date : 2015/Mar/18 +* Description : LIS2DG driver +* +******************************************************************************** +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +* THE PRESENT SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES +* OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, FOR THE SOLE +* PURPOSE TO SUPPORT YOUR APPLICATION DEVELOPMENT. +* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, +* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE +* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING +* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. +* +********************************************************************************/ + +#ifndef __LIS2DG_H__ +#define __LIS2DG_H__ + +#define LIS2DG_DEV_NAME "lis2dg" +#define LIS2DG_I2C_ADDR 0x1e + +struct lis2dg_platform_data { + u8 drdy_int_pin; +}; + +#endif /* __LIS2DG_H__ */ diff --git a/include/linux/platform_data/lis2ds12.h b/include/linux/platform_data/lis2ds12.h new file mode 100644 index 00000000..fec9fccb --- /dev/null +++ b/include/linux/platform_data/lis2ds12.h @@ -0,0 +1,22 @@ +/* + * STMicroelectronics lis2ds12 driver + * + * Copyright 2015 STMicroelectronics Inc. + * + * Giuseppe Barba <giuseppe.barba@st.com> + * + * Licensed under the GPL-2. + */ + + +#ifndef __LIS2DS12_H__ +#define __LIS2DS12_H__ + +#define LIS2DS12_DEV_NAME "lis2ds12" +#define LIS2DS12_I2C_ADDR 0x1e + +struct lis2ds12_platform_data { + u8 drdy_int_pin; +}; + +#endif /* __LIS2DS12_H__ */ diff --git a/include/linux/qpnp/power-on.h b/include/linux/qpnp/power-on.h index da8f5a86..73c9fe9e 100644 --- a/include/linux/qpnp/power-on.h +++ b/include/linux/qpnp/power-on.h @@ -59,6 +59,8 @@ enum pon_restart_reason { PON_RESTART_REASON_DMVERITY_ENFORCE = 0x05, PON_RESTART_REASON_KEYS_CLEAR = 0x06, }; +#define RESET_EXTRA_REBOOT_BL_REASON BIT(2) +#define RESET_EXTRA_LAST_REBOOT_REASON BIT(4) #ifdef CONFIG_QPNP_POWER_ON int qpnp_pon_system_pwr_off(enum pon_power_off_type type); @@ -67,7 +69,7 @@ int qpnp_pon_trigger_config(enum pon_trigger_source pon_src, bool enable); int qpnp_pon_wd_config(bool enable); int qpnp_pon_set_restart_reason(enum pon_restart_reason reason); bool qpnp_pon_check_hard_reset_stored(void); - +int qpnp_pon_store_extra_reset_info(u16 mask, u16 val); #else static int qpnp_pon_system_pwr_off(enum pon_power_off_type type) { @@ -91,6 +93,11 @@ static inline bool qpnp_pon_check_hard_reset_stored(void) { return false; } + +static inline int qpnp_pon_store_extra_reset_info(u16 mask, u16 val) +{ + return -ENODEV; +} #endif #endif diff --git a/include/linux/usb.h b/include/linux/usb.h index 70a7dbf1..0f4f5092 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -735,6 +735,17 @@ static inline bool usb_device_no_sg_constraint(struct usb_device *udev) /* for drivers using iso endpoints */ extern int usb_get_current_frame_number(struct usb_device *usb_dev); +extern int usb_sec_event_ring_setup(struct usb_device *dev, + unsigned intr_num); +extern int usb_sec_event_ring_cleanup(struct usb_device *dev, + unsigned intr_num); + +extern dma_addr_t +usb_get_sec_event_ring_dma_addr(struct usb_device *dev, + unsigned intr_num); +extern dma_addr_t usb_get_dcba_dma_addr(struct usb_device *dev); +extern dma_addr_t usb_get_xfer_ring_dma_addr(struct usb_device *dev, + struct usb_host_endpoint *ep); /* Sets up a group of bulk endpoints to support multiple stream IDs. */ extern int usb_alloc_streams(struct usb_interface *interface, diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 9a30c1e0..80326fa9 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h @@ -387,6 +387,15 @@ struct hc_driver { void (*dump_regs)(struct usb_hcd *); void (*set_autosuspend_delay)(struct usb_device *); void (*reset_sof_bug_handler)(struct usb_hcd *hcd, u32 val); + + int (*sec_event_ring_setup)(struct usb_hcd *hcd, unsigned intr_num); + int (*sec_event_ring_cleanup)(struct usb_hcd *hcd, unsigned intr_num); + dma_addr_t (*get_sec_event_ring_dma_addr)(struct usb_hcd *hcd, + unsigned intr_num); + dma_addr_t (*get_xfer_ring_dma_addr)(struct usb_hcd *hcd, + struct usb_device *udev, struct usb_host_endpoint *ep); + dma_addr_t (*get_dcba_dma_addr)(struct usb_hcd *hcd, + struct usb_device *udev); }; static inline int hcd_giveback_urb_in_bh(struct usb_hcd *hcd) @@ -425,6 +434,17 @@ extern int usb_hcd_alloc_bandwidth(struct usb_device *udev, struct usb_host_interface *old_alt, struct usb_host_interface *new_alt); extern int usb_hcd_get_frame_number(struct usb_device *udev); +extern int usb_hcd_sec_event_ring_setup(struct usb_device *udev, + unsigned intr_num); +extern int usb_hcd_sec_event_ring_cleanup(struct usb_device *udev, + unsigned intr_num); +extern dma_addr_t +usb_hcd_get_sec_event_ring_dma_addr(struct usb_device *udev, + unsigned intr_num); +extern dma_addr_t usb_hcd_get_dcba_dma_addr(struct usb_device *udev); +extern dma_addr_t +usb_hcd_get_xfer_ring_dma_addr(struct usb_device *udev, + struct usb_host_endpoint *ep); extern struct usb_hcd *usb_create_hcd(const struct hc_driver *driver, struct device *dev, const char *bus_name); diff --git a/include/linux/usb/tty_diag.h b/include/linux/usb/tty_diag.h new file mode 100644 index 00000000..665f77ac --- /dev/null +++ b/include/linux/usb/tty_diag.h @@ -0,0 +1,60 @@ +#ifndef _DRIVERS_TTY_DIAG_H_ +#define _DRIVERS_TTY_DIAG_H_ + +#ifdef CONFIG_DIAG_OVER_USB +#include <linux/usb/usbdiag.h> +#endif + +#ifdef CONFIG_DIAG_OVER_TTY +struct usb_diag_ch *tty_diag_channel_open(const char *name, void *priv, + void (*notify)(void *, unsigned, struct diag_request *)); +void tty_diag_channel_close(struct usb_diag_ch *diag_ch); +int tty_diag_channel_read(struct usb_diag_ch *diag_ch, + struct diag_request *d_req); +int tty_diag_channel_write(struct usb_diag_ch *diag_ch, + struct diag_request *d_req); +void tty_diag_channel_abandon_request(void); +int tty_diag_get_dbg_ftm_flag_value(void); +int tty_diag_set_dbg_ftm_flag_value(int val); +#else +static inline struct usb_diag_ch *tty_diag_channel_open(const char *name, + void *priv, + void (*notify)(void *, unsigned, struct diag_request *)) +{ + return ERR_PTR(-ENODEV); +} + +static inline void tty_diag_channel_close(struct usb_diag_ch *diag_ch) +{ +} + +static inline int tty_diag_channel_read(struct usb_diag_ch *diag_ch, + struct diag_request *d_req) +{ + return -ENODEV; +} + +static inline int tty_diag_channel_write(struct usb_diag_ch *diag_ch, + struct diag_request *d_req) +{ + return -ENODEV; +} + +static inline void tty_diag_channel_abandon_request(void) +{ + return -ENODEV; +} + +static inline int tty_diag_get_dbg_ftm_flag_value(void) +{ + return -ENODEV; +} + +static inline int tty_diag_set_dbg_ftm_flag_value(int val) +{ + return -ENODEV; +} + +#endif + +#endif /* _DRIVERS_TTY_DIAG_H_ */ diff --git a/include/linux/usb/usbdiag.h b/include/linux/usb/usbdiag.h index 1be8e634..91e93b5e 100644 --- a/include/linux/usb/usbdiag.h +++ b/include/linux/usb/usbdiag.h @@ -32,6 +32,7 @@ #define USB_DIAG_DISCONNECT 1 #define USB_DIAG_WRITE_DONE 2 #define USB_DIAG_READ_DONE 3 +#define USB_DIAG_WRITE_DONE_SYNC 4 struct diag_request { char *buf; diff --git a/include/linux/usb_bam.h b/include/linux/usb_bam.h index ebc2fe89..80bbd8c8 100644 --- a/include/linux/usb_bam.h +++ b/include/linux/usb_bam.h @@ -209,7 +209,6 @@ struct usb_bam_pipe_connect { * can work at in bam2bam mode when connected to HS host. * @max_mbps_superspeed: Maximum Mbits per seconds that the USB core * can work at in bam2bam mode when connected to SS host. - * @enable_hsusb_bam_on_boot: Enable HSUSB BAM (non-NDP) on bootup itself */ struct msm_usb_bam_platform_data { u8 max_connections; @@ -222,7 +221,6 @@ struct msm_usb_bam_platform_data { u32 override_threshold; u32 max_mbps_highspeed; u32 max_mbps_superspeed; - bool enable_hsusb_bam_on_boot; enum usb_ctrl bam_type; }; |
