mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
Merge "cnss2: Add support to download hds.bin file to firmware"
This commit is contained in:
commit
c0751da608
3 changed files with 36 additions and 0 deletions
|
|
@ -436,6 +436,8 @@ static int cnss_fw_mem_ready_hdlr(struct cnss_plat_data *plat_priv)
|
|||
if (ret)
|
||||
goto out;
|
||||
|
||||
if (plat_priv->hds_enabled)
|
||||
cnss_wlfw_bdf_dnld_send_sync(plat_priv, CNSS_BDF_HDS);
|
||||
cnss_wlfw_bdf_dnld_send_sync(plat_priv, CNSS_BDF_REGDB);
|
||||
|
||||
if (plat_priv->device_id == QCN7605_DEVICE_ID)
|
||||
|
|
@ -2648,6 +2650,32 @@ static int cnss_register_bus_scale(struct cnss_plat_data *plat_priv)
|
|||
static void cnss_unregister_bus_scale(struct cnss_plat_data *plat_priv) {}
|
||||
#endif /* CONFIG_INTERCONNECT */
|
||||
|
||||
static ssize_t enable_hds_store(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct cnss_plat_data *plat_priv = dev_get_drvdata(dev);
|
||||
unsigned int enable_hds = 0;
|
||||
|
||||
if (!plat_priv)
|
||||
return -ENODEV;
|
||||
|
||||
if (sscanf(buf, "%du", &enable_hds) != 1) {
|
||||
cnss_pr_err("Invalid enable_hds sysfs command\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (enable_hds)
|
||||
plat_priv->hds_enabled = true;
|
||||
else
|
||||
plat_priv->hds_enabled = false;
|
||||
|
||||
cnss_pr_dbg("%s HDS file download, count is %zu\n",
|
||||
plat_priv->hds_enabled ? "Enable" : "Disable", count);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t recovery_store(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
|
|
@ -2791,6 +2819,7 @@ static ssize_t hw_trace_override_store(struct device *dev,
|
|||
static DEVICE_ATTR_WO(fs_ready);
|
||||
static DEVICE_ATTR_WO(shutdown);
|
||||
static DEVICE_ATTR_WO(recovery);
|
||||
static DEVICE_ATTR_WO(enable_hds);
|
||||
static DEVICE_ATTR_WO(qdss_trace_start);
|
||||
static DEVICE_ATTR_WO(qdss_trace_stop);
|
||||
static DEVICE_ATTR_WO(qdss_conf_download);
|
||||
|
|
@ -2800,6 +2829,7 @@ static struct attribute *cnss_attrs[] = {
|
|||
&dev_attr_fs_ready.attr,
|
||||
&dev_attr_shutdown.attr,
|
||||
&dev_attr_recovery.attr,
|
||||
&dev_attr_enable_hds.attr,
|
||||
&dev_attr_qdss_trace_start.attr,
|
||||
&dev_attr_qdss_trace_stop.attr,
|
||||
&dev_attr_qdss_conf_download.attr,
|
||||
|
|
|
|||
|
|
@ -344,6 +344,7 @@ enum cnss_bdf_type {
|
|||
CNSS_BDF_BIN,
|
||||
CNSS_BDF_ELF,
|
||||
CNSS_BDF_REGDB = 4,
|
||||
CNSS_BDF_HDS = 6,
|
||||
};
|
||||
|
||||
enum cnss_cal_status {
|
||||
|
|
@ -436,6 +437,7 @@ struct cnss_plat_data {
|
|||
enum cnss_driver_status driver_status;
|
||||
u32 recovery_count;
|
||||
u8 recovery_enabled;
|
||||
u8 hds_enabled;
|
||||
unsigned long driver_state;
|
||||
struct list_head event_list;
|
||||
spinlock_t event_lock; /* spinlock for driver work event handling */
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#define BIN_BDF_FILE_NAME_PREFIX "bdwlan.b"
|
||||
#define BIN_BDF_FILE_NAME_GF_PREFIX "bdwlang.b"
|
||||
#define REGDB_FILE_NAME "regdb.bin"
|
||||
#define HDS_FILE_NAME "hds.bin"
|
||||
#define CHIP_ID_GF_MASK 0x10
|
||||
|
||||
#define QDSS_TRACE_CONFIG_FILE "qdss_trace_config"
|
||||
|
|
@ -560,6 +561,9 @@ static int cnss_get_bdf_file_name(struct cnss_plat_data *plat_priv,
|
|||
case CNSS_BDF_REGDB:
|
||||
snprintf(filename_tmp, filename_len, REGDB_FILE_NAME);
|
||||
break;
|
||||
case CNSS_BDF_HDS:
|
||||
snprintf(filename_tmp, filename_len, HDS_FILE_NAME);
|
||||
break;
|
||||
default:
|
||||
cnss_pr_err("Invalid BDF type: %d\n",
|
||||
plat_priv->ctrl_params.bdf_type);
|
||||
|
|
|
|||
Loading…
Reference in a new issue