summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/dt-bindings/pinctrl/omap.h4
-rw-r--r--include/linux/buffer_head.h4
-rw-r--r--include/linux/clk/msm-clock-generic.h14
-rw-r--r--include/linux/efi.h2
-rw-r--r--include/linux/f2fs_fs.h10
-rw-r--r--include/linux/input/qpnp-power-on.h5
-rw-r--r--include/linux/kernel.h7
-rw-r--r--include/linux/mm.h4
-rw-r--r--include/linux/mmzone.h3
-rw-r--r--include/linux/netdevice.h3
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/phy.h8
-rw-r--r--include/linux/preempt.h21
-rw-r--r--include/linux/sched/sysctl.h1
-rw-r--r--include/linux/skbuff.h7
-rw-r--r--include/linux/tee_drv.h277
-rw-r--r--include/linux/timekeeper_internal.h8
-rw-r--r--include/linux/usb.h1
-rw-r--r--include/linux/usb/cdc_ncm.h1
-rw-r--r--include/media/adv7481.h3
-rw-r--r--include/media/msm_ba.h1
-rw-r--r--include/net/genetlink.h2
-rw-r--r--include/net/inet_sock.h8
-rw-r--r--include/net/tcp.h6
-rw-r--r--include/soc/qcom/icnss.h1
-rw-r--r--include/sound/apr_audio-v2.h1025
-rw-r--r--include/sound/pcm.h3
-rw-r--r--include/sound/q6adm-v2.h21
-rw-r--r--include/sound/q6asm-v2.h11
-rw-r--r--include/sound/q6common.h23
-rw-r--r--include/sound/q6lsm.h120
-rw-r--r--include/sound/seq_kernel.h3
-rw-r--r--include/target/target_core_base.h1
-rw-r--r--include/trace/events/f2fs.h116
-rw-r--r--include/trace/events/sched.h12
-rw-r--r--include/trace/events/sunrpc.h17
-rw-r--r--include/uapi/drm/drm_mode.h19
-rw-r--r--include/uapi/drm/msm_drm.h15
-rw-r--r--include/uapi/linux/bcache.h2
-rw-r--r--include/uapi/linux/habmm.h21
-rw-r--r--include/uapi/linux/msm_ipa.h2
-rw-r--r--include/uapi/linux/rds.h102
-rw-r--r--include/uapi/linux/spi/spidev.h1
-rw-r--r--include/uapi/linux/tee.h346
-rw-r--r--include/uapi/linux/usb/ch9.h20
-rw-r--r--include/uapi/media/Kbuild1
-rw-r--r--include/uapi/media/msm_ba.h35
-rw-r--r--include/uapi/sound/audio_effects.h6
48 files changed, 1537 insertions, 788 deletions
diff --git a/include/dt-bindings/pinctrl/omap.h b/include/dt-bindings/pinctrl/omap.h
index 13949259705a..0d4fe32b3ae2 100644
--- a/include/dt-bindings/pinctrl/omap.h
+++ b/include/dt-bindings/pinctrl/omap.h
@@ -45,8 +45,8 @@
#define PIN_OFF_NONE 0
#define PIN_OFF_OUTPUT_HIGH (OFF_EN | OFFOUT_EN | OFFOUT_VAL)
#define PIN_OFF_OUTPUT_LOW (OFF_EN | OFFOUT_EN)
-#define PIN_OFF_INPUT_PULLUP (OFF_EN | OFF_PULL_EN | OFF_PULL_UP)
-#define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFF_PULL_EN)
+#define PIN_OFF_INPUT_PULLUP (OFF_EN | OFFOUT_EN | OFF_PULL_EN | OFF_PULL_UP)
+#define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFFOUT_EN | OFF_PULL_EN)
#define PIN_OFF_WAKEUPENABLE WAKEUP_EN
/*
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 89d9aa9e79bf..6fe974dbe741 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -234,12 +234,10 @@ static inline int block_page_mkwrite_return(int err)
{
if (err == 0)
return VM_FAULT_LOCKED;
- if (err == -EFAULT)
+ if (err == -EFAULT || err == -EAGAIN)
return VM_FAULT_NOPAGE;
if (err == -ENOMEM)
return VM_FAULT_OOM;
- if (err == -EAGAIN)
- return VM_FAULT_RETRY;
/* -ENOSPC, -EDQUOT, -EIO ... */
return VM_FAULT_SIGBUS;
}
diff --git a/include/linux/clk/msm-clock-generic.h b/include/linux/clk/msm-clock-generic.h
index d7186a363a3f..fe019d366d0b 100644
--- a/include/linux/clk/msm-clock-generic.h
+++ b/include/linux/clk/msm-clock-generic.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2017, 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
@@ -307,4 +307,16 @@ static inline struct mux_div_clk *to_mux_div_clk(struct clk *clk)
extern struct clk_ops clk_ops_mux_div_clk;
+/* ==================== Virtual clock ==================== */
+struct virtclk_front {
+ int id;
+ struct clk c;
+};
+
+extern struct clk_ops virtclk_front_ops;
+
+int msm_virtclk_front_probe(struct platform_device *pdev,
+ struct clk_lookup *table,
+ size_t size);
+
#endif
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 333d0ca6940f..516d83041206 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -1292,7 +1292,7 @@ efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg,
unsigned long *load_addr,
unsigned long *load_size);
-efi_status_t efi_parse_options(char *cmdline);
+efi_status_t efi_parse_options(char const *cmdline);
bool efi_runtime_disabled(void);
#endif /* _LINUX_EFI_H */
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h
index c2a975e4a711..fef1caeddf54 100644
--- a/include/linux/f2fs_fs.h
+++ b/include/linux/f2fs_fs.h
@@ -36,6 +36,8 @@
#define F2FS_NODE_INO(sbi) (sbi->node_ino_num)
#define F2FS_META_INO(sbi) (sbi->meta_ino_num)
+#define F2FS_MAX_QUOTAS 3
+
#define F2FS_IO_SIZE(sbi) (1 << (sbi)->write_io_size_bits) /* Blocks */
#define F2FS_IO_SIZE_KB(sbi) (1 << ((sbi)->write_io_size_bits + 2)) /* KB */
#define F2FS_IO_SIZE_BYTES(sbi) (1 << ((sbi)->write_io_size_bits + 12)) /* B */
@@ -108,7 +110,8 @@ struct f2fs_super_block {
__u8 encryption_level; /* versioning level for encryption */
__u8 encrypt_pw_salt[16]; /* Salt used for string2key algorithm */
struct f2fs_device devs[MAX_DEVICES]; /* device list */
- __u8 reserved[327]; /* valid reserved region */
+ __le32 qf_ino[F2FS_MAX_QUOTAS]; /* quota inode numbers */
+ __u8 reserved[315]; /* valid reserved region */
} __packed;
/*
@@ -184,7 +187,8 @@ struct f2fs_extent {
} __packed;
#define F2FS_NAME_LEN 255
-#define F2FS_INLINE_XATTR_ADDRS 50 /* 200 bytes for inline xattrs */
+/* 200 bytes for inline xattrs by default */
+#define DEFAULT_INLINE_XATTR_ADDRS 50
#define DEF_ADDRS_PER_INODE 923 /* Address Pointers in an Inode */
#define CUR_ADDRS_PER_INODE(inode) (DEF_ADDRS_PER_INODE - \
get_extra_isize(inode))
@@ -238,7 +242,7 @@ struct f2fs_inode {
union {
struct {
__le16 i_extra_isize; /* extra inode attribute size */
- __le16 i_padding; /* padding */
+ __le16 i_inline_xattr_size; /* inline xattr size, unit: 4 bytes */
__le32 i_projid; /* project id */
__le32 i_inode_checksum;/* inode meta checksum */
__le32 i_extra_end[0]; /* for attribute size calculation */
diff --git a/include/linux/input/qpnp-power-on.h b/include/linux/input/qpnp-power-on.h
index a2624ab57826..5944f0fd3414 100644
--- a/include/linux/input/qpnp-power-on.h
+++ b/include/linux/input/qpnp-power-on.h
@@ -51,6 +51,7 @@ enum pon_power_off_type {
};
enum pon_restart_reason {
+ /* 0 ~ 31 for common defined features */
PON_RESTART_REASON_UNKNOWN = 0x00,
PON_RESTART_REASON_RECOVERY = 0x01,
PON_RESTART_REASON_BOOTLOADER = 0x02,
@@ -58,6 +59,10 @@ enum pon_restart_reason {
PON_RESTART_REASON_DMVERITY_CORRUPTED = 0x04,
PON_RESTART_REASON_DMVERITY_ENFORCE = 0x05,
PON_RESTART_REASON_KEYS_CLEAR = 0x06,
+
+ /* 32 ~ 63 for OEMs/ODMs secific features */
+ PON_RESTART_REASON_OEM_MIN = 0x20,
+ PON_RESTART_REASON_OEM_MAX = 0x3f,
};
#ifdef CONFIG_INPUT_QPNP_POWER_ON
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 50220cab738c..05b63a1e9f84 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -53,6 +53,13 @@
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
+#define u64_to_user_ptr(x) ( \
+{ \
+ typecheck(u64, x); \
+ (void __user *)(uintptr_t)x; \
+} \
+)
+
/*
* This looks more complex than it should be. But we need to
* get the type for the ~ right in round_down (it needs to be
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7d0b5e7bcadb..b4a5021fbbfa 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -71,6 +71,10 @@ extern int mmap_rnd_compat_bits __read_mostly;
#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0))
#endif
+#ifndef lm_alias
+#define lm_alias(x) __va(__pa_symbol(x))
+#endif
+
/*
* To prevent common memory management code establishing
* a zero page mapping on a read fault.
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 2b1be7efde55..721bdb0226bd 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -715,7 +715,8 @@ typedef struct pglist_data {
* is the first PFN that needs to be initialised.
*/
unsigned long first_deferred_pfn;
- unsigned long static_init_size;
+ /* Number of non-deferred pages */
+ unsigned long static_init_pgcnt;
#endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */
} pg_data_t;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 0a306b431ece..c77de3b5f564 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3473,6 +3473,9 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
unsigned char name_assign_type,
void (*setup)(struct net_device *),
unsigned int txqs, unsigned int rxqs);
+int dev_get_valid_name(struct net *net, struct net_device *dev,
+ const char *name);
+
#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \
alloc_netdev_mqs(sizeof_priv, name, name_assign_type, setup, 1, 1)
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 639e9b8b0e4d..0b41959aab9f 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -131,6 +131,7 @@ netlink_skb_clone(struct sk_buff *skb, gfp_t gfp_mask)
struct netlink_callback {
struct sk_buff *skb;
const struct nlmsghdr *nlh;
+ int (*start)(struct netlink_callback *);
int (*dump)(struct sk_buff * skb,
struct netlink_callback *cb);
int (*done)(struct netlink_callback *cb);
@@ -153,6 +154,7 @@ struct nlmsghdr *
__nlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, int type, int len, int flags);
struct netlink_dump_control {
+ int (*start)(struct netlink_callback *);
int (*dump)(struct sk_buff *skb, struct netlink_callback *);
int (*done)(struct netlink_callback *);
void *data;
diff --git a/include/linux/phy.h b/include/linux/phy.h
index b64825d6ad26..5bc4b9d563a9 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -136,11 +136,7 @@ static inline const char *phy_modes(phy_interface_t interface)
/* Used when trying to connect to a specific phy (mii bus id:phy device id) */
#define PHY_ID_FMT "%s:%02x"
-/*
- * Need to be a little smaller than phydev->dev.bus_id to leave room
- * for the ":%02x"
- */
-#define MII_BUS_ID_SIZE (20 - 3)
+#define MII_BUS_ID_SIZE 61
/* Or MII_ADDR_C45 into regnum for read/write on mii_bus to enable the 21 bit
IEEE 802.3ae clause 45 addressing mode used by 10GIGE phy chips. */
@@ -599,7 +595,7 @@ struct phy_driver {
/* A Structure for boards to register fixups with the PHY Lib */
struct phy_fixup {
struct list_head list;
- char bus_id[20];
+ char bus_id[MII_BUS_ID_SIZE + 3];
u32 phy_uid;
u32 phy_uid_mask;
int (*run)(struct phy_device *phydev);
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index 75e4e30677f1..7eeceac52dea 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -65,19 +65,24 @@
/*
* Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context? Interrupt context?
- * in_softirq - Are we currently processing softirq or have bh disabled?
- * in_serving_softirq - Are we currently processing softirq?
+ *
+ * in_irq() - We're in (hard) IRQ context
+ * in_softirq() - We have BH disabled, or are processing softirqs
+ * in_interrupt() - We're in NMI,IRQ,SoftIRQ context or have BH disabled
+ * in_serving_softirq() - We're in softirq context
+ * in_nmi() - We're in NMI context
+ * in_task() - We're in task context
+ *
+ * Note: due to the BH disabled confusion: in_softirq(),in_interrupt() really
+ * should not be used in new code.
*/
#define in_irq() (hardirq_count())
#define in_softirq() (softirq_count())
#define in_interrupt() (irq_count())
#define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET)
-
-/*
- * Are we in NMI context?
- */
-#define in_nmi() (preempt_count() & NMI_MASK)
+#define in_nmi() (preempt_count() & NMI_MASK)
+#define in_task() (!(preempt_count() & \
+ (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET)))
/*
* The preempt_count offset after preempt_disable();
diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h
index 128c4a8c9979..ca7c8041b894 100644
--- a/include/linux/sched/sysctl.h
+++ b/include/linux/sched/sysctl.h
@@ -40,7 +40,6 @@ extern unsigned int sysctl_sched_min_granularity;
extern unsigned int sysctl_sched_wakeup_granularity;
extern unsigned int sysctl_sched_child_runs_first;
extern unsigned int sysctl_sched_sync_hint_enable;
-extern unsigned int sysctl_sched_initial_task_util;
extern unsigned int sysctl_sched_cstate_aware;
#ifdef CONFIG_SCHED_HMP
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 3f61c647fc5c..b5421f6f155a 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3400,6 +3400,13 @@ static inline void nf_reset_trace(struct sk_buff *skb)
#endif
}
+static inline void ipvs_reset(struct sk_buff *skb)
+{
+#if IS_ENABLED(CONFIG_IP_VS)
+ skb->ipvs_property = 0;
+#endif
+}
+
/* Note: This doesn't put any conntrack and bridge info in dst. */
static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src,
bool copy)
diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h
new file mode 100644
index 000000000000..0f175b8f6456
--- /dev/null
+++ b/include/linux/tee_drv.h
@@ -0,0 +1,277 @@
+/*
+ * Copyright (c) 2015-2016, Linaro Limited
+ *
+ * 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 __TEE_DRV_H
+#define __TEE_DRV_H
+
+#include <linux/types.h>
+#include <linux/idr.h>
+#include <linux/list.h>
+#include <linux/tee.h>
+
+/*
+ * The file describes the API provided by the generic TEE driver to the
+ * specific TEE driver.
+ */
+
+#define TEE_SHM_MAPPED 0x1 /* Memory mapped by the kernel */
+#define TEE_SHM_DMA_BUF 0x2 /* Memory with dma-buf handle */
+
+struct tee_device;
+struct tee_shm;
+struct tee_shm_pool;
+
+/**
+ * struct tee_context - driver specific context on file pointer data
+ * @teedev: pointer to this drivers struct tee_device
+ * @list_shm: List of shared memory object owned by this context
+ * @data: driver specific context data, managed by the driver
+ */
+struct tee_context {
+ struct tee_device *teedev;
+ struct list_head list_shm;
+ void *data;
+};
+
+struct tee_param_memref {
+ size_t shm_offs;
+ size_t size;
+ struct tee_shm *shm;
+};
+
+struct tee_param_value {
+ u64 a;
+ u64 b;
+ u64 c;
+};
+
+struct tee_param {
+ u64 attr;
+ union {
+ struct tee_param_memref memref;
+ struct tee_param_value value;
+ } u;
+};
+
+/**
+ * struct tee_driver_ops - driver operations vtable
+ * @get_version: returns version of driver
+ * @open: called when the device file is opened
+ * @release: release this open file
+ * @open_session: open a new session
+ * @close_session: close a session
+ * @invoke_func: invoke a trusted function
+ * @cancel_req: request cancel of an ongoing invoke or open
+ * @supp_revc: called for supplicant to get a command
+ * @supp_send: called for supplicant to send a response
+ */
+struct tee_driver_ops {
+ void (*get_version)(struct tee_device *teedev,
+ struct tee_ioctl_version_data *vers);
+ int (*open)(struct tee_context *ctx);
+ void (*release)(struct tee_context *ctx);
+ int (*open_session)(struct tee_context *ctx,
+ struct tee_ioctl_open_session_arg *arg,
+ struct tee_param *param);
+ int (*close_session)(struct tee_context *ctx, u32 session);
+ int (*invoke_func)(struct tee_context *ctx,
+ struct tee_ioctl_invoke_arg *arg,
+ struct tee_param *param);
+ int (*cancel_req)(struct tee_context *ctx, u32 cancel_id, u32 session);
+ int (*supp_recv)(struct tee_context *ctx, u32 *func, u32 *num_params,
+ struct tee_param *param);
+ int (*supp_send)(struct tee_context *ctx, u32 ret, u32 num_params,
+ struct tee_param *param);
+};
+
+/**
+ * struct tee_desc - Describes the TEE driver to the subsystem
+ * @name: name of driver
+ * @ops: driver operations vtable
+ * @owner: module providing the driver
+ * @flags: Extra properties of driver, defined by TEE_DESC_* below
+ */
+#define TEE_DESC_PRIVILEGED 0x1
+struct tee_desc {
+ const char *name;
+ const struct tee_driver_ops *ops;
+ struct module *owner;
+ u32 flags;
+};
+
+/**
+ * tee_device_alloc() - Allocate a new struct tee_device instance
+ * @teedesc: Descriptor for this driver
+ * @dev: Parent device for this device
+ * @pool: Shared memory pool, NULL if not used
+ * @driver_data: Private driver data for this device
+ *
+ * Allocates a new struct tee_device instance. The device is
+ * removed by tee_device_unregister().
+ *
+ * @returns a pointer to a 'struct tee_device' or an ERR_PTR on failure
+ */
+struct tee_device *tee_device_alloc(const struct tee_desc *teedesc,
+ struct device *dev,
+ struct tee_shm_pool *pool,
+ void *driver_data);
+
+/**
+ * tee_device_register() - Registers a TEE device
+ * @teedev: Device to register
+ *
+ * tee_device_unregister() need to be called to remove the @teedev if
+ * this function fails.
+ *
+ * @returns < 0 on failure
+ */
+int tee_device_register(struct tee_device *teedev);
+
+/**
+ * tee_device_unregister() - Removes a TEE device
+ * @teedev: Device to unregister
+ *
+ * This function should be called to remove the @teedev even if
+ * tee_device_register() hasn't been called yet. Does nothing if
+ * @teedev is NULL.
+ */
+void tee_device_unregister(struct tee_device *teedev);
+
+/**
+ * struct tee_shm_pool_mem_info - holds information needed to create a shared
+ * memory pool
+ * @vaddr: Virtual address of start of pool
+ * @paddr: Physical address of start of pool
+ * @size: Size in bytes of the pool
+ */
+struct tee_shm_pool_mem_info {
+ unsigned long vaddr;
+ phys_addr_t paddr;
+ size_t size;
+};
+
+/**
+ * tee_shm_pool_alloc_res_mem() - Create a shared memory pool from reserved
+ * memory range
+ * @priv_info: Information for driver private shared memory pool
+ * @dmabuf_info: Information for dma-buf shared memory pool
+ *
+ * Start and end of pools will must be page aligned.
+ *
+ * Allocation with the flag TEE_SHM_DMA_BUF set will use the range supplied
+ * in @dmabuf, others will use the range provided by @priv.
+ *
+ * @returns pointer to a 'struct tee_shm_pool' or an ERR_PTR on failure.
+ */
+struct tee_shm_pool *
+tee_shm_pool_alloc_res_mem(struct tee_shm_pool_mem_info *priv_info,
+ struct tee_shm_pool_mem_info *dmabuf_info);
+
+/**
+ * tee_shm_pool_free() - Free a shared memory pool
+ * @pool: The shared memory pool to free
+ *
+ * The must be no remaining shared memory allocated from this pool when
+ * this function is called.
+ */
+void tee_shm_pool_free(struct tee_shm_pool *pool);
+
+/**
+ * tee_get_drvdata() - Return driver_data pointer
+ * @returns the driver_data pointer supplied to tee_register().
+ */
+void *tee_get_drvdata(struct tee_device *teedev);
+
+/**
+ * tee_shm_alloc() - Allocate shared memory
+ * @ctx: Context that allocates the shared memory
+ * @size: Requested size of shared memory
+ * @flags: Flags setting properties for the requested shared memory.
+ *
+ * Memory allocated as global shared memory is automatically freed when the
+ * TEE file pointer is closed. The @flags field uses the bits defined by
+ * TEE_SHM_* above. TEE_SHM_MAPPED must currently always be set. If
+ * TEE_SHM_DMA_BUF global shared memory will be allocated and associated
+ * with a dma-buf handle, else driver private memory.
+ *
+ * @returns a pointer to 'struct tee_shm'
+ */
+struct tee_shm *tee_shm_alloc(struct tee_context *ctx, size_t size, u32 flags);
+
+/**
+ * tee_shm_free() - Free shared memory
+ * @shm: Handle to shared memory to free
+ */
+void tee_shm_free(struct tee_shm *shm);
+
+/**
+ * tee_shm_put() - Decrease reference count on a shared memory handle
+ * @shm: Shared memory handle
+ */
+void tee_shm_put(struct tee_shm *shm);
+
+/**
+ * tee_shm_va2pa() - Get physical address of a virtual address
+ * @shm: Shared memory handle
+ * @va: Virtual address to tranlsate
+ * @pa: Returned physical address
+ * @returns 0 on success and < 0 on failure
+ */
+int tee_shm_va2pa(struct tee_shm *shm, void *va, phys_addr_t *pa);
+
+/**
+ * tee_shm_pa2va() - Get virtual address of a physical address
+ * @shm: Shared memory handle
+ * @pa: Physical address to tranlsate
+ * @va: Returned virtual address
+ * @returns 0 on success and < 0 on failure
+ */
+int tee_shm_pa2va(struct tee_shm *shm, phys_addr_t pa, void **va);
+
+/**
+ * tee_shm_get_va() - Get virtual address of a shared memory plus an offset
+ * @shm: Shared memory handle
+ * @offs: Offset from start of this shared memory
+ * @returns virtual address of the shared memory + offs if offs is within
+ * the bounds of this shared memory, else an ERR_PTR
+ */
+void *tee_shm_get_va(struct tee_shm *shm, size_t offs);
+
+/**
+ * tee_shm_get_pa() - Get physical address of a shared memory plus an offset
+ * @shm: Shared memory handle
+ * @offs: Offset from start of this shared memory
+ * @pa: Physical address to return
+ * @returns 0 if offs is within the bounds of this shared memory, else an
+ * error code.
+ */
+int tee_shm_get_pa(struct tee_shm *shm, size_t offs, phys_addr_t *pa);
+
+/**
+ * tee_shm_get_id() - Get id of a shared memory object
+ * @shm: Shared memory handle
+ * @returns id
+ */
+int tee_shm_get_id(struct tee_shm *shm);
+
+/**
+ * tee_shm_get_from_id() - Find shared memory object and increase reference
+ * count
+ * @ctx: Context owning the shared memory
+ * @id: Id of shared memory object
+ * @returns a pointer to 'struct tee_shm' on success or an ERR_PTR on failure
+ */
+struct tee_shm *tee_shm_get_from_id(struct tee_context *ctx, int id);
+
+#endif /*__TEE_DRV_H*/
diff --git a/include/linux/timekeeper_internal.h b/include/linux/timekeeper_internal.h
index f0f1793cfa49..3a5af09af18b 100644
--- a/include/linux/timekeeper_internal.h
+++ b/include/linux/timekeeper_internal.h
@@ -50,13 +50,13 @@ struct tk_read_base {
* @tai_offset: The current UTC to TAI offset in seconds
* @clock_was_set_seq: The sequence number of clock was set events
* @next_leap_ktime: CLOCK_MONOTONIC time value of a pending leap-second
- * @raw_time: Monotonic raw base time in timespec64 format
+ * @raw_sec: CLOCK_MONOTONIC_RAW time in seconds
* @cycle_interval: Number of clock cycles in one NTP interval
* @xtime_interval: Number of clock shifted nano seconds in one NTP
* interval.
* @xtime_remainder: Shifted nano seconds left over when rounding
* @cycle_interval
- * @raw_interval: Raw nano seconds accumulated per NTP interval.
+ * @raw_interval: Shifted raw nano seconds accumulated per NTP interval.
* @ntp_error: Difference between accumulated time and NTP time in ntp
* shifted nano seconds.
* @ntp_error_shift: Shift conversion between clock shifted nano seconds and
@@ -91,13 +91,13 @@ struct timekeeper {
s32 tai_offset;
unsigned int clock_was_set_seq;
ktime_t next_leap_ktime;
- struct timespec64 raw_time;
+ u64 raw_sec;
/* The following members are for timekeeping internal use */
cycle_t cycle_interval;
u64 xtime_interval;
s64 xtime_remainder;
- u32 raw_interval;
+ u64 raw_interval;
/* The ntp_tick_length() value currently being used.
* This cached copy ensures we consistently apply the tick
* length for an entire tick, as ntp_tick_length may change
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 83a505c749e1..1821d34c24a5 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -330,6 +330,7 @@ struct usb_host_bos {
struct usb_ss_cap_descriptor *ss_cap;
struct usb_ssp_cap_descriptor *ssp_cap;
struct usb_ss_container_id_descriptor *ss_id;
+ struct usb_ptm_cap_descriptor *ptm_cap;
struct usb_config_summary_descriptor *config_summary;
unsigned int num_config_summary_desc;
};
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h
index 3a375d07d0dc..6670e9b34f20 100644
--- a/include/linux/usb/cdc_ncm.h
+++ b/include/linux/usb/cdc_ncm.h
@@ -82,6 +82,7 @@
/* Driver flags */
#define CDC_NCM_FLAG_NDP_TO_END 0x02 /* NDP is placed at end of frame */
+#define CDC_NCM_FLAG_RESET_NTB16 0x08 /* set NDP16 one more time after altsetting switch */
#define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \
(x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE)
diff --git a/include/media/adv7481.h b/include/media/adv7481.h
index 80b8ee879ea4..fa5466197889 100644
--- a/include/media/adv7481.h
+++ b/include/media/adv7481.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-2017, 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
@@ -14,6 +14,7 @@
#ifndef __ADV7481_H__
#define __ADV7481_H__
+#include <uapi/media/msm_ba.h>
/**
* adv7481_platform_data
* structure to pass board specific information to the ADV7481 driver
diff --git a/include/media/msm_ba.h b/include/media/msm_ba.h
index d630e441590f..4bab36ade468 100644
--- a/include/media/msm_ba.h
+++ b/include/media/msm_ba.h
@@ -35,6 +35,7 @@ enum msm_ba_ip {
BA_IP_HDMI_1,
BA_IP_MHL_1,
BA_IP_TTL,
+ BA_IP_TV_TUNER,
BA_IP_MAX = 0xffffffff
};
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 1b6b6dcb018d..43c0e771f417 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -114,6 +114,7 @@ static inline void genl_info_net_set(struct genl_info *info, struct net *net)
* @flags: flags
* @policy: attribute validation policy
* @doit: standard command callback
+ * @start: start callback for dumps
* @dumpit: callback for dumpers
* @done: completion callback for dumps
* @ops_list: operations list
@@ -122,6 +123,7 @@ struct genl_ops {
const struct nla_policy *policy;
int (*doit)(struct sk_buff *skb,
struct genl_info *info);
+ int (*start)(struct netlink_callback *cb);
int (*dumpit)(struct sk_buff *skb,
struct netlink_callback *cb);
int (*done)(struct netlink_callback *cb);
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 625bdf95d673..95aa999f31d7 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -95,7 +95,7 @@ struct inet_request_sock {
kmemcheck_bitfield_end(flags);
u32 ir_mark;
union {
- struct ip_options_rcu *opt;
+ struct ip_options_rcu __rcu *ireq_opt;
struct sk_buff *pktopts;
};
};
@@ -113,6 +113,12 @@ static inline u32 inet_request_mark(const struct sock *sk, struct sk_buff *skb)
return sk->sk_mark;
}
+static inline struct ip_options_rcu *ireq_opt_deref(const struct inet_request_sock *ireq)
+{
+ return rcu_dereference_check(ireq->ireq_opt,
+ atomic_read(&ireq->req.rsk_refcnt) > 0);
+}
+
struct inet_cork {
unsigned int flags;
__be32 addr;
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 52402ab90c57..340b01dd8c37 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1629,12 +1629,12 @@ static inline void tcp_highest_sack_reset(struct sock *sk)
tcp_sk(sk)->highest_sack = tcp_write_queue_head(sk);
}
-/* Called when old skb is about to be deleted (to be combined with new skb) */
-static inline void tcp_highest_sack_combine(struct sock *sk,
+/* Called when old skb is about to be deleted and replaced by new skb */
+static inline void tcp_highest_sack_replace(struct sock *sk,
struct sk_buff *old,
struct sk_buff *new)
{
- if (tcp_sk(sk)->sacked_out && (old == tcp_sk(sk)->highest_sack))
+ if (old == tcp_highest_sack(sk))
tcp_sk(sk)->highest_sack = new;
}
diff --git a/include/soc/qcom/icnss.h b/include/soc/qcom/icnss.h
index 7915841b17ea..4fff429dc0b2 100644
--- a/include/soc/qcom/icnss.h
+++ b/include/soc/qcom/icnss.h
@@ -153,6 +153,7 @@ extern int icnss_wlan_set_dfs_nol(const void *info, u16 info_len);
extern int icnss_wlan_get_dfs_nol(void *info, u16 info_len);
extern bool icnss_is_qmi_disable(struct device *dev);
extern bool icnss_is_fw_ready(void);
+extern bool icnss_is_fw_down(void);
extern int icnss_set_wlan_mac_address(const u8 *in, const uint32_t len);
extern u8 *icnss_get_wlan_mac_address(struct device *dev, uint32_t *num);
extern int icnss_trigger_recovery(struct device *dev);
diff --git a/include/sound/apr_audio-v2.h b/include/sound/apr_audio-v2.h
index 6078ef2e24de..ca2ceff39f2f 100644
--- a/include/sound/apr_audio-v2.h
+++ b/include/sound/apr_audio-v2.h
@@ -29,6 +29,108 @@ struct param_outband {
phys_addr_t paddr;
};
+/* --------- Common Structures and Definitions------------- */
+/* Instance ID Definitions */
+#define INSTANCE_ID_0 0x0000
+
+struct mem_mapping_hdr {
+ /*
+ * LSW of parameter data payload address. Supported values: any.
+ * - Must be set to zero for in-band data.
+ */
+ u32 data_payload_addr_lsw;
+
+ /*
+ * MSW of Parameter data payload address. Supported values: any.
+ * - Must be set to zero for in-band data.
+ * - In the case of 32 bit Shared memory address, msw field must be
+ * set to zero.
+ * - In the case of 36 bit shared memory address, bit 31 to bit 4 of
+ * msw must be set to zero.
+ */
+ u32 data_payload_addr_msw;
+
+ /*
+ * Memory map handle returned by DSP through
+ * ASM_CMD_SHARED_MEM_MAP_REGIONS command.
+ * Supported Values: Any.
+ * If mmhandle is NULL, the ParamData payloads are within the
+ * message payload (in-band).
+ * If mmhandle is non-NULL, the ParamData payloads begin at the
+ * address specified in the address msw and lsw (out-of-band).
+ */
+ u32 mem_map_handle;
+
+} __packed;
+
+/*
+ * Payload format for parameter data.
+ * Immediately following these structures are param_size bytes of parameter
+ * data.
+ */
+struct param_hdr_v1 {
+ /* Valid ID of the module. */
+ uint32_t module_id;
+
+ /* Valid ID of the parameter. */
+ uint32_t param_id;
+
+ /* The size of the parameter specified by the module/param ID combo */
+ uint16_t param_size;
+
+ /* This field must be set to zero. */
+ uint16_t reserved;
+} __packed;
+
+struct param_hdr_v2 {
+ /* Valid ID of the module. */
+ uint32_t module_id;
+
+ /* Valid ID of the parameter. */
+ uint32_t param_id;
+
+ /* The size of the parameter specified by the module/param ID combo */
+ uint32_t param_size;
+} __packed;
+
+struct param_hdr_v3 {
+ /* Valid ID of the module. */
+ uint32_t module_id;
+
+ /* Instance of the module. */
+ uint16_t instance_id;
+
+ /* This field must be set to zero. */
+ uint16_t reserved;
+
+ /* Valid ID of the parameter. */
+ uint32_t param_id;
+
+ /* The size of the parameter specified by the module/param ID combo */
+ uint32_t param_size;
+} __packed;
+
+/* A union of all param_hdr versions for versitility and max size */
+union param_hdrs {
+ struct param_hdr_v1 v1;
+ struct param_hdr_v2 v2;
+ struct param_hdr_v3 v3;
+};
+
+struct module_instance_info {
+ /* Module ID. */
+ u32 module_id;
+
+ /* Instance of the module */
+ u16 instance_id;
+
+ /* Reserved. This field must be set to zero. */
+ u16 reserved;
+} __packed;
+/* -------------------------------------------------------- */
+
+/* Begin service specific definitions and structures */
+
#define ADSP_ADM_VERSION 0x00070000
#define ADM_CMD_SHARED_MEM_MAP_REGIONS 0x00010322
@@ -399,70 +501,36 @@ struct adm_cmd_device_open_v6 {
/* Sets one or more parameters to a COPP.
*/
#define ADM_CMD_SET_PP_PARAMS_V5 0x00010328
+#define ADM_CMD_SET_PP_PARAMS_V6 0x0001035D
-/* Payload of the #ADM_CMD_SET_PP_PARAMS_V5 command.
- * If the data_payload_addr_lsw and data_payload_addr_msw element
- * are NULL, a series of adm_param_datastructures immediately
- * follows, whose total size is data_payload_size bytes.
- */
-struct adm_cmd_set_pp_params_v5 {
- struct apr_hdr hdr;
- u32 payload_addr_lsw;
- /* LSW of parameter data payload address.*/
- u32 payload_addr_msw;
- /* MSW of parameter data payload address.*/
-
- u32 mem_map_handle;
-/* Memory map handle returned by ADM_CMD_SHARED_MEM_MAP_REGIONS
- * command */
-/* If mem_map_handle is zero implies the message is in
- * the payload */
-
- u32 payload_size;
-/* Size in bytes of the variable payload accompanying this
- * message or
- * in shared memory. This is used for parsing the parameter
- * payload.
- */
-} __packed;
-
-/* Payload format for COPP parameter data.
- * Immediately following this structure are param_size bytes
- * of parameter
- * data.
+/*
+ * Structure of the ADM Set PP Params command. Parameter data must be
+ * pre-packed with correct header for either V2 or V3 when sent in-band.
+ * Use q6core_pack_pp_params to pack the header and data correctly depending on
+ * Instance ID support.
*/
-struct adm_param_data_v5 {
- u32 module_id;
- /* Unique ID of the module. */
- u32 param_id;
- /* Unique ID of the parameter. */
- u16 param_size;
- /* Data size of the param_id/module_id combination.
- This value is a
- multiple of 4 bytes. */
- u16 reserved;
- /* Reserved for future enhancements.
- * This field must be set to zero.
- */
-} __packed;
+struct adm_cmd_set_pp_params {
+ /* APR Header */
+ struct apr_hdr apr_hdr;
+ /* The memory mapping header to be used when sending out of band */
+ struct mem_mapping_hdr mem_hdr;
-struct param_data_v6 {
- /* Unique ID of the module. */
- u32 module_id;
- /* Unique ID of the instance. */
- u16 instance_id;
- /* Reserved for future enhancements.
- * This field must be set to zero.
+ /* Size in bytes of the variable payload accompanying this
+ * message or
+ * in shared memory. This is used for parsing the parameter
+ * payload.
*/
- u16 reserved;
- /* Unique ID of the parameter. */
- u32 param_id;
- /* Data size of the param_id/module_id combination.
- * This value is a
- * multiple of 4 bytes.
+ u32 payload_size;
+
+ /* Parameter data for in band payload. This should be structured as the
+ * parameter header immediately followed by the parameter data. Multiple
+ * parameters can be set in one command by repeating the header followed
+ * by the data for as many parameters as need to be set.
+ * Use q6core_pack_pp_params to pack the header and data correctly
+ * depending on Instance ID support.
*/
- u32 param_size;
+ u8 param_data[0];
} __packed;
/* ADM_CMD_SET_MTMX_STRTR_DEV_PARAMS_V1 command is used to set
@@ -480,7 +548,7 @@ struct param_data_v6 {
/* Payload of the #define ADM_CMD_SET_MTMX_STRTR_DEV_PARAMS_V1 command.
* If the data_payload_addr_lsw and data_payload_addr_msw element
- * are NULL, a series of struct param_data_v6 structures immediately
+ * are NULL, a series of struct param_hdr_v3 structures immediately
* follows, whose total size is payload_size bytes.
*/
struct adm_cmd_set_mtmx_params_v1 {
@@ -517,7 +585,7 @@ struct enable_param_v6 {
* This parameter is generic/common parameter to configure or
* determine the state of any audio processing module.
*/
- struct param_data_v6 param;
+ struct param_hdr_v3 param;
/* @values 0 : Disable 1: Enable */
uint32_t enable;
@@ -570,25 +638,6 @@ struct adm_cmd_set_pspd_mtmx_strtr_params_v5 {
u16 reserved;
} __packed;
-/* Defined specifically for in-band use, includes params */
-struct adm_cmd_set_pp_params_inband_v5 {
- struct apr_hdr hdr;
- /* LSW of parameter data payload address.*/
- u32 payload_addr_lsw;
- /* MSW of parameter data payload address.*/
- u32 payload_addr_msw;
- /* Memory map handle returned by ADM_CMD_SHARED_MEM_MAP_REGIONS */
- /* command. If mem_map_handle is zero implies the message is in */
- /* the payload */
- u32 mem_map_handle;
- /* Size in bytes of the variable payload accompanying this */
- /* message or in shared memory. This is used for parsing the */
- /* parameter payload. */
- u32 payload_size;
- /* Parameters passed for in band payload */
- struct adm_param_data_v5 params;
-} __packed;
-
/* Returns the status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V5 command.
*/
#define ADM_CMDRSP_DEVICE_OPEN_V5 0x00010329
@@ -621,44 +670,21 @@ struct adm_cmd_rsp_device_open_v5 {
/* This command allows a query of one COPP parameter.
*/
#define ADM_CMD_GET_PP_PARAMS_V5 0x0001032A
+#define ADM_CMD_GET_PP_PARAMS_V6 0x0001035E
-/* Payload an #ADM_CMD_GET_PP_PARAMS_V5 command.
-*/
-struct adm_cmd_get_pp_params_v5 {
- struct apr_hdr hdr;
- u32 data_payload_addr_lsw;
- /* LSW of parameter data payload address.*/
-
- u32 data_payload_addr_msw;
- /* MSW of parameter data payload address.*/
-
- /* If the mem_map_handle is non zero,
- * on ACK, the ParamData payloads begin at
- * the address specified (out-of-band).
- */
-
- u32 mem_map_handle;
- /* Memory map handle returned
- * by ADM_CMD_SHARED_MEM_MAP_REGIONS command.
- * If the mem_map_handle is 0, it implies that
- * the ACK's payload will contain the ParamData (in-band).
- */
-
- u32 module_id;
- /* Unique ID of the module. */
+/*
+ * Structure of the ADM Get PP Params command. Parameter header must be
+ * packed correctly for either V2 or V3. Use q6core_pack_pp_params to pack the
+ * header correctly depending on Instance ID support.
+ */
+struct adm_cmd_get_pp_params {
+ struct apr_hdr apr_hdr;
- u32 param_id;
- /* Unique ID of the parameter. */
+ /* The memory mapping header to be used when requesting outband */
+ struct mem_mapping_hdr mem_hdr;
- u16 param_max_size;
- /* Maximum data size of the parameter
- *ID/module ID combination. This
- * field is a multiple of 4 bytes.
- */
- u16 reserved;
- /* Reserved for future enhancements.
- * This field must be set to zero.
- */
+ /* Parameter header for in band payload. */
+ union param_hdrs param_hdr;
} __packed;
/* Returns parameter values
@@ -670,15 +696,48 @@ struct adm_cmd_get_pp_params_v5 {
* which returns parameter values in response
* to an #ADM_CMD_GET_PP_PARAMS_V5 command.
* Immediately following this
- * structure is the adm_param_data_v5
+ * structure is the param_hdr_v1
* structure containing the pre/postprocessing
* parameter data. For an in-band
* scenario, the variable payload depends
* on the size of the parameter.
*/
struct adm_cmd_rsp_get_pp_params_v5 {
- u32 status;
/* Status message (error code).*/
+ u32 status;
+
+ /* The header that identifies the subsequent parameter data */
+ struct param_hdr_v1 param_hdr;
+
+ /* The parameter data returned */
+ u32 param_data[0];
+} __packed;
+
+/*
+ * Returns parameter values in response to an #ADM_CMD_GET_PP_PARAMS_V5/6
+ * command.
+ */
+#define ADM_CMDRSP_GET_PP_PARAMS_V6 0x0001035F
+
+/* Payload of the #ADM_CMDRSP_GET_PP_PARAMS_V6 message,
+ * which returns parameter values in response
+ * to an #ADM_CMD_GET_PP_PARAMS_V6 command.
+ * Immediately following this
+ * structure is the param_hdr_v3
+ * structure containing the pre/postprocessing
+ * parameter data. For an in-band
+ * scenario, the variable payload depends
+ * on the size of the parameter.
+*/
+struct adm_cmd_rsp_get_pp_params_v6 {
+ /* Status message (error code).*/
+ u32 status;
+
+ /* The header that identifies the subsequent parameter data */
+ struct param_hdr_v3 param_hdr;
+
+ /* The parameter data returned */
+ u32 param_data[0];
} __packed;
/* Structure for holding soft stepping volume parameters. */
@@ -731,9 +790,29 @@ struct adm_pspd_param_data_t {
uint16_t reserved;
} __packed;
-struct audproc_mfc_output_media_fmt {
- struct adm_cmd_set_pp_params_v5 params;
- struct adm_param_data_v5 data;
+struct adm_cmd_set_pp_params_v5 {
+ struct apr_hdr hdr;
+ u32 payload_addr_lsw;
+ /* LSW of parameter data payload address.*/
+ u32 payload_addr_msw;
+ /* MSW of parameter data payload address.*/
+
+ u32 mem_map_handle;
+ /* Memory map handle returned by ADM_CMD_SHARED_MEM_MAP_REGIONS
+ * command.
+ * If mem_map_handle is zero implies the message is in
+ * the payload
+ */
+
+ u32 payload_size;
+ /* Size in bytes of the variable payload accompanying this
+ * message or
+ * in shared memory. This is used for parsing the parameter
+ * payload.
+ */
+} __packed;
+
+struct audproc_mfc_param_media_fmt {
uint32_t sampling_rate;
uint16_t bits_per_sample;
uint16_t num_channels;
@@ -741,8 +820,6 @@ struct audproc_mfc_output_media_fmt {
} __packed;
struct audproc_volume_ctrl_master_gain {
- struct adm_cmd_set_pp_params_v5 params;
- struct adm_param_data_v5 data;
/* Linear gain in Q13 format. */
uint16_t master_gain;
/* Clients must set this field to zero. */
@@ -750,8 +827,6 @@ struct audproc_volume_ctrl_master_gain {
} __packed;
struct audproc_soft_step_volume_params {
- struct adm_cmd_set_pp_params_v5 params;
- struct adm_param_data_v5 data;
/*
* Period in milliseconds.
* Supported values: 0 to 15000
@@ -773,7 +848,6 @@ struct audproc_soft_step_volume_params {
} __packed;
struct audproc_enable_param_t {
- struct adm_cmd_set_pp_params_inband_v5 pp_params;
/*
* Specifies whether the Audio processing module is enabled.
* This parameter is generic/common parameter to configure or
@@ -1497,87 +1571,136 @@ struct afe_sidetone_iir_filter_config_params {
#define AFE_MODULE_LOOPBACK 0x00010205
#define AFE_PARAM_ID_LOOPBACK_GAIN_PER_PATH 0x00010206
-/* Payload of the #AFE_PARAM_ID_LOOPBACK_GAIN_PER_PATH parameter,
- * which gets/sets loopback gain of a port to an Rx port.
- * The Tx port ID of the loopback is part of the set_param command.
- */
+/* Used by RTAC */
+struct afe_rtac_user_data_set_v2 {
+ /* Port interface and direction (Rx or Tx) to start. */
+ u16 port_id;
-/* Payload of the #AFE_PORT_CMD_SET_PARAM_V2 command's
- * configuration/calibration settings for the AFE port.
- */
-struct afe_port_cmd_set_param_v2 {
+ /* Actual size of the payload in bytes.
+ * This is used for parsing the parameter payload.
+ * Supported values: > 0
+ */
+ u16 payload_size;
+
+ /* The header detailing the memory mapping for out of band. */
+ struct mem_mapping_hdr mem_hdr;
+
+ /* The parameter header for the parameter data to set */
+ struct param_hdr_v1 param_hdr;
+
+ /* The parameter data to be filled when sent inband */
+ u32 *param_data;
+} __packed;
+
+struct afe_rtac_user_data_set_v3 {
+ /* Port interface and direction (Rx or Tx) to start. */
u16 port_id;
-/* Port interface and direction (Rx or Tx) to start.
- */
+ /* Reserved for future enhancements. Must be 0. */
+ u16 reserved;
+
+ /* The header detailing the memory mapping for out of band. */
+ struct mem_mapping_hdr mem_hdr;
+ /* The size of the parameter header and parameter data */
+ u32 payload_size;
+
+ /* The parameter header for the parameter data to set */
+ struct param_hdr_v3 param_hdr;
+
+ /* The parameter data to be filled when sent inband */
+ u32 *param_data;
+} __packed;
+
+struct afe_rtac_user_data_get_v2 {
+ /* Port interface and direction (Rx or Tx) to start. */
+ u16 port_id;
+
+ /* Actual size of the payload in bytes.
+ * This is used for parsing the parameter payload.
+ * Supported values: > 0
+ */
u16 payload_size;
-/* Actual size of the payload in bytes.
- * This is used for parsing the parameter payload.
- * Supported values: > 0
- */
-u32 payload_address_lsw;
-/* LSW of 64 bit Payload address.
- * Address should be 32-byte,
- * 4kbyte aligned and must be contiguous memory.
- */
+ /* The header detailing the memory mapping for out of band. */
+ struct mem_mapping_hdr mem_hdr;
-u32 payload_address_msw;
-/* MSW of 64 bit Payload address.
- * In case of 32-bit shared memory address,
- * this field must be set to zero.
- * In case of 36-bit shared memory address,
- * bit-4 to bit-31 must be set to zero.
- * Address should be 32-byte, 4kbyte aligned
- * and must be contiguous memory.
- */
+ /* The module ID of the parameter to get */
+ u32 module_id;
-u32 mem_map_handle;
-/* Memory map handle returned by
- * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands.
- * Supported Values:
- * - NULL -- Message. The parameter data is in-band.
- * - Non-NULL -- The parameter data is Out-band.Pointer to
- * the physical address
- * in shared memory of the payload data.
- * An optional field is available if parameter
- * data is in-band:
- * afe_param_data_v2 param_data[...].
- * For detailed payload content, see the
- * afe_port_param_data_v2 structure.
- */
+ /* The parameter ID of the parameter to get */
+ u32 param_id;
+
+ /* The parameter data to be filled when sent inband */
+ struct param_hdr_v1 param_hdr;
} __packed;
+struct afe_rtac_user_data_get_v3 {
+ /* Port interface and direction (Rx or Tx) to start. */
+ u16 port_id;
+ /* Reserved for future enhancements. Must be 0. */
+ u16 reserved;
+
+ /* The header detailing the memory mapping for out of band. */
+ struct mem_mapping_hdr mem_hdr;
+
+ /* The parameter data to be filled when sent inband */
+ struct param_hdr_v3 param_hdr;
+} __packed;
#define AFE_PORT_CMD_SET_PARAM_V2 0x000100EF
+struct afe_port_cmd_set_param_v2 {
+ /* APR Header */
+ struct apr_hdr apr_hdr;
-struct afe_port_param_data_v2 {
- u32 module_id;
-/* ID of the module to be configured.
- * Supported values: Valid module ID
- */
+ /* Port interface and direction (Rx or Tx) to start. */
+ u16 port_id;
-u32 param_id;
-/* ID of the parameter corresponding to the supported parameters
- * for the module ID.
- * Supported values: Valid parameter ID
- */
+ /*
+ * Actual size of the payload in bytes.
+ * This is used for parsing the parameter payload.
+ * Supported values: > 0
+ */
+ u16 payload_size;
-u16 param_size;
-/* Actual size of the data for the
- * module_id/param_id pair. The size is a
- * multiple of four bytes.
- * Supported values: > 0
- */
+ /* The header detailing the memory mapping for out of band. */
+ struct mem_mapping_hdr mem_hdr;
-u16 reserved;
-/* This field must be set to zero.
- */
+ /* The parameter data to be filled when sent inband */
+ u8 param_data[0];
} __packed;
+#define AFE_PORT_CMD_SET_PARAM_V3 0x000100FA
+struct afe_port_cmd_set_param_v3 {
+ /* APR Header */
+ struct apr_hdr apr_hdr;
+
+ /* Port ID of the AFE port to configure. Port interface and direction
+ * (Rx or Tx) to configure. An even number represents the Rx direction,
+ * and an odd number represents the Tx direction.
+ */
+ u16 port_id;
+
+ /* Reserved. This field must be set to zero. */
+ u16 reserved;
+
+ /* The memory mapping header to be used when sending outband */
+ struct mem_mapping_hdr mem_hdr;
+
+ /* The total size of the payload, including param_hdr_v3 */
+ u32 payload_size;
+
+ /*
+ * The parameter data to be filled when sent inband.
+ * Must include param_hdr packed correctly.
+ */
+ u8 param_data[0];
+} __packed;
+
+/* Payload of the #AFE_PARAM_ID_LOOPBACK_GAIN_PER_PATH parameter,
+ * which gets/sets loopback gain of a port to an Rx port.
+ * The Tx port ID of the loopback is part of the set_param command.
+ */
+
struct afe_loopback_gain_per_path_param {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 pdata;
u16 rx_port_id;
/* Rx port of the loopback. */
@@ -1613,9 +1736,6 @@ enum afe_loopback_routing_mode {
* which enables/disables one AFE loopback.
*/
struct afe_loopback_cfg_v1 {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 pdata;
u32 loopback_cfg_minor_version;
/* Minor version used for tracking the version of the RMC module
* configuration interface.
@@ -1677,19 +1797,19 @@ struct loopback_cfg_data {
struct afe_st_loopback_cfg_v1 {
struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 gain_pdata;
+ struct mem_mapping_hdr mem_hdr;
+ struct param_hdr_v1 gain_pdata;
struct afe_loopback_sidetone_gain gain_data;
- struct afe_port_param_data_v2 cfg_pdata;
+ struct param_hdr_v1 cfg_pdata;
struct loopback_cfg_data cfg_data;
} __packed;
struct afe_loopback_iir_cfg_v2 {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 st_iir_enable_pdata;
- struct afe_mod_enable_param st_iir_mode_enable_data;
- struct afe_port_param_data_v2 st_iir_filter_config_pdata;
+ struct apr_hdr hdr;
+ struct mem_mapping_hdr param;
+ struct param_hdr_v1 st_iir_enable_pdata;
+ struct afe_mod_enable_param st_iir_mode_enable_data;
+ struct param_hdr_v1 st_iir_filter_config_pdata;
struct afe_sidetone_iir_filter_config_params st_iir_filter_config_data;
} __packed;
#define AFE_MODULE_SPEAKER_PROTECTION 0x00010209
@@ -2141,20 +2261,6 @@ struct afe_param_id_spdif_clk_cfg {
*/
} __packed;
-struct afe_spdif_clk_config_command {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 pdata;
- struct afe_param_id_spdif_clk_cfg clk_cfg;
-} __packed;
-
-struct afe_spdif_chstatus_config_command {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 pdata;
- struct afe_param_id_spdif_ch_status_cfg ch_status;
-} __packed;
-
struct afe_spdif_port_config {
struct afe_param_id_spdif_cfg cfg;
struct afe_param_id_spdif_ch_status_cfg ch_status;
@@ -2680,16 +2786,6 @@ struct afe_param_id_usb_audio_cfg {
u32 endian;
} __packed;
-struct afe_usb_audio_dev_param_command {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 pdata;
- union {
- struct afe_param_id_usb_audio_dev_params usb_dev;
- struct afe_param_id_usb_audio_dev_lpcm_fmt lpcm_fmt;
- };
-} __packed;
-
/*
* This param id is used to configure Real Time Proxy interface.
*/
@@ -3084,20 +3180,6 @@ struct afe_param_id_custom_tdm_header_cfg {
uint16_t header7; Reserved Info[3] - Bitrate[kbps] - Low Byte -> 0x0 */
} __packed;
-struct afe_slot_mapping_config_command {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 pdata;
- struct afe_param_id_slot_mapping_cfg slot_mapping;
-} __packed;
-
-struct afe_custom_tdm_header_config_command {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 pdata;
- struct afe_param_id_custom_tdm_header_cfg custom_tdm_header;
-} __packed;
-
struct afe_tdm_port_config {
struct afe_param_id_tdm_cfg tdm;
struct afe_param_id_slot_mapping_cfg slot_mapping;
@@ -3474,18 +3556,6 @@ union afe_port_config {
struct avs_enc_packetizer_id_param_t enc_pkt_id_param;
} __packed;
-struct afe_audioif_config_command_no_payload {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
-} __packed;
-
-struct afe_audioif_config_command {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 pdata;
- union afe_port_config port;
-} __packed;
-
#define AFE_PORT_CMD_DEVICE_START 0x000100E5
/* Payload of the #AFE_PORT_CMD_DEVICE_START.*/
@@ -3648,13 +3718,8 @@ u32 mem_map_handle;
*/
} __packed;
-#define AFE_PORT_CMD_GET_PARAM_V2 0x000100F0
-
-/* Payload of the #AFE_PORT_CMD_GET_PARAM_V2 command,
- * which queries for one post/preprocessing parameter of a
- * stream.
- */
-struct afe_port_cmd_get_param_v2 {
+/* Used by RTAC */
+struct afe_rtac_get_param_v2 {
u16 port_id;
/* Port interface and direction (Rx or Tx) to start. */
@@ -3700,6 +3765,37 @@ struct afe_port_cmd_get_param_v2 {
*/
} __packed;
+#define AFE_PORT_CMD_GET_PARAM_V2 0x000100F0
+
+/* Payload of the #AFE_PORT_CMD_GET_PARAM_V2 command,
+ * which queries for one post/preprocessing parameter of a
+ * stream.
+ */
+struct afe_port_cmd_get_param_v2 {
+ struct apr_hdr apr_hdr;
+
+ /* Port interface and direction (Rx or Tx) to start. */
+ u16 port_id;
+
+ /* Maximum data size of the parameter ID/module ID combination.
+ * This is a multiple of four bytes
+ * Supported values: > 0
+ */
+ u16 payload_size;
+
+ /* The memory mapping header to be used when requesting outband */
+ struct mem_mapping_hdr mem_hdr;
+
+ /* The module ID of the parameter data requested */
+ u32 module_id;
+
+ /* The parameter ID of the parameter data requested */
+ u32 param_id;
+
+ /* The header information for the parameter data */
+ struct param_hdr_v1 param_hdr;
+} __packed;
+
#define AFE_PORT_CMDRSP_GET_PARAM_V2 0x00010106
/* Payload of the #AFE_PORT_CMDRSP_GET_PARAM_V2 message, which
@@ -3715,6 +3811,41 @@ struct afe_port_cmd_get_param_v2 {
struct afe_port_cmdrsp_get_param_v2 {
u32 status;
+ struct param_hdr_v1 param_hdr;
+ u8 param_data[0];
+} __packed;
+
+#define AFE_PORT_CMD_GET_PARAM_V3 0x000100FB
+struct afe_port_cmd_get_param_v3 {
+ /* APR Header */
+ struct apr_hdr apr_hdr;
+
+ /* Port ID of the AFE port to configure. Port interface and direction
+ * (Rx or Tx) to configure. An even number represents the Rx direction,
+ * and an odd number represents the Tx direction.
+ */
+ u16 port_id;
+
+ /* Reserved. This field must be set to zero. */
+ u16 reserved;
+
+ /* The memory mapping header to be used when requesting outband */
+ struct mem_mapping_hdr mem_hdr;
+
+ /* The header information for the parameter data */
+ struct param_hdr_v3 param_hdr;
+} __packed;
+
+#define AFE_PORT_CMDRSP_GET_PARAM_V3 0x00010108
+struct afe_port_cmdrsp_get_param_v3 {
+ /* The status of the command */
+ uint32_t status;
+
+ /* The header information for the parameter data */
+ struct param_hdr_v3 param_hdr;
+
+ /* The parameter data to be filled when sent inband */
+ u8 param_data[0];
} __packed;
#define AFE_PARAM_ID_LPASS_CORE_SHARED_CLOCK_CONFIG 0x0001028C
@@ -3736,13 +3867,6 @@ struct afe_param_id_lpass_core_shared_clk_cfg {
*/
} __packed;
-struct afe_lpass_core_shared_clk_config_command {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 pdata;
- struct afe_param_id_lpass_core_shared_clk_cfg clk_cfg;
-} __packed;
-
/* adsp_afe_service_commands.h */
#define ADSP_MEMORY_MAP_EBI_POOL 0
@@ -6382,59 +6506,33 @@ struct asm_stream_cmd_open_transcode_loopback_t {
#define ASM_STREAM_CMD_FLUSH_READBUFS 0x00010C09
#define ASM_STREAM_CMD_SET_PP_PARAMS_V2 0x00010DA1
+#define ASM_STREAM_CMD_SET_PP_PARAMS_V3 0x0001320D
-struct asm_stream_cmd_set_pp_params_v2 {
- u32 data_payload_addr_lsw;
-/* LSW of parameter data payload address. Supported values: any. */
- u32 data_payload_addr_msw;
-/* MSW of Parameter data payload address. Supported values: any.
- * - Must be set to zero for in-band data.
- * - In the case of 32 bit Shared memory address, msw field must be
- * - set to zero.
- * - In the case of 36 bit shared memory address, bit 31 to bit 4 of
- * msw
- *
- * - must be set to zero.
+/*
+ * Structure for the ASM Stream Set PP Params command. Parameter data must be
+ * pre-packed with the correct header for either V2 or V3 when sent in-band.
+ * Use q6core_pack_pp_params to pack the header and data correctly depending on
+ * Instance ID support.
*/
- u32 mem_map_handle;
-/* Supported Values: Any.
-* memory map handle returned by DSP through
-* ASM_CMD_SHARED_MEM_MAP_REGIONS
-* command.
-* if mmhandle is NULL, the ParamData payloads are within the
-* message payload (in-band).
-* If mmhandle is non-NULL, the ParamData payloads begin at the
-* address specified in the address msw and lsw (out-of-band).
-*/
+struct asm_stream_cmd_set_pp_params {
+ /* APR Header */
+ struct apr_hdr apr_hdr;
- u32 data_payload_size;
-/* Size in bytes of the variable payload accompanying the
-message, or in shared memory. This field is used for parsing the
-parameter payload. */
-
-} __packed;
+ /* The memory mapping header to be used when sending out of band */
+ struct mem_mapping_hdr mem_hdr;
+ /* The total size of the payload, including the parameter header */
+ u32 payload_size;
-struct asm_stream_param_data_v2 {
- u32 module_id;
- /* Unique module ID. */
-
- u32 param_id;
- /* Unique parameter ID. */
-
- u16 param_size;
-/* Data size of the param_id/module_id combination. This is
- * a multiple of 4 bytes.
- */
-
- u16 reserved;
-/* Reserved for future enhancements. This field must be set to
- * zero.
- */
-
+ /* The parameter data to be filled when sent inband. Parameter data
+ * must be pre-packed with parameter header and then copied here. Use
+ * q6core_pack_pp_params to pack the header and param data correctly.
+ */
+ u32 param_data[0];
} __packed;
#define ASM_STREAM_CMD_GET_PP_PARAMS_V2 0x00010DA2
+#define ASM_STREAM_CMD_GET_PP_PARAMS_V3 0x0001320E
struct asm_stream_cmd_get_pp_params_v2 {
u32 data_payload_addr_lsw;
@@ -6613,6 +6711,7 @@ struct asm_aac_dual_mono_mapping_param {
} __packed;
#define ASM_STREAM_CMDRSP_GET_PP_PARAMS_V2 0x00010DA4
+#define ASM_STREAM_CMDRSP_GET_PP_PARAMS_V3 0x0001320F
struct asm_stream_cmdrsp_get_pp_params_v2 {
u32 status;
@@ -7388,12 +7487,6 @@ struct admx_mic_gain {
/*< Clients must set this field to zero. */
} __packed;
-struct adm_set_mic_gain_params {
- struct adm_cmd_set_pp_params_v5 params;
- struct adm_param_data_v5 data;
- struct admx_mic_gain mic_gain_data;
-} __packed;
-
/* end_addtogroup audio_pp_param_ids */
/* @ingroup audio_pp_module_ids
@@ -7749,56 +7842,23 @@ struct adm_qensemble_param_set_new_angle {
#define ADM_CMD_GET_PP_TOPO_MODULE_LIST 0x00010349
#define ADM_CMDRSP_GET_PP_TOPO_MODULE_LIST 0x00010350
+#define ADM_CMD_GET_PP_TOPO_MODULE_LIST_V2 0x00010360
+#define ADM_CMDRSP_GET_PP_TOPO_MODULE_LIST_V2 0x00010361
#define AUDPROC_PARAM_ID_ENABLE 0x00010904
- /*
- * Payload of the ADM_CMD_GET_PP_TOPO_MODULE_LIST command.
- */
-struct adm_cmd_get_pp_topo_module_list_t {
- struct apr_hdr hdr;
- /* Lower 32 bits of the 64-bit parameter data payload address. */
- uint32_t data_payload_addr_lsw;
- /*
- * Upper 32 bits of the 64-bit parameter data payload address.
- *
- *
- * The size of the shared memory, if specified, must be large enough to
- * contain the entire parameter data payload, including the module ID,
- * parameter ID, parameter size, and parameter values.
- */
- uint32_t data_payload_addr_msw;
- /*
- * Unique identifier for an address.
- *
- * This memory map handle is returned by the aDSP through the
- * #ADM_CMD_SHARED_MEM_MAP_REGIONS command.
- *
- * @values
- * - Non-NULL -- On acknowledgment, the parameter data payloads begin at
- * the address specified (out-of-band)
- * - NULL -- The acknowledgment's payload contains the parameter data
- * (in-band) @tablebulletend
- */
- uint32_t mem_map_handle;
+/*
+ * Payload of the ADM_CMD_GET_PP_TOPO_MODULE_LIST command.
+ */
+struct adm_cmd_get_pp_topo_module_list {
+ struct apr_hdr apr_hdr;
+
+ /* The memory mapping header to be used when requesting out of band */
+ struct mem_mapping_hdr mem_hdr;
+
/*
* Maximum data size of the list of modules. This
* field is a multiple of 4 bytes.
*/
- uint16_t param_max_size;
- /* This field must be set to zero. */
- uint16_t reserved;
-} __packed;
-
-/*
- * Payload of the ADM_CMDRSP_GET_PP_TOPO_MODULE_LIST message, which returns
- * module ids in response to an ADM_CMD_GET_PP_TOPO_MODULE_LIST command.
- * Immediately following this structure is the acknowledgement <b>module id
- * data variable payload</b> containing the pre/postprocessing module id
- * values. For an in-band scenario, the variable payload depends on the size
- * of the parameter.
- */
-struct adm_cmd_rsp_get_pp_topo_module_list_t {
- /* Status message (error code). */
- uint32_t status;
+ uint32_t param_max_size;
} __packed;
struct audproc_topology_module_id_info_t {
@@ -7891,9 +7951,6 @@ struct audproc_topology_module_id_info_t {
struct asm_volume_ctrl_master_gain {
- struct apr_hdr hdr;
- struct asm_stream_cmd_set_pp_params_v2 param;
- struct asm_stream_param_data_v2 data;
uint16_t master_gain;
/*< Linear gain in Q13 format. */
@@ -7904,10 +7961,6 @@ struct asm_volume_ctrl_master_gain {
struct asm_volume_ctrl_lr_chan_gain {
- struct apr_hdr hdr;
- struct asm_stream_cmd_set_pp_params_v2 param;
- struct asm_stream_param_data_v2 data;
-
uint16_t l_chan_gain;
/*< Linear gain in Q13 format for the left channel. */
@@ -7919,6 +7972,7 @@ struct audproc_chmixer_param_coeff {
uint32_t index;
uint16_t num_output_channels;
uint16_t num_input_channels;
+ uint32_t payload[0];
} __packed;
@@ -7947,6 +8001,7 @@ struct audproc_volume_ctrl_channel_type_gain_pair {
/* Payload of the AUDPROC_PARAM_ID_MULTICHANNEL_MUTE parameters used by
* the Volume Control module.
*/
+#define ASM_MAX_CHANNELS 8
struct audproc_volume_ctrl_multichannel_gain {
uint32_t num_channels;
/* Number of channels for which mute configuration is provided. Any
@@ -7954,7 +8009,8 @@ struct audproc_volume_ctrl_multichannel_gain {
* provided are set to unmute.
*/
- struct audproc_volume_ctrl_channel_type_gain_pair *gain_data;
+ struct audproc_volume_ctrl_channel_type_gain_pair
+ gain_data[ASM_MAX_CHANNELS];
/* Array of channel type/mute setting pairs. */
} __packed;
@@ -7968,9 +8024,6 @@ struct audproc_volume_ctrl_multichannel_gain {
struct asm_volume_ctrl_mute_config {
- struct apr_hdr hdr;
- struct asm_stream_cmd_set_pp_params_v2 param;
- struct asm_stream_param_data_v2 data;
uint32_t mute_flag;
/*< Specifies whether mute is disabled (0) or enabled (nonzero).*/
@@ -7998,9 +8051,6 @@ struct asm_volume_ctrl_mute_config {
* parameters used by the Volume Control module.
*/
struct asm_soft_step_volume_params {
- struct apr_hdr hdr;
- struct asm_stream_cmd_set_pp_params_v2 param;
- struct asm_stream_param_data_v2 data;
uint32_t period;
/*< Period in milliseconds.
* Supported values: 0 to 15000
@@ -8030,9 +8080,6 @@ struct asm_soft_step_volume_params {
struct asm_soft_pause_params {
- struct apr_hdr hdr;
- struct asm_stream_cmd_set_pp_params_v2 param;
- struct asm_stream_param_data_v2 data;
uint32_t enable_flag;
/*< Specifies whether soft pause is disabled (0) or enabled
* (nonzero).
@@ -8122,10 +8169,7 @@ struct asm_volume_ctrl_channeltype_gain_pair {
struct asm_volume_ctrl_multichannel_gain {
- struct apr_hdr hdr;
- struct asm_stream_cmd_set_pp_params_v2 param;
- struct asm_stream_param_data_v2 data;
- uint32_t num_channels;
+ uint32_t num_channels;
/*
* Number of channels for which gain values are provided. Any
* channels present in the data for which gain is not provided are
@@ -8150,9 +8194,6 @@ struct asm_volume_ctrl_multichannel_gain {
struct asm_volume_ctrl_channelype_mute_pair {
- struct apr_hdr hdr;
- struct asm_stream_cmd_set_pp_params_v2 param;
- struct asm_stream_param_data_v2 data;
uint8_t channelype;
/*< Channel type for which the mute setting is to be applied.
* Supported values:
@@ -8201,9 +8242,6 @@ struct asm_volume_ctrl_channelype_mute_pair {
struct asm_volume_ctrl_multichannel_mute {
- struct apr_hdr hdr;
- struct asm_stream_cmd_set_pp_params_v2 param;
- struct asm_stream_param_data_v2 data;
uint32_t num_channels;
/*< Number of channels for which mute configuration is
* provided. Any channels present in the data for which mute
@@ -8648,9 +8686,6 @@ struct asm_eq_per_band_params {
} __packed;
struct asm_eq_params {
- struct apr_hdr hdr;
- struct asm_stream_cmd_set_pp_params_v2 param;
- struct asm_stream_param_data_v2 data;
uint32_t enable_flag;
/*< Specifies whether the equalizer module is disabled (0) or enabled
* (nonzero).
@@ -8689,6 +8724,9 @@ struct asm_eq_params {
#define VSS_ICOMMON_CMD_SET_PARAM_V2 0x0001133D
#define VSS_ICOMMON_CMD_GET_PARAM_V2 0x0001133E
#define VSS_ICOMMON_RSP_GET_PARAM 0x00011008
+#define VSS_ICOMMON_CMD_SET_PARAM_V3 0x00013245
+#define VSS_ICOMMON_CMD_GET_PARAM_V3 0x00013246
+#define VSS_ICOMMON_RSP_GET_PARAM_V3 0x00013247
/** ID of the Bass Boost module.
This module supports the following parameter IDs:
@@ -9072,15 +9110,13 @@ struct afe_sp_th_vi_ftm_params {
} __packed;
struct afe_sp_th_vi_get_param {
- struct apr_hdr hdr;
- struct afe_port_cmd_get_param_v2 get_param;
- struct afe_port_param_data_v2 pdata;
+ struct param_hdr_v3 pdata;
struct afe_sp_th_vi_ftm_params param;
} __packed;
struct afe_sp_th_vi_get_param_resp {
uint32_t status;
- struct afe_port_param_data_v2 pdata;
+ struct param_hdr_v3 pdata;
struct afe_sp_th_vi_ftm_params param;
} __packed;
@@ -9146,15 +9182,13 @@ struct afe_sp_ex_vi_ftm_params {
} __packed;
struct afe_sp_ex_vi_get_param {
- struct apr_hdr hdr;
- struct afe_port_cmd_get_param_v2 get_param;
- struct afe_port_param_data_v2 pdata;
+ struct param_hdr_v3 pdata;
struct afe_sp_ex_vi_ftm_params param;
} __packed;
struct afe_sp_ex_vi_get_param_resp {
uint32_t status;
- struct afe_port_param_data_v2 pdata;
+ struct param_hdr_v3 pdata;
struct afe_sp_ex_vi_ftm_params param;
} __packed;
@@ -9169,23 +9203,16 @@ union afe_spkr_prot_config {
struct afe_sp_ex_vi_ftm_cfg ex_vi_ftm_cfg;
} __packed;
-struct afe_spkr_prot_config_command {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 pdata;
- union afe_spkr_prot_config prot_config;
-} __packed;
-
struct afe_spkr_prot_get_vi_calib {
struct apr_hdr hdr;
- struct afe_port_cmd_get_param_v2 get_param;
- struct afe_port_param_data_v2 pdata;
+ struct mem_mapping_hdr mem_hdr;
+ struct param_hdr_v3 pdata;
struct asm_calib_res_cfg res_cfg;
} __packed;
struct afe_spkr_prot_calib_get_resp {
uint32_t status;
- struct afe_port_param_data_v2 pdata;
+ struct param_hdr_v3 pdata;
struct asm_calib_res_cfg res_cfg;
} __packed;
@@ -9313,16 +9340,6 @@ struct srs_trumedia_params {
#define ASM_STREAM_POSTPROC_TOPO_ID_DTS_HPX 0x00010DED
#define ASM_STREAM_POSTPROC_TOPO_ID_HPX_PLUS 0x10015000
#define ASM_STREAM_POSTPROC_TOPO_ID_HPX_MASTER 0x10015001
-struct asm_dts_eagle_param {
- struct apr_hdr hdr;
- struct asm_stream_cmd_set_pp_params_v2 param;
- struct asm_stream_param_data_v2 data;
-} __packed;
-
-struct asm_dts_eagle_param_get {
- struct apr_hdr hdr;
- struct asm_stream_cmd_get_pp_params_v2 param;
-} __packed;
/* Opcode to set BT address and license for aptx decoder */
#define APTX_DECODER_BT_ADDRESS 0x00013201
@@ -9430,6 +9447,7 @@ struct avcs_fwk_ver_info {
#define LSM_SESSION_CMD_CLOSE_TX (0x00012A88)
#define LSM_SESSION_CMD_SET_PARAMS (0x00012A83)
#define LSM_SESSION_CMD_SET_PARAMS_V2 (0x00012A8F)
+#define LSM_SESSION_CMD_SET_PARAMS_V3 (0x00012A92)
#define LSM_SESSION_CMD_REGISTER_SOUND_MODEL (0x00012A84)
#define LSM_SESSION_CMD_DEREGISTER_SOUND_MODEL (0x00012A85)
#define LSM_SESSION_CMD_START (0x00012A86)
@@ -9476,6 +9494,7 @@ struct avcs_fwk_ver_info {
/* Commands/Params to pass the codec/slimbus data to DSP */
#define AFE_SVC_CMD_SET_PARAM (0x000100f3)
+#define AFE_SVC_CMD_SET_PARAM_V2 (0x000100fc)
#define AFE_MODULE_CDC_DEV_CFG (0x00010234)
#define AFE_PARAM_ID_CDC_SLIMBUS_SLAVE_CFG (0x00010235)
#define AFE_PARAM_ID_CDC_REG_CFG (0x00010236)
@@ -9860,13 +9879,6 @@ struct afe_clk_cfg {
#define AFE_MODULE_CLOCK_SET 0x0001028F
#define AFE_PARAM_ID_CLOCK_SET 0x00010290
-struct afe_lpass_clk_config_command {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 pdata;
- struct afe_clk_cfg clk_cfg;
-} __packed;
-
enum afe_lpass_digital_clk_src {
Q6AFE_LPASS_DIGITAL_ROOT_INVALID,
Q6AFE_LPASS_DIGITAL_ROOT_PRI_MI2S_OSR,
@@ -9902,14 +9914,6 @@ struct afe_digital_clk_cfg {
u16 reserved;
} __packed;
-
-struct afe_lpass_digital_clk_config_command {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 pdata;
- struct afe_digital_clk_cfg clk_cfg;
-} __packed;
-
/*
* Opcode for AFE to start DTMF.
*/
@@ -10018,107 +10022,43 @@ struct afe_param_cdc_reg_cfg_data {
struct afe_param_cdc_reg_cfg *reg_data;
} __packed;
-struct afe_svc_cmd_set_param {
- uint32_t payload_size;
- uint32_t payload_address_lsw;
- uint32_t payload_address_msw;
- uint32_t mem_map_handle;
-} __packed;
-
-struct afe_svc_param_data {
- uint32_t module_id;
- uint32_t param_id;
- uint16_t param_size;
- uint16_t reserved;
-} __packed;
-
-struct afe_param_hw_mad_ctrl {
- uint32_t minor_version;
- uint16_t mad_type;
- uint16_t mad_enable;
-} __packed;
-
-struct afe_cmd_hw_mad_ctrl {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 pdata;
- struct afe_param_hw_mad_ctrl payload;
-} __packed;
+struct afe_svc_cmd_set_param_v1 {
+ /* APR Header */
+ struct apr_hdr apr_hdr;
-struct afe_cmd_hw_mad_slimbus_slave_port_cfg {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 pdata;
- struct afe_param_slimbus_slave_port_cfg sb_port_cfg;
-} __packed;
+ /* The total size of the payload, including param_hdr_v3 */
+ uint32_t payload_size;
-struct afe_cmd_sw_mad_enable {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 pdata;
-} __packed;
+ /* The memory mapping header to be used when sending outband */
+ struct mem_mapping_hdr mem_hdr;
-struct afe_param_cdc_reg_cfg_payload {
- struct afe_svc_param_data common;
- struct afe_param_cdc_reg_cfg reg_cfg;
+ /* The parameter data to be filled when sent inband */
+ u32 param_data[0];
} __packed;
-struct afe_lpass_clk_config_command_v2 {
- struct apr_hdr hdr;
- struct afe_svc_cmd_set_param param;
- struct afe_svc_param_data pdata;
- struct afe_clk_set clk_cfg;
-} __packed;
+struct afe_svc_cmd_set_param_v2 {
+ /* APR Header */
+ struct apr_hdr apr_hdr;
-/*
- * reg_data's size can be up to AFE_MAX_CDC_REGISTERS_TO_CONFIG
- */
-struct afe_svc_cmd_cdc_reg_cfg {
- struct apr_hdr hdr;
- struct afe_svc_cmd_set_param param;
- struct afe_param_cdc_reg_cfg_payload reg_data[0];
-} __packed;
+ /* The memory mapping header to be used when sending outband */
+ struct mem_mapping_hdr mem_hdr;
-struct afe_svc_cmd_init_cdc_reg_cfg {
- struct apr_hdr hdr;
- struct afe_svc_cmd_set_param param;
- struct afe_port_param_data_v2 init;
-} __packed;
+ /* The total size of the payload, including param_hdr_v3 */
+ u32 payload_size;
-struct afe_svc_cmd_sb_slave_cfg {
- struct apr_hdr hdr;
- struct afe_svc_cmd_set_param param;
- struct afe_port_param_data_v2 pdata;
- struct afe_param_cdc_slimbus_slave_cfg sb_slave_cfg;
+ /* The parameter data to be filled when sent inband */
+ u32 param_data[0];
} __packed;
-struct afe_svc_cmd_cdc_reg_page_cfg {
- struct apr_hdr hdr;
- struct afe_svc_cmd_set_param param;
- struct afe_port_param_data_v2 pdata;
- struct afe_param_cdc_reg_page_cfg cdc_reg_page_cfg;
-} __packed;
-
-struct afe_svc_cmd_cdc_aanc_version {
- struct apr_hdr hdr;
- struct afe_svc_cmd_set_param param;
- struct afe_port_param_data_v2 pdata;
- struct afe_param_id_cdc_aanc_version version;
-} __packed;
-
-struct afe_port_cmd_set_aanc_param {
- struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
- struct afe_port_param_data_v2 pdata;
- union {
- struct afe_param_aanc_port_cfg aanc_port_cfg;
- struct afe_mod_enable_param mod_enable;
- } __packed data;
+struct afe_param_hw_mad_ctrl {
+ uint32_t minor_version;
+ uint16_t mad_type;
+ uint16_t mad_enable;
} __packed;
struct afe_port_cmd_set_aanc_acdb_table {
struct apr_hdr hdr;
- struct afe_port_cmd_set_param_v2 param;
+ struct mem_mapping_hdr mem_hdr;
} __packed;
/* Dolby DAP topology */
@@ -10141,13 +10081,6 @@ struct afe_port_cmd_set_aanc_acdb_table {
#define Q14_GAIN_ZERO_POINT_FIVE 0x2000
#define Q14_GAIN_UNITY 0x4000
-struct afe_svc_cmd_set_clip_bank_selection {
- struct apr_hdr hdr;
- struct afe_svc_cmd_set_param param;
- struct afe_port_param_data_v2 pdata;
- struct afe_param_id_clip_bank_sel bank_sel;
-} __packed;
-
/* Ultrasound supported formats */
#define US_POINT_EPOS_FORMAT_V2 0x0001272D
#define US_RAW_FORMAT_V2 0x0001272C
@@ -10361,13 +10294,6 @@ union afe_port_group_config {
struct afe_param_id_group_device_tdm_cfg tdm_cfg;
} __packed;
-struct afe_port_group_create {
- struct apr_hdr hdr;
- struct afe_svc_cmd_set_param param;
- struct afe_port_param_data_v2 pdata;
- union afe_port_group_config data;
-} __packed;
-
/* ID of the parameter used by #AFE_MODULE_AUDIO_DEV_INTERFACE to specify
* the timing statistics of the corresponding device interface.
* Client can periodically query for the device time statistics to help adjust
@@ -10457,16 +10383,9 @@ struct afe_param_id_dev_timing_stats {
u32 ref_timer_abs_ts_msw;
} __packed;
-struct afe_av_dev_drift_get_param {
- struct apr_hdr hdr;
- struct afe_port_cmd_get_param_v2 get_param;
- struct afe_port_param_data_v2 pdata;
- struct afe_param_id_dev_timing_stats timing_stats;
-} __packed;
-
struct afe_av_dev_drift_get_param_resp {
uint32_t status;
- struct afe_port_param_data_v2 pdata;
+ struct param_hdr_v3 pdata;
struct afe_param_id_dev_timing_stats timing_stats;
} __packed;
@@ -10678,7 +10597,7 @@ union asm_session_mtmx_strtr_param_config {
struct asm_mtmx_strtr_params {
struct apr_hdr hdr;
struct asm_session_cmd_set_mtmx_strstr_params_v2 param;
- struct asm_stream_param_data_v2 data;
+ struct param_hdr_v1 data;
union asm_session_mtmx_strtr_param_config config;
} __packed;
@@ -10788,7 +10707,7 @@ struct asm_mtmx_strtr_get_params {
struct asm_mtmx_strtr_get_params_cmdrsp {
uint32_t err_code;
- struct asm_stream_param_data_v2 param_info;
+ struct param_hdr_v1 param_info;
union asm_session_mtmx_strtr_data_type param_data;
} __packed;
@@ -10808,18 +10727,14 @@ enum {
#define AUDPROC_PARAM_ID_COMPRESSED_MUTE 0x00010771
struct adm_set_compressed_device_mute {
- struct adm_cmd_set_pp_params_v5 command;
- struct adm_param_data_v5 params;
- u32 mute_on;
+ u32 mute_on;
} __packed;
#define AUDPROC_MODULE_ID_COMPRESSED_LATENCY 0x0001076E
#define AUDPROC_PARAM_ID_COMPRESSED_LATENCY 0x0001076F
struct adm_set_compressed_device_latency {
- struct adm_cmd_set_pp_params_v5 command;
- struct adm_param_data_v5 params;
- u32 latency;
+ u32 latency;
} __packed;
#define VOICEPROC_MODULE_ID_GENERIC_TX 0x00010EF6
@@ -10849,12 +10764,6 @@ struct adm_param_fluence_soundfocus_t {
uint16_t reserved;
} __packed;
-struct adm_set_fluence_soundfocus_param {
- struct adm_cmd_set_pp_params_v5 params;
- struct adm_param_data_v5 data;
- struct adm_param_fluence_soundfocus_t soundfocus_data;
-} __packed;
-
struct adm_param_fluence_sourcetracking_t {
uint8_t vad[MAX_SECTORS];
uint16_t doa_speech;
@@ -10884,10 +10793,4 @@ struct admx_sec_primary_mic_ch {
uint16_t reserved1;
} __packed;
-
-struct adm_set_sec_primary_ch_params {
- struct adm_cmd_set_pp_params_v5 params;
- struct adm_param_data_v5 data;
- struct admx_sec_primary_mic_ch sec_primary_mic_ch_data;
-} __packed;
#endif /*_APR_AUDIO_V2_H_ */
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 2b6e8f8240d9..147e448ed405 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -106,7 +106,7 @@ struct snd_pcm_ops {
#endif
#define SNDRV_PCM_IOCTL1_RESET 0
-#define SNDRV_PCM_IOCTL1_INFO 1
+/* 1 is absent slot. */
#define SNDRV_PCM_IOCTL1_CHANNEL_INFO 2
#define SNDRV_PCM_IOCTL1_GSTATE 3
#define SNDRV_PCM_IOCTL1_FIFO_SIZE 4
@@ -466,6 +466,7 @@ struct snd_pcm_substream {
const struct snd_pcm_ops *ops;
/* -- runtime information -- */
struct snd_pcm_runtime *runtime;
+ spinlock_t runtime_lock;
/* -- timer section -- */
struct snd_timer *timer; /* timer */
unsigned timer_running: 1; /* time is running */
diff --git a/include/sound/q6adm-v2.h b/include/sound/q6adm-v2.h
index 65c42ee18914..84087de3d4d8 100644
--- a/include/sound/q6adm-v2.h
+++ b/include/sound/q6adm-v2.h
@@ -25,6 +25,8 @@
#define MAX_MODULES_IN_TOPO 16
#define ADM_GET_TOPO_MODULE_LIST_LENGTH\
((MAX_MODULES_IN_TOPO + 1) * sizeof(uint32_t))
+#define ADM_GET_TOPO_MODULE_INSTANCE_LIST_LENGTH \
+ ((MAX_MODULES_IN_TOPO + 1) * 2 * sizeof(uint32_t))
#define AUD_PROC_BLOCK_SIZE 4096
#define AUD_VOL_BLOCK_SIZE 4096
#define AUDIO_RX_CALIBRATION_SIZE (AUD_PROC_BLOCK_SIZE + \
@@ -101,12 +103,24 @@ void adm_copp_mfc_cfg(int port_id, int copp_idx, int dst_sample_rate);
int adm_get_params(int port_id, int copp_idx, uint32_t module_id,
uint32_t param_id, uint32_t params_length, char *params);
+int adm_get_pp_params(int port_id, int copp_idx, uint32_t client_id,
+ struct mem_mapping_hdr *mem_hdr,
+ struct param_hdr_v3 *param_hdr, u8 *returned_param_data);
+
int adm_send_params_v5(int port_id, int copp_idx, char *params,
uint32_t params_length);
int adm_dolby_dap_send_params(int port_id, int copp_idx, char *params,
uint32_t params_length);
+int adm_set_pp_params(int port_id, int copp_idx,
+ struct mem_mapping_hdr *mem_hdr, u8 *param_data,
+ u32 params_size);
+
+int adm_pack_and_set_one_pp_param(int port_id, int copp_idx,
+ struct param_hdr_v3 param_hdr,
+ u8 *param_data);
+
int adm_open(int port, int path, int rate, int mode, int topology,
int perf_mode, uint16_t bits_per_sample,
int app_type, int acdbdev_id);
@@ -157,6 +171,10 @@ int adm_set_downmix_params(int port_id, int copp_idx,
int adm_get_pp_topo_module_list(int port_id, int copp_idx, int32_t param_length,
char *params);
+int adm_get_pp_topo_module_list_v2(int port_id, int copp_idx,
+ int32_t param_length,
+ int32_t *returned_params);
+
int adm_set_volume(int port_id, int copp_idx, int volume);
int adm_set_softvolume(int port_id, int copp_idx,
@@ -169,6 +187,9 @@ int adm_send_set_multichannel_ec_primary_mic_ch(int port_id, int copp_idx,
int adm_param_enable(int port_id, int copp_idx, int module_id, int enable);
+int adm_param_enable_v2(int port_id, int copp_idx,
+ struct module_instance_info mod_inst_info, int enable);
+
int adm_send_calibration(int port_id, int copp_idx, int path, int perf_mode,
int cal_type, char *params, int size);
diff --git a/include/sound/q6asm-v2.h b/include/sound/q6asm-v2.h
index 9ddd02cac9ac..285d32e249b8 100644
--- a/include/sound/q6asm-v2.h
+++ b/include/sound/q6asm-v2.h
@@ -265,6 +265,17 @@ int q6asm_audio_client_buf_alloc_contiguous(unsigned int dir
int q6asm_audio_client_buf_free_contiguous(unsigned int dir,
struct audio_client *ac);
+int q6asm_set_pp_params(struct audio_client *ac,
+ struct mem_mapping_hdr *mem_hdr, u8 *param_data,
+ u32 param_size);
+
+int q6asm_pack_and_set_pp_param_in_band(struct audio_client *ac,
+ struct param_hdr_v3 param_hdr,
+ u8 *param_data);
+
+int q6asm_set_soft_volume_module_instance_ids(int instance,
+ struct param_hdr_v3 *param_hdr);
+
int q6asm_open_read(struct audio_client *ac, uint32_t format
/*, uint16_t bits_per_sample*/);
diff --git a/include/sound/q6common.h b/include/sound/q6common.h
new file mode 100644
index 000000000000..b6208f756cd9
--- /dev/null
+++ b/include/sound/q6common.h
@@ -0,0 +1,23 @@
+/* Copyright (c) 2017, 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
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __Q6COMMON_H__
+#define __Q6COMMON_H__
+
+#include <sound/apr_audio-v2.h>
+
+void q6common_update_instance_id_support(bool supported);
+bool q6common_is_instance_id_supported(void);
+int q6common_pack_pp_params(u8 *dest, struct param_hdr_v3 *v3_hdr,
+ u8 *param_data, u32 *total_size);
+
+#endif /* __Q6COMMON_H__ */
diff --git a/include/sound/q6lsm.h b/include/sound/q6lsm.h
index 4805246766d6..c046cd468b49 100644
--- a/include/sound/q6lsm.h
+++ b/include/sound/q6lsm.h
@@ -112,31 +112,27 @@ struct lsm_custom_topologies {
uint32_t buffer_size;
} __packed;
-struct lsm_param_size_reserved {
- uint16_t param_size;
- uint16_t reserved;
-} __packed;
-
-union lsm_param_size {
- uint32_t param_size;
- struct lsm_param_size_reserved sr;
+struct lsm_session_cmd_set_params_v2 {
+ struct apr_hdr apr_hdr;
+ uint32_t payload_size;
+ struct mem_mapping_hdr mem_hdr;
+ u32 param_data[0];
} __packed;
-struct lsm_param_payload_common {
- uint32_t module_id;
- uint32_t param_id;
- union lsm_param_size p_size;
+struct lsm_session_cmd_set_params_v3 {
+ struct apr_hdr apr_hdr;
+ struct mem_mapping_hdr mem_hdr;
+ uint32_t payload_size;
+ u32 param_data[0];
} __packed;
struct lsm_param_op_mode {
- struct lsm_param_payload_common common;
uint32_t minor_version;
uint16_t mode;
uint16_t reserved;
} __packed;
struct lsm_param_connect_to_port {
- struct lsm_param_payload_common common;
uint32_t minor_version;
/* AFE port id that receives voice wake up data */
uint16_t port_id;
@@ -144,20 +140,17 @@ struct lsm_param_connect_to_port {
} __packed;
struct lsm_param_poll_enable {
- struct lsm_param_payload_common common;
uint32_t minor_version;
/* indicates to voice wakeup that HW MAD/SW polling is enabled or not */
uint32_t polling_enable;
} __packed;
struct lsm_param_fwk_mode_cfg {
- struct lsm_param_payload_common common;
uint32_t minor_version;
uint32_t mode;
} __packed;
struct lsm_param_media_fmt {
- struct lsm_param_payload_common common;
uint32_t minor_version;
uint32_t sample_rate;
uint16_t num_channels;
@@ -165,78 +158,23 @@ struct lsm_param_media_fmt {
uint8_t channel_mapping[LSM_MAX_NUM_CHANNELS];
} __packed;
-/*
- * This param cannot be sent in this format.
- * The actual number of confidence level values
- * need to appended to this param payload.
- */
-struct lsm_param_min_confidence_levels {
- struct lsm_param_payload_common common;
- uint8_t num_confidence_levels;
-} __packed;
-
-struct lsm_set_params_hdr {
- uint32_t data_payload_size;
- uint32_t data_payload_addr_lsw;
- uint32_t data_payload_addr_msw;
- uint32_t mem_map_handle;
-} __packed;
-
-struct lsm_cmd_set_params {
- struct apr_hdr msg_hdr;
- struct lsm_set_params_hdr param_hdr;
-} __packed;
-
-struct lsm_cmd_set_params_conf {
- struct apr_hdr msg_hdr;
- struct lsm_set_params_hdr params_hdr;
- struct lsm_param_min_confidence_levels conf_payload;
-} __packed;
-
-struct lsm_cmd_set_params_opmode {
- struct apr_hdr msg_hdr;
- struct lsm_set_params_hdr params_hdr;
- struct lsm_param_op_mode op_mode;
-} __packed;
-
-struct lsm_cmd_set_connectport {
- struct apr_hdr msg_hdr;
- struct lsm_set_params_hdr params_hdr;
- struct lsm_param_connect_to_port connect_to_port;
-} __packed;
-
-struct lsm_cmd_poll_enable {
- struct apr_hdr msg_hdr;
- struct lsm_set_params_hdr params_hdr;
- struct lsm_param_poll_enable poll_enable;
+struct lsm_param_confidence_levels {
+ uint8_t num_confidence_levels;
+ uint8_t confidence_levels[0];
} __packed;
struct lsm_param_epd_thres {
- struct lsm_param_payload_common common;
uint32_t minor_version;
uint32_t epd_begin;
uint32_t epd_end;
} __packed;
-struct lsm_cmd_set_epd_threshold {
- struct apr_hdr msg_hdr;
- struct lsm_set_params_hdr param_hdr;
- struct lsm_param_epd_thres epd_thres;
-} __packed;
-
struct lsm_param_gain {
- struct lsm_param_payload_common common;
uint32_t minor_version;
uint16_t gain;
uint16_t reserved;
} __packed;
-struct lsm_cmd_set_gain {
- struct apr_hdr msg_hdr;
- struct lsm_set_params_hdr param_hdr;
- struct lsm_param_gain lsm_gain;
-} __packed;
-
struct lsm_cmd_reg_snd_model {
struct apr_hdr hdr;
uint32_t model_size;
@@ -245,31 +183,16 @@ struct lsm_cmd_reg_snd_model {
uint32_t mem_map_handle;
} __packed;
-struct lsm_lab_enable {
- struct lsm_param_payload_common common;
+struct lsm_param_lab_enable {
uint16_t enable;
uint16_t reserved;
} __packed;
-struct lsm_params_lab_enable {
- struct apr_hdr msg_hdr;
- struct lsm_set_params_hdr params_hdr;
- struct lsm_lab_enable lab_enable;
-} __packed;
-
-struct lsm_lab_config {
- struct lsm_param_payload_common common;
+struct lsm_param_lab_config {
uint32_t minor_version;
uint32_t wake_up_latency_ms;
} __packed;
-
-struct lsm_params_lab_config {
- struct apr_hdr msg_hdr;
- struct lsm_set_params_hdr params_hdr;
- struct lsm_lab_config lab_config;
-} __packed;
-
struct lsm_cmd_read {
struct apr_hdr hdr;
uint32_t buf_addr_lsw;
@@ -291,19 +214,6 @@ struct lsm_cmd_read_done {
uint32_t flags;
} __packed;
-struct lsm_cmd_set_fwk_mode_cfg {
- struct apr_hdr msg_hdr;
- struct lsm_set_params_hdr params_hdr;
- struct lsm_param_fwk_mode_cfg fwk_mode_cfg;
-} __packed;
-
-struct lsm_cmd_set_media_fmt {
- struct apr_hdr msg_hdr;
- struct lsm_set_params_hdr params_hdr;
- struct lsm_param_media_fmt media_fmt;
-} __packed;
-
-
struct lsm_client *q6lsm_client_alloc(lsm_app_cb cb, void *priv);
void q6lsm_client_free(struct lsm_client *client);
int q6lsm_open(struct lsm_client *client, uint16_t app_id);
diff --git a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h
index feb58d455560..4b9ee3009aa0 100644
--- a/include/sound/seq_kernel.h
+++ b/include/sound/seq_kernel.h
@@ -49,7 +49,8 @@ typedef union snd_seq_timestamp snd_seq_timestamp_t;
#define SNDRV_SEQ_DEFAULT_CLIENT_EVENTS 200
/* max delivery path length */
-#define SNDRV_SEQ_MAX_HOPS 10
+/* NOTE: this shouldn't be greater than MAX_LOCKDEP_SUBCLASSES */
+#define SNDRV_SEQ_MAX_HOPS 8
/* max size of event size */
#define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 1adf8739980c..8555321306fb 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -199,6 +199,7 @@ enum tcm_tmreq_table {
TMR_LUN_RESET = 5,
TMR_TARGET_WARM_RESET = 6,
TMR_TARGET_COLD_RESET = 7,
+ TMR_UNKNOWN = 0xff,
};
/* fabric independent task management response values */
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index 7063bbcca03b..589df6f73789 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -128,6 +128,18 @@ TRACE_DEFINE_ENUM(CP_TRIMMED);
{ CP_DISCARD, "Discard" }, \
{ CP_UMOUNT | CP_TRIMMED, "Umount,Trimmed" })
+#define show_fsync_cpreason(type) \
+ __print_symbolic(type, \
+ { CP_NO_NEEDED, "no needed" }, \
+ { CP_NON_REGULAR, "non regular" }, \
+ { CP_HARDLINK, "hardlink" }, \
+ { CP_SB_NEED_CP, "sb needs cp" }, \
+ { CP_WRONG_PINO, "wrong pino" }, \
+ { CP_NO_SPC_ROLL, "no space roll forward" }, \
+ { CP_NODE_NEED_CP, "node needs cp" }, \
+ { CP_FASTBOOT_MODE, "fastboot mode" }, \
+ { CP_SPEC_LOG_NUM, "log type is 2" })
+
struct victim_sel_policy;
struct f2fs_map_blocks;
@@ -202,14 +214,14 @@ DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter,
TRACE_EVENT(f2fs_sync_file_exit,
- TP_PROTO(struct inode *inode, int need_cp, int datasync, int ret),
+ TP_PROTO(struct inode *inode, int cp_reason, int datasync, int ret),
- TP_ARGS(inode, need_cp, datasync, ret),
+ TP_ARGS(inode, cp_reason, datasync, ret),
TP_STRUCT__entry(
__field(dev_t, dev)
__field(ino_t, ino)
- __field(int, need_cp)
+ __field(int, cp_reason)
__field(int, datasync)
__field(int, ret)
),
@@ -217,15 +229,15 @@ TRACE_EVENT(f2fs_sync_file_exit,
TP_fast_assign(
__entry->dev = inode->i_sb->s_dev;
__entry->ino = inode->i_ino;
- __entry->need_cp = need_cp;
+ __entry->cp_reason = cp_reason;
__entry->datasync = datasync;
__entry->ret = ret;
),
- TP_printk("dev = (%d,%d), ino = %lu, checkpoint is %s, "
+ TP_printk("dev = (%d,%d), ino = %lu, cp_reason: %s, "
"datasync = %d, ret = %d",
show_dev_ino(__entry),
- __entry->need_cp ? "needed" : "not needed",
+ show_fsync_cpreason(__entry->cp_reason),
__entry->datasync,
__entry->ret)
);
@@ -716,6 +728,91 @@ TRACE_EVENT(f2fs_get_victim,
__entry->free)
);
+TRACE_EVENT(f2fs_lookup_start,
+
+ TP_PROTO(struct inode *dir, struct dentry *dentry, unsigned int flags),
+
+ TP_ARGS(dir, dentry, flags),
+
+ TP_STRUCT__entry(
+ __field(dev_t, dev)
+ __field(ino_t, ino)
+ __field(const char *, name)
+ __field(unsigned int, flags)
+ ),
+
+ TP_fast_assign(
+ __entry->dev = dir->i_sb->s_dev;
+ __entry->ino = dir->i_ino;
+ __entry->name = dentry->d_name.name;
+ __entry->flags = flags;
+ ),
+
+ TP_printk("dev = (%d,%d), pino = %lu, name:%s, flags:%u",
+ show_dev_ino(__entry),
+ __entry->name,
+ __entry->flags)
+);
+
+TRACE_EVENT(f2fs_lookup_end,
+
+ TP_PROTO(struct inode *dir, struct dentry *dentry, nid_t ino,
+ int err),
+
+ TP_ARGS(dir, dentry, ino, err),
+
+ TP_STRUCT__entry(
+ __field(dev_t, dev)
+ __field(ino_t, ino)
+ __field(const char *, name)
+ __field(nid_t, cino)
+ __field(int, err)
+ ),
+
+ TP_fast_assign(
+ __entry->dev = dir->i_sb->s_dev;
+ __entry->ino = dir->i_ino;
+ __entry->name = dentry->d_name.name;
+ __entry->cino = ino;
+ __entry->err = err;
+ ),
+
+ TP_printk("dev = (%d,%d), pino = %lu, name:%s, ino:%u, err:%d",
+ show_dev_ino(__entry),
+ __entry->name,
+ __entry->cino,
+ __entry->err)
+);
+
+TRACE_EVENT(f2fs_readdir,
+
+ TP_PROTO(struct inode *dir, loff_t start_pos, loff_t end_pos, int err),
+
+ TP_ARGS(dir, start_pos, end_pos, err),
+
+ TP_STRUCT__entry(
+ __field(dev_t, dev)
+ __field(ino_t, ino)
+ __field(loff_t, start)
+ __field(loff_t, end)
+ __field(int, err)
+ ),
+
+ TP_fast_assign(
+ __entry->dev = dir->i_sb->s_dev;
+ __entry->ino = dir->i_ino;
+ __entry->start = start_pos;
+ __entry->end = end_pos;
+ __entry->err = err;
+ ),
+
+ TP_printk("dev = (%d,%d), ino = %lu, start_pos:%llu, end_pos:%llu, err:%d",
+ show_dev_ino(__entry),
+ __entry->start,
+ __entry->end,
+ __entry->err)
+);
+
TRACE_EVENT(f2fs_fallocate,
TP_PROTO(struct inode *inode, int mode,
@@ -1274,6 +1371,13 @@ DEFINE_EVENT(f2fs_discard, f2fs_issue_discard,
TP_ARGS(dev, blkstart, blklen)
);
+DEFINE_EVENT(f2fs_discard, f2fs_remove_discard,
+
+ TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
+
+ TP_ARGS(dev, blkstart, blklen)
+);
+
TRACE_EVENT(f2fs_issue_reset_zone,
TP_PROTO(struct block_device *dev, block_t blkstart),
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 739bcb89f602..cc0ebe6867a5 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -436,9 +436,9 @@ TRACE_EVENT(sched_update_task_ravg,
TRACE_EVENT(sched_get_task_cpu_cycles,
- TP_PROTO(int cpu, int event, u64 cycles, u64 exec_time),
+ TP_PROTO(int cpu, int event, u64 cycles, u64 exec_time, struct task_struct *p),
- TP_ARGS(cpu, event, cycles, exec_time),
+ TP_ARGS(cpu, event, cycles, exec_time, p),
TP_STRUCT__entry(
__field(int, cpu )
@@ -448,6 +448,8 @@ TRACE_EVENT(sched_get_task_cpu_cycles,
__field(u32, freq )
__field(u32, legacy_freq )
__field(u32, max_freq)
+ __field(pid_t, pid )
+ __array(char, comm, TASK_COMM_LEN )
),
TP_fast_assign(
@@ -458,12 +460,14 @@ TRACE_EVENT(sched_get_task_cpu_cycles,
__entry->freq = cpu_cycles_to_freq(cycles, exec_time);
__entry->legacy_freq = cpu_cur_freq(cpu);
__entry->max_freq = cpu_max_freq(cpu);
+ __entry->pid = p->pid;
+ memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
),
- TP_printk("cpu=%d event=%d cycles=%llu exec_time=%llu freq=%u legacy_freq=%u max_freq=%u",
+ TP_printk("cpu=%d event=%d cycles=%llu exec_time=%llu freq=%u legacy_freq=%u max_freq=%u task=%d (%s)",
__entry->cpu, __entry->event, __entry->cycles,
__entry->exec_time, __entry->freq, __entry->legacy_freq,
- __entry->max_freq)
+ __entry->max_freq, __entry->pid, __entry->comm)
);
TRACE_EVENT(sched_update_history,
diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
index 5664ca07c9c7..a01a076ea060 100644
--- a/include/trace/events/sunrpc.h
+++ b/include/trace/events/sunrpc.h
@@ -455,20 +455,22 @@ TRACE_EVENT(svc_recv,
TP_ARGS(rqst, status),
TP_STRUCT__entry(
- __field(struct sockaddr *, addr)
__field(__be32, xid)
__field(int, status)
__field(unsigned long, flags)
+ __dynamic_array(unsigned char, addr, rqst->rq_addrlen)
),
TP_fast_assign(
- __entry->addr = (struct sockaddr *)&rqst->rq_addr;
__entry->xid = status > 0 ? rqst->rq_xid : 0;
__entry->status = status;
__entry->flags = rqst->rq_flags;
+ memcpy(__get_dynamic_array(addr),
+ &rqst->rq_addr, rqst->rq_addrlen);
),
- TP_printk("addr=%pIScp xid=0x%x status=%d flags=%s", __entry->addr,
+ TP_printk("addr=%pIScp xid=0x%x status=%d flags=%s",
+ (struct sockaddr *)__get_dynamic_array(addr),
be32_to_cpu(__entry->xid), __entry->status,
show_rqstp_flags(__entry->flags))
);
@@ -480,22 +482,23 @@ DECLARE_EVENT_CLASS(svc_rqst_status,
TP_ARGS(rqst, status),
TP_STRUCT__entry(
- __field(struct sockaddr *, addr)
__field(__be32, xid)
- __field(int, dropme)
__field(int, status)
__field(unsigned long, flags)
+ __dynamic_array(unsigned char, addr, rqst->rq_addrlen)
),
TP_fast_assign(
- __entry->addr = (struct sockaddr *)&rqst->rq_addr;
__entry->xid = rqst->rq_xid;
__entry->status = status;
__entry->flags = rqst->rq_flags;
+ memcpy(__get_dynamic_array(addr),
+ &rqst->rq_addr, rqst->rq_addrlen);
),
TP_printk("addr=%pIScp rq_xid=0x%x status=%d flags=%s",
- __entry->addr, be32_to_cpu(__entry->xid),
+ (struct sockaddr *)__get_dynamic_array(addr),
+ be32_to_cpu(__entry->xid),
__entry->status, show_rqstp_flags(__entry->flags))
);
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index 0630e0f64b9c..f693b5b5b7ab 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -80,6 +80,20 @@ extern "C" {
#define DRM_MODE_FLAG_SUPPORTS_RGB (1<<20)
#define DRM_MODE_FLAG_SUPPORTS_YUV (1<<21)
+/* Picture aspect ratio options */
+#define DRM_MODE_PICTURE_ASPECT_NONE 0
+#define DRM_MODE_PICTURE_ASPECT_4_3 1
+#define DRM_MODE_PICTURE_ASPECT_16_9 2
+
+/* Aspect ratio flag bitmask (4 bits 27:24) */
+#define DRM_MODE_FLAG_PIC_AR_MASK (0x0F<<24)
+#define DRM_MODE_FLAG_PIC_AR_NONE \
+ (DRM_MODE_PICTURE_ASPECT_NONE<<24)
+#define DRM_MODE_FLAG_PIC_AR_4_3 \
+ (DRM_MODE_PICTURE_ASPECT_4_3<<24)
+#define DRM_MODE_FLAG_PIC_AR_16_9 \
+ (DRM_MODE_PICTURE_ASPECT_16_9<<24)
+
/* DPMS flags */
/* bit compatible with the xorg definitions. */
#define DRM_MODE_DPMS_ON 0
@@ -94,11 +108,6 @@ extern "C" {
#define DRM_MODE_SCALE_CENTER 2 /* Centered, no scaling */
#define DRM_MODE_SCALE_ASPECT 3 /* Full screen, preserve aspect */
-/* Picture aspect ratio options */
-#define DRM_MODE_PICTURE_ASPECT_NONE 0
-#define DRM_MODE_PICTURE_ASPECT_4_3 1
-#define DRM_MODE_PICTURE_ASPECT_16_9 2
-
/* Dithering mode options */
#define DRM_MODE_DITHERING_OFF 0
#define DRM_MODE_DITHERING_ON 1
diff --git a/include/uapi/drm/msm_drm.h b/include/uapi/drm/msm_drm.h
index a852f2a3701f..30ae8c3c1c85 100644
--- a/include/uapi/drm/msm_drm.h
+++ b/include/uapi/drm/msm_drm.h
@@ -112,13 +112,14 @@ struct drm_msm_ext_panel_hdr_properties {
__u32 hdr_min_luminance; /* Min Luminance */
};
-#define MSM_PARAM_GPU_ID 0x01
-#define MSM_PARAM_GMEM_SIZE 0x02
-#define MSM_PARAM_CHIP_ID 0x03
-#define MSM_PARAM_MAX_FREQ 0x04
-#define MSM_PARAM_TIMESTAMP 0x05
-#define MSM_PARAM_GMEM_BASE 0x06
-#define MSM_PARAM_NR_RINGS 0x07
+#define MSM_PARAM_GPU_ID 0x01
+#define MSM_PARAM_GMEM_SIZE 0x02
+#define MSM_PARAM_CHIP_ID 0x03
+#define MSM_PARAM_MAX_FREQ 0x04
+#define MSM_PARAM_TIMESTAMP 0x05
+#define MSM_PARAM_GMEM_BASE 0x06
+#define MSM_PARAM_NR_RINGS 0x07
+#define MSM_PARAM_GPU_HANG_TIMEOUT 0xa0 /* timeout in ms */
struct drm_msm_param {
__u32 pipe; /* in, MSM_PIPE_x */
diff --git a/include/uapi/linux/bcache.h b/include/uapi/linux/bcache.h
index 22b6ad31c706..8562b1cb776b 100644
--- a/include/uapi/linux/bcache.h
+++ b/include/uapi/linux/bcache.h
@@ -90,7 +90,7 @@ PTR_FIELD(PTR_GEN, 0, 8)
#define PTR_CHECK_DEV ((1 << PTR_DEV_BITS) - 1)
-#define PTR(gen, offset, dev) \
+#define MAKE_PTR(gen, offset, dev) \
((((__u64) dev) << 51) | ((__u64) offset) << 8 | gen)
/* Bkey utility code */
diff --git a/include/uapi/linux/habmm.h b/include/uapi/linux/habmm.h
index 902bd35ee474..59b603a0fcf7 100644
--- a/include/uapi/linux/habmm.h
+++ b/include/uapi/linux/habmm.h
@@ -73,8 +73,9 @@ struct hab_unimport {
#define MM_AUD_END 105
#define MM_CAM_START 200
-#define MM_CAM 201
-#define MM_CAM_END 202
+#define MM_CAM_1 201
+#define MM_CAM_2 202
+#define MM_CAM_END 203
#define MM_DISP_START 300
#define MM_DISP_1 301
@@ -102,7 +103,13 @@ struct hab_unimport {
#define MM_QCPE_VM3 703
#define MM_QCPE_VM4 704
#define MM_QCPE_END 705
-#define MM_ID_MAX 706
+
+#define MM_CLK_START 800
+#define MM_CLK_VM1 801
+#define MM_CLK_VM2 802
+#define MM_CLK_END 803
+
+#define MM_ID_MAX 804
#define HABMM_SOCKET_OPEN_FLAGS_SINGLE_BE_SINGLE_FE 0x00000000
#define HABMM_SOCKET_OPEN_FLAGS_SINGLE_BE_SINGLE_DOMU 0x00000001
@@ -110,6 +117,14 @@ struct hab_unimport {
#define HABMM_SOCKET_SEND_FLAGS_NON_BLOCKING 0x00000001
+/*
+ * Collect cross-VM stats: client provides stat-buffer large enough to allow 2
+ * ets of a 2-uint64_t pair to collect seconds and nano-seconds at the
+ * beginning of the stat-buffer. Stats are collected when the stat-buffer leaves
+ * VM1, then enters VM2
+ */
+#define HABMM_SOCKET_SEND_FLAGS_XING_VM_STAT 0x00000002
+
#define HABMM_SOCKET_RECV_FLAGS_NON_BLOCKING 0x00000001
#define HABMM_EXP_MEM_TYPE_DMA 0x00000001
diff --git a/include/uapi/linux/msm_ipa.h b/include/uapi/linux/msm_ipa.h
index 0bdfc9741d19..3d330990676c 100644
--- a/include/uapi/linux/msm_ipa.h
+++ b/include/uapi/linux/msm_ipa.h
@@ -163,6 +163,8 @@
#define IPA_FLT_MAC_SRC_ADDR_802_3 (1ul << 19)
#define IPA_FLT_MAC_DST_ADDR_802_3 (1ul << 20)
#define IPA_FLT_MAC_ETHER_TYPE (1ul << 21)
+#define IPA_FLT_TCP_SYN (1ul << 23)
+#define IPA_FLT_TCP_SYN_L2TP (1ul << 24)
/**
* maximal number of NAT PDNs in the PDN config table
diff --git a/include/uapi/linux/rds.h b/include/uapi/linux/rds.h
index 7af20a136429..804c9b2bfce3 100644
--- a/include/uapi/linux/rds.h
+++ b/include/uapi/linux/rds.h
@@ -104,8 +104,8 @@
#define RDS_INFO_LAST 10010
struct rds_info_counter {
- uint8_t name[32];
- uint64_t value;
+ __u8 name[32];
+ __u64 value;
} __attribute__((packed));
#define RDS_INFO_CONNECTION_FLAG_SENDING 0x01
@@ -115,35 +115,35 @@ struct rds_info_counter {
#define TRANSNAMSIZ 16
struct rds_info_connection {
- uint64_t next_tx_seq;
- uint64_t next_rx_seq;
+ __u64 next_tx_seq;
+ __u64 next_rx_seq;
__be32 laddr;
__be32 faddr;
- uint8_t transport[TRANSNAMSIZ]; /* null term ascii */
- uint8_t flags;
+ __u8 transport[TRANSNAMSIZ]; /* null term ascii */
+ __u8 flags;
} __attribute__((packed));
#define RDS_INFO_MESSAGE_FLAG_ACK 0x01
#define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02
struct rds_info_message {
- uint64_t seq;
- uint32_t len;
+ __u64 seq;
+ __u32 len;
__be32 laddr;
__be32 faddr;
__be16 lport;
__be16 fport;
- uint8_t flags;
+ __u8 flags;
} __attribute__((packed));
struct rds_info_socket {
- uint32_t sndbuf;
+ __u32 sndbuf;
__be32 bound_addr;
__be32 connected_addr;
__be16 bound_port;
__be16 connected_port;
- uint32_t rcvbuf;
- uint64_t inum;
+ __u32 rcvbuf;
+ __u64 inum;
} __attribute__((packed));
struct rds_info_tcp_socket {
@@ -151,25 +151,25 @@ struct rds_info_tcp_socket {
__be16 local_port;
__be32 peer_addr;
__be16 peer_port;
- uint64_t hdr_rem;
- uint64_t data_rem;
- uint32_t last_sent_nxt;
- uint32_t last_expected_una;
- uint32_t last_seen_una;
+ __u64 hdr_rem;
+ __u64 data_rem;
+ __u32 last_sent_nxt;
+ __u32 last_expected_una;
+ __u32 last_seen_una;
} __attribute__((packed));
#define RDS_IB_GID_LEN 16
struct rds_info_rdma_connection {
__be32 src_addr;
__be32 dst_addr;
- uint8_t src_gid[RDS_IB_GID_LEN];
- uint8_t dst_gid[RDS_IB_GID_LEN];
+ __u8 src_gid[RDS_IB_GID_LEN];
+ __u8 dst_gid[RDS_IB_GID_LEN];
- uint32_t max_send_wr;
- uint32_t max_recv_wr;
- uint32_t max_send_sge;
- uint32_t rdma_mr_max;
- uint32_t rdma_mr_size;
+ __u32 max_send_wr;
+ __u32 max_recv_wr;
+ __u32 max_send_sge;
+ __u32 rdma_mr_max;
+ __u32 rdma_mr_size;
};
/*
@@ -210,70 +210,70 @@ struct rds_info_rdma_connection {
* (so that the application does not have to worry about
* alignment).
*/
-typedef uint64_t rds_rdma_cookie_t;
+typedef __u64 rds_rdma_cookie_t;
struct rds_iovec {
- uint64_t addr;
- uint64_t bytes;
+ __u64 addr;
+ __u64 bytes;
};
struct rds_get_mr_args {
struct rds_iovec vec;
- uint64_t cookie_addr;
- uint64_t flags;
+ __u64 cookie_addr;
+ __u64 flags;
};
struct rds_get_mr_for_dest_args {
struct __kernel_sockaddr_storage dest_addr;
struct rds_iovec vec;
- uint64_t cookie_addr;
- uint64_t flags;
+ __u64 cookie_addr;
+ __u64 flags;
};
struct rds_free_mr_args {
rds_rdma_cookie_t cookie;
- uint64_t flags;
+ __u64 flags;
};
struct rds_rdma_args {
rds_rdma_cookie_t cookie;
struct rds_iovec remote_vec;
- uint64_t local_vec_addr;
- uint64_t nr_local;
- uint64_t flags;
- uint64_t user_token;
+ __u64 local_vec_addr;
+ __u64 nr_local;
+ __u64 flags;
+ __u64 user_token;
};
struct rds_atomic_args {
rds_rdma_cookie_t cookie;
- uint64_t local_addr;
- uint64_t remote_addr;
+ __u64 local_addr;
+ __u64 remote_addr;
union {
struct {
- uint64_t compare;
- uint64_t swap;
+ __u64 compare;
+ __u64 swap;
} cswp;
struct {
- uint64_t add;
+ __u64 add;
} fadd;
struct {
- uint64_t compare;
- uint64_t swap;
- uint64_t compare_mask;
- uint64_t swap_mask;
+ __u64 compare;
+ __u64 swap;
+ __u64 compare_mask;
+ __u64 swap_mask;
} m_cswp;
struct {
- uint64_t add;
- uint64_t nocarry_mask;
+ __u64 add;
+ __u64 nocarry_mask;
} m_fadd;
};
- uint64_t flags;
- uint64_t user_token;
+ __u64 flags;
+ __u64 user_token;
};
struct rds_rdma_notify {
- uint64_t user_token;
- int32_t status;
+ __u64 user_token;
+ __s32 status;
};
#define RDS_RDMA_SUCCESS 0
diff --git a/include/uapi/linux/spi/spidev.h b/include/uapi/linux/spi/spidev.h
index dd5f21e75805..856de39d0b89 100644
--- a/include/uapi/linux/spi/spidev.h
+++ b/include/uapi/linux/spi/spidev.h
@@ -23,6 +23,7 @@
#define SPIDEV_H
#include <linux/types.h>
+#include <linux/ioctl.h>
/* User space versions of kernel symbols for SPI clocking modes,
* matching <linux/spi/spi.h>
diff --git a/include/uapi/linux/tee.h b/include/uapi/linux/tee.h
new file mode 100644
index 000000000000..370d8845ab21
--- /dev/null
+++ b/include/uapi/linux/tee.h
@@ -0,0 +1,346 @@
+/*
+ * Copyright (c) 2015-2016, Linaro Limited
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __TEE_H
+#define __TEE_H
+
+#include <linux/ioctl.h>
+#include <linux/types.h>
+
+/*
+ * This file describes the API provided by a TEE driver to user space.
+ *
+ * Each TEE driver defines a TEE specific protocol which is used for the
+ * data passed back and forth using TEE_IOC_CMD.
+ */
+
+/* Helpers to make the ioctl defines */
+#define TEE_IOC_MAGIC 0xa4
+#define TEE_IOC_BASE 0
+
+/* Flags relating to shared memory */
+#define TEE_IOCTL_SHM_MAPPED 0x1 /* memory mapped in normal world */
+#define TEE_IOCTL_SHM_DMA_BUF 0x2 /* dma-buf handle on shared memory */
+
+#define TEE_MAX_ARG_SIZE 1024
+
+#define TEE_GEN_CAP_GP (1 << 0)/* GlobalPlatform compliant TEE */
+
+/*
+ * TEE Implementation ID
+ */
+#define TEE_IMPL_ID_OPTEE 1
+
+/*
+ * OP-TEE specific capabilities
+ */
+#define TEE_OPTEE_CAP_TZ (1 << 0)
+
+/**
+ * struct tee_ioctl_version_data - TEE version
+ * @impl_id: [out] TEE implementation id
+ * @impl_caps: [out] Implementation specific capabilities
+ * @gen_caps: [out] Generic capabilities, defined by TEE_GEN_CAPS_* above
+ *
+ * Identifies the TEE implementation, @impl_id is one of TEE_IMPL_ID_* above.
+ * @impl_caps is implementation specific, for example TEE_OPTEE_CAP_*
+ * is valid when @impl_id == TEE_IMPL_ID_OPTEE.
+ */
+struct tee_ioctl_version_data {
+ __u32 impl_id;
+ __u32 impl_caps;
+ __u32 gen_caps;
+};
+
+/**
+ * TEE_IOC_VERSION - query version of TEE
+ *
+ * Takes a tee_ioctl_version_data struct and returns with the TEE version
+ * data filled in.
+ */
+#define TEE_IOC_VERSION _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 0, \
+ struct tee_ioctl_version_data)
+
+/**
+ * struct tee_ioctl_shm_alloc_data - Shared memory allocate argument
+ * @size: [in/out] Size of shared memory to allocate
+ * @flags: [in/out] Flags to/from allocation.
+ * @id: [out] Identifier of the shared memory
+ *
+ * The flags field should currently be zero as input. Updated by the call
+ * with actual flags as defined by TEE_IOCTL_SHM_* above.
+ * This structure is used as argument for TEE_IOC_SHM_ALLOC below.
+ */
+struct tee_ioctl_shm_alloc_data {
+ __u64 size;
+ __u32 flags;
+ __s32 id;
+};
+
+/**
+ * TEE_IOC_SHM_ALLOC - allocate shared memory
+ *
+ * Allocates shared memory between the user space process and secure OS.
+ *
+ * Returns a file descriptor on success or < 0 on failure
+ *
+ * The returned file descriptor is used to map the shared memory into user
+ * space. The shared memory is freed when the descriptor is closed and the
+ * memory is unmapped.
+ */
+#define TEE_IOC_SHM_ALLOC _IOWR(TEE_IOC_MAGIC, TEE_IOC_BASE + 1, \
+ struct tee_ioctl_shm_alloc_data)
+
+/**
+ * struct tee_ioctl_buf_data - Variable sized buffer
+ * @buf_ptr: [in] A __user pointer to a buffer
+ * @buf_len: [in] Length of the buffer above
+ *
+ * Used as argument for TEE_IOC_OPEN_SESSION, TEE_IOC_INVOKE,
+ * TEE_IOC_SUPPL_RECV, and TEE_IOC_SUPPL_SEND below.
+ */
+struct tee_ioctl_buf_data {
+ __u64 buf_ptr;
+ __u64 buf_len;
+};
+
+/*
+ * Attributes for struct tee_ioctl_param, selects field in the union
+ */
+#define TEE_IOCTL_PARAM_ATTR_TYPE_NONE 0 /* parameter not used */
+
+/*
+ * These defines value parameters (struct tee_ioctl_param_value)
+ */
+#define TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT 1
+#define TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT 2
+#define TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT 3 /* input and output */
+
+/*
+ * These defines shared memory reference parameters (struct
+ * tee_ioctl_param_memref)
+ */
+#define TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT 5
+#define TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT 6
+#define TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT 7 /* input and output */
+
+/*
+ * Mask for the type part of the attribute, leaves room for more types
+ */
+#define TEE_IOCTL_PARAM_ATTR_TYPE_MASK 0xff
+
+/*
+ * Matches TEEC_LOGIN_* in GP TEE Client API
+ * Are only defined for GP compliant TEEs
+ */
+#define TEE_IOCTL_LOGIN_PUBLIC 0
+#define TEE_IOCTL_LOGIN_USER 1
+#define TEE_IOCTL_LOGIN_GROUP 2
+#define TEE_IOCTL_LOGIN_APPLICATION 4
+#define TEE_IOCTL_LOGIN_USER_APPLICATION 5
+#define TEE_IOCTL_LOGIN_GROUP_APPLICATION 6
+
+/**
+ * struct tee_ioctl_param - parameter
+ * @attr: attributes
+ * @a: if a memref, offset into the shared memory object, else a value parameter
+ * @b: if a memref, size of the buffer, else a value parameter
+ * @c: if a memref, shared memory identifier, else a value parameter
+ *
+ * @attr & TEE_PARAM_ATTR_TYPE_MASK indicates if memref or value is used in
+ * the union. TEE_PARAM_ATTR_TYPE_VALUE_* indicates value and
+ * TEE_PARAM_ATTR_TYPE_MEMREF_* indicates memref. TEE_PARAM_ATTR_TYPE_NONE
+ * indicates that none of the members are used.
+ *
+ * Shared memory is allocated with TEE_IOC_SHM_ALLOC which returns an
+ * identifier representing the shared memory object. A memref can reference
+ * a part of a shared memory by specifying an offset (@a) and size (@b) of
+ * the object. To supply the entire shared memory object set the offset
+ * (@a) to 0 and size (@b) to the previously returned size of the object.
+ */
+struct tee_ioctl_param {
+ __u64 attr;
+ __u64 a;
+ __u64 b;
+ __u64 c;
+};
+
+#define TEE_IOCTL_UUID_LEN 16
+
+/**
+ * struct tee_ioctl_open_session_arg - Open session argument
+ * @uuid: [in] UUID of the Trusted Application
+ * @clnt_uuid: [in] UUID of client
+ * @clnt_login: [in] Login class of client, TEE_IOCTL_LOGIN_* above
+ * @cancel_id: [in] Cancellation id, a unique value to identify this request
+ * @session: [out] Session id
+ * @ret: [out] return value
+ * @ret_origin [out] origin of the return value
+ * @num_params [in] number of parameters following this struct
+ */
+struct tee_ioctl_open_session_arg {
+ __u8 uuid[TEE_IOCTL_UUID_LEN];
+ __u8 clnt_uuid[TEE_IOCTL_UUID_LEN];
+ __u32 clnt_login;
+ __u32 cancel_id;
+ __u32 session;
+ __u32 ret;
+ __u32 ret_origin;
+ __u32 num_params;
+ /* num_params tells the actual number of element in params */
+ struct tee_ioctl_param params[];
+};
+
+/**
+ * TEE_IOC_OPEN_SESSION - opens a session to a Trusted Application
+ *
+ * Takes a struct tee_ioctl_buf_data which contains a struct
+ * tee_ioctl_open_session_arg followed by any array of struct
+ * tee_ioctl_param
+ */
+#define TEE_IOC_OPEN_SESSION _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 2, \
+ struct tee_ioctl_buf_data)
+
+/**
+ * struct tee_ioctl_invoke_func_arg - Invokes a function in a Trusted
+ * Application
+ * @func: [in] Trusted Application function, specific to the TA
+ * @session: [in] Session id
+ * @cancel_id: [in] Cancellation id, a unique value to identify this request
+ * @ret: [out] return value
+ * @ret_origin [out] origin of the return value
+ * @num_params [in] number of parameters following this struct
+ */
+struct tee_ioctl_invoke_arg {
+ __u32 func;
+ __u32 session;
+ __u32 cancel_id;
+ __u32 ret;
+ __u32 ret_origin;
+ __u32 num_params;
+ /* num_params tells the actual number of element in params */
+ struct tee_ioctl_param params[];
+};
+
+/**
+ * TEE_IOC_INVOKE - Invokes a function in a Trusted Application
+ *
+ * Takes a struct tee_ioctl_buf_data which contains a struct
+ * tee_invoke_func_arg followed by any array of struct tee_param
+ */
+#define TEE_IOC_INVOKE _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 3, \
+ struct tee_ioctl_buf_data)
+
+/**
+ * struct tee_ioctl_cancel_arg - Cancels an open session or invoke ioctl
+ * @cancel_id: [in] Cancellation id, a unique value to identify this request
+ * @session: [in] Session id, if the session is opened, else set to 0
+ */
+struct tee_ioctl_cancel_arg {
+ __u32 cancel_id;
+ __u32 session;
+};
+
+/**
+ * TEE_IOC_CANCEL - Cancels an open session or invoke
+ */
+#define TEE_IOC_CANCEL _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 4, \
+ struct tee_ioctl_cancel_arg)
+
+/**
+ * struct tee_ioctl_close_session_arg - Closes an open session
+ * @session: [in] Session id
+ */
+struct tee_ioctl_close_session_arg {
+ __u32 session;
+};
+
+/**
+ * TEE_IOC_CLOSE_SESSION - Closes a session
+ */
+#define TEE_IOC_CLOSE_SESSION _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 5, \
+ struct tee_ioctl_close_session_arg)
+
+/**
+ * struct tee_iocl_supp_recv_arg - Receive a request for a supplicant function
+ * @func: [in] supplicant function
+ * @num_params [in/out] number of parameters following this struct
+ *
+ * @num_params is the number of params that tee-supplicant has room to
+ * receive when input, @num_params is the number of actual params
+ * tee-supplicant receives when output.
+ */
+struct tee_iocl_supp_recv_arg {
+ __u32 func;
+ __u32 num_params;
+ /* num_params tells the actual number of element in params */
+ struct tee_ioctl_param params[];
+};
+
+/**
+ * TEE_IOC_SUPPL_RECV - Receive a request for a supplicant function
+ *
+ * Takes a struct tee_ioctl_buf_data which contains a struct
+ * tee_iocl_supp_recv_arg followed by any array of struct tee_param
+ */
+#define TEE_IOC_SUPPL_RECV _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 6, \
+ struct tee_ioctl_buf_data)
+
+/**
+ * struct tee_iocl_supp_send_arg - Send a response to a received request
+ * @ret: [out] return value
+ * @num_params [in] number of parameters following this struct
+ */
+struct tee_iocl_supp_send_arg {
+ __u32 ret;
+ __u32 num_params;
+ /* num_params tells the actual number of element in params */
+ struct tee_ioctl_param params[];
+};
+
+/**
+ * TEE_IOC_SUPPL_SEND - Receive a request for a supplicant function
+ *
+ * Takes a struct tee_ioctl_buf_data which contains a struct
+ * tee_iocl_supp_send_arg followed by any array of struct tee_param
+ */
+#define TEE_IOC_SUPPL_SEND _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 7, \
+ struct tee_ioctl_buf_data)
+
+/*
+ * Five syscalls are used when communicating with the TEE driver.
+ * open(): opens the device associated with the driver
+ * ioctl(): as described above operating on the file descriptor from open()
+ * close(): two cases
+ * - closes the device file descriptor
+ * - closes a file descriptor connected to allocated shared memory
+ * mmap(): maps shared memory into user space using information from struct
+ * tee_ioctl_shm_alloc_data
+ * munmap(): unmaps previously shared memory
+ */
+
+#endif /*__TEE_H*/
diff --git a/include/uapi/linux/usb/ch9.h b/include/uapi/linux/usb/ch9.h
index b6c14b1ebdaf..7778723e4405 100644
--- a/include/uapi/linux/usb/ch9.h
+++ b/include/uapi/linux/usb/ch9.h
@@ -812,6 +812,8 @@ struct usb_wireless_cap_descriptor { /* Ultra Wide Band */
__u8 bReserved;
} __attribute__((packed));
+#define USB_DT_USB_WIRELESS_CAP_SIZE 11
+
/* USB 2.0 Extension descriptor */
#define USB_CAP_TYPE_EXT 2
@@ -896,6 +898,17 @@ struct usb_ssp_cap_descriptor {
} __attribute__((packed));
/*
+ * Precision time measurement capability descriptor: advertised by devices and
+ * hubs that support PTM
+ */
+#define USB_PTM_CAP_TYPE 0xb
+struct usb_ptm_cap_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDevCapabilityType;
+} __attribute__((packed));
+
+/*
* Configuration Summary descriptors: Defines a list of functions in the
* configuration. This descriptor may be used by Host software to decide
* which Configuration to use to obtain the desired functionality.
@@ -919,6 +932,12 @@ struct usb_config_summary_descriptor {
struct function_class_info cs_info[];
} __attribute__((packed));
+/*
+ * The size of the descriptor for the Sublink Speed Attribute Count
+ * (SSAC) specified in bmAttributes[4:0].
+ */
+#define USB_DT_USB_SSP_CAP_SIZE(ssac) (16 + ssac * 4)
+
/*-------------------------------------------------------------------------*/
/* USB_DT_WIRELESS_ENDPOINT_COMP: companion descriptor associated with
@@ -1014,6 +1033,7 @@ enum usb3_link_state {
USB3_LPM_U3
};
+#define USB_DT_USB_PTM_ID_SIZE 3
/*
* A U1 timeout of 0x0 means the parent hub will reject any transitions to U1.
* 0xff means the parent hub will accept transitions to U1, but will not
diff --git a/include/uapi/media/Kbuild b/include/uapi/media/Kbuild
index 421c65d8a901..640002326ace 100644
--- a/include/uapi/media/Kbuild
+++ b/include/uapi/media/Kbuild
@@ -20,3 +20,4 @@ header-y += msmb_ispif.h
header-y += msmb_pproc.h
header-y += radio-iris.h
header-y += radio-iris-commands.h
+header-y += msm_ba.h
diff --git a/include/uapi/media/msm_ba.h b/include/uapi/media/msm_ba.h
new file mode 100644
index 000000000000..587d14652f3f
--- /dev/null
+++ b/include/uapi/media/msm_ba.h
@@ -0,0 +1,35 @@
+/* Copyright (c) 2017, 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
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef __UAPI_MSM_BA_H__
+#define __UAPI_MSM_BA_H__
+
+#include <linux/videodev2.h>
+#include <linux/types.h>
+
+/* CSI control params */
+struct csi_ctrl_params {
+ uint32_t settle_count;
+ uint32_t lane_count;
+};
+
+/* private ioctl structure */
+struct msm_ba_v4l2_ioctl_t {
+ size_t len;
+ void __user *ptr;
+};
+
+/* ADV7481 private ioctls for CSI control params */
+#define VIDIOC_G_CSI_PARAMS \
+ _IOWR('V', BASE_VIDIOC_PRIVATE, struct msm_ba_v4l2_ioctl_t)
+#endif
diff --git a/include/uapi/sound/audio_effects.h b/include/uapi/sound/audio_effects.h
index 6565acff4073..147e877db71e 100644
--- a/include/uapi/sound/audio_effects.h
+++ b/include/uapi/sound/audio_effects.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2015, 2017 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
@@ -159,8 +159,12 @@
#define PBE_ENABLE_PARAM_LEN 1
#define PBE_CONFIG_PARAM_LEN 28
+/* Command Payload length and size for Non-IID commands */
#define COMMAND_PAYLOAD_LEN 3
#define COMMAND_PAYLOAD_SZ (COMMAND_PAYLOAD_LEN * sizeof(uint32_t))
+/* Command Payload length and size for IID commands */
+#define COMMAND_IID_PAYLOAD_LEN 4
+#define COMMAND_IID_PAYLOAD_SZ (COMMAND_IID_PAYLOAD_LEN * sizeof(uint32_t))
#define MAX_INBAND_PARAM_SZ 4096
#define Q27_UNITY (1 << 27)
#define Q8_UNITY (1 << 8)