2018-05-03 21:26:20 +08:00
|
|
|
/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2017 BayLibre, SAS
|
|
|
|
* Author: Neil Armstrong <narmstrong@baylibre.com>
|
|
|
|
*
|
|
|
|
* Copyright (c) 2018 Amlogic, inc.
|
|
|
|
* Author: Qiufang Dai <qiufang.dai@amlogic.com>
|
|
|
|
* Author: Yixun Lan <yixun.lan@amlogic.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MESON_AOCLK_H__
|
|
|
|
#define __MESON_AOCLK_H__
|
|
|
|
|
clk: meson: rework and clean drivers dependencies
Initially, the meson clock directory only hosted 2 controllers drivers,
for meson8 and gxbb. At the time, both used the same set of clock drivers
so managing the dependencies was not a big concern.
Since this ancient time, entropy did its job, controllers with different
requirement and specific clock drivers have been added. Unfortunately, we
did not do a great job at managing the dependencies between the
controllers and the different clock drivers. Some drivers, such as
clk-phase or vid-pll-div, are compiled even if they are useless on the
target (meson8). As we are adding new controllers, we need to be able to
pick a driver w/o pulling the whole thing.
The patch aims to clean things up by:
* providing a dedicated CONFIG_ for each clock drivers
* allowing clock drivers to be compiled as a modules, if possible
* stating explicitly which drivers are required by each controller.
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lkml.kernel.org/r/20190201125841.26785-5-jbrunet@baylibre.com
2019-02-01 20:58:41 +08:00
|
|
|
#include <linux/clk-provider.h>
|
2018-05-03 21:26:20 +08:00
|
|
|
#include <linux/platform_device.h>
|
clk: meson: rework and clean drivers dependencies
Initially, the meson clock directory only hosted 2 controllers drivers,
for meson8 and gxbb. At the time, both used the same set of clock drivers
so managing the dependencies was not a big concern.
Since this ancient time, entropy did its job, controllers with different
requirement and specific clock drivers have been added. Unfortunately, we
did not do a great job at managing the dependencies between the
controllers and the different clock drivers. Some drivers, such as
clk-phase or vid-pll-div, are compiled even if they are useless on the
target (meson8). As we are adding new controllers, we need to be able to
pick a driver w/o pulling the whole thing.
The patch aims to clean things up by:
* providing a dedicated CONFIG_ for each clock drivers
* allowing clock drivers to be compiled as a modules, if possible
* stating explicitly which drivers are required by each controller.
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lkml.kernel.org/r/20190201125841.26785-5-jbrunet@baylibre.com
2019-02-01 20:58:41 +08:00
|
|
|
#include <linux/regmap.h>
|
2018-05-03 21:26:20 +08:00
|
|
|
#include <linux/reset-controller.h>
|
clk: meson: rework and clean drivers dependencies
Initially, the meson clock directory only hosted 2 controllers drivers,
for meson8 and gxbb. At the time, both used the same set of clock drivers
so managing the dependencies was not a big concern.
Since this ancient time, entropy did its job, controllers with different
requirement and specific clock drivers have been added. Unfortunately, we
did not do a great job at managing the dependencies between the
controllers and the different clock drivers. Some drivers, such as
clk-phase or vid-pll-div, are compiled even if they are useless on the
target (meson8). As we are adding new controllers, we need to be able to
pick a driver w/o pulling the whole thing.
The patch aims to clean things up by:
* providing a dedicated CONFIG_ for each clock drivers
* allowing clock drivers to be compiled as a modules, if possible
* stating explicitly which drivers are required by each controller.
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lkml.kernel.org/r/20190201125841.26785-5-jbrunet@baylibre.com
2019-02-01 20:58:41 +08:00
|
|
|
|
|
|
|
#include "clk-regmap.h"
|
2019-01-17 01:54:35 +08:00
|
|
|
|
2018-05-03 21:26:20 +08:00
|
|
|
struct meson_aoclk_data {
|
|
|
|
const unsigned int reset_reg;
|
|
|
|
const int num_reset;
|
|
|
|
const unsigned int *reset;
|
2019-01-17 01:54:35 +08:00
|
|
|
const int num_clks;
|
2018-05-03 21:26:20 +08:00
|
|
|
struct clk_regmap **clks;
|
|
|
|
const struct clk_hw_onecell_data *hw_data;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct meson_aoclk_reset_controller {
|
|
|
|
struct reset_controller_dev reset;
|
|
|
|
const struct meson_aoclk_data *data;
|
|
|
|
struct regmap *regmap;
|
|
|
|
};
|
|
|
|
|
|
|
|
int meson_aoclkc_probe(struct platform_device *pdev);
|
|
|
|
#endif
|