Browse Source

Add support for pineapple

- Enables bt kernel driver for pineapple
- Replace fallthrough comments with attribute
- Disable WLAN dependencies

Change-Id: I7843ecc47b656e22d9e558af6be8d3445d79918f
Franklin Abreu Bueno 2 years ago
parent
commit
45014a6ec9
8 changed files with 13 additions and 56 deletions
  1. 1 3
      Android.mk
  2. 0 3
      Makefile
  3. 0 1
      include/btpower.h
  4. 0 1
      pwr/Kconfig
  5. 0 2
      pwr/Makefile
  6. 6 43
      pwr/btpower.c
  7. 2 1
      rtc6226/radio-rtc6226-common.c
  8. 4 2
      slimbus/btfm_slim_codec.c

+ 1 - 3
Android.mk

@@ -3,7 +3,7 @@
 LOCAL_PATH := $(call my-dir)
 
 # Build/Package only in case of supported target
-ifeq ($(call is-board-platform-in-list,taro kalama), true)
+ifeq ($(call is-board-platform-in-list,taro kalama pineapple), true)
 
 BT_SELECT := CONFIG_MSM_BT_POWER=m
 #ifdef CONFIG_SLIMBUS
@@ -44,8 +44,6 @@ LOCAL_MODULE              := bt-kernel-module-symvers
 LOCAL_MODULE_STEM         := Module.symvers
 LOCAL_MODULE_KBUILD_NAME  := Module.symvers
 LOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
-LOCAL_REQUIRED_MODULES := wlan-platform-module-symvers
-LOCAL_ADDITIONAL_DEPENDENCIES += $(call intermediates-dir-for,DLKM,wlan-platform-module-symvers)/Module.symvers
 include $(DLKM_DIR)/Build_external_kernelmodule.mk
 
 # Below are for Android build system to recognize each module name, so

+ 0 - 3
Makefile

@@ -5,9 +5,6 @@ M=$(PWD)
 BT_ROOT=$(KERNEL_SRC)/$(M)
 
 KBUILD_OPTIONS+=  BT_ROOT=$(BT_ROOT)
-KBUILD_EXTRA_SYMBOLS=$(call intermediates-dir-for,DLKM,wlan-platform-module-symvers)/Module.symvers
-KBUILD_EXTRA_SYMBOLS=$(OUT_DIR)/vendor/qcom/wlan/platform/Module.symvers
-ccflags-y += -I$(BT_ROOT)/../wlan/platform/inc
 
 all:
 	$(MAKE) -C $(KERNEL_SRC) M=$(M) modules $(KBUILD_OPTIONS)

+ 0 - 1
include/btpower.h

