Merge tag 'amlogic-drivers-for-v5.14' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/drivers
Amlogic Drivers updates for v5.14: - soc: amlogic: meson-ee-pwrc: Rename "get_power" to "is_powered_off" * tag 'amlogic-drivers-for-v5.14' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: soc: amlogic: meson-ee-pwrc: Rename "get_power" to "is_powered_off" Link: https://lore.kernel.org/r/58283600-2d9a-c259-4d80-6915e6e6c79e@baylibre.com Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
@ -68,7 +68,7 @@ struct meson_ee_pwrc_domain_desc {
|
|||||||
struct meson_ee_pwrc_top_domain *top_pd;
|
struct meson_ee_pwrc_top_domain *top_pd;
|
||||||
unsigned int mem_pd_count;
|
unsigned int mem_pd_count;
|
||||||
struct meson_ee_pwrc_mem_domain *mem_pd;
|
struct meson_ee_pwrc_mem_domain *mem_pd;
|
||||||
bool (*get_power)(struct meson_ee_pwrc_domain *pwrc_domain);
|
bool (*is_powered_off)(struct meson_ee_pwrc_domain *pwrc_domain);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct meson_ee_pwrc_domain_data {
|
struct meson_ee_pwrc_domain_data {
|
||||||
@ -217,7 +217,7 @@ static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_audio[] = {
|
|||||||
{ HHI_AUDIO_MEM_PD_REG0, GENMASK(27, 26) },
|
{ HHI_AUDIO_MEM_PD_REG0, GENMASK(27, 26) },
|
||||||
};
|
};
|
||||||
|
|
||||||
#define VPU_PD(__name, __top_pd, __mem, __get_power, __resets, __clks) \
|
#define VPU_PD(__name, __top_pd, __mem, __is_pwr_off, __resets, __clks) \
|
||||||
{ \
|
{ \
|
||||||
.name = __name, \
|
.name = __name, \
|
||||||
.reset_names_count = __resets, \
|
.reset_names_count = __resets, \
|
||||||
@ -225,46 +225,46 @@ static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_audio[] = {
|
|||||||
.top_pd = __top_pd, \
|
.top_pd = __top_pd, \
|
||||||
.mem_pd_count = ARRAY_SIZE(__mem), \
|
.mem_pd_count = ARRAY_SIZE(__mem), \
|
||||||
.mem_pd = __mem, \
|
.mem_pd = __mem, \
|
||||||
.get_power = __get_power, \
|
.is_powered_off = __is_pwr_off, \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TOP_PD(__name, __top_pd, __mem, __get_power) \
|
#define TOP_PD(__name, __top_pd, __mem, __is_pwr_off) \
|
||||||
{ \
|
{ \
|
||||||
.name = __name, \
|
.name = __name, \
|
||||||
.top_pd = __top_pd, \
|
.top_pd = __top_pd, \
|
||||||
.mem_pd_count = ARRAY_SIZE(__mem), \
|
.mem_pd_count = ARRAY_SIZE(__mem), \
|
||||||
.mem_pd = __mem, \
|
.mem_pd = __mem, \
|
||||||
.get_power = __get_power, \
|
.is_powered_off = __is_pwr_off, \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MEM_PD(__name, __mem) \
|
#define MEM_PD(__name, __mem) \
|
||||||
TOP_PD(__name, NULL, __mem, NULL)
|
TOP_PD(__name, NULL, __mem, NULL)
|
||||||
|
|
||||||
static bool pwrc_ee_get_power(struct meson_ee_pwrc_domain *pwrc_domain);
|
static bool pwrc_ee_is_powered_off(struct meson_ee_pwrc_domain *pwrc_domain);
|
||||||
|
|
||||||
static struct meson_ee_pwrc_domain_desc axg_pwrc_domains[] = {
|
static struct meson_ee_pwrc_domain_desc axg_pwrc_domains[] = {
|
||||||
[PWRC_AXG_VPU_ID] = VPU_PD("VPU", &gx_pwrc_vpu, axg_pwrc_mem_vpu,
|
[PWRC_AXG_VPU_ID] = VPU_PD("VPU", &gx_pwrc_vpu, axg_pwrc_mem_vpu,
|
||||||
pwrc_ee_get_power, 5, 2),
|
pwrc_ee_is_powered_off, 5, 2),
|
||||||
[PWRC_AXG_ETHERNET_MEM_ID] = MEM_PD("ETH", meson_pwrc_mem_eth),
|
[PWRC_AXG_ETHERNET_MEM_ID] = MEM_PD("ETH", meson_pwrc_mem_eth),
|
||||||
[PWRC_AXG_AUDIO_ID] = MEM_PD("AUDIO", axg_pwrc_mem_audio),
|
[PWRC_AXG_AUDIO_ID] = MEM_PD("AUDIO", axg_pwrc_mem_audio),
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct meson_ee_pwrc_domain_desc g12a_pwrc_domains[] = {
|
static struct meson_ee_pwrc_domain_desc g12a_pwrc_domains[] = {
|
||||||
[PWRC_G12A_VPU_ID] = VPU_PD("VPU", &gx_pwrc_vpu, g12a_pwrc_mem_vpu,
|
[PWRC_G12A_VPU_ID] = VPU_PD("VPU", &gx_pwrc_vpu, g12a_pwrc_mem_vpu,
|
||||||
pwrc_ee_get_power, 11, 2),
|
pwrc_ee_is_powered_off, 11, 2),
|
||||||
[PWRC_G12A_ETH_ID] = MEM_PD("ETH", meson_pwrc_mem_eth),
|
[PWRC_G12A_ETH_ID] = MEM_PD("ETH", meson_pwrc_mem_eth),
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct meson_ee_pwrc_domain_desc gxbb_pwrc_domains[] = {
|
static struct meson_ee_pwrc_domain_desc gxbb_pwrc_domains[] = {
|
||||||
[PWRC_GXBB_VPU_ID] = VPU_PD("VPU", &gx_pwrc_vpu, gxbb_pwrc_mem_vpu,
|
[PWRC_GXBB_VPU_ID] = VPU_PD("VPU", &gx_pwrc_vpu, gxbb_pwrc_mem_vpu,
|
||||||
pwrc_ee_get_power, 12, 2),
|
pwrc_ee_is_powered_off, 12, 2),
|
||||||
[PWRC_GXBB_ETHERNET_MEM_ID] = MEM_PD("ETH", meson_pwrc_mem_eth),
|
[PWRC_GXBB_ETHERNET_MEM_ID] = MEM_PD("ETH", meson_pwrc_mem_eth),
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct meson_ee_pwrc_domain_desc meson8_pwrc_domains[] = {
|
static struct meson_ee_pwrc_domain_desc meson8_pwrc_domains[] = {
|
||||||
[PWRC_MESON8_VPU_ID] = VPU_PD("VPU", &meson8_pwrc_vpu,
|
[PWRC_MESON8_VPU_ID] = VPU_PD("VPU", &meson8_pwrc_vpu,
|
||||||
meson8_pwrc_mem_vpu, pwrc_ee_get_power,
|
meson8_pwrc_mem_vpu,
|
||||||
0, 1),
|
pwrc_ee_is_powered_off, 0, 1),
|
||||||
[PWRC_MESON8_ETHERNET_MEM_ID] = MEM_PD("ETHERNET_MEM",
|
[PWRC_MESON8_ETHERNET_MEM_ID] = MEM_PD("ETHERNET_MEM",
|
||||||
meson_pwrc_mem_eth),
|
meson_pwrc_mem_eth),
|
||||||
[PWRC_MESON8_AUDIO_DSP_MEM_ID] = MEM_PD("AUDIO_DSP_MEM",
|
[PWRC_MESON8_AUDIO_DSP_MEM_ID] = MEM_PD("AUDIO_DSP_MEM",
|
||||||
@ -273,8 +273,8 @@ static struct meson_ee_pwrc_domain_desc meson8_pwrc_domains[] = {
|
|||||||
|
|
||||||
static struct meson_ee_pwrc_domain_desc meson8b_pwrc_domains[] = {
|
static struct meson_ee_pwrc_domain_desc meson8b_pwrc_domains[] = {
|
||||||
[PWRC_MESON8_VPU_ID] = VPU_PD("VPU", &meson8_pwrc_vpu,
|
[PWRC_MESON8_VPU_ID] = VPU_PD("VPU", &meson8_pwrc_vpu,
|
||||||
meson8_pwrc_mem_vpu, pwrc_ee_get_power,
|
meson8_pwrc_mem_vpu,
|
||||||
11, 1),
|
pwrc_ee_is_powered_off, 11, 1),
|
||||||
[PWRC_MESON8_ETHERNET_MEM_ID] = MEM_PD("ETHERNET_MEM",
|
[PWRC_MESON8_ETHERNET_MEM_ID] = MEM_PD("ETHERNET_MEM",
|
||||||
meson_pwrc_mem_eth),
|
meson_pwrc_mem_eth),
|
||||||
[PWRC_MESON8_AUDIO_DSP_MEM_ID] = MEM_PD("AUDIO_DSP_MEM",
|
[PWRC_MESON8_AUDIO_DSP_MEM_ID] = MEM_PD("AUDIO_DSP_MEM",
|
||||||
@ -283,15 +283,15 @@ static struct meson_ee_pwrc_domain_desc meson8b_pwrc_domains[] = {
|
|||||||
|
|
||||||
static struct meson_ee_pwrc_domain_desc sm1_pwrc_domains[] = {
|
static struct meson_ee_pwrc_domain_desc sm1_pwrc_domains[] = {
|
||||||
[PWRC_SM1_VPU_ID] = VPU_PD("VPU", &sm1_pwrc_vpu, sm1_pwrc_mem_vpu,
|
[PWRC_SM1_VPU_ID] = VPU_PD("VPU", &sm1_pwrc_vpu, sm1_pwrc_mem_vpu,
|
||||||
pwrc_ee_get_power, 11, 2),
|
pwrc_ee_is_powered_off, 11, 2),
|
||||||
[PWRC_SM1_NNA_ID] = TOP_PD("NNA", &sm1_pwrc_nna, sm1_pwrc_mem_nna,
|
[PWRC_SM1_NNA_ID] = TOP_PD("NNA", &sm1_pwrc_nna, sm1_pwrc_mem_nna,
|
||||||
pwrc_ee_get_power),
|
pwrc_ee_is_powered_off),
|
||||||
[PWRC_SM1_USB_ID] = TOP_PD("USB", &sm1_pwrc_usb, sm1_pwrc_mem_usb,
|
[PWRC_SM1_USB_ID] = TOP_PD("USB", &sm1_pwrc_usb, sm1_pwrc_mem_usb,
|
||||||
pwrc_ee_get_power),
|
pwrc_ee_is_powered_off),
|
||||||
[PWRC_SM1_PCIE_ID] = TOP_PD("PCI", &sm1_pwrc_pci, sm1_pwrc_mem_pcie,
|
[PWRC_SM1_PCIE_ID] = TOP_PD("PCI", &sm1_pwrc_pci, sm1_pwrc_mem_pcie,
|
||||||
pwrc_ee_get_power),
|
pwrc_ee_is_powered_off),
|
||||||
[PWRC_SM1_GE2D_ID] = TOP_PD("GE2D", &sm1_pwrc_ge2d, sm1_pwrc_mem_ge2d,
|
[PWRC_SM1_GE2D_ID] = TOP_PD("GE2D", &sm1_pwrc_ge2d, sm1_pwrc_mem_ge2d,
|
||||||
pwrc_ee_get_power),
|
pwrc_ee_is_powered_off),
|
||||||
[PWRC_SM1_AUDIO_ID] = MEM_PD("AUDIO", sm1_pwrc_mem_audio),
|
[PWRC_SM1_AUDIO_ID] = MEM_PD("AUDIO", sm1_pwrc_mem_audio),
|
||||||
[PWRC_SM1_ETH_ID] = MEM_PD("ETH", meson_pwrc_mem_eth),
|
[PWRC_SM1_ETH_ID] = MEM_PD("ETH", meson_pwrc_mem_eth),
|
||||||
};
|
};
|
||||||
@ -314,7 +314,7 @@ struct meson_ee_pwrc {
|
|||||||
struct genpd_onecell_data xlate;
|
struct genpd_onecell_data xlate;
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool pwrc_ee_get_power(struct meson_ee_pwrc_domain *pwrc_domain)
|
static bool pwrc_ee_is_powered_off(struct meson_ee_pwrc_domain *pwrc_domain)
|
||||||
{
|
{
|
||||||
u32 reg;
|
u32 reg;
|
||||||
|
|
||||||
@ -445,7 +445,7 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev,
|
|||||||
* we need to power the domain off, otherwise the internal clocks
|
* we need to power the domain off, otherwise the internal clocks
|
||||||
* prepare/enable counters won't be in sync.
|
* prepare/enable counters won't be in sync.
|
||||||
*/
|
*/
|
||||||
if (dom->num_clks && dom->desc.get_power && !dom->desc.get_power(dom)) {
|
if (dom->num_clks && dom->desc.is_powered_off && !dom->desc.is_powered_off(dom)) {
|
||||||
ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks);
|
ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
@ -456,8 +456,8 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev,
|
|||||||
return ret;
|
return ret;
|
||||||
} else {
|
} else {
|
||||||
ret = pm_genpd_init(&dom->base, NULL,
|
ret = pm_genpd_init(&dom->base, NULL,
|
||||||
(dom->desc.get_power ?
|
(dom->desc.is_powered_off ?
|
||||||
dom->desc.get_power(dom) : true));
|
dom->desc.is_powered_off(dom) : true));
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -536,7 +536,7 @@ static void meson_ee_pwrc_shutdown(struct platform_device *pdev)
|
|||||||
for (i = 0 ; i < pwrc->xlate.num_domains ; ++i) {
|
for (i = 0 ; i < pwrc->xlate.num_domains ; ++i) {
|
||||||
struct meson_ee_pwrc_domain *dom = &pwrc->domains[i];
|
struct meson_ee_pwrc_domain *dom = &pwrc->domains[i];
|
||||||
|
|
||||||
if (dom->desc.get_power && !dom->desc.get_power(dom))
|
if (dom->desc.is_powered_off && !dom->desc.is_powered_off(dom))
|
||||||
meson_ee_pwrc_off(&dom->base);
|
meson_ee_pwrc_off(&dom->base);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user