From: Yadwinder Singh Brar <yadi.brar@samsung.com>
To: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org,
"Rafael J. Wysocki" <rjw@sisk.pl>,
Viresh Kumar <viresh.kumar@linaro.org>,
MyungJoo Ham <myungjoo.ham@samsung.com>,
Kukjin Kim <kgene.kim@samsung.com>,
Thomas Abraham <thomas.abraham@linaro.org>,
Tomasz Figa <t.figa@samsung.com>,
Yadwinder Singh Brar <yadi.brar@samsung.com>
Subject: [RFC 2/4] power: asv: Add a common asv driver for exynos SoCs.
Date: Wed, 11 Sep 2013 16:44:06 +0530 [thread overview]
Message-ID: <1378898048-25205-3-git-send-email-yadi.brar@samsung.com> (raw)
In-Reply-To: <1378898048-25205-1-git-send-email-yadi.brar@samsung.com>
This patch adds a common platform driver to register ASV members for exynos
SoCs.
Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
---
drivers/power/asv/Kconfig | 13 +++++++
drivers/power/asv/Makefile | 1 +
drivers/power/asv/exynos-asv.c | 72 ++++++++++++++++++++++++++++++++++++++++
drivers/power/asv/exynos-asv.h | 21 +++++++++++
4 files changed, 107 insertions(+), 0 deletions(-)
create mode 100644 drivers/power/asv/exynos-asv.c
create mode 100644 drivers/power/asv/exynos-asv.h
diff --git a/drivers/power/asv/Kconfig b/drivers/power/asv/Kconfig
index 7cd84bd..6104b09 100644
--- a/drivers/power/asv/Kconfig
+++ b/drivers/power/asv/Kconfig
@@ -9,3 +9,16 @@ menuconfig POWER_ASV
manufacturing process.
Say Y here to enable Adaptive Supply voltage support.
+
+if POWER_ASV
+
+config POWER_EXYNOS_ASV
+ bool "Adaptive Supply Voltage for Exynos"
+ help
+ Exynos supports ASV depending upon the ASV group fused on chip.
+ Users can request ASV specific to a frequency for a particular member
+ from corresponding DVFS driver.
+
+ Say Y here to enable Exynos Adaptive Voltage Scaling.
+
+endif
diff --git a/drivers/power/asv/Makefile b/drivers/power/asv/Makefile
index 62921da..9a94868 100644
--- a/drivers/power/asv/Makefile
+++ b/drivers/power/asv/Makefile
@@ -1 +1,2 @@
obj-$(CONFIG_POWER_ASV) += asv.o
+obj-$(CONFIG_POWER_EXYNOS_ASV) += exynos-asv.o
diff --git a/drivers/power/asv/exynos-asv.c b/drivers/power/asv/exynos-asv.c
new file mode 100644
index 0000000..d3f43a4
--- /dev/null
+++ b/drivers/power/asv/exynos-asv.c
@@ -0,0 +1,72 @@
+/* Common Exynos ASV(Adaptive Supply Voltage) driver
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+#include <linux/of_address.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/power/asv-driver.h>
+#include "exynos-asv.h"
+
+static int exynos_asv_probe(struct platform_device *pdev)
+{
+ struct device_node *chip_id;
+ struct exynos_asv_common *exynos_asv_info;
+ void __iomem *base;
+ int ret = 0;
+
+ exynos_asv_info = kzalloc(sizeof(struct exynos_asv_common), GFP_KERNEL);
+ if (!exynos_asv_info)
+ return -ENOMEM;
+
+ chip_id = of_find_compatible_node(NULL, NULL,
+ "samsung,exynos4210-chipid");
+ if (!chip_id) {
+ pr_err("%s: unable to find chipid\n", __func__);
+ ret = -ENODEV;
+ goto err_node;
+ }
+
+ base = of_iomap(chip_id, 0);
+ if (!base) {
+ pr_err("%s: unable to map chip_id register\n", __func__);
+ ret = -ENOMEM;
+ goto err_map;
+ }
+
+ exynos_asv_info->base = base;
+
+ /* call SoC specific intialisation routine */
+
+ register_asv_member(exynos_asv_info->asv_list, exynos_asv_info->nr_mem);
+
+ iounmap(base);
+err_map:
+ of_node_put(chip_id);
+err_node:
+ kfree(exynos_asv_info);
+
+ return ret;
+}
+
+static struct platform_driver exynos_asv_platdrv = {
+ .driver = {
+ .name = "exynos-asv",
+ .owner = THIS_MODULE,
+ },
+ .probe = exynos_asv_probe,
+};
+module_platform_driver(exynos_asv_platdrv);
+
+MODULE_AUTHOR("Yadwinder Singh Brar<yadi.brar@samsung.com>");
+MODULE_DESCRIPTION("Common Exynos ASV driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/power/asv/exynos-asv.h b/drivers/power/asv/exynos-asv.h
new file mode 100644
index 0000000..89a1ae8
--- /dev/null
+++ b/drivers/power/asv/exynos-asv.h
@@ -0,0 +1,21 @@
+/*
+ * Exynos - Adaptive Supply Voltage Driver Header File
+ *
+ * copyright (c) 2013 samsung electronics co., ltd.
+ * http://www.samsung.com/
+ *
+ * this program is free software; you can redistribute it and/or modify
+ * it under the terms of the gnu general public license version 2 as
+ * published by the free software foundation.
+*/
+
+#ifndef __EXYNOS_ASV_D_H
+#define __EXYNOS_ASV_D_H __FILE__
+
+struct exynos_asv_common {
+ struct asv_info *asv_list;
+ unsigned int nr_mem;
+ void __iomem *base;
+};
+
+#endif /* __EXYNOS_ASV_D_H */
--
1.7.0.4
next prev parent reply other threads:[~2013-09-11 11:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-11 11:14 [RFC 0/4] Add basic support for ASV Yadwinder Singh Brar
2013-09-11 11:14 ` [RFC 1/4] power: asv: Add common ASV support for samsung SoCs Yadwinder Singh Brar
2013-09-11 11:14 ` Yadwinder Singh Brar [this message]
2013-09-11 11:14 ` [RFC 3/4] power: asv: Add support for exynos5250 Yadwinder Singh Brar
2013-09-11 11:14 ` [RFC 4/4] arm: exynos5: Register static platform device for ASV Yadwinder Singh Brar
2013-11-11 14:27 ` [RFC 0/4] Add basic support " Yadwinder Singh Brar
2013-11-13 2:33 ` MyungJoo Ham
2013-11-14 14:06 ` Yadwinder Singh Brar
2013-11-14 15:06 ` Tomasz Figa
2013-11-14 23:15 ` Yadwinder Singh Brar
2013-11-15 0:03 ` Tomasz Figa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1378898048-25205-3-git-send-email-yadi.brar@samsung.com \
--to=yadi.brar@samsung.com \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=rjw@sisk.pl \
--cc=t.figa@samsung.com \
--cc=thomas.abraham@linaro.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®