@@ -74,7 +74,6 @@ struct btpower_platform_data {
 	struct mbox_client mbox_client_data;
 	struct mbox_chan *mbox_chan;
 	const char *vreg_ipa;
-	bool is_converged_dt;
 	int pdc_init_table_len;
 	const char **pdc_init_table;
 	int bt_device_type;

+ 0 - 1
pwr/Kconfig

@@ -3,7 +3,6 @@
 config MSM_BT_POWER
 	tristate "MSM Bluetooth Power Control"
 	depends on ARCH_QCOM
-	select CNSS_UTILS
 	help
 		MSM Bluetooth Power control driver.
 		This provides a parameter to switch on/off power from PMIC

+ 0 - 2
pwr/Makefile

@@ -1,4 +1,2 @@
 ccflags-y += -I$(BT_ROOT)/include
-ccflags-y += -I$(BT_ROOT)/../wlan/platform/inc
-ccflags-y += -I$(BT_ROOT)/../wlan/platform/cnss_utils
 obj-$(CONFIG_MSM_BT_POWER)  += btpower.o

+ 6 - 43
pwr/btpower.c

@@ -30,7 +30,6 @@
 #include "btfm_slim.h"
 #endif
 #include <linux/fs.h>
-#include "cnss_utils.h"
 
 #define PWR_SRC_NOT_AVAILABLE -2
 #define DEFAULT_INVALID_VALUE -1
@@ -77,6 +76,7 @@ enum power_src_pos {
 	BT_VDD_LDO,
 	BT_VDD_RFA_0p8,
 	BT_VDD_RFACMN,
+	BT_VDD_ANT_LDO,
 	// these indexes GPIOs/regs value are fetched during crash.
 	BT_RESET_GPIO_CURRENT,
 	BT_SW_CTRL_GPIO_CURRENT,
@@ -94,6 +94,7 @@ enum power_src_pos {
 	BT_VDD_RFACMN_CURRENT,
 	BT_VDD_IPA_2p2,
 	BT_VDD_IPA_2p2_CURRENT,
+	BT_VDD_ANT_LDO_CURRENT,
 	/* The below bucks are voted for HW WAR on some platform which supports
 	 * WNC39xx.
 	 */
@@ -142,6 +143,8 @@ static struct bt_power_vreg_data bt_vregs_info_qca6xx0[] = {
 // Regulator structure for kiwi BT SoC series
 static struct bt_power_vreg_data bt_vregs_info_kiwi[] = {
 	{NULL, "qcom,bt-vdd18-aon",      1800000, 1800000, 0, false, true,
+		{BT_VDD_LDO, BT_VDD_LDO_CURRENT}},
+	{NULL, "qcom,bt-vdd12-io",      1200000, 1200000, 0, false, true,
 		{BT_VDD_IO_LDO, BT_VDD_IO_LDO_CURRENT}},
 	{NULL, "qcom,bt-vdd-aon",     950000,  950000,  0, false, true,
 		{BT_VDD_AON_LDO, BT_VDD_AON_LDO_CURRENT}},
@@ -156,6 +159,8 @@ static struct bt_power_vreg_data bt_vregs_info_kiwi[] = {
 		{BT_VDD_RFA1_LDO, BT_VDD_RFA1_LDO_CURRENT}},
 	{NULL, "qcom,bt-vdd-rfa2",     1900000, 1900000, 0, false, true,
 		{BT_VDD_RFA2_LDO, BT_VDD_RFA2_LDO_CURRENT}},
+	{NULL, "qcom,bt-ant-ldo",  1776000, 1776000, 0, false, true,
+		{BT_VDD_ANT_LDO, BT_VDD_ANT_LDO_CURRENT}},
 };
 
 // Regulator structure for WCN399x BT SoC series
@@ -976,27 +981,11 @@ static void bt_power_vreg_put(void)
 static int bt_power_populate_dt_pinfo(struct platform_device *pdev)
 {
 	int rc;
-	struct device_node *child;
 	pr_debug("%s\n", __func__);
 
 	if (!bt_power_pdata)
 		return -ENOMEM;
 
-	if (bt_power_pdata->is_converged_dt) {
-		for_each_available_child_of_node(pdev->dev.of_node, child) {
-			if (bt_power_pdata->bt_device_type == CNSS_HSP_DEVICE_TYPE ) {
-				if (strcmp(child->name, "bt_qca6490"))
-					continue;
-				pr_info("%s: bt_qca6490 device node found", __func__);
-			} else if (bt_power_pdata->bt_device_type == CNSS_HMT_DEVICE_TYPE) {
-				if (strcmp(child->name, "bt_kiwi"))
-					continue;
-				pr_info("%s: bt_kiwi device node found", __func__);
-			}
-			pdev->dev.of_node = child;
-			break;
-		}
-	}
 	if (pdev->dev.of_node) {
 		rc = bt_power_vreg_get(pdev);
 		if (rc)
@@ -1062,11 +1051,6 @@ static int bt_power_populate_dt_pinfo(struct platform_device *pdev)
 	return 0;
 }
 
-static inline bool bt_is_converged_dt(struct platform_device *plat_dev)
-{
-	return of_property_read_bool(plat_dev->dev.of_node, "qcom,converged-dt");
-}
-
 static void bt_power_pdc_init_params (struct btpower_platform_data *pdata)
 {
 	int ret;
@@ -1090,7 +1074,6 @@ static void bt_power_pdc_init_params (struct btpower_platform_data *pdata)
 static int bt_power_probe(struct platform_device *pdev)
 {
 	int ret = 0;
-	unsigned int gpio_value;
 	int itr;
 
 	pr_debug("%s\n", __func__);
@@ -1108,26 +1091,6 @@ static int bt_power_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	bt_power_pdata->pdev = pdev;
-        bt_power_pdata->is_converged_dt = bt_is_converged_dt(pdev);
-	if (bt_power_pdata->is_converged_dt) {
-		if (of_find_property(pdev->dev.of_node, WLAN_SW_CTRL_GPIO, NULL)) {
-			bt_power_pdata->wlan_sw_ctrl_gpio =
-				of_get_named_gpio(pdev->dev.of_node, WLAN_SW_CTRL_GPIO,0);
-			pr_debug("WLAN Switch control GPIO: %d\n",
-					bt_power_pdata->wlan_sw_ctrl_gpio);
-		} else {
-			bt_power_pdata->wlan_sw_ctrl_gpio = -EINVAL;
-		}
-		gpio_value = gpio_get_value(bt_power_pdata->wlan_sw_ctrl_gpio);
-		pr_info("%s:WLAN_SW_CNTRL_GPIO value= %d\n", __func__, gpio_value);
-		if(gpio_value) {
-			bt_power_pdata->bt_device_type =
-				cnss_utils_update_device_type(CNSS_HSP_DEVICE_TYPE);
-		} else {
-			bt_power_pdata->bt_device_type =
-				cnss_utils_update_device_type(CNSS_HMT_DEVICE_TYPE);
-		}
-	}
 
 	if (pdev->dev.of_node) {
 		ret = bt_power_populate_dt_pinfo(pdev);

+ 2 - 1
rtc6226/radio-rtc6226-common.c

@@ -1309,7 +1309,8 @@ void rtc6226_rds_handler(struct work_struct *worker)
 	case RDS_TYPE_0A:
 		if (radio->bler[2] <= CORRECTED_THREE_TO_FIVE)
 			rtc6226_update_af_list(radio);
-		/*  fall through */
+		/* fall through */
+		fallthrough;
 	case RDS_TYPE_0B:
 		addr = (radio->block[1] & PS_MASK) * NO_OF_CHARS_IN_EACH_ADD;
 		FMDBG("%s RDS is PS\n", __func__);

+ 4 - 2
slimbus/btfm_slim_codec.c

@@ -259,7 +259,7 @@ static int btfm_slim_dai_set_channel_map(struct snd_soc_dai *dai,
 		 * get channel handler from slimbus driver
 		*/
 		rx_chs->ch = *(uint8_t *)(rx_slot + i);
-		BTFMSLIM_DBG("    %d\t%s\t%d\t%x\t%d\t%x", rx_chs->id,
+		BTFMSLIM_DBG("    %d\t%s\t%d\t%d\t", rx_chs->id,
 			rx_chs->name, rx_chs->port, rx_chs->ch);
 	}
 
@@ -270,7 +270,7 @@ static int btfm_slim_dai_set_channel_map(struct snd_soc_dai *dai,
 		 * get channel handler from slimbus driver
 		*/
 		tx_chs->ch = *(uint8_t *)(tx_slot + i);
-	BTFMSLIM_DBG("    %d\t%s\t%d\t%x\t%d\t%x", tx_chs->id,
+	BTFMSLIM_DBG("    %d\t%s\t%d\t%d\t", tx_chs->id,
 			tx_chs->name, tx_chs->port, tx_chs->ch);
 	}
 
@@ -291,6 +291,8 @@ static int btfm_slim_dai_get_channel_map(struct snd_soc_dai *dai,
 	switch (dai->id) {
 	case BTFM_FM_SLIM_TX:
 		num = 2;
+		/* fall through */
+		fallthrough;
 	case BTFM_BT_SCO_SLIM_TX:
 		if (!tx_slot || !tx_num) {
 			BTFMSLIM_ERR("Invalid tx_slot %p or tx_num %p",