diff --git a/Makefile b/Makefile index 78006819ddfc..8ce39e9174d6 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 -SUBLEVEL = 194 +SUBLEVEL = 195 EXTRAVERSION = NAME = Petit Gorille diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h index d123ff90f7a8..9995bed6e92e 100644 --- a/arch/alpha/include/asm/io.h +++ b/arch/alpha/include/asm/io.h @@ -493,10 +493,10 @@ extern inline void writeq(u64 b, volatile void __iomem *addr) } #endif -#define ioread16be(p) be16_to_cpu(ioread16(p)) -#define ioread32be(p) be32_to_cpu(ioread32(p)) -#define iowrite16be(v,p) iowrite16(cpu_to_be16(v), (p)) -#define iowrite32be(v,p) iowrite32(cpu_to_be32(v), (p)) +#define ioread16be(p) swab16(ioread16(p)) +#define ioread32be(p) swab32(ioread32(p)) +#define iowrite16be(v,p) iowrite16(swab16(v), (p)) +#define iowrite32be(v,p) iowrite32(swab32(v), (p)) #define inb_p inb #define inw_p inw diff --git a/arch/m68k/include/asm/m53xxacr.h b/arch/m68k/include/asm/m53xxacr.h index 9138a624c5c8..692f90e7fecc 100644 --- a/arch/m68k/include/asm/m53xxacr.h +++ b/arch/m68k/include/asm/m53xxacr.h @@ -89,9 +89,9 @@ * coherency though in all cases. And for copyback caches we will need * to push cached data as well. */ -#define CACHE_INIT CACR_CINVA -#define CACHE_INVALIDATE CACR_CINVA -#define CACHE_INVALIDATED CACR_CINVA +#define CACHE_INIT (CACHE_MODE + CACR_CINVA - CACR_EC) +#define CACHE_INVALIDATE (CACHE_MODE + CACR_CINVA) +#define CACHE_INVALIDATED (CACHE_MODE + CACR_CINVA) #define ACR0_MODE ((CONFIG_RAMBASE & 0xff000000) + \ (0x000f0000) + \ diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 5fc8a010fdf0..ebe97e5500ee 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -66,15 +67,11 @@ static inline bool notify_page_fault(struct pt_regs *regs) } /* - * Check whether the instruction at regs->nip is a store using + * Check whether the instruction inst is a store using * an update addressing form which will update r1. */ -static bool store_updates_sp(struct pt_regs *regs) +static bool store_updates_sp(unsigned int inst) { - unsigned int inst; - - if (get_user(inst, (unsigned int __user *)regs->nip)) - return false; /* check for 1 in the rA field */ if (((inst >> 16) & 0x1f) != 1) return false; @@ -227,20 +224,24 @@ static bool bad_kernel_fault(bool is_exec, unsigned long error_code, return is_exec || (address >= TASK_SIZE); } +// This comes from 64-bit struct rt_sigframe + __SIGNAL_FRAMESIZE +#define SIGFRAME_MAX_SIZE (4096 + 128) + static bool bad_stack_expansion(struct pt_regs *regs, unsigned long address, - struct vm_area_struct *vma, - bool store_update_sp) + struct vm_area_struct *vma, unsigned int flags, + bool *must_retry) { /* * N.B. The POWER/Open ABI allows programs to access up to * 288 bytes below the stack pointer. - * The kernel signal delivery code writes up to about 1.5kB + * The kernel signal delivery code writes a bit over 4KB * below the stack pointer (r1) before decrementing it. * The exec code can write slightly over 640kB to the stack * before setting the user r1. Thus we allow the stack to * expand to 1MB without further checks. */ if (address + 0x100000 < vma->vm_end) { + unsigned int __user *nip = (unsigned int __user *)regs->nip; /* get user regs even if this fault is in kernel mode */ struct pt_regs *uregs = current->thread.regs; if (uregs == NULL) @@ -258,8 +259,22 @@ static bool bad_stack_expansion(struct pt_regs *regs, unsigned long address, * between the last mapped region and the stack will * expand the stack rather than segfaulting. */ - if (address + 2048 < uregs->gpr[1] && !store_update_sp) - return true; + if (address + SIGFRAME_MAX_SIZE >= uregs->gpr[1]) + return false; + + if ((flags & FAULT_FLAG_WRITE) && (flags & FAULT_FLAG_USER) && + access_ok(VERIFY_READ, nip, sizeof(*nip))) { + unsigned int inst; + int res; + + pagefault_disable(); + res = __get_user_inatomic(inst, nip); + pagefault_enable(); + if (!res) + return !store_updates_sp(inst); + *must_retry = true; + } + return true; } return false; } @@ -392,7 +407,7 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address, int is_user = user_mode(regs); int is_write = page_fault_is_write(error_code); int fault, major = 0; - bool store_update_sp = false; + bool must_retry = false; if (notify_page_fault(regs)) return 0; @@ -439,9 +454,6 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address, * can result in fault, which will cause a deadlock when called with * mmap_sem held */ - if (is_write && is_user) - store_update_sp = store_updates_sp(regs); - if (is_user) flags |= FAULT_FLAG_USER; if (is_write) @@ -488,8 +500,17 @@ retry: return bad_area(regs, address); /* The stack is being expanded, check if it's valid */ - if (unlikely(bad_stack_expansion(regs, address, vma, store_update_sp))) - return bad_area(regs, address); + if (unlikely(bad_stack_expansion(regs, address, vma, flags, + &must_retry))) { + if (!must_retry) + return bad_area(regs, address); + + up_read(&mm->mmap_sem); + if (fault_in_pages_readable((const char __user *)regs->nip, + sizeof(unsigned int))) + return bad_area_nosemaphore(regs, address); + goto retry; + } /* Try to expand it */ if (unlikely(expand_stack(vma, address))) diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c index 5ec935521204..8d20d49b252a 100644 --- a/arch/powerpc/platforms/pseries/ras.c +++ b/arch/powerpc/platforms/pseries/ras.c @@ -115,7 +115,6 @@ static void handle_system_shutdown(char event_modifier) case EPOW_SHUTDOWN_ON_UPS: pr_emerg("Loss of system power detected. System is running on" " UPS/battery. Check RTAS error log for details\n"); - orderly_poweroff(true); break; case EPOW_SHUTDOWN_LOSS_OF_CRITICAL_FUNCTIONS: diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 7a4714aafcdc..7ee62043cab9 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -63,6 +63,17 @@ static DEFINE_MUTEX(vdd_class_list_lock); */ static LIST_HEAD(clk_rate_change_list); +static struct hlist_head *all_lists[] = { + &clk_root_list, + &clk_orphan_list, + NULL, +}; + +static struct hlist_head *orphan_list[] = { + &clk_orphan_list, + NULL, +}; + /*** private data structures ***/ struct clk_core { @@ -2693,17 +2704,6 @@ static u32 debug_suspend; static DEFINE_MUTEX(clk_debug_lock); static HLIST_HEAD(clk_debug_list); -static struct hlist_head *all_lists[] = { - &clk_root_list, - &clk_orphan_list, - NULL, -}; - -static struct hlist_head *orphan_list[] = { - &clk_orphan_list, - NULL, -}; - static void clk_state_subtree(struct clk_core *c) { int vdd_level = 0; @@ -3982,6 +3982,34 @@ static const struct clk_ops clk_nodrv_ops = { .set_parent = clk_nodrv_set_parent, }; +static void clk_core_evict_parent_cache_subtree(struct clk_core *root, + struct clk_core *target) +{ + int i; + struct clk_core *child; + + for (i = 0; i < root->num_parents; i++) + if (root->parents[i] == target) + root->parents[i] = NULL; + + hlist_for_each_entry(child, &root->children, child_node) + clk_core_evict_parent_cache_subtree(child, target); +} + +/* Remove this clk from all parent caches */ +static void clk_core_evict_parent_cache(struct clk_core *core) +{ + struct hlist_head **lists; + struct clk_core *root; + + lockdep_assert_held(&prepare_lock); + + for (lists = all_lists; *lists; lists++) + hlist_for_each_entry(root, *lists, child_node) + clk_core_evict_parent_cache_subtree(root, core); + +} + /** * clk_unregister - unregister a currently registered clock * @clk: clock to unregister @@ -4020,6 +4048,8 @@ void clk_unregister(struct clk *clk) clk_core_set_parent(child, NULL); } + clk_core_evict_parent_cache(clk->core); + hlist_del_init(&clk->core->child_node); if (clk->core->prepare_count) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index dd9c850c01ad..3de77fa297a2 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -1378,6 +1378,7 @@ static void intel_pstate_get_cpu_pstates(struct cpudata *cpu) intel_pstate_get_hwp_max(cpu->cpu, &phy_max, ¤t_max); cpu->pstate.turbo_freq = phy_max * cpu->pstate.scaling; + cpu->pstate.turbo_pstate = phy_max; } else { cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * cpu->pstate.scaling; } diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c index aa592277d510..67037eb9a80e 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -220,32 +220,6 @@ static int vgem_gem_dumb_create(struct drm_file *file, struct drm_device *dev, return 0; } -static int vgem_gem_dumb_map(struct drm_file *file, struct drm_device *dev, - uint32_t handle, uint64_t *offset) -{ - struct drm_gem_object *obj; - int ret; - - obj = drm_gem_object_lookup(file, handle); - if (!obj) - return -ENOENT; - - if (!obj->filp) { - ret = -EINVAL; - goto unref; - } - - ret = drm_gem_create_mmap_offset(obj); - if (ret) - goto unref; - - *offset = drm_vma_node_offset_addr(&obj->vma_node); -unref: - drm_gem_object_put_unlocked(obj); - - return ret; -} - static struct drm_ioctl_desc vgem_ioctls[] = { DRM_IOCTL_DEF_DRV(VGEM_FENCE_ATTACH, vgem_fence_attach_ioctl, DRM_AUTH|DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(VGEM_FENCE_SIGNAL, vgem_fence_signal_ioctl, DRM_AUTH|DRM_RENDER_ALLOW), @@ -439,7 +413,6 @@ static struct drm_driver vgem_driver = { .fops = &vgem_driver_fops, .dumb_create = vgem_gem_dumb_create, - .dumb_map_offset = vgem_gem_dumb_map, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 8ac9e03c05b4..ca8f726dab2e 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -2012,7 +2012,7 @@ static int psmouse_get_maxproto(char *buffer, const struct kernel_param *kp) { int type = *((unsigned int *)kp->arg); - return sprintf(buffer, "%s", psmouse_protocol_by_type(type)->name); + return sprintf(buffer, "%s\n", psmouse_protocol_by_type(type)->name); } static int __init psmouse_init(void) diff --git a/drivers/media/pci/ttpci/budget-core.c b/drivers/media/pci/ttpci/budget-core.c index 97499b2af714..20524376b83b 100644 --- a/drivers/media/pci/ttpci/budget-core.c +++ b/drivers/media/pci/ttpci/budget-core.c @@ -383,20 +383,25 @@ static int budget_register(struct budget *budget) ret = dvbdemux->dmx.add_frontend(&dvbdemux->dmx, &budget->hw_frontend); if (ret < 0) - return ret; + goto err_release_dmx; budget->mem_frontend.source = DMX_MEMORY_FE; ret = dvbdemux->dmx.add_frontend(&dvbdemux->dmx, &budget->mem_frontend); if (ret < 0) - return ret; + goto err_release_dmx; ret = dvbdemux->dmx.connect_frontend(&dvbdemux->dmx, &budget->hw_frontend); if (ret < 0) - return ret; + goto err_release_dmx; dvb_net_init(&budget->dvb_adapter, &budget->dvb_net, &dvbdemux->dmx); return 0; + +err_release_dmx: + dvb_dmxdev_release(&budget->dmxdev); + dvb_dmx_release(&budget->demux); + return ret; } static void budget_unregister(struct budget *budget) diff --git a/drivers/media/platform/davinci/vpss.c b/drivers/media/platform/davinci/vpss.c index 2ee4cd9e6d80..d984f45c0314 100644 --- a/drivers/media/platform/davinci/vpss.c +++ b/drivers/media/platform/davinci/vpss.c @@ -514,19 +514,31 @@ static void vpss_exit(void) static int __init vpss_init(void) { + int ret; + if (!request_mem_region(VPSS_CLK_CTRL, 4, "vpss_clock_control")) return -EBUSY; oper_cfg.vpss_regs_base2 = ioremap(VPSS_CLK_CTRL, 4); if (unlikely(!oper_cfg.vpss_regs_base2)) { - release_mem_region(VPSS_CLK_CTRL, 4); - return -ENOMEM; + ret = -ENOMEM; + goto err_ioremap; } writel(VPSS_CLK_CTRL_VENCCLKEN | - VPSS_CLK_CTRL_DACCLKEN, oper_cfg.vpss_regs_base2); + VPSS_CLK_CTRL_DACCLKEN, oper_cfg.vpss_regs_base2); - return platform_driver_register(&vpss_driver); + ret = platform_driver_register(&vpss_driver); + if (ret) + goto err_pd_register; + + return 0; + +err_pd_register: + iounmap(oper_cfg.vpss_regs_base2); +err_ioremap: + release_mem_region(VPSS_CLK_CTRL, 4); + return ret; } subsys_initcall(vpss_init); module_exit(vpss_exit); diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 90e1df5b7dab..77edff28cada 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2010,7 +2010,8 @@ static int bond_release_and_destroy(struct net_device *bond_dev, int ret; ret = __bond_release_one(bond_dev, slave_dev, false, true); - if (ret == 0 && !bond_has_slaves(bond)) { + if (ret == 0 && !bond_has_slaves(bond) && + bond_dev->reg_state != NETREG_UNREGISTERING) { bond_dev->priv_flags |= IFF_DISABLE_NETPOLL; netdev_info(bond_dev, "Destroying bond %s\n", bond_dev->name); @@ -2752,6 +2753,9 @@ static int bond_ab_arp_inspect(struct bonding *bond) if (bond_time_in_interval(bond, last_rx, 1)) { bond_propose_link_state(slave, BOND_LINK_UP); commit++; + } else if (slave->link == BOND_LINK_BACK) { + bond_propose_link_state(slave, BOND_LINK_FAIL); + commit++; } continue; } @@ -2862,6 +2866,19 @@ static void bond_ab_arp_commit(struct bonding *bond) continue; + case BOND_LINK_FAIL: + bond_set_slave_link_state(slave, BOND_LINK_FAIL, + BOND_SLAVE_NOTIFY_NOW); + bond_set_slave_inactive_flags(slave, + BOND_SLAVE_NOTIFY_NOW); + + /* A slave has just been enslaved and has become + * the current active slave. + */ + if (rtnl_dereference(bond->curr_active_slave)) + RCU_INIT_POINTER(bond->current_arp_slave, NULL); + continue; + default: netdev_err(bond->dev, "impossible: new_link %d on slave %s\n", slave->link_new_state, slave->dev->name); @@ -2911,8 +2928,6 @@ static bool bond_ab_arp_probe(struct bonding *bond) return should_notify_rtnl; } - bond_set_slave_inactive_flags(curr_arp_slave, BOND_SLAVE_NOTIFY_LATER); - bond_for_each_slave_rcu(bond, slave, iter) { if (!found && !before && bond_slave_is_up(slave)) before = slave; @@ -4156,13 +4171,23 @@ static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev) return ret; } +static u32 bond_mode_bcast_speed(struct slave *slave, u32 speed) +{ + if (speed == 0 || speed == SPEED_UNKNOWN) + speed = slave->speed; + else + speed = min(speed, slave->speed); + + return speed; +} + static int bond_ethtool_get_link_ksettings(struct net_device *bond_dev, struct ethtool_link_ksettings *cmd) { struct bonding *bond = netdev_priv(bond_dev); - unsigned long speed = 0; struct list_head *iter; struct slave *slave; + u32 speed = 0; cmd->base.duplex = DUPLEX_UNKNOWN; cmd->base.port = PORT_OTHER; @@ -4174,8 +4199,13 @@ static int bond_ethtool_get_link_ksettings(struct net_device *bond_dev, */ bond_for_each_slave(bond, slave, iter) { if (bond_slave_can_tx(slave)) { - if (slave->speed != SPEED_UNKNOWN) - speed += slave->speed; + if (slave->speed != SPEED_UNKNOWN) { + if (BOND_MODE(bond) == BOND_MODE_BROADCAST) + speed = bond_mode_bcast_speed(slave, + speed); + else + speed += slave->speed; + } if (cmd->base.duplex == DUPLEX_UNKNOWN && slave->duplex != DUPLEX_UNKNOWN) cmd->base.duplex = slave->duplex; diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 4479bfc228cd..d2b0131d8653 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -1160,6 +1160,8 @@ static int b53_arl_op(struct b53_device *dev, int op, int port, return ret; switch (ret) { + case -ETIMEDOUT: + return ret; case -ENOSPC: dev_dbg(dev->dev, "{%pM,%.4d} no space left in ARL\n", addr, vid); diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 8ba915cc4c2e..22f964ef859e 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -3536,11 +3536,11 @@ failed_mii_init: failed_irq: failed_init: fec_ptp_stop(pdev); - if (fep->reg_phy) - regulator_disable(fep->reg_phy); failed_reset: pm_runtime_put_noidle(&pdev->dev); pm_runtime_disable(&pdev->dev); + if (fep->reg_phy) + regulator_disable(fep->reg_phy); failed_regulator: clk_disable_unprepare(fep->clk_ahb); failed_clk_ahb: diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h index 5d5f422cbae5..f82da2b47d9a 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h @@ -1175,7 +1175,7 @@ struct i40e_aqc_set_vsi_promiscuous_modes { #define I40E_AQC_SET_VSI_PROMISC_BROADCAST 0x04 #define I40E_AQC_SET_VSI_DEFAULT 0x08 #define I40E_AQC_SET_VSI_PROMISC_VLAN 0x10 -#define I40E_AQC_SET_VSI_PROMISC_TX 0x8000 +#define I40E_AQC_SET_VSI_PROMISC_RX_ONLY 0x8000 __le16 seid; #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF __le16 vlan_tag; diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c index 111426ba5fbc..3fd2dfaf2bd5 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_common.c +++ b/drivers/net/ethernet/intel/i40e/i40e_common.c @@ -1914,6 +1914,21 @@ i40e_status i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags, return status; } +/** + * i40e_is_aq_api_ver_ge + * @aq: pointer to AdminQ info containing HW API version to compare + * @maj: API major value + * @min: API minor value + * + * Assert whether current HW API version is greater/equal than provided. + **/ +static bool i40e_is_aq_api_ver_ge(struct i40e_adminq_info *aq, u16 maj, + u16 min) +{ + return (aq->api_maj_ver > maj || + (aq->api_maj_ver == maj && aq->api_min_ver >= min)); +} + /** * i40e_aq_add_vsi * @hw: pointer to the hw struct @@ -2039,18 +2054,16 @@ i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, if (set) { flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; - if (rx_only_promisc && - (((hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver >= 5)) || - (hw->aq.api_maj_ver > 1))) - flags |= I40E_AQC_SET_VSI_PROMISC_TX; + if (rx_only_promisc && i40e_is_aq_api_ver_ge(&hw->aq, 1, 5)) + flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY; } cmd->promiscuous_flags = cpu_to_le16(flags); cmd->valid_flags = cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_UNICAST); - if (((hw->aq.api_maj_ver >= 1) && (hw->aq.api_min_ver >= 5)) || - (hw->aq.api_maj_ver > 1)) - cmd->valid_flags |= cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_TX); + if (i40e_is_aq_api_ver_ge(&hw->aq, 1, 5)) + cmd->valid_flags |= + cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY); cmd->seid = cpu_to_le16(seid); status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); @@ -2147,11 +2160,17 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw, i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_set_vsi_promiscuous_modes); - if (enable) + if (enable) { flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; + if (i40e_is_aq_api_ver_ge(&hw->aq, 1, 5)) + flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY; + } cmd->promiscuous_flags = cpu_to_le16(flags); cmd->valid_flags = cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_UNICAST); + if (i40e_is_aq_api_ver_ge(&hw->aq, 1, 5)) + cmd->valid_flags |= + cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY); cmd->seid = cpu_to_le16(seid); cmd->vlan_tag = cpu_to_le16(vid | I40E_AQC_SET_VSI_VLAN_VALID); diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index aa2b446d6ad0..f4475cbf8ce8 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -11822,6 +11822,9 @@ static void i40e_remove(struct pci_dev *pdev) i40e_write_rx_ctl(hw, I40E_PFQF_HENA(0), 0); i40e_write_rx_ctl(hw, I40E_PFQF_HENA(1), 0); + while (test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state)) + usleep_range(1000, 2000); + /* no more scheduling of any task */ set_bit(__I40E_SUSPENDED, pf->state); set_bit(__I40E_DOWN, pf->state); diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 10c3480c2da8..dbc6c9ed1c8f 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -500,7 +500,7 @@ static int netvsc_vf_xmit(struct net_device *net, struct net_device *vf_netdev, int rc; skb->dev = vf_netdev; - skb->queue_mapping = qdisc_skb_cb(skb)->slave_dev_queue_mapping; + skb_record_rx_queue(skb, qdisc_skb_cb(skb)->slave_dev_queue_mapping); rc = dev_queue_xmit(skb); if (likely(rc == NET_XMIT_SUCCESS || rc == NET_XMIT_CN)) { diff --git a/drivers/rtc/rtc-goldfish.c b/drivers/rtc/rtc-goldfish.c index a1c44d0c8557..30cbe22c57a8 100644 --- a/drivers/rtc/rtc-goldfish.c +++ b/drivers/rtc/rtc-goldfish.c @@ -87,6 +87,7 @@ static int goldfish_rtc_set_alarm(struct device *dev, rtc_alarm64 = rtc_alarm * NSEC_PER_SEC; writel((rtc_alarm64 >> 32), base + TIMER_ALARM_HIGH); writel(rtc_alarm64, base + TIMER_ALARM_LOW); + writel(1, base + TIMER_IRQ_ENABLED); } else { /* * if this function was called with enabled=0 diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c index 28b50ab2fbb0..62f83cc151b2 100644 --- a/drivers/scsi/libfc/fc_disc.c +++ b/drivers/scsi/libfc/fc_disc.c @@ -605,8 +605,12 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp, if (PTR_ERR(fp) == -FC_EX_CLOSED) goto out; - if (IS_ERR(fp)) - goto redisc; + if (IS_ERR(fp)) { + mutex_lock(&disc->disc_mutex); + fc_disc_restart(disc); + mutex_unlock(&disc->disc_mutex); + goto out; + } cp = fc_frame_payload_get(fp, sizeof(*cp)); if (!cp) @@ -633,7 +637,7 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp, new_rdata->disc_id = disc->disc_id; fc_rport_login(new_rdata); } - goto out; + goto free_fp; } rdata->disc_id = disc->disc_id; mutex_unlock(&rdata->rp_mutex); @@ -650,6 +654,8 @@ redisc: fc_disc_restart(disc); mutex_unlock(&disc->disc_mutex); } +free_fp: + fc_frame_free(fp); out: kref_put(&rdata->kref, fc_rport_destroy); if (!IS_ERR(fp)) diff --git a/drivers/scsi/ufs/ufs_quirks.h b/drivers/scsi/ufs/ufs_quirks.h index 05624728f11c..90ec67231a8b 100644 --- a/drivers/scsi/ufs/ufs_quirks.h +++ b/drivers/scsi/ufs/ufs_quirks.h @@ -21,6 +21,7 @@ #define UFS_ANY_VENDOR 0xFFFF #define UFS_ANY_MODEL "ANY_MODEL" +#define UFS_VENDOR_MICRON 0x12C #define UFS_VENDOR_TOSHIBA 0x198 #define UFS_VENDOR_SAMSUNG 0x1CE #define UFS_VENDOR_SKHYNIX 0x1AD diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index d57e3e61325a..a1999808ddf4 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -405,6 +405,8 @@ static inline bool ufshcd_is_valid_pm_lvl(int lvl) static struct ufs_dev_fix ufs_fixups[] = { /* UFS cards deviations table */ + UFS_FIX(UFS_VENDOR_MICRON, UFS_ANY_MODEL, + UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM), UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL, UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM), UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL, diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index bc5684aab0a5..a1990213f5bf 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -839,4 +839,7 @@ config SPI_SLAVE_SYSTEM_CONTROL endif # SPI_SLAVE +config SPI_DYNAMIC + def_bool ACPI || OF_DYNAMIC || SPI_SLAVE + endif # SPI diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 237099464fec..6c5279b43e8e 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -428,6 +428,12 @@ static LIST_HEAD(spi_controller_list); */ static DEFINE_MUTEX(board_lock); +/* + * Prevents addition of devices with same chip select and + * addition of devices below an unregistering controller. + */ +static DEFINE_MUTEX(spi_add_lock); + /** * spi_alloc_device - Allocate a new SPI device * @ctlr: Controller to which device is connected @@ -506,7 +512,6 @@ static int spi_dev_check(struct device *dev, void *data) */ int spi_add_device(struct spi_device *spi) { - static DEFINE_MUTEX(spi_add_lock); struct spi_controller *ctlr = spi->controller; struct device *dev = ctlr->dev.parent; int status; @@ -534,6 +539,13 @@ int spi_add_device(struct spi_device *spi) goto done; } + /* Controller may unregister concurrently */ + if (IS_ENABLED(CONFIG_SPI_DYNAMIC) && + !device_is_registered(&ctlr->dev)) { + status = -ENODEV; + goto done; + } + if (ctlr->cs_gpios) spi->cs_gpio = ctlr->cs_gpios[spi->chip_select]; @@ -2265,6 +2277,10 @@ void spi_unregister_controller(struct spi_controller *ctlr) struct spi_controller *found; int id = ctlr->bus_num; + /* Prevent addition of new devices, unregister existing ones */ + if (IS_ENABLED(CONFIG_SPI_DYNAMIC)) + mutex_lock(&spi_add_lock); + device_for_each_child(&ctlr->dev, NULL, __unregister); /* First make sure that this controller was ever added */ @@ -2285,6 +2301,9 @@ void spi_unregister_controller(struct spi_controller *ctlr) if (found == ctlr) idr_remove(&spi_master_idr, id); mutex_unlock(&board_lock); + + if (IS_ENABLED(CONFIG_SPI_DYNAMIC)) + mutex_unlock(&spi_add_lock); } EXPORT_SYMBOL_GPL(spi_unregister_controller); diff --git a/drivers/staging/fw-api/fw/htt_ppdu_stats.h b/drivers/staging/fw-api/fw/htt_ppdu_stats.h index a9f25643a649..526fd692793a 100644 --- a/drivers/staging/fw-api/fw/htt_ppdu_stats.h +++ b/drivers/staging/fw-api/fw/htt_ppdu_stats.h @@ -1745,6 +1745,19 @@ typedef enum HTT_PPDU_STATS_RESP_TYPE HTT_PPDU_STATS_RESP_TYPE; ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_FAILURE_S)); \ } while (0) +#define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_M 0x00040000 +#define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_S 18 + +#define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_GET(_var) \ + (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_M) >> \ + HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_S) + +#define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_SET (_var , _val) \ + do { \ + HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX, _val); \ + ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_S)); \ + } while (0) + #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI_M 0xffffffff #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI_S 0 @@ -1868,11 +1881,15 @@ typedef struct { * BIT [ 15: 13] :- medium protection type * BIT [ 16: 16] :- rts_success * BIT [ 17: 17] :- rts_failure - * BIT [ 31: 18] :- reserved + * BIT [ 18: 18] :- pream_punc_tx + * BIT [ 31: 19] :- reserved */ union { - A_UINT32 resp_type_is_ampdu__short_retry__long_retry; /* older name */ - A_UINT32 resp_type__is_ampdu__short_retry__long_retry__mprot_type__rts_success__rts_failure; /* newer name */ + /* older names */ + A_UINT32 resp_type_is_ampdu__short_retry__long_retry; + A_UINT32 resp_type__is_ampdu__short_retry__long_retry__mprot_type__rts_success__rts_failure; + /* newest name */ + A_UINT32 resp_type__is_ampdu__short_retry__long_retry__mprot_type__rts_success__rts_failure__pream_punc_tx; struct { /* bitfield names */ A_UINT32 long_retries: 4, short_retries: 4, @@ -1881,7 +1898,8 @@ typedef struct { mprot_type: 3, rts_success: 1, rts_failure: 1, - reserved0: 14; + pream_punc_tx: 1, + reserved0: 13; }; }; diff --git a/drivers/staging/fw-api/fw/wmi_services.h b/drivers/staging/fw-api/fw/wmi_services.h index 9b6d51c7f688..7309c6317077 100644 --- a/drivers/staging/fw-api/fw/wmi_services.h +++ b/drivers/staging/fw-api/fw/wmi_services.h @@ -475,6 +475,8 @@ typedef enum { WMI_SERVICE_CFR_CAPTURE_COUNT_SUPPORT = 256, /* indicates FW support to program CFR capture mode and capture count */ WMI_SERVICE_OCV_SUPPORT = 257, /* FW supports OCV (Operating Channel Validation) */ + WMI_SERVICE_LL_STATS_PER_CHAN_RX_TX_TIME_SUPPORT = 258, /* Indicates firmware support sending per channel own tx & rx time in radio stats of LL stats. */ + WMI_SERVICE_THERMAL_MULTI_CLIENT_SUPPORT = 259, /* Indicates FW Thermal Mgr will support multiple clients for mitigation */ WMI_MAX_EXT2_SERVICE diff --git a/drivers/staging/fw-api/fw/wmi_tlv_defs.h b/drivers/staging/fw-api/fw/wmi_tlv_defs.h index 1a8ea2273fa0..8553675e166b 100644 --- a/drivers/staging/fw-api/fw/wmi_tlv_defs.h +++ b/drivers/staging/fw-api/fw/wmi_tlv_defs.h @@ -1100,6 +1100,7 @@ typedef enum { WMITLV_TAG_STRUC_wmi_configure_roam_trigger_parameters, WMITLV_TAG_STRUC_wmi_vdev_extd_stats, WMITLV_TAG_STRUC_wmi_twt_add_dialog_additional_params, + WMITLV_TAG_STRUC_WMI_SCAN_RADIO_CAPABILITIES_EXT2, } WMITLV_TAG_ID; /* @@ -4517,7 +4518,8 @@ WMITLV_CREATE_PARAM_STRUC(WMI_SERVICE_READY_EXT_EVENTID); WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_spectral_bin_scaling_params, wmi_bin_scaling_params, WMITLV_SIZE_VAR) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, WMI_MAC_PHY_CAPABILITIES_EXT, mac_phy_caps, WMITLV_SIZE_VAR) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, WMI_HAL_REG_CAPABILITIES_EXT2, hal_reg_caps, WMITLV_SIZE_VAR) \ - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_nan_capabilities, wmi_nan_capabilities, nan_cap, WMITLV_SIZE_FIX) + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_nan_capabilities, wmi_nan_capabilities, nan_cap, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, WMI_SCAN_RADIO_CAPABILITIES_EXT2, wmi_scan_radio_caps, WMITLV_SIZE_VAR) WMITLV_CREATE_PARAM_STRUC(WMI_SERVICE_READY_EXT2_EVENTID); #define WMITLV_TABLE_WMI_CHAN_RF_CHARACTERIZATION_INFO_EVENTID(id,op,buf,len) \ diff --git a/drivers/staging/fw-api/fw/wmi_unified.h b/drivers/staging/fw-api/fw/wmi_unified.h index 6bb8e967e5aa..8040c0ca73bc 100644 --- a/drivers/staging/fw-api/fw/wmi_unified.h +++ b/drivers/staging/fw-api/fw/wmi_unified.h @@ -6861,6 +6861,9 @@ typedef enum { */ WMI_PDEV_PARAM_SR_TRIGGER_MARGIN, + /* Param to enable/disable PCIE HW ILP */ + WMI_PDEV_PARAM_PCIE_HW_ILP, + } WMI_PDEV_PARAM; #define WMI_PDEV_ONLY_BSR_TRIG_IS_ENABLED(trig_type) WMI_GET_BITS(trig_type, 0, 1) @@ -8060,6 +8063,12 @@ typedef struct { A_UINT32 tx_time; /** msecs the radio is in active receive (32 bits number accruing over time) */ A_UINT32 rx_time; + /*** NOTE *** + * Be cautious about adding new fields in wmi_channel_stats. + * STA-centric targets may instantiate many instances of per-channel + * stats, and consequently may consume a non-trivial amount of on-chip + * memory for storing the channel stats. + */ } wmi_channel_stats; /* @@ -9515,6 +9524,11 @@ typedef struct { * VDEV_FLAGS_NON_TRANSMIT_AP classify it as either Tx vap * or non Tx vap. */ +#define VDEV_FLAGS_SCAN_MODE_VAP 0x00000010 /* for Scan Radio vdev will be special vap. + * There will not be WMI_VDEV_UP_CMD, there will be only WMI_VDEV_CREATE_CMD + * and WMI_VDEV_START_REQUEST_CMD. Based on this parameter need to make decision like + * vdev Pause/Unpause at WMI_VDEV_START_REQUEST_CMD. + */ typedef struct { A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_vdev_create_cmd_fixed_param */ @@ -11774,6 +11788,10 @@ typedef struct { A_UINT32 frame_inject_period; /** Destination address of frame */ wmi_mac_addr frame_addr1; + /** Frame control duration field to be set in CTS_TO_SELF. + * Applicable to frame_type WMI_FRAME_INJECT_TYPE_CTS_TO_SELF only. + */ + A_UINT32 fc_duration; /** variable buffer length. Can be used for frame template. * data is in TLV data[] */ @@ -25913,6 +25931,38 @@ typedef struct { A_UINT32 wireless_modes_ext; } WMI_HAL_REG_CAPABILITIES_EXT2; +/* + * This TLV used for Scan Radio RDP + * We have an RDP which supports Multiband-Frequency (2Ghz, 5Ghz and 6Ghz) + * on a single radio. + * The AP acts as a special VAP. There will not be WMI_VDEV_UP_CMD. + * This radio is used only for scanning purpose and to send few MGMT frames. + * The DFS feature is disabled on this scan radio, since there will not be + * much TX traffic. + * The Host has to disable CAC timer because DFS feature not supported here. + * In order to know about the scan radio RDP and DFS disabled case, + * the target has to send this information to Host per pdev via + * WMI_SERVICE_READY_EXT2_EVENT. + * The target is notified of the special scan VAP by the flags variable + * in the WMI_CREATE_CMD. + */ +typedef struct { + A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_WMI_SCAN_RADIO_CAPABILITIES_EXT2 */ + A_UINT32 phy_id; + /* + * [0] 1 - SCAN_RADIO supported 0 - SCAN_RADIO not supported + * [1] 1 - DFS enabled 0 - DFS disabled + * [2:31] reserved + */ + A_UINT32 flags; +} WMI_SCAN_RADIO_CAPABILITIES_EXT2; + +#define WMI_SCAN_RADIO_CAP_SCAN_RADIO_FLAG_GET(flag) WMI_GET_BITS(flag, 0, 1) +#define WMI_SCAN_RADIO_CAP_SCAN_RADIO_FLAG_SET(flag, val) WMI_SET_BITS(flag, 0, 1, val) + +#define WMI_SCAN_RADIO_CAP_DFS_FLAG_GET(flag) WMI_GET_BITS(flag, 1, 1) +#define WMI_SCAN_RADIO_CAP_DFS_FLAG_SET(flag, val) WMI_SET_BITS(flag, 1, 1, val) + typedef struct { A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_WMI_SOC_HAL_REG_CAPABILITIES */ A_UINT32 num_phy; @@ -26035,6 +26085,16 @@ typedef struct { A_UINT32 prio; } wmi_therm_throt_level_config_info; +typedef enum { + WMI_THERMAL_CLIENT_UNSPECIFIED = 0, + WMI_THERMAL_CLIENT_APPS = 1, + WMI_THERMAL_CLIENT_WPSS = 2, + WMI_THERMAL_CLIENT_FW = 3, + WMI_THERMAL_CLIENT_MAX +} WMI_THERMAL_MITIGATION_CLIENTS; + +#define WMI_THERMAL_CLIENT_MAX_PRIORITY 10 + typedef struct { A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_therm_throt_config_request_fixed_param */ A_UINT32 pdev_id; /* config for each pdev */ @@ -26042,6 +26102,8 @@ typedef struct { A_UINT32 dc; /* duty cycle in ms */ A_UINT32 dc_per_event; /* how often (after how many duty cycles) the FW sends stats to host */ A_UINT32 therm_throt_levels; /* Indicates the number of thermal zone configuration */ + A_UINT32 client_id; /* Indicates the client from whom the request is being forwarded to FW. Refer to WMI_THERMAL_MITIGATION_CLIENTS. */ + A_UINT32 priority; /* Indicates the priority, higher the value, higher the priority. Varies from 1 to WMI_THERMAL_CLIENT_MAX_PRIORITY. */ /* * Following this structure is the TLV: * struct wmi_therm_throt_level_config_info therm_throt_level_config_info[therm_throt_levels]; diff --git a/drivers/staging/fw-api/fw/wmi_version.h b/drivers/staging/fw-api/fw/wmi_version.h index 1c9ece2f85a5..b5a0a98e4a13 100644 --- a/drivers/staging/fw-api/fw/wmi_version.h +++ b/drivers/staging/fw-api/fw/wmi_version.h @@ -36,7 +36,7 @@ #define __WMI_VER_MINOR_ 0 /** WMI revision number has to be incremented when there is a * change that may or may not break compatibility. */ -#define __WMI_REVISION_ 872 +#define __WMI_REVISION_ 878 /** The Version Namespace should not be normally changed. Only * host and firmware of the same WMI namespace will work diff --git a/drivers/staging/qca-wifi-host-cmn/qdf/linux/src/i_qdf_event.h b/drivers/staging/qca-wifi-host-cmn/qdf/linux/src/i_qdf_event.h index 41726f934dc1..5d26c7d9a36a 100644 --- a/drivers/staging/qca-wifi-host-cmn/qdf/linux/src/i_qdf_event.h +++ b/drivers/staging/qca-wifi-host-cmn/qdf/linux/src/i_qdf_event.h @@ -30,11 +30,13 @@ * qdf_event_t - manages events * @complete: instance to completion * @cookie: unsigned int + * @done: indicate completion * @force_set: indicate forceful completion */ typedef struct qdf_evt { struct completion complete; uint32_t cookie; + bool done; bool force_set; } __qdf_event_t; diff --git a/drivers/staging/qca-wifi-host-cmn/qdf/linux/src/qdf_event.c b/drivers/staging/qca-wifi-host-cmn/qdf/linux/src/qdf_event.c index a4494b36a5db..025f2e43378b 100644 --- a/drivers/staging/qca-wifi-host-cmn/qdf/linux/src/qdf_event.c +++ b/drivers/staging/qca-wifi-host-cmn/qdf/linux/src/qdf_event.c @@ -100,6 +100,7 @@ QDF_STATUS qdf_event_set(qdf_event_t *event) if (event->cookie != LINUX_EVENT_COOKIE) return QDF_STATUS_E_INVAL; + event->done = true; complete(&event->complete); return QDF_STATUS_SUCCESS; @@ -133,6 +134,7 @@ QDF_STATUS qdf_event_reset(qdf_event_t *event) return QDF_STATUS_E_INVAL; /* (re)initialize event */ + event->done = false; event->force_set = false; INIT_COMPLETION(event->complete); @@ -252,8 +254,10 @@ void qdf_complete_wait_events(void) event_node = qdf_container_of(list_node, struct qdf_evt_node, node); - event_node->pevent->force_set = true; - qdf_event_set(event_node->pevent); + if (!event_node->pevent->done) { + event_node->pevent->force_set = true; + qdf_event_set(event_node->pevent); + } status = qdf_list_peek_next(&qdf_wait_event_list, &event_node->node, &list_node); diff --git a/drivers/staging/qca-wifi-host-cmn/umac/dfs/core/src/misc/dfs_nol.c b/drivers/staging/qca-wifi-host-cmn/umac/dfs/core/src/misc/dfs_nol.c index 3db800552121..3be3d6877646 100644 --- a/drivers/staging/qca-wifi-host-cmn/umac/dfs/core/src/misc/dfs_nol.c +++ b/drivers/staging/qca-wifi-host-cmn/umac/dfs/core/src/misc/dfs_nol.c @@ -116,20 +116,24 @@ static os_timer_func(dfs_nol_timeout) static void dfs_nol_elem_free_work_cb(void *context) { struct wlan_dfs *dfs = (struct wlan_dfs *)context; - struct dfs_nolelem *tmp_nol_entry, *nol_entry; + struct dfs_nolelem *nol_head; - WLAN_DFSNOL_LOCK(dfs); - if (!TAILQ_EMPTY(&dfs->dfs_nol_free_list)) - TAILQ_FOREACH_SAFE(nol_entry, - &dfs->dfs_nol_free_list, - nolelem_list, - tmp_nol_entry) { - TAILQ_REMOVE(&dfs->dfs_nol_free_list, - nol_entry, nolelem_list); - qdf_timer_free(&nol_entry->nol_timer); - qdf_mem_free(nol_entry); + while (true) { + WLAN_DFSNOL_LOCK(dfs); + + nol_head = TAILQ_FIRST(&dfs->dfs_nol_free_list); + if (nol_head) { + TAILQ_REMOVE(&dfs->dfs_nol_free_list, nol_head, + nolelem_list); + WLAN_DFSNOL_UNLOCK(dfs); + + qdf_timer_free(&nol_head->nol_timer); + qdf_mem_free(nol_head); + } else { + WLAN_DFSNOL_UNLOCK(dfs); + break; } - WLAN_DFSNOL_UNLOCK(dfs); + } } void dfs_nol_timer_init(struct wlan_dfs *dfs) @@ -542,23 +546,22 @@ void dfs_nol_timer_cleanup(struct wlan_dfs *dfs) { struct dfs_nolelem *nol; - WLAN_DFSNOL_LOCK(dfs); - nol = dfs->dfs_nol; - while (nol) { - dfs->dfs_nol = nol->nol_next; - dfs->dfs_nol_count--; - /* - * Unlock is required so that when we sync with the - * nol_timeout timer we do not run into deadlock. - */ - WLAN_DFSNOL_UNLOCK(dfs); - qdf_timer_free(&nol->nol_timer); + while (true) { WLAN_DFSNOL_LOCK(dfs); - qdf_mem_free(nol); nol = dfs->dfs_nol; + if (nol) { + dfs->dfs_nol = nol->nol_next; + dfs->dfs_nol_count--; + WLAN_DFSNOL_UNLOCK(dfs); + + qdf_timer_free(&nol->nol_timer); + qdf_mem_free(nol); + } else { + WLAN_DFSNOL_UNLOCK(dfs); + break; + } } - WLAN_DFSNOL_UNLOCK(dfs); } void dfs_nol_workqueue_cleanup(struct wlan_dfs *dfs) diff --git a/drivers/staging/qca-wifi-host-cmn/wmi/src/wmi_unified_tlv.c b/drivers/staging/qca-wifi-host-cmn/wmi/src/wmi_unified_tlv.c index 410fa1cea5cb..6756bab99b64 100644 --- a/drivers/staging/qca-wifi-host-cmn/wmi/src/wmi_unified_tlv.c +++ b/drivers/staging/qca-wifi-host-cmn/wmi/src/wmi_unified_tlv.c @@ -23962,7 +23962,12 @@ extract_roam_scan_ap_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf, uint8_t i; param_buf = (WMI_ROAM_STATS_EVENTID_param_tlvs *)evt_buf; - if (!param_buf || ap_idx >= param_buf->num_roam_ap_info) { + if (!param_buf) { + WMI_LOGE("%s Param buf is NULL", __func__); + return QDF_STATUS_E_FAILURE; + } + + if (ap_idx >= param_buf->num_roam_ap_info) { WMI_LOGE("Invalid roam scan AP tlv ap_idx:%d total_ap:%d", ap_idx, param_buf->num_roam_ap_info); return QDF_STATUS_E_FAILURE; diff --git a/drivers/staging/qcacld-3.0/Kbuild b/drivers/staging/qcacld-3.0/Kbuild index 340a2faa5a01..33d13253fe6a 100644 --- a/drivers/staging/qcacld-3.0/Kbuild +++ b/drivers/staging/qcacld-3.0/Kbuild @@ -1708,6 +1708,8 @@ cppflags-$(CONFIG_WLAN_HANG_EVENT) += -DWLAN_HANG_EVENT cppflags-$(CONFIG_WLAN_FEATURE_PERIODIC_STA_STATS) += -DWLAN_FEATURE_PERIODIC_STA_STATS +cppflags-$(CONFIG_RX_HASH_DEBUG) += -DRX_HASH_DEBUG + ifeq ($(CONFIG_CNSS), y) ifeq ($(CONFIG_CNSS_SDIO), y) cppflags-y += -DCONFIG_PLD_SDIO_CNSS diff --git a/drivers/staging/qcacld-3.0/configs/default_defconfig b/drivers/staging/qcacld-3.0/configs/default_defconfig index e6e4a3a15a4a..ef579f4b4ac9 100644 --- a/drivers/staging/qcacld-3.0/configs/default_defconfig +++ b/drivers/staging/qcacld-3.0/configs/default_defconfig @@ -611,7 +611,16 @@ ifeq ($(CONFIG_ARCH_MSM8996), y) CONFIG_CHANNEL_HOPPING_ALL_BANDS := y endif +ifneq ($(CONFIG_HIF_USB), y) CONFIG_WLAN_LOGGING_SOCK_SVC := n +endif + +ifneq ($(TARGET_BUILD_VARIANT),user) +CONFIG_DESC_DUP_DETECT_DEBUG := n +endif + +CONFIG_DP_TRACE := n +#Enable Beacon Reception Stats CONFIG_FEATURE_BECN_STATS := n #enable MPTA helper for QCS405 @@ -635,8 +644,6 @@ ifeq ($(CONFIG_ARCH_SDM660), y) CONFIG_WLAN_FEATURE_PKT_CAPTURE := y endif -CONFIG_WLAN_HANG_EVENT := n - #Flag to enable/disable kernel panic calls CONFIG_PANIC_ON_WLAN_QDF_BUG=y PANIC_ON_BUG := n @@ -646,3 +653,11 @@ ifeq ($(CONFIG_SLUB_DEBUG), y) PANIC_ON_BUG := y endif endif + +#Enable RX RING buffers debug +CONFIG_DEBUG_RX_RING_BUFFER := n + +#Enable Hash debug +CONFIG_RX_HASH_DEBUG := n + +CONFIG_WLAN_HANG_EVENT := n diff --git a/drivers/staging/qcacld-3.0/core/dp/htt/htt.c b/drivers/staging/qcacld-3.0/core/dp/htt/htt.c index ea95639d38ac..25e33babbb0f 100644 --- a/drivers/staging/qcacld-3.0/core/dp/htt/htt.c +++ b/drivers/staging/qcacld-3.0/core/dp/htt/htt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2011, 2014-2018, 2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -804,10 +804,15 @@ void htt_log_rx_ring_info(htt_pdev_handle pdev) "%s: Data Stall Detected with reason 4 (=FW_RX_REFILL_FAILED)." "src htt rx ring: space for %d elements, filled with %d buffers, buffers in the ring %d, refill debt %d", __func__, pdev->rx_ring.size, pdev->rx_ring.fill_level, - pdev->rx_ring.fill_cnt, + qdf_atomic_read(&pdev->rx_ring.fill_cnt), qdf_atomic_read(&pdev->rx_ring.refill_debt)); } +void htt_rx_refill_failure(htt_pdev_handle pdev) +{ + QDF_BUG(qdf_atomic_read(&pdev->rx_ring.refill_debt)); +} + #if HTT_DEBUG_LEVEL > 5 void htt_display(htt_pdev_handle pdev, int indent) { diff --git a/drivers/staging/qcacld-3.0/core/dp/htt/htt_internal.h b/drivers/staging/qcacld-3.0/core/dp/htt/htt_internal.h index aef0eacfb235..12a0c7185181 100644 --- a/drivers/staging/qcacld-3.0/core/dp/htt/htt_internal.h +++ b/drivers/staging/qcacld-3.0/core/dp/htt/htt_internal.h @@ -160,7 +160,11 @@ struct htt_host_rx_desc_base { * @posted: time-stamp when HTT message is recived * @recvd : 0x48545452584D5367 ('HTTRXMSG') */ +#ifdef CONFIG_SLUB_DEBUG_ON #define HTT_RX_RING_BUFF_DBG_LIST (8 * 1024) +#else +#define HTT_RX_RING_BUFF_DBG_LIST (4 * 1024) +#endif struct rx_buf_debug { qdf_dma_addr_t paddr; qdf_nbuf_t nbuf; @@ -1017,7 +1021,7 @@ static inline qdf_nbuf_t htt_rx_in_order_netbuf_pop(htt_pdev_handle pdev, qdf_dma_addr_t paddr) { HTT_ASSERT1(htt_rx_in_order_ring_elems(pdev) != 0); - pdev->rx_ring.fill_cnt--; + qdf_atomic_dec(&pdev->rx_ring.fill_cnt); paddr = htt_paddr_trim_to_37(paddr); return htt_rx_hash_list_lookup(pdev, paddr); } diff --git a/drivers/staging/qcacld-3.0/core/dp/htt/htt_rx.c b/drivers/staging/qcacld-3.0/core/dp/htt/htt_rx.c index 22291f0418b7..ae6d09631e79 100644 --- a/drivers/staging/qcacld-3.0/core/dp/htt/htt_rx.c +++ b/drivers/staging/qcacld-3.0/core/dp/htt/htt_rx.c @@ -739,7 +739,7 @@ moretofill: } pdev->rx_ring.buf.paddrs_ring[idx] = paddr_marked; - pdev->rx_ring.fill_cnt++; + qdf_atomic_inc(&pdev->rx_ring.fill_cnt); num--; idx++; @@ -1220,7 +1220,7 @@ static inline qdf_nbuf_t htt_rx_netbuf_pop(htt_pdev_handle pdev) idx++; idx &= pdev->rx_ring.size_mask; pdev->rx_ring.sw_rd_idx.msdu_payld = idx; - pdev->rx_ring.fill_cnt--; + qdf_atomic_dec(&pdev->rx_ring.fill_cnt); return msdu; } @@ -2505,7 +2505,8 @@ static void htt_rx_fill_ring_count(htt_pdev_handle pdev) { int num_to_fill; - num_to_fill = pdev->rx_ring.fill_level - pdev->rx_ring.fill_cnt; + num_to_fill = pdev->rx_ring.fill_level - + qdf_atomic_read(&pdev->rx_ring.fill_cnt); htt_rx_ring_fill_n(pdev, num_to_fill /* okay if <= 0 */); } #endif @@ -2992,7 +2993,7 @@ int htt_rx_attach(struct htt_pdev_t *pdev) htt_rx_ring_refill_retry, (void *)pdev, QDF_TIMER_TYPE_SW); - pdev->rx_ring.fill_cnt = 0; + qdf_atomic_init(&pdev->rx_ring.fill_cnt); pdev->rx_ring.pop_fail_cnt = 0; #ifdef DEBUG_DMA_DONE pdev->rx_ring.dbg_ring_idx = 0; diff --git a/drivers/staging/qcacld-3.0/core/dp/htt/htt_types.h b/drivers/staging/qcacld-3.0/core/dp/htt/htt_types.h index 6ccd02d8784f..8f61398f6668 100644 --- a/drivers/staging/qcacld-3.0/core/dp/htt/htt_types.h +++ b/drivers/staging/qcacld-3.0/core/dp/htt/htt_types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2011, 2014-2018, 2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -288,7 +288,8 @@ struct htt_pdev_t { uint32_t size_mask; /* size - 1, at least 16 bits long */ int fill_level; /* how many rx buffers to keep in the ring */ - int fill_cnt; /* # of rx buffers (full+empty) in the ring */ + /* # of rx buffers (full+empty) in the ring */ + qdf_atomic_t fill_cnt; int pop_fail_cnt; /* # of nebuf pop failures */ /* diff --git a/drivers/staging/qcacld-3.0/core/dp/ol/inc/ol_htt_api.h b/drivers/staging/qcacld-3.0/core/dp/ol/inc/ol_htt_api.h index afb04d2bb2f8..887847afabee 100644 --- a/drivers/staging/qcacld-3.0/core/dp/ol/inc/ol_htt_api.h +++ b/drivers/staging/qcacld-3.0/core/dp/ol/inc/ol_htt_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2011, 2014-2018, 2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -195,6 +195,14 @@ void htt_t2h_stats_print(uint8_t *stats_data, int concise); */ void htt_log_rx_ring_info(htt_pdev_handle pdev); +/** + * htt_rx_refill_failure() - During refill failure check if debt is zero + * @pdev: handle to the HTT instance + * + * Return: None + */ +void htt_rx_refill_failure(htt_pdev_handle pdev); + #ifndef HTT_DEBUG_LEVEL #if defined(DEBUG) #define HTT_DEBUG_LEVEL 10 diff --git a/drivers/staging/qcacld-3.0/core/dp/txrx/ol_txrx.c b/drivers/staging/qcacld-3.0/core/dp/txrx/ol_txrx.c index bc83a452b27e..60e647458cfc 100644 --- a/drivers/staging/qcacld-3.0/core/dp/txrx/ol_txrx.c +++ b/drivers/staging/qcacld-3.0/core/dp/txrx/ol_txrx.c @@ -6202,8 +6202,10 @@ static void ol_txrx_post_data_stall_event( data_stall_info->recovery_type = recovery_type; if (data_stall_info->data_stall_type == - DATA_STALL_LOG_FW_RX_REFILL_FAILED) + DATA_STALL_LOG_FW_RX_REFILL_FAILED) { htt_log_rx_ring_info(pdev->htt_pdev); + htt_rx_refill_failure(pdev->htt_pdev); + } sys_build_message_header(SYS_MSG_ID_DATA_STALL_MSG, &msg); /* Save callback and data */ diff --git a/drivers/staging/qcacld-3.0/core/mac/inc/qwlan_version.h b/drivers/staging/qcacld-3.0/core/mac/inc/qwlan_version.h index 0c905b94a313..b185a51433a7 100644 --- a/drivers/staging/qcacld-3.0/core/mac/inc/qwlan_version.h +++ b/drivers/staging/qcacld-3.0/core/mac/inc/qwlan_version.h @@ -32,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 2 #define QWLAN_VERSION_PATCH 03 -#define QWLAN_VERSION_EXTRA "X" -#define QWLAN_VERSION_BUILD 29 +#define QWLAN_VERSION_EXTRA "B" +#define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.2.03.29X" +#define QWLAN_VERSIONSTR "5.2.03.30B" #endif /* QWLAN_VERSION_H */ diff --git a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_assoc_utils.c b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_assoc_utils.c index 0a8b3deb4d30..6ac0ca371464 100644 --- a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_assoc_utils.c @@ -353,7 +353,8 @@ uint8_t lim_check_rx_rsn_ie_match(tpAniSirGlobal mac_ctx, bool *pmf_connection) { tDot11fIERSN *rsn_ie; - uint8_t i, j, match, only_non_ht_cipher = 1; + bool match = false; + uint8_t i, j, only_non_ht_cipher = 1; #ifdef WLAN_FEATURE_11W bool we_are_pmf_capable; bool we_require_pmf; @@ -380,7 +381,7 @@ uint8_t lim_check_rx_rsn_ie_match(tpAniSirGlobal mac_ctx, if (!qdf_mem_cmp(&rx_rsn_ie->akm_suite[0], &rsn_ie->akm_suite[i], sizeof(rsn_ie->akm_suite[i]))) { - match = 1; + match = true; break; } if (!match) { @@ -400,13 +401,13 @@ uint8_t lim_check_rx_rsn_ie_match(tpAniSirGlobal mac_ctx, * For each Pairwise cipher suite check whether we support * received pairwise */ - match = 0; + match = false; for (i = 0; i < rx_rsn_ie->pwise_cipher_suite_count; i++) { for (j = 0; j < rsn_ie->pwise_cipher_suite_count; j++) { if (!qdf_mem_cmp(&rx_rsn_ie->pwise_cipher_suites[i], &rsn_ie->pwise_cipher_suites[j], sizeof(rsn_ie->pwise_cipher_suites[j]))) { - match = 1; + match = true; break; } } @@ -488,7 +489,8 @@ lim_check_rx_wpa_ie_match(tpAniSirGlobal mac, tDot11fIEWPA rx_wpaie, tpPESession session_entry, uint8_t sta_is_ht) { tDot11fIEWPA *wpa_ie; - uint8_t i, j, match, only_non_ht_cipher = 1; + bool match = false; + uint8_t i, j, only_non_ht_cipher = 1; /* WPA IE should be received from PE */ wpa_ie = &session_entry->gStartBssWPAIe; @@ -504,7 +506,7 @@ lim_check_rx_wpa_ie_match(tpAniSirGlobal mac, tDot11fIEWPA rx_wpaie, if (!qdf_mem_cmp(&rx_wpaie.auth_suites[0], &wpa_ie->auth_suites[i], sizeof(wpa_ie->auth_suites[i]))) { - match = 1; + match = true; break; } if (!match) { @@ -524,12 +526,12 @@ lim_check_rx_wpa_ie_match(tpAniSirGlobal mac, tDot11fIEWPA rx_wpaie, * For each Pairwise cipher suite check whether we support * received pairwise */ - match = 0; + match = false; for (i = 0; i < rx_wpaie.unicast_cipher_count; i++) { for (j = 0; j < wpa_ie->unicast_cipher_count; j++) { if (!qdf_mem_cmp(rx_wpaie.unicast_ciphers[i], wpa_ie->unicast_ciphers[j], 4)) { - match = 1; + match = true; break; } } diff --git a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c index b5ca95daa2fb..b1d7034d1a1c 100644 --- a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c +++ b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c @@ -517,6 +517,14 @@ static void lim_handle_assoc_reject_status(tpAniSirGlobal mac_ctx, } #endif +static void clean_up_ft_sha384(tpSirAssocRsp assoc_rsp, bool sha384_akm) +{ + if (sha384_akm) { + qdf_mem_free(assoc_rsp->sha384_ft_subelem.gtk); + qdf_mem_free(assoc_rsp->sha384_ft_subelem.igtk); + } +} + /** * lim_process_assoc_rsp_frame() - Processes assoc response * @mac_ctx: Pointer to Global MAC structure @@ -550,6 +558,8 @@ lim_process_assoc_rsp_frame(tpAniSirGlobal mac_ctx, #endif tSirMacEdcaParamRecord mu_edca_set[MAX_NUM_AC]; int8_t rssi; + enum ani_akm_type auth_type; + bool sha384_akm; #ifdef WLAN_FEATURE_ROAM_OFFLOAD sme_sessionid = session_entry->smeSessionId; @@ -729,6 +739,9 @@ lim_process_assoc_rsp_frame(tpAniSirGlobal mac_ctx, lim_update_ese_tspec(mac_ctx, session_entry, assoc_rsp); #endif + auth_type = session_entry->connected_akm; + sha384_akm = lim_is_sha384_akm(auth_type); + if (assoc_rsp->capabilityInfo.ibss) { /* * Received Re/Association Response from peer @@ -737,6 +750,7 @@ lim_process_assoc_rsp_frame(tpAniSirGlobal mac_ctx, * failure timeout. */ pe_err("received Re/AssocRsp frame with IBSS capability"); + clean_up_ft_sha384(assoc_rsp, sha384_akm); qdf_mem_free(assoc_rsp); qdf_mem_free(beacon); return; @@ -744,6 +758,7 @@ lim_process_assoc_rsp_frame(tpAniSirGlobal mac_ctx, if (cfg_get_capability_info(mac_ctx, &caps, session_entry) != QDF_STATUS_SUCCESS) { + clean_up_ft_sha384(assoc_rsp, sha384_akm); qdf_mem_free(assoc_rsp); qdf_mem_free(beacon); pe_err("could not retrieve Capabilities"); @@ -837,6 +852,7 @@ lim_process_assoc_rsp_frame(tpAniSirGlobal mac_ctx, NULL) != QDF_STATUS_SUCCESS) { pe_err("Set link state to POSTASSOC failed"); qdf_mem_free(beacon); + clean_up_ft_sha384(assoc_rsp, sha384_akm); qdf_mem_free(assoc_rsp); return; } @@ -969,6 +985,7 @@ lim_process_assoc_rsp_frame(tpAniSirGlobal mac_ctx, assoc_cnf.protStatusCode = eSIR_SME_SUCCESS; lim_post_sme_message(mac_ctx, LIM_MLM_ASSOC_CNF, (uint32_t *) &assoc_cnf); + clean_up_ft_sha384(assoc_rsp, sha384_akm); qdf_mem_free(assoc_rsp); qdf_mem_free(beacon); return; @@ -1034,6 +1051,7 @@ lim_process_assoc_rsp_frame(tpAniSirGlobal mac_ctx, beacon, &session_entry->pLimJoinReq->bssDescription, true, session_entry)) { + clean_up_ft_sha384(assoc_rsp, sha384_akm); qdf_mem_free(assoc_rsp); qdf_mem_free(beacon); return; diff --git a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_deauth_frame.c b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_deauth_frame.c index 0ed23d8e16d0..146d2738a005 100644 --- a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_deauth_frame.c +++ b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_deauth_frame.c @@ -324,6 +324,7 @@ void lim_perform_deauth(tpAniSirGlobal mac_ctx, tpPESession pe_session, tLimMlmAssocCnf mlmAssocCnf; uint16_t aid; tpDphHashNode sta_ds; + tpSirAssocRsp assoc_rsp; sta_ds = dph_lookup_hash_entry(mac_ctx, addr, &aid, &pe_session->dph.dphHashTable); @@ -539,6 +540,10 @@ void lim_perform_deauth(tpAniSirGlobal mac_ctx, tpPESession pe_session, lim_delete_pre_auth_node(mac_ctx, addr); if (pe_session->limAssocResponseData) { + assoc_rsp = (tpSirAssocRsp) pe_session-> + limAssocResponseData; + qdf_mem_free(assoc_rsp->sha384_ft_subelem.gtk); + qdf_mem_free(assoc_rsp->sha384_ft_subelem.igtk); qdf_mem_free(pe_session->limAssocResponseData); pe_session->limAssocResponseData = NULL; } diff --git a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_disassoc_frame.c b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_disassoc_frame.c index 750dfd3d4ed9..a67ebabbac51 100644 --- a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_disassoc_frame.c +++ b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_disassoc_frame.c @@ -348,6 +348,7 @@ void lim_perform_disassoc(tpAniSirGlobal mac_ctx, int32_t frame_rssi, tLimMlmDisassocInd mlmDisassocInd; uint16_t aid; tpDphHashNode sta_ds; + tpSirAssocRsp assoc_rsp; sta_ds = dph_lookup_hash_entry(mac_ctx, addr, &aid, &pe_session->dph.dphHashTable); @@ -378,6 +379,10 @@ void lim_perform_disassoc(tpAniSirGlobal mac_ctx, int32_t frame_rssi, pe_debug("received Disassoc from AP while waiting for Reassoc Rsp"); if (pe_session->limAssocResponseData) { + assoc_rsp = (tpSirAssocRsp) pe_session-> + limAssocResponseData; + qdf_mem_free(assoc_rsp->sha384_ft_subelem.gtk); + qdf_mem_free(assoc_rsp->sha384_ft_subelem.igtk); qdf_mem_free(pe_session->limAssocResponseData); pe_session->limAssocResponseData = NULL; } diff --git a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_sme_req_messages.c index c5b6b165f8c9..9dfc25a29cad 100644 --- a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -3062,7 +3062,7 @@ void __lim_process_sme_assoc_cnf_new(tpAniSirGlobal mac_ctx, uint32_t msg_type, if (msg_buf == NULL) { pe_err("msg_buf is NULL"); - goto end; + return; } qdf_mem_copy(&assoc_cnf, msg_buf, sizeof(struct sSirSmeAssocCnf)); diff --git a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_reassoc_utils.c b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_reassoc_utils.c index 0cad0ea12694..bdc68d2e2c83 100644 --- a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_reassoc_utils.c +++ b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_reassoc_utils.c @@ -208,6 +208,8 @@ void lim_handle_del_bss_in_re_assoc_context(tpAniSirGlobal pMac, qdf_mem_free(beacon_struct); goto error; } + qdf_mem_free(assocRsp->sha384_ft_subelem.gtk); + qdf_mem_free(assocRsp->sha384_ft_subelem.igtk); qdf_mem_free(assocRsp); qdf_mem_free(beacon_struct); psessionEntry->limAssocResponseData = NULL; @@ -334,6 +336,8 @@ void lim_handle_add_bss_in_re_assoc_context(tpAniSirGlobal pMac, qdf_mem_free(pBeaconStruct); goto Error; } + qdf_mem_free(assocRsp->sha384_ft_subelem.gtk); + qdf_mem_free(assocRsp->sha384_ft_subelem.igtk); qdf_mem_free(assocRsp); psessionEntry->limAssocResponseData = NULL; qdf_mem_free(pBeaconStruct); diff --git a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_session.c b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_session.c index bca6f3666012..1efb25272729 100644 --- a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_session.c +++ b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_session.c @@ -797,6 +797,7 @@ void pe_delete_session(tpAniSirGlobal mac_ctx, tpPESession session) uint16_t i = 0; uint16_t n; TX_TIMER *timer_ptr; + tpSirAssocRsp assoc_rsp; if (!session || (session && !session->valid)) { pe_debug("session already deleted or not valid"); @@ -913,6 +914,9 @@ void pe_delete_session(tpAniSirGlobal mac_ctx, tpPESession session) session->parsedAssocReq = NULL; } if (NULL != session->limAssocResponseData) { + assoc_rsp = (tpSirAssocRsp) session->limAssocResponseData; + qdf_mem_free(assoc_rsp->sha384_ft_subelem.gtk); + qdf_mem_free(assoc_rsp->sha384_ft_subelem.igtk); qdf_mem_free(session->limAssocResponseData); session->limAssocResponseData = NULL; } diff --git a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_utils.c b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_utils.c index 65a0835e40ff..c7286516241d 100644 --- a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_utils.c +++ b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_utils.c @@ -6487,38 +6487,95 @@ end: } /** - * lim_send_ies_per_band() - gets ht and vht capability and send to firmware via - * wma + * is_dot11mode_support_ht_cap() - Check dot11mode supports HT capability + * @dot11mode: dot11mode + * + * This function checks whether dot11mode support HT capability or not + * + * Return: True, if supports. False otherwise + */ +static bool is_dot11mode_support_ht_cap(enum csr_cfgdot11mode dot11mode) +{ + if ((dot11mode == eCSR_CFG_DOT11_MODE_AUTO) || + (dot11mode == eCSR_CFG_DOT11_MODE_11N) || + (dot11mode == eCSR_CFG_DOT11_MODE_11AC) || + (dot11mode == eCSR_CFG_DOT11_MODE_11N_ONLY) || + (dot11mode == eCSR_CFG_DOT11_MODE_11AC_ONLY) || + (dot11mode == eCSR_CFG_DOT11_MODE_11AX) || + (dot11mode == eCSR_CFG_DOT11_MODE_11AX_ONLY)) { + return true; + } + + return false; +} + +/** + * is_dot11mode_support_vht_cap() - Check dot11mode supports VHT capability + * @dot11mode: dot11mode + * + * This function checks whether dot11mode support VHT capability or not + * + * Return: True, if supports. False otherwise + */ +static bool is_dot11mode_support_vht_cap(enum csr_cfgdot11mode dot11mode) +{ + if ((dot11mode == eCSR_CFG_DOT11_MODE_AUTO) || + (dot11mode == eCSR_CFG_DOT11_MODE_11AC) || + (dot11mode == eCSR_CFG_DOT11_MODE_11AC_ONLY) || + (dot11mode == eCSR_CFG_DOT11_MODE_11AX) || + (dot11mode == eCSR_CFG_DOT11_MODE_11AX_ONLY)) { + return true; + } + + return false; +} + +/** + * is_dot11mode_support_he_cap() - Check dot11mode supports HE capability + * @dot11mode: dot11mode + * + * This function checks whether dot11mode support HE capability or not + * + * Return: True, if supports. False otherwise + */ +static bool is_dot11mode_support_he_cap(enum csr_cfgdot11mode dot11mode) +{ + if ((dot11mode == eCSR_CFG_DOT11_MODE_AUTO) || + (dot11mode == eCSR_CFG_DOT11_MODE_11AX) || + (dot11mode == eCSR_CFG_DOT11_MODE_11AX_ONLY)) { + return true; + } + + return false; +} + +/** + * lim_send_ht_caps_ie() - gets HT capability and send to firmware via wma * @mac_ctx: global mac context * @session: pe session. This can be NULL. In that case self cap will be sent + * @device_mode: VDEV op mode * @vdev_id: vdev for which IE is targeted * - * This funciton gets ht and vht capability and send to firmware via wma + * This function gets HT capability and send to firmware via wma * - * Return: status of operation + * Return: QDF_STATUS */ -QDF_STATUS lim_send_ies_per_band(tpAniSirGlobal mac_ctx, - tpPESession session, - uint8_t vdev_id) +static QDF_STATUS lim_send_ht_caps_ie(tpAniSirGlobal mac_ctx, + tpPESession session, + enum QDF_OPMODE device_mode, + uint8_t vdev_id) { uint8_t ht_caps[DOT11F_IE_HTCAPS_MIN_LEN + 2] = {0}; - uint8_t vht_caps[DOT11F_IE_VHTCAPS_MAX_LEN + 2] = {0}; tHtCaps *p_ht_cap = (tHtCaps *)(&ht_caps[2]); - tSirMacVHTCapabilityInfo *p_vht_cap = - (tSirMacVHTCapabilityInfo *)(&vht_caps[2]); - QDF_STATUS status; + QDF_STATUS status_5g, status_2g; - /* - * Note: Do not use Dot11f VHT structure, since 1 byte present flag in - * it is causing weird padding errors. Instead use Sir Mac VHT struct - * to send IE to wma. - */ ht_caps[0] = DOT11F_EID_HTCAPS; ht_caps[1] = DOT11F_IE_HTCAPS_MIN_LEN; lim_set_ht_caps(mac_ctx, session, ht_caps, DOT11F_IE_HTCAPS_MIN_LEN + 2); /* Get LDPC and over write for 2G */ - p_ht_cap->advCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_6); + p_ht_cap->advCodingCap = lim_get_rx_ldpc(mac_ctx, + CHAN_ENUM_6); /* Get self cap for HT40 support in 2G */ if (mac_ctx->roam.configParam.channelBondingMode24GHz) { p_ht_cap->supportedChannelWidthSet = 1; @@ -6527,11 +6584,18 @@ QDF_STATUS lim_send_ies_per_band(tpAniSirGlobal mac_ctx, p_ht_cap->supportedChannelWidthSet = 0; p_ht_cap->shortGI40MHz = 0; } + lim_populate_mcs_set_ht_per_vdev(mac_ctx, p_ht_cap, vdev_id, NSS_CHAINS_BAND_2GHZ); + if (device_mode == QDF_NDI_MODE) { + p_ht_cap->txBF = 0; + p_ht_cap->implicitTxBF = 0; + p_ht_cap->explicitCSITxBF = 0; + } - lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_HTCAPS, - CDS_BAND_2GHZ, &ht_caps[2], DOT11F_IE_HTCAPS_MIN_LEN); + status_2g = lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_HTCAPS, + CDS_BAND_2GHZ, &ht_caps[2], + DOT11F_IE_HTCAPS_MIN_LEN); /* * Get LDPC and over write for 5G - using channel 64 because it * is available in all reg domains. @@ -6547,25 +6611,63 @@ QDF_STATUS lim_send_ies_per_band(tpAniSirGlobal mac_ctx, } lim_populate_mcs_set_ht_per_vdev(mac_ctx, p_ht_cap, vdev_id, NSS_CHAINS_BAND_5GHZ); + status_5g = lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_HTCAPS, + CDS_BAND_5GHZ, &ht_caps[2], + DOT11F_IE_HTCAPS_MIN_LEN); - lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_HTCAPS, - CDS_BAND_5GHZ, &ht_caps[2], DOT11F_IE_HTCAPS_MIN_LEN); + if (QDF_IS_STATUS_SUCCESS(status_2g) && + QDF_IS_STATUS_SUCCESS(status_5g)) + return QDF_STATUS_SUCCESS; + + return QDF_STATUS_E_FAILURE; +} + +/** + * lim_send_vht_caps_ie() - gets VHT capability and send to firmware via wma + * @mac_ctx: global mac context + * @session: pe session. This can be NULL. In that case self cap will be sent + * @device_mode: VDEV op mode + * @vdev_id: vdev for which IE is targeted + * + * This function gets VHT capability and send to firmware via wma + * + * Return: QDF_STATUS + */ +static QDF_STATUS lim_send_vht_caps_ie(tpAniSirGlobal mac_ctx, + tpPESession session, + enum QDF_OPMODE device_mode, + uint8_t vdev_id) +{ + uint8_t vht_caps[DOT11F_IE_VHTCAPS_MAX_LEN + 2] = {0}; + tSirMacVHTCapabilityInfo *p_vht_cap = + (tSirMacVHTCapabilityInfo *)(&vht_caps[2]); + QDF_STATUS status_5g, status_2g; vht_caps[0] = DOT11F_EID_VHTCAPS; vht_caps[1] = DOT11F_IE_VHTCAPS_MAX_LEN; lim_set_vht_caps(mac_ctx, session, vht_caps, - DOT11F_IE_VHTCAPS_MIN_LEN + 2); + DOT11F_IE_VHTCAPS_MIN_LEN + 2); /* * Get LDPC and over write for 5G - using channel 64 because it * is available in all reg domains. */ p_vht_cap->ldpcCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_64); - /* Self VHT channel width for 5G is already negotiated with FW */ - lim_populate_mcs_set_vht_per_vdev(mac_ctx, vht_caps, - vdev_id, NSS_CHAINS_BAND_5GHZ); + lim_populate_mcs_set_vht_per_vdev(mac_ctx, vht_caps, vdev_id, + NSS_CHAINS_BAND_5GHZ); - lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_VHTCAPS, - CDS_BAND_5GHZ, &vht_caps[2], DOT11F_IE_VHTCAPS_MIN_LEN); + if (device_mode == QDF_NDI_MODE) { + p_vht_cap->muBeamformeeCap = 0; + p_vht_cap->muBeamformerCap = 0; + p_vht_cap->suBeamformeeCap = 0; + p_vht_cap->suBeamFormerCap = 0; + } + /* + * Self VHT channel width for 5G is already negotiated + * with FW + */ + status_5g = lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_VHTCAPS, + CDS_BAND_5GHZ, &vht_caps[2], + DOT11F_IE_VHTCAPS_MIN_LEN); /* Get LDPC and over write for 2G */ p_vht_cap->ldpcCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_6); @@ -6573,15 +6675,76 @@ QDF_STATUS lim_send_ies_per_band(tpAniSirGlobal mac_ctx, p_vht_cap->supportedChannelWidthSet = 0; p_vht_cap->shortGI80MHz = 0; p_vht_cap->shortGI160and80plus80MHz = 0; - lim_populate_mcs_set_vht_per_vdev(mac_ctx, vht_caps, - vdev_id, NSS_CHAINS_BAND_2GHZ); + lim_populate_mcs_set_vht_per_vdev(mac_ctx, vht_caps, vdev_id, + NSS_CHAINS_BAND_2GHZ); + status_2g = lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_VHTCAPS, + CDS_BAND_2GHZ, &vht_caps[2], + DOT11F_IE_VHTCAPS_MIN_LEN); - lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_VHTCAPS, - CDS_BAND_2GHZ, &vht_caps[2], DOT11F_IE_VHTCAPS_MIN_LEN); + if (QDF_IS_STATUS_SUCCESS(status_2g) && + QDF_IS_STATUS_SUCCESS(status_5g)) + return QDF_STATUS_SUCCESS; - status = lim_send_he_caps_ie(mac_ctx, session, vdev_id); + return QDF_STATUS_E_FAILURE; +} - return status; +/** + * lim_send_ies_per_band() - gets ht and vht capability and send to firmware via + * wma + * @mac_ctx: global mac context + * @session: pe session. This can be NULL. In that case self cap will be sent + * @vdev_id: vdev for which IE is targeted + * + * This funciton gets ht and vht capability and send to firmware via wma + * + * Return: status of operation + */ +QDF_STATUS lim_send_ies_per_band(tpAniSirGlobal mac_ctx, + tpPESession session, + uint8_t vdev_id) +{ + struct wlan_objmgr_vdev *vdev; + enum QDF_OPMODE device_mode; + QDF_STATUS status_ht = QDF_STATUS_SUCCESS; + QDF_STATUS status_vht = QDF_STATUS_SUCCESS; + QDF_STATUS status_he = QDF_STATUS_SUCCESS; + + vdev = wlan_objmgr_get_vdev_by_id_from_psoc( + mac_ctx->psoc, vdev_id, + WLAN_LEGACY_MAC_ID); + if (!vdev) { + pe_err("vdev is NULL"); + return QDF_STATUS_E_FAILURE; + } + device_mode = wlan_vdev_mlme_get_opmode(vdev); + wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID); + + /* + * Note: Do not use Dot11f VHT structure, since 1 byte present flag in + * it is causing weird padding errors. Instead use Sir Mac VHT struct + * to send IE to wma. + */ + if (is_dot11mode_support_ht_cap( + mac_ctx->roam.configParam.uCfgDot11Mode)) + status_ht = lim_send_ht_caps_ie(mac_ctx, session, + device_mode, vdev_id); + + if (is_dot11mode_support_vht_cap( + mac_ctx->roam.configParam.uCfgDot11Mode)) + status_vht = lim_send_vht_caps_ie(mac_ctx, session, + device_mode, vdev_id); + + if (is_dot11mode_support_he_cap( + mac_ctx->roam.configParam.uCfgDot11Mode)) + status_he = lim_send_he_caps_ie(mac_ctx, session, + device_mode, vdev_id); + + if (QDF_IS_STATUS_SUCCESS(status_ht) && + QDF_IS_STATUS_SUCCESS(status_vht) && + QDF_IS_STATUS_SUCCESS(status_he)) + return QDF_STATUS_SUCCESS; + + return QDF_STATUS_E_FAILURE; } /** @@ -7856,12 +8019,17 @@ void lim_set_he_caps(tpAniSirGlobal mac, tpPESession session, uint8_t *ie_start, } } -QDF_STATUS lim_send_he_caps_ie(tpAniSirGlobal mac_ctx, tpPESession session, +QDF_STATUS lim_send_he_caps_ie(tpAniSirGlobal mac_ctx, + tpPESession session, + enum QDF_OPMODE device_mode, uint8_t vdev_id) { uint8_t he_caps[SIR_MAC_HE_CAP_MIN_LEN + 3]; struct he_capability_info *he_cap; QDF_STATUS status_5g, status_2g; + uint8_t he_cap_total_len = SIR_MAC_HE_CAP_MIN_LEN + HE_CAP_OUI_LEN + + HE_CAP_160M_MCS_MAP_LEN + + HE_CAP_80P80_MCS_MAP_LEN; /* Sending only minimal info(no PPET) to FW now, update if required */ qdf_mem_zero(he_caps, SIR_MAC_HE_CAP_MIN_LEN + 3); @@ -7872,7 +8040,17 @@ QDF_STATUS lim_send_he_caps_ie(tpAniSirGlobal mac_ctx, tpPESession session, SIR_MAC_HE_CAP_MIN_LEN + 3); he_cap = (struct he_capability_info *) (&he_caps[2 + HE_CAP_OUI_SIZE]); he_cap->ppet_present = 0; - + if (device_mode == QDF_NDI_MODE) { + he_cap->su_beamformee = 0; + he_cap->su_beamformer = 0; + he_cap->mu_beamformer = 0; + he_cap->bfee_sts_gt_80 = 0; + he_cap->bfee_sts_lt_80 = 0; + he_cap->num_sounding_gt_80 = 0; + he_cap->num_sounding_lt_80 = 0; + he_cap->su_feedback_tone16 = 0; + he_cap->mu_feedback_tone16 = 0; + } status_5g = lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_HE_CAP, CDS_BAND_5GHZ, &he_caps[2], SIR_MAC_HE_CAP_MIN_LEN + 1); diff --git a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_utils.h b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_utils.h index 423cd9180eca..f572223f905f 100644 --- a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_utils.h +++ b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_utils.h @@ -1159,13 +1159,16 @@ void lim_set_he_caps(tpAniSirGlobal mac, tpPESession session, * lim_send_he_caps_ie() - gets HE capability and send to firmware via wma * @mac_ctx: global mac context * @session: pe session. This can be NULL. In that case self cap will be sent + * @device_mode: VDEV op mode * @vdev_id: vdev for which IE is targeted * * This function gets HE capability and send to firmware via wma * * Return: QDF_STATUS */ -QDF_STATUS lim_send_he_caps_ie(tpAniSirGlobal mac_ctx, tpPESession session, +QDF_STATUS lim_send_he_caps_ie(tpAniSirGlobal mac_ctx, + tpPESession session, + enum QDF_OPMODE device_mode, uint8_t vdev_id); /** @@ -1301,6 +1304,7 @@ static inline void lim_set_he_caps(tpAniSirGlobal mac, tpPESession session, static inline QDF_STATUS lim_send_he_caps_ie(tpAniSirGlobal mac_ctx, tpPESession session, + enum QDF_OPMODE device_mode, uint8_t vdev_id) { return QDF_STATUS_SUCCESS; diff --git a/drivers/staging/qcacld-3.0/core/sap/src/sap_module.c b/drivers/staging/qcacld-3.0/core/sap/src/sap_module.c index 14f824df13f7..279078dbae8c 100644 --- a/drivers/staging/qcacld-3.0/core/sap/src/sap_module.c +++ b/drivers/staging/qcacld-3.0/core/sap/src/sap_module.c @@ -3120,7 +3120,7 @@ QDF_STATUS wlansap_update_owe_info(struct sap_context *sap_ctx, struct owe_assoc_ind *owe_assoc_ind; tSirSmeAssocInd *assoc_ind = NULL; qdf_list_node_t *node = NULL, *next_node = NULL; - QDF_STATUS status; + QDF_STATUS status = QDF_STATUS_SUCCESS; if (!wlansap_validate_owe_ies(ie, ie_len)) { QDF_TRACE_ERROR(QDF_MODULE_ID_SAP, "Invalid OWE IE"); diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 2c68fa5b0221..0a24c1b38209 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -1088,13 +1088,16 @@ static int vfio_bus_type(struct device *dev, void *data) static int vfio_iommu_replay(struct vfio_iommu *iommu, struct vfio_domain *domain) { - struct vfio_domain *d; + struct vfio_domain *d = NULL; struct rb_node *n; unsigned long limit = rlimit(RLIMIT_MEMLOCK) >> PAGE_SHIFT; int ret; /* Arbitrarily pick the first domain in the list for lookups */ - d = list_first_entry(&iommu->domain_list, struct vfio_domain, next); + if (!list_empty(&iommu->domain_list)) + d = list_first_entry(&iommu->domain_list, + struct vfio_domain, next); + n = rb_first(&iommu->dma_list); for (; n; n = rb_next(n)) { @@ -1112,6 +1115,11 @@ static int vfio_iommu_replay(struct vfio_iommu *iommu, phys_addr_t p; dma_addr_t i; + if (WARN_ON(!d)) { /* mapped w/o a domain?! */ + ret = -EINVAL; + goto unwind; + } + phys = iommu_iova_to_phys(d->domain, iova); if (WARN_ON(!phys)) { @@ -1141,7 +1149,7 @@ static int vfio_iommu_replay(struct vfio_iommu *iommu, if (npage <= 0) { WARN_ON(!npage); ret = (int)npage; - return ret; + goto unwind; } phys = pfn << PAGE_SHIFT; @@ -1150,14 +1158,67 @@ static int vfio_iommu_replay(struct vfio_iommu *iommu, ret = iommu_map(domain->domain, iova, phys, size, dma->prot | domain->prot); - if (ret) - return ret; + if (ret) { + if (!dma->iommu_mapped) + vfio_unpin_pages_remote(dma, iova, + phys >> PAGE_SHIFT, + size >> PAGE_SHIFT, + true); + goto unwind; + } iova += size; } + } + + /* All dmas are now mapped, defer to second tree walk for unwind */ + for (n = rb_first(&iommu->dma_list); n; n = rb_next(n)) { + struct vfio_dma *dma = rb_entry(n, struct vfio_dma, node); + dma->iommu_mapped = true; } + return 0; + +unwind: + for (; n; n = rb_prev(n)) { + struct vfio_dma *dma = rb_entry(n, struct vfio_dma, node); + dma_addr_t iova; + + if (dma->iommu_mapped) { + iommu_unmap(domain->domain, dma->iova, dma->size); + continue; + } + + iova = dma->iova; + while (iova < dma->iova + dma->size) { + phys_addr_t phys, p; + size_t size; + dma_addr_t i; + + phys = iommu_iova_to_phys(domain->domain, iova); + if (!phys) { + iova += PAGE_SIZE; + continue; + } + + size = PAGE_SIZE; + p = phys + size; + i = iova + size; + while (i < dma->iova + dma->size && + p == iommu_iova_to_phys(domain->domain, i)) { + size += PAGE_SIZE; + p += PAGE_SIZE; + i += PAGE_SIZE; + } + + iommu_unmap(domain->domain, iova, size); + vfio_unpin_pages_remote(dma, iova, phys >> PAGE_SHIFT, + size >> PAGE_SHIFT, true); + } + } + + return ret; } /* diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 03f85b80df88..73586eebd2cf 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -829,6 +829,9 @@ bool virtqueue_poll(struct virtqueue *_vq, unsigned last_used_idx) { struct vring_virtqueue *vq = to_vvq(_vq); + if (unlikely(vq->broken)) + return false; + virtio_mb(vq->weak_barriers); return (u16)last_used_idx != virtio16_to_cpu(_vq->vdev, vq->vring.used->idx); } diff --git a/drivers/xen/preempt.c b/drivers/xen/preempt.c index 5f6b77ea34fb..128375ff80b8 100644 --- a/drivers/xen/preempt.c +++ b/drivers/xen/preempt.c @@ -31,7 +31,7 @@ EXPORT_SYMBOL_GPL(xen_in_preemptible_hcall); asmlinkage __visible void xen_maybe_preempt_hcall(void) { if (unlikely(__this_cpu_read(xen_in_preemptible_hcall) - && need_resched())) { + && need_resched() && !preempt_count())) { /* * Clear flag as we may be rescheduled on a different * cpu. diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 5412b12491cb..de951987fd23 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -3262,6 +3262,8 @@ ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size); int btrfs_parse_options(struct btrfs_fs_info *info, char *options, unsigned long new_flags); int btrfs_sync_fs(struct super_block *sb, int wait); +char *btrfs_get_subvol_name_from_objectid(struct btrfs_fs_info *fs_info, + u64 subvol_objectid); static inline __printf(2, 3) void btrfs_no_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...) diff --git a/fs/btrfs/export.c b/fs/btrfs/export.c index 3aeb5770f896..b6ce765aa7f3 100644 --- a/fs/btrfs/export.c +++ b/fs/btrfs/export.c @@ -56,9 +56,9 @@ static int btrfs_encode_fh(struct inode *inode, u32 *fh, int *max_len, return type; } -static struct dentry *btrfs_get_dentry(struct super_block *sb, u64 objectid, - u64 root_objectid, u32 generation, - int check_generation) +struct dentry *btrfs_get_dentry(struct super_block *sb, u64 objectid, + u64 root_objectid, u32 generation, + int check_generation) { struct btrfs_fs_info *fs_info = btrfs_sb(sb); struct btrfs_root *root; @@ -151,7 +151,7 @@ static struct dentry *btrfs_fh_to_dentry(struct super_block *sb, struct fid *fh, return btrfs_get_dentry(sb, objectid, root_objectid, generation, 1); } -static struct dentry *btrfs_get_parent(struct dentry *child) +struct dentry *btrfs_get_parent(struct dentry *child) { struct inode *dir = d_inode(child); struct btrfs_fs_info *fs_info = btrfs_sb(dir->i_sb); diff --git a/fs/btrfs/export.h b/fs/btrfs/export.h index 91b3908e7c54..15db02462141 100644 --- a/fs/btrfs/export.h +++ b/fs/btrfs/export.h @@ -17,4 +17,9 @@ struct btrfs_fid { u64 parent_root_objectid; } __attribute__ ((packed)); +struct dentry *btrfs_get_dentry(struct super_block *sb, u64 objectid, + u64 root_objectid, u32 generation, + int check_generation); +struct dentry *btrfs_get_parent(struct dentry *child); + #endif diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index cb17c5bafeeb..42df66e83350 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -630,7 +630,21 @@ cont: btrfs_free_reserved_data_space_noquota(inode, start, end - start + 1); - goto free_pages_out; + + /* + * Ensure we only free the compressed pages if we have + * them allocated, as we can still reach here with + * inode_need_compress() == false. + */ + if (pages) { + for (i = 0; i < nr_pages; i++) { + WARN_ON(pages[i]->mapping); + put_page(pages[i]); + } + kfree(pages); + } + + return; } } @@ -709,13 +723,6 @@ cleanup_and_bail_uncompressed: *num_added += 1; return; - -free_pages_out: - for (i = 0; i < nr_pages; i++) { - WARN_ON(pages[i]->mapping); - put_page(pages[i]); - } - kfree(pages); } static void free_async_extent_pages(struct async_extent *async_extent) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 17a8463ef35c..eb64d4b159e0 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -939,8 +939,8 @@ out: return error; } -static char *get_subvol_name_from_objectid(struct btrfs_fs_info *fs_info, - u64 subvol_objectid) +char *btrfs_get_subvol_name_from_objectid(struct btrfs_fs_info *fs_info, + u64 subvol_objectid) { struct btrfs_root *root = fs_info->tree_root; struct btrfs_root *fs_root; @@ -1221,6 +1221,7 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry) { struct btrfs_fs_info *info = btrfs_sb(dentry->d_sb); char *compress_type; + const char *subvol_name; if (btrfs_test_opt(info, DEGRADED)) seq_puts(seq, ",degraded"); @@ -1307,8 +1308,13 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry) #endif seq_printf(seq, ",subvolid=%llu", BTRFS_I(d_inode(dentry))->root->root_key.objectid); - seq_puts(seq, ",subvol="); - seq_dentry(seq, dentry, " \t\n\\"); + subvol_name = btrfs_get_subvol_name_from_objectid(info, + BTRFS_I(d_inode(dentry))->root->root_key.objectid); + if (!IS_ERR(subvol_name)) { + seq_puts(seq, ",subvol="); + seq_escape(seq, subvol_name, " \t\n\\"); + kfree(subvol_name); + } return 0; } @@ -1427,8 +1433,8 @@ static struct dentry *mount_subvol(const char *subvol_name, u64 subvol_objectid, goto out; } } - subvol_name = get_subvol_name_from_objectid(btrfs_sb(mnt->mnt_sb), - subvol_objectid); + subvol_name = btrfs_get_subvol_name_from_objectid( + btrfs_sb(mnt->mnt_sb), subvol_objectid); if (IS_ERR(subvol_name)) { root = ERR_CAST(subvol_name); subvol_name = NULL; diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index f05341bda1d1..383546ff62f0 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "ctree.h" #include "disk-io.h" @@ -749,7 +750,9 @@ int btrfs_sysfs_add_device_link(struct btrfs_fs_devices *fs_devices, { int error = 0; struct btrfs_device *dev; + unsigned int nofs_flag; + nofs_flag = memalloc_nofs_save(); list_for_each_entry(dev, &fs_devices->devices, dev_list) { struct hd_struct *disk; struct kobject *disk_kobj; @@ -768,6 +771,7 @@ int btrfs_sysfs_add_device_link(struct btrfs_fs_devices *fs_devices, if (error) break; } + memalloc_nofs_restore(nofs_flag); return error; } diff --git a/fs/eventpoll.c b/fs/eventpoll.c index a05c6a17d8a9..2e771297058e 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1910,9 +1910,11 @@ static int ep_loop_check_proc(void *priv, void *cookie, int call_nests) * not already there, and calling reverse_path_check() * during ep_insert(). */ - if (list_empty(&epi->ffd.file->f_tfile_llink)) + if (list_empty(&epi->ffd.file->f_tfile_llink)) { + get_file(epi->ffd.file); list_add(&epi->ffd.file->f_tfile_llink, &tfile_check_list); + } } } mutex_unlock(&ep->mtx); @@ -1956,6 +1958,7 @@ static void clear_tfile_check_list(void) file = list_first_entry(&tfile_check_list, struct file, f_tfile_llink); list_del_init(&file->f_tfile_llink); + fput(file); } INIT_LIST_HEAD(&tfile_check_list); } @@ -2106,13 +2109,13 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, mutex_lock(&epmutex); if (is_file_epoll(tf.file)) { error = -ELOOP; - if (ep_loop_check(ep, tf.file) != 0) { - clear_tfile_check_list(); + if (ep_loop_check(ep, tf.file) != 0) goto error_tgt_fput; - } - } else + } else { + get_file(tf.file); list_add(&tf.file->f_tfile_llink, &tfile_check_list); + } mutex_lock_nested(&ep->mtx, 0); if (is_file_epoll(tf.file)) { tep = tf.file->private_data; @@ -2136,8 +2139,6 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, error = ep_insert(ep, &epds, tf.file, fd, full_check); } else error = -EEXIST; - if (full_check) - clear_tfile_check_list(); break; case EPOLL_CTL_DEL: if (epi) @@ -2160,8 +2161,10 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, mutex_unlock(&ep->mtx); error_tgt_fput: - if (full_check) + if (full_check) { + clear_tfile_check_list(); mutex_unlock(&epmutex); + } fdput(tf); error_fput: diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index f72e2b3fe797..814af981d840 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1391,8 +1391,8 @@ int ext4_search_dir(struct buffer_head *bh, char *search_buf, int buf_size, ext4_match(dir, fname, de)) { /* found a match - just to be sure, do * a full check */ - if (ext4_check_dir_entry(dir, NULL, de, bh, bh->b_data, - bh->b_size, offset)) + if (ext4_check_dir_entry(dir, NULL, de, bh, search_buf, + buf_size, offset)) return -1; *res_dir = de; return 1; @@ -1853,7 +1853,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir, blocksize, hinfo, map); map -= count; dx_sort_map(map, count); - /* Split the existing block in the middle, size-wise */ + /* Ensure that neither split block is over half full */ size = 0; move = 0; for (i = count-1; i >= 0; i--) { @@ -1863,8 +1863,18 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir, size += map[i].size; move++; } - /* map index at which we will split */ - split = count - move; + /* + * map index at which we will split + * + * If the sum of active entries didn't exceed half the block size, just + * split it in half by count; each resulting block will have at least + * half the space free. + */ + if (i > 0) + split = count - move; + else + split = count/2; + hash2 = map[split].hash; continued = hash2 == map[split - 1].hash; dxtrace(printk(KERN_INFO "Split block %lu at %x, %i/%i\n", @@ -2473,7 +2483,7 @@ int ext4_generic_delete_entry(handle_t *handle, de = (struct ext4_dir_entry_2 *)entry_buf; while (i < buf_size - csum_size) { if (ext4_check_dir_entry(dir, NULL, de, bh, - bh->b_data, bh->b_size, i)) + entry_buf, buf_size, i)) return -EFSCORRUPTED; if (de == de_del) { if (pde) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 6e054b368b5f..93a466cf58ba 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1356,8 +1356,10 @@ static int jbd2_write_superblock(journal_t *journal, int write_flags) int ret; /* Buffer got discarded which means block device got invalidated */ - if (!buffer_mapped(bh)) + if (!buffer_mapped(bh)) { + unlock_buffer(bh); return -EIO; + } trace_jbd2_write_superblock(journal, write_flags); if (!(journal->j_flags & JBD2_BARRIER)) diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index e5a6deb38e1e..f4a5ec92f5dc 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c @@ -590,10 +590,14 @@ static int jffs2_rmdir (struct inode *dir_i, struct dentry *dentry) int ret; uint32_t now = get_seconds(); + mutex_lock(&f->sem); for (fd = f->dents ; fd; fd = fd->next) { - if (fd->ino) + if (fd->ino) { + mutex_unlock(&f->sem); return -ENOTEMPTY; + } } + mutex_unlock(&f->sem); ret = jffs2_do_unlink(c, dir_f, dentry->d_name.name, dentry->d_name.len, f, now); diff --git a/fs/romfs/storage.c b/fs/romfs/storage.c index f86f51f99ace..1dcadd22b440 100644 --- a/fs/romfs/storage.c +++ b/fs/romfs/storage.c @@ -221,10 +221,8 @@ int romfs_dev_read(struct super_block *sb, unsigned long pos, size_t limit; limit = romfs_maxsize(sb); - if (pos >= limit) + if (pos >= limit || buflen > limit - pos) return -EIO; - if (buflen > limit - pos) - buflen = limit - pos; #ifdef CONFIG_ROMFS_ON_MTD if (sb->s_mtd) diff --git a/fs/xfs/xfs_sysfs.h b/fs/xfs/xfs_sysfs.h index d04637181ef2..980c9429abec 100644 --- a/fs/xfs/xfs_sysfs.h +++ b/fs/xfs/xfs_sysfs.h @@ -44,9 +44,11 @@ xfs_sysfs_init( struct xfs_kobj *parent_kobj, const char *name) { + struct kobject *parent; + + parent = parent_kobj ? &parent_kobj->kobject : NULL; init_completion(&kobj->complete); - return kobject_init_and_add(&kobj->kobject, ktype, - &parent_kobj->kobject, "%s", name); + return kobject_init_and_add(&kobj->kobject, ktype, parent, "%s", name); } static inline void diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c index c3d547211d16..9c42e50a5cb7 100644 --- a/fs/xfs/xfs_trans_dquot.c +++ b/fs/xfs/xfs_trans_dquot.c @@ -669,7 +669,7 @@ xfs_trans_dqresv( } } if (ninos > 0) { - total_count = be64_to_cpu(dqp->q_core.d_icount) + ninos; + total_count = dqp->q_res_icount + ninos; timer = be32_to_cpu(dqp->q_core.d_itimer); warns = be16_to_cpu(dqp->q_core.d_iwarns); warnlimit = dqp->q_mount->m_quotainfo->qi_iwarnlimit; diff --git a/include/uapi/linux/virtio_gpu.h b/include/uapi/linux/virtio_gpu.h index f44af31f7990..f67d443077cd 100644 --- a/include/uapi/linux/virtio_gpu.h +++ b/include/uapi/linux/virtio_gpu.h @@ -85,8 +85,6 @@ enum virtio_gpu_ctrl_type { VIRTIO_GPU_CMD_GET_EDID, VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID, VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB, - VIRTIO_GPU_CMD_RESOURCE_MAP, - VIRTIO_GPU_CMD_RESOURCE_UNMAP, /* 3d commands */ VIRTIO_GPU_CMD_CTX_CREATE = 0x0200, @@ -97,6 +95,8 @@ enum virtio_gpu_ctrl_type { VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D, VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D, VIRTIO_GPU_CMD_SUBMIT_3D, + VIRTIO_GPU_CMD_RESOURCE_MAP, + VIRTIO_GPU_CMD_RESOURCE_UNMAP, /* cursor commands */ VIRTIO_GPU_CMD_UPDATE_CURSOR = 0x0300, diff --git a/kernel/relay.c b/kernel/relay.c index 813823080a08..51b9a256030a 100644 --- a/kernel/relay.c +++ b/kernel/relay.c @@ -197,6 +197,7 @@ free_buf: static void relay_destroy_channel(struct kref *kref) { struct rchan *chan = container_of(kref, struct rchan, kref); + free_percpu(chan->buf); kfree(chan); } diff --git a/mm/hugetlb.c b/mm/hugetlb.c index c99bdbed5af4..358d8a0e5662 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4578,25 +4578,21 @@ static bool vma_shareable(struct vm_area_struct *vma, unsigned long addr) void adjust_range_if_pmd_sharing_possible(struct vm_area_struct *vma, unsigned long *start, unsigned long *end) { - unsigned long check_addr = *start; + unsigned long a_start, a_end; if (!(vma->vm_flags & VM_MAYSHARE)) return; - for (check_addr = *start; check_addr < *end; check_addr += PUD_SIZE) { - unsigned long a_start = check_addr & PUD_MASK; - unsigned long a_end = a_start + PUD_SIZE; + /* Extend the range to be PUD aligned for a worst case scenario */ + a_start = ALIGN_DOWN(*start, PUD_SIZE); + a_end = ALIGN(*end, PUD_SIZE); - /* - * If sharing is possible, adjust start/end if necessary. - */ - if (range_in_vma(vma, a_start, a_end)) { - if (a_start < *start) - *start = a_start; - if (a_end > *end) - *end = a_end; - } - } + /* + * Intersect the range with the vma range, since pmd sharing won't be + * across vma after all + */ + *start = max(vma->vm_start, a_start); + *end = min(vma->vm_end, a_end); } /* diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 6666cc93990a..39d13cfcdd33 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -394,7 +394,7 @@ static void insert_to_mm_slots_hash(struct mm_struct *mm, static inline int khugepaged_test_exit(struct mm_struct *mm) { - return atomic_read(&mm->mm_users) == 0; + return atomic_read(&mm->mm_users) == 0 || !mmget_still_valid(mm); } int __khugepaged_enter(struct mm_struct *mm) @@ -407,7 +407,7 @@ int __khugepaged_enter(struct mm_struct *mm) return -ENOMEM; /* __khugepaged_exit() must not run from under us */ - VM_BUG_ON_MM(khugepaged_test_exit(mm), mm); + VM_BUG_ON_MM(atomic_read(&mm->mm_users) == 0, mm); if (unlikely(test_and_set_bit(MMF_VM_HUGEPAGE, &mm->flags))) { free_mm_slot(mm_slot); return 0; @@ -1008,9 +1008,6 @@ static void collapse_huge_page(struct mm_struct *mm, * handled by the anon_vma lock + PG_lock. */ down_write(&mm->mmap_sem); - result = SCAN_ANY_PROCESS; - if (!mmget_still_valid(mm)) - goto out; result = hugepage_vma_revalidate(mm, address, &vma); if (result) goto out; diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ff570c341f8f..d5d16b53d2c1 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1191,6 +1191,11 @@ static void free_pcppages_bulk(struct zone *zone, int count, spin_lock(&zone->lock); isolated_pageblocks = has_isolate_pageblock(zone); + /* + * Ensure proper count is passed which otherwise would stuck in the + * below while (list_empty(list)) loop. + */ + count = min(pcp->count, count); while (count) { struct page *page; struct list_head *list; @@ -7297,7 +7302,7 @@ int __meminit init_per_zone_wmark_min(void) return 0; } -core_initcall(init_per_zone_wmark_min) +postcore_initcall(init_per_zone_wmark_min) /* * min_free_kbytes_sysctl_handler - just a wrapper around proc_dointvec() so diff --git a/sound/soc/codecs/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c index 3633eb30dd13..4f949ad50d6a 100644 --- a/sound/soc/codecs/msm8916-wcd-analog.c +++ b/sound/soc/codecs/msm8916-wcd-analog.c @@ -16,8 +16,8 @@ #define CDC_D_REVISION1 (0xf000) #define CDC_D_PERPH_SUBTYPE (0xf005) -#define CDC_D_INT_EN_SET (0x015) -#define CDC_D_INT_EN_CLR (0x016) +#define CDC_D_INT_EN_SET (0xf015) +#define CDC_D_INT_EN_CLR (0xf016) #define MBHC_SWITCH_INT BIT(7) #define MBHC_MIC_ELECTRICAL_INS_REM_DET BIT(6) #define MBHC_BUTTON_PRESS_DET BIT(5) diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c index 4558c8b93036..3a645fc425cd 100644 --- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c +++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c @@ -339,7 +339,7 @@ static int sst_media_open(struct snd_pcm_substream *substream, ret_val = power_up_sst(stream); if (ret_val < 0) - return ret_val; + goto out_power_up; /* Make sure, that the period size is always even */ snd_pcm_hw_constraint_step(substream->runtime, 0, @@ -348,8 +348,9 @@ static int sst_media_open(struct snd_pcm_substream *substream, return snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); out_ops: - kfree(stream); mutex_unlock(&sst_lock); +out_power_up: + kfree(stream); return ret_val; } diff --git a/techpack/audio/4.0/asoc/Android.mk b/techpack/audio/4.0/asoc/Android.mk deleted file mode 100644 index 9d866f997644..000000000000 --- a/techpack/audio/4.0/asoc/Android.mk +++ /dev/null @@ -1,97 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,msmnile),true) -TARGET := msmnile -ifeq ($(TARGET_PRODUCT), $(filter $(TARGET_PRODUCT), msmnile_au msmnile_gvmq)) -AUDIO_SELECT := CONFIG_SND_SOC_SA8155=m -else -AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m -endif -endif - -ifeq ($(call is-board-platform,$(MSMSTEPPE)),true) -TARGET := talos -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -ifeq ($(call is-board-platform,$(TRINKET)),true) -TARGET := trinket -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -ifeq ($(call is-board-platform,kona),true) -TARGET := kona -AUDIO_SELECT := CONFIG_SND_SOC_KONA=m -endif - -ifeq ($(call is-board-platform,lito),true) -TARGET := lito -AUDIO_SELECT := CONFIG_SND_SOC_LITO=m -endif - -ifeq ($(call is-board-platform,atoll),true) -TARGET := atoll -AUDIO_SELECT := CONFIG_SND_SOC_ATOLL=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito atoll),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=platform_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_platform.ko -LOCAL_MODULE_KBUILD_NAME := platform_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -ifeq ($(call is-board-platform-in-list, ),true) -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_cpe_lsm.ko -LOCAL_MODULE_KBUILD_NAME := cpe_lsm_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -endif -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_machine_$(TARGET).ko -LOCAL_MODULE_KBUILD_NAME := machine_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/4.0/asoc/codecs/Android.mk b/techpack/audio/4.0/asoc/codecs/Android.mk deleted file mode 100644 index 593510245f69..000000000000 --- a/techpack/audio/4.0/asoc/codecs/Android.mk +++ /dev/null @@ -1,145 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,msmnile),true) -ifeq ($(TARGET_PRODUCT), $(filter $(TARGET_PRODUCT), msmnile_au)) -AUDIO_SELECT := CONFIG_SND_SOC_SA8155=m -else -AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m -endif -endif - -ifeq ($(call is-board-platform,$(MSMSTEPPE)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -ifeq ($(call is-board-platform,$(TRINKET)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -ifeq ($(call is-board-platform,kona),true) -AUDIO_SELECT := CONFIG_SND_SOC_KONA=m -endif - -ifeq ($(call is-board-platform,lito),true) -AUDIO_SELECT := CONFIG_SND_SOC_LITO=m -endif - -ifeq ($(call is-board-platform,atoll),true) -AUDIO_SELECT := CONFIG_SND_SOC_ATOLL=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito atoll),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=wcd_core_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -ifneq ($(TARGET_PRODUCT), $(filter $(TARGET_PRODUCT), msmnile_au msmnile_gvmq)) -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_core.ko -LOCAL_MODULE_KBUILD_NAME := wcd_core_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd9xxx.ko -LOCAL_MODULE_KBUILD_NAME := wcd9xxx_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -ifeq ($(call is-board-platform-in-list, ),true) -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_cpe.ko -LOCAL_MODULE_KBUILD_NAME := wcd_cpe_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -endif -########################################################### -ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET)),true) -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_spi.ko -LOCAL_MODULE_KBUILD_NAME := wcd_spi_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -endif -########################################################### -ifeq ($(call is-board-platform-in-list, ),true) -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd9335.ko -LOCAL_MODULE_KBUILD_NAME := wcd9335_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -endif -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wsa881x.ko -LOCAL_MODULE_KBUILD_NAME := wsa881x_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_mbhc.ko -LOCAL_MODULE_KBUILD_NAME := mbhc_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -endif -############################################################ -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_stub.ko -LOCAL_MODULE_KBUILD_NAME := stub_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################## -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_hdmi.ko -LOCAL_MODULE_KBUILD_NAME := hdmi_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/4.0/asoc/codecs/bolero/Android.mk b/techpack/audio/4.0/asoc/codecs/bolero/Android.mk deleted file mode 100644 index 47791b4eb1be..000000000000 --- a/techpack/audio/4.0/asoc/codecs/bolero/Android.mk +++ /dev/null @@ -1,94 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,$(MSMSTEPPE) $(TRINKET)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -ifeq ($(call is-board-platform,kona),true) -AUDIO_SELECT := CONFIG_SND_SOC_KONA=m -endif - -ifeq ($(call is-board-platform,lito),true) -AUDIO_SELECT := CONFIG_SND_SOC_LITO=m -endif - -ifeq ($(call is-board-platform,atoll),true) -AUDIO_SELECT := CONFIG_SND_SOC_ATOLL=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) $(TRINKET) kona lito atoll),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=bolero_cdc_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_bolero_cdc.ko -LOCAL_MODULE_KBUILD_NAME := bolero_cdc_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wsa_macro.ko -LOCAL_MODULE_KBUILD_NAME := wsa_macro_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_va_macro.ko -LOCAL_MODULE_KBUILD_NAME := va_macro_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_tx_macro.ko -LOCAL_MODULE_KBUILD_NAME := tx_macro_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_rx_macro.ko -LOCAL_MODULE_KBUILD_NAME := rx_macro_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/4.0/asoc/codecs/bolero/bolero-cdc.c b/techpack/audio/4.0/asoc/codecs/bolero/bolero-cdc.c index bfecc5651ee3..a09bbaec5f56 100644 --- a/techpack/audio/4.0/asoc/codecs/bolero/bolero-cdc.c +++ b/techpack/audio/4.0/asoc/codecs/bolero/bolero-cdc.c @@ -389,9 +389,10 @@ static int bolero_copy_dais_from_macro(struct bolero_priv *priv) /* memcpy into bolero_dais all macro dais */ if (!priv->bolero_dais) - priv->bolero_dais = devm_kcalloc(priv->dev, - priv->num_dais, - sizeof(struct snd_soc_dai_driver), + priv->bolero_dais = devm_kzalloc(priv->dev, + priv->num_dais * + sizeof( + struct snd_soc_dai_driver), GFP_KERNEL); if (!priv->bolero_dais) return -ENOMEM; diff --git a/techpack/audio/4.0/asoc/codecs/bolero/bolero-clk-rsc.c b/techpack/audio/4.0/asoc/codecs/bolero/bolero-clk-rsc.c index 54f2ac6a6daf..b134819e0c16 100644 --- a/techpack/audio/4.0/asoc/codecs/bolero/bolero-clk-rsc.c +++ b/techpack/audio/4.0/asoc/codecs/bolero/bolero-clk-rsc.c @@ -640,7 +640,7 @@ static int bolero_clk_rsc_probe(struct platform_device *pdev) ret = -EINVAL; goto err; } - clk_name_array = devm_kcalloc(&pdev->dev, clk_cnt, sizeof(char *), + clk_name_array = devm_kzalloc(&pdev->dev, clk_cnt * sizeof(char *), GFP_KERNEL); if (!clk_name_array) { ret = -ENOMEM; diff --git a/techpack/audio/4.0/asoc/codecs/bolero/tx-macro.c b/techpack/audio/4.0/asoc/codecs/bolero/tx-macro.c index 70605c715f0a..94dc5fa80042 100644 --- a/techpack/audio/4.0/asoc/codecs/bolero/tx-macro.c +++ b/techpack/audio/4.0/asoc/codecs/bolero/tx-macro.c @@ -1516,10 +1516,6 @@ static const struct snd_soc_dapm_widget tx_macro_dapm_widgets_v2[] = { SND_SOC_DAPM_MIXER("TX_AIF3_CAP Mixer", SND_SOC_NOPM, TX_MACRO_AIF3_CAP, 0, tx_aif3_cap_mixer_v2, ARRAY_SIZE(tx_aif3_cap_mixer_v2)), - - SND_SOC_DAPM_SUPPLY_S("TX_SWR_CLK", 0, SND_SOC_NOPM, 0, 0, - tx_macro_tx_swr_clk_event, - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), }; static const struct snd_soc_dapm_widget tx_macro_dapm_widgets_v3[] = { diff --git a/techpack/audio/4.0/asoc/codecs/bolero/va-macro.c b/techpack/audio/4.0/asoc/codecs/bolero/va-macro.c index 2cd43116e7eb..850773f93f20 100644 --- a/techpack/audio/4.0/asoc/codecs/bolero/va-macro.c +++ b/techpack/audio/4.0/asoc/codecs/bolero/va-macro.c @@ -2057,172 +2057,6 @@ static const struct snd_soc_dapm_widget va_macro_dapm_widgets[] = { SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD), -static const struct snd_soc_dapm_widget va_macro_dapm_widgets_v2[] = { - SND_SOC_DAPM_MIXER("VA_AIF1_CAP Mixer", SND_SOC_NOPM, - VA_MACRO_AIF1_CAP, 0, - va_aif1_cap_mixer_v2, ARRAY_SIZE(va_aif1_cap_mixer_v2)), - - SND_SOC_DAPM_MIXER("VA_AIF2_CAP Mixer", SND_SOC_NOPM, - VA_MACRO_AIF2_CAP, 0, - va_aif2_cap_mixer_v2, ARRAY_SIZE(va_aif2_cap_mixer_v2)), - - SND_SOC_DAPM_MIXER("VA_AIF3_CAP Mixer", SND_SOC_NOPM, - VA_MACRO_AIF3_CAP, 0, - va_aif3_cap_mixer_v2, ARRAY_SIZE(va_aif3_cap_mixer_v2)), - - SND_SOC_DAPM_SUPPLY_S("VA_SWR_PWR", -1, SND_SOC_NOPM, 0, 0, - va_macro_swr_pwr_event_v2, - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), - - SND_SOC_DAPM_SUPPLY_S("VA_TX_SWR_CLK", 0, SND_SOC_NOPM, 0, 0, - va_macro_tx_swr_clk_event_v2, - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), -}; - -static const struct snd_soc_dapm_widget va_macro_dapm_widgets_v3[] = { - SND_SOC_DAPM_MIXER("VA_AIF1_CAP Mixer", SND_SOC_NOPM, - VA_MACRO_AIF1_CAP, 0, - va_aif1_cap_mixer_v3, ARRAY_SIZE(va_aif1_cap_mixer_v3)), - - SND_SOC_DAPM_MIXER("VA_AIF2_CAP Mixer", SND_SOC_NOPM, - VA_MACRO_AIF2_CAP, 0, - va_aif2_cap_mixer_v3, ARRAY_SIZE(va_aif2_cap_mixer_v3)), - - SND_SOC_DAPM_MIXER("VA_AIF3_CAP Mixer", SND_SOC_NOPM, - VA_MACRO_AIF3_CAP, 0, - va_aif3_cap_mixer_v3, ARRAY_SIZE(va_aif3_cap_mixer_v3)), - - VA_MACRO_DAPM_MUX("VA DMIC MUX2", 0, va_dmic2), - VA_MACRO_DAPM_MUX("VA DMIC MUX3", 0, va_dmic3), - - VA_MACRO_DAPM_MUX("VA SMIC MUX2", 0, va_smic2_v3), - VA_MACRO_DAPM_MUX("VA SMIC MUX3", 0, va_smic3_v3), - - SND_SOC_DAPM_MUX_E("VA DEC2 MUX", SND_SOC_NOPM, VA_MACRO_DEC2, 0, - &va_dec2_mux, va_macro_enable_dec, - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | - SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD), - - SND_SOC_DAPM_MUX_E("VA DEC3 MUX", SND_SOC_NOPM, VA_MACRO_DEC3, 0, - &va_dec3_mux, va_macro_enable_dec, - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | - SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD), - - SND_SOC_DAPM_SUPPLY_S("VA_SWR_PWR", -1, SND_SOC_NOPM, 0, 0, - va_macro_swr_pwr_event, - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), -}; - -static const struct snd_soc_dapm_widget va_macro_dapm_widgets[] = { - SND_SOC_DAPM_AIF_OUT_E("VA_AIF1 CAP", "VA_AIF1 Capture", 0, - SND_SOC_NOPM, VA_MACRO_AIF1_CAP, 0, - va_macro_enable_tx, SND_SOC_DAPM_POST_PMU | - SND_SOC_DAPM_PRE_PMD), - - SND_SOC_DAPM_AIF_OUT_E("VA_AIF2 CAP", "VA_AIF2 Capture", 0, - SND_SOC_NOPM, VA_MACRO_AIF2_CAP, 0, - va_macro_enable_tx, SND_SOC_DAPM_POST_PMU | - SND_SOC_DAPM_PRE_PMD), - - SND_SOC_DAPM_AIF_OUT_E("VA_AIF3 CAP", "VA_AIF3 Capture", 0, - SND_SOC_NOPM, VA_MACRO_AIF3_CAP, 0, - va_macro_enable_tx, SND_SOC_DAPM_POST_PMU | - SND_SOC_DAPM_PRE_PMD), - - SND_SOC_DAPM_MIXER("VA_AIF1_CAP Mixer", SND_SOC_NOPM, - VA_MACRO_AIF1_CAP, 0, - va_aif1_cap_mixer, ARRAY_SIZE(va_aif1_cap_mixer)), - - SND_SOC_DAPM_MIXER("VA_AIF2_CAP Mixer", SND_SOC_NOPM, - VA_MACRO_AIF2_CAP, 0, - va_aif2_cap_mixer, ARRAY_SIZE(va_aif2_cap_mixer)), - - SND_SOC_DAPM_MIXER("VA_AIF3_CAP Mixer", SND_SOC_NOPM, - VA_MACRO_AIF3_CAP, 0, - va_aif3_cap_mixer, ARRAY_SIZE(va_aif3_cap_mixer)), - - VA_MACRO_DAPM_MUX("VA DMIC MUX0", 0, va_dmic0), - VA_MACRO_DAPM_MUX("VA DMIC MUX1", 0, va_dmic1), - VA_MACRO_DAPM_MUX("VA DMIC MUX2", 0, va_dmic2), - VA_MACRO_DAPM_MUX("VA DMIC MUX3", 0, va_dmic3), - VA_MACRO_DAPM_MUX("VA DMIC MUX4", 0, va_dmic4), - VA_MACRO_DAPM_MUX("VA DMIC MUX5", 0, va_dmic5), - VA_MACRO_DAPM_MUX("VA DMIC MUX6", 0, va_dmic6), - VA_MACRO_DAPM_MUX("VA DMIC MUX7", 0, va_dmic7), - - VA_MACRO_DAPM_MUX("VA SMIC MUX0", 0, va_smic0), - VA_MACRO_DAPM_MUX("VA SMIC MUX1", 0, va_smic1), - VA_MACRO_DAPM_MUX("VA SMIC MUX2", 0, va_smic2), - VA_MACRO_DAPM_MUX("VA SMIC MUX3", 0, va_smic3), - VA_MACRO_DAPM_MUX("VA SMIC MUX4", 0, va_smic4), - VA_MACRO_DAPM_MUX("VA SMIC MUX5", 0, va_smic5), - VA_MACRO_DAPM_MUX("VA SMIC MUX6", 0, va_smic6), - VA_MACRO_DAPM_MUX("VA SMIC MUX7", 0, va_smic7), - - SND_SOC_DAPM_MICBIAS_E("VA MIC BIAS1", SND_SOC_NOPM, 0, 0, - va_macro_enable_micbias, - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), - - SND_SOC_DAPM_ADC_E("VA DMIC0", NULL, SND_SOC_NOPM, 0, 0, - va_macro_enable_dmic, SND_SOC_DAPM_PRE_PMU | - SND_SOC_DAPM_POST_PMD), - - SND_SOC_DAPM_ADC_E("VA DMIC1", NULL, SND_SOC_NOPM, 0, 0, - va_macro_enable_dmic, SND_SOC_DAPM_PRE_PMU | - SND_SOC_DAPM_POST_PMD), - - SND_SOC_DAPM_ADC_E("VA DMIC2", NULL, SND_SOC_NOPM, 0, 0, - va_macro_enable_dmic, SND_SOC_DAPM_PRE_PMU | - SND_SOC_DAPM_POST_PMD), - - SND_SOC_DAPM_ADC_E("VA DMIC3", NULL, SND_SOC_NOPM, 0, 0, - va_macro_enable_dmic, SND_SOC_DAPM_PRE_PMU | - SND_SOC_DAPM_POST_PMD), - - SND_SOC_DAPM_ADC_E("VA DMIC4", NULL, SND_SOC_NOPM, 0, 0, - va_macro_enable_dmic, SND_SOC_DAPM_PRE_PMU | - SND_SOC_DAPM_POST_PMD), - - SND_SOC_DAPM_ADC_E("VA DMIC5", NULL, SND_SOC_NOPM, 0, 0, - va_macro_enable_dmic, SND_SOC_DAPM_PRE_PMU | - SND_SOC_DAPM_POST_PMD), - - SND_SOC_DAPM_ADC_E("VA DMIC6", NULL, SND_SOC_NOPM, 0, 0, - va_macro_enable_dmic, SND_SOC_DAPM_PRE_PMU | - SND_SOC_DAPM_POST_PMD), - - SND_SOC_DAPM_ADC_E("VA DMIC7", NULL, SND_SOC_NOPM, 0, 0, - va_macro_enable_dmic, SND_SOC_DAPM_PRE_PMU | - SND_SOC_DAPM_POST_PMD), - - SND_SOC_DAPM_INPUT("VA SWR_ADC0"), - SND_SOC_DAPM_INPUT("VA SWR_ADC1"), - SND_SOC_DAPM_INPUT("VA SWR_ADC2"), - SND_SOC_DAPM_INPUT("VA SWR_ADC3"), - SND_SOC_DAPM_INPUT("VA SWR_MIC0"), - SND_SOC_DAPM_INPUT("VA SWR_MIC1"), - SND_SOC_DAPM_INPUT("VA SWR_MIC2"), - SND_SOC_DAPM_INPUT("VA SWR_MIC3"), - SND_SOC_DAPM_INPUT("VA SWR_MIC4"), - SND_SOC_DAPM_INPUT("VA SWR_MIC5"), - SND_SOC_DAPM_INPUT("VA SWR_MIC6"), - SND_SOC_DAPM_INPUT("VA SWR_MIC7"), - - SND_SOC_DAPM_MUX_E("VA DEC0 MUX", SND_SOC_NOPM, VA_MACRO_DEC0, 0, - &va_dec0_mux, va_macro_enable_dec, - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | - SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD), - - SND_SOC_DAPM_MUX_E("VA DEC1 MUX", SND_SOC_NOPM, VA_MACRO_DEC1, 0, - &va_dec1_mux, va_macro_enable_dec, - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | - SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD), - - SND_SOC_DAPM_MUX_E("VA DEC2 MUX", SND_SOC_NOPM, VA_MACRO_DEC2, 0, - &va_dec2_mux, va_macro_enable_dec, - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | - SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD), - SND_SOC_DAPM_MUX_E("VA DEC3 MUX", SND_SOC_NOPM, VA_MACRO_DEC3, 0, &va_dec3_mux, va_macro_enable_dec, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | diff --git a/techpack/audio/4.0/asoc/codecs/wcd-mbhc-adc.c b/techpack/audio/4.0/asoc/codecs/wcd-mbhc-adc.c index 7db02eddaea5..eb2d9431874f 100644 --- a/techpack/audio/4.0/asoc/codecs/wcd-mbhc-adc.c +++ b/techpack/audio/4.0/asoc/codecs/wcd-mbhc-adc.c @@ -843,6 +843,7 @@ correct_plug_type: plug_type == MBHC_PLUG_TYPE_HEADPHONE)) if (mbhc->mbhc_cb->bcs_enable) mbhc->mbhc_cb->bcs_enable(mbhc, true); + if (!wrk_complete) { /* * If plug_tye is headset, we might have already reported either diff --git a/techpack/audio/4.0/asoc/codecs/wcd937x/Android.mk b/techpack/audio/4.0/asoc/codecs/wcd937x/Android.mk deleted file mode 100644 index 183c78dfe2d7..000000000000 --- a/techpack/audio/4.0/asoc/codecs/wcd937x/Android.mk +++ /dev/null @@ -1,61 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,$(MSMSTEPPE) $(TRINKET)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -ifeq ($(call is-board-platform,atoll),true) -AUDIO_SELECT := CONFIG_SND_SOC_ATOLL=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) $(TRINKET) atoll),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=wcd937x_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd937x.ko -LOCAL_MODULE_KBUILD_NAME := wcd937x_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd937x_slave.ko -LOCAL_MODULE_KBUILD_NAME := wcd937x_slave_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/4.0/asoc/codecs/wcd938x/Android.mk b/techpack/audio/4.0/asoc/codecs/wcd938x/Android.mk deleted file mode 100644 index 87f16620ed13..000000000000 --- a/techpack/audio/4.0/asoc/codecs/wcd938x/Android.mk +++ /dev/null @@ -1,69 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,kona),true) -AUDIO_SELECT := CONFIG_SND_SOC_KONA=m -endif - -ifeq ($(call is-board-platform,lito),true) -AUDIO_SELECT := CONFIG_SND_SOC_LITO=m -endif - -ifeq ($(call is-board-platform,atoll),true) -AUDIO_SELECT := CONFIG_SND_SOC_ATOLL=m -endif - -ifeq ($(call is-board-platform,$(MSMSTEPPE)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,kona lito atoll $(MSMSTEPPE)),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=wcd938x_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd938x.ko -LOCAL_MODULE_KBUILD_NAME := wcd938x_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd938x_slave.ko -LOCAL_MODULE_KBUILD_NAME := wcd938x_slave_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/4.0/asoc/codecs/wcd9xxx-core.c b/techpack/audio/4.0/asoc/codecs/wcd9xxx-core.c index 03e38e7954ed..9736c43c365b 100644 --- a/techpack/audio/4.0/asoc/codecs/wcd9xxx-core.c +++ b/techpack/audio/4.0/asoc/codecs/wcd9xxx-core.c @@ -179,7 +179,7 @@ static int wcd9xxx_slim_multi_reg_write(struct wcd9xxx *wcd9xxx, if (num_regs == 0) return -EINVAL; - bulk_reg = kcalloc(num_regs, sizeof(struct wcd9xxx_reg_val), + bulk_reg = kzalloc(num_regs * (sizeof(struct wcd9xxx_reg_val)), GFP_KERNEL); if (!bulk_reg) return -ENOMEM; @@ -484,7 +484,7 @@ int wcd9xxx_slim_bulk_write(struct wcd9xxx *wcd9xxx, return 0; } - msgs = kcalloc(size, sizeof(struct slim_val_inf), GFP_KERNEL); + msgs = kzalloc(size * (sizeof(struct slim_val_inf)), GFP_KERNEL); if (!msgs) { ret = -ENOMEM; goto mem_fail; diff --git a/techpack/audio/4.0/asoc/msm-dai-q6-v2.c b/techpack/audio/4.0/asoc/msm-dai-q6-v2.c index d68f6ef49049..0ed0dae05b90 100644 --- a/techpack/audio/4.0/asoc/msm-dai-q6-v2.c +++ b/techpack/audio/4.0/asoc/msm-dai-q6-v2.c @@ -4463,9 +4463,9 @@ static int msm_auxpcm_dev_probe(struct platform_device *pdev) } auxpcm_pdata->mode_8k.slot_mapping = - kcalloc(auxpcm_pdata->mode_8k.num_slots, - sizeof(uint16_t), - GFP_KERNEL); + kzalloc(sizeof(uint16_t) * + auxpcm_pdata->mode_8k.num_slots, + GFP_KERNEL); if (!auxpcm_pdata->mode_8k.slot_mapping) { dev_err(&pdev->dev, "%s No mem for mode_8k slot mapping\n", __func__); @@ -4478,9 +4478,9 @@ static int msm_auxpcm_dev_probe(struct platform_device *pdev) (u16)be32_to_cpu(slot_mapping_array[i]); auxpcm_pdata->mode_16k.slot_mapping = - kcalloc(auxpcm_pdata->mode_16k.num_slots, - sizeof(uint16_t), - GFP_KERNEL); + kzalloc(sizeof(uint16_t) * + auxpcm_pdata->mode_16k.num_slots, + GFP_KERNEL); if (!auxpcm_pdata->mode_16k.slot_mapping) { dev_err(&pdev->dev, "%s No mem for mode_16k slot mapping\n", diff --git a/techpack/audio/4.0/asoc/msm-dai-slim.c b/techpack/audio/4.0/asoc/msm-dai-slim.c index 3bebf565c2f0..545590fa3735 100644 --- a/techpack/audio/4.0/asoc/msm-dai-slim.c +++ b/techpack/audio/4.0/asoc/msm-dai-slim.c @@ -492,8 +492,8 @@ static int msm_dai_slim_populate_dai_data(struct device *dev, SET_DAI_STATE(dai_data_t->status, DAI_STATE_INITIALIZED); - dai_data_t->chan_h = devm_kcalloc(dev, - num_ch, sizeof(u16), + dai_data_t->chan_h = devm_kzalloc(dev, + sizeof(u16) * num_ch, GFP_KERNEL); if (!dai_data_t->chan_h) { dev_err(dev, @@ -503,8 +503,8 @@ static int msm_dai_slim_populate_dai_data(struct device *dev, goto err_mem_alloc; } - dai_data_t->sh_ch = devm_kcalloc(dev, - num_ch, sizeof(u16), + dai_data_t->sh_ch = devm_kzalloc(dev, + sizeof(u16) * num_ch, GFP_KERNEL); if (!dai_data_t->sh_ch) { dev_err(dev, diff --git a/techpack/audio/4.0/asoc/msm-lsm-client.c b/techpack/audio/4.0/asoc/msm-lsm-client.c index 9bcda9bf0fa5..d6fd86cc97a2 100644 --- a/techpack/audio/4.0/asoc/msm-lsm-client.c +++ b/techpack/audio/4.0/asoc/msm-lsm-client.c @@ -2576,7 +2576,7 @@ static int msm_lsm_send_ch_mix_config(struct snd_pcm_substream *substream) return 0; } - ch_wght_coeff = kcalloc(in_params->num_chs * pp_ch_cnt, sizeof(int), + ch_wght_coeff = kzalloc(in_params->num_chs * pp_ch_cnt * sizeof(int), GFP_KERNEL); if (!ch_wght_coeff) return -ENOMEM; diff --git a/techpack/audio/4.0/asoc/msm-pcm-routing-v2.c b/techpack/audio/4.0/asoc/msm-pcm-routing-v2.c index 856edb481ee5..f3b229410a19 100644 --- a/techpack/audio/4.0/asoc/msm-pcm-routing-v2.c +++ b/techpack/audio/4.0/asoc/msm-pcm-routing-v2.c @@ -10904,74 +10904,6 @@ static const struct snd_kcontrol_new sec_tdm_rx_2_mixer_controls[] = { msm_routing_put_audio_mixer), }; -static const struct snd_kcontrol_new quin_tdm_tx_1_mixer_controls[] = { - SOC_DOUBLE_EXT("MultiMedia1", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_1, - MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia2", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_1, - MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia3", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_1, - MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia4", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_1, - MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia5", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_1, - MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia6", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_1, - MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia7", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_1, - MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia8", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_1, - MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia9", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_1, - MSM_FRONTEND_DAI_MULTIMEDIA9, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia10", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_1, - MSM_FRONTEND_DAI_MULTIMEDIA10, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia11", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_1, - MSM_FRONTEND_DAI_MULTIMEDIA11, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia12", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_1, - MSM_FRONTEND_DAI_MULTIMEDIA12, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia13", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_1, - MSM_FRONTEND_DAI_MULTIMEDIA13, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia14", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_1, - MSM_FRONTEND_DAI_MULTIMEDIA14, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia15", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_1, - MSM_FRONTEND_DAI_MULTIMEDIA15, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia16", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_1, - MSM_FRONTEND_DAI_MULTIMEDIA16, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), -}; - -static const struct snd_kcontrol_new quin_tdm_rx_1_mixer_controls[] = { static const struct snd_kcontrol_new sec_tdm_rx_3_mixer_controls[] = { SOC_DOUBLE_EXT("MultiMedia1", SND_SOC_NOPM, MSM_BACKEND_DAI_SEC_TDM_RX_3, @@ -11272,74 +11204,6 @@ static const struct snd_kcontrol_new tert_tdm_tx_0_mixer_controls[] = { msm_routing_put_audio_mixer), }; -static const struct snd_kcontrol_new quin_tdm_tx_3_mixer_controls[] = { - SOC_DOUBLE_EXT("MultiMedia1", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_3, - MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia2", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_3, - MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia3", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_3, - MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia4", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_3, - MSM_FRONTEND_DAI_MULTIMEDIA4, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia5", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_3, - MSM_FRONTEND_DAI_MULTIMEDIA5, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia6", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_3, - MSM_FRONTEND_DAI_MULTIMEDIA6, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia7", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_3, - MSM_FRONTEND_DAI_MULTIMEDIA7, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia8", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_3, - MSM_FRONTEND_DAI_MULTIMEDIA8, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia9", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_3, - MSM_FRONTEND_DAI_MULTIMEDIA9, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia10", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_3, - MSM_FRONTEND_DAI_MULTIMEDIA10, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia11", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_3, - MSM_FRONTEND_DAI_MULTIMEDIA11, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia12", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_3, - MSM_FRONTEND_DAI_MULTIMEDIA12, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia13", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_3, - MSM_FRONTEND_DAI_MULTIMEDIA13, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia14", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_3, - MSM_FRONTEND_DAI_MULTIMEDIA14, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia15", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_3, - MSM_FRONTEND_DAI_MULTIMEDIA15, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia16", SND_SOC_NOPM, - MSM_BACKEND_DAI_QUIN_TDM_TX_3, - MSM_FRONTEND_DAI_MULTIMEDIA16, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), -}; - -static const struct snd_kcontrol_new quin_tdm_rx_3_mixer_controls[] = { static const struct snd_kcontrol_new tert_tdm_rx_1_mixer_controls[] = { SOC_DOUBLE_EXT("MultiMedia1", SND_SOC_NOPM, MSM_BACKEND_DAI_TERT_TDM_RX_1, @@ -28869,186 +28733,6 @@ static const struct snd_soc_dapm_route intercon_tdm[] = { {"AUDIO_REF_EC_UL10 MUX", "TERT_TDM_RX_2", "TERT_TDM_RX_2"}, {"AUDIO_REF_EC_UL10 MUX", "SEC_TDM_TX_0", "SEC_TDM_TX_0"}, - {"AUDIO_REF_EC_UL16 MUX", "PRI_MI2S_TX", "PRI_MI2S_TX"}, - {"AUDIO_REF_EC_UL16 MUX", "SEC_MI2S_TX", "SEC_MI2S_TX"}, - {"AUDIO_REF_EC_UL16 MUX", "TERT_MI2S_TX", "TERT_MI2S_TX"}, - {"AUDIO_REF_EC_UL16 MUX", "QUAT_MI2S_TX", "QUAT_MI2S_TX"}, - - {"AUDIO_REF_EC_UL17 MUX", "PRI_MI2S_TX", "PRI_MI2S_TX"}, - {"AUDIO_REF_EC_UL17 MUX", "SEC_MI2S_TX", "SEC_MI2S_TX"}, - {"AUDIO_REF_EC_UL17 MUX", "TERT_MI2S_TX", "TERT_MI2S_TX"}, - {"AUDIO_REF_EC_UL17 MUX", "QUAT_MI2S_TX", "QUAT_MI2S_TX"}, - - {"AUDIO_REF_EC_UL18 MUX", "PRI_MI2S_TX", "PRI_MI2S_TX"}, - {"AUDIO_REF_EC_UL18 MUX", "SEC_MI2S_TX", "SEC_MI2S_TX"}, - {"AUDIO_REF_EC_UL18 MUX", "TERT_MI2S_TX", "TERT_MI2S_TX"}, - {"AUDIO_REF_EC_UL18 MUX", "QUAT_MI2S_TX", "QUAT_MI2S_TX"}, - - {"AUDIO_REF_EC_UL19 MUX", "PRI_MI2S_TX", "PRI_MI2S_TX"}, - {"AUDIO_REF_EC_UL19 MUX", "SEC_MI2S_TX", "SEC_MI2S_TX"}, - {"AUDIO_REF_EC_UL19 MUX", "TERT_MI2S_TX", "TERT_MI2S_TX"}, - {"AUDIO_REF_EC_UL19 MUX", "QUAT_MI2S_TX", "QUAT_MI2S_TX"}, - - {"AUDIO_REF_EC_UL28 MUX", "PRI_MI2S_TX", "PRI_MI2S_TX"}, - {"AUDIO_REF_EC_UL28 MUX", "SEC_MI2S_TX", "SEC_MI2S_TX"}, - {"AUDIO_REF_EC_UL28 MUX", "TERT_MI2S_TX", "TERT_MI2S_TX"}, - {"AUDIO_REF_EC_UL28 MUX", "QUAT_MI2S_TX", "QUAT_MI2S_TX"}, - - {"AUDIO_REF_EC_UL29 MUX", "PRI_MI2S_TX", "PRI_MI2S_TX"}, - {"AUDIO_REF_EC_UL29 MUX", "SEC_MI2S_TX", "SEC_MI2S_TX"}, - {"AUDIO_REF_EC_UL29 MUX", "TERT_MI2S_TX", "TERT_MI2S_TX"}, - {"AUDIO_REF_EC_UL29 MUX", "QUAT_MI2S_TX", "QUAT_MI2S_TX"}, - - {"LSM1_UL_HL", NULL, "AUDIO_REF_EC_UL1 MUX"}, - {"LSM2_UL_HL", NULL, "AUDIO_REF_EC_UL1 MUX"}, - {"LSM3_UL_HL", NULL, "AUDIO_REF_EC_UL1 MUX"}, - {"LSM4_UL_HL", NULL, "AUDIO_REF_EC_UL1 MUX"}, - {"LSM5_UL_HL", NULL, "AUDIO_REF_EC_UL1 MUX"}, - {"LSM6_UL_HL", NULL, "AUDIO_REF_EC_UL1 MUX"}, - {"LSM7_UL_HL", NULL, "AUDIO_REF_EC_UL1 MUX"}, - {"LSM8_UL_HL", NULL, "AUDIO_REF_EC_UL1 MUX"}, - - {"MM_UL1", NULL, "AUDIO_REF_EC_UL1 MUX"}, - {"MM_UL2", NULL, "AUDIO_REF_EC_UL2 MUX"}, - {"MM_UL3", NULL, "AUDIO_REF_EC_UL3 MUX"}, - {"MM_UL4", NULL, "AUDIO_REF_EC_UL4 MUX"}, - {"MM_UL5", NULL, "AUDIO_REF_EC_UL5 MUX"}, - {"MM_UL6", NULL, "AUDIO_REF_EC_UL6 MUX"}, - {"MM_UL8", NULL, "AUDIO_REF_EC_UL8 MUX"}, - {"MM_UL9", NULL, "AUDIO_REF_EC_UL9 MUX"}, - {"MM_UL10", NULL, "AUDIO_REF_EC_UL10 MUX"}, - {"MM_UL16", NULL, "AUDIO_REF_EC_UL16 MUX"}, - {"MM_UL17", NULL, "AUDIO_REF_EC_UL17 MUX"}, - {"MM_UL18", NULL, "AUDIO_REF_EC_UL18 MUX"}, - {"MM_UL19", NULL, "AUDIO_REF_EC_UL19 MUX"}, - {"MM_UL28", NULL, "AUDIO_REF_EC_UL28 MUX"}, - {"MM_UL29", NULL, "AUDIO_REF_EC_UL29 MUX"}, - {"MM_UL30", NULL, "AUDIO_REF_EC_UL30 MUX"}, - - {"VoiceMMode1_Tx Mixer", "PRI_TX_MMode1", "PRI_I2S_TX"}, - {"VoiceMMode1_Tx Mixer", "PRI_MI2S_TX_MMode1", "PRI_MI2S_TX"}, - {"VoiceMMode1_Tx Mixer", "MI2S_TX_MMode1", "MI2S_TX"}, - {"VoiceMMode1_Tx Mixer", "SEC_MI2S_TX_MMode1", "SEC_MI2S_TX"}, - {"VoiceMMode1_Tx Mixer", "TERT_MI2S_TX_MMode1", "TERT_MI2S_TX"}, - {"VoiceMMode1_Tx Mixer", "INT3_MI2S_TX_MMode1", "INT3_MI2S_TX"}, - {"VoiceMMode1_Tx Mixer", "SLIM_0_TX_MMode1", "SLIMBUS_0_TX"}, - {"VoiceMMode1_Tx Mixer", "SLIM_7_TX_MMode1", "SLIMBUS_7_TX"}, - {"VoiceMMode1_Tx Mixer", "SLIM_8_TX_MMode1", "SLIMBUS_8_TX"}, - {"VoiceMMode1_Tx Mixer", "USB_AUDIO_TX_MMode1", "USB_AUDIO_TX"}, - {"VoiceMMode1_Tx Mixer", "INT_BT_SCO_TX_MMode1", "INT_BT_SCO_TX"}, - {"VoiceMMode1_Tx Mixer", "AFE_PCM_TX_MMode1", "PCM_TX"}, - {"VoiceMMode1_Tx Mixer", "AUX_PCM_TX_MMode1", "AUX_PCM_TX"}, - {"VoiceMMode1_Tx Mixer", "SEC_AUX_PCM_TX_MMode1", "SEC_AUX_PCM_TX"}, - {"VoiceMMode1_Tx Mixer", "TERT_AUX_PCM_TX_MMode1", "TERT_AUX_PCM_TX"}, - {"VoiceMMode1_Tx Mixer", "QUAT_AUX_PCM_TX_MMode1", "QUAT_AUX_PCM_TX"}, - {"VoiceMMode1_Tx Mixer", "QUIN_AUX_PCM_TX_MMode1", "QUIN_AUX_PCM_TX"}, - {"VoiceMMode1_Tx Mixer", "SEN_AUX_PCM_TX_MMode1", "SEN_AUX_PCM_TX"}, - {"VoiceMMode1_Tx Mixer", "QUAT_TDM_TX_0_MMode1", "QUAT_TDM_TX_0"}, - {"VoiceMMode1_Tx Mixer", "TX_CDC_DMA_TX_0_MMode1", "TX_CDC_DMA_TX_0"}, - {"VoiceMMode1_Tx Mixer", "TX_CDC_DMA_TX_1_MMode1", "TX_CDC_DMA_TX_1"}, - {"VoiceMMode1_Tx Mixer", "TX_CDC_DMA_TX_2_MMode1", "TX_CDC_DMA_TX_2"}, - {"VoiceMMode1_Tx Mixer", "TX_CDC_DMA_TX_3_MMode1", "TX_CDC_DMA_TX_3"}, - {"VoiceMMode1_Tx Mixer", "TX_CDC_DMA_TX_4_MMode1", "TX_CDC_DMA_TX_4"}, - {"VoiceMMode1_Tx Mixer", "TX_CDC_DMA_TX_5_MMode1", "TX_CDC_DMA_TX_5"}, - {"VoiceMMode1_Tx Mixer", "QUAT_MI2S_TX_MMode1", "QUAT_MI2S_TX"}, - {"VoiceMMode1_Tx Mixer", "QUIN_MI2S_TX_MMode1", "QUIN_MI2S_TX"}, - {"VoiceMMode1_Tx Mixer", "PRI_TDM_TX_3_MMode1", "PRI_TDM_TX_3"}, - {"VOICEMMODE1_UL", NULL, "VoiceMMode1_Tx Mixer"}, - - {"VoiceMMode2_Tx Mixer", "PRI_TX_MMode2", "PRI_I2S_TX"}, - {"VoiceMMode2_Tx Mixer", "PRI_MI2S_TX_MMode2", "PRI_MI2S_TX"}, - {"VoiceMMode2_Tx Mixer", "SEC_MI2S_TX_MMode2", "SEC_MI2S_TX"}, - {"VoiceMMode2_Tx Mixer", "MI2S_TX_MMode2", "MI2S_TX"}, - {"VoiceMMode2_Tx Mixer", "TERT_MI2S_TX_MMode2", "TERT_MI2S_TX"}, - {"VoiceMMode2_Tx Mixer", "INT3_MI2S_TX_MMode2", "INT3_MI2S_TX"}, - {"VoiceMMode2_Tx Mixer", "SLIM_0_TX_MMode2", "SLIMBUS_0_TX"}, - {"VoiceMMode2_Tx Mixer", "SLIM_7_TX_MMode2", "SLIMBUS_7_TX"}, - {"VoiceMMode2_Tx Mixer", "SLIM_8_TX_MMode2", "SLIMBUS_8_TX"}, - {"VoiceMMode2_Tx Mixer", "USB_AUDIO_TX_MMode2", "USB_AUDIO_TX"}, - {"VoiceMMode2_Tx Mixer", "INT_BT_SCO_TX_MMode2", "INT_BT_SCO_TX"}, - {"VoiceMMode2_Tx Mixer", "AFE_PCM_TX_MMode2", "PCM_TX"}, - {"VoiceMMode2_Tx Mixer", "AUX_PCM_TX_MMode2", "AUX_PCM_TX"}, - {"VoiceMMode2_Tx Mixer", "SEC_AUX_PCM_TX_MMode2", "SEC_AUX_PCM_TX"}, - {"VoiceMMode2_Tx Mixer", "TERT_AUX_PCM_TX_MMode2", "TERT_AUX_PCM_TX"}, - {"VoiceMMode2_Tx Mixer", "QUAT_AUX_PCM_TX_MMode2", "QUAT_AUX_PCM_TX"}, - {"VoiceMMode2_Tx Mixer", "QUIN_AUX_PCM_TX_MMode2", "QUIN_AUX_PCM_TX"}, - {"VoiceMMode2_Tx Mixer", "SEN_AUX_PCM_TX_MMode2", "SEN_AUX_PCM_TX"}, - {"VoiceMMode2_Tx Mixer", "TX_CDC_DMA_TX_0_MMode2", "TX_CDC_DMA_TX_0"}, - {"VoiceMMode2_Tx Mixer", "TX_CDC_DMA_TX_1_MMode2", "TX_CDC_DMA_TX_1"}, - {"VoiceMMode2_Tx Mixer", "TX_CDC_DMA_TX_2_MMode2", "TX_CDC_DMA_TX_2"}, - {"VoiceMMode2_Tx Mixer", "TX_CDC_DMA_TX_3_MMode2", "TX_CDC_DMA_TX_3"}, - {"VoiceMMode2_Tx Mixer", "TX_CDC_DMA_TX_4_MMode2", "TX_CDC_DMA_TX_4"}, - {"VoiceMMode2_Tx Mixer", "TX_CDC_DMA_TX_5_MMode2", "TX_CDC_DMA_TX_5"}, - {"VoiceMMode2_Tx Mixer", "QUAT_MI2S_TX_MMode2", "QUAT_MI2S_TX"}, - {"VoiceMMode2_Tx Mixer", "QUIN_MI2S_TX_MMode2", "QUIN_MI2S_TX"}, - {"VoiceMMode2_Tx Mixer", "PRI_TDM_TX_3_MMode2", "PRI_TDM_TX_3"}, - {"VOICEMMODE2_UL", NULL, "VoiceMMode2_Tx Mixer"}, - - {"Voip_Tx Mixer", "PRI_TX_Voip", "PRI_I2S_TX"}, - {"Voip_Tx Mixer", "MI2S_TX_Voip", "MI2S_TX"}, - {"Voip_Tx Mixer", "SEC_MI2S_TX_Voip", "SEC_MI2S_TX"}, - {"Voip_Tx Mixer", "TERT_MI2S_TX_Voip", "TERT_MI2S_TX"}, - {"Voip_Tx Mixer", "INT3_MI2S_TX_Voip", "INT3_MI2S_TX"}, - {"Voip_Tx Mixer", "SLIM_0_TX_Voip", "SLIMBUS_0_TX"}, - {"Voip_Tx Mixer", "SLIM_7_TX_Voip", "SLIMBUS_7_TX"}, - {"Voip_Tx Mixer", "SLIM_8_TX_Voip", "SLIMBUS_8_TX"}, - {"Voip_Tx Mixer", "USB_AUDIO_TX_Voip", "USB_AUDIO_TX"}, - {"Voip_Tx Mixer", "INTERNAL_BT_SCO_TX_Voip", "INT_BT_SCO_TX"}, - {"Voip_Tx Mixer", "AFE_PCM_TX_Voip", "PCM_TX"}, - {"Voip_Tx Mixer", "AUX_PCM_TX_Voip", "AUX_PCM_TX"}, - {"Voip_Tx Mixer", "SEC_AUX_PCM_TX_Voip", "SEC_AUX_PCM_TX"}, - {"Voip_Tx Mixer", "TERT_AUX_PCM_TX_Voip", "TERT_AUX_PCM_TX"}, - {"Voip_Tx Mixer", "QUAT_AUX_PCM_TX_Voip", "QUAT_AUX_PCM_TX"}, - {"Voip_Tx Mixer", "QUIN_AUX_PCM_TX_Voip", "QUIN_AUX_PCM_TX"}, - {"Voip_Tx Mixer", "SEN_AUX_PCM_TX_Voip", "SEN_AUX_PCM_TX"}, - {"Voip_Tx Mixer", "PRI_MI2S_TX_Voip", "PRI_MI2S_TX"}, - {"Voip_Tx Mixer", "PRI_TDM_TX_3_Voip", "PRI_TDM_TX_3"}, - {"Voip_Tx Mixer", "TX_CDC_DMA_TX_0_Voip", "TX_CDC_DMA_TX_0"}, - {"Voip_Tx Mixer", "TX_CDC_DMA_TX_1_Voip", "TX_CDC_DMA_TX_1"}, - {"Voip_Tx Mixer", "TX_CDC_DMA_TX_2_Voip", "TX_CDC_DMA_TX_2"}, - {"Voip_Tx Mixer", "TX_CDC_DMA_TX_3_Voip", "TX_CDC_DMA_TX_3"}, - {"Voip_Tx Mixer", "TX_CDC_DMA_TX_4_Voip", "TX_CDC_DMA_TX_4"}, - {"Voip_Tx Mixer", "TX_CDC_DMA_TX_5_Voip", "TX_CDC_DMA_TX_5"}, - {"VOIP_UL", NULL, "Voip_Tx Mixer"}, - - {"SLIMBUS_DL_HL", "Switch", "SLIM0_DL_HL"}, - {"SLIMBUS_0_RX", NULL, "SLIMBUS_DL_HL"}, - {"SLIMBUS1_DL_HL", "Switch", "SLIM1_DL_HL"}, - {"SLIMBUS_1_RX", NULL, "SLIMBUS1_DL_HL"}, - {"SLIMBUS3_DL_HL", "Switch", "SLIM3_DL_HL"}, - {"SLIMBUS_3_RX", NULL, "SLIMBUS3_DL_HL"}, - {"SLIMBUS4_DL_HL", "Switch", "SLIM4_DL_HL"}, - {"SLIMBUS_4_RX", NULL, "SLIMBUS4_DL_HL"}, - {"SLIMBUS6_DL_HL", "Switch", "SLIM0_DL_HL"}, - {"SLIMBUS_6_RX", NULL, "SLIMBUS6_DL_HL"}, - {"SCO_SLIM7_DL_HL", "Switch", "SLIM7_DL_HL"}, - {"SLIMBUS_7_RX", NULL, "SCO_SLIM7_DL_HL"}, - {"SLIM0_UL_HL", NULL, "SLIMBUS_0_TX"}, - {"SLIM1_UL_HL", NULL, "SLIMBUS_1_TX"}, - {"SLIM3_UL_HL", NULL, "SLIMBUS_3_TX"}, - {"SLIM4_UL_HL", NULL, "SLIMBUS_4_TX"}, - {"SLIM8_UL_HL", NULL, "SLIMBUS_8_TX"}, - {"WSA_CDC_DMA_RX_0_DL_HL", "Switch", "CDC_DMA_DL_HL"}, - {"WSA_CDC_DMA_RX_0", NULL, "WSA_CDC_DMA_RX_0_DL_HL"}, - {"CDC_DMA_UL_HL", NULL, "VA_CDC_DMA_TX_0"}, - {"RX_CDC_DMA_RX_0_DL_HL", "Switch", "CDC_DMA_DL_HL"}, - {"RX_CDC_DMA_RX_0", NULL, "RX_CDC_DMA_RX_0_DL_HL"}, - {"RX_CDC_DMA_RX_1", NULL, "RX_CDC_DMA_RX_0_DL_HL"}, - {"RX_CDC_DMA_RX_1_DL_HL", "Switch", "CDC_DMA_DL_HL"}, - {"RX_CDC_DMA_RX_1", NULL, "RX_CDC_DMA_RX_1_DL_HL"}, - {"TX3_CDC_DMA_UL_HL", NULL, "TX_CDC_DMA_TX_3"}, - {"LSM1 Mixer", "SLIMBUS_0_TX", "SLIMBUS_0_TX"}, - {"LSM1 Mixer", "SLIMBUS_1_TX", "SLIMBUS_1_TX"}, - {"LSM1 Mixer", "SLIMBUS_3_TX", "SLIMBUS_3_TX"}, - {"LSM1 Mixer", "SLIMBUS_4_TX", "SLIMBUS_4_TX"}, - {"LSM1 Mixer", "SLIMBUS_5_TX", "SLIMBUS_5_TX"}, - {"LSM1 Mixer", "TERT_MI2S_TX", "TERT_MI2S_TX"}, - {"LSM1 Mixer", "QUAT_MI2S_TX", "QUAT_MI2S_TX"}, - {"LSM1 Mixer", "INT3_MI2S_TX", "INT3_MI2S_TX"}, - {"LSM1 Mixer", "VA_CDC_DMA_TX_0", "VA_CDC_DMA_TX_0"}, - {"LSM1 Mixer", "VA_CDC_DMA_TX_1", "VA_CDC_DMA_TX_1"}, - {"LSM1 Mixer", "VA_CDC_DMA_TX_2", "VA_CDC_DMA_TX_2"}, - {"LSM1 Mixer", "TX_CDC_DMA_TX_3", "TX_CDC_DMA_TX_3"}, {"LSM1 Mixer", "QUIN_TDM_TX_0", "QUIN_TDM_TX_0"}, {"LSM1 Mixer", "TERT_TDM_TX_0", "TERT_TDM_TX_0"}, {"LSM2 Mixer", "QUIN_TDM_TX_0", "QUIN_TDM_TX_0"}, diff --git a/techpack/audio/4.0/dsp/Android.mk b/techpack/audio/4.0/dsp/Android.mk deleted file mode 100644 index 172fbee3f895..000000000000 --- a/techpack/audio/4.0/dsp/Android.mk +++ /dev/null @@ -1,104 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,msmnile),true) -ifeq ($(TARGET_PRODUCT), $(filter $(TARGET_PRODUCT), msmnile_au msmnile_gvmq)) -AUDIO_SELECT := CONFIG_SND_SOC_SA8155=m -else -AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m -endif -endif - -ifeq ($(call is-board-platform,$(MSMSTEPPE) $(TRINKET)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -ifeq ($(call is-board-platform, kona),true) -AUDIO_SELECT := CONFIG_SND_SOC_KONA=m -endif - -ifeq ($(call is-board-platform, lito),true) -AUDIO_SELECT := CONFIG_SND_SOC_LITO=m -endif - -ifeq ($(call is-board-platform, atoll),true) -AUDIO_SELECT := CONFIG_SND_SOC_ATOLL=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) atoll kona lito),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=q6_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_q6.ko -LOCAL_MODULE_KBUILD_NAME := q6_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_adsp_loader.ko -LOCAL_MODULE_KBUILD_NAME := adsp_loader_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_q6_notifier.ko -LOCAL_MODULE_KBUILD_NAME := q6_notifier_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -############################################################ -ifneq ($(TARGET_PRODUCT), $(filter $(TARGET_PRODUCT), msmnile_au msmnile_gvmq)) -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_usf.ko -LOCAL_MODULE_KBUILD_NAME := usf_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################## -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_q6_pdr.ko -LOCAL_MODULE_KBUILD_NAME := q6_pdr_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -endif -########################################################### -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/4.0/dsp/adsp-loader.c b/techpack/audio/4.0/dsp/adsp-loader.c index 673fbff0eb14..c0dbe3f4f438 100644 --- a/techpack/audio/4.0/dsp/adsp-loader.c +++ b/techpack/audio/4.0/dsp/adsp-loader.c @@ -371,8 +371,8 @@ static int adsp_loader_probe(struct platform_device *pdev) goto wqueue; } - adsp_fw_bit_values = devm_kcalloc(&pdev->dev, - adsp_fw_cnt, sizeof(u32), GFP_KERNEL); + adsp_fw_bit_values = devm_kzalloc(&pdev->dev, + adsp_fw_cnt * sizeof(u32), GFP_KERNEL); if (!adsp_fw_bit_values) goto wqueue; @@ -387,8 +387,8 @@ static int adsp_loader_probe(struct platform_device *pdev) goto wqueue; } - adsp_fw_name_array = devm_kcalloc(&pdev->dev, - adsp_fw_cnt, sizeof(char *), GFP_KERNEL); + adsp_fw_name_array = devm_kzalloc(&pdev->dev, + adsp_fw_cnt * sizeof(char *), GFP_KERNEL); if (!adsp_fw_name_array) goto wqueue; diff --git a/techpack/audio/4.0/dsp/codecs/Android.mk b/techpack/audio/4.0/dsp/codecs/Android.mk deleted file mode 100644 index 48e3b8568f6e..000000000000 --- a/techpack/audio/4.0/dsp/codecs/Android.mk +++ /dev/null @@ -1,66 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,msmnile),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m -endif - -ifeq ($(call is-board-platform,$(MSMSTEPPE) $(TRINKET)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -ifeq ($(call is-board-platform,kona),true) -AUDIO_SELECT := CONFIG_SND_SOC_KONA=m -endif - -ifeq ($(call is-board-platform,lito),true) -AUDIO_SELECT := CONFIG_SND_SOC_LITO=m -endif - -ifeq ($(call is-board-platform,atoll),true) -AUDIO_SELECT := CONFIG_SND_SOC_ATOLL=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) atoll kona lito),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=native_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_native.ko -LOCAL_MODULE_KBUILD_NAME := native_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/4.0/dsp/q6asm.c b/techpack/audio/4.0/dsp/q6asm.c index 8acd2330b84b..bb1df5b24432 100644 --- a/techpack/audio/4.0/dsp/q6asm.c +++ b/techpack/audio/4.0/dsp/q6asm.c @@ -309,7 +309,7 @@ static ssize_t audio_output_latency_dbgfs_write(struct file *file, pr_err("%s: err count is more %zd\n", __func__, count); return -EINVAL; } - temp = kmalloc(2, GFP_KERNEL); + temp = kmalloc(2*sizeof(char), GFP_KERNEL); out_cold_index = 0; @@ -365,7 +365,7 @@ static ssize_t audio_input_latency_dbgfs_write(struct file *file, pr_err("%s: err count is more %zd\n", __func__, count); return -EINVAL; } - temp = kmalloc(2, GFP_KERNEL); + temp = kmalloc(2*sizeof(char), GFP_KERNEL); if (temp) { if (copy_from_user(temp, buf, 2*sizeof(char))) { @@ -8472,7 +8472,7 @@ static int q6asm_memory_map_regions(struct audio_client *ac, int dir, return -EINVAL; } - buffer_node = kcalloc(bufcnt, sizeof(struct asm_buffer_node), + buffer_node = kzalloc(sizeof(struct asm_buffer_node) * bufcnt, GFP_KERNEL); if (!buffer_node) return -ENOMEM; diff --git a/techpack/audio/4.0/dsp/q6lsm.c b/techpack/audio/4.0/dsp/q6lsm.c index ca149618c8aa..8ad6ed624002 100644 --- a/techpack/audio/4.0/dsp/q6lsm.c +++ b/techpack/audio/4.0/dsp/q6lsm.c @@ -2554,9 +2554,8 @@ int q6lsm_lab_buffer_alloc(struct lsm_client *client, bool alloc) out_params->buf_sz; allocate_size = PAGE_ALIGN(allocate_size); client->lab_buffer = - kcalloc(out_params->period_count, - sizeof(struct lsm_lab_buffer), - GFP_KERNEL); + kzalloc(sizeof(struct lsm_lab_buffer) * + out_params->period_count, GFP_KERNEL); if (!client->lab_buffer) { pr_err("%s: memory allocation for lab buffer failed count %d\n" , __func__, diff --git a/techpack/audio/4.0/dsp/q6usm.c b/techpack/audio/4.0/dsp/q6usm.c index 94a88afe2aef..cd024fce8139 100644 --- a/techpack/audio/4.0/dsp/q6usm.c +++ b/techpack/audio/4.0/dsp/q6usm.c @@ -306,7 +306,7 @@ struct us_client *q6usm_us_client_alloc( if (usc == NULL) return NULL; - p_mem_handle = kcalloc(4, sizeof(uint32_t), GFP_KERNEL); + p_mem_handle = kzalloc(sizeof(uint32_t) * 4, GFP_KERNEL); if (p_mem_handle == NULL) { kfree(usc); return NULL; diff --git a/techpack/audio/4.0/include/uapi/Android.mk b/techpack/audio/4.0/include/uapi/Android.mk deleted file mode 100644 index f19a6c20337e..000000000000 --- a/techpack/audio/4.0/include/uapi/Android.mk +++ /dev/null @@ -1,30 +0,0 @@ -# Use this by setting -# LOCAL_HEADER_LIBRARIES := audio_kernel_headers - -LOCAL_PATH := $(call my-dir) -MYLOCAL_PATH := $(LOCAL_PATH) - -UAPI_OUT := $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/include - -AUDIO_KERNEL_HEADERS := $(call all-named-files-under,*.h,linux) $(call all-named-files-under,*.h,sound) - -HEADER_INSTALL_DIR := kernel/msm-$(TARGET_KERNEL_VERSION)/scripts - -BUILD_ROOT_RELATIVE := ../../../../../../../ - -include $(CLEAR_VARS) -LOCAL_MODULE := audio_kernel_headers -LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_PREBUILT_INT_KERNEL) -LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr - -GEN := $(addprefix $(UAPI_OUT)/,$(AUDIO_KERNEL_HEADERS)) -$(GEN): $(KERNEL_USR) -$(GEN): PRIVATE_PATH := $(MYLOCAL_PATH) -$(GEN): PRIVATE_CUSTOM_TOOL = $(shell cd $(PRODUCT_OUT)/obj/KERNEL_OBJ; $(BUILD_ROOT_RELATIVE)$(HEADER_INSTALL_DIR)/headers_install.sh $(BUILD_ROOT_RELATIVE)$(dir $@) $(BUILD_ROOT_RELATIVE)$(subst $(UAPI_OUT),$(MYLOCAL_PATH),$(dir $@)) $(notdir $@)) -$(GEN): $(addprefix $(MYLOCAL_PATH)/,$(AUDIO_KERNEL_HEADERS)) - $(transform-generated-source) - -LOCAL_GENERATED_SOURCES := $(GEN) -LOCAL_EXPORT_C_INCLUDE_DIRS := $(UAPI_OUT) - -include $(BUILD_HEADER_LIBRARY) diff --git a/techpack/audio/4.0/include/uapi/linux/msm_audio_calibration.h b/techpack/audio/4.0/include/uapi/linux/msm_audio_calibration.h index e8ba1b3c206a..35b596062247 100644 --- a/techpack/audio/4.0/include/uapi/linux/msm_audio_calibration.h +++ b/techpack/audio/4.0/include/uapi/linux/msm_audio_calibration.h @@ -104,7 +104,6 @@ enum { ADM_LSM_TOPOLOGY_CAL_TYPE, ADM_LSM_AUDPROC_CAL_TYPE, ADM_LSM_AUDPROC_PERSISTENT_CAL_TYPE, - ADM_AUDPROC_PERSISTENT_CAL_TYPE, MAX_CAL_TYPES, }; @@ -118,7 +117,6 @@ enum { #define ADM_LSM_TOPOLOGY_CAL_TYPE ADM_LSM_TOPOLOGY_CAL_TYPE #define ADM_LSM_AUDPROC_CAL_TYPE ADM_LSM_AUDPROC_CAL_TYPE #define ADM_LSM_AUDPROC_PERSISTENT_CAL_TYPE ADM_LSM_AUDPROC_PERSISTENT_CAL_TYPE -#define ADM_AUDPROC_PERSISTENT_CAL_TYPE ADM_AUDPROC_PERSISTENT_CAL_TYPE #define LSM_CAL_TYPES #define TOPOLOGY_SPECIFIC_CHANNEL_INFO diff --git a/techpack/audio/4.0/ipc/Android.mk b/techpack/audio/4.0/ipc/Android.mk deleted file mode 100644 index 25b98dd09d9b..000000000000 --- a/techpack/audio/4.0/ipc/Android.mk +++ /dev/null @@ -1,81 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,msmnile),true) -ifeq ($(TARGET_PRODUCT), $(filter $(TARGET_PRODUCT), msmnile_au msmnile_gvmq)) -AUDIO_SELECT := CONFIG_SND_SOC_SA8155=m -else -AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m -endif -endif - -ifeq ($(call is-board-platform,$(MSMSTEPPE) $(TRINKET)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -ifeq ($(call is-board-platform,kona),true) -AUDIO_SELECT := CONFIG_SND_SOC_KONA=m -endif - -ifeq ($(call is-board-platform,atoll),true) -AUDIO_SELECT := CONFIG_SND_SOC_ATOLL=m -endif - -ifeq ($(call is-board-platform,lito),true) -AUDIO_SELECT := CONFIG_SND_SOC_LITO=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) atoll kona lito),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=apr_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_apr.ko -LOCAL_MODULE_KBUILD_NAME := apr_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET)),true) -ifneq ($(TARGET_PRODUCT), $(filter $(TARGET_PRODUCT), msmnile_au msmnile_gvmq)) -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wglink.ko -LOCAL_MODULE_KBUILD_NAME := wglink_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -endif -endif -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/4.0/soc/Android.mk b/techpack/audio/4.0/soc/Android.mk deleted file mode 100644 index 83101fceaded..000000000000 --- a/techpack/audio/4.0/soc/Android.mk +++ /dev/null @@ -1,103 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,msmnile),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m -endif - -ifeq ($(call is-board-platform,$(MSMSTEPPE) $(TRINKET)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -ifeq ($(call is-board-platform,kona),true) -AUDIO_SELECT := CONFIG_SND_SOC_KONA=m -endif - -ifeq ($(call is-board-platform,lito),true) -AUDIO_SELECT := CONFIG_SND_SOC_LITO=m -endif - -ifeq ($(call is-board-platform,atoll),true) -AUDIO_SELECT := CONFIG_SND_SOC_ATOLL=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito atoll),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=soc_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) $(TRINKET) atoll kona lito),true) -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_pinctrl_lpi.ko -LOCAL_MODULE_KBUILD_NAME := pinctrl_lpi_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -endif -########################################################### -ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) $(TRINKET) kona), true) -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_pinctrl_wcd.ko -LOCAL_MODULE_KBUILD_NAME := pinctrl_wcd_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -endif -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_swr.ko -LOCAL_MODULE_KBUILD_NAME := swr_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_swr_ctrl.ko -LOCAL_MODULE_KBUILD_NAME := swr_ctrl_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -ifeq ($(call is-board-platform-in-list, $(MSMSTEPPE) kona lito atoll),true) -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_snd_event.ko -LOCAL_MODULE_KBUILD_NAME := snd_event_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -endif -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/4.0/soc/pinctrl-wcd.c b/techpack/audio/4.0/soc/pinctrl-wcd.c index ff4c4718b8ab..437563f0a8a0 100644 --- a/techpack/audio/4.0/soc/pinctrl-wcd.c +++ b/techpack/audio/4.0/soc/pinctrl-wcd.c @@ -331,8 +331,7 @@ static int wcd_pinctrl_probe(struct platform_device *pdev) goto err_name_alloc; } for (i = 0; i < npins; i++, pindesc++) { - name[i] = devm_kzalloc(dev, - WCD_GPIO_STRING_LEN, + name[i] = devm_kzalloc(dev, sizeof(char) * WCD_GPIO_STRING_LEN, GFP_KERNEL); if (!name[i]) { ret = -ENOMEM; diff --git a/techpack/audio/4.0/soc/swr-mstr-ctrl.c b/techpack/audio/4.0/soc/swr-mstr-ctrl.c index cfb6777cc30f..847c90d71fb3 100644 --- a/techpack/audio/4.0/soc/swr-mstr-ctrl.c +++ b/techpack/audio/4.0/soc/swr-mstr-ctrl.c @@ -3204,8 +3204,8 @@ static int swrm_alloc_port_mem(struct device *dev, struct swr_mstr_ctrl *swrm, u32 uc, u32 size) { if (!swrm->port_param) { - swrm->port_param = devm_kcalloc(dev, - SWR_UC_MAX, sizeof(swrm->port_param), + swrm->port_param = devm_kzalloc(dev, + sizeof(swrm->port_param) * SWR_UC_MAX, GFP_KERNEL); if (!swrm->port_param) return -ENOMEM; diff --git a/techpack/audio/Android.mk b/techpack/audio/Android.mk deleted file mode 100644 index 1df2cfb9da17..000000000000 --- a/techpack/audio/Android.mk +++ /dev/null @@ -1,83 +0,0 @@ -# Android makefile for audio kernel modules -MY_LOCAL_PATH := $(call my-dir) - -ifeq ($(call is-board-platform-in-list,msm8953 sdm845 sdm670 sdm660 qcs605 msmnile $(MSMSTEPPE) $(TRINKET)),true) -UAPI_OUT := $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/include - -$(shell mkdir -p $(UAPI_OUT)/linux;) -$(shell mkdir -p $(UAPI_OUT)/sound;) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/codecs/Module.symvers) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd934x/Module.symvers) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/tfa98xx/Module.symvers) - -include $(MY_LOCAL_PATH)/include/uapi/Android.mk -include $(MY_LOCAL_PATH)/ipc/Android.mk -include $(MY_LOCAL_PATH)/dsp/Android.mk -include $(MY_LOCAL_PATH)/dsp/codecs/Android.mk -include $(MY_LOCAL_PATH)/soc/Android.mk -include $(MY_LOCAL_PATH)/asoc/Android.mk -include $(MY_LOCAL_PATH)/asoc/codecs/Android.mk -include $(MY_LOCAL_PATH)/asoc/codecs/wcd934x/Android.mk -include $(MY_LOCAL_PATH)/asoc/codecs/tas2557/Android.mk -include $(MY_LOCAL_PATH)/asoc/codecs/cs35l41/Android.mk -include $(MY_LOCAL_PATH)/asoc/codecs/tfa98xx/Android.mk -endif - -ifeq ($(call is-board-platform-in-list, atoll),true) -UAPI_OUT := $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/4.0/include - -$(shell mkdir -p $(UAPI_OUT)/linux;) -$(shell mkdir -p $(UAPI_OUT)/sound;) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/4.0/ipc/Module.symvers) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/4.0/dsp/Module.symvers) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/4.0/dsp/codecs/Module.symvers) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/4.0/soc/Module.symvers) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/4.0/asoc/Module.symvers) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/4.0/asoc/codecs/Module.symvers) - -include $(MY_LOCAL_PATH)/4.0/include/uapi/Android.mk -include $(MY_LOCAL_PATH)/4.0/ipc/Android.mk -include $(MY_LOCAL_PATH)/4.0/dsp/Android.mk -include $(MY_LOCAL_PATH)/4.0/dsp/codecs/Android.mk -include $(MY_LOCAL_PATH)/4.0/soc/Android.mk -include $(MY_LOCAL_PATH)/4.0/asoc/Android.mk -include $(MY_LOCAL_PATH)/4.0/asoc/codecs/Android.mk -endif - -ifeq ($(call is-board-platform-in-list,sdm670 msmnile),true) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/aqt1000/Module.symvers) -include $(MY_LOCAL_PATH)/asoc/codecs/aqt1000/Android.mk -endif - -ifeq ($(call is-board-platform-in-list, $(MSMSTEPPE) $(TRINKET)),true) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/bolero/Module.symvers) -include $(MY_LOCAL_PATH)/asoc/codecs/bolero/Android.mk -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd937x/Module.symvers) -include $(MY_LOCAL_PATH)/asoc/codecs/wcd937x/Android.mk -endif - -ifeq ($(call is-board-platform-in-list, atoll),true) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/4.0/asoc/codecs/bolero/Module.symvers) -include $(MY_LOCAL_PATH)/4.0/asoc/codecs/bolero/Android.mk -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/4.0/asoc/codecs/wcd937x/Module.symvers) -include $(MY_LOCAL_PATH)/4.0/asoc/codecs/wcd937x/Android.mk -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/4.0/asoc/codecs/wcd938x/Module.symvers) -include $(MY_LOCAL_PATH)/4.0/asoc/codecs/wcd938x/Android.mk -endif - -ifeq ($(call is-board-platform-in-list,msm8953 sdm670 sdm660 qcs605),true) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/sdm660_cdc/Module.symvers) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/msm_sdw/Module.symvers) -include $(MY_LOCAL_PATH)/asoc/codecs/sdm660_cdc/Android.mk -include $(MY_LOCAL_PATH)/asoc/codecs/msm_sdw/Android.mk -endif - -ifeq ($(call is-board-platform-in-list,msmnile),true) -$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd9360/Module.symvers) -include $(MY_LOCAL_PATH)/asoc/codecs/wcd9360/Android.mk -endif diff --git a/techpack/audio/Makefile b/techpack/audio/Makefile index 53cea8360fa2..7368626a898d 100644 --- a/techpack/audio/Makefile +++ b/techpack/audio/Makefile @@ -17,7 +17,7 @@ export endif ifeq ($(CONFIG_ARCH_SM8150), y) include $(srctree)/techpack/audio/config/sm8150auto.conf -export $(shell sed 's/=.*//' $(srctree)/techpack/audio/config/sm8150auto.conf) +export $(shell sed 's/=.*//' $(srctree)/techpack/audio/config/sm8150auto.conf) endif ifeq ($(CONFIG_ARCH_SDMSHRIKE), y) include $(srctree)/techpack/audio/config/sm8150auto.conf @@ -32,15 +32,17 @@ USERINCLUDE += \ # Needed to be compatible with the O= option LINUXINCLUDE += \ -I$(srctree)/techpack/audio/include/uapi \ - -I$(srctree)/techpack/audio/include/elliptic \ -I$(srctree)/techpack/audio/include -#for mius start +ifeq ($(CONFIG_ELLIPTIC_ULTRASOUND), y) +LINUXINCLUDE += \ + -I$(srctree)/techpack/audio/include/elliptic +endif + ifeq ($(CONFIG_US_PROXIMITY), y) LINUXINCLUDE += \ -I$(srctree)/techpack/audio/include/mius endif -#for mius end ifeq ($(CONFIG_ARCH_SDM845), y) LINUXINCLUDE += \ @@ -69,13 +71,5 @@ endif obj-y += soc/ obj-y += dsp/ -ifeq ($(CONFIG_ELLIPTIC_ULTRASOUND), y) -obj-y += dsp/elliptic -endif -#for mius start -ifeq ($(CONFIG_US_PROXIMITY), y) -obj-y += dsp/mius -endif -#for mius end obj-y += ipc/ obj-y += asoc/ diff --git a/techpack/audio/asoc/Android.mk b/techpack/audio/asoc/Android.mk deleted file mode 100644 index 3a495a5e3fa7..000000000000 --- a/techpack/audio/asoc/Android.mk +++ /dev/null @@ -1,93 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,sdm845),true) -TARGET := sdm845 -AUDIO_SELECT := CONFIG_SND_SOC_SDM845=m -endif - -ifeq ($(call is-board-platform,sdm660),true) -TARGET := sdm660 -AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m -endif - -ifeq ($(call is-board-platform-in-list,msm8953 sdm670 qcs605),true) -TARGET := sdm670 -AUDIO_SELECT := CONFIG_SND_SOC_SDM670=m -endif - -ifeq ($(call is-board-platform,msmnile),true) -TARGET := msmnile -AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m -endif - -ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) atoll),true) -TARGET := talos -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -ifeq ($(call is-board-platform,$(TRINKET)),true) -TARGET := trinket -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msm8953 sdm845 sdm670 sdm660 qcs605 msmnile $(MSMSTEPPE) $(TRINKET)),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=platform_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_platform.ko -LOCAL_MODULE_KBUILD_NAME := platform_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -ifeq ($(call is-board-platform-in-list,msm8953 sdm670 sdm660 qcs605 $(TRINKET)),true) -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_cpe_lsm.ko -LOCAL_MODULE_KBUILD_NAME := cpe_lsm_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -endif -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_machine_$(TARGET).ko -LOCAL_MODULE_KBUILD_NAME := machine_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/asoc/Kbuild b/techpack/audio/asoc/Kbuild index 5e0106a2f345..8575f3f31487 100644 --- a/techpack/audio/asoc/Kbuild +++ b/techpack/audio/asoc/Kbuild @@ -25,11 +25,6 @@ ifeq ($(KERNEL_BUILD), 0) INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h endif ifeq ($(CONFIG_ARCH_SDM670), y) - include $(AUDIO_ROOT)/config/sdm660auto.conf - export - INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h - endif - ifeq ($(CONFIG_ARCH_SDM660), y) include $(AUDIO_ROOT)/config/sdm670auto.conf export INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h @@ -192,14 +187,12 @@ CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ -DANI_OS_TYPE_ANDROID=6 \ -DPTT_SOCK_SVC_ENABLE \ -Wall\ - -D__linux__ \ - -DCONFIG_SND_SOC_TFA9874_FOR_DAVI + -D__linux__ -ifeq ($(TARGET_PRODUCT), $(filter $(TARGET_PRODUCT),cepheus hercules orion)) +ifdef CONFIG_SND_SOC_CS35L41_FOR_CEPH CDEFINES += -DCONFIG_SND_SOC_CS35L41_FOR_CEPH endif - KBUILD_CPPFLAGS += $(CDEFINES) # Currently, for versions of gcc which support it, the kernel Makefile diff --git a/techpack/audio/asoc/codecs/Android.mk b/techpack/audio/asoc/codecs/Android.mk deleted file mode 100644 index d2b787ae412f..000000000000 --- a/techpack/audio/asoc/codecs/Android.mk +++ /dev/null @@ -1,137 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,sdm845),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM845=m -endif - -ifeq ($(call is-board-platform,sdm660),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m -endif - -ifeq ($(call is-board-platform-in-list,msm8953 sdm670 qcs605),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM670=m -endif - -ifeq ($(call is-board-platform,msmnile),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m -endif - -ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) atoll),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -ifeq ($(call is-board-platform,$(TRINKET)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msm8953 sdm845 sdm670 sdm660 qcs605 msmnile atoll $(MSMSTEPPE) $(TRINKET)),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=wcd_core_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_core.ko -LOCAL_MODULE_KBUILD_NAME := wcd_core_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd9xxx.ko -LOCAL_MODULE_KBUILD_NAME := wcd9xxx_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -ifeq ($(call is-board-platform-in-list,sdm670 sdm660 qcs605 $(TRINKET)),true) -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_cpe.ko -LOCAL_MODULE_KBUILD_NAME := wcd_cpe_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -endif -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_spi.ko -LOCAL_MODULE_KBUILD_NAME := wcd_spi_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -ifeq ($(call is-board-platform-in-list,msm8953 sdm670 sdm660 qcs605 $(TRINKET)),true) -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd9335.ko -LOCAL_MODULE_KBUILD_NAME := wcd9335_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -endif -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wsa881x.ko -LOCAL_MODULE_KBUILD_NAME := wsa881x_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_stub.ko -LOCAL_MODULE_KBUILD_NAME := stub_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_mbhc.ko -LOCAL_MODULE_KBUILD_NAME := mbhc_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_hdmi.ko -LOCAL_MODULE_KBUILD_NAME := hdmi_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/asoc/codecs/Kbuild b/techpack/audio/asoc/codecs/Kbuild index f31dfbfb7645..a74325bad381 100644 --- a/techpack/audio/asoc/codecs/Kbuild +++ b/techpack/audio/asoc/codecs/Kbuild @@ -179,8 +179,7 @@ CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ -DANI_OS_TYPE_ANDROID=6 \ -DPTT_SOCK_SVC_ENABLE \ -Wall\ - -D__linux__ \ - -DGOOGLE_HOTWORD + -D__linux__ KBUILD_CPPFLAGS += $(CDEFINES) @@ -208,9 +207,9 @@ ifeq ($(KERNEL_BUILD), 1) obj-y += sdm660_cdc/ obj-y += msm_sdw/ obj-y += wcd9360/ - obj-y += tas2557/ - obj-y += cs35l41/ obj-y += wcd937x/ + obj-y += cs35l41/ + obj-y += tas2557/ obj-y += tfa98xx/ endif diff --git a/techpack/audio/asoc/codecs/Kbuild.bk b/techpack/audio/asoc/codecs/Kbuild.bk deleted file mode 100755 index 0f68ffe3c38b..000000000000 --- a/techpack/audio/asoc/codecs/Kbuild.bk +++ /dev/null @@ -1,214 +0,0 @@ -# We can build either as part of a standalone Kernel build or as -# an external module. Determine which mechanism is being used -ifeq ($(MODNAME),) - KERNEL_BUILD := 1 -else - KERNEL_BUILD := 0 -endif - -ifeq ($(KERNEL_BUILD), 1) - # These are configurable via Kconfig for kernel-based builds - # Need to explicitly configure for Android-based builds - AUDIO_BLD_DIR := $(ANDROID_BUILD_TOP)/kernel/msm-4.9 - AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio -endif - -ifeq ($(KERNEL_BUILD), 0) - ifeq ($(CONFIG_ARCH_SDM845), y) - include $(AUDIO_ROOT)/config/sdm845auto.conf - export - INCS += -include $(AUDIO_ROOT)/config/sdm845autoconf.h - endif - ifeq ($(CONFIG_ARCH_SDM670), y) - include $(AUDIO_ROOT)/config/sdm670auto.conf - export - INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h - endif - ifeq ($(CONFIG_ARCH_SDM450), y) - include $(AUDIO_ROOT)/config/sdm670auto.conf - export - INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h - endif - ifeq ($(CONFIG_ARCH_SM8150), y) - include $(AUDIO_ROOT)/config/sm8150auto.conf - export - INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h - endif - ifeq ($(CONFIG_ARCH_SM6150), y) - include $(AUDIO_ROOT)/config/sm8150auto.conf - export - INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h - endif - ifeq ($(CONFIG_ARCH_SDMSHRIKE), y) - include $(AUDIO_ROOT)/config/sm8150auto.conf - export - INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h - endif -endif - -# As per target team, build is done as follows: -# Defconfig : build with default flags -# Slub : defconfig + CONFIG_SLUB_DEBUG := y + -# CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y -# Perf : Using appropriate msmXXXX-perf_defconfig -# -# Shipment builds (user variants) should not have any debug feature -# enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds -# are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since -# there is no other way to identify defconfig builds, QTI internal -# representation of perf builds (identified using the string 'perf'), -# is used to identify if the build is a slub or defconfig one. This -# way no critical debug feature will be enabled for perf and shipment -# builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT -# config. - -############ UAPI ############ -UAPI_DIR := uapi -UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) - -############ COMMON ############ -COMMON_DIR := include -COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) - -############ ASoC Codecs ############ -ifdef CONFIG_WCD9XXX_CODEC_CORE - CORE_OBJS += wcd9xxx-rst.o - CORE_OBJS += wcd9xxx-core-init.o - CORE_OBJS += wcd9xxx-core.o - CORE_OBJS += wcd9xxx-irq.o - CORE_OBJS += wcd9xxx-slimslave.o - CORE_OBJS += wcd9xxx-utils.o - CORE_OBJS += wcd9335-regmap.o - CORE_OBJS += wcd9335-tables.o - CORE_OBJS += msm-cdc-pinctrl.o - CORE_OBJS += msm-cdc-supply.o - CORE_OBJS += wcd934x/wcd934x-regmap.o - CORE_OBJS += wcd934x/wcd934x-tables.o - CORE_OBJS += wcd9360/wcd9360-regmap.o -endif - -ifdef CONFIG_SND_SOC_WCD9XXX_V2 - WCD9XXX_OBJS += wcd9xxx-common-v2.o - WCD9XXX_OBJS += wcd9xxx-resmgr-v2.o - WCD9XXX_OBJS += wcdcal-hwdep.o - WCD9XXX_OBJS += wcd9xxx-soc-init.o - WCD9XXX_OBJS += wcd-dsp-utils.o - WCD9XXX_OBJS += wcd-dsp-mgr.o - WCD9XXX_OBJS += audio-ext-clk-up.o -endif - -ifdef CONFIG_SND_SOC_WCD9335 - WCD9335_OBJS += wcd9335.o -endif - -ifdef CONFIG_SND_SOC_WSA881X - WSA881X_OBJS += wsa881x.o - WSA881X_OBJS += wsa881x-tables.o - WSA881X_OBJS += wsa881x-regmap.o - WSA881X_OBJS += wsa881x-temp-sensor.o -endif - -ifdef CONFIG_SND_SOC_MSM_STUB - STUB_OBJS += msm_stub.o -endif -ifdef CONFIG_SND_SOC_WCD_SPI - SPI_OBJS += wcd-spi.o -endif - -ifdef CONFIG_SND_SOC_WCD_CPE - WCD_CPE_OBJS += wcd_cpe_core.o - WCD_CPE_OBJS += wcd_cpe_services.o -endif - -ifdef CONFIG_SND_SOC_WCD_MBHC - MBHC_OBJS += wcd-mbhc-v2.o -endif - -ifdef CONFIG_SND_SOC_WCD_MBHC_ADC - MBHC_OBJS += wcd-mbhc-adc.o -endif - -ifdef CONFIG_SND_SOC_WCD_MBHC_LEGACY - MBHC_OBJS += wcd-mbhc-legacy.o -endif - -ifdef CONFIG_SND_SOC_MSM_HDMI_CODEC_RX - HDMICODEC_OBJS += msm_hdmi_codec_rx.o -endif - -LINUX_INC += -Iinclude/linux - -INCS += $(COMMON_INC) \ - $(UAPI_INC) - - -EXTRA_CFLAGS += $(INCS) - - -CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ - -DANI_LITTLE_BIT_ENDIAN \ - -DDOT11F_LITTLE_ENDIAN_HOST \ - -DANI_COMPILER_TYPE_GCC \ - -DANI_OS_TYPE_ANDROID=6 \ - -DPTT_SOCK_SVC_ENABLE \ - -Wall\ - -Werror\ - -D__linux__ - -KBUILD_CPPFLAGS += $(CDEFINES) - -# Currently, for versions of gcc which support it, the kernel Makefile -# is disabling the maybe-uninitialized warning. Re-enable it for the -# AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it -# will override the kernel settings. -ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) -EXTRA_CFLAGS += -Wmaybe-uninitialized -endif -#EXTRA_CFLAGS += -Wmissing-prototypes - -ifeq ($(call cc-option-yn, -Wheader-guard),y) -EXTRA_CFLAGS += -Wheader-guard -endif - - -ifeq ($(KERNEL_BUILD), 0) -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers -KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers -endif - -ifeq ($(KERNEL_BUILD), 1) - obj-y += wcd934x/ - obj-y += sdm660_cdc/ - obj-y += msm_sdw/ - obj-y += tas2557/ - obj-y += cs35l41/ -endif -# Module information used by KBuild framework -obj-$(CONFIG_WCD9XXX_CODEC_CORE) += wcd_core_dlkm.o -wcd_core_dlkm-y := $(CORE_OBJS) - -obj-$(CONFIG_SND_SOC_WCD9XXX_V2) += wcd9xxx_dlkm.o -wcd9xxx_dlkm-y := $(WCD9XXX_OBJS) - -obj-$(CONFIG_SND_SOC_WCD9335) += wcd9335_dlkm.o -wcd9335_dlkm-y := $(WCD9335_OBJS) - -obj-$(CONFIG_SND_SOC_WSA881X) += wsa881x_dlkm.o -wsa881x_dlkm-y := $(WSA881X_OBJS) - -obj-$(CONFIG_SND_SOC_MSM_STUB) += stub_dlkm.o -stub_dlkm-y := $(STUB_OBJS) - -obj-$(CONFIG_SND_SOC_WCD_CPE) += wcd_cpe_dlkm.o -wcd_cpe_dlkm-y := $(WCD_CPE_OBJS) - -obj-$(CONFIG_SND_SOC_WCD_SPI) += wcd_spi_dlkm.o -wcd_spi_dlkm-y := $(SPI_OBJS) - -obj-$(CONFIG_SND_SOC_WCD_MBHC) += mbhc_dlkm.o -mbhc_dlkm-y := $(MBHC_OBJS) - -obj-$(CONFIG_SND_SOC_MSM_HDMI_CODEC_RX) += hdmi_dlkm.o -hdmi_dlkm-y := $(HDMICODEC_OBJS) - -# inject some build related information diff --git a/techpack/audio/asoc/codecs/aqt1000/Android.mk b/techpack/audio/asoc/codecs/aqt1000/Android.mk deleted file mode 100644 index ac26f6d52469..000000000000 --- a/techpack/audio/asoc/codecs/aqt1000/Android.mk +++ /dev/null @@ -1,41 +0,0 @@ -# Android makefile for audio kernel modules - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,sdm670),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=aqt1000_cdc_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_aqt1000_cdc.ko -LOCAL_MODULE_KBUILD_NAME := aqt1000_cdc_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/asoc/codecs/audio-ext-clk-up.c b/techpack/audio/asoc/codecs/audio-ext-clk-up.c index f4e89028ad3f..9889d01b594e 100644 --- a/techpack/audio/asoc/codecs/audio-ext-clk-up.c +++ b/techpack/audio/asoc/codecs/audio-ext-clk-up.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2019, 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 @@ -17,8 +17,6 @@ #include #include #include -#include -#include #include "../../../drivers/clk/qcom/common.h" #include #include @@ -37,7 +35,6 @@ enum { AUDIO_EXT_CLK_LPASS6, AUDIO_EXT_CLK_LPASS7, AUDIO_EXT_CLK_LPASS_CORE_HW_VOTE, - AUDIO_EXT_CLK_PM660_PMI, AUDIO_EXT_CLK_LPASS_MAX, AUDIO_EXT_CLK_MAX = AUDIO_EXT_CLK_LPASS_MAX, }; @@ -52,7 +49,6 @@ struct pinctrl_info { struct audio_ext_clk { struct pinctrl_info pnctrl_info; struct clk_fixed_factor fact; - int gpio; }; struct audio_ext_clk_priv { @@ -345,19 +341,6 @@ static struct audio_ext_clk audio_clk_array[] = { }, }, }, - { - .gpio = -EINVAL, - .fact = { - .mult = 1, - .div = 1, - .hw.init = &(struct clk_init_data){ - .name = "audio_ext_pm660_pmi_clk", - .parent_names = (const char *[]){ "div_clk1" }, - .num_parents = 1, - .ops = &audio_ext_clk_dummy_ops, - }, - }, - }, }; static int audio_get_pinctrl(struct platform_device *pdev) @@ -481,7 +464,6 @@ static int audio_ref_clk_probe(struct platform_device *pdev) int ret; struct audio_ext_clk_priv *clk_priv; u32 clk_freq = 0, clk_id = 0, clk_src = 0, use_pinctrl = 0; - int clk_gpio; clk_priv = devm_kzalloc(&pdev->dev, sizeof(*clk_priv), GFP_KERNEL); if (!clk_priv) @@ -553,30 +535,11 @@ static int audio_ref_clk_probe(struct platform_device *pdev) } } - clk_gpio = of_get_named_gpio(pdev->dev.of_node, - "qcom,audio-ref-clk-gpio", 0); - if (clk_gpio > 0) { - ret = gpio_request(clk_gpio, "EXT_CLK"); - if (ret) { - dev_err(&pdev->dev, - "Request ext clk gpio failed %d, err:%d\n", - clk_gpio, ret); - return ret; - } - if (of_property_read_bool(pdev->dev.of_node, - "qcom,node_has_rpm_clock")) { - clk_priv->audio_clk.gpio = clk_gpio; - } - } - ret = audio_get_clk_data(pdev); if (ret) { dev_err(&pdev->dev, "%s: clk_init is failed\n", __func__); - if (use_pinctrl) - audio_put_pinctrl(pdev); - if (clk_priv->audio_clk.gpio > 0) - gpio_free(clk_priv->audio_clk.gpio); + audio_put_pinctrl(pdev); return ret; } @@ -585,11 +548,7 @@ static int audio_ref_clk_probe(struct platform_device *pdev) static int audio_ref_clk_remove(struct platform_device *pdev) { - struct audio_ext_clk_priv *clk_priv = platform_get_drvdata(pdev); - audio_put_pinctrl(pdev); - if (clk_priv->audio_clk.gpio > 0) - gpio_free(clk_priv->audio_clk.gpio); return 0; } diff --git a/techpack/audio/asoc/codecs/bolero/Android.mk b/techpack/audio/asoc/codecs/bolero/Android.mk deleted file mode 100644 index ab7224434aa4..000000000000 --- a/techpack/audio/asoc/codecs/bolero/Android.mk +++ /dev/null @@ -1,82 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) atoll $(TRINKET)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) atoll $(TRINKET)),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=bolero_cdc_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_bolero_cdc.ko -LOCAL_MODULE_KBUILD_NAME := bolero_cdc_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wsa_macro.ko -LOCAL_MODULE_KBUILD_NAME := wsa_macro_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_va_macro.ko -LOCAL_MODULE_KBUILD_NAME := va_macro_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_tx_macro.ko -LOCAL_MODULE_KBUILD_NAME := tx_macro_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_rx_macro.ko -LOCAL_MODULE_KBUILD_NAME := rx_macro_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/asoc/codecs/bolero/bolero-cdc.c b/techpack/audio/asoc/codecs/bolero/bolero-cdc.c index 7d5b1ccb0d58..02998fc4373a 100644 --- a/techpack/audio/asoc/codecs/bolero/bolero-cdc.c +++ b/techpack/audio/asoc/codecs/bolero/bolero-cdc.c @@ -288,9 +288,10 @@ static int bolero_copy_dais_from_macro(struct bolero_priv *priv) /* memcpy into bolero_dais all macro dais */ if (!priv->bolero_dais) - priv->bolero_dais = devm_kcalloc(priv->dev, - priv->num_dais, - sizeof(struct snd_soc_dai_driver), + priv->bolero_dais = devm_kzalloc(priv->dev, + priv->num_dais * + sizeof( + struct snd_soc_dai_driver), GFP_KERNEL); if (!priv->bolero_dais) return -ENOMEM; diff --git a/techpack/audio/asoc/codecs/cs35l41/Android.mk b/techpack/audio/asoc/codecs/cs35l41/Android.mk deleted file mode 100755 index 9b2b116f0487..000000000000 --- a/techpack/audio/asoc/codecs/cs35l41/Android.mk +++ /dev/null @@ -1,55 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,msmnile),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m -endif - -ifeq ($(call is-board-platform,$(MSMSTEPPE)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE)),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - #AUDIO_BLD_DIR := $(ANDROID_BUILD_TOP)/vendor/qcom/opensource/audio-kernel - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=cs35l41_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_cs35l41.ko -LOCAL_MODULE_KBUILD_NAME := cs35l41_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/asoc/codecs/cs35l41/cs35l41-i2c.c b/techpack/audio/asoc/codecs/cs35l41/cs35l41-i2c.c index 7631de66daab..e33bc7412feb 100755 --- a/techpack/audio/asoc/codecs/cs35l41/cs35l41-i2c.c +++ b/techpack/audio/asoc/codecs/cs35l41/cs35l41-i2c.c @@ -2,7 +2,6 @@ * cs35l41-i2c.c -- CS35l41 I2C driver * * Copyright 2017 Cirrus Logic, Inc. - * Copyright (C) 2019 XiaoMi, Inc. * * Author: David Rhodes * diff --git a/techpack/audio/asoc/codecs/cs35l41/cs35l41-spi.c b/techpack/audio/asoc/codecs/cs35l41/cs35l41-spi.c index 5cad9ea1d97a..49ee3a8d2058 100755 --- a/techpack/audio/asoc/codecs/cs35l41/cs35l41-spi.c +++ b/techpack/audio/asoc/codecs/cs35l41/cs35l41-spi.c @@ -2,7 +2,6 @@ * cs35l41-spi.c -- CS35l41 SPI driver * * Copyright 2017 Cirrus Logic, Inc. - * Copyright (C) 2019 XiaoMi, Inc. * * Author: David Rhodes * diff --git a/techpack/audio/asoc/codecs/cs35l41/cs35l41-tables.c b/techpack/audio/asoc/codecs/cs35l41/cs35l41-tables.c index 8275754283e3..ec8c1eb1c5f7 100755 --- a/techpack/audio/asoc/codecs/cs35l41/cs35l41-tables.c +++ b/techpack/audio/asoc/codecs/cs35l41/cs35l41-tables.c @@ -2,7 +2,6 @@ * cs35l41-tables.c -- CS35L41 ALSA SoC audio driver * * Copyright 2018 Cirrus Logic, Inc. - * Copyright (C) 2019 XiaoMi, Inc. * * Author: Brian Austin * David Rhodes diff --git a/techpack/audio/asoc/codecs/cs35l41/cs35l41.c b/techpack/audio/asoc/codecs/cs35l41/cs35l41.c index d0ecfa550c13..25db86058e47 100755 --- a/techpack/audio/asoc/codecs/cs35l41/cs35l41.c +++ b/techpack/audio/asoc/codecs/cs35l41/cs35l41.c @@ -2,7 +2,6 @@ * cs35l41.c -- CS35l41 ALSA SoC audio driver * * Copyright 2018 Cirrus Logic, Inc. - * Copyright (C) 2019 XiaoMi, Inc. * * Author: David Rhodes * Brian Austin @@ -12,6 +11,7 @@ * published by the Free Software Foundation. * */ +#define DEBUG 1 #include #include #include @@ -215,7 +215,7 @@ static int vendor_id_get(struct snd_kcontrol *kcontrol, ucontrol->value.integer.value[0] = VENDOR_ID_NONE; if (cs35l41->pdata.spk_id_gpio_p) - ucontrol->value.integer.value[0] = spk_id_get(cs35l41->pdata.spk_id_gpio_p); + ucontrol->value.integer.value[0] = cs35l41_spk_id_get(cs35l41->pdata.spk_id_gpio_p); return 0; } @@ -1646,7 +1646,7 @@ static struct snd_soc_codec_driver soc_codec_dev_cs35l41 = { .idle_bias_off = true, }; -int spk_id_get(struct device_node *np) +int cs35l41_spk_id_get(struct device_node *np) { int id; int state; @@ -1742,7 +1742,7 @@ static int cs35l41_handle_of_data(struct device *dev, "cirrus,spk-id-pin", np->full_name); pdata->mnSpkType = VENDOR_ID_NONE; } else { - pdata->mnSpkType = spk_id_get(pdata->spk_id_gpio_p); + pdata->mnSpkType = cs35l41_spk_id_get(pdata->spk_id_gpio_p); } dev_info(dev, "spk is is %d", pdata->mnSpkType); diff --git a/techpack/audio/asoc/codecs/cs35l41/cs35l41.h b/techpack/audio/asoc/codecs/cs35l41/cs35l41.h index 9ebbe2b791ac..4569abf5f1d6 100755 --- a/techpack/audio/asoc/codecs/cs35l41/cs35l41.h +++ b/techpack/audio/asoc/codecs/cs35l41/cs35l41.h @@ -2,7 +2,6 @@ * cs35l41.h -- CS35L41 ALSA SoC audio driver * * Copyright 2018 Cirrus Logic, Inc. - * Copyright (C) 2019 XiaoMi, Inc. * * Author: Brian Austin * David Rhodes diff --git a/techpack/audio/asoc/codecs/cs35l41/wm_adsp.c b/techpack/audio/asoc/codecs/cs35l41/wm_adsp.c index 8c8c129d2194..2e028ac6ef36 100755 --- a/techpack/audio/asoc/codecs/cs35l41/wm_adsp.c +++ b/techpack/audio/asoc/codecs/cs35l41/wm_adsp.c @@ -2,7 +2,6 @@ * wm_adsp.c -- Wolfson ADSP support * * Copyright 2012 Wolfson Microelectronics plc - * Copyright (C) 2019 XiaoMi, Inc. * * Author: Mark Brown * @@ -10,6 +9,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#define DEBUG //#define WM_ADSP_DEBUG #include #include diff --git a/techpack/audio/asoc/codecs/cs35l41/wm_adsp.h b/techpack/audio/asoc/codecs/cs35l41/wm_adsp.h index 25bffe45dc42..084d3aa1e14a 100755 --- a/techpack/audio/asoc/codecs/cs35l41/wm_adsp.h +++ b/techpack/audio/asoc/codecs/cs35l41/wm_adsp.h @@ -2,7 +2,6 @@ * wm_adsp.h -- Wolfson ADSP support * * Copyright 2012 Wolfson Microelectronics plc - * Copyright (C) 2019 XiaoMi, Inc. * * Author: Mark Brown * diff --git a/techpack/audio/asoc/codecs/cs35l41/wmfw.h b/techpack/audio/asoc/codecs/cs35l41/wmfw.h index 8f712f5972d1..5e10bb4737af 100755 --- a/techpack/audio/asoc/codecs/cs35l41/wmfw.h +++ b/techpack/audio/asoc/codecs/cs35l41/wmfw.h @@ -2,7 +2,6 @@ * wmfw.h - Wolfson firmware format information * * Copyright 2012 Wolfson Microelectronics plc - * Copyright (C) 2019 XiaoMi, Inc. * * Author: Mark Brown * diff --git a/techpack/audio/asoc/codecs/ep92/Android.mk b/techpack/audio/asoc/codecs/ep92/Android.mk deleted file mode 100644 index c2ac0599f7d8..000000000000 --- a/techpack/audio/asoc/codecs/ep92/Android.mk +++ /dev/null @@ -1,50 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,qcs405),true) -AUDIO_SELECT := CONFIG_SND_SOC_QCS405=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,qcs405),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(ANDROID_BUILD_TOP)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=ep92_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_ep92.ko -LOCAL_MODULE_KBUILD_NAME := ep92_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/asoc/codecs/msm_sdw/Android.mk b/techpack/audio/asoc/codecs/msm_sdw/Android.mk deleted file mode 100644 index e073cccbb8da..000000000000 --- a/techpack/audio/asoc/codecs/msm_sdw/Android.mk +++ /dev/null @@ -1,53 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msm8953 sdm670 qcs605),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM670=m -endif - -ifeq ($(call is-board-platform,sdm660),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m -endif - -ifeq ($(call is-board-platform-in-list,msm8953 sdm670 sdm660 qcs605),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=msm_sdw_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_msm_sdw.ko -LOCAL_MODULE_KBUILD_NAME := msm_sdw_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/asoc/codecs/sdm660_cdc/Android.mk b/techpack/audio/asoc/codecs/sdm660_cdc/Android.mk deleted file mode 100644 index 17c4c4f80b26..000000000000 --- a/techpack/audio/asoc/codecs/sdm660_cdc/Android.mk +++ /dev/null @@ -1,53 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msm8953 sdm660 sdm670 qcs605),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=analog_cdc_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_analog_cdc.ko -LOCAL_MODULE_KBUILD_NAME := analog_cdc_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_digital_cdc.ko -LOCAL_MODULE_KBUILD_NAME := digital_cdc_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/asoc/codecs/sdm660_cdc/msm-analog-cdc.c b/techpack/audio/asoc/codecs/sdm660_cdc/msm-analog-cdc.c index 26827fb00075..abfa4b7e3f44 100644 --- a/techpack/audio/asoc/codecs/sdm660_cdc/msm-analog-cdc.c +++ b/techpack/audio/asoc/codecs/sdm660_cdc/msm-analog-cdc.c @@ -4313,9 +4313,9 @@ static int msm_anlg_cdc_init_supplies(struct sdm660_cdc_priv *sdm660_cdc, int ret; int i; - sdm660_cdc->supplies = devm_kcalloc(sdm660_cdc->dev, + sdm660_cdc->supplies = devm_kzalloc(sdm660_cdc->dev, + sizeof(struct regulator_bulk_data) * ARRAY_SIZE(pdata->regulator), - sizeof(struct regulator_bulk_data), GFP_KERNEL); if (!sdm660_cdc->supplies) { ret = -ENOMEM; diff --git a/techpack/audio/asoc/codecs/spk-id.c b/techpack/audio/asoc/codecs/spk-id.c index 7c2ce1647510..6de016000efb 100755 --- a/techpack/audio/asoc/codecs/spk-id.c +++ b/techpack/audio/asoc/codecs/spk-id.c @@ -1,5 +1,4 @@ /* Copyright (c) 2016, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 @@ -10,6 +9,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ +#define DEBUG #include #include #include diff --git a/techpack/audio/asoc/codecs/spk-id.h b/techpack/audio/asoc/codecs/spk-id.h index 2416f89bd23f..3e99afd03007 100755 --- a/techpack/audio/asoc/codecs/spk-id.h +++ b/techpack/audio/asoc/codecs/spk-id.h @@ -1,5 +1,4 @@ /* Copyright (c) 2016, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 diff --git a/techpack/audio/asoc/codecs/tas2557/Android.mk b/techpack/audio/asoc/codecs/tas2557/Android.mk deleted file mode 100755 index 279ede3ee009..000000000000 --- a/techpack/audio/asoc/codecs/tas2557/Android.mk +++ /dev/null @@ -1,55 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,msmnile),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m -endif - -ifeq ($(call is-board-platform,$(MSMSTEPPE)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE)),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - #AUDIO_BLD_DIR := $(ANDROID_BUILD_TOP)/vendor/qcom/opensource/audio-kernel - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=tas2557_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_tas2557.ko -LOCAL_MODULE_KBUILD_NAME := tas2557_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/asoc/codecs/tas2557/tas2557-codec.c b/techpack/audio/asoc/codecs/tas2557/tas2557-codec.c index c2f214117ba5..5aec1fe87c67 100755 --- a/techpack/audio/asoc/codecs/tas2557/tas2557-codec.c +++ b/techpack/audio/asoc/codecs/tas2557/tas2557-codec.c @@ -1,7 +1,6 @@ /* ** ============================================================================= ** Copyright (c) 2016 Texas Instruments Inc. -** Copyright (C) 2019 XiaoMi, Inc. ** ** This program is free software; you can redistribute it and/or modify it under ** the terms of the GNU General Public License as published by the Free Software @@ -22,6 +21,7 @@ #ifdef CONFIG_TAS2557_CODEC +#define DEBUG #include #include #include @@ -330,7 +330,7 @@ static int vendor_id_get(struct snd_kcontrol *kcontrol, ucontrol->value.integer.value[0] = VENDOR_ID_NONE; if (pTAS2557->spk_id_gpio_p) - ucontrol->value.integer.value[0] = spk_id_get(pTAS2557->spk_id_gpio_p); + ucontrol->value.integer.value[0] = tas2557_spk_id_get(pTAS2557->spk_id_gpio_p); return 0; } diff --git a/techpack/audio/asoc/codecs/tas2557/tas2557-codec.h b/techpack/audio/asoc/codecs/tas2557/tas2557-codec.h index 20babdde5025..8e20270c6b92 100755 --- a/techpack/audio/asoc/codecs/tas2557/tas2557-codec.h +++ b/techpack/audio/asoc/codecs/tas2557/tas2557-codec.h @@ -1,7 +1,6 @@ /* ** ============================================================================= ** Copyright (c) 2016 Texas Instruments Inc. -** Copyright (C) 2019 XiaoMi, Inc. ** ** This program is free software; you can redistribute it and/or modify it under ** the terms of the GNU General Public License as published by the Free Software diff --git a/techpack/audio/asoc/codecs/tas2557/tas2557-core.c b/techpack/audio/asoc/codecs/tas2557/tas2557-core.c index 00cedf4a679e..d95c46ec9a80 100755 --- a/techpack/audio/asoc/codecs/tas2557/tas2557-core.c +++ b/techpack/audio/asoc/codecs/tas2557/tas2557-core.c @@ -1,7 +1,6 @@ /* ** ============================================================================= ** Copyright (c) 2016 Texas Instruments Inc. -** Copyright (C) 2019 XiaoMi, Inc. ** ** This program is free software; you can redistribute it and/or modify it under ** the terms of the GNU General Public License as published by the Free Software @@ -20,6 +19,7 @@ ** ============================================================================= */ +#define DEBUG #include #include #include @@ -2051,7 +2051,7 @@ end: return bFound; } -int spk_id_get(struct device_node *np) +int tas2557_spk_id_get(struct device_node *np) { int id; int state; @@ -2092,7 +2092,7 @@ int tas2557_parse_dt(struct device *dev, struct tas2557_priv *pTAS2557) "ti,spk-id-pin", np->full_name); pTAS2557->mnSpkType = VENDOR_ID_NONE; } else { - pTAS2557->mnSpkType = spk_id_get(pTAS2557->spk_id_gpio_p); + pTAS2557->mnSpkType = tas2557_spk_id_get(pTAS2557->spk_id_gpio_p); } dev_dbg(pTAS2557->dev, "spk is is %d", pTAS2557->mnSpkType); diff --git a/techpack/audio/asoc/codecs/tas2557/tas2557-core.h b/techpack/audio/asoc/codecs/tas2557/tas2557-core.h index aa0987381658..4d72ddadefbc 100755 --- a/techpack/audio/asoc/codecs/tas2557/tas2557-core.h +++ b/techpack/audio/asoc/codecs/tas2557/tas2557-core.h @@ -1,7 +1,6 @@ /* ** ============================================================================= ** Copyright (c) 2016 Texas Instruments Inc. -** Copyright (C) 2019 XiaoMi, Inc. ** ** This program is free software; you can redistribute it and/or modify it under ** the terms of the GNU General Public License as published by the Free Software @@ -77,6 +76,6 @@ int tas2557_parse_dt(struct device *dev, struct tas2557_priv *pTAS2557); int tas2557_get_DAC_gain(struct tas2557_priv *pTAS2557, unsigned char *pnGain); int tas2557_set_DAC_gain(struct tas2557_priv *pTAS2557, unsigned int nGain); int tas2557_configIRQ(struct tas2557_priv *pTAS2557); -int spk_id_get(struct device_node *np); +int tas2557_spk_id_get(struct device_node *np); #endif /* _TAS2557_CORE_H */ diff --git a/techpack/audio/asoc/codecs/tas2557/tas2557-misc.c b/techpack/audio/asoc/codecs/tas2557/tas2557-misc.c index cdae4e70cedb..5f342e60e33a 100755 --- a/techpack/audio/asoc/codecs/tas2557/tas2557-misc.c +++ b/techpack/audio/asoc/codecs/tas2557/tas2557-misc.c @@ -1,7 +1,6 @@ /* ** ============================================================================= ** Copyright (c) 2016 Texas Instruments Inc. -** Copyright (C) 2019 XiaoMi, Inc. ** ** This program is free software; you can redistribute it and/or modify it under ** the terms of the GNU General Public License as published by the Free Software @@ -22,6 +21,7 @@ #ifdef CONFIG_TAS2557_MISC +#define DEBUG #include #include #include diff --git a/techpack/audio/asoc/codecs/tas2557/tas2557-misc.h b/techpack/audio/asoc/codecs/tas2557/tas2557-misc.h index fbcde772006d..a82f1d74b3c4 100755 --- a/techpack/audio/asoc/codecs/tas2557/tas2557-misc.h +++ b/techpack/audio/asoc/codecs/tas2557/tas2557-misc.h @@ -1,7 +1,6 @@ /* ** ============================================================================= ** Copyright (c) 2016 Texas Instruments Inc. -** Copyright (C) 2019 XiaoMi, Inc. ** ** This program is free software; you can redistribute it and/or modify it under ** the terms of the GNU General Public License as published by the Free Software diff --git a/techpack/audio/asoc/codecs/tas2557/tas2557-regmap.c b/techpack/audio/asoc/codecs/tas2557/tas2557-regmap.c index 35b2877cd7b4..4a1f3b4ff73f 100755 --- a/techpack/audio/asoc/codecs/tas2557/tas2557-regmap.c +++ b/techpack/audio/asoc/codecs/tas2557/tas2557-regmap.c @@ -1,7 +1,6 @@ /* ** ============================================================================= ** Copyright (c) 2016 Texas Instruments Inc. -** Copyright (C) 2019 XiaoMi, Inc. ** ** This program is free software; you can redistribute it and/or modify it under ** the terms of the GNU General Public License as published by the Free Software @@ -22,6 +21,7 @@ #ifdef CONFIG_TAS2557_REGMAP +#define DEBUG #include #include #include diff --git a/techpack/audio/asoc/codecs/tas2557/tas2557.h b/techpack/audio/asoc/codecs/tas2557/tas2557.h index fb5bf866f8b0..e46bedc9fbab 100755 --- a/techpack/audio/asoc/codecs/tas2557/tas2557.h +++ b/techpack/audio/asoc/codecs/tas2557/tas2557.h @@ -1,7 +1,6 @@ /* ** ============================================================================= ** Copyright (c) 2016 Texas Instruments Inc. -** Copyright (C) 2019 XiaoMi, Inc. ** ** This program is free software; you can redistribute it and/or modify it under ** the terms of the GNU General Public License as published by the Free Software diff --git a/techpack/audio/asoc/codecs/tas2557/tiload.c b/techpack/audio/asoc/codecs/tas2557/tiload.c index 1f4943960490..4cf0ddfa1879 100755 --- a/techpack/audio/asoc/codecs/tas2557/tiload.c +++ b/techpack/audio/asoc/codecs/tas2557/tiload.c @@ -1,7 +1,6 @@ /* ** ============================================================================= ** Copyright (c) 2016 Texas Instruments Inc. -** Copyright (C) 2019 XiaoMi, Inc. ** ** This program is free software; you can redistribute it and/or modify it under ** the terms of the GNU General Public License as published by the Free Software @@ -40,6 +39,7 @@ #include "tiload.h" /* enable debug prints in the driver */ +#define DEBUG static struct cdev *tiload_cdev; static int tiload_major; /* Dynamic allocation of Mjr No. */ diff --git a/techpack/audio/asoc/codecs/tas2557/tiload.h b/techpack/audio/asoc/codecs/tas2557/tiload.h index d97fc8fb29f5..7468acfa3964 100755 --- a/techpack/audio/asoc/codecs/tas2557/tiload.h +++ b/techpack/audio/asoc/codecs/tas2557/tiload.h @@ -1,7 +1,6 @@ /* ** ============================================================================= ** Copyright (c) 2016 Texas Instruments Inc. -** Copyright (C) 2019 XiaoMi, Inc. ** ** This program is free software; you can redistribute it and/or modify it under ** the terms of the GNU General Public License as published by the Free Software diff --git a/techpack/audio/asoc/codecs/tfa98xx/Android.mk b/techpack/audio/asoc/codecs/tfa98xx/Android.mk deleted file mode 100755 index f7bdf5f3a10f..000000000000 --- a/techpack/audio/asoc/codecs/tfa98xx/Android.mk +++ /dev/null @@ -1,55 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,msmnile),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m -endif - -ifeq ($(call is-board-platform,$(MSMSTEPPE)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE)),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - #AUDIO_BLD_DIR := $(ANDROID_BUILD_TOP)/vendor/qcom/opensource/audio-kernel - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=tfa98xx_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_tfa98xx.ko -LOCAL_MODULE_KBUILD_NAME := tfa98xx_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/asoc/codecs/tfa98xx/inc/dbgprint.h b/techpack/audio/asoc/codecs/tfa98xx/inc/dbgprint.h index ddd17b8f158b..b9b4558a7141 100644 --- a/techpack/audio/asoc/codecs/tfa98xx/inc/dbgprint.h +++ b/techpack/audio/asoc/codecs/tfa98xx/inc/dbgprint.h @@ -31,7 +31,7 @@ # ifdef DEBUG # define _DEBUG(level, fmt, va...) do {\ if (unlikely(debug >= (level))) \ - printk(KERN_INFO PREFIX "%s:%d: "fmt, __func__, __LINE__, ##va); \ + printk(KERN_INFO PREFIX "%s:%d: "fmt, __func__, __LINE__, ##va); \ } while (0) # else diff --git a/techpack/audio/asoc/codecs/tfa98xx/inc/tfa9873_tfafieldnames_B0.h b/techpack/audio/asoc/codecs/tfa98xx/inc/tfa9873_tfafieldnames_B0.h index 05b57857f6c0..1d2dbe6b0001 100644 --- a/techpack/audio/asoc/codecs/tfa98xx/inc/tfa9873_tfafieldnames_B0.h +++ b/techpack/audio/asoc/codecs/tfa98xx/inc/tfa9873_tfafieldnames_B0.h @@ -14,7 +14,7 @@ #define _TFA9873_TFAFIELDNAMES_B0_H -#define TFA9873B0_I2CVERSION 13 +#define TFA9873B0_I2CVERSION 16 typedef enum Tfa9873B0BfEnumList { TFA9873B0_BF_PWDN = 0x0000, /*!< Powerdown selection */ diff --git a/techpack/audio/asoc/codecs/tfa98xx/inc/tfa98xx_parameters.h b/techpack/audio/asoc/codecs/tfa98xx/inc/tfa98xx_parameters.h index 26a97ec52335..dba720d8bdc5 100644 --- a/techpack/audio/asoc/codecs/tfa98xx/inc/tfa98xx_parameters.h +++ b/techpack/audio/asoc/codecs/tfa98xx/inc/tfa98xx_parameters.h @@ -267,11 +267,11 @@ typedef struct TfaEqualizer { #define HDR(c1, c2) (c2<<8|c1) // little endian typedef enum TfaHeaderType { paramsHdr = HDR('P', 'M'), /* containter file */ - volstepHdr = HDR('V', 'P'), - patchHdr = HDR('P', 'A'), - speakerHdr = HDR('S', 'P'), - presetHdr = HDR('P', 'R'), - configHdr = HDR('C', 'O'), + volstepHdr = HDR('V', 'P'), + patchHdr = HDR('P', 'A'), + speakerHdr = HDR('S', 'P'), + presetHdr = HDR('P', 'R'), + configHdr = HDR('C', 'O'), equalizerHdr = HDR('E', 'Q'), drcHdr = HDR('D', 'R'), msgHdr = HDR('M', 'G'), /* generic message */ diff --git a/techpack/audio/asoc/codecs/tfa98xx/inc/tfa_device.h b/techpack/audio/asoc/codecs/tfa98xx/inc/tfa_device.h index a5f03dd8a2be..f220c6e2228f 100644 --- a/techpack/audio/asoc/codecs/tfa98xx/inc/tfa_device.h +++ b/techpack/audio/asoc/codecs/tfa98xx/inc/tfa_device.h @@ -92,11 +92,11 @@ enum tfa_state { TFA_STATE_FAULT, /**< An alarm or error occurred */ TFA_STATE_RESET, /**< I2C reset and ACS set */ /* --sticky state modifiers-- */ - TFA_STATE_MUTE = 0x10, /**< Algo & Amp mute */ - TFA_STATE_UNMUTE = 0x20, /**< Algo & Amp unmute */ - TFA_STATE_CLOCK_ALWAYS = 0x40, /**< PLL connect to internal oscillator */ - TFA_STATE_CLOCK_AUDIO = 0x80, /**< PLL connect to audio clock (BCK/FS) */ - TFA_STATE_LOW_POWER = 0x100, /**< lowest possible power state */ + TFA_STATE_MUTE = 0x10, /**< Algo & Amp mute */ + TFA_STATE_UNMUTE = 0x20, /**< Algo & Amp unmute */ + TFA_STATE_CLOCK_ALWAYS = 0x40, /**< PLL connect to internal oscillator */ + TFA_STATE_CLOCK_AUDIO = 0x80, /**< PLL connect to audio clock (BCK/FS) */ + TFA_STATE_LOW_POWER = 0x100, /**< lowest possible power state */ }; /** diff --git a/techpack/audio/asoc/codecs/tfa98xx/inc/tfa_dsp_fw.h b/techpack/audio/asoc/codecs/tfa98xx/inc/tfa_dsp_fw.h index b191b6902859..62e0edd7d8ff 100644 --- a/techpack/audio/asoc/codecs/tfa98xx/inc/tfa_dsp_fw.h +++ b/techpack/audio/asoc/codecs/tfa98xx/inc/tfa_dsp_fw.h @@ -152,9 +152,9 @@ enum tfa_fw_event { /* not all available on each device */ #define TFA2_FW_XMEM_CMD_COUNT 520 /* note that the following defs rely on the handle variable */ -#define TFA_FW_XMEM_CALIBRATION_DONE TFA_FAM_FW(tfa, XMEM_CALIBRATION_DONE) -#define TFA_FW_XMEM_COUNT_BOOT TFA_FAM_FW(tfa, XMEM_COUNT_BOOT) -#define TFA_FW_XMEM_CMD_COUNT TFA_FAM_FW(tfa, XMEM_CMD_COUNT) +#define TFA_FW_XMEM_CALIBRATION_DONE TFA_FAM_FW(tfa, XMEM_CALIBRATION_DONE) +#define TFA_FW_XMEM_COUNT_BOOT TFA_FAM_FW(tfa, XMEM_COUNT_BOOT) +#define TFA_FW_XMEM_CMD_COUNT TFA_FAM_FW(tfa, XMEM_CMD_COUNT) #define TFA2_FW_ReZ_SCALE 65536 #define TFA1_FW_ReZ_SCALE 16384 diff --git a/techpack/audio/asoc/codecs/tfa98xx/inc/tfa_service.h b/techpack/audio/asoc/codecs/tfa98xx/inc/tfa_service.h index c0af0a781965..9cb5f757ad6d 100644 --- a/techpack/audio/asoc/codecs/tfa98xx/inc/tfa_service.h +++ b/techpack/audio/asoc/codecs/tfa98xx/inc/tfa_service.h @@ -27,13 +27,10 @@ extern "C" { #endif /* Linux kernel module defines TFA98XX_GIT_VERSIONS in the linux_driver/Makefile */ -#if !defined(TFA98XX_GIT_VERSIONS) -#include "versions.h" -#endif #ifdef TFA98XX_GIT_VERSIONS - #define TFA98XX_API_REV_STR "v6.7.3"/*TFA98XX_GIT_VERSIONS*/ + #define TFA98XX_API_REV_STR "v6.7.4"/*TFA98XX_GIT_VERSIONS*/ #else - #define TFA98XX_API_REV_STR "v6.7.3" + #define TFA98XX_API_REV_STR "v6.7.4" #endif #include "tfa_device.h" diff --git a/techpack/audio/asoc/codecs/tfa98xx/inc/versions.h b/techpack/audio/asoc/codecs/tfa98xx/inc/versions.h deleted file mode 100755 index 437fe7c3c012..000000000000 --- a/techpack/audio/asoc/codecs/tfa98xx/inc/versions.h +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef _VERSIONS_H -#define TFA98XX_GIT_VERSIONS "v6.5.2_xxxxxxxxxx" -#define _VERSIONS_H -#endif - diff --git a/techpack/audio/asoc/codecs/tfa98xx/src/tfa98xx.c b/techpack/audio/asoc/codecs/tfa98xx/src/tfa98xx.c index ebd43dbaa9a5..546f4f806149 100644 --- a/techpack/audio/asoc/codecs/tfa98xx/src/tfa98xx.c +++ b/techpack/audio/asoc/codecs/tfa98xx/src/tfa98xx.c @@ -214,7 +214,6 @@ static enum tfa_error tfa98xx_tfa_start(struct tfa98xx *tfa98xx, int next_profil err = tfa_dev_start(tfa98xx->tfa, next_profile, vstep); #endif /*[nxp34663] CR: support 16bit/24bit/32bit audio data. end*/ - pr_debug("%s after performed tfa_dev_start return (%d)\n", __func__, err); if (trace_level & 8) { stop_time = ktime_get_boottime(); @@ -520,7 +519,7 @@ static ssize_t tfa98xx_dbgfs_start_set(struct file *file, struct tfa98xx *tfa98xx = i2c_get_clientdata(i2c); enum tfa_error ret; char buf[32]; - static const char ref[] = "please calibrate now"; + const char ref[] = "please calibrate now"; int buf_size, cal_profile = 0; /* check string length, and account for eol */ @@ -677,10 +676,10 @@ static ssize_t tfa98xx_dbgfs_dsp_state_set(struct file *file, struct tfa98xx *tfa98xx = i2c_get_clientdata(i2c); enum tfa_error ret; char buf[32]; - static const char start_cmd[] = "start"; - static const char stop_cmd[] = "stop"; - static const char mon_start_cmd[] = "monitor start"; - static const char mon_stop_cmd[] = "monitor stop"; + const char start_cmd[] = "start"; + const char stop_cmd[] = "stop"; + const char mon_start_cmd[] = "monitor start"; + const char mon_stop_cmd[] = "monitor stop"; int buf_size; buf_size = min(count, (size_t)(sizeof(buf) - 1)); @@ -703,7 +702,7 @@ static ssize_t tfa98xx_dbgfs_dsp_state_set(struct file *file, pr_debug("[0x%x] tfa_dev_stop complete: %d\n", tfa98xx->i2c->addr, ret); } else if (!strncmp(buf, mon_start_cmd, sizeof(mon_start_cmd) - 1)) { pr_info("[0x%x] Manual start of monitor thread...\n", tfa98xx->i2c->addr); - queue_delayed_work(system_power_efficient_wq, + queue_delayed_work(tfa98xx->tfa98xx_wq, &tfa98xx->monitor_work, HZ); } else if (!strncmp(buf, mon_stop_cmd, sizeof(mon_stop_cmd) - 1)) { pr_info("[0x%x] Manual stop of monitor thread...\n", tfa98xx->i2c->addr); @@ -745,7 +744,14 @@ static ssize_t tfa98xx_dbgfs_fw_state_get(struct file *file, return simple_read_from_buffer(user_buf, count, ppos, str, strlen(str)); } +#ifdef TFA_NON_DSP_SOLUTION extern int send_tfa_cal_apr(void *buf, int cmd_size, bool bRead); +#else +int send_tfa_cal_apr(void *buf, int cmd_size, bool bRead) +{ + return 0; +} +#endif static ssize_t tfa98xx_dbgfs_rpc_read(struct file *file, char __user *user_buf, size_t count, @@ -1571,7 +1577,6 @@ static int tfa987x_algo_set_status(struct snd_kcontrol *kcontrol, int32_t ret = 0; u8 buff[56] = {0}, *ptr = buff; ((int32_t *)buff)[0] = ucontrol->value.integer.value[0]; - pr_err("%s:status data %d\n", __func__, ((int32_t *)buff)[0]); atomic_set(&g_bypass, ((int32_t *)buff)[0]); ret = send_tfa_cal_set_bypass(ptr, 4); return ret; @@ -1583,7 +1588,6 @@ static int tfa987x_algo_set_tx_enable(struct snd_kcontrol *kcontrol, int32_t ret = 0; u8 buff[56] = {0}, *ptr = buff; ((int32_t *)buff)[0] = ucontrol->value.integer.value[0]; - pr_err("%s:set_tx_enable %d\n", __func__, ((int32_t *)buff)[0]); atomic_set(&g_Tx_enable, ((int32_t *)buff)[0]); ret = send_tfa_cal_set_tx_enable(ptr, 4); return ret; @@ -1805,21 +1809,18 @@ static int tfa98xx_append_i2c_address(struct device *dev, snprintf(buf, 50, "%s-%x-%x", dai_drv[i].name, i2cbus, addr); dai_drv[i].name = tfa98xx_devm_kstrdup(dev, buf); - pr_info("tfa98xx_append_i2c_address() dai_drv[%d].name = [%s]\n", i, dai_drv[i].name); memset(buf, 0x00, sizeof(buf)); snprintf(buf, 50, "%s-%x-%x", dai_drv[i].playback.stream_name, i2cbus, addr); dai_drv[i].playback.stream_name = tfa98xx_devm_kstrdup(dev, buf); - pr_info("tfa98xx_append_i2c_address() dai_drv[%d].playback.stream_name = [%s]\n", i, dai_drv[i].playback.stream_name); memset(buf, 0x00, sizeof(buf)); snprintf(buf, 50, "%s-%x-%x", dai_drv[i].capture.stream_name, i2cbus, addr); dai_drv[i].capture.stream_name = tfa98xx_devm_kstrdup(dev, buf); - pr_info("tfa98xx_append_i2c_address() dai_drv[%d].capture.stream_name = [%s]\n", i, dai_drv[i].capture.stream_name); } /* the idea behind this is convert: @@ -2224,7 +2225,7 @@ static void tfa98xx_tapdet_check_update(struct tfa98xx *tfa98xx) /* interrupt not available, setup polling mode */ tfa98xx->tapdet_poll = true; if (enable) - queue_delayed_work(system_power_efficient_wq, + queue_delayed_work(tfa98xx->tfa98xx_wq, &tfa98xx->tapdet_work, HZ / 10); else cancel_delayed_work_sync(&tfa98xx->tapdet_work); @@ -2389,7 +2390,6 @@ static void tfa98xx_container_loaded(const struct firmware *cont, void *context) /* Preload settings using internal clock on TFA2 */ if ((tfa98xx->tfa->tfa_family == 2) && (tfa98xx->tfa->is_probus_device == 0)) { mutex_lock(&tfa98xx->dsp_lock); - pr_info("will be using internal clock to preload MAX2 TFA settings.\n"); ret = tfa98xx_tfa_start(tfa98xx, tfa98xx->profile, tfa98xx->vstep); if (ret == Tfa98xx_Error_Not_Supported) tfa98xx->dsp_fw_state = TFA98XX_DSP_FW_FAIL; @@ -2468,7 +2468,7 @@ static void tfa98xx_tapdet_work(struct work_struct *work) if (tfa_irq_get(tfa98xx->tfa, tfa9912_irq_sttapdet)) tfa98xx_tapdet(tfa98xx); - queue_delayed_work(system_power_efficient_wq, &tfa98xx->tapdet_work, HZ / 10); + queue_delayed_work(tfa98xx->tfa98xx_wq, &tfa98xx->tapdet_work, HZ / 10); } static void tfa98xx_nmode_update_work(struct work_struct *work) { @@ -2497,13 +2497,13 @@ static void tfa98xx_monitor(struct work_struct *work) if (error == Tfa98xx_Error_DSP_not_running) { if (tfa98xx->dsp_init == TFA98XX_DSP_INIT_DONE) { tfa98xx->dsp_init = TFA98XX_DSP_INIT_RECOVER; - queue_delayed_work(system_power_efficient_wq, &tfa98xx->init_work, 0); + queue_delayed_work(tfa98xx->tfa98xx_wq, &tfa98xx->init_work, 0); } } } /* reschedule */ - queue_delayed_work(system_power_efficient_wq, &tfa98xx->monitor_work, 5 * HZ); + queue_delayed_work(tfa98xx->tfa98xx_wq, &tfa98xx->monitor_work, 5 * HZ); #endif } @@ -2565,7 +2565,7 @@ static void tfa98xx_dsp_init(struct tfa98xx *tfa98xx) } if (reschedule) { /* reschedule this init work for later */ - queue_delayed_work(system_power_efficient_wq, + queue_delayed_work(tfa98xx->tfa98xx_wq, &tfa98xx->init_work, msecs_to_jiffies(5)); tfa98xx->init_count++; @@ -2603,7 +2603,7 @@ static void tfa98xx_dsp_init(struct tfa98xx *tfa98xx) * needed. */ if (tfa98xx->tfa->tfa_family == 1) - queue_delayed_work(system_power_efficient_wq, + queue_delayed_work(tfa98xx->tfa98xx_wq, &tfa98xx->monitor_work, 1 * HZ); mutex_unlock(&tfa98xx->dsp_lock); @@ -2848,7 +2848,6 @@ enum Tfa98xx_Error tfa98xx_adsp_send_calib_values(void) /* if the calibration value was sent to host DSP, we clear flag only (stereo case). */ if ((tfa98xx_device_count > 1) && (tfa98xx_device_count == bytes[0])) { - pr_info("The calibration value was sent to host DSP.\n"); bytes[0] = 0; return Tfa98xx_Error_Ok; } @@ -2861,7 +2860,6 @@ enum Tfa98xx_Error tfa98xx_adsp_send_calib_values(void) if (TFA_GET_BF(tfa, MTPEX) == 1) { value = tfa_dev_mtp_get(tfa, TFA_MTP_RE25); dsp_cal_value = (value * 65536) / 1000; - pr_info("Device 0x%x cal value is 0x%d\n", tfa98xx->i2c->addr, dsp_cal_value); bytes[nr++] = (uint8_t)((dsp_cal_value >> 16) & 0xff); bytes[nr++] = (uint8_t)((dsp_cal_value >> 8) & 0xff); @@ -2874,7 +2872,6 @@ enum Tfa98xx_Error tfa98xx_adsp_send_calib_values(void) if (tfa98xx_device_count == 1) { memcpy(&bytes[7], &bytes[4], sizeof(char)*3); } - pr_debug("tfa98xx_device_count=%d bytes[0]=%d\n", tfa98xx_device_count, bytes[0]); /* we will send it to host DSP algorithm once calibraion value loaded from all device. */ if (tfa98xx_device_count == bytes[0]) { @@ -2882,7 +2879,6 @@ enum Tfa98xx_Error tfa98xx_adsp_send_calib_values(void) bytes[2] = 0x81; bytes[3] = 0x05; - pr_debug("calibration value send to host DSP.\n"); ret = send_tfa_cal_in_band(&bytes[1], sizeof(bytes) - 1); msleep(10); @@ -2891,7 +2887,6 @@ enum Tfa98xx_Error tfa98xx_adsp_send_calib_values(void) bytes[0] = 0; } else { - pr_err("load calibration data from device failed.\n"); ret = Tfa98xx_Error_Bad_Parameter; } @@ -2902,7 +2897,6 @@ static int tfa98xx_send_mute_cmd(void) { uint8_t cmd[9] = {0x04, 0x81, 0x04, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff}; - pr_debug("send mute command to host DSP.\n"); return send_tfa_cal_in_band(&cmd[0], sizeof(cmd)); } #endif @@ -2918,14 +2912,11 @@ static int tfa98xx_mute(struct snd_soc_dai *dai, int mute, int stream) #endif dev_dbg(&tfa98xx->i2c->dev, "%s: state: %d\n", __func__, mute); - if (no_start) { - pr_debug("no_start parameter set no tfa_dev_start or tfa_dev_stop, returning\n"); + if (no_start) return 0; - } - if (tfa98xx->tfa_mute_mode == TFA98XX_DEVICE_MUTE_ON) { - pr_debug("%s: if Mute mode is enalbed, we don't need to power-on device.\n", __func__); + + if (tfa98xx->tfa_mute_mode == TFA98XX_DEVICE_MUTE_ON) return 0; - } if (mute) { /* stop DSP only when both playback and capture streams @@ -2969,17 +2960,11 @@ static int tfa98xx_mute(struct snd_soc_dai *dai, int mute, int stream) tfa98xx->cstream = 1; } -#if 0 - /* Start DSP with async mode.*/ - if (tfa98xx->dsp_init != TFA98XX_DSP_INIT_PENDING) - queue_delayed_work(system_power_efficient_wq, - &tfa98xx->init_work, 0); -#else - /* Start DSP with sync mode.*/ - pr_debug("[NXP] %s dsp_init=%d\n", __func__, tfa98xx->dsp_init); - if (tfa98xx->dsp_init != TFA98XX_DSP_INIT_PENDING) - tfa98xx_dsp_init(tfa98xx); -#endif + /* Start DSP with async mode.*/ + if (tfa98xx->dsp_init != TFA98XX_DSP_INIT_PENDING) + queue_delayed_work(tfa98xx->tfa98xx_wq, + &tfa98xx->init_work, 0); + if (tfa98xx->flags & TFA98XX_FLAG_ADAPT_NOISE_MODE) queue_delayed_work(tfa98xx->tfa98xx_wq, &tfa98xx->nmodeupdate_work, @@ -3041,6 +3026,10 @@ static int tfa98xx_probe(struct snd_soc_codec *codec) #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) snd_soc_component_init_regmap(codec, tfa98xx->regmap); #endif + /* setup work queue, will be used to initial DSP on first boot up */ + tfa98xx->tfa98xx_wq = create_singlethread_workqueue("tfa98xx"); + if (!tfa98xx->tfa98xx_wq) + return -ENOMEM; INIT_DELAYED_WORK(&tfa98xx->init_work, tfa98xx_dsp_init_work); INIT_DELAYED_WORK(&tfa98xx->monitor_work, tfa98xx_monitor); @@ -3090,6 +3079,9 @@ static int tfa98xx_remove(struct snd_soc_codec *codec) cancel_delayed_work_sync(&tfa98xx->tapdet_work); cancel_delayed_work_sync(&tfa98xx->nmodeupdate_work); + if (tfa98xx->tfa98xx_wq) + destroy_workqueue(tfa98xx->tfa98xx_wq); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) return; #else @@ -3155,7 +3147,7 @@ static void tfa98xx_irq_tfa2(struct tfa98xx *tfa98xx) * will be unmasked after handling interrupts in workqueue */ tfa_irq_mask(tfa98xx->tfa); - queue_delayed_work(system_power_efficient_wq, &tfa98xx->interrupt_work, 0); + queue_delayed_work(tfa98xx->tfa98xx_wq, &tfa98xx->interrupt_work, 0); } @@ -3320,7 +3312,6 @@ static int tfa98xx_misc_device_profile_open(struct inode *inode, struct file *fi { struct tfa98xx *tfa98xx = container_of(file->private_data, struct tfa98xx, tfa98xx_profile); - //pr_info("entry tfa98xx=%p\n", tfa98xx); if (tfa98xx) { file->private_data = tfa98xx; return 0; @@ -3338,19 +3329,13 @@ static ssize_t tfa98xx_misc_device_profile_write(struct file *file, const char _ int ret = 0; int profileID = 0; - //pr_info("entry count=%d\n", (int)count); if (tfa98xx == NULL) { pr_err("%s tfa98xx is NULL.\n", __func__); return -EINVAL; } - /*if (count != 1) { - pr_err("%s invalid register address\n", __func__); - return -EINVAL; - }*/ memset(name, 0x00, sizeof(name)); ret = copy_from_user(name, user_buf, count); - //pr_info("profile name=%s\n", name); /* search profile name and return ID. */ profileID = get_profile_id_by_name(name, strlen(name)); @@ -3367,7 +3352,6 @@ static ssize_t tfa98xx_misc_device_profile_write(struct file *file, const char _ tfa98xx_mixer_profile = profileID; tfa98xx->profile = prof_idx; tfa98xx->vstep = tfa98xx->prof_vsteps[prof_idx]; - //pr_info("update profile index (%d:%d) succeeded\n", profileID, prof_idx); } } @@ -3394,8 +3378,6 @@ static ssize_t tfa98xx_misc_device_reg_write(struct file *file, const char __use u8 address = 0; int ret = 0; - //pr_info("entry count=%d\n", (int)count); - if (tfa98xx == NULL) { pr_err("tfa98xx is NULL.\n"); return -EINVAL; @@ -3412,7 +3394,6 @@ static ssize_t tfa98xx_misc_device_reg_write(struct file *file, const char __use } tfa98xx->reg = address; - //pr_info("tfa98xx->reg=0x%x\n", tfa98xx->reg); return count; } @@ -3453,8 +3434,6 @@ static ssize_t tfa98xx_misc_device_rw_read(struct file *file, char __user *user_ int ret; int retries = I2C_RETRIES; - //pr_info("entry count=%d\n", (int)count); - data = kmalloc(count+1, GFP_KERNEL); if (data == NULL) { pr_debug("can not allocate memory\n"); @@ -3465,7 +3444,6 @@ static ssize_t tfa98xx_misc_device_rw_read(struct file *file, char __user *user_ retry: ret = i2c_transfer(tfa98xx->i2c->adapter, msgs, ARRAY_SIZE(msgs)); - //pr_info("i2c_transfer ret=%d\n", ret); if (ret < 0) { pr_warn("i2c error, retries left: %d\n", retries); @@ -3498,7 +3476,6 @@ static ssize_t tfa98xx_misc_device_rw_write(struct file *file, const char __user u8 *data; int ret; int retries = I2C_RETRIES; - //pr_info("entry count=%d\n", (int)count); data = kmalloc(count+1, GFP_KERNEL); if (data == NULL) { @@ -3506,8 +3483,6 @@ static ssize_t tfa98xx_misc_device_rw_write(struct file *file, const char __user return -ENOMEM; } - //pr_info("tfa98xx->reg=0x%x\n", tfa98xx->reg); - data[0] = tfa98xx->reg; if (copy_from_user(&data[1], user_buf, count)) { pr_err("copy to user space failed.\n"); @@ -3544,8 +3519,6 @@ static int tfa98xx_misc_device_rpc_open(struct inode *inode, struct file *file) } } -extern int send_tfa_cal_apr(void *buf, int cmd_size, bool bRead); - static ssize_t tfa98xx_misc_device_rpc_read(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { @@ -3617,18 +3590,16 @@ static ssize_t tfa98xx_misc_device_rpc_write(struct file *file, const char __use } enum Tfa98xx_Error tfa98xx_read_data_from_hostdsp(struct tfa_device *tfa, - unsigned char module_id, - unsigned char param_id, int num_bytes, - unsigned char data[]) + unsigned char module_id, + unsigned char param_id, int num_bytes, + unsigned char data[]) { int error; unsigned char buffer[3]; int nr = 0; - if (num_bytes <= 0) { - pr_debug("Error: The number of READ bytes is smaller or equal to 0!\n"); + if (num_bytes <= 0) return Tfa98xx_Error_Fail; - } if ((tfa->cnt->ndev == 1) && (param_id == SB_PARAM_GET_RE25C || @@ -3839,12 +3810,6 @@ static long tfa98xx_misc_device_control_ioctl(struct file *file, list_for_each_entry(tfa98xx, &tfa98xx_device_list, list) { /* clear buffer and read livedata from dsp.*/ memset((char *)(&livedata[0]), 0x00, sizeof(livedata)); - /* read original memtrack data from device. */ - if (Tfa98xx_Error_Ok == tfa98xx_read_memtrack_data(tfa98xx, &livedata[0])) { - pr_debug("Device 0x%x read memtrack data sucessed.\n", tfa98xx->i2c->addr); - } else { - pr_err("Device 0x%x read memtrack data failed.\n", tfa98xx->i2c->addr); - } /* copy data to user spcace. if copied is successed, will be returned actual size to user space. */ @@ -3895,7 +3860,6 @@ static long tfa98xx_misc_device_control_ioctl(struct file *file, break; } - //pr_info("exit result=%d\n", result); return result; } @@ -3904,8 +3868,6 @@ static long tfa98xx_misc_device_control_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { - //pr_info("%s entry cmd=%d arg=%p\n", __func__, cmd, (void*)arg); - if (!arg) { pr_err("%s No data send to driver!\n", __func__); return -EINVAL; @@ -3964,7 +3926,6 @@ int tfa98xx_init_misc_device(struct tfa98xx *tfa98xx) return -EINVAL; } - //pr_info("I2C bus=0x%x address=0x%x\n", tfa98xx->i2c->adapter->nr, tfa98xx->i2c->addr); /* create device node "tfa_reg_X" for write sub address. */ tfa98xx->tfa98xx_reg.minor = MISC_DYNAMIC_MINOR; tfa98xx->tfa98xx_reg.name = miscdevice_info[MISC_DEVICE_TFA98XX_REG].devicename; @@ -4017,7 +3978,6 @@ int tfa98xx_init_misc_device(struct tfa98xx *tfa98xx) void tfa98xx_remove_misc_device(struct tfa98xx *tfa98xx) { - pr_info("entry\n"); if (tfa98xx == NULL) { pr_err("tfa98xx is NULL.\n"); return; diff --git a/techpack/audio/asoc/codecs/tfa98xx/src/tfa_dsp.c b/techpack/audio/asoc/codecs/tfa98xx/src/tfa_dsp.c index b8881cb69cdb..9940944ef5b3 100644 --- a/techpack/audio/asoc/codecs/tfa98xx/src/tfa_dsp.c +++ b/techpack/audio/asoc/codecs/tfa98xx/src/tfa_dsp.c @@ -3158,7 +3158,7 @@ enum tfa_error tfa_dev_start(struct tfa_device *tfa, int next_profile, int vstep TFA_SET_BF(tfa, TDMNBCK, 0); TFA_SET_BF(tfa, TDMSLLN, 15); TFA_SET_BF(tfa, TDMSSIZE, 15); - } else if ((pcm_format == 24) || (pcm_format == 32)) { + } else if ((24 == pcm_format) || (pcm_format == 32)) { TFA_SET_BF(tfa, TDMNBCK, 2); TFA_SET_BF(tfa, TDMSLLN, 31); TFA_SET_BF(tfa, TDMSSIZE, 31); diff --git a/techpack/audio/asoc/codecs/tfa98xx/src/tfa_init.c b/techpack/audio/asoc/codecs/tfa98xx/src/tfa_init.c index e186b7d183c4..54ed275cccf6 100644 --- a/techpack/audio/asoc/codecs/tfa98xx/src/tfa_init.c +++ b/techpack/audio/asoc/codecs/tfa98xx/src/tfa_init.c @@ -8,6 +8,7 @@ * */ + #include "dbgprint.h" #include "tfa_service.h" #include "tfa_internal.h" @@ -156,7 +157,7 @@ static int tfa_get_swvstep(struct tfa_device *tfa) return value - 1; /* invalid if 0 */ } -static int tfa_get_mtpb(struct tfa_device *tfa) +static int tfa_get_mtpb(struct tfa_device *tfa) { int value = 0; @@ -723,7 +724,7 @@ static enum Tfa98xx_Error tfa9873_dsp_system_stable(struct tfa_device *tfa, int return error; } -static int tfa9873_get_mtpb(struct tfa_device *tfa) +static int tfa9873_get_mtpb(struct tfa_device *tfa) { int value; @@ -780,14 +781,14 @@ static enum Tfa98xx_Error tfa9873_specific(struct tfa_device *tfa) break; case 0x0b73: /* ----- generated code start ----- */ - /* ----- version 13 ----- */ + /* ----- version 16 ----- */ reg_write(tfa, 0x02, 0x0628); //POR=0x0008 reg_write(tfa, 0x61, 0x0183); //POR=0x0182 reg_write(tfa, 0x63, 0x005a); //POR=0x055a - reg_write(tfa, 0x6f, 0x0083); //POR=0x00a5 - reg_write(tfa, 0x70, 0xa3fb); //POR=0x23fb + reg_write(tfa, 0x6f, 0x0082); //POR=0x00a5 + reg_write(tfa, 0x70, 0xa3eb); //POR=0x23fb reg_write(tfa, 0x73, 0x0187); //POR=0x0107 - reg_write(tfa, 0x83, 0x009a); //POR=0x0799 + reg_write(tfa, 0x83, 0x071c); //POR=0x0799 reg_write(tfa, 0x85, 0x0380); //POR=0x0382 reg_write(tfa, 0xd5, 0x004d); //POR=0x014d /* ----- generated code end ----- */ @@ -963,7 +964,7 @@ static enum Tfa98xx_Error tfa9874_dsp_system_stable(struct tfa_device *tfa, int return error; } -static int tfa9874_get_mtpb(struct tfa_device *tfa) +static int tfa9874_get_mtpb(struct tfa_device *tfa) { int value; @@ -1107,7 +1108,7 @@ static enum Tfa98xx_Error tfa9878_dsp_system_stable(struct tfa_device *tfa, int return error; } -static int tfa9878_get_mtpb(struct tfa_device *tfa) +static int tfa9878_get_mtpb(struct tfa_device *tfa) { int value; diff --git a/techpack/audio/asoc/codecs/wcd-clsh.c b/techpack/audio/asoc/codecs/wcd-clsh.c index 980f709d3913..6f54593aff93 100644 --- a/techpack/audio/asoc/codecs/wcd-clsh.c +++ b/techpack/audio/asoc/codecs/wcd-clsh.c @@ -70,7 +70,7 @@ static const char *state_to_str(u8 state, char *buf, size_t buflen) for (i = 0; i < ARRAY_SIZE(states); i++) { if (!(state & (1 << i))) continue; - cnt = scnprintf(buf, buflen - cnt - 1, "%s%s%s", buf, + cnt = snprintf(buf, buflen - cnt - 1, "%s%s%s", buf, buf[0] == '\0' ? "[" : "|", states[i]); } diff --git a/techpack/audio/asoc/codecs/wcd-dsp-mgr.c b/techpack/audio/asoc/codecs/wcd-dsp-mgr.c index 647a07ef7242..402c8c85290a 100644 --- a/techpack/audio/asoc/codecs/wcd-dsp-mgr.c +++ b/techpack/audio/asoc/codecs/wcd-dsp-mgr.c @@ -1,6 +1,5 @@ /* * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 @@ -1257,12 +1256,8 @@ static int wdsp_mgr_parse_dt_entries(struct wdsp_mgr_priv *wdsp) return ret; } -#ifdef GOOGLE_HOTWORD wdsp->img_fname = "cpe_intl"; pr_info("%s: using global wdsp fw: %s.\n", __func__, wdsp->img_fname); -#else - pr_info("%s: using non-global wdsp fw: %s.\n", __func__, wdsp->img_fname); -#endif ret = of_count_phandle_with_args(dev->of_node, "qcom,wdsp-components", diff --git a/techpack/audio/asoc/codecs/wcd-mbhc-v2.c b/techpack/audio/asoc/codecs/wcd-mbhc-v2.c index 0170cb721526..9cb62a35b6ae 100644 --- a/techpack/audio/asoc/codecs/wcd-mbhc-v2.c +++ b/techpack/audio/asoc/codecs/wcd-mbhc-v2.c @@ -1,5 +1,4 @@ /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 @@ -36,7 +35,6 @@ #include "wcd-mbhc-v2-api.h" #define CONFIG_AUDIO_UART_DEBUG -static struct wakeup_source mbhc_ws; void wcd_mbhc_jack_report(struct wcd_mbhc *mbhc, struct snd_soc_jack *jack, int status, int mask) @@ -257,7 +255,6 @@ static int wcd_event_notify(struct notifier_block *self, unsigned long val, MBHC_COMMON_MICB_PRECHARGE, false); out_micb_en: - /* Disable current source if micbias enabled */ if (!mbhc->mbhc_cb->mbhc_micbias_control) { mbhc->is_hs_recording = true; wcd_enable_curr_micbias(mbhc, WCD_MBHC_EN_MB); @@ -1172,7 +1169,6 @@ static irqreturn_t wcd_mbhc_btn_press_handler(int irq, void *data) unsigned long msec_val; pr_debug("%s: enter\n", __func__); - __pm_wakeup_event(&mbhc_ws, 500); complete(&mbhc->btn_press_compl); WCD_MBHC_RSC_LOCK(mbhc); wcd_cancel_btn_work(mbhc); @@ -1223,7 +1219,6 @@ static irqreturn_t wcd_mbhc_release_handler(int irq, void *data) int ret; pr_debug("%s: enter\n", __func__); - __pm_wakeup_event(&mbhc_ws, 500); WCD_MBHC_RSC_LOCK(mbhc); if (wcd_swch_level_remove(mbhc)) { pr_debug("%s: Switch level is low ", __func__); @@ -1857,7 +1852,6 @@ int wcd_mbhc_start(struct wcd_mbhc *mbhc, struct wcd_mbhc_config *mbhc_cfg) goto err; } #endif - rc = wcd_mbhc_usb_c_analog_init(mbhc); if (rc) { rc = EPROBE_DEFER; @@ -2239,7 +2233,6 @@ int wcd_mbhc_init(struct wcd_mbhc *mbhc, struct snd_soc_codec *codec, mbhc->intr_ids->hph_right_ocp); goto err_hphr_ocp_irq; } - wakeup_source_init(&mbhc_ws, "mbhc_ws"); mbhc->deinit_in_progress = false; pr_debug("%s: leave ret %d\n", __func__, ret); @@ -2264,7 +2257,6 @@ err_mbhc_sw_irq: mbhc->mbhc_cb->register_notifier(mbhc, &mbhc->nblock, false); mutex_destroy(&mbhc->codec_resource_lock); err: - wakeup_source_trash(&mbhc_ws); pr_debug("%s: leave ret %d\n", __func__, ret); return ret; } diff --git a/techpack/audio/asoc/codecs/wcd-spi.c b/techpack/audio/asoc/codecs/wcd-spi.c index c73bc2ce2814..d9a5567f7341 100644 --- a/techpack/audio/asoc/codecs/wcd-spi.c +++ b/techpack/audio/asoc/codecs/wcd-spi.c @@ -1,6 +1,5 @@ /* * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 @@ -1392,7 +1391,7 @@ static int wcd_spi_component_bind(struct device *dev, } if (wcd_spi_debugfs_init(spi)) - dev_dbg(&spi->dev, "%s: Failed debugfs init\n", __func__); + dev_err(&spi->dev, "%s: Failed debugfs init\n", __func__); spi_message_init(&wcd_spi->msg1); spi_message_add_tail(&wcd_spi->xfer1, &wcd_spi->msg1); diff --git a/techpack/audio/asoc/codecs/wcd934x/Android.mk b/techpack/audio/asoc/codecs/wcd934x/Android.mk deleted file mode 100644 index af4f17b04cd2..000000000000 --- a/techpack/audio/asoc/codecs/wcd934x/Android.mk +++ /dev/null @@ -1,66 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,sdm845),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM845=m -endif - -ifeq ($(call is-board-platform,sdm660),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m -endif - -ifeq ($(call is-board-platform,msmnile),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m -endif - -ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) atoll $(TRINKET)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -ifeq ($(call is-board-platform-in-list,msm8953 sdm670 qcs605),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM670=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msm8953 sdm845 sdm670 sdm660 qcs605 msmnile atoll $(MSMSTEPPE) $(TRINKET)),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=wcd934x_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd934x.ko -LOCAL_MODULE_KBUILD_NAME := wcd934x_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/asoc/codecs/wcd934x/wcd934x-mbhc.h b/techpack/audio/asoc/codecs/wcd934x/wcd934x-mbhc.h index f1330863a2e3..7995017f2e0d 100644 --- a/techpack/audio/asoc/codecs/wcd934x/wcd934x-mbhc.h +++ b/techpack/audio/asoc/codecs/wcd934x/wcd934x-mbhc.h @@ -1,6 +1,5 @@ /* * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 diff --git a/techpack/audio/asoc/codecs/wcd934x/wcd934x-regmap.c b/techpack/audio/asoc/codecs/wcd934x/wcd934x-regmap.c index 02cc05ca197f..e62b69c6931f 100644 --- a/techpack/audio/asoc/codecs/wcd934x/wcd934x-regmap.c +++ b/techpack/audio/asoc/codecs/wcd934x/wcd934x-regmap.c @@ -1,6 +1,5 @@ /* * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 diff --git a/techpack/audio/asoc/codecs/wcd934x/wcd934x.c b/techpack/audio/asoc/codecs/wcd934x/wcd934x.c index 0d89afe22f19..02f8b88ee0d3 100644 --- a/techpack/audio/asoc/codecs/wcd934x/wcd934x.c +++ b/techpack/audio/asoc/codecs/wcd934x/wcd934x.c @@ -1,5 +1,4 @@ /* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 @@ -640,7 +639,7 @@ struct tavil_priv { int power_active_ref; u8 sidetone_coeff_array[IIR_MAX][BAND_MAX] [WCD934X_CDC_SIDETONE_IIR_COEFF_MAX * 4]; - unsigned short slim_tx_of_uf_cnt[WCD934X_TX_MAX][SB_PORT_ERR_MAX]; + struct spi_device *spi; struct platform_device *pdev_child_devices [WCD934X_CHILD_DEVICES_MAX]; @@ -650,6 +649,7 @@ struct tavil_priv { int micb_load_low; int micb_load_high; u8 dmic_drv_ctl; + unsigned short slim_tx_of_uf_cnt[WCD934X_TX_MAX][SB_PORT_ERR_MAX]; }; static const struct tavil_reg_mask_val tavil_spkr_default[] = { @@ -1930,9 +1930,9 @@ static int tavil_codec_enable_slimvi_feedback(struct snd_soc_dapm_widget *w, struct wcd9xxx *core = NULL; struct snd_soc_codec *codec = NULL; struct tavil_priv *tavil_p = NULL; + struct wcd9xxx_ch *ch; int ret = 0; struct wcd9xxx_codec_dai_data *dai = NULL; - struct wcd9xxx_ch *ch; codec = snd_soc_dapm_to_codec(w->dapm); tavil_p = snd_soc_codec_get_drvdata(codec); diff --git a/techpack/audio/asoc/codecs/wcd934x/wcd934x.h b/techpack/audio/asoc/codecs/wcd934x/wcd934x.h index c96e93aa56df..0f2e2a396cc7 100644 --- a/techpack/audio/asoc/codecs/wcd934x/wcd934x.h +++ b/techpack/audio/asoc/codecs/wcd934x/wcd934x.h @@ -1,6 +1,5 @@ /* * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 diff --git a/techpack/audio/asoc/codecs/wcd9360/Android.mk b/techpack/audio/asoc/codecs/wcd9360/Android.mk deleted file mode 100644 index 492061265f26..000000000000 --- a/techpack/audio/asoc/codecs/wcd9360/Android.mk +++ /dev/null @@ -1,50 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,msmnile),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msmnile),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=wcd9360_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd9360.ko -LOCAL_MODULE_KBUILD_NAME := wcd9360_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/asoc/codecs/wcd937x/Android.mk b/techpack/audio/asoc/codecs/wcd937x/Android.mk deleted file mode 100644 index dec151ad0438..000000000000 --- a/techpack/audio/asoc/codecs/wcd937x/Android.mk +++ /dev/null @@ -1,57 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) atoll $(TRINKET)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msm8953 sdm845 sdm670 qcs605 msmnile atoll $(MSMSTEPPE) $(TRINKET)),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=wcd937x_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd937x.ko -LOCAL_MODULE_KBUILD_NAME := wcd937x_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd937x_slave.ko -LOCAL_MODULE_KBUILD_NAME := wcd937x_slave_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/asoc/codecs/wcd9xxx-common-v2.c b/techpack/audio/asoc/codecs/wcd9xxx-common-v2.c index eab5497c7a89..934519c9adee 100644 --- a/techpack/audio/asoc/codecs/wcd9xxx-common-v2.c +++ b/techpack/audio/asoc/codecs/wcd9xxx-common-v2.c @@ -1,6 +1,5 @@ /* * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 @@ -366,7 +365,7 @@ static const char *state_to_str(u8 state, char *buf, size_t buflen) for (i = 0; i < ARRAY_SIZE(states); i++) { if (!(state & (1 << i))) continue; - cnt = scnprintf(buf, buflen - cnt - 1, "%s%s%s", buf, + cnt = snprintf(buf, buflen - cnt - 1, "%s%s%s", buf, buf[0] == '\0' ? "[" : "|", states[i]); } diff --git a/techpack/audio/asoc/codecs/wcd9xxx-core.c b/techpack/audio/asoc/codecs/wcd9xxx-core.c index 312373339ad3..f1b34b047251 100644 --- a/techpack/audio/asoc/codecs/wcd9xxx-core.c +++ b/techpack/audio/asoc/codecs/wcd9xxx-core.c @@ -129,7 +129,7 @@ static int wcd9xxx_slim_multi_reg_write(struct wcd9xxx *wcd9xxx, if (num_regs == 0) return -EINVAL; - bulk_reg = kcalloc(num_regs, sizeof(struct wcd9xxx_reg_val), + bulk_reg = kzalloc(num_regs * (sizeof(struct wcd9xxx_reg_val)), GFP_KERNEL); if (!bulk_reg) return -ENOMEM; @@ -435,7 +435,7 @@ int wcd9xxx_slim_bulk_write(struct wcd9xxx *wcd9xxx, return 0; } - msgs = kcalloc(size, sizeof(struct slim_val_inf), GFP_KERNEL); + msgs = kzalloc(size * (sizeof(struct slim_val_inf)), GFP_KERNEL); if (!msgs) { ret = -ENOMEM; goto mem_fail; diff --git a/techpack/audio/asoc/codecs/wcd9xxx-irq.c b/techpack/audio/asoc/codecs/wcd9xxx-irq.c index 88b6ede42891..ad15470a393f 100644 --- a/techpack/audio/asoc/codecs/wcd9xxx-irq.c +++ b/techpack/audio/asoc/codecs/wcd9xxx-irq.c @@ -1,5 +1,4 @@ /* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 @@ -636,14 +635,10 @@ int wcd9xxx_request_irq(struct wcd9xxx_core_resource *wcd9xxx_res, const char *name, void *data) { int virq; - int flags = IRQF_TRIGGER_RISING; virq = phyirq_to_virq(wcd9xxx_res, irq); - if (!strncmp(name, "Button ", strlen("Button") + 1)) - flags |= IRQF_NO_SUSPEND; - - return request_threaded_irq(virq, NULL, handler, flags, + return request_threaded_irq(virq, NULL, handler, IRQF_TRIGGER_RISING, name, data); } EXPORT_SYMBOL(wcd9xxx_request_irq); diff --git a/techpack/audio/asoc/codecs/wcd9xxx-slimslave.c b/techpack/audio/asoc/codecs/wcd9xxx-slimslave.c index 1b3d85d0e1ca..560e80b17902 100644 --- a/techpack/audio/asoc/codecs/wcd9xxx-slimslave.c +++ b/techpack/audio/asoc/codecs/wcd9xxx-slimslave.c @@ -1,5 +1,4 @@ /* Copyright (c) 2012-2017, 2019, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 diff --git a/techpack/audio/asoc/codecs/wcd9xxx-slimslave.h b/techpack/audio/asoc/codecs/wcd9xxx-slimslave.h index c407b76c598c..fdf98e123873 100644 --- a/techpack/audio/asoc/codecs/wcd9xxx-slimslave.h +++ b/techpack/audio/asoc/codecs/wcd9xxx-slimslave.h @@ -1,5 +1,4 @@ /* Copyright (c) 2012-2015, 2019, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 diff --git a/techpack/audio/asoc/codecs/wcd_cpe_core.c b/techpack/audio/asoc/codecs/wcd_cpe_core.c index 66c03c5ade6a..d64a74978ce9 100644 --- a/techpack/audio/asoc/codecs/wcd_cpe_core.c +++ b/techpack/audio/asoc/codecs/wcd_cpe_core.c @@ -2257,7 +2257,6 @@ static int fill_cmi_header(struct cmi_hdr *hdr, return -EINVAL; } - hdr->hdr_info = 0; CMI_HDR_SET_SESSION(hdr, session_id); CMI_HDR_SET_SERVICE(hdr, service_id); if (version) diff --git a/techpack/audio/asoc/msm-compress-q6-v2.c b/techpack/audio/asoc/msm-compress-q6-v2.c index 5ba373ea74f0..bd38c7329bba 100644 --- a/techpack/audio/asoc/msm-compress-q6-v2.c +++ b/techpack/audio/asoc/msm-compress-q6-v2.c @@ -1,5 +1,4 @@ /* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 diff --git a/techpack/audio/asoc/msm-dai-fe.c b/techpack/audio/asoc/msm-dai-fe.c index 9198301c9c36..6709a22c4d93 100644 --- a/techpack/audio/asoc/msm-dai-fe.c +++ b/techpack/audio/asoc/msm-dai-fe.c @@ -1,5 +1,4 @@ /* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 diff --git a/techpack/audio/asoc/msm-dai-q6-v2.c b/techpack/audio/asoc/msm-dai-q6-v2.c index b79bdc23b740..4c043edafc27 100644 --- a/techpack/audio/asoc/msm-dai-q6-v2.c +++ b/techpack/audio/asoc/msm-dai-q6-v2.c @@ -4140,9 +4140,9 @@ static int msm_auxpcm_dev_probe(struct platform_device *pdev) } auxpcm_pdata->mode_8k.slot_mapping = - kcalloc(auxpcm_pdata->mode_8k.num_slots, - sizeof(uint16_t), - GFP_KERNEL); + kzalloc(sizeof(uint16_t) * + auxpcm_pdata->mode_8k.num_slots, + GFP_KERNEL); if (!auxpcm_pdata->mode_8k.slot_mapping) { dev_err(&pdev->dev, "%s No mem for mode_8k slot mapping\n", __func__); @@ -4155,9 +4155,9 @@ static int msm_auxpcm_dev_probe(struct platform_device *pdev) (u16)be32_to_cpu(slot_mapping_array[i]); auxpcm_pdata->mode_16k.slot_mapping = - kcalloc(auxpcm_pdata->mode_16k.num_slots, - sizeof(uint16_t), - GFP_KERNEL); + kzalloc(sizeof(uint16_t) * + auxpcm_pdata->mode_16k.num_slots, + GFP_KERNEL); if (!auxpcm_pdata->mode_16k.slot_mapping) { dev_err(&pdev->dev, "%s No mem for mode_16k slot mapping\n", diff --git a/techpack/audio/asoc/msm-dai-slim.c b/techpack/audio/asoc/msm-dai-slim.c index 906a86f6b007..e8bdf13fdc6c 100644 --- a/techpack/audio/asoc/msm-dai-slim.c +++ b/techpack/audio/asoc/msm-dai-slim.c @@ -500,8 +500,8 @@ static int msm_dai_slim_populate_dai_data(struct device *dev, SET_DAI_STATE(dai_data_t->status, DAI_STATE_INITIALIZED); - dai_data_t->chan_h = devm_kcalloc(dev, - num_ch, sizeof(u16), + dai_data_t->chan_h = devm_kzalloc(dev, + sizeof(u16) * num_ch, GFP_KERNEL); if (!dai_data_t->chan_h) { dev_err(dev, @@ -511,8 +511,8 @@ static int msm_dai_slim_populate_dai_data(struct device *dev, goto err_mem_alloc; } - dai_data_t->sh_ch = devm_kcalloc(dev, - num_ch, sizeof(u16), + dai_data_t->sh_ch = devm_kzalloc(dev, + sizeof(u16) * num_ch, GFP_KERNEL); if (!dai_data_t->sh_ch) { dev_err(dev, diff --git a/techpack/audio/asoc/msm-lsm-client.c b/techpack/audio/asoc/msm-lsm-client.c index db355ec679f6..6cc8d43575c9 100644 --- a/techpack/audio/asoc/msm-lsm-client.c +++ b/techpack/audio/asoc/msm-lsm-client.c @@ -2535,7 +2535,7 @@ static int msm_lsm_send_ch_mix_config(struct snd_pcm_substream *substream) return 0; } - ch_wght_coeff = kcalloc(in_params->num_chs * pp_ch_cnt, sizeof(int), + ch_wght_coeff = kzalloc(in_params->num_chs * pp_ch_cnt * sizeof(int), GFP_KERNEL); if (!ch_wght_coeff) return -ENOMEM; diff --git a/techpack/audio/asoc/msm-pcm-q6-v2.c b/techpack/audio/asoc/msm-pcm-q6-v2.c index 7210fa3a18a3..40acfe7e31dc 100644 --- a/techpack/audio/asoc/msm-pcm-q6-v2.c +++ b/techpack/audio/asoc/msm-pcm-q6-v2.c @@ -1693,6 +1693,9 @@ static int msm_pcm_chmap_ctl_get(struct snd_kcontrol *kcontrol, return -EINVAL; } + memset(ucontrol->value.integer.value, 0, + sizeof(ucontrol->value.integer.value)); + mutex_lock(&pdata->lock); prtd = substream->runtime->private_data; diff --git a/techpack/audio/asoc/msm-pcm-routing-v2.c b/techpack/audio/asoc/msm-pcm-routing-v2.c index d25fd954c42c..9ab530867440 100644 --- a/techpack/audio/asoc/msm-pcm-routing-v2.c +++ b/techpack/audio/asoc/msm-pcm-routing-v2.c @@ -1,5 +1,4 @@ /* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 @@ -44,12 +43,10 @@ #include #include #endif -/* for mius start */ #ifdef CONFIG_US_PROXIMITY #include #include #endif -/* for mius end */ #include "msm-pcm-routing-v2.h" #include "msm-pcm-routing-devdep.h" @@ -105,7 +102,6 @@ static bool is_ds2_on; static bool swap_ch; static bool hifi_filter_enabled; static int aanc_level; -static int adsp_ssr_switch_status; #define WEIGHT_0_DB 0x4000 /* all the FEs which can support channel mixer */ @@ -2507,32 +2503,6 @@ static int msm_routing_put_usb_switch_mixer(struct snd_kcontrol *kcontrol, return 1; } -static int adsp_ssr_trigger_status_get(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) -{ - ucontrol->value.integer.value[0] = adsp_ssr_switch_status; - pr_debug("%s: get value %ld\n", __func__, - ucontrol->value.integer.value[0]); - return 0; -} - -static int adsp_ssr_trigger_status_put(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) -{ - int ret = 0; - - adsp_ssr_switch_status = ucontrol->value.integer.value[0]; - pr_debug("%s: put value %d\n", __func__, adsp_ssr_switch_status); - - if (adsp_ssr_switch_status > 0) { - ret = q6core_adsp_crash(); - pr_info("%s: trigger SSR ret %d\n", __func__, ret); - } - - adsp_ssr_switch_status = 0; - return ret; -} - static int msm_routing_get_pri_mi2s_switch_mixer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { @@ -3895,6 +3865,7 @@ static int msm_routing_ec_ref_rx_put(struct snd_kcontrol *kcontrol, struct snd_soc_dapm_update *update = NULL; bool state = true; + mutex_lock(&routing_lock); switch (ucontrol->value.integer.value[0]) { case 0: @@ -4050,9 +4021,8 @@ static int msm_routing_ec_ref_rx_put(struct snd_kcontrol *kcontrol, state = false; break; } - pr_debug("%s: msm_route_ec_ref_rx = %d\n", - __func__, msm_route_ec_ref_rx); + __func__, msm_route_ec_ref_rx); if (!strncmp(widget->name, "AUDIO_REF_EC_UL10 MUX", strlen("AUDIO_REF_EC_UL10 MUX"))) voip_ext_ec_common_ref = msm_route_ec_ref_rx; @@ -6692,10 +6662,6 @@ static const struct snd_kcontrol_new slimbus_7_rx_mixer_controls[] = { MSM_BACKEND_DAI_SLIMBUS_7_RX, MSM_FRONTEND_DAI_MULTIMEDIA26, 1, 0, msm_routing_get_audio_mixer, msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia30", SND_SOC_NOPM, - MSM_BACKEND_DAI_SLIMBUS_7_RX, - MSM_FRONTEND_DAI_MULTIMEDIA30, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), }; static const struct snd_kcontrol_new slimbus_9_rx_mixer_controls[] = { @@ -6837,10 +6803,6 @@ static const struct snd_kcontrol_new usb_audio_rx_mixer_controls[] = { MSM_BACKEND_DAI_USB_RX, MSM_FRONTEND_DAI_MULTIMEDIA26, 1, 0, msm_routing_get_audio_mixer, msm_routing_put_audio_mixer), - SOC_DOUBLE_EXT("MultiMedia30", SND_SOC_NOPM, - MSM_BACKEND_DAI_USB_RX, - MSM_FRONTEND_DAI_MULTIMEDIA30, 1, 0, msm_routing_get_audio_mixer, - msm_routing_put_audio_mixer), }; static const struct snd_kcontrol_new int_bt_sco_rx_mixer_controls[] = { @@ -15357,11 +15319,6 @@ static const struct snd_kcontrol_new tert_tdm_rx_0_port_mixer_controls[] = { MSM_BACKEND_DAI_QUIN_TDM_TX_3, 1, 0, msm_routing_get_port_mixer, msm_routing_put_port_mixer), - SOC_DOUBLE_EXT("SLIM_7_TX", SND_SOC_NOPM, - MSM_BACKEND_DAI_TERT_TDM_RX_0, - MSM_BACKEND_DAI_SLIMBUS_7_TX, 1, 0, - msm_routing_get_port_mixer, - msm_routing_put_port_mixer), }; static const struct snd_kcontrol_new tert_tdm_rx_1_port_mixer_controls[] = { @@ -17081,11 +17038,6 @@ static const struct snd_kcontrol_new a2dp_slim7_switch_mixer_controls = 0, 1, 0, msm_routing_a2dp_switch_mixer_get, msm_routing_a2dp_switch_mixer_put); -static const struct snd_kcontrol_new adsp_ssr_trigger_controls = - SOC_SINGLE_EXT("Switch", SND_SOC_NOPM, - 0, 1, 0, adsp_ssr_trigger_status_get, - adsp_ssr_trigger_status_put); - static const struct soc_enum lsm_port_enum = SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(lsm_port_text), lsm_port_text); @@ -19188,9 +19140,6 @@ static const struct snd_soc_dapm_widget msm_qdsp6_widgets[] = { SND_SOC_DAPM_SWITCH("RX_CDC_DMA_RX_0_DL_HL", SND_SOC_NOPM, 0, 0, &cdc_dma_rx_switch_mixer_controls), - SND_SOC_DAPM_SWITCH("ADSP_SSR_TRIGGER", SND_SOC_NOPM, 0, 0, - &adsp_ssr_trigger_controls), - /* Mixer definitions */ SND_SOC_DAPM_MIXER("PRI_RX Audio Mixer", SND_SOC_NOPM, 0, 0, pri_i2s_rx_mixer_controls, ARRAY_SIZE(pri_i2s_rx_mixer_controls)), @@ -20209,7 +20158,6 @@ static const struct snd_soc_dapm_route intercon[] = { {"SLIMBUS_7_RX Audio Mixer", "MultiMedia15", "MM_DL15"}, {"SLIMBUS_7_RX Audio Mixer", "MultiMedia16", "MM_DL16"}, {"SLIMBUS_7_RX Audio Mixer", "MultiMedia26", "MM_DL26"}, - {"SLIMBUS_7_RX Audio Mixer", "MultiMedia30", "MM_DL30"}, {"SLIMBUS_7_RX", NULL, "SLIMBUS_7_RX Audio Mixer"}, {"SLIMBUS_9_RX Audio Mixer", "MultiMedia1", "MM_DL1"}, @@ -20248,7 +20196,6 @@ static const struct snd_soc_dapm_route intercon[] = { {"USB_AUDIO_RX Audio Mixer", "MultiMedia15", "MM_DL15"}, {"USB_AUDIO_RX Audio Mixer", "MultiMedia16", "MM_DL16"}, {"USB_AUDIO_RX Audio Mixer", "MultiMedia26", "MM_DL26"}, - {"USB_AUDIO_RX Audio Mixer", "MultiMedia30", "MM_DL30"}, {"USB_AUDIO_RX", NULL, "USB_AUDIO_RX Audio Mixer"}, {"MultiMedia1 Mixer", "VOC_REC_UL", "INCALL_RECORD_TX"}, @@ -22305,7 +22252,6 @@ static const struct snd_soc_dapm_route intercon[] = { {"TERT_TDM_TX_2_UL_HL", NULL, "TERT_TDM_TX_2"}, {"TERT_TDM_TX_3_UL_HL", NULL, "TERT_TDM_TX_3"}, {"TERT_TDM_TX_7_UL_HL", NULL, "TERT_TDM_TX_7"}, - {"ADSP_SSR_TRIGGER", "Switch", "TERT_TDM_RX_0_DL_HL"}, {"TERT_TDM_RX_0", NULL, "TERT_TDM_RX_0_DL_HL"}, {"TERT_TDM_RX_1", NULL, "TERT_TDM_RX_1_DL_HL"}, {"TERT_TDM_RX_2", NULL, "TERT_TDM_RX_2_DL_HL"}, @@ -22526,7 +22472,6 @@ static const struct snd_soc_dapm_route intercon[] = { {"TERT_TDM_RX_0 Port Mixer", "QUIN_TDM_TX_1", "QUIN_TDM_TX_1"}, {"TERT_TDM_RX_0 Port Mixer", "QUIN_TDM_TX_2", "QUIN_TDM_TX_2"}, {"TERT_TDM_RX_0 Port Mixer", "QUIN_TDM_TX_3", "QUIN_TDM_TX_3"}, - {"TERT_TDM_RX_0 Port Mixer", "SLIM_7_TX", "SLIMBUS_7_TX"}, {"TERT_TDM_RX_0", NULL, "TERT_TDM_RX_0 Port Mixer"}, {"TERT_TDM_RX_1 Port Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"}, @@ -23977,7 +23922,7 @@ static const struct snd_pcm_ops msm_routing_pcm_ops = { }; #ifdef CONFIG_MSM_CSPL - //extern void msm_crus_pb_add_controls(struct snd_soc_platform *platform); + extern void msm_crus_pb_add_controls(struct snd_soc_platform *platform); #endif /* Not used but frame seems to require it */ @@ -24044,7 +23989,7 @@ static int msm_routing_probe(struct snd_soc_platform *platform) ARRAY_SIZE(msm_routing_be_dai_name_table_mixer_controls)); #ifdef CONFIG_MSM_CSPL - //msm_crus_pb_add_controls(platform); + msm_crus_pb_add_controls(platform); #endif snd_soc_add_platform_controls(platform, msm_source_tracking_controls, @@ -24059,18 +24004,15 @@ static int msm_routing_probe(struct snd_soc_platform *platform) snd_soc_add_platform_controls( platform, msm_routing_feature_support_mixer_controls, ARRAY_SIZE(msm_routing_feature_support_mixer_controls)); -#ifdef CONFIG_ELLIPTIC_ULTRASOUND - elliptic_add_platform_controls(platform); -#endif snd_soc_add_platform_controls(platform, port_multi_channel_map_mixer_controls, ARRAY_SIZE(port_multi_channel_map_mixer_controls)); - /* for mius start */ +#ifdef CONFIG_ELLIPTIC_ULTRASOUND + elliptic_add_platform_controls(platform); +#endif #ifdef CONFIG_US_PROXIMITY mius_add_platform_controls(platform); #endif - /* for mius end */ - return 0; } diff --git a/techpack/audio/asoc/sdm660-external.c b/techpack/audio/asoc/sdm660-external.c index 9c08779cd1db..af54bcb8ac18 100644 --- a/techpack/audio/asoc/sdm660-external.c +++ b/techpack/audio/asoc/sdm660-external.c @@ -1933,8 +1933,8 @@ err: EXPORT_SYMBOL(msm_ext_cdc_init); /** -* msm_ext_cdc_deinit - external codec machine specific deinit. -*/ + * msm_ext_cdc_deinit - external codec machine specific deinit. + */ void msm_ext_cdc_deinit(struct msm_asoc_mach_data *pdata) { if (pdata->msm_snd_intr_lpi.mpm_wakeup) diff --git a/techpack/audio/asoc/sm8150.c b/techpack/audio/asoc/sm8150.c index 8ef373658156..c3d7e4723166 100644 --- a/techpack/audio/asoc/sm8150.c +++ b/techpack/audio/asoc/sm8150.c @@ -1,5 +1,4 @@ /* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 @@ -73,10 +72,6 @@ #define WCN_CDC_SLIM_RX_CH_MAX 2 #define WCN_CDC_SLIM_TX_CH_MAX 3 -//#undef CONFIG_SND_SOC_TAS2557 -//#undef CONFIG_SND_SOC_CS35L41 -//#undef CONFIG_SND_SOC_TFA9874 - #define CS35L41_CODEC_NAME "cs35l41.0-0040" #if 0 static atomic_t cs35l41_mclk_rsc_ref; @@ -3444,8 +3439,6 @@ static SOC_ENUM_SINGLE_VIRT_DECL(external_AMIC2_enum, external_AMIC2_enum_text); static const struct snd_kcontrol_new ext_amc2_mux = SOC_DAPM_ENUM_EXT("External AMIC2 sel", external_AMIC2_enum, snd_soc_dapm_get_enum_double, external_amic2_sel_put); - - static const struct snd_soc_dapm_widget msm_dapm_widgets[] = { SND_SOC_DAPM_SUPPLY("MCLK", SND_SOC_NOPM, 0, 0, @@ -5215,7 +5208,7 @@ static int msm_fe_qos_prepare(struct snd_pcm_substream *substream) cpumask_clear(&mask); cpumask_set_cpu(1, &mask); /* affine to core 1 */ cpumask_set_cpu(2, &mask); /* affine to core 2 */ - atomic_set(&substream->latency_pm_qos_req.cpus_affine, *cpumask_bits(&mask)); + cpumask_copy(&substream->latency_pm_qos_req.cpus_affine, &mask); substream->latency_pm_qos_req.type = PM_QOS_REQ_AFFINE_CORES; @@ -5291,7 +5284,6 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) snd_soc_codec_set_sysclk(rtd->codec_dai->codec, 0, 0, mi2s_clk[index].clk_freq_in_hz, SND_SOC_CLOCK_IN); - clk_off: if (ret < 0) msm_mi2s_set_sclk(substream, false); @@ -7064,21 +7056,23 @@ static struct snd_soc_dai_link msm_mi2s_be_dai_links[] = { .ops = &msm_mi2s_be_ops, .ignore_suspend = 1, }, -// { -// .name = LPASS_BE_QUAT_MI2S_RX, -// .stream_name = "Quaternary MI2S Playback", -// .cpu_dai_name = "msm-dai-q6-mi2s.3", -// .platform_name = "msm-pcm-routing", -// .codec_name = "msm-stub-codec.1", -// .codec_dai_name = "msm-stub-rx", -// .no_pcm = 1, -// .dpcm_playback = 1, -// .id = MSM_BACKEND_DAI_QUATERNARY_MI2S_RX, -// .be_hw_params_fixup = msm_be_hw_params_fixup, -// .ops = &msm_mi2s_be_ops, -// .ignore_suspend = 1, -// .ignore_pmdown_time = 1, -// }, +/* + { + .name = LPASS_BE_QUAT_MI2S_RX, + .stream_name = "Quaternary MI2S Playback", + .cpu_dai_name = "msm-dai-q6-mi2s.3", + .platform_name = "msm-pcm-routing", + .codec_name = "msm-stub-codec.1", + .codec_dai_name = "msm-stub-rx", + .no_pcm = 1, + .dpcm_playback = 1, + .id = MSM_BACKEND_DAI_QUATERNARY_MI2S_RX, + .be_hw_params_fixup = msm_be_hw_params_fixup, + .ops = &msm_mi2s_be_ops, + .ignore_suspend = 1, + .ignore_pmdown_time = 1, + }, +*/ { .name = LPASS_BE_QUAT_MI2S_TX, .stream_name = "Quaternary MI2S Capture", @@ -7143,24 +7137,6 @@ static struct snd_soc_dai_link quat_mi2s_rx_tas2557_dai_links[] = { }, }; -static struct snd_soc_dai_link quat_mi2s_rx_tfa9874_dai_links[] = { - { - .name = LPASS_BE_QUAT_MI2S_RX, - .stream_name = "Quaternary MI2S Playback", - .cpu_dai_name = "msm-dai-q6-mi2s.3", - .platform_name = "msm-pcm-routing", - .codec_name = "tfa98xx.1-0034", - .codec_dai_name = "tfa98xx-aif-1-34", - .no_pcm = 1, - .dpcm_playback = 1, - .id = MSM_BACKEND_DAI_QUATERNARY_MI2S_RX, - .be_hw_params_fixup = msm_be_hw_params_fixup, - .ops = &msm_mi2s_be_ops, - .ignore_suspend = 1, - .ignore_pmdown_time = 1, - }, -}; - static struct snd_soc_dai_link quat_mi2s_rx_cs35l41_dai_links[] = { { .name = LPASS_BE_QUAT_MI2S_RX, @@ -7179,6 +7155,23 @@ static struct snd_soc_dai_link quat_mi2s_rx_cs35l41_dai_links[] = { }, }; +static struct snd_soc_dai_link quat_mi2s_rx_tfa9874_dai_links[] = { + { + .name = LPASS_BE_QUAT_MI2S_RX, + .stream_name = "Quaternary MI2S Playback", + .cpu_dai_name = "msm-dai-q6-mi2s.3", + .platform_name = "msm-pcm-routing", + .codec_name = "tfa98xx.1-0034", + .codec_dai_name = "tfa98xx-aif-1-34", + .no_pcm = 1, + .dpcm_playback = 1, + .id = MSM_BACKEND_DAI_QUATERNARY_MI2S_RX, + .be_hw_params_fixup = msm_be_hw_params_fixup, + .ops = &msm_mi2s_be_ops, + .ignore_suspend = 1, + .ignore_pmdown_time = 1, + }, +}; static struct snd_soc_dai_link msm_auxpcm_be_dai_links[] = { /* Primary AUX PCM Backend DAI Links */ @@ -7343,8 +7336,8 @@ static struct snd_soc_dai_link msm_tavil_dai_links[ ARRAY_SIZE(ext_disp_be_dai_link) + ARRAY_SIZE(msm_mi2s_be_dai_links) + ARRAY_SIZE(quat_mi2s_rx_tas2557_dai_links) + - ARRAY_SIZE(quat_mi2s_rx_tfa9874_dai_links) + ARRAY_SIZE(quat_mi2s_rx_cs35l41_dai_links) + + ARRAY_SIZE(quat_mi2s_rx_tfa9874_dai_links) + ARRAY_SIZE(msm_auxpcm_be_dai_links)]; static int msm_snd_card_tavil_late_probe(struct snd_soc_card *card) @@ -7359,8 +7352,6 @@ static int msm_snd_card_tavil_late_probe(struct snd_soc_card *card) struct snd_soc_dapm_context * cs35l41_dapm; #endif - - printk("<%s><%d>: E.\n", __func__, __LINE__); rtd = snd_soc_get_pcm_runtime(card, be_dl_name); if (!rtd) { dev_err(card->dev, @@ -7407,15 +7398,12 @@ static int msm_snd_card_tavil_late_probe(struct snd_soc_card *card) } } #endif - - printk("<%s><%d>: X.\n", __func__, __LINE__); return 0; err_hs_detect: kfree(mbhc_calibration); err_mbhc_cal: err_pcm_runtime: - printk("<%s><%d>: X, failed.\n", __func__, __LINE__); return ret; } @@ -8110,8 +8098,6 @@ static int msm_asoc_machine_probe(struct platform_device *pdev) const char *mbhc_audio_jack_type = NULL; int ret; - printk("<%s><%d>: E.\n", __func__, __LINE__); - if (!pdev->dev.of_node) { dev_err(&pdev->dev, "No platform supplied from device tree\n"); return -EINVAL; @@ -8168,14 +8154,12 @@ static int msm_asoc_machine_probe(struct platform_device *pdev) ret = msm_populate_dai_link_component_of_node(card); if (ret) { - printk("<%s><%d>: HERE.\n", __func__, __LINE__); ret = -EPROBE_DEFER; goto err; } ret = msm_init_wsa_dev(pdev, card); - if (ret) { + if (ret) goto err; - } ret = devm_snd_soc_register_card(&pdev->dev, card); if (ret == -EPROBE_DEFER) { @@ -8284,13 +8268,10 @@ static int msm_asoc_machine_probe(struct platform_device *pdev) pr_err("%s: Audio notifier register failed ret = %d\n", __func__, ret); - printk("<%s><%d>: X.\n", __func__, __LINE__); - return 0; err: msm_release_pinctrl(pdev); devm_kfree(&pdev->dev, pdata); - printk("<%s><%d>: X, failed.\n", __func__, __LINE__); return ret; } diff --git a/techpack/audio/config/sm8150auto.conf b/techpack/audio/config/sm8150auto.conf index 94200f222873..a26daf0fb511 100644 --- a/techpack/audio/config/sm8150auto.conf +++ b/techpack/audio/config/sm8150auto.conf @@ -38,11 +38,13 @@ CONFIG_DTS_SRS_TM=y CONFIG_SND_SOC_MSM_STUB=y CONFIG_MSM_AVTIMER=y CONFIG_SND_SOC_MSM_HDMI_CODEC_RX=y -# CONFIG_VOICE_MHI is not set -CONFIG_SND_SOC_TFA9874=y -# CONFIG_SND_SOC_TAS2557 is not set -# CONFIG_TAS2557_REGMAP is not set -# CONFIG_TAS2557_CODEC is not set -# CONFIG_TAS2557_MISC is not set -# CONFIG_SND_SOC_CS35L41 is not set +CONFIG_VOICE_MHI=y +CONFIG_SND_SOC_CS35L41=y +CONFIG_SND_SOC_CS35L41_FOR_CEPH=y +CONFIG_SND_SOC_TAS2557=y +CONFIG_TAS2557_REGMAP=y +CONFIG_TAS2557_CODEC=y +CONFIG_TAS2557_MISC=y CONFIG_MSM_CSPL=y +CONFIG_SND_SOC_TFA9874=y +CONFIG_SND_SOC_TFA9874_FOR_DAVI=y diff --git a/techpack/audio/config/sm8150autoconf.h b/techpack/audio/config/sm8150autoconf.h index 65dccbeb2ae1..30a6cdcf3ffe 100644 --- a/techpack/audio/config/sm8150autoconf.h +++ b/techpack/audio/config/sm8150autoconf.h @@ -1,5 +1,4 @@ /* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * * 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 @@ -51,11 +50,13 @@ #define CONFIG_SND_SOC_MSM_STUB 1 #define CONFIG_MSM_AVTIMER 1 #define CONFIG_SND_SOC_MSM_HDMI_CODEC_RX 1 -#define CONFIG_VOICE_MHI 0 -#define CONFIG_SND_SOC_TFA9874 1 +#define CONFIG_VOICE_MHI 1 +#define CONFIG_SND_SOC_CS35L41 1 #define CONFIG_SND_SOC_TAS2557 1 #define CONFIG_TAS2557_REGMAP 1 #define CONFIG_TAS2557_CODEC 1 #define CONFIG_TAS2557_MISC 1 -#define CONFIG_SND_SOC_CS35L41 1 +#define CONFIG_ELLIPTIC_ULTRASOUND 1 #define CONFIG_MSM_CSPL 1 +#define CONFIG_SND_SOC_TFA9874 1 +#define CONFIG_SND_SOC_TFA9874_FOR_DAVI 1 diff --git a/techpack/audio/dsp/Android.mk b/techpack/audio/dsp/Android.mk deleted file mode 100644 index 54a355aab636..000000000000 --- a/techpack/audio/dsp/Android.mk +++ /dev/null @@ -1,98 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,sdm845),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM845=m -endif - -ifeq ($(call is-board-platform,sdm660),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m -endif - -ifeq ($(call is-board-platform-in-list,msm8953 sdm670 qcs605),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM670=m -endif - -ifeq ($(call is-board-platform,msmnile),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m -endif - -ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) atoll $(TRINKET)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msm8953 sdm845 sdm670 sdm660 qcs605 msmnile atoll $(MSMSTEPPE) $(TRINKET)),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=q6_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_q6.ko -LOCAL_MODULE_KBUILD_NAME := q6_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_usf.ko -LOCAL_MODULE_KBUILD_NAME := usf_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_adsp_loader.ko -LOCAL_MODULE_KBUILD_NAME := adsp_loader_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_q6_notifier.ko -LOCAL_MODULE_KBUILD_NAME := q6_notifier_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_q6_pdr.ko -LOCAL_MODULE_KBUILD_NAME := q6_pdr_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/dsp/Kbuild b/techpack/audio/dsp/Kbuild index 93af1b486a70..75c58f80abbd 100644 --- a/techpack/audio/dsp/Kbuild +++ b/techpack/audio/dsp/Kbuild @@ -107,7 +107,6 @@ ifdef CONFIG_SND_SOC_MSM_QDSP6V2_INTF Q6_OBJS += msm_audio_ion.o Q6_OBJS += avtimer.o Q6_OBJS += q6_init.o - ifdef CONFIG_ELLIPTIC_ULTRASOUND Q6_OBJS += apr_elliptic.o Q6_OBJS += elliptic/elliptic.o @@ -117,8 +116,6 @@ ifdef CONFIG_ELLIPTIC_ULTRASOUND Q6_OBJS += elliptic/io_modules/userspace/elliptic_data_userspace_io.o Q6_OBJS += elliptic/io_modules/userspace/elliptic_data_userspace_ctrl.o endif - -# for mius start ifdef CONFIG_US_PROXIMITY Q6_OBJS += apr_mius.o Q6_OBJS += mius/mius.o @@ -128,7 +125,6 @@ ifdef CONFIG_US_PROXIMITY Q6_OBJS += mius/io_modules/userspace/mius_data_userspace_io.o Q6_OBJS += mius/io_modules/userspace/mius_data_userspace_ctrl.o endif -# for mius end endif ifdef CONFIG_XT_LOGGING @@ -186,8 +182,11 @@ CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ -DANI_OS_TYPE_ANDROID=6 \ -DPTT_SOCK_SVC_ENABLE \ -Wall\ - -D__linux__ \ - -DCONFIG_SND_SOC_TFA9874_FOR_DAVI + -D__linux__ + +ifdef CONFIG_SND_SOC_TFA9874_FOR_DAVI + CDEFINES += -DCONFIG_SND_SOC_TFA9874_FOR_DAVI +endif KBUILD_CPPFLAGS += $(CDEFINES) diff --git a/techpack/audio/dsp/codecs/Android.mk b/techpack/audio/dsp/codecs/Android.mk deleted file mode 100644 index 5adda956426f..000000000000 --- a/techpack/audio/dsp/codecs/Android.mk +++ /dev/null @@ -1,66 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,sdm845),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM845=m -endif - -ifeq ($(call is-board-platform,sdm660),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m -endif - -ifeq ($(call is-board-platform-in-list,msm8953 sdm670 qcs605),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM670=m -endif - -ifeq ($(call is-board-platform,msmnile),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m -endif - -ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) atoll $(TRINKET)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msm8953 sdm845 sdm670 sdm660 qcs605 msmnile $(MSMSTEPPE) atoll $(TRINKET)),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=native_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_native.ko -LOCAL_MODULE_KBUILD_NAME := native_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/dsp/elliptic/elliptic.c b/techpack/audio/dsp/elliptic/elliptic.c index 8cb5f9d219c5..2466d6185315 100755 --- a/techpack/audio/dsp/elliptic/elliptic.c +++ b/techpack/audio/dsp/elliptic/elliptic.c @@ -1,8 +1,8 @@ /** * Copyright Elliptic Labs -* Copyright (C) 2019 XiaoMi, Inc. * */ +/* #define DEBUG */ #include #include #include @@ -726,7 +726,7 @@ int __init elliptic_driver_init(void) goto fail; elliptic_devices = (struct elliptic_device *) - kcalloc(ELLIPTIC_NUM_DEVICES, sizeof(struct elliptic_device), + kzalloc(sizeof(struct elliptic_device) * ELLIPTIC_NUM_DEVICES, GFP_KERNEL); if (elliptic_devices == NULL) { diff --git a/techpack/audio/dsp/elliptic/elliptic_sysfs.c b/techpack/audio/dsp/elliptic/elliptic_sysfs.c index a0cd78dc43ee..882bda0c4b85 100755 --- a/techpack/audio/dsp/elliptic/elliptic_sysfs.c +++ b/techpack/audio/dsp/elliptic/elliptic_sysfs.c @@ -503,7 +503,7 @@ static ssize_t cache_show(char *buf, int pretty) static ssize_t opmode_show(struct device *dev, struct device_attribute *attr, char *buf) { - int length = 0; + int length; ssize_t result; struct elliptic_system_configuration_parameters_cache *cache = @@ -518,7 +518,7 @@ static ssize_t opmode_show(struct device *dev, static ssize_t opmode_flags_show(struct device *dev, struct device_attribute *attr, char *buf) { - int length = 0; + int length; ssize_t result; struct elliptic_system_configuration_parameters_cache *cache = &elliptic_system_configuration_cache; @@ -531,7 +531,7 @@ static ssize_t opmode_flags_show(struct device *dev, static ssize_t driver_version_show(char *buf) { - int length = 0; + int length; length = snprintf(buf, PAGE_SIZE, "Driver version: %s-%s (%s)\n", build_name, build_number, build_source_version); diff --git a/techpack/audio/dsp/elliptic/io_modules/msm/elliptic_data_msm_io.c b/techpack/audio/dsp/elliptic/io_modules/msm/elliptic_data_msm_io.c index 3f77f968f0e1..f5443903e88e 100755 --- a/techpack/audio/dsp/elliptic/io_modules/msm/elliptic_data_msm_io.c +++ b/techpack/audio/dsp/elliptic/io_modules/msm/elliptic_data_msm_io.c @@ -1,6 +1,5 @@ /** * Copyright Elliptic Labs - * Copyright (C) 2019 XiaoMi, Inc. * */ diff --git a/techpack/audio/dsp/elliptic/io_modules/userspace/elliptic_data_userspace_ctrl.c b/techpack/audio/dsp/elliptic/io_modules/userspace/elliptic_data_userspace_ctrl.c index 76d332504757..93abf6e4c304 100644 --- a/techpack/audio/dsp/elliptic/io_modules/userspace/elliptic_data_userspace_ctrl.c +++ b/techpack/audio/dsp/elliptic/io_modules/userspace/elliptic_data_userspace_ctrl.c @@ -1,6 +1,5 @@ /** * Copyright Elliptic Labs - * Copyright (C) 2019 XiaoMi, Inc. * */ diff --git a/techpack/audio/dsp/elliptic/io_modules/userspace/elliptic_data_userspace_io.c b/techpack/audio/dsp/elliptic/io_modules/userspace/elliptic_data_userspace_io.c index 7897e6df0d1a..7f207d98a644 100644 --- a/techpack/audio/dsp/elliptic/io_modules/userspace/elliptic_data_userspace_io.c +++ b/techpack/audio/dsp/elliptic/io_modules/userspace/elliptic_data_userspace_io.c @@ -1,6 +1,5 @@ /** * Copyright Elliptic Labs - * Copyright (C) 2019 XiaoMi, Inc. * */ diff --git a/techpack/audio/dsp/elliptic/io_modules/userspace_test/elliptic_data_io.c b/techpack/audio/dsp/elliptic/io_modules/userspace_test/elliptic_data_io.c index 378acd2b01b7..0af53f06b433 100755 --- a/techpack/audio/dsp/elliptic/io_modules/userspace_test/elliptic_data_io.c +++ b/techpack/audio/dsp/elliptic/io_modules/userspace_test/elliptic_data_io.c @@ -1,6 +1,5 @@ /** * Copyright Elliptic Labs - * Copyright (C) 2019 XiaoMi, Inc. * */ diff --git a/techpack/audio/dsp/mius/Makefile b/techpack/audio/dsp/mius/Makefile index 1a0cd5f4608b..70f42362235b 100644 --- a/techpack/audio/dsp/mius/Makefile +++ b/techpack/audio/dsp/mius/Makefile @@ -5,8 +5,8 @@ IO_MODULE := msm # Need to add include paths: LINUXINCLUDE += \ - -I$(srctree)techpack/audio/include/dsp - -I$(srctree)techpack/audio/include/uapi + -I$(srctree)techpack/audio/include/dsp \ + -I$(srctree)techpack/audio/include/uapi \ -I$(srctree)techpack/aduio/include obj-y += mius.o diff --git a/techpack/audio/dsp/mius/io_modules/msm/mius_data_msm_io.c b/techpack/audio/dsp/mius/io_modules/msm/mius_data_msm_io.c index 0cf8f594ba27..374af6cca12d 100644 --- a/techpack/audio/dsp/mius/io_modules/msm/mius_data_msm_io.c +++ b/techpack/audio/dsp/mius/io_modules/msm/mius_data_msm_io.c @@ -1,6 +1,5 @@ /** * Copyright MI - * Copyright (C) 2019 XiaoMi, Inc. * */ diff --git a/techpack/audio/dsp/mius/io_modules/userspace/mius_data_userspace_ctrl.c b/techpack/audio/dsp/mius/io_modules/userspace/mius_data_userspace_ctrl.c index 09142a091015..703d22e1052a 100644 --- a/techpack/audio/dsp/mius/io_modules/userspace/mius_data_userspace_ctrl.c +++ b/techpack/audio/dsp/mius/io_modules/userspace/mius_data_userspace_ctrl.c @@ -1,6 +1,5 @@ /** * Copyright MI - * Copyright (C) 2019 XiaoMi, Inc. * */ diff --git a/techpack/audio/dsp/mius/io_modules/userspace/mius_data_userspace_io.c b/techpack/audio/dsp/mius/io_modules/userspace/mius_data_userspace_io.c index db03418b9539..540b3c21853b 100644 --- a/techpack/audio/dsp/mius/io_modules/userspace/mius_data_userspace_io.c +++ b/techpack/audio/dsp/mius/io_modules/userspace/mius_data_userspace_io.c @@ -1,6 +1,5 @@ /** * Copyright MI - * Copyright (C) 2019 XiaoMi, Inc. * */ diff --git a/techpack/audio/dsp/mius/io_modules/userspace_test/mius_data_io.c b/techpack/audio/dsp/mius/io_modules/userspace_test/mius_data_io.c index 2d4e16242cf6..b2c91254e743 100644 --- a/techpack/audio/dsp/mius/io_modules/userspace_test/mius_data_io.c +++ b/techpack/audio/dsp/mius/io_modules/userspace_test/mius_data_io.c @@ -1,6 +1,5 @@ /** * Copyright MI - * Copyright (C) 2019 XiaoMi, Inc. * */ diff --git a/techpack/audio/dsp/mius/mius.c b/techpack/audio/dsp/mius/mius.c index 668be0216096..e3efe8915572 100644 --- a/techpack/audio/dsp/mius/mius.c +++ b/techpack/audio/dsp/mius/mius.c @@ -1,6 +1,5 @@ /** * Copyright MI -* Copyright (C) 2019 XiaoMi, Inc. * */ /* #define DEBUG */ diff --git a/techpack/audio/dsp/msm-cirrus-playback.c b/techpack/audio/dsp/msm-cirrus-playback.c index d074740c823e..251bce5d9d51 100755 --- a/techpack/audio/dsp/msm-cirrus-playback.c +++ b/techpack/audio/dsp/msm-cirrus-playback.c @@ -1,5 +1,4 @@ /* Copyright (c) 2015, The Linux Foundation. All rights reserved. - * Copyright (C) 2019 XiaoMi, Inc. * 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. @@ -188,7 +187,7 @@ static int crus_afe_get_param(int port, int module, int param, int length, int index = afe_get_port_index(port); int ret = 0, count = 0; - pr_debug("CRUS_SP: (get_param) module = 0x%08x, port = 0x%08x, param = 0x%08x\n", + pr_info("CRUS_SP: (get_param) module = 0x%08x, port = 0x%08x, param = 0x%08x\n", module, port, param); config = (struct afe_custom_crus_get_config_v2_t *) @@ -1114,8 +1113,8 @@ void msm_crus_pb_add_controls(struct snd_soc_platform *platform) } EXPORT_SYMBOL(msm_crus_pb_add_controls); - -int crus_afe_port_start(u16 port_id) { +int crus_afe_port_start(u16 port_id) +{ pr_info("%s: 0x%x\n", __func__, port_id); //CSPL do not be involved in AFE @@ -1141,7 +1140,7 @@ int crus_afe_port_start(u16 port_id) { EXPORT_SYMBOL(crus_afe_port_start); int crus_afe_port_close(u16 port_id) { - pr_debug("%s: 0x%x\n", __func__, port_id); + pr_info("%s: 0x%x\n", __func__, port_id); //CSPL do not be involved in AFE #if 0 @@ -1161,7 +1160,7 @@ static long crus_sp_shared_ioctl(struct file *f, unsigned int cmd, uint32_t bufsize = 0, size; void *io_data = NULL; - pr_debug("%s\n", __func__); + pr_info("%s\n", __func__); if (copy_from_user(&size, arg, sizeof(size))) { pr_err("CRUS_SP: copy_from_user (size) failed\n"); @@ -1223,7 +1222,7 @@ static long crus_sp_shared_ioctl(struct file *f, unsigned int cmd, port = this_ctrl.ff_port; break; default: - pr_debug("%s: Unrecognized port ID (%d)\n", __func__, + pr_info("%s: Unrecognized port ID (%d)\n", __func__, crus_sp_hdr.module_id); port = this_ctrl.ff_port; } @@ -1252,7 +1251,7 @@ exit: static long crus_sp_ioctl(struct file *f, unsigned int cmd, unsigned long arg) { - pr_debug("%s\n", __func__); + pr_info("%s\n", __func__); return crus_sp_shared_ioctl(f, cmd, (void __user *)arg); } @@ -1262,7 +1261,7 @@ static long crus_sp_compat_ioctl(struct file *f, { unsigned int cmd64; - pr_debug("%s\n", __func__); + pr_info("%s\n", __func__); switch (cmd) { case CRUS_SP_IOCTL_GET32: diff --git a/techpack/audio/dsp/q6_init.c b/techpack/audio/dsp/q6_init.c index 8a75b5fa26c3..52c62a921aff 100644 --- a/techpack/audio/dsp/q6_init.c +++ b/techpack/audio/dsp/q6_init.c @@ -1,6 +1,5 @@ /* Copyright (c) 2017, 2019 The Linux Foundation. All rights reserved. -Copyright (C) 2019 XiaoMi, Inc. 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 @@ -36,27 +35,23 @@ static int __init audio_q6_init(void) crus_sp_init(); #endif msm_mdf_init(); -#if CONFIG_VOICE_MHI voice_mhi_init(); -#endif #ifdef CONFIG_ELLIPTIC_ULTRASOUND elliptic_driver_init(); #endif -/* for mius start */ #ifdef CONFIG_US_PROXIMITY mius_driver_init(); #endif -/* for mius end */ return 0; } static void __exit audio_q6_exit(void) { msm_mdf_exit(); + avtimer_exit(); #ifdef CONFIG_MSM_CSPL crus_sp_exit(); #endif - avtimer_exit(); audio_slimslave_exit(); msm_audio_ion_exit(); core_exit(); @@ -69,17 +64,13 @@ static void __exit audio_q6_exit(void) rtac_exit(); audio_cal_exit(); adsp_err_exit(); -#if CONFIG_VOICE_MHI voice_mhi_exit(); -#endif #ifdef CONFIG_ELLIPTIC_ULTRASOUND elliptic_driver_exit(); #endif -/* for mius start */ #ifdef CONFIG_US_PROXIMITY mius_driver_exit(); #endif -/* for mius end */ } module_init(audio_q6_init); diff --git a/techpack/audio/dsp/q6_init.h b/techpack/audio/dsp/q6_init.h index cc69237c0c73..e2af48054f05 100644 --- a/techpack/audio/dsp/q6_init.h +++ b/techpack/audio/dsp/q6_init.h @@ -1,6 +1,5 @@ /* Copyright (c) 2017, 2019 The Linux Foundation. All rights reserved. -Copyright (C) 2019 XiaoMi, Inc. 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 @@ -27,11 +26,9 @@ int rtac_init(void); int msm_audio_ion_init(void); int audio_slimslave_init(void); int avtimer_init(void); - #ifdef CONFIG_MSM_CSPL int crus_sp_init(void); #endif - #ifdef CONFIG_MSM_MDF int msm_mdf_init(void); void msm_mdf_exit(void); @@ -39,11 +36,9 @@ void msm_mdf_exit(void); #ifdef CONFIG_ELLIPTIC_ULTRASOUND int elliptic_driver_init(void); #endif -/* for mius start */ #ifdef CONFIG_US_PROXIMITY int mius_driver_init(void); #endif -/* for mius end */ static inline int msm_mdf_init(void) { return 0; @@ -67,11 +62,10 @@ static inline void spk_params_exit(void) } #endif +void avtimer_exit(void); #ifdef CONFIG_MSM_CSPL void crus_sp_exit(void); #endif - -void avtimer_exit(void); void audio_slimslave_exit(void); void msm_audio_ion_exit(void); void rtac_exit(void); @@ -86,11 +80,9 @@ void adsp_err_exit(void); #ifdef CONFIG_ELLIPTIC_ULTRASOUND int elliptic_driver_exit(void); #endif -/* for mius start */ #ifdef CONFIG_US_PROXIMITY int mius_driver_exit(void); #endif -/* for mius end */ #ifdef CONFIG_VOICE_MHI int voice_mhi_init(void); diff --git a/techpack/audio/dsp/q6adm.c b/techpack/audio/dsp/q6adm.c index 9db17e37dba8..a7896a093c79 100644 --- a/techpack/audio/dsp/q6adm.c +++ b/techpack/audio/dsp/q6adm.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -100,7 +99,6 @@ struct adm_ctl { struct param_outband outband_memmap; struct source_tracking_data sourceTrackingData; - struct mutex adm_apr_lock; int set_custom_topology; int ec_ref_rx; int num_ec_ref_rx_chans; @@ -901,47 +899,6 @@ exit: } EXPORT_SYMBOL(adm_set_custom_chmix_cfg); -/* - * adm_apr_send_pkt : returns 0 on success, negative otherwise. - */ -int adm_apr_send_pkt(void *data, int port_idx, int copp_idx) -{ - int ret = 0; - atomic_t *copp_stat = NULL; - wait_queue_head_t *wait = NULL; - - mutex_lock(&this_adm.adm_apr_lock); - - wait = &this_adm.copp.wait[port_idx][copp_idx]; - copp_stat = &this_adm.copp.stat[port_idx][copp_idx]; - atomic_set(copp_stat, -1); - - ret = apr_send_pkt(this_adm.apr, data); - if (ret > 0) { - ret = wait_event_timeout(*wait, - atomic_read(copp_stat) >= 0, - msecs_to_jiffies(TIMEOUT_MS)); - if (atomic_read(copp_stat) > 0) { - pr_err("%s: DSP returned error[%s]\n", __func__, - adsp_err_get_err_str(atomic_read(copp_stat))); - ret = adsp_err_get_lnx_err_code(atomic_read(copp_stat)); - } else if (!ret) { - pr_err_ratelimited("%s: request timedout\n", - __func__); - ret = -ETIMEDOUT; - } else { - ret = 0; - } - } else if (ret == 0) { - pr_err("%s: packet not transmitted\n", __func__); - /* apr_send_pkt can return 0 when nothing is transmitted */ - ret = -EINVAL; - } - - mutex_unlock(&this_adm.adm_apr_lock); - return ret; -} - /* * With pre-packed data, only the opcode differes from V5 and V6. * Use q6common_pack_pp_params to pack the data correctly. @@ -953,6 +910,7 @@ int adm_set_pp_params(int port_id, int copp_idx, struct adm_cmd_set_pp_params *adm_set_params = NULL; int size = 0; int port_idx = 0; + atomic_t *copp_stat = NULL; int ret = 0; port_id = afe_convert_virtual_to_portid(port_id); @@ -965,12 +923,6 @@ int adm_set_pp_params(int port_id, int copp_idx, return -EINVAL; } - if (atomic_read(&this_adm.copp.cnt[port_idx][copp_idx]) == 0) { - pr_err("%s:: port[0x%x] coppid[0x%x] is not active, ERROR\n", - __func__, port_id, copp_idx); - return -EINVAL; - } - /* Only add params_size in inband case */ size = sizeof(struct adm_cmd_set_pp_params); if (param_data != NULL) @@ -1017,8 +969,31 @@ int adm_set_pp_params(int port_id, int copp_idx, goto done; } - ret = adm_apr_send_pkt((uint32_t *) adm_set_params, - port_idx, copp_idx); + copp_stat = &this_adm.copp.stat[port_idx][copp_idx]; + atomic_set(copp_stat, -1); + ret = apr_send_pkt(this_adm.apr, (uint32_t *) adm_set_params); + if (ret < 0) { + pr_err("%s: Set params APR send failed port = 0x%x ret %d\n", + __func__, port_id, ret); + goto done; + } + ret = wait_event_timeout(this_adm.copp.wait[port_idx][copp_idx], + atomic_read(copp_stat) >= 0, + msecs_to_jiffies(TIMEOUT_MS)); + if (!ret) { + pr_err("%s: Set params timed out port = 0x%x\n", __func__, + port_id); + ret = -ETIMEDOUT; + goto done; + } + if (atomic_read(copp_stat) > 0) { + pr_err("%s: DSP returned error[%s]\n", __func__, + adsp_err_get_err_str(atomic_read(copp_stat))); + ret = adsp_err_get_lnx_err_code(atomic_read(copp_stat)); + goto done; + } + + ret = 0; done: kfree(adm_set_params); return ret; @@ -1653,16 +1628,9 @@ static int32_t adm_callback(struct apr_client_data *data, void *priv) if (client_id == ADM_CLIENT_ID_SOURCE_TRACKING) this_adm.sourceTrackingData. apr_cmd_status = payload[1]; - else { - rtac_make_adm_callback(payload, - data->payload_size); - } - atomic_set(&this_adm.copp.stat[port_idx] - [copp_idx], payload[1]); - wake_up( - &this_adm.copp.wait[port_idx][copp_idx]); - break; - + else if (rtac_make_adm_callback(payload, + data->payload_size)) + break; /* * if soft volume is called and already * interrupted break out of the sequence here @@ -1805,14 +1773,8 @@ static int32_t adm_callback(struct apr_client_data *data, void *priv) this_adm.sourceTrackingData.apr_cmd_status = payload[0]; else if (rtac_make_adm_callback(payload, - data->payload_size)) { - atomic_set( - &this_adm.copp.stat[port_idx][copp_idx], - payload[0]); - wake_up( - &this_adm.copp.wait[port_idx][copp_idx]); + data->payload_size)) break; - } idx = ADM_GET_PARAMETER_LENGTH * copp_idx; if (payload[0] == 0 && data->payload_size > 0) { @@ -2888,9 +2850,9 @@ int adm_open(int port_id, int path, int rate, int channel_mode, int topology, void *adm_params = NULL; int param_size; - pr_err("%s:port %#x path:%d rate:%d mode:%d perf_mode:%d,topo_id 0x%x bit_width %d app_type %d acdb_id %d\n", - __func__, port_id, path, rate, channel_mode, perf_mode, - topology, bit_width, app_type, acdb_id); + pr_debug("%s:port %#x path:%d rate:%d mode:%d perf_mode:%d,topo_id %d\n", + __func__, port_id, path, rate, channel_mode, perf_mode, + topology); port_id = q6audio_convert_virtual_to_portid(port_id); port_idx = adm_validate_and_get_port_index(port_id); @@ -5169,7 +5131,6 @@ int __init adm_init(void) this_adm.ffecns_port_id = -1; init_waitqueue_head(&this_adm.matrix_map_wait); init_waitqueue_head(&this_adm.adm_wait); - mutex_init(&this_adm.adm_apr_lock); for (i = 0; i < AFE_MAX_PORTS; i++) { for (j = 0; j < MAX_COPPS_PER_PORT; j++) { @@ -5194,7 +5155,6 @@ int __init adm_init(void) void adm_exit(void) { - mutex_destroy(&this_adm.adm_apr_lock); if (this_adm.apr) adm_reset_data(); adm_delete_cal_data(); diff --git a/techpack/audio/dsp/q6afe.c b/techpack/audio/dsp/q6afe.c index 6c7dec64fdba..885df4662f06 100644 --- a/techpack/audio/dsp/q6afe.c +++ b/techpack/audio/dsp/q6afe.c @@ -29,11 +29,9 @@ #ifdef CONFIG_ELLIPTIC_ULTRASOUND #include #endif -/* for mius start */ #ifdef CONFIG_US_PROXIMITY #include #endif -/* for mius end */ #include #include "adsp_err.h" #include "q6afecal-hwdep.h" @@ -333,11 +331,6 @@ static void av_dev_drift_afe_cb_handler(uint32_t opcode, uint32_t *payload, switch (opcode) { case AFE_PORT_CMDRSP_GET_PARAM_V2: expected_size += sizeof(struct param_hdr_v1); - if (payload_size < expected_size) { - pr_err("%s: Error: received size %d, expected size %zu\n", - __func__, payload_size, expected_size); - return; - } /* Repack response to add IID */ this_afe.av_dev_drift_resp.status = payload[0]; this_afe.av_dev_drift_resp.pdata.module_id = payload[1]; @@ -349,11 +342,6 @@ static void av_dev_drift_afe_cb_handler(uint32_t opcode, uint32_t *payload, break; case AFE_PORT_CMDRSP_GET_PARAM_V3: expected_size += sizeof(struct param_hdr_v3); - if (payload_size < expected_size) { - pr_err("%s: Error: received size %d, expected size %zu\n", - __func__, payload_size, expected_size); - return; - } memcpy(&this_afe.av_dev_drift_resp, payload, sizeof(this_afe.av_dev_drift_resp)); break; @@ -582,10 +570,11 @@ static int32_t afe_callback(struct apr_client_data *data, void *priv) uint32_t *payload = data->payload; uint32_t param_id; -#if CONFIG_MSM_CSPL +#ifdef CONFIG_MSM_CSPL if (crus_afe_callback(data->payload, data->payload_size) == 0) return 0; #endif + if (!payload || (data->token >= AFE_MAX_PORTS)) { pr_err("%s: Error: size %d payload %pK token %d\n", __func__, data->payload_size, @@ -650,7 +639,6 @@ static int32_t afe_callback(struct apr_client_data *data, void *priv) else pr_err("[EXPORT_SYMBOLLUS]: payload ptr is Invalid"); #endif - /* for mius start */ #ifdef CONFIG_US_PROXIMITY } else if (data->opcode == MI_ULTRASOUND_OPCODE) { if (NULL != data->payload) @@ -661,7 +649,6 @@ static int32_t afe_callback(struct apr_client_data *data, void *priv) else pr_err("[EXPORT_SYMBOLLUS]: payload ptr is Invalid"); #endif - /* for mius end */ } else if (data->payload_size) { uint32_t *payload; uint16_t port_id = 0; @@ -1823,7 +1810,6 @@ afe_ultrasound_state_t elus_afe = { EXPORT_SYMBOL(elus_afe); #endif -/* for mius start */ #ifdef CONFIG_US_PROXIMITY afe_mi_ultrasound_state_t mius_afe = { .ptr_apr= &this_afe.apr, @@ -1834,7 +1820,6 @@ afe_mi_ultrasound_state_t mius_afe = { }; EXPORT_SYMBOL(mius_afe); #endif -/* for mius end */ static void afe_send_cal_spkr_prot_tx(int port_id) { @@ -3350,8 +3335,6 @@ int afe_tdm_port_start(u16 port_id, struct afe_tdm_port_config *tdm_port, uint16_t port_index = 0; enum afe_mad_type mad_type = MAD_HW_NONE; int ret = 0; - struct cal_block_data *cal_block = NULL; - struct audio_cal_info_afe_top *afe_top; if (!tdm_port) { pr_err("%s: Error, no configuration data\n", __func__); @@ -3401,18 +3384,6 @@ int afe_tdm_port_start(u16 port_id, struct afe_tdm_port_config *tdm_port, } } - /* Obtain the calibration block for debug log - * Note that afe_find_cal_topo_id_by_port needs to be called before - * afe_send_cal because afe_find_cal_topo_id_by_port only finds blocks - * that have not been used and afe_send_cal marks the cal_block as used - * after executed. - * - * References: - * afe_send_cal --> send_afe_cal_type --> cal_utils_mark_cal_used - */ - cal_block = afe_find_cal_topo_id_by_port( - this_afe.cal_data[AFE_TOPOLOGY_CAL], port_id); - /* Also send the topology id here: */ if (!(this_afe.afe_cal_mode[port_index] == AFE_CAL_MODE_NONE)) { /* One time call: only for first time */ @@ -3482,14 +3453,6 @@ int afe_tdm_port_start(u16 port_id, struct afe_tdm_port_config *tdm_port, } } - if (cal_block != NULL) { - afe_top = (struct audio_cal_info_afe_top *)cal_block->cal_info; - pr_debug("%s: top_id:%x acdb_id:%d port_id:0x%x\n", - __func__, afe_top->topology, afe_top->acdb_id, port_id); - } else { - pr_debug("%s: port_id:0x%x\n", __func__, port_id); - } - ret = afe_send_cmd_port_start(port_id); fail_cmd: @@ -4014,7 +3977,7 @@ static int q6afe_send_enc_config(u16 port_id, if (ret) { pr_err("%s: AFE_ENCODER_PARAM_ID_ENABLE_SCRAMBLING for port 0x%x failed %d\n", __func__, port_id, ret); - //goto exit; + goto exit; } if (format == ASM_MEDIA_FMT_APTX) { @@ -4158,8 +4121,6 @@ static int __afe_port_start(u16 port_id, union afe_port_config *afe_config, int index = 0; enum afe_mad_type mad_type; uint16_t port_index; - struct cal_block_data *cal_block = NULL; - struct audio_cal_info_afe_top *afe_top; memset(¶m_hdr, 0, sizeof(param_hdr)); memset(&port_cfg, 0, sizeof(port_cfg)); @@ -4239,10 +4200,6 @@ static int __afe_port_start(u16 port_id, union afe_port_config *afe_config, } } - /* Obtain the calibration block for debug log */ - cal_block = afe_find_cal_topo_id_by_port( - this_afe.cal_data[AFE_TOPOLOGY_CAL], port_id); - /* Also send the topology id here: */ if (!(this_afe.afe_cal_mode[port_index] == AFE_CAL_MODE_NONE)) { /* One time call: only for first time */ @@ -4505,22 +4462,12 @@ static int __afe_port_start(u16 port_id, union afe_port_config *afe_config, ret = -EINVAL; goto fail_cmd; } - - if (cal_block != NULL) { - afe_top = (struct audio_cal_info_afe_top *)cal_block->cal_info; - pr_debug("%s: top_id:%x acdb_id:%d port_id:0x%x\n", - __func__, afe_top->topology, afe_top->acdb_id, port_id); - } else { - pr_debug("%s: port_id:0x%x\n", __func__, port_id); - } - ret = afe_send_cmd_port_start(port_id); #if CONFIG_MSM_CSPL if (ret == 0) crus_afe_port_start(port_id); #endif - fail_cmd: mutex_unlock(&this_afe.afe_cmd_lock); return ret; @@ -7224,7 +7171,7 @@ int afe_close(int port_id) pr_err("%s: AFE close failed %d\n", __func__, ret); #if CONFIG_MSM_CSPL - crus_afe_port_close(port_id); + crus_afe_port_close(port_id); #endif fail_cmd: @@ -8655,7 +8602,7 @@ static void afe_release_uevent_data(struct kobject *kobj) int send_tfa_cal_apr(void *buf, int cmd_size, bool bRead) { - int32_t result = 0, port_id = AFE_PORT_ID_TFADSP_RX; + int32_t result, port_id = AFE_PORT_ID_TFADSP_RX; uint32_t port_index = 0, payload_size = 0; size_t len; struct rtac_cal_block_data *tfa_cal = &(this_afe.tfa_cal); diff --git a/techpack/audio/dsp/q6asm.c b/techpack/audio/dsp/q6asm.c index 34cf5768745e..f89b01565870 100644 --- a/techpack/audio/dsp/q6asm.c +++ b/techpack/audio/dsp/q6asm.c @@ -311,7 +311,7 @@ static ssize_t audio_output_latency_dbgfs_write(struct file *file, pr_err("%s: err count is more %zd\n", __func__, count); return -EINVAL; } - temp = kmalloc(2, GFP_KERNEL); + temp = kmalloc(2*sizeof(char), GFP_KERNEL); out_cold_index = 0; @@ -367,7 +367,7 @@ static ssize_t audio_input_latency_dbgfs_write(struct file *file, pr_err("%s: err count is more %zd\n", __func__, count); return -EINVAL; } - temp = kmalloc(2, GFP_KERNEL); + temp = kmalloc(2*sizeof(char), GFP_KERNEL); if (temp) { if (copy_from_user(temp, buf, 2*sizeof(char))) { @@ -8328,7 +8328,7 @@ static int q6asm_memory_map_regions(struct audio_client *ac, int dir, return -EINVAL; } - buffer_node = kcalloc(bufcnt, sizeof(struct asm_buffer_node), + buffer_node = kzalloc(sizeof(struct asm_buffer_node) * bufcnt, GFP_KERNEL); if (!buffer_node) return -ENOMEM; diff --git a/techpack/audio/dsp/q6audio-v2.c b/techpack/audio/dsp/q6audio-v2.c index cc2bfeca6c63..e72ec1977c37 100644 --- a/techpack/audio/dsp/q6audio-v2.c +++ b/techpack/audio/dsp/q6audio-v2.c @@ -352,12 +352,12 @@ int q6audio_get_port_index(u16 port_id) return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_6; case AFE_PORT_ID_RX_CODEC_DMA_RX_7: return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_7; - case AFE_PORT_ID_PSEUDOPORT_01: - return IDX_AFE_PORT_ID_PSEUDOPORT_01; case RT_PROXY_PORT_002_RX: return IDX_RT_PROXY_PORT_002_RX; case RT_PROXY_PORT_002_TX: return IDX_RT_PROXY_PORT_002_TX; + case AFE_PORT_ID_PSEUDOPORT_01: + return IDX_AFE_PORT_ID_PSEUDOPORT_01; default: return -EINVAL; } } @@ -1093,9 +1093,9 @@ int q6audio_validate_port(u16 port_id) case AFE_PORT_ID_TX_CODEC_DMA_TX_5: case AFE_PORT_ID_RX_CODEC_DMA_RX_6: case AFE_PORT_ID_RX_CODEC_DMA_RX_7: - case AFE_PORT_ID_PSEUDOPORT_01: case RT_PROXY_PORT_002_RX: case RT_PROXY_PORT_002_TX: + case AFE_PORT_ID_PSEUDOPORT_01: { ret = 0; break; diff --git a/techpack/audio/dsp/q6core.c b/techpack/audio/dsp/q6core.c index 56e93dcb721b..596e9ee63bc7 100644 --- a/techpack/audio/dsp/q6core.c +++ b/techpack/audio/dsp/q6core.c @@ -1329,48 +1329,6 @@ unlock: return ret; } -int q6core_adsp_crash(void) -{ - int ret = 0; - struct avcs_cmd_adsp_crash adsp_crash; - - if (!q6core_is_adsp_ready()) { - pr_err("%s: ADSP is not ready!\n", __func__); - return -ENODEV; - } - - memset(&adsp_crash, 0, sizeof(adsp_crash)); - mutex_lock(&q6core_lcl.cmd_lock); - - adsp_crash.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, - APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); - adsp_crash.hdr.pkt_size = sizeof(adsp_crash); - adsp_crash.hdr.src_svc = APR_SVC_ADSP_CORE; - adsp_crash.hdr.src_domain = APR_DOMAIN_APPS; - adsp_crash.hdr.dest_svc = APR_SVC_ADSP_CORE; - adsp_crash.hdr.dest_domain = APR_DOMAIN_ADSP; - adsp_crash.hdr.opcode = AVCS_CMD_ADSP_CRASH; - - q6core_lcl.adsp_status = 0; - q6core_lcl.bus_bw_resp_received = 0; - - ret = apr_send_pkt(q6core_lcl.core_handle_q, (uint32_t *) &adsp_crash); - if (ret < 0) { - pr_err("%s: crash ADSP failed %d\n", __func__, ret); - goto unlock; - } - - ret = wait_event_timeout(q6core_lcl.bus_bw_req_wait, - (q6core_lcl.bus_bw_resp_received == 1), - msecs_to_jiffies(TIMEOUT_MS * 5)); - -unlock: - mutex_unlock(&q6core_lcl.cmd_lock); - - return ret; -} -EXPORT_SYMBOL(q6core_adsp_crash); - static int get_cal_type_index(int32_t cal_type) { int ret = -EINVAL; diff --git a/techpack/audio/dsp/q6lsm.c b/techpack/audio/dsp/q6lsm.c index dd6801af4e5e..aa864ddbee7b 100644 --- a/techpack/audio/dsp/q6lsm.c +++ b/techpack/audio/dsp/q6lsm.c @@ -2476,9 +2476,8 @@ int q6lsm_lab_buffer_alloc(struct lsm_client *client, bool alloc) out_params->buf_sz; allocate_size = PAGE_ALIGN(allocate_size); client->lab_buffer = - kcalloc(out_params->period_count, - sizeof(struct lsm_lab_buffer), - GFP_KERNEL); + kzalloc(sizeof(struct lsm_lab_buffer) * + out_params->period_count, GFP_KERNEL); if (!client->lab_buffer) { pr_err("%s: memory allocation for lab buffer failed count %d\n" , __func__, diff --git a/techpack/audio/dsp/q6usm.c b/techpack/audio/dsp/q6usm.c index e6d5a6779d80..61e3bb96596b 100644 --- a/techpack/audio/dsp/q6usm.c +++ b/techpack/audio/dsp/q6usm.c @@ -314,7 +314,7 @@ struct us_client *q6usm_us_client_alloc( if (usc == NULL) return NULL; - p_mem_handle = kcalloc(4, sizeof(uint32_t), GFP_KERNEL); + p_mem_handle = kzalloc(sizeof(uint32_t) * 4, GFP_KERNEL); if (p_mem_handle == NULL) { kfree(usc); return NULL; diff --git a/techpack/audio/dsp/q6voice.c b/techpack/audio/dsp/q6voice.c index a4da33cb6215..2d9991bb62b3 100644 --- a/techpack/audio/dsp/q6voice.c +++ b/techpack/audio/dsp/q6voice.c @@ -29,9 +29,7 @@ #include #include #include "adsp_err.h" -#if CONFIG_VOICE_MHI #include -#endif #define TIMEOUT_MS 300 @@ -4292,7 +4290,7 @@ static int voice_send_cvp_mfc_config_cmd(struct voice_data *v) return ret; } -static __maybe_unused int voice_get_avcs_version_per_service(uint32_t service_id) +static int voice_get_avcs_version_per_service(uint32_t service_id) { int ret = 0; size_t ver_size; @@ -4321,44 +4319,21 @@ done: return ret; } -static void voice_send_uevent(char *uevent) -{ - int ret = 0; - - if (uevent == NULL) - return; - - pr_info("uevent = %s\n", uevent); - mutex_lock(&common.common_lock); - ret = q6core_send_uevent(common.uevent_data, uevent); - if (ret) - pr_err("%s: Send UEvent %s failed :%d\n", __func__, - uevent, ret); - mutex_unlock(&common.common_lock); -} - static void voice_mic_break_work_fn(struct work_struct *work) { + int ret = 0; char event[25] = ""; struct voice_data *v = container_of(work, struct voice_data, voice_mic_break_work); - uint8_t mic_break_stat = - v->mic_break_status & MIC_BREAK_STAT_MIC_BREAK_MASK; - uint8_t mic_degrade_stat = - (v->mic_break_status & MIC_BREAK_STAT_MIC_DEGRADE_MASK) - >> MIC_DEGRADE_SHIFT_BITS; - if (mic_break_stat) { - snprintf(event, sizeof(event), "MIC_BREAK_STATUS=%d", - mic_break_stat); - voice_send_uevent(event); - } + snprintf(event, sizeof(event), "MIC_BREAK_STATUS=%s", + v->mic_break_status ? "TRUE" : "FALSE"); - if (mic_degrade_stat) { - snprintf(event, sizeof(event), "MIC_DEGRADE_STATUS=%d", - mic_degrade_stat); - voice_send_uevent(event); - } + mutex_lock(&common.common_lock); + ret = q6core_send_uevent(common.uevent_data, event); + if (ret) + pr_err("%s: Send UEvent %s failed :%d\n", __func__, event, ret); + mutex_unlock(&common.common_lock); } static int voice_setup_vocproc(struct voice_data *v) @@ -4372,7 +4347,7 @@ static int voice_setup_vocproc(struct voice_data *v) pr_err("%s: CVP create failed err:%d\n", __func__, ret); goto fail; } -#if 0 + if (common.is_avcs_version_queried == false) common.cvp_version = voice_get_avcs_version_per_service( APRV2_IDS_SERVICE_ID_ADSP_CVP_V); @@ -4383,7 +4358,6 @@ static int voice_setup_vocproc(struct voice_data *v) ret = -EINVAL; goto fail; } -#endif pr_debug("%s: CVP Version %d\n", __func__, common.cvp_version); ret = voice_send_cvp_media_fmt_info_cmd(v); @@ -6894,12 +6868,11 @@ int voc_end_voice_call(uint32_t session_id) voice_destroy_mvm_cvs_session(v); -#if CONFIG_VOICE_MHI ret = voice_mhi_end(); if (ret < 0) pr_debug("%s: voice_mhi_end failed! %d\n", __func__, ret); -#endif + v->voc_state = VOC_RELEASE; } else { pr_err("%s: Error: End voice called in state %d\n", @@ -7235,14 +7208,12 @@ int voc_start_voice_call(uint32_t session_id) __func__, ret); } -#if CONFIG_VOICE_MHI ret = voice_mhi_start(); if (ret < 0) { pr_debug("%s: voice_mhi_start failed! %d\n", __func__, ret); goto fail; } -#endif ret = voice_create_mvm_cvs_session(v); if (ret < 0) { @@ -7648,17 +7619,9 @@ static int32_t qdsp_mvm_callback(struct apr_client_data *data, void *priv) voice_act_update = (struct vss_evt_voice_activity *) data->payload; - pr_debug("activity = 0x%x\n", voice_act_update->activity); - if ((voice_act_update->activity >= - VSS_ICOMMON_VOICE_ACTIVITY_MIC_BREAK_STAT_BASE) && - (voice_act_update->activity <= - VSS_ICOMMON_VOICE_ACTIVITY_MIC_BREAK_STAT_BASE + - MIC_BREAK_STAT_MAX)) - v->mic_break_status = voice_act_update->activity - - VSS_ICOMMON_VOICE_ACTIVITY_MIC_BREAK_STAT_BASE; /* Drop notifications other than Mic Break */ - else if ((voice_act_update->activity + if ((voice_act_update->activity != VSS_ICOMMON_VOICE_ACTIVITY_MIC_BREAK) && (voice_act_update->activity != VSS_ICOMMON_VOICE_ACITIVTY_MIC_UNBREAK)) diff --git a/techpack/audio/dsp/rtac.c b/techpack/audio/dsp/rtac.c index 5c48cddd4345..5a3ce34107c0 100644 --- a/techpack/audio/dsp/rtac.c +++ b/techpack/audio/dsp/rtac.c @@ -736,6 +736,7 @@ bool rtac_make_adm_callback(uint32_t *payload, u32 payload_size) atomic_set(&rtac_common.apr_err_code, payload[1]); atomic_set(&rtac_adm_apr_data.cmd_state, 0); + wake_up(&rtac_adm_apr_data.cmd_wait); return true; } @@ -887,17 +888,32 @@ int send_adm_apr(void *buf, u32 opcode) pr_debug("%s: Sending RTAC command ioctl 0x%x, paddr 0x%pK\n", __func__, opcode, &rtac_cal[ADM_RTAC_CAL].cal_data.paddr); - mutex_unlock(&rtac_adm_apr_mutex); - - result = adm_apr_send_pkt((uint32_t *)rtac_adm_buffer, - port_idx, copp_idx); - - mutex_lock(&rtac_adm_apr_mutex); + result = apr_send_pkt(rtac_adm_apr_data.apr_handle, + (uint32_t *)rtac_adm_buffer); if (result < 0) { pr_err("%s: Set params failed copp = %d\n", __func__, copp_id); goto err; } + /* Wait for the callback */ + result = wait_event_timeout(rtac_adm_apr_data.cmd_wait, + (atomic_read(&rtac_adm_apr_data.cmd_state) == 0), + msecs_to_jiffies(TIMEOUT_MS)); + if (!result) { + pr_err("%s: Set params timed out copp = %d\n", __func__, + copp_id); + goto err; + } + if (atomic_read(&rtac_common.apr_err_code)) { + pr_err("%s: DSP returned error code = [%s], opcode = 0x%x\n", + __func__, adsp_err_get_err_str(atomic_read( + &rtac_common.apr_err_code)), + opcode); + result = adsp_err_get_lnx_err_code( + atomic_read( + &rtac_common.apr_err_code)); + goto err; + } if (opcode == ADM_CMD_GET_PP_PARAMS_V5) { bytes_returned = ((u32 *)rtac_cal[ADM_RTAC_CAL].cal_data. diff --git a/techpack/audio/dsp/voice_mhi.c b/techpack/audio/dsp/voice_mhi.c index eeaa073efebc..1397b6d4fae5 100644 --- a/techpack/audio/dsp/voice_mhi.c +++ b/techpack/audio/dsp/voice_mhi.c @@ -437,7 +437,7 @@ static int voice_mhi_pcie_up_callback(struct mhi_device *voice_mhi_dev, static void voice_mhi_pcie_down_callback(struct mhi_device *voice_mhi_dev) { dma_addr_t iova; - struct device *md = NULL; + struct device *md; mutex_lock(&voice_mhi_lcl.mutex); diff --git a/techpack/audio/include/dsp/apr_audio-v2.h b/techpack/audio/include/dsp/apr_audio-v2.h index a5c18ca98523..e5aec5bcf4e7 100644 --- a/techpack/audio/include/dsp/apr_audio-v2.h +++ b/techpack/audio/include/dsp/apr_audio-v2.h @@ -11382,7 +11382,7 @@ struct afe_clk_set { * for enable and disable clock. * "clk_freq_in_hz", "clk_attri", and "clk_root" * are ignored in disable clock case. - * @values? + * @values * - 0 -- Disabled * - 1 -- Enabled @tablebulletend */ diff --git a/techpack/audio/include/dsp/msm-cirrus-playback.h b/techpack/audio/include/dsp/msm-cirrus-playback.h index 2991c4614f04..84094c8d78d8 100755 --- a/techpack/audio/include/dsp/msm-cirrus-playback.h +++ b/techpack/audio/include/dsp/msm-cirrus-playback.h @@ -1,5 +1,4 @@ /* Copyright (c) 2015 Cirrus Logic, Inc. - * Copyright (C) 2019 XiaoMi, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/techpack/audio/include/dsp/q6adm-v2.h b/techpack/audio/include/dsp/q6adm-v2.h index 8e758d64897a..ecaa926a1c67 100644 --- a/techpack/audio/include/dsp/q6adm-v2.h +++ b/techpack/audio/include/dsp/q6adm-v2.h @@ -215,5 +215,4 @@ int adm_programable_channel_mixer(int port_id, int copp_idx, int session_id, void msm_dts_srs_acquire_lock(void); void msm_dts_srs_release_lock(void); void adm_set_native_mode(int mode); -int adm_apr_send_pkt(void *data, int port_idx, int copp_idx); #endif /* __Q6_ADM_V2_H__ */ diff --git a/techpack/audio/include/dsp/q6afe-v2.h b/techpack/audio/include/dsp/q6afe-v2.h index 8258d37c3cf2..fde67d96d48d 100644 --- a/techpack/audio/include/dsp/q6afe-v2.h +++ b/techpack/audio/include/dsp/q6afe-v2.h @@ -265,11 +265,11 @@ enum { /* IDX 187 -> 188 */ IDX_AFE_PORT_ID_SENARY_PCM_RX, IDX_AFE_PORT_ID_SENARY_PCM_TX, - - IDX_AFE_PORT_ID_PSEUDOPORT_01, /* IDX 189 -> 190 */ IDX_RT_PROXY_PORT_002_RX, IDX_RT_PROXY_PORT_002_TX, + + IDX_AFE_PORT_ID_PSEUDOPORT_01, AFE_MAX_PORTS }; @@ -461,13 +461,11 @@ int afe_get_sp_rx_tmax_xmax_logging_data( u16 port_id); int afe_cal_init_hwdep(void *card); int afe_send_port_island_mode(u16 port_id); - #ifdef CONFIG_MSM_CSPL int afe_apr_send_pkt_crus(void *data, int index, int set); int crus_afe_port_close(u16 port_id); int crus_afe_port_start(u16 port_id); #endif - int afe_send_cmd_wakeup_register(void *handle, bool enable); void afe_register_wakeup_irq_callback( void (*afe_cb_wakeup_irq)(void *handle)); diff --git a/techpack/audio/include/dsp/q6core.h b/techpack/audio/include/dsp/q6core.h index dff5df22456b..ec629df4415f 100644 --- a/techpack/audio/include/dsp/q6core.h +++ b/techpack/audio/include/dsp/q6core.h @@ -180,12 +180,6 @@ struct avcs_cmd_deregister_topologies { */ } __packed; -#define AVCS_CMD_ADSP_CRASH 0x0001FFFF - -struct avcs_cmd_adsp_crash { - struct apr_hdr hdr; -} __packed; - #define AVCS_MODE_DEREGISTER_ALL_CUSTOM_TOPOLOGIES 2 #define AVCS_CMD_LOAD_TOPO_MODULES 0x0001296C @@ -210,7 +204,6 @@ int q6core_map_mdf_shared_memory(uint32_t map_handle, phys_addr_t *buf_add, int32_t core_set_license(uint32_t key, uint32_t module_id); int32_t core_get_license_status(uint32_t module_id); -int q6core_adsp_crash(void); int32_t q6core_load_unload_topo_modules(uint32_t topology_id, bool preload_type); diff --git a/techpack/audio/include/dsp/q6voice.h b/techpack/audio/include/dsp/q6voice.h index cf395d720bdf..d39578faf7b6 100644 --- a/techpack/audio/include/dsp/q6voice.h +++ b/techpack/audio/include/dsp/q6voice.h @@ -509,22 +509,6 @@ struct vss_icommon_cmd_set_param { #define VSS_ICOMMON_VOICE_ACTIVITY_MIC_BREAK 0x000131F3 /* Mic path is restored. */ #define VSS_ICOMMON_VOICE_ACITIVTY_MIC_UNBREAK 0x000131F4 -/* Mic break status base. */ -#define VSS_ICOMMON_VOICE_ACTIVITY_MIC_BREAK_STAT_BASE 0x00013300 - -enum mic_break_stat { - MIC_BREAK_STAT_OK = 0, - MIC_BREAK_STAT_MIC1_BREAK = 0x1, - MIC_BREAK_STAT_MIC2_BREAK = 0x2, - MIC_BREAK_STAT_MIC3_BREAK = 0x4, - MIC_BREAK_STAT_MIC_BREAK_MASK = 0x07, - MIC_BREAK_STAT_MIC1_DEGRADE = 0x8, - MIC_BREAK_STAT_MIC2_DEGRADE = 0x10, - MIC_BREAK_STAT_MIC3_DEGRADE = 0x20, - MIC_BREAK_STAT_MIC_DEGRADE_MASK = 0x38, - MIC_BREAK_STAT_MAX = 0x3F, -}; -#define MIC_DEGRADE_SHIFT_BITS 3 enum msm_audio_voc_rate { VOC_0_RATE, /* Blank frame */ @@ -1915,7 +1899,7 @@ struct voice_data { struct voice_rec_route_state rec_route_state; - uint8_t mic_break_status; + bool mic_break_status; struct work_struct voice_mic_break_work; }; diff --git a/techpack/audio/include/elliptic/elliptic_data_io.h b/techpack/audio/include/elliptic/elliptic_data_io.h index db087b1cae21..43841ed3e044 100644 --- a/techpack/audio/include/elliptic/elliptic_data_io.h +++ b/techpack/audio/include/elliptic/elliptic_data_io.h @@ -1,6 +1,5 @@ /** * Copyright Elliptic Labs 2015-2016 -* Copyright (C) 2019 XiaoMi, Inc. * */ diff --git a/techpack/audio/include/elliptic/elliptic_device.h b/techpack/audio/include/elliptic/elliptic_device.h index b48184c4808f..78159257cead 100644 --- a/techpack/audio/include/elliptic/elliptic_device.h +++ b/techpack/audio/include/elliptic/elliptic_device.h @@ -1,6 +1,5 @@ /** * Copyright Elliptic Labs - * Copyright (C) 2019 XiaoMi, Inc. * */ @@ -48,7 +47,7 @@ extern struct class *elliptic_class; pr_warn("[ELUS] : (%s) : " string "\n", __func__, ##arg) #define EL_PRINT_I(string, arg...) \ - pr_debug("[ELUS] : (%s) : " string "\n", __func__, ##arg) + pr_info("[ELUS] : (%s) : " string "\n", __func__, ##arg) #define EL_PRINT_D(string, arg...) \ pr_debug("[ELUS] : (%s) : " string "\n", __func__, ##arg) diff --git a/techpack/audio/include/mius/mius_data_io.h b/techpack/audio/include/mius/mius_data_io.h index c8a3ba1087a4..7894d420e577 100644 --- a/techpack/audio/include/mius/mius_data_io.h +++ b/techpack/audio/include/mius/mius_data_io.h @@ -1,6 +1,5 @@ /** * Copyright MI 2015-2016 -* Copyright (C) 2019 XiaoMi, Inc. * */ diff --git a/techpack/audio/include/mius/mius_device.h b/techpack/audio/include/mius/mius_device.h index d5fa058b93b0..215963d8f240 100644 --- a/techpack/audio/include/mius/mius_device.h +++ b/techpack/audio/include/mius/mius_device.h @@ -1,6 +1,5 @@ /** * Copyright MI - * Copyright (C) 2019 XiaoMi, Inc. * */ diff --git a/techpack/audio/include/uapi/Android.mk b/techpack/audio/include/uapi/Android.mk deleted file mode 100644 index b8c209adaa0e..000000000000 --- a/techpack/audio/include/uapi/Android.mk +++ /dev/null @@ -1,29 +0,0 @@ -# Use this by setting -# LOCAL_HEADER_LIBRARIES := audio_kernel_headers - -LOCAL_PATH := $(call my-dir) -MYLOCAL_PATH := $(LOCAL_PATH) - -UAPI_OUT := $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/include - -AUDIO_KERNEL_HEADERS := $(call all-named-files-under,*.h,linux) $(call all-named-files-under,*.h,sound) - -HEADER_INSTALL_DIR := kernel/msm-$(TARGET_KERNEL_VERSION)/scripts - -BUILD_ROOT_RELATIVE := ../../../../../../../ - -include $(CLEAR_VARS) -LOCAL_MODULE := audio_kernel_headers -LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_PREBUILT_INT_KERNEL) - -GEN := $(addprefix $(UAPI_OUT)/,$(AUDIO_KERNEL_HEADERS)) -$(GEN): $(KERNEL_USR) -$(GEN): PRIVATE_PATH := $(MYLOCAL_PATH) -$(GEN): PRIVATE_CUSTOM_TOOL = $(shell cd $(PRODUCT_OUT)/obj/KERNEL_OBJ; $(BUILD_ROOT_RELATIVE)$(HEADER_INSTALL_DIR)/headers_install.sh $(BUILD_ROOT_RELATIVE)$(dir $@) $(BUILD_ROOT_RELATIVE)$(subst $(UAPI_OUT),$(MYLOCAL_PATH),$(dir $@)) $(notdir $@)) -$(GEN): $(addprefix $(MYLOCAL_PATH)/,$(AUDIO_KERNEL_HEADERS)) - $(transform-generated-source) - -LOCAL_GENERATED_SOURCES := $(GEN) -LOCAL_EXPORT_C_INCLUDE_DIRS := $(UAPI_OUT) - -include $(BUILD_HEADER_LIBRARY) diff --git a/techpack/audio/include/uapi/linux/msm_audio_calibration.h b/techpack/audio/include/uapi/linux/msm_audio_calibration.h index e8ba1b3c206a..35b596062247 100644 --- a/techpack/audio/include/uapi/linux/msm_audio_calibration.h +++ b/techpack/audio/include/uapi/linux/msm_audio_calibration.h @@ -104,7 +104,6 @@ enum { ADM_LSM_TOPOLOGY_CAL_TYPE, ADM_LSM_AUDPROC_CAL_TYPE, ADM_LSM_AUDPROC_PERSISTENT_CAL_TYPE, - ADM_AUDPROC_PERSISTENT_CAL_TYPE, MAX_CAL_TYPES, }; @@ -118,7 +117,6 @@ enum { #define ADM_LSM_TOPOLOGY_CAL_TYPE ADM_LSM_TOPOLOGY_CAL_TYPE #define ADM_LSM_AUDPROC_CAL_TYPE ADM_LSM_AUDPROC_CAL_TYPE #define ADM_LSM_AUDPROC_PERSISTENT_CAL_TYPE ADM_LSM_AUDPROC_PERSISTENT_CAL_TYPE -#define ADM_AUDPROC_PERSISTENT_CAL_TYPE ADM_AUDPROC_PERSISTENT_CAL_TYPE #define LSM_CAL_TYPES #define TOPOLOGY_SPECIFIC_CHANNEL_INFO diff --git a/techpack/audio/include/uapi/sound/cs35l41.h b/techpack/audio/include/uapi/sound/cs35l41.h index 59307dbe7e06..7a2fb19d825d 100755 --- a/techpack/audio/include/uapi/sound/cs35l41.h +++ b/techpack/audio/include/uapi/sound/cs35l41.h @@ -2,7 +2,6 @@ * linux/sound/cs35l41.h -- Platform data for CS35L41 * * Copyright (c) 2018 Cirrus Logic Inc. - * Copyright (C) 2019 XiaoMi, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -80,5 +79,5 @@ struct cs35l41_private { int cs35l41_probe(struct cs35l41_private *cs35l41, struct cs35l41_platform_data *pdata); -int spk_id_get(struct device_node *np); +int cs35l41_spk_id_get(struct device_node *np); #endif /* __CS35L41_H */ diff --git a/techpack/audio/include/uapi/sound/msm-cirrus-playback.h b/techpack/audio/include/uapi/sound/msm-cirrus-playback.h index 6f118a45497a..aca17609f26f 100755 --- a/techpack/audio/include/uapi/sound/msm-cirrus-playback.h +++ b/techpack/audio/include/uapi/sound/msm-cirrus-playback.h @@ -1,5 +1,4 @@ /* Copyright (c) 2016 Cirrus Logic, Inc. - * Copyright (C) 2019 XiaoMi, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/techpack/audio/ipc/Android.mk b/techpack/audio/ipc/Android.mk deleted file mode 100644 index af0fbef6eb3f..000000000000 --- a/techpack/audio/ipc/Android.mk +++ /dev/null @@ -1,73 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,sdm845),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM845=m -endif - -ifeq ($(call is-board-platform,sdm660),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m -endif - -ifeq ($(call is-board-platform-in-list,msm8953 sdm670 qcs605),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM670=m -endif - -ifeq ($(call is-board-platform,msmnile),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m -endif - -ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) atoll $(TRINKET)),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msm8953 sdm845 sdm670 sdm660 qcs605 msmnile $(MSMSTEPPE) atoll $(TRINKET)),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=apr_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_apr.ko -LOCAL_MODULE_KBUILD_NAME := apr_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_wglink.ko -LOCAL_MODULE_KBUILD_NAME := wglink_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/ipc/apr.c b/techpack/audio/ipc/apr.c index 9390c966753e..f5b602de4453 100644 --- a/techpack/audio/ipc/apr.c +++ b/techpack/audio/ipc/apr.c @@ -41,7 +41,7 @@ static struct apr_q6 q6; static struct apr_client client[APR_DEST_MAX][APR_CLIENT_MAX]; -static void __maybe_unused *apr_pkt_ctx; +static void *apr_pkt_ctx; static wait_queue_head_t modem_wait; static bool is_modem_up; static char *subsys_name = NULL; @@ -89,7 +89,12 @@ static const struct file_operations apr_debug_ops = { }; #endif -#define APR_PKT_INFO(x...) ((void)0) +#define APR_PKT_INFO(x...) \ +do { \ + if (apr_pkt_ctx) \ + ipc_log_string(apr_pkt_ctx, ": "x); \ +} while (0) + struct apr_svc_table { char name[64]; @@ -728,7 +733,7 @@ void apr_cb_func(void *buf, int len, void *priv) if (unlikely(apr_cf_debug)) { if (hdr->opcode == APR_BASIC_RSP_RESULT && data.payload) { - uint32_t __maybe_unused *ptr = data.payload; + uint32_t *ptr = data.payload; APR_PKT_INFO( "Rx: src_addr[0x%X] dest_addr[0x%X] opcode[0x%X] token[0x%X] rc[0x%X]", @@ -1180,7 +1185,7 @@ static int apr_probe(struct platform_device *pdev) apr_pkt_ctx = ipc_log_context_create(APR_PKT_IPC_LOG_PAGE_CNT, "apr", 0); if (!apr_pkt_ctx) - pr_debug("%s: Unable to create ipc log context\n", __func__); + pr_err("%s: Unable to create ipc log context\n", __func__); spin_lock(&apr_priv->apr_lock); apr_priv->is_initial_boot = true; diff --git a/techpack/audio/soc/Android.mk b/techpack/audio/soc/Android.mk deleted file mode 100644 index 5e4beb3d3192..000000000000 --- a/techpack/audio/soc/Android.mk +++ /dev/null @@ -1,101 +0,0 @@ -# Android makefile for audio kernel modules - -# Assume no targets will be supported - -# Check if this driver needs be built for current target -ifeq ($(call is-board-platform,sdm845),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM845=m -endif - -ifeq ($(call is-board-platform,sdm660),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM660=m -endif - -ifeq ($(call is-board-platform-in-list,msm8953 sdm670 qcs605),true) -AUDIO_SELECT := CONFIG_SND_SOC_SDM670=m -endif - -ifeq ($(call is-board-platform,msmnile),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m -endif - -ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) $(TRINKET) atoll),true) -AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m -endif - -AUDIO_CHIPSET := audio -# Build/Package only in case of supported target -ifeq ($(call is-board-platform-in-list,msm8953 sdm845 sdm670 sdm660 qcs605 msmnile $(MSMSTEPPE) $(TRINKET) atoll),true) - -LOCAL_PATH := $(call my-dir) - -# This makefile is only for DLKM -ifneq ($(findstring vendor,$(LOCAL_PATH)),) - -ifneq ($(findstring opensource,$(LOCAL_PATH)),) - AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel -endif # opensource - -DLKM_DIR := $(TOP)/device/qcom/common/dlkm - -# Build audio.ko as $(AUDIO_CHIPSET)_audio.ko -########################################################### -# This is set once per LOCAL_PATH, not per (kernel) module -KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR) - -# We are actually building audio.ko here, as per the -# requirement we are specifying _audio.ko as LOCAL_MODULE. -# This means we need to rename the module to _audio.ko -# after audio.ko is built. -KBUILD_OPTIONS += MODNAME=soc_dlkm -KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) -KBUILD_OPTIONS += $(AUDIO_SELECT) - -########################################################### -ifeq ($(call is-board-platform-in-list,msm8953 sdm670 sdm660 qcs605 $(MSMSTEPPE) atoll),true) -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_pinctrl_lpi.ko -LOCAL_MODULE_KBUILD_NAME := pinctrl_lpi_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -endif -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_pinctrl_wcd.ko -LOCAL_MODULE_KBUILD_NAME := pinctrl_wcd_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_swr.ko -LOCAL_MODULE_KBUILD_NAME := swr_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_swr_ctrl.ko -LOCAL_MODULE_KBUILD_NAME := swr_ctrl_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -########################################################### -ifeq ($(call is-board-platform-in-list, $(MSMSTEPPE) atoll $(TRINKET)),true) -include $(CLEAR_VARS) -LOCAL_MODULE := $(AUDIO_CHIPSET)_snd_event.ko -LOCAL_MODULE_KBUILD_NAME := snd_event_dlkm.ko -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_DEBUG_ENABLE := true -LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) -include $(DLKM_DIR)/AndroidKernelModule.mk -endif -########################################################### - -endif # DLKM check -endif # supported target check diff --git a/techpack/audio/soc/pinctrl-lpi.c b/techpack/audio/soc/pinctrl-lpi.c index 23edee736cec..d4e0dfdc8b8c 100644 --- a/techpack/audio/soc/pinctrl-lpi.c +++ b/techpack/audio/soc/pinctrl-lpi.c @@ -778,17 +778,7 @@ static struct platform_driver lpi_pinctrl_driver = { .remove = lpi_pinctrl_remove, }; -static int __init lpi_init(void) -{ - return platform_driver_register(&lpi_pinctrl_driver); -} -late_initcall(lpi_init); - -static void __exit lpi_exit(void) -{ - platform_driver_unregister(&lpi_pinctrl_driver); -} -module_exit(lpi_exit); +module_platform_driver(lpi_pinctrl_driver); MODULE_DESCRIPTION("QTI LPI GPIO pin control driver"); MODULE_LICENSE("GPL v2"); diff --git a/techpack/audio/soc/pinctrl-wcd.c b/techpack/audio/soc/pinctrl-wcd.c index 18881f09d566..d7695dbe77b8 100644 --- a/techpack/audio/soc/pinctrl-wcd.c +++ b/techpack/audio/soc/pinctrl-wcd.c @@ -339,8 +339,7 @@ static int wcd_pinctrl_probe(struct platform_device *pdev) goto err_name_alloc; } for (i = 0; i < npins; i++, pindesc++) { - name[i] = devm_kzalloc(dev, - WCD_GPIO_STRING_LEN, + name[i] = devm_kzalloc(dev, sizeof(char) * WCD_GPIO_STRING_LEN, GFP_KERNEL); if (!name[i]) { ret = -ENOMEM; diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 8f7f9d05f38c..bfa6d9d21556 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -1354,7 +1354,7 @@ int debuginfo__find_trace_events(struct debuginfo *dbg, tf.ntevs = 0; ret = debuginfo__find_probes(dbg, &tf.pf); - if (ret < 0) { + if (ret < 0 || tf.ntevs == 0) { for (i = 0; i < tf.ntevs; i++) clear_probe_trace_event(&tf.tevs[i]); zfree(tevs); diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c index 3814cdad643a..7fe673248e98 100644 --- a/virt/kvm/arm/mmu.c +++ b/virt/kvm/arm/mmu.c @@ -307,12 +307,6 @@ static void unmap_stage2_range(struct kvm *kvm, phys_addr_t start, u64 size) next = stage2_pgd_addr_end(addr, end); if (!stage2_pgd_none(*pgd)) unmap_stage2_puds(kvm, pgd, addr, next); - /* - * If the range is too large, release the kvm->mmu_lock - * to prevent starvation and lockup detector warnings. - */ - if (next != end) - cond_resched_lock(&kvm->mmu_lock); } while (pgd++, addr = next, addr != end); }