power: domain: mediatek: prefix internal identifiers with mtk_
Prefix internal functions, variables, and struct tags with the mtk_ prefix to avoid namespace collisions. Signed-off-by: Julien Stephan <jstephan@baylibre.com> Link: https://patch.msgid.link/20260709-mt8188-add-power-domain-v2-6-589ace7d30e2@baylibre.com Signed-off-by: David Lechner <dlechner@baylibre.com>
This commit is contained in:
committed by
David Lechner
parent
89e39800f5
commit
f68a654213
@@ -61,10 +61,10 @@
|
||||
|
||||
#define DCM_TOP_EN BIT(0)
|
||||
|
||||
struct scp_domain;
|
||||
struct mtk_scp_domain;
|
||||
|
||||
struct scp_domain_data {
|
||||
struct scp_domain *scpd;
|
||||
struct mtk_scp_domain_data {
|
||||
struct mtk_scp_domain *scpd;
|
||||
u32 sta_mask;
|
||||
int ctl_offs;
|
||||
u32 sram_pdn_bits;
|
||||
@@ -72,13 +72,13 @@ struct scp_domain_data {
|
||||
u32 bus_prot_mask;
|
||||
};
|
||||
|
||||
struct scp_domain {
|
||||
struct mtk_scp_domain {
|
||||
void __iomem *base;
|
||||
void __iomem *infracfg;
|
||||
struct scp_domain_data *data;
|
||||
struct mtk_scp_domain_data *data;
|
||||
};
|
||||
|
||||
static struct scp_domain_data scp_domain_mt2701[] = {
|
||||
static struct mtk_scp_domain_data scp_domain_mt2701[] = {
|
||||
[MT2701_POWER_DOMAIN_CONN] = {
|
||||
.sta_mask = PWR_STATUS_CONN,
|
||||
.ctl_offs = SPM_CONN_PWR_CON,
|
||||
@@ -131,7 +131,7 @@ static struct scp_domain_data scp_domain_mt2701[] = {
|
||||
},
|
||||
};
|
||||
|
||||
static struct scp_domain_data scp_domain_mt7622[] = {
|
||||
static struct mtk_scp_domain_data scp_domain_mt7622[] = {
|
||||
[MT7622_POWER_DOMAIN_ETHSYS] = {
|
||||
.sta_mask = PWR_STATUS_ETHSYS,
|
||||
.ctl_offs = SPM_ETHSYS_PWR_CON,
|
||||
@@ -182,9 +182,9 @@ static int mtk_infracfg_clear_bus_protection(void __iomem *infracfg,
|
||||
!(val & mask), 100);
|
||||
}
|
||||
|
||||
static int scpsys_domain_is_on(struct scp_domain_data *data)
|
||||
static int mtk_scpsys_domain_is_on(struct mtk_scp_domain_data *data)
|
||||
{
|
||||
struct scp_domain *scpd = data->scpd;
|
||||
struct mtk_scp_domain *scpd = data->scpd;
|
||||
u32 sta = readl(scpd->base + SPM_PWR_STATUS) &
|
||||
data->sta_mask;
|
||||
u32 sta2 = readl(scpd->base + SPM_PWR_STATUS_2ND) &
|
||||
@@ -202,10 +202,10 @@ static int scpsys_domain_is_on(struct scp_domain_data *data)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int scpsys_power_on(struct power_domain *power_domain)
|
||||
static int mtk_scpsys_power_on(struct power_domain *power_domain)
|
||||
{
|
||||
struct scp_domain *scpd = dev_get_priv(power_domain->dev);
|
||||
struct scp_domain_data *data = &scpd->data[power_domain->id];
|
||||
struct mtk_scp_domain *scpd = dev_get_priv(power_domain->dev);
|
||||
struct mtk_scp_domain_data *data = &scpd->data[power_domain->id];
|
||||
void __iomem *ctl_addr = scpd->base + data->ctl_offs;
|
||||
u32 pdn_ack = data->sram_pdn_ack_bits;
|
||||
u32 val;
|
||||
@@ -220,7 +220,7 @@ static int scpsys_power_on(struct power_domain *power_domain)
|
||||
val |= PWR_ON_2ND_BIT;
|
||||
writel(val, ctl_addr);
|
||||
|
||||
ret = readx_poll_timeout(scpsys_domain_is_on, data, tmp, tmp > 0,
|
||||
ret = readx_poll_timeout(mtk_scpsys_domain_is_on, data, tmp, tmp > 0,
|
||||
100);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@@ -251,10 +251,10 @@ static int scpsys_power_on(struct power_domain *power_domain)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int scpsys_power_off(struct power_domain *power_domain)
|
||||
static int mtk_scpsys_power_off(struct power_domain *power_domain)
|
||||
{
|
||||
struct scp_domain *scpd = dev_get_priv(power_domain->dev);
|
||||
struct scp_domain_data *data = &scpd->data[power_domain->id];
|
||||
struct mtk_scp_domain *scpd = dev_get_priv(power_domain->dev);
|
||||
struct mtk_scp_domain_data *data = &scpd->data[power_domain->id];
|
||||
void __iomem *ctl_addr = scpd->base + data->ctl_offs;
|
||||
u32 pdn_ack = data->sram_pdn_ack_bits;
|
||||
u32 val;
|
||||
@@ -291,17 +291,17 @@ static int scpsys_power_off(struct power_domain *power_domain)
|
||||
val &= ~PWR_ON_2ND_BIT;
|
||||
writel(val, ctl_addr);
|
||||
|
||||
ret = readx_poll_timeout(scpsys_domain_is_on, data, tmp, !tmp, 100);
|
||||
ret = readx_poll_timeout(mtk_scpsys_domain_is_on, data, tmp, !tmp, 100);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int scpsys_power_request(struct power_domain *power_domain)
|
||||
static int mtk_scpsys_power_request(struct power_domain *power_domain)
|
||||
{
|
||||
struct scp_domain *scpd = dev_get_priv(power_domain->dev);
|
||||
struct scp_domain_data *data;
|
||||
struct mtk_scp_domain *scpd = dev_get_priv(power_domain->dev);
|
||||
struct mtk_scp_domain_data *data;
|
||||
|
||||
data = &scpd->data[power_domain->id];
|
||||
data->scpd = scpd;
|
||||
@@ -312,7 +312,7 @@ static int scpsys_power_request(struct power_domain *power_domain)
|
||||
static int mtk_power_domain_probe(struct udevice *dev)
|
||||
{
|
||||
struct ofnode_phandle_args args;
|
||||
struct scp_domain *scpd = dev_get_priv(dev);
|
||||
struct mtk_scp_domain *scpd = dev_get_priv(dev);
|
||||
struct regmap *regmap;
|
||||
struct clk_bulk bulk;
|
||||
int err;
|
||||
@@ -321,7 +321,7 @@ static int mtk_power_domain_probe(struct udevice *dev)
|
||||
if (!scpd->base)
|
||||
return -ENOENT;
|
||||
|
||||
scpd->data = (struct scp_domain_data *)dev_get_driver_data(dev);
|
||||
scpd->data = (struct mtk_scp_domain_data *)dev_get_driver_data(dev);
|
||||
|
||||
/* get corresponding syscon phandle */
|
||||
err = dev_read_phandle_with_args(dev, "infracfg", NULL, 0, 0, &args);
|
||||
@@ -363,9 +363,9 @@ static const struct udevice_id mtk_power_domain_ids[] = {
|
||||
};
|
||||
|
||||
static const struct power_domain_ops mtk_power_domain_ops = {
|
||||
.off = scpsys_power_off,
|
||||
.on = scpsys_power_on,
|
||||
.request = scpsys_power_request,
|
||||
.off = mtk_scpsys_power_off,
|
||||
.on = mtk_scpsys_power_on,
|
||||
.request = mtk_scpsys_power_request,
|
||||
};
|
||||
|
||||
U_BOOT_DRIVER(mtk_power_domain) = {
|
||||
@@ -374,5 +374,5 @@ U_BOOT_DRIVER(mtk_power_domain) = {
|
||||
.ops = &mtk_power_domain_ops,
|
||||
.probe = mtk_power_domain_probe,
|
||||
.of_match = mtk_power_domain_ids,
|
||||
.priv_auto = sizeof(struct scp_domain),
|
||||
.priv_auto = sizeof(struct mtk_scp_domain),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user