cregit-Linux how code gets into the kernel

Release 4.14 drivers/soc/samsung/exynos-pmu.c

/*
 * Copyright (c) 2011-2014 Samsung Electronics Co., Ltd.
 *              http://www.samsung.com/
 *
 * EXYNOS - CPU PMU(Power Management Unit) support
 *
 * 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/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/mfd/syscon.h>
#include <linux/platform_device.h>
#include <linux/delay.h>

#include <linux/soc/samsung/exynos-regs-pmu.h>
#include <linux/soc/samsung/exynos-pmu.h>

#include "exynos-pmu.h"


struct exynos_pmu_context {
	
struct device *dev;
	
const struct exynos_pmu_data *pmu_data;
};


void __iomem *pmu_base_addr;

static struct exynos_pmu_context *pmu_context;


void pmu_raw_writel(u32 val, u32 offset) { writel_relaxed(val, pmu_base_addr + offset); }

Contributors

PersonTokensPropCommitsCommitProp
Pankaj Dubey1260.00%150.00%
Abhilash Kesavan840.00%150.00%
Total20100.00%2100.00%


u32 pmu_raw_readl(u32 offset) { return readl_relaxed(pmu_base_addr + offset); }

Contributors

PersonTokensPropCommitsCommitProp
Pankaj Dubey1381.25%150.00%
Abhilash Kesavan318.75%150.00%
Total16100.00%2100.00%


void exynos_sys_powerdown_conf(enum sys_powerdown mode) { unsigned int i; const struct exynos_pmu_data *pmu_data; if (!pmu_context || !pmu_context->pmu_data) return; pmu_data = pmu_context->pmu_data; if (pmu_data->powerdown_conf) pmu_data->powerdown_conf(mode); if (pmu_data->pmu_config) { for (i = 0; (pmu_data->pmu_config[i].offset != PMU_TABLE_END); i++) pmu_raw_writel(pmu_data->pmu_config[i].val[mode], pmu_data->pmu_config[i].offset); } if (pmu_data->powerdown_conf_extra) pmu_data->powerdown_conf_extra(mode); if (pmu_data->pmu_config_extra) { for (i = 0; pmu_data->pmu_config_extra[i].offset != PMU_TABLE_END; i++) pmu_raw_writel(pmu_data->pmu_config_extra[i].val[mode], pmu_data->pmu_config_extra[i].offset); } }

Contributors

PersonTokensPropCommitsCommitProp
Pankaj Dubey5130.36%330.00%
Inderpal Singh3722.02%110.00%
Abhilash Kesavan2615.48%110.00%
Jongpill Lee2213.10%220.00%
Jaecheol Lee148.33%110.00%
Bartlomiej Zolnierkiewicz137.74%110.00%
Marek Szyprowski52.98%110.00%
Total168100.00%10100.00%

/* * Split the data between ARM architectures because it is relatively big * and useless on other arch. */ #ifdef CONFIG_EXYNOS_PMU_ARM_DRIVERS #define exynos_pmu_data_arm_ptr(data) (&data) #else #define exynos_pmu_data_arm_ptr(data) NULL #endif /* * PMU platform driver and devicetree bindings. */ static const struct of_device_id exynos_pmu_of_device_ids[] = { { .compatible = "samsung,exynos3250-pmu", .data = exynos_pmu_data_arm_ptr(exynos3250_pmu_data), }, { .compatible = "samsung,exynos4210-pmu", .data = exynos_pmu_data_arm_ptr(exynos4210_pmu_data), }, { .compatible = "samsung,exynos4212-pmu", .data = exynos_pmu_data_arm_ptr(exynos4212_pmu_data), }, { .compatible = "samsung,exynos4412-pmu", .data = exynos_pmu_data_arm_ptr(exynos4412_pmu_data), }, { .compatible = "samsung,exynos5250-pmu", .data = exynos_pmu_data_arm_ptr(exynos5250_pmu_data), }, { .compatible = "samsung,exynos5420-pmu", .data = exynos_pmu_data_arm_ptr(exynos5420_pmu_data), }, { .compatible = "samsung,exynos5433-pmu", }, { /*sentinel*/ }, };
struct regmap *exynos_get_pmu_regmap(void) { struct device_node *np = of_find_matching_node(NULL, exynos_pmu_of_device_ids); if (np) return syscon_node_to_regmap(np); return ERR_PTR(-ENODEV); }

Contributors

PersonTokensPropCommitsCommitProp
Marek Szyprowski38100.00%1100.00%
Total38100.00%1100.00%

EXPORT_SYMBOL_GPL(exynos_get_pmu_regmap);
static int exynos_pmu_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct resource *res; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); pmu_base_addr = devm_ioremap_resource(dev, res); if (IS_ERR(pmu_base_addr)) return PTR_ERR(pmu_base_addr); pmu_context = devm_kzalloc(&pdev->dev, sizeof(struct exynos_pmu_context), GFP_KERNEL); if (!pmu_context) return -ENOMEM; pmu_context->dev = dev; pmu_context->pmu_data = of_device_get_match_data(dev); if (pmu_context->pmu_data && pmu_context->pmu_data->pmu_init) pmu_context->pmu_data->pmu_init(); platform_set_drvdata(pdev, pmu_context); dev_dbg(dev, "Exynos PMU Driver probe done\n"); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Pankaj Dubey12188.32%116.67%
Marek Szyprowski85.84%233.33%
Jongpill Lee75.11%233.33%
Jaecheol Lee10.73%116.67%
Total137100.00%6100.00%

static struct platform_driver exynos_pmu_driver = { .driver = { .name = "exynos-pmu", .of_match_table = exynos_pmu_of_device_ids, }, .probe = exynos_pmu_probe, };
static int __init exynos_pmu_init(void) { return platform_driver_register(&exynos_pmu_driver); }

Contributors

PersonTokensPropCommitsCommitProp
Pankaj Dubey16100.00%1100.00%
Total16100.00%1100.00%

postcore_initcall(exynos_pmu_init);

Overall Contributors

PersonTokensPropCommitsCommitProp
Pankaj Dubey34054.84%736.84%
Marek Szyprowski6911.13%315.79%
Abhilash Kesavan558.87%15.26%
Krzysztof Kozlowski406.45%15.26%
Inderpal Singh375.97%15.26%
Jongpill Lee335.32%315.79%
Bartlomiej Zolnierkiewicz254.03%15.26%
Jaecheol Lee193.06%15.26%
Kukjin Kim20.32%15.26%
Total620100.00%19100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.