mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
memory: tegra30-emc: Add the SoC model prefix to functions
Replace "tegra_emc" with "tegra30_emc" in all functions to: 1. Avoid name clashing with other Tegra EMC drivers which makes it easier to jump to function definitions, 2. Decode the calltraces a bit easier, 3. Unify with other Tegra MC and EMC drivers, which use the SoC model prefixes. No functional impact. Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
This commit is contained in:
@@ -413,7 +413,7 @@ static int emc_seq_update_timing(struct tegra_emc *emc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static irqreturn_t tegra_emc_isr(int irq, void *data)
|
||||
static irqreturn_t tegra30_emc_isr(int irq, void *data)
|
||||
{
|
||||
struct tegra_emc *emc = data;
|
||||
u32 intmask = EMC_REFRESH_OVERFLOW_INT;
|
||||
@@ -1228,7 +1228,7 @@ static long emc_round_rate(unsigned long rate,
|
||||
return timing->rate;
|
||||
}
|
||||
|
||||
static void tegra_emc_rate_requests_init(struct tegra_emc *emc)
|
||||
static void tegra30_emc_rate_requests_init(struct tegra_emc *emc)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
@@ -1330,7 +1330,7 @@ static int emc_set_max_rate(struct tegra_emc *emc, unsigned long rate,
|
||||
* valid range.
|
||||
*/
|
||||
|
||||
static bool tegra_emc_validate_rate(struct tegra_emc *emc, unsigned long rate)
|
||||
static bool tegra30_emc_validate_rate(struct tegra_emc *emc, unsigned long rate)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
@@ -1341,7 +1341,7 @@ static bool tegra_emc_validate_rate(struct tegra_emc *emc, unsigned long rate)
|
||||
return false;
|
||||
}
|
||||
|
||||
static int tegra_emc_debug_available_rates_show(struct seq_file *s, void *data)
|
||||
static int tegra30_emc_debug_available_rates_show(struct seq_file *s, void *data)
|
||||
{
|
||||
struct tegra_emc *emc = s->private;
|
||||
const char *prefix = "";
|
||||
@@ -1356,9 +1356,9 @@ static int tegra_emc_debug_available_rates_show(struct seq_file *s, void *data)
|
||||
|
||||
return 0;
|
||||
}
|
||||
DEFINE_SHOW_ATTRIBUTE(tegra_emc_debug_available_rates);
|
||||
DEFINE_SHOW_ATTRIBUTE(tegra30_emc_debug_available_rates);
|
||||
|
||||
static int tegra_emc_debug_min_rate_get(void *data, u64 *rate)
|
||||
static int tegra30_emc_debug_min_rate_get(void *data, u64 *rate)
|
||||
{
|
||||
struct tegra_emc *emc = data;
|
||||
|
||||
@@ -1367,12 +1367,12 @@ static int tegra_emc_debug_min_rate_get(void *data, u64 *rate)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int tegra_emc_debug_min_rate_set(void *data, u64 rate)
|
||||
static int tegra30_emc_debug_min_rate_set(void *data, u64 rate)
|
||||
{
|
||||
struct tegra_emc *emc = data;
|
||||
int err;
|
||||
|
||||
if (!tegra_emc_validate_rate(emc, rate))
|
||||
if (!tegra30_emc_validate_rate(emc, rate))
|
||||
return -EINVAL;
|
||||
|
||||
err = emc_set_min_rate(emc, rate, EMC_RATE_DEBUG);
|
||||
@@ -1384,11 +1384,11 @@ static int tegra_emc_debug_min_rate_set(void *data, u64 rate)
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_DEBUGFS_ATTRIBUTE(tegra_emc_debug_min_rate_fops,
|
||||
tegra_emc_debug_min_rate_get,
|
||||
tegra_emc_debug_min_rate_set, "%llu\n");
|
||||
DEFINE_DEBUGFS_ATTRIBUTE(tegra30_emc_debug_min_rate_fops,
|
||||
tegra30_emc_debug_min_rate_get,
|
||||
tegra30_emc_debug_min_rate_set, "%llu\n");
|
||||
|
||||
static int tegra_emc_debug_max_rate_get(void *data, u64 *rate)
|
||||
static int tegra30_emc_debug_max_rate_get(void *data, u64 *rate)
|
||||
{
|
||||
struct tegra_emc *emc = data;
|
||||
|
||||
@@ -1397,12 +1397,12 @@ static int tegra_emc_debug_max_rate_get(void *data, u64 *rate)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int tegra_emc_debug_max_rate_set(void *data, u64 rate)
|
||||
static int tegra30_emc_debug_max_rate_set(void *data, u64 rate)
|
||||
{
|
||||
struct tegra_emc *emc = data;
|
||||
int err;
|
||||
|
||||
if (!tegra_emc_validate_rate(emc, rate))
|
||||
if (!tegra30_emc_validate_rate(emc, rate))
|
||||
return -EINVAL;
|
||||
|
||||
err = emc_set_max_rate(emc, rate, EMC_RATE_DEBUG);
|
||||
@@ -1414,11 +1414,11 @@ static int tegra_emc_debug_max_rate_set(void *data, u64 rate)
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_DEBUGFS_ATTRIBUTE(tegra_emc_debug_max_rate_fops,
|
||||
tegra_emc_debug_max_rate_get,
|
||||
tegra_emc_debug_max_rate_set, "%llu\n");
|
||||
DEFINE_DEBUGFS_ATTRIBUTE(tegra30_emc_debug_max_rate_fops,
|
||||
tegra30_emc_debug_max_rate_get,
|
||||
tegra30_emc_debug_max_rate_set, "%llu\n");
|
||||
|
||||
static void tegra_emc_debugfs_init(struct tegra_emc *emc)
|
||||
static void tegra30_emc_debugfs_init(struct tegra_emc *emc)
|
||||
{
|
||||
struct device *dev = emc->dev;
|
||||
unsigned int i;
|
||||
@@ -1451,11 +1451,11 @@ static void tegra_emc_debugfs_init(struct tegra_emc *emc)
|
||||
emc->debugfs.root = debugfs_create_dir("emc", NULL);
|
||||
|
||||
debugfs_create_file("available_rates", 0444, emc->debugfs.root,
|
||||
emc, &tegra_emc_debug_available_rates_fops);
|
||||
emc, &tegra30_emc_debug_available_rates_fops);
|
||||
debugfs_create_file("min_rate", 0644, emc->debugfs.root,
|
||||
emc, &tegra_emc_debug_min_rate_fops);
|
||||
emc, &tegra30_emc_debug_min_rate_fops);
|
||||
debugfs_create_file("max_rate", 0644, emc->debugfs.root,
|
||||
emc, &tegra_emc_debug_max_rate_fops);
|
||||
emc, &tegra30_emc_debug_max_rate_fops);
|
||||
}
|
||||
|
||||
static inline struct tegra_emc *
|
||||
@@ -1518,7 +1518,7 @@ static int emc_icc_set(struct icc_node *src, struct icc_node *dst)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int tegra_emc_interconnect_init(struct tegra_emc *emc)
|
||||
static int tegra30_emc_interconnect_init(struct tegra_emc *emc)
|
||||
{
|
||||
const struct tegra_mc_soc *soc = emc->mc->soc;
|
||||
struct icc_node *node;
|
||||
@@ -1567,25 +1567,25 @@ remove_nodes:
|
||||
return dev_err_probe(emc->dev, err, "failed to initialize ICC\n");
|
||||
}
|
||||
|
||||
static void devm_tegra_emc_unset_callback(void *data)
|
||||
static void devm_tegra30_emc_unset_callback(void *data)
|
||||
{
|
||||
tegra20_clk_set_emc_round_callback(NULL, NULL);
|
||||
}
|
||||
|
||||
static void devm_tegra_emc_unreg_clk_notifier(void *data)
|
||||
static void devm_tegra30_emc_unreg_clk_notifier(void *data)
|
||||
{
|
||||
struct tegra_emc *emc = data;
|
||||
|
||||
clk_notifier_unregister(emc->clk, &emc->clk_nb);
|
||||
}
|
||||
|
||||
static int tegra_emc_init_clk(struct tegra_emc *emc)
|
||||
static int tegra30_emc_init_clk(struct tegra_emc *emc)
|
||||
{
|
||||
int err;
|
||||
|
||||
tegra20_clk_set_emc_round_callback(emc_round_rate, emc);
|
||||
|
||||
err = devm_add_action_or_reset(emc->dev, devm_tegra_emc_unset_callback,
|
||||
err = devm_add_action_or_reset(emc->dev, devm_tegra30_emc_unset_callback,
|
||||
NULL);
|
||||
if (err)
|
||||
return err;
|
||||
@@ -1600,14 +1600,14 @@ static int tegra_emc_init_clk(struct tegra_emc *emc)
|
||||
return dev_err_probe(emc->dev, err, "failed to register clk notifier\n");
|
||||
|
||||
err = devm_add_action_or_reset(emc->dev,
|
||||
devm_tegra_emc_unreg_clk_notifier, emc);
|
||||
devm_tegra30_emc_unreg_clk_notifier, emc);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int tegra_emc_probe(struct platform_device *pdev)
|
||||
static int tegra30_emc_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct tegra_core_opp_params opp_params = {};
|
||||
struct device_node *np;
|
||||
@@ -1648,12 +1648,12 @@ static int tegra_emc_probe(struct platform_device *pdev)
|
||||
|
||||
emc->irq = err;
|
||||
|
||||
err = devm_request_irq(&pdev->dev, emc->irq, tegra_emc_isr, 0,
|
||||
err = devm_request_irq(&pdev->dev, emc->irq, tegra30_emc_isr, 0,
|
||||
dev_name(&pdev->dev), emc);
|
||||
if (err)
|
||||
return dev_err_probe(&pdev->dev, err, "failed to request irq\n");
|
||||
|
||||
err = tegra_emc_init_clk(emc);
|
||||
err = tegra30_emc_init_clk(emc);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -1664,9 +1664,9 @@ static int tegra_emc_probe(struct platform_device *pdev)
|
||||
return err;
|
||||
|
||||
platform_set_drvdata(pdev, emc);
|
||||
tegra_emc_rate_requests_init(emc);
|
||||
tegra_emc_debugfs_init(emc);
|
||||
tegra_emc_interconnect_init(emc);
|
||||
tegra30_emc_rate_requests_init(emc);
|
||||
tegra30_emc_debugfs_init(emc);
|
||||
tegra30_emc_interconnect_init(emc);
|
||||
|
||||
/*
|
||||
* Don't allow the kernel module to be unloaded. Unloading adds some
|
||||
@@ -1678,7 +1678,7 @@ static int tegra_emc_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int tegra_emc_suspend(struct device *dev)
|
||||
static int tegra30_emc_suspend(struct device *dev)
|
||||
{
|
||||
struct tegra_emc *emc = dev_get_drvdata(dev);
|
||||
int err;
|
||||
@@ -1699,7 +1699,7 @@ static int tegra_emc_suspend(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int tegra_emc_resume(struct device *dev)
|
||||
static int tegra30_emc_resume(struct device *dev)
|
||||
{
|
||||
struct tegra_emc *emc = dev_get_drvdata(dev);
|
||||
|
||||
@@ -1711,28 +1711,28 @@ static int tegra_emc_resume(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops tegra_emc_pm_ops = {
|
||||
.suspend = tegra_emc_suspend,
|
||||
.resume = tegra_emc_resume,
|
||||
static const struct dev_pm_ops tegra30_emc_pm_ops = {
|
||||
.suspend = tegra30_emc_suspend,
|
||||
.resume = tegra30_emc_resume,
|
||||
};
|
||||
|
||||
static const struct of_device_id tegra_emc_of_match[] = {
|
||||
static const struct of_device_id tegra30_emc_of_match[] = {
|
||||
{ .compatible = "nvidia,tegra30-emc", },
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, tegra_emc_of_match);
|
||||
MODULE_DEVICE_TABLE(of, tegra30_emc_of_match);
|
||||
|
||||
static struct platform_driver tegra_emc_driver = {
|
||||
.probe = tegra_emc_probe,
|
||||
static struct platform_driver tegra30_emc_driver = {
|
||||
.probe = tegra30_emc_probe,
|
||||
.driver = {
|
||||
.name = "tegra30-emc",
|
||||
.of_match_table = tegra_emc_of_match,
|
||||
.pm = &tegra_emc_pm_ops,
|
||||
.of_match_table = tegra30_emc_of_match,
|
||||
.pm = &tegra30_emc_pm_ops,
|
||||
.suppress_bind_attrs = true,
|
||||
.sync_state = icc_sync_state,
|
||||
},
|
||||
};
|
||||
module_platform_driver(tegra_emc_driver);
|
||||
module_platform_driver(tegra30_emc_driver);
|
||||
|
||||
MODULE_AUTHOR("Dmitry Osipenko <digetx@gmail.com>");
|
||||
MODULE_DESCRIPTION("NVIDIA Tegra30 EMC driver");
|
||||
|
||||
Reference in New Issue
Block a user