From patchwork Mon Aug 6 23:07:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 1282001 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 719DBDF288 for ; Mon, 6 Aug 2012 23:14:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932161Ab2HFXNg (ORCPT ); Mon, 6 Aug 2012 19:13:36 -0400 Received: from ogre.sisk.pl ([193.178.161.156]:44955 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751697Ab2HFXLQ (ORCPT ); Mon, 6 Aug 2012 19:11:16 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by ogre.sisk.pl (Postfix) with ESMTP id 493F81DB96E; Tue, 7 Aug 2012 01:01:19 +0200 (CEST) Received: from ogre.sisk.pl ([127.0.0.1]) by localhost (ogre.sisk.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04270-05; Tue, 7 Aug 2012 01:00:54 +0200 (CEST) Received: from ferrari.rjw.lan (62-121-64-87.home.aster.pl [62.121.64.87]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ogre.sisk.pl (Postfix) with ESMTP id 53ECB1DB9B3; Tue, 7 Aug 2012 01:00:54 +0200 (CEST) From: "Rafael J. Wysocki" To: "Linux-sh list" Subject: [PATCH 2/12] ARM: shmobile: Use names of power domains for adding devices to them Date: Tue, 7 Aug 2012 01:07:01 +0200 User-Agent: KMail/1.13.6 (Linux/3.5.0+; KDE/4.6.0; x86_64; ; ) Cc: LKML , Linux PM list , Magnus Damm References: <201208070105.23262.rjw@sisk.pl> In-Reply-To: <201208070105.23262.rjw@sisk.pl> MIME-Version: 1.0 Message-Id: <201208070107.01411.rjw@sisk.pl> X-Virus-Scanned: amavisd-new at ogre.sisk.pl using MkS_Vir for Linux Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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: Rafael J. Wysocki --- arch/arm/mach-shmobile/board-ap4evb.c | 14 +++--- arch/arm/mach-shmobile/board-armadillo800eva.c | 6 +- arch/arm/mach-shmobile/board-mackerel.c | 24 +++++------ arch/arm/mach-shmobile/include/mach/pm-rmobile.h | 4 - arch/arm/mach-shmobile/pm-rmobile.c | 4 - arch/arm/mach-shmobile/setup-r8a7740.c | 20 ++++----- arch/arm/mach-shmobile/setup-sh7372.c | 48 +++++++++++------------ 7 files changed, 60 insertions(+), 60 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux/arch/arm/mach-shmobile/pm-rmobile.c =================================================================== --- linux.orig/arch/arm/mach-shmobile/pm-rmobile.c +++ linux/arch/arm/mach-shmobile/pm-rmobile.c @@ -149,12 +149,12 @@ void rmobile_init_pm_domain(struct rmobi __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); } Index: linux/arch/arm/mach-shmobile/include/mach/pm-rmobile.h =================================================================== --- linux.orig/arch/arm/mach-shmobile/include/mach/pm-rmobile.h +++ linux/arch/arm/mach-shmobile/include/mach/pm-rmobile.h @@ -31,13 +31,13 @@ struct rmobile_pm_domain *to_rmobile_pd( #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 */ Index: linux/arch/arm/mach-shmobile/board-mackerel.c =================================================================== --- linux.orig/arch/arm/mach-shmobile/board-mackerel.c +++ linux/arch/arm/mach-shmobile/board-mackerel.c @@ -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(); Index: linux/arch/arm/mach-shmobile/setup-sh7372.c =================================================================== --- linux.orig/arch/arm/mach-shmobile/setup-sh7372.c +++ linux/arch/arm/mach-shmobile/setup-sh7372.c @@ -1023,30 +1023,30 @@ void __init sh7372_add_standard_devices( platform_add_devices(sh7372_late_devices, ARRAY_SIZE(sh7372_late_devices)); - rmobile_add_device_to_domain(&sh7372_pd_a3rv, &vpu_device); - rmobile_add_device_to_domain(&sh7372_pd_a4mp, &spu0_device); - rmobile_add_device_to_domain(&sh7372_pd_a4mp, &spu1_device); - rmobile_add_device_to_domain(&sh7372_pd_a3sp, &scif0_device); - rmobile_add_device_to_domain(&sh7372_pd_a3sp, &scif1_device); - rmobile_add_device_to_domain(&sh7372_pd_a3sp, &scif2_device); - rmobile_add_device_to_domain(&sh7372_pd_a3sp, &scif3_device); - rmobile_add_device_to_domain(&sh7372_pd_a3sp, &scif4_device); - rmobile_add_device_to_domain(&sh7372_pd_a3sp, &scif5_device); - rmobile_add_device_to_domain(&sh7372_pd_a3sp, &scif6_device); - rmobile_add_device_to_domain(&sh7372_pd_a3sp, &iic1_device); - rmobile_add_device_to_domain(&sh7372_pd_a3sp, &dma0_device); - rmobile_add_device_to_domain(&sh7372_pd_a3sp, &dma1_device); - rmobile_add_device_to_domain(&sh7372_pd_a3sp, &dma2_device); - rmobile_add_device_to_domain(&sh7372_pd_a3sp, &usb_dma0_device); - rmobile_add_device_to_domain(&sh7372_pd_a3sp, &usb_dma1_device); - rmobile_add_device_to_domain(&sh7372_pd_a4r, &iic0_device); - rmobile_add_device_to_domain(&sh7372_pd_a4r, &veu0_device); - rmobile_add_device_to_domain(&sh7372_pd_a4r, &veu1_device); - rmobile_add_device_to_domain(&sh7372_pd_a4r, &veu2_device); - rmobile_add_device_to_domain(&sh7372_pd_a4r, &veu3_device); - rmobile_add_device_to_domain(&sh7372_pd_a4r, &jpu_device); - rmobile_add_device_to_domain(&sh7372_pd_a4r, &tmu00_device); - rmobile_add_device_to_domain(&sh7372_pd_a4r, &tmu01_device); + rmobile_add_device_to_domain("A3RV", &vpu_device); + rmobile_add_device_to_domain("A4MP", &spu0_device); + rmobile_add_device_to_domain("A4MP", &spu1_device); + rmobile_add_device_to_domain("A3SP", &scif0_device); + rmobile_add_device_to_domain("A3SP", &scif1_device); + rmobile_add_device_to_domain("A3SP", &scif2_device); + rmobile_add_device_to_domain("A3SP", &scif3_device); + rmobile_add_device_to_domain("A3SP", &scif4_device); + rmobile_add_device_to_domain("A3SP", &scif5_device); + rmobile_add_device_to_domain("A3SP", &scif6_device); + rmobile_add_device_to_domain("A3SP", &iic1_device); + rmobile_add_device_to_domain("A3SP", &dma0_device); + rmobile_add_device_to_domain("A3SP", &dma1_device); + rmobile_add_device_to_domain("A3SP", &dma2_device); + rmobile_add_device_to_domain("A3SP", &usb_dma0_device); + rmobile_add_device_to_domain("A3SP", &usb_dma1_device); + rmobile_add_device_to_domain("A4R", &iic0_device); + rmobile_add_device_to_domain("A4R", &veu0_device); + rmobile_add_device_to_domain("A4R", &veu1_device); + rmobile_add_device_to_domain("A4R", &veu2_device); + rmobile_add_device_to_domain("A4R", &veu3_device); + rmobile_add_device_to_domain("A4R", &jpu_device); + rmobile_add_device_to_domain("A4R", &tmu00_device); + rmobile_add_device_to_domain("A4R", &tmu01_device); } static void __init sh7372_earlytimer_init(void) Index: linux/arch/arm/mach-shmobile/board-ap4evb.c =================================================================== --- linux.orig/arch/arm/mach-shmobile/board-ap4evb.c +++ linux/arch/arm/mach-shmobile/board-ap4evb.c @@ -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("A4LC", &lcdc1_device); + rmobile_add_device_to_domain("A4LC", &lcdc_device); + rmobile_add_device_to_domain("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("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(); Index: linux/arch/arm/mach-shmobile/setup-r8a7740.c =================================================================== --- linux.orig/arch/arm/mach-shmobile/setup-r8a7740.c +++ linux/arch/arm/mach-shmobile/setup-r8a7740.c @@ -688,16 +688,16 @@ void __init r8a7740_add_standard_devices /* add devices to PM domain */ - rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scif0_device); - rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scif1_device); - rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scif2_device); - rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scif3_device); - rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scif4_device); - rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scif5_device); - rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scif6_device); - rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scif7_device); - rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &scifb_device); - rmobile_add_device_to_domain(&r8a7740_pd_a3sp, &i2c1_device); + rmobile_add_device_to_domain("A3SP", &scif0_device); + rmobile_add_device_to_domain("A3SP", &scif1_device); + rmobile_add_device_to_domain("A3SP", &scif2_device); + rmobile_add_device_to_domain("A3SP", &scif3_device); + rmobile_add_device_to_domain("A3SP", &scif4_device); + rmobile_add_device_to_domain("A3SP", &scif5_device); + rmobile_add_device_to_domain("A3SP", &scif6_device); + rmobile_add_device_to_domain("A3SP", &scif7_device); + rmobile_add_device_to_domain("A3SP", &scifb_device); + rmobile_add_device_to_domain("A3SP", &i2c1_device); } static void __init r8a7740_earlytimer_init(void) Index: linux/arch/arm/mach-shmobile/board-armadillo800eva.c =================================================================== --- linux.orig/arch/arm/mach-shmobile/board-armadillo800eva.c +++ linux/arch/arm/mach-shmobile/board-armadillo800eva.c @@ -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)