rtw88: pci: enable CLKREQ function if host supports it
authorYan-Hsuan Chuang <yhchuang@realtek.com>
Mon, 18 Nov 2019 09:54:31 +0000 (17:54 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 20 Nov 2019 07:44:50 +0000 (09:44 +0200)
commitd2e2c47e65af7310ad7d40ebf4cbb1d898719ec2
treedf82f35cd7703b6198ff52497f86aeeef2cdb778
parentff3297f62fff6fc90d35051eec48913dbd9cbb18
rtw88: pci: enable CLKREQ function if host supports it

By Realtek's design, there are two HW modules associated for CLKREQ,
one is responsible to follow the PCIE host settings, and another
is to actually working on it. But the module that is actually working
on it is default disabled, and driver should enable that module if
host and device have successfully sync'ed with each other.

The module is default disabled because sometimes the host does not
support it, and if there is any incorrect settings (ex. CLKREQ# is
not Bi-Direction), device can be lost and disconnected to the host.

So driver should first check after host and device are sync'ed, and
the host does support the function and set it in configuration
space, then driver can turn on the HW module to working on it.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtw88/pci.c
drivers/net/wireless/realtek/rtw88/pci.h