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

Commit 7bac0bc0 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: qcom: proxy_consumer: Add support for amba_driver"

parents f4e98f0c 74672e6b
Loading
Loading
Loading
Loading
+384 −280

File changed.

Preview size limit exceeded, changes collapsed.

+2 −0
Original line number Diff line number Diff line
@@ -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
+76 −1
Original line number Diff line number Diff line
@@ -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");