浏览代码

BT: Check slimbus configuration enabled or not

Disable BTFM slimbus driver if core slimbus disabled.

Change-Id: I6bcbe037181021d4449f345a81d257a2bc2deab6
satish kumar sugasi 3 年之前
父节点
当前提交
1d6e351ae8
共有 5 个文件被更改,包括 8 次插入23 次删除
  1. 2 0
      Android.mk
  2. 0 3
      include/btpower.h
  3. 6 6
      pwr/btpower.c
  4. 0 12
      slimbus/btfm_slim.c
  5. 0 2
      slimbus/btfm_slim_codec.c

+ 2 - 0
Android.mk

@@ -6,7 +6,9 @@ LOCAL_PATH := $(call my-dir)
 ifeq ($(call is-board-platform-in-list,taro kalama), true)
 
 BT_SELECT := CONFIG_MSM_BT_POWER=m
+ifdef CONFIG_SLIMBUS
 BT_SELECT += CONFIG_BTFM_SLIM=m
+endif
 BT_SELECT += CONFIG_I2C_RTC6226_QCA=m
 
 LOCAL_PATH := $(call my-dir)

+ 0 - 3
include/btpower.h

@@ -82,7 +82,4 @@ int btpower_aop_mbox_init(struct btpower_platform_data *pdata);
 #define BT_CMD_GETVAL_POWER_SRCS	0xbfb1
 #define BT_CMD_SET_IPA_TCS_INFO  0xbfc0
 
-/* total number of power src */
-#define BT_POWER_SRC_SIZE           28
-
 #endif /* __LINUX_BLUETOOTH_POWER_H */

+ 6 - 6
pwr/btpower.c

@@ -178,12 +178,6 @@ static struct bt_power bt_vreg_info_qca6174 = {
 	.compatible = "qcom,qca6174",
 	.vregs = bt_vregs_info_qca61x4_937x,
 	.num_vregs = ARRAY_SIZE(bt_vregs_info_qca61x4_937x),
-
-
-static struct bt_power bt_vreg_info_kiwi = {
-	.compatible = "qcom,kiwi",
-	.vregs = bt_vregs_info_kiwi,
-	.num_vregs = ARRAY_SIZE(bt_vregs_info_kiwi),
 };
 
 static struct bt_power bt_vreg_info_qca6390 = {
@@ -198,6 +192,12 @@ static struct bt_power bt_vreg_info_qca6490 = {
 	.num_vregs = ARRAY_SIZE(bt_vregs_info_qca6xx0),
 };
 
+static struct bt_power bt_vreg_info_kiwi = {
+	.compatible = "qcom,kiwi",
+	.vregs = bt_vregs_info_kiwi,
+	.num_vregs = ARRAY_SIZE(bt_vregs_info_kiwi),
+};
+
 
 static struct bt_power bt_vreg_info_wcn6750 = {
 	.compatible = "qcom,wcn6750-bt",

+ 0 - 12
slimbus/btfm_slim.c

@@ -25,16 +25,13 @@
 #define SLIM_MANF_ID_QCOM	0x217
 #define SLIM_PROD_CODE		0x221
 
-#ifdef CONFIG_SLIMBUS
 static bool btfm_is_port_opening_delayed = true;
 static int btfm_num_ports_open;
-#endif
 
 int btfm_slim_write(struct btfmslim *btfmslim,
 		uint16_t reg, uint8_t reg_val, uint8_t pgd)
 {
 	int ret = -1;
-#ifdef CONFIG_SLIMBUS
 	uint32_t reg_addr;
 	int slim_write_tries = SLIM_SLAVE_RW_MAX_TRIES;
 
@@ -60,14 +57,12 @@ int btfm_slim_write(struct btfmslim *btfmslim,
 		BTFMSLIM_DBG("retrying to Write 0x%02x to reg 0x%x ret %d",
 				reg_val, reg_addr, ret);
 	}
-#endif
 	return ret;
 }
 
 int btfm_slim_read(struct btfmslim *btfmslim, uint32_t reg, uint8_t pgd)
 {
 	int ret = -1;
-#ifdef CONFIG_SLIMBUS
 	int slim_read_tries = SLIM_SLAVE_RW_MAX_TRIES;
 	uint32_t reg_addr;
 	BTFMSLIM_DBG("Read from %s", pgd?"PGD":"IFD");
@@ -84,11 +79,9 @@ int btfm_slim_read(struct btfmslim *btfmslim, uint32_t reg, uint8_t pgd)
 			break;
 		usleep_range(5000, 5100);
 	}
-#endif
 	return ret;
 }
 
-#ifdef CONFIG_SLIMBUS
 static bool btfm_slim_is_sb_reset_needed(int chip_ver)
 {
 	switch (chip_ver) {
@@ -455,20 +448,17 @@ int btfm_slim_hw_deinit(struct btfmslim *btfmslim)
 	mutex_unlock(&btfmslim->io_lock);
 	return ret;
 }
-#endif
 
 static int btfm_slim_status(struct slim_device *sdev,
 				enum slim_device_status status)
 {
 	int ret = 0;
-#ifdef CONFIG_SLIMBUS
 	struct device *dev = &sdev->dev;
 	struct btfmslim *btfm_slim;
 	btfm_slim = dev_get_drvdata(dev);
 	ret = btfm_slim_register_codec(btfm_slim);
 	if (ret)
 		BTFMSLIM_ERR("error, registering slimbus codec failed");
-#endif
 	return ret;
 }
 
@@ -562,8 +552,6 @@ static struct slim_driver btfm_slim_driver = {
 	.id_table = btfm_slim_id
 };
 
-#ifdef CONFIG_SLIMBUS
 module_slim_driver(btfm_slim_driver);
-#endif
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("BTFM Slimbus Slave driver");

+ 0 - 2
slimbus/btfm_slim_codec.c

@@ -25,7 +25,6 @@
 static int bt_soc_enable_status;
 int btfm_feedback_ch_setting;
 
-#ifdef CONFIG_SLIMBUS
 static int btfm_slim_codec_write(struct snd_soc_component *codec,
 			unsigned int reg, unsigned int value)
 {
@@ -458,7 +457,6 @@ void btfm_slim_unregister_codec(struct device *dev)
 	/* Unregister Codec driver */
 	snd_soc_unregister_component(dev);
 }
-#endif
 
 MODULE_DESCRIPTION("BTFM Slimbus Codec driver");
 MODULE_LICENSE("GPL v2");