Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d38f7ef authored by Sameer Thalappil's avatar Sameer Thalappil
Browse files

cnss: Add support for platform capability API



WLAN driver uses the platform capability API to query and then configure
platform specific information.

CRs-Fixed: 655470
Change-Id: Id12474c6e12ed49775ec26d24d667305d6ce2ed8
Signed-off-by: default avatarSameer Thalappil <sameert@codeaurora.org>
parent d8f87b5d
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ static struct cnss_data {
	void *subsys_handle;
	struct esoc_desc *esoc_desc;
	bool notify_modem_status;
	struct cnss_platform_cap cap;
} *penv;


@@ -283,6 +284,7 @@ static int cnss_wlan_get_resources(struct platform_device *pdev)
			pr_err("%s: vreg initial vote failed\n", __func__);
			goto err_reg_enable2;
		}
		penv->cap.cap_flag |= CNSS_HAS_EXTERNAL_SWREG;
	}

	vreg_info->state = VREG_ON;
@@ -1276,6 +1278,19 @@ int cnss_request_bus_bandwidth(int bandwidth)
}
EXPORT_SYMBOL(cnss_request_bus_bandwidth);

int cnss_get_platform_cap(struct cnss_platform_cap *cap)
{
	if (!penv)
		return -ENODEV;

	if (cap)
		*cap = penv->cap;

	return 0;

}
EXPORT_SYMBOL(cnss_get_platform_cap);

module_init(cnss_initialize);
module_exit(cnss_exit);

+10 −0
Original line number Diff line number Diff line
@@ -49,6 +49,15 @@ struct cnss_wlan_driver {
	const struct pci_device_id *id_table;
};

/* platform capabilities */
enum cnss_platform_cap_flag {
	CNSS_HAS_EXTERNAL_SWREG = 0x01,
};

struct cnss_platform_cap {
	u32 cap_flag;
};

extern void cnss_device_crashed(void);
extern void cnss_device_self_recovery(void);
extern int cnss_get_ramdump_mem(unsigned long *address, unsigned long *size);
@@ -71,5 +80,6 @@ extern void cnss_pm_wake_lock_destroy(struct wakeup_source *ws);
extern int cnss_set_cpus_allowed_ptr(struct task_struct *task, ulong cpu);
extern void cnss_request_pm_qos(u32 qos_val);
extern void cnss_remove_pm_qos(void);
extern int cnss_get_platform_cap(struct cnss_platform_cap *cap);

#endif /* _NET_CNSS_H_ */