mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
Merge "soc: qcom: proxy_consumer: Add support for amba_driver"
This commit is contained in:
commit
7bac0bc013
3 changed files with 462 additions and 281 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -21,6 +21,8 @@
|
|||
alloc_skb_with_frags
|
||||
alloc_workqueue
|
||||
amba_bustype
|
||||
amba_driver_register
|
||||
amba_driver_unregister
|
||||
anon_inode_getfile
|
||||
arch_bpf_jit_check_func
|
||||
__arch_clear_user
|
||||
|
|
|
|||
|
|
@ -6,6 +6,14 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/amba/bus.h>
|
||||
|
||||
#define QCOM_PROXY_CONSUMER_AMBA_ID(pid) \
|
||||
{ \
|
||||
.id = pid, \
|
||||
.mask = 0x000fffff, \
|
||||
}
|
||||
|
||||
/*
|
||||
* of_match table that contains a list of compatible strings for the
|
||||
|
|
@ -15,6 +23,24 @@
|
|||
static const struct of_device_id qcom_proxy_of_consumer_match[] = {
|
||||
#if !IS_ENABLED(CONFIG_SERIAL_MSM_GENI_CONSOLE)
|
||||
{ .compatible = "qcom,msm-geni-console"},
|
||||
#endif
|
||||
#if !IS_ENABLED(CONFIG_MSM_JTAGV8)
|
||||
{ .compatible = "qcom,jtagv8-mm"},
|
||||
#endif
|
||||
{}
|
||||
};
|
||||
|
||||
static const struct amba_id qcom_proxy_amba_of_consumer_match[] = {
|
||||
#if !IS_ENABLED(CONFIG_CORESIGHT_SOURCE_ETM4X)
|
||||
QCOM_PROXY_CONSUMER_AMBA_ID(0x000bb95d), /* Cortex-A53 */
|
||||
QCOM_PROXY_CONSUMER_AMBA_ID(0x000bb95e), /* Cortex-A57 */
|
||||
QCOM_PROXY_CONSUMER_AMBA_ID(0x000bb95a), /* Cortex-A72 */
|
||||
QCOM_PROXY_CONSUMER_AMBA_ID(0x000bb959), /* Cortex-A73 */
|
||||
QCOM_PROXY_CONSUMER_AMBA_ID(0x000bb9da), /* Cortex-A35 */
|
||||
QCOM_PROXY_CONSUMER_AMBA_ID(0x000f0205), /* QCOM Kryo */
|
||||
QCOM_PROXY_CONSUMER_AMBA_ID(0x000f0211), /* QCOM Kryo */
|
||||
QCOM_PROXY_CONSUMER_AMBA_ID(0x000bb802), /* QCOM Kryo 385 Cortex-A55 */
|
||||
QCOM_PROXY_CONSUMER_AMBA_ID(0x000bb803), /* QCOM Kryo 385 Cortex-A75 */
|
||||
#endif
|
||||
{}
|
||||
};
|
||||
|
|
@ -25,6 +51,21 @@ static int qcom_proxy_of_consumer_probe(struct platform_device *pdev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int qcom_proxy_amba_of_consumer_probe(struct amba_device *adev,
|
||||
const struct amba_id *id)
|
||||
{
|
||||
dev_dbg(&adev->dev, "Proxy probing\n");
|
||||
|
||||
/* Before calling this probe, the amba framework votes for the clk
|
||||
* by default. It removes the vote only during the runtime suspend
|
||||
* of the device. Hence, explicilty decrement the usage count of
|
||||
* the device for the suspend to happen.
|
||||
*/
|
||||
pm_runtime_put(&adev->dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver qcom_proxy_of_consumer_driver = {
|
||||
.probe = qcom_proxy_of_consumer_probe,
|
||||
.driver = {
|
||||
|
|
@ -33,7 +74,41 @@ static struct platform_driver qcom_proxy_of_consumer_driver = {
|
|||
},
|
||||
};
|
||||
|
||||
module_platform_driver(qcom_proxy_of_consumer_driver);
|
||||
static struct amba_driver qcom_proxy_amba_of_consumer_driver = {
|
||||
.probe = qcom_proxy_amba_of_consumer_probe,
|
||||
.id_table = qcom_proxy_amba_of_consumer_match,
|
||||
.drv = {
|
||||
.name = "qcom_proxy_amba_of_consumer",
|
||||
},
|
||||
};
|
||||
|
||||
static int __init qcom_proxy_of_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = platform_driver_register(&qcom_proxy_of_consumer_driver);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = amba_driver_register(&qcom_proxy_amba_of_consumer_driver);
|
||||
if (ret < 0)
|
||||
goto amba_fail;
|
||||
|
||||
return 0;
|
||||
|
||||
amba_fail:
|
||||
platform_driver_unregister(&qcom_proxy_of_consumer_driver);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void __exit qcom_proxy_of_exit(void)
|
||||
{
|
||||
amba_driver_unregister(&qcom_proxy_amba_of_consumer_driver);
|
||||
platform_driver_unregister(&qcom_proxy_of_consumer_driver);
|
||||
}
|
||||
|
||||
module_init(qcom_proxy_of_init);
|
||||
module_exit(qcom_proxy_of_exit);
|
||||
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_DESCRIPTION("Qualcomm Technologies, of proxy consumer driver");
|
||||
|
|
|
|||
Loading…
Reference in a new issue