Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8bdd9468 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

ARM: shmobile: Use names of power domains for adding devices to them



Make the power management code under arch/arm/mach-shmobile/ use
names of power domains instead of pointers to domain objects for
adding devices to the domains.  This will allow us to put the
domain objects into tables and register them all in one shot
going forward.

Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Acked-by: default avatarMagnus Damm <damm@opensource.se>
parent 74a2799a
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -1461,14 +1461,14 @@ static void __init ap4evb_init(void)

	platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices));

	rmobile_add_device_to_domain(&sh7372_pd_a4lc, &lcdc1_device);
	rmobile_add_device_to_domain(&sh7372_pd_a4lc, &lcdc_device);
	rmobile_add_device_to_domain(&sh7372_pd_a4mp, &fsi_device);

	rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sh_mmcif_device);
	rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sdhi0_device);
	rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sdhi1_device);
	rmobile_add_device_to_domain(&sh7372_pd_a4r, &ceu_device);
	rmobile_add_device_to_domain("A4LC", &lcdc1_device);
	rmobile_add_device_to_domain("A4LC", &lcdc_device);
	rmobile_add_device_to_domain("A4MP", &fsi_device);

	rmobile_add_device_to_domain("A3SP", &sh_mmcif_device);
	rmobile_add_device_to_domain("A3SP", &sdhi0_device);
	rmobile_add_device_to_domain("A3SP", &sdhi1_device);
	rmobile_add_device_to_domain("A4R", &ceu_device);

	hdmi_init_pm_clock();
	fsi_init_pm_clock();
+3 −3
Original line number Diff line number Diff line
@@ -1181,10 +1181,10 @@ static void __init eva_init(void)

	eva_clock_init();

	rmobile_add_device_to_domain(&r8a7740_pd_a4lc, &lcdc0_device);
	rmobile_add_device_to_domain(&r8a7740_pd_a4lc, &hdmi_lcdc_device);
	rmobile_add_device_to_domain("A4LC", &lcdc0_device);
	rmobile_add_device_to_domain("A4LC", &hdmi_lcdc_device);
	if (usb)
		rmobile_add_device_to_domain(&r8a7740_pd_a3sp, usb);
		rmobile_add_device_to_domain("A3SP", usb);
}

static void __init eva_earlytimer_init(void)
+12 −12
Original line number Diff line number Diff line
@@ -1623,20 +1623,20 @@ static void __init mackerel_init(void)

	platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices));

	rmobile_add_device_to_domain(&sh7372_pd_a4lc, &lcdc_device);
	rmobile_add_device_to_domain(&sh7372_pd_a4lc, &hdmi_lcdc_device);
	rmobile_add_device_to_domain(&sh7372_pd_a4lc, &meram_device);
	rmobile_add_device_to_domain(&sh7372_pd_a4mp, &fsi_device);
	rmobile_add_device_to_domain(&sh7372_pd_a3sp, &usbhs0_device);
	rmobile_add_device_to_domain(&sh7372_pd_a3sp, &usbhs1_device);
	rmobile_add_device_to_domain(&sh7372_pd_a3sp, &nand_flash_device);
	rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sh_mmcif_device);
	rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sdhi0_device);
	rmobile_add_device_to_domain("A4LC", &lcdc_device);
	rmobile_add_device_to_domain("A4LC", &hdmi_lcdc_device);
	rmobile_add_device_to_domain("A4LC", &meram_device);
	rmobile_add_device_to_domain("A4MP", &fsi_device);
	rmobile_add_device_to_domain("A3SP", &usbhs0_device);
	rmobile_add_device_to_domain("A3SP", &usbhs1_device);
	rmobile_add_device_to_domain("A3SP", &nand_flash_device);
	rmobile_add_device_to_domain("A3SP", &sh_mmcif_device);
	rmobile_add_device_to_domain("A3SP", &sdhi0_device);
#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
	rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sdhi1_device);
	rmobile_add_device_to_domain("A3SP", &sdhi1_device);
#endif
	rmobile_add_device_to_domain(&sh7372_pd_a3sp, &sdhi2_device);
	rmobile_add_device_to_domain(&sh7372_pd_a4r, &ceu_device);
	rmobile_add_device_to_domain("A3SP", &sdhi2_device);
	rmobile_add_device_to_domain("A4R", &ceu_device);

	hdmi_init_pm_clock();
	sh7372_pm_init();
+2 −2
Original line number Diff line number Diff line
@@ -31,13 +31,13 @@ struct rmobile_pm_domain *to_rmobile_pd(struct generic_pm_domain *d)

#ifdef CONFIG_PM
extern void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd);
extern void rmobile_add_device_to_domain(struct rmobile_pm_domain *rmobile_pd,
extern void rmobile_add_device_to_domain(const char *domain_name,
					struct platform_device *pdev);
extern void rmobile_pm_add_subdomain(struct rmobile_pm_domain *rmobile_pd,
				    struct rmobile_pm_domain *rmobile_sd);
#else
#define rmobile_init_pm_domain(pd) do { } while (0)
#define rmobile_add_device_to_domain(pd, pdev) do { } while (0)
#define rmobile_add_device_to_domain(name, pdev) do { } while (0)
#define rmobile_pm_add_subdomain(pd, sd) do { } while (0)
#endif /* CONFIG_PM */

+2 −2
Original line number Diff line number Diff line
@@ -149,12 +149,12 @@ void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
	__rmobile_pd_power_up(rmobile_pd, false);
}

void rmobile_add_device_to_domain(struct rmobile_pm_domain *rmobile_pd,
void rmobile_add_device_to_domain(const char *domain_name,
				 struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;

	pm_genpd_add_device(&rmobile_pd->genpd, dev);
	pm_genpd_name_add_device(domain_name, dev);
	if (pm_clk_no_clocks(dev))
		pm_clk_add(dev, NULL);
}
Loading