@@ -8,3 +8,16 @@ menuconfig POWER_ASV
chip id info which depends on the chip 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 Supply Voltage.
+
+endif
@@ -1 +1,2 @@
obj-$(CONFIG_POWER_ASV) += asv.o
+obj-$(CONFIG_POWER_EXYNOS_ASV) += exynos-asv.o
new file mode 100644
@@ -0,0 +1,70 @@
+/* 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 = devm_kzalloc(&pdev->dev, sizeof(*exynos_asv_info),
+ 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__);
+ return -ENODEV;
+ }
+
+ base = of_iomap(chip_id, 0);
+ if (!base) {
+ dev_err(&pdev->dev, "unable to map chip_id register\n");
+ 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);
+
+ 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("Exynos ASV driver");
+MODULE_LICENSE("GPL");
new file mode 100644
@@ -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 */