Re: [PATCH] soc: samsung: pmu: split up SoC specific PMU data
From: jonghwa3 . lee
Date: Wed Dec 03 2014 - 00:34:32 EST
On 2014ë 12ì 01ì 01:16, Pankaj Dubey wrote:
> This patch splits up exynos-pmu.c file, and moves PMU configuration data
> and functions handing those data into SoC specific PMU files, keeping
> driver structure and common functionality into exynos-pmu.c.
> At the same time it also separates compilation of these different SoC PMU files
> based on CONFIG_ARM64 and CONFIG_ARM. This way we can reduce overhead of ARM64
> SoC's PMU getting compiled when kernel is built for ARM and vice-versa.
> This patch also removes .owner field from exynos-pmu.c as it's redundant for
> drivers calling platform_driver_register to register platform_driver.
> Signed-off-by: Pankaj Dubey <pankaj.dubey@xxxxxxxxxxx>
> This patch is prepared on top of kgene/for-next and following patch  from
> Amit Daniel.
> : http://www.spinics.net/lists/linux-samsung-soc/msg39797.html
> This patch tries to address some of concerns raised for using exynos-pmu.c for
> ARM and ARM64 based SoC at these threads , .
> : http://www.spinics.net/lists/linux-samsung-soc/msg39809.html
> : https://lkml.org/lkml/2014/11/24/322
> Since Exynos SoC's has similar PMU IP, and already existing bindings can be
> used, it makes sense to keep single driver for both ARM and ARM64 based SoCs.
> All common functionalties are in exynos-pmu.c whereas SoC specific data and
> handling are moved into SoC specific exynosNNNN-pmu files.
> All changes are compiled tested only. Any improvements/suggestions are most
> drivers/soc/samsung/Makefile | 9 +-
> drivers/soc/samsung/exynos-pmu.c | 1293 +---------------------------------
> drivers/soc/samsung/exynos-pmu.h | 63 ++
> drivers/soc/samsung/exynos3250-pmu.c | 176 +++++
> drivers/soc/samsung/exynos4-pmu.c | 223 ++++++
> drivers/soc/samsung/exynos5250-pmu.c | 196 ++++++
> drivers/soc/samsung/exynos5420-pmu.c | 298 ++++++++
> drivers/soc/samsung/exynos7-pmu.c | 441 ++++++++++++
> 8 files changed, 1412 insertions(+), 1287 deletions(-)
> create mode 100644 drivers/soc/samsung/exynos-pmu.h
> create mode 100644 drivers/soc/samsung/exynos3250-pmu.c
> create mode 100644 drivers/soc/samsung/exynos4-pmu.c
> create mode 100644 drivers/soc/samsung/exynos5250-pmu.c
> create mode 100644 drivers/soc/samsung/exynos5420-pmu.c
> create mode 100644 drivers/soc/samsung/exynos7-pmu.c
> diff --git a/drivers/soc/samsung/exynos-pmu.h b/drivers/soc/samsung/exynos-pmu.h
> new file mode 100644
> index 0000000..4adc5a3
> --- /dev/null
> +++ b/drivers/soc/samsung/exynos-pmu.h
> @@ -0,0 +1,63 @@
> + * Copyright (c) 2014 Samsung Electronics Co., Ltd.
> + * http://www.samsung.com
> + *
> + * Header for EXYNOS PMU Driver 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.
> + */
> +#ifndef __EXYNOSPMU_H
> +#define __EXYNOSPMU_H
> +#include <linux/io.h>
> +#define PMU_TABLE_END (-1U)
> +static void __iomem *pmu_base_addr;
AFAIK, static variable in header file can't be used globally. It would be placed
in exynos-pmu.c or elsewhere and then only extern declaration is allowed here.
If I'm wrong, please let me know.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/