cnss2: Provide platform name if it is required
Provide platform name in host_cap message if property platform-name-required specified in DTS. Current platform name is same as device's model name. Change-id: I8d427602bfc7e6bb5d732fa3e29ff66c965e153b CRs-Fixed: 3540641
This commit is contained in:
29
cnss2/main.c
29
cnss2/main.c
@@ -467,6 +467,35 @@ int cnss_get_feature_list(struct cnss_plat_data *plat_priv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t cnss_get_platform_name(struct cnss_plat_data *plat_priv,
|
||||
char *buf, const size_t buf_len)
|
||||
{
|
||||
if (unlikely(!plat_priv || !buf || !buf_len))
|
||||
return 0;
|
||||
|
||||
if (of_property_read_bool(plat_priv->plat_dev->dev.of_node,
|
||||
"platform-name-required")) {
|
||||
struct device_node *root;
|
||||
|
||||
root = of_find_node_by_path("/");
|
||||
if (root) {
|
||||
const char *model;
|
||||
size_t model_len;
|
||||
|
||||
model = of_get_property(root, "model", NULL);
|
||||
if (model) {
|
||||
model_len = strlcpy(buf, model, buf_len);
|
||||
cnss_pr_dbg("Platform name: %s (%zu)\n",
|
||||
buf, model_len);
|
||||
|
||||
return model_len;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cnss_pm_stay_awake(struct cnss_plat_data *plat_priv)
|
||||
{
|
||||
if (atomic_inc_return(&plat_priv->pm_count) != 1)
|
||||
|
Reference in New Issue
Block a user