BT: Check slimbus configuration enabled or not
Disable BTFM slimbus driver if core slimbus disabled. Change-Id: I6bcbe037181021d4449f345a81d257a2bc2deab6
This commit is contained in:
@@ -6,7 +6,9 @@ LOCAL_PATH := $(call my-dir)
|
|||||||
ifeq ($(call is-board-platform-in-list,taro kalama), true)
|
ifeq ($(call is-board-platform-in-list,taro kalama), true)
|
||||||
|
|
||||||
BT_SELECT := CONFIG_MSM_BT_POWER=m
|
BT_SELECT := CONFIG_MSM_BT_POWER=m
|
||||||
|
ifdef CONFIG_SLIMBUS
|
||||||
BT_SELECT += CONFIG_BTFM_SLIM=m
|
BT_SELECT += CONFIG_BTFM_SLIM=m
|
||||||
|
endif
|
||||||
BT_SELECT += CONFIG_I2C_RTC6226_QCA=m
|
BT_SELECT += CONFIG_I2C_RTC6226_QCA=m
|
||||||
|
|
||||||
LOCAL_PATH := $(call my-dir)
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
|||||||
@@ -82,7 +82,4 @@ int btpower_aop_mbox_init(struct btpower_platform_data *pdata);
|
|||||||
#define BT_CMD_GETVAL_POWER_SRCS 0xbfb1
|
#define BT_CMD_GETVAL_POWER_SRCS 0xbfb1
|
||||||
#define BT_CMD_SET_IPA_TCS_INFO 0xbfc0
|
#define BT_CMD_SET_IPA_TCS_INFO 0xbfc0
|
||||||
|
|
||||||
/* total number of power src */
|
|
||||||
#define BT_POWER_SRC_SIZE 28
|
|
||||||
|
|
||||||
#endif /* __LINUX_BLUETOOTH_POWER_H */
|
#endif /* __LINUX_BLUETOOTH_POWER_H */
|
||||||
|
|||||||
@@ -178,12 +178,6 @@ static struct bt_power bt_vreg_info_qca6174 = {
|
|||||||
.compatible = "qcom,qca6174",
|
.compatible = "qcom,qca6174",
|
||||||
.vregs = bt_vregs_info_qca61x4_937x,
|
.vregs = bt_vregs_info_qca61x4_937x,
|
||||||
.num_vregs = ARRAY_SIZE(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 = {
|
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),
|
.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 = {
|
static struct bt_power bt_vreg_info_wcn6750 = {
|
||||||
.compatible = "qcom,wcn6750-bt",
|
.compatible = "qcom,wcn6750-bt",
|
||||||
|
|||||||
@@ -25,16 +25,13 @@
|
|||||||
#define SLIM_MANF_ID_QCOM 0x217
|
#define SLIM_MANF_ID_QCOM 0x217
|
||||||
#define SLIM_PROD_CODE 0x221
|
#define SLIM_PROD_CODE 0x221
|
||||||
|
|
||||||
#ifdef CONFIG_SLIMBUS
|
|
||||||
static bool btfm_is_port_opening_delayed = true;
|
static bool btfm_is_port_opening_delayed = true;
|
||||||
static int btfm_num_ports_open;
|
static int btfm_num_ports_open;
|
||||||
#endif
|
|
||||||
|
|
||||||
int btfm_slim_write(struct btfmslim *btfmslim,
|
int btfm_slim_write(struct btfmslim *btfmslim,
|
||||||
uint16_t reg, uint8_t reg_val, uint8_t pgd)
|
uint16_t reg, uint8_t reg_val, uint8_t pgd)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
#ifdef CONFIG_SLIMBUS
|
|
||||||
uint32_t reg_addr;
|
uint32_t reg_addr;
|
||||||
int slim_write_tries = SLIM_SLAVE_RW_MAX_TRIES;
|
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",
|
BTFMSLIM_DBG("retrying to Write 0x%02x to reg 0x%x ret %d",
|
||||||
reg_val, reg_addr, ret);
|
reg_val, reg_addr, ret);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int btfm_slim_read(struct btfmslim *btfmslim, uint32_t reg, uint8_t pgd)
|
int btfm_slim_read(struct btfmslim *btfmslim, uint32_t reg, uint8_t pgd)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
#ifdef CONFIG_SLIMBUS
|
|
||||||
int slim_read_tries = SLIM_SLAVE_RW_MAX_TRIES;
|
int slim_read_tries = SLIM_SLAVE_RW_MAX_TRIES;
|
||||||
uint32_t reg_addr;
|
uint32_t reg_addr;
|
||||||
BTFMSLIM_DBG("Read from %s", pgd?"PGD":"IFD");
|
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;
|
break;
|
||||||
usleep_range(5000, 5100);
|
usleep_range(5000, 5100);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SLIMBUS
|
|
||||||
static bool btfm_slim_is_sb_reset_needed(int chip_ver)
|
static bool btfm_slim_is_sb_reset_needed(int chip_ver)
|
||||||
{
|
{
|
||||||
switch (chip_ver) {
|
switch (chip_ver) {
|
||||||
@@ -455,20 +448,17 @@ int btfm_slim_hw_deinit(struct btfmslim *btfmslim)
|
|||||||
mutex_unlock(&btfmslim->io_lock);
|
mutex_unlock(&btfmslim->io_lock);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static int btfm_slim_status(struct slim_device *sdev,
|
static int btfm_slim_status(struct slim_device *sdev,
|
||||||
enum slim_device_status status)
|
enum slim_device_status status)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
#ifdef CONFIG_SLIMBUS
|
|
||||||
struct device *dev = &sdev->dev;
|
struct device *dev = &sdev->dev;
|
||||||
struct btfmslim *btfm_slim;
|
struct btfmslim *btfm_slim;
|
||||||
btfm_slim = dev_get_drvdata(dev);
|
btfm_slim = dev_get_drvdata(dev);
|
||||||
ret = btfm_slim_register_codec(btfm_slim);
|
ret = btfm_slim_register_codec(btfm_slim);
|
||||||
if (ret)
|
if (ret)
|
||||||
BTFMSLIM_ERR("error, registering slimbus codec failed");
|
BTFMSLIM_ERR("error, registering slimbus codec failed");
|
||||||
#endif
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -562,8 +552,6 @@ static struct slim_driver btfm_slim_driver = {
|
|||||||
.id_table = btfm_slim_id
|
.id_table = btfm_slim_id
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_SLIMBUS
|
|
||||||
module_slim_driver(btfm_slim_driver);
|
module_slim_driver(btfm_slim_driver);
|
||||||
#endif
|
|
||||||
MODULE_LICENSE("GPL v2");
|
MODULE_LICENSE("GPL v2");
|
||||||
MODULE_DESCRIPTION("BTFM Slimbus Slave driver");
|
MODULE_DESCRIPTION("BTFM Slimbus Slave driver");
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
static int bt_soc_enable_status;
|
static int bt_soc_enable_status;
|
||||||
int btfm_feedback_ch_setting;
|
int btfm_feedback_ch_setting;
|
||||||
|
|
||||||
#ifdef CONFIG_SLIMBUS
|
|
||||||
static int btfm_slim_codec_write(struct snd_soc_component *codec,
|
static int btfm_slim_codec_write(struct snd_soc_component *codec,
|
||||||
unsigned int reg, unsigned int value)
|
unsigned int reg, unsigned int value)
|
||||||
{
|
{
|
||||||
@@ -458,7 +457,6 @@ void btfm_slim_unregister_codec(struct device *dev)
|
|||||||
/* Unregister Codec driver */
|
/* Unregister Codec driver */
|
||||||
snd_soc_unregister_component(dev);
|
snd_soc_unregister_component(dev);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
MODULE_DESCRIPTION("BTFM Slimbus Codec driver");
|
MODULE_DESCRIPTION("BTFM Slimbus Codec driver");
|
||||||
MODULE_LICENSE("GPL v2");
|
MODULE_LICENSE("GPL v2");
|
||||||
|
|||||||
Reference in New Issue
Block a user