mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-17 13:58:46 +00:00
This pull request contains Broadcom ARM/ARM64-based SoCs fixes for 5.1,
please pull the following: - Eric provides fixes for the bcm2835-pm driver: added missing depends on MFD_CORE for the ARM64 definition of ARCH_BCM2835, fixing error paths on initialization and fixing the PM_IMAGE_PERI power domain -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEm+Rq3+YGJdiR9yuFh9CWnEQHBwQFAlyRTXMACgkQh9CWnEQH BwTKOBAAiN0SyRVtCQmomvrIOMTJilmUs+BZrcPnjlIEcxCdUcXn+qxKKgYdtXbR KWkrlZypv3LwTbFE9DiBxIT0f3pmBt0c8oeDdiX3uyhUHAaWBasD3+b1XBx8oyYR u3wU0A94tVHBvmXHIaDpbPx07Vq2LZ5U8nOGID4A5YTz12v7uzlSY6spdPZz774w vMLA/TrXWTvnx+MIF9zHshq/+CuOG9w3Ne86B2rCpTAAX1MxLyGNAu1dkFD/yFEl maBcBQJy3G2wgGCgudw3d+LMGMhwP0FKNdspblQ0yxiayPJDkHm+oOfdrF74gW00 DldAW4nqelDkJJ6KVMuLVlkcTkUf8VXYQX+EJP0K/V3fvfiDf3pr8wK+yp95GvEc 8/p/HwLWGQjATxUBgJIRORfTUPOTYbJUX3q6n2Wn8EKuTwWSl+mQGrsrGbv31N8I 6+Mo2eKhxMxmdsfcN3Ox++m9XXqTlds2wXuSYq77lT0kXspq5HuaMu1PsRPsvDFN pbAqaKgf7DPoUQBrGFaJJgjB1bj+gG/7r4rTcNXEHxQcAneo20TuGtwjNq2rxVVY 8fn9eDbSrh/e7wduXf6hhrV/akn2tq5bLYUSqcWmFCpskITbz4wDbAyMtLt8qZty WGZBmnP7e3O3qa9wJvOkC4HKmb878+eNNn8Uvl6k/riu34kUmj8= =0kxj -----END PGP SIGNATURE----- Merge tag 'arm-soc/for-5.1/soc-fixes' of https://github.com/Broadcom/stblinux into arm/fixes This pull request contains Broadcom ARM/ARM64-based SoCs fixes for 5.1, please pull the following: - Eric provides fixes for the bcm2835-pm driver: added missing depends on MFD_CORE for the ARM64 definition of ARCH_BCM2835, fixing error paths on initialization and fixing the PM_IMAGE_PERI power domain * tag 'arm-soc/for-5.1/soc-fixes' of https://github.com/Broadcom/stblinux: arm64: bcm2835: Add missing dependency on MFD_CORE. soc: bcm: bcm2835-pm: Fix error paths of initialization. soc: bcm: bcm2835-pm: Fix PM_IMAGE_PERI power domain support.
This commit is contained in:
commit
0cee41d4d0
@ -27,6 +27,7 @@ config ARCH_BCM2835
|
||||
bool "Broadcom BCM2835 family"
|
||||
select TIMER_OF
|
||||
select GPIOLIB
|
||||
select MFD_CORE
|
||||
select PINCTRL
|
||||
select PINCTRL_BCM2835
|
||||
select ARM_AMBA
|
||||
|
@ -150,7 +150,12 @@ struct bcm2835_power {
|
||||
|
||||
static int bcm2835_asb_enable(struct bcm2835_power *power, u32 reg)
|
||||
{
|
||||
u64 start = ktime_get_ns();
|
||||
u64 start;
|
||||
|
||||
if (!reg)
|
||||
return 0;
|
||||
|
||||
start = ktime_get_ns();
|
||||
|
||||
/* Enable the module's async AXI bridges. */
|
||||
ASB_WRITE(reg, ASB_READ(reg) & ~ASB_REQ_STOP);
|
||||
@ -165,7 +170,12 @@ static int bcm2835_asb_enable(struct bcm2835_power *power, u32 reg)
|
||||
|
||||
static int bcm2835_asb_disable(struct bcm2835_power *power, u32 reg)
|
||||
{
|
||||
u64 start = ktime_get_ns();
|
||||
u64 start;
|
||||
|
||||
if (!reg)
|
||||
return 0;
|
||||
|
||||
start = ktime_get_ns();
|
||||
|
||||
/* Enable the module's async AXI bridges. */
|
||||
ASB_WRITE(reg, ASB_READ(reg) | ASB_REQ_STOP);
|
||||
@ -475,7 +485,7 @@ static int bcm2835_power_pd_power_off(struct generic_pm_domain *domain)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static int
|
||||
bcm2835_init_power_domain(struct bcm2835_power *power,
|
||||
int pd_xlate_index, const char *name)
|
||||
{
|
||||
@ -483,6 +493,17 @@ bcm2835_init_power_domain(struct bcm2835_power *power,
|
||||
struct bcm2835_power_domain *dom = &power->domains[pd_xlate_index];
|
||||
|
||||
dom->clk = devm_clk_get(dev->parent, name);
|
||||
if (IS_ERR(dom->clk)) {
|
||||
int ret = PTR_ERR(dom->clk);
|
||||
|
||||
if (ret == -EPROBE_DEFER)
|
||||
return ret;
|
||||
|
||||
/* Some domains don't have a clk, so make sure that we
|
||||
* don't deref an error pointer later.
|
||||
*/
|
||||
dom->clk = NULL;
|
||||
}
|
||||
|
||||
dom->base.name = name;
|
||||
dom->base.power_on = bcm2835_power_pd_power_on;
|
||||
@ -495,6 +516,8 @@ bcm2835_init_power_domain(struct bcm2835_power *power,
|
||||
pm_genpd_init(&dom->base, NULL, true);
|
||||
|
||||
power->pd_xlate.domains[pd_xlate_index] = &dom->base;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** bcm2835_reset_reset - Resets a block that has a reset line in the
|
||||
@ -592,7 +615,7 @@ static int bcm2835_power_probe(struct platform_device *pdev)
|
||||
{ BCM2835_POWER_DOMAIN_IMAGE_PERI, BCM2835_POWER_DOMAIN_CAM0 },
|
||||
{ BCM2835_POWER_DOMAIN_IMAGE_PERI, BCM2835_POWER_DOMAIN_CAM1 },
|
||||
};
|
||||
int ret, i;
|
||||
int ret = 0, i;
|
||||
u32 id;
|
||||
|
||||
power = devm_kzalloc(dev, sizeof(*power), GFP_KERNEL);
|
||||
@ -619,8 +642,11 @@ static int bcm2835_power_probe(struct platform_device *pdev)
|
||||
|
||||
power->pd_xlate.num_domains = ARRAY_SIZE(power_domain_names);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(power_domain_names); i++)
|
||||
bcm2835_init_power_domain(power, i, power_domain_names[i]);
|
||||
for (i = 0; i < ARRAY_SIZE(power_domain_names); i++) {
|
||||
ret = bcm2835_init_power_domain(power, i, power_domain_names[i]);
|
||||
if (ret)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(domain_deps); i++) {
|
||||
pm_genpd_add_subdomain(&power->domains[domain_deps[i].parent].base,
|
||||
@ -634,12 +660,21 @@ static int bcm2835_power_probe(struct platform_device *pdev)
|
||||
|
||||
ret = devm_reset_controller_register(dev, &power->reset);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto fail;
|
||||
|
||||
of_genpd_add_provider_onecell(dev->parent->of_node, &power->pd_xlate);
|
||||
|
||||
dev_info(dev, "Broadcom BCM2835 power domains driver");
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
for (i = 0; i < ARRAY_SIZE(power_domain_names); i++) {
|
||||
struct generic_pm_domain *dom = &power->domains[i].base;
|
||||
|
||||
if (dom->name)
|
||||
pm_genpd_remove(dom);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int bcm2835_power_remove(struct platform_device *pdev)
|
||||
|
Loading…
x
Reference in New Issue
Block a user