Loading Android.mk +5 −0 Original line number Diff line number Diff line Loading @@ -29,3 +29,8 @@ $(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codec 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 asoc/codecs/core.h +3 −1 Original line number Diff line number Diff line /* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2011-2018, 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 Loading Loading @@ -105,6 +105,8 @@ #define IS_CODEC_VERSION(wcd, wcdversion) \ ((wcd->version == wcdversion) ? true : false) #define PAHU_VERSION_1_0 0 enum { CDC_V_1_0, CDC_V_1_1, Loading asoc/codecs/msm-cdc-supply.c +101 −1 Original line number Diff line number Diff line /* * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2018, 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 Loading Loading @@ -126,6 +126,106 @@ static int msm_cdc_check_supply_param(struct device *dev, return 0; } /* * msm_cdc_disable_ondemand_supply: * Disable codec ondemand supply * * @dev: pointer to codec device * @supplies: pointer to regulator bulk data * @cdc_vreg: pointer to platform regulator data * @num_supplies: number of supplies * @supply_name: Ondemand supply name to be enabled * * Return error code if supply disable is failed */ int msm_cdc_disable_ondemand_supply(struct device *dev, struct regulator_bulk_data *supplies, struct cdc_regulator *cdc_vreg, int num_supplies, char *supply_name) { int rc, i; if ((!supply_name) || (!supplies)) { pr_err("%s: either dev or supplies or cdc_vreg is NULL\n", __func__); return -EINVAL; } /* input parameter validation */ rc = msm_cdc_check_supply_param(dev, cdc_vreg, num_supplies); if (rc) return rc; for (i = 0; i < num_supplies; i++) { if (cdc_vreg[i].ondemand && !strcmp(cdc_vreg[i].name, supply_name)) { rc = regulator_disable(supplies[i].consumer); if (rc) dev_err(dev, "%s: failed to disable supply %s, err:%d\n", __func__, supplies[i].supply, rc); break; } } if (i == num_supplies) { dev_err(dev, "%s: not able to find supply %s\n", __func__, supply_name); rc = -EINVAL; } return rc; } EXPORT_SYMBOL(msm_cdc_disable_ondemand_supply); /* * msm_cdc_enable_ondemand_supply: * Enable codec ondemand supply * * @dev: pointer to codec device * @supplies: pointer to regulator bulk data * @cdc_vreg: pointer to platform regulator data * @num_supplies: number of supplies * @supply_name: Ondemand supply name to be enabled * * Return error code if supply enable is failed */ int msm_cdc_enable_ondemand_supply(struct device *dev, struct regulator_bulk_data *supplies, struct cdc_regulator *cdc_vreg, int num_supplies, char *supply_name) { int rc, i; if ((!supply_name) || (!supplies)) { pr_err("%s: either dev or supplies or cdc_vreg is NULL\n", __func__); return -EINVAL; } /* input parameter validation */ rc = msm_cdc_check_supply_param(dev, cdc_vreg, num_supplies); if (rc) return rc; for (i = 0; i < num_supplies; i++) { if (cdc_vreg[i].ondemand && !strcmp(cdc_vreg[i].name, supply_name)) { rc = regulator_enable(supplies[i].consumer); if (rc) dev_err(dev, "%s: failed to enable supply %s, rc: %d\n", __func__, supplies[i].supply, rc); break; } } if (i == num_supplies) { dev_err(dev, "%s: not able to find supply %s\n", __func__, supply_name); rc = -EINVAL; } return rc; } EXPORT_SYMBOL(msm_cdc_enable_ondemand_supply); /* * msm_cdc_disable_static_supplies: * Disable codec static supplies Loading asoc/codecs/msm-cdc-supply.h +9 −1 Original line number Diff line number Diff line /* Copyright (c) 2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2016, 2018 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 Loading Loading @@ -29,6 +29,14 @@ struct cdc_regulator { extern int msm_cdc_get_power_supplies(struct device *dev, struct cdc_regulator **cdc_vreg, int *total_num_supplies); extern int msm_cdc_disable_ondemand_supply(struct device *dev, struct regulator_bulk_data *supplies, struct cdc_regulator *cdc_vreg, int num_supplies, char *supply_name); extern int msm_cdc_enable_ondemand_supply(struct device *dev, struct regulator_bulk_data *supplies, struct cdc_regulator *cdc_vreg, int num_supplies, char *supply_name); extern int msm_cdc_disable_static_supplies(struct device *dev, struct regulator_bulk_data *supplies, struct cdc_regulator *cdc_vreg, Loading asoc/codecs/wcd9360/Android.mk 0 → 100644 +50 −0 Original line number Diff line number Diff line # 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_SDM855=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 := $(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 <chipset>_audio.ko as LOCAL_MODULE. # This means we need to rename the module to <chipset>_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 Loading
Android.mk +5 −0 Original line number Diff line number Diff line Loading @@ -29,3 +29,8 @@ $(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codec 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
asoc/codecs/core.h +3 −1 Original line number Diff line number Diff line /* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2011-2018, 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 Loading Loading @@ -105,6 +105,8 @@ #define IS_CODEC_VERSION(wcd, wcdversion) \ ((wcd->version == wcdversion) ? true : false) #define PAHU_VERSION_1_0 0 enum { CDC_V_1_0, CDC_V_1_1, Loading
asoc/codecs/msm-cdc-supply.c +101 −1 Original line number Diff line number Diff line /* * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2018, 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 Loading Loading @@ -126,6 +126,106 @@ static int msm_cdc_check_supply_param(struct device *dev, return 0; } /* * msm_cdc_disable_ondemand_supply: * Disable codec ondemand supply * * @dev: pointer to codec device * @supplies: pointer to regulator bulk data * @cdc_vreg: pointer to platform regulator data * @num_supplies: number of supplies * @supply_name: Ondemand supply name to be enabled * * Return error code if supply disable is failed */ int msm_cdc_disable_ondemand_supply(struct device *dev, struct regulator_bulk_data *supplies, struct cdc_regulator *cdc_vreg, int num_supplies, char *supply_name) { int rc, i; if ((!supply_name) || (!supplies)) { pr_err("%s: either dev or supplies or cdc_vreg is NULL\n", __func__); return -EINVAL; } /* input parameter validation */ rc = msm_cdc_check_supply_param(dev, cdc_vreg, num_supplies); if (rc) return rc; for (i = 0; i < num_supplies; i++) { if (cdc_vreg[i].ondemand && !strcmp(cdc_vreg[i].name, supply_name)) { rc = regulator_disable(supplies[i].consumer); if (rc) dev_err(dev, "%s: failed to disable supply %s, err:%d\n", __func__, supplies[i].supply, rc); break; } } if (i == num_supplies) { dev_err(dev, "%s: not able to find supply %s\n", __func__, supply_name); rc = -EINVAL; } return rc; } EXPORT_SYMBOL(msm_cdc_disable_ondemand_supply); /* * msm_cdc_enable_ondemand_supply: * Enable codec ondemand supply * * @dev: pointer to codec device * @supplies: pointer to regulator bulk data * @cdc_vreg: pointer to platform regulator data * @num_supplies: number of supplies * @supply_name: Ondemand supply name to be enabled * * Return error code if supply enable is failed */ int msm_cdc_enable_ondemand_supply(struct device *dev, struct regulator_bulk_data *supplies, struct cdc_regulator *cdc_vreg, int num_supplies, char *supply_name) { int rc, i; if ((!supply_name) || (!supplies)) { pr_err("%s: either dev or supplies or cdc_vreg is NULL\n", __func__); return -EINVAL; } /* input parameter validation */ rc = msm_cdc_check_supply_param(dev, cdc_vreg, num_supplies); if (rc) return rc; for (i = 0; i < num_supplies; i++) { if (cdc_vreg[i].ondemand && !strcmp(cdc_vreg[i].name, supply_name)) { rc = regulator_enable(supplies[i].consumer); if (rc) dev_err(dev, "%s: failed to enable supply %s, rc: %d\n", __func__, supplies[i].supply, rc); break; } } if (i == num_supplies) { dev_err(dev, "%s: not able to find supply %s\n", __func__, supply_name); rc = -EINVAL; } return rc; } EXPORT_SYMBOL(msm_cdc_enable_ondemand_supply); /* * msm_cdc_disable_static_supplies: * Disable codec static supplies Loading
asoc/codecs/msm-cdc-supply.h +9 −1 Original line number Diff line number Diff line /* Copyright (c) 2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2016, 2018 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 Loading Loading @@ -29,6 +29,14 @@ struct cdc_regulator { extern int msm_cdc_get_power_supplies(struct device *dev, struct cdc_regulator **cdc_vreg, int *total_num_supplies); extern int msm_cdc_disable_ondemand_supply(struct device *dev, struct regulator_bulk_data *supplies, struct cdc_regulator *cdc_vreg, int num_supplies, char *supply_name); extern int msm_cdc_enable_ondemand_supply(struct device *dev, struct regulator_bulk_data *supplies, struct cdc_regulator *cdc_vreg, int num_supplies, char *supply_name); extern int msm_cdc_disable_static_supplies(struct device *dev, struct regulator_bulk_data *supplies, struct cdc_regulator *cdc_vreg, Loading
asoc/codecs/wcd9360/Android.mk 0 → 100644 +50 −0 Original line number Diff line number Diff line # 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_SDM855=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 := $(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 <chipset>_audio.ko as LOCAL_MODULE. # This means we need to rename the module to <chipset>_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