From 4be887342c48f3b1e208bac6375c19c57791a3b9 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Fri, 18 Nov 2011 16:13:09 +0900 Subject: sh: cpuidle: Migrate off of hwblk API. Now that the hwblk API is unused and going away, migrate cpuidle off of it. This is a pretty straightforward migration given that we weren't really making use of the allowed mode overloading in the first place, so simply default to regular sleep mode. Signed-off-by: Paul Mundt --- arch/sh/include/asm/hwblk.h | 1 - arch/sh/kernel/cpu/hwblk.c | 5 ----- arch/sh/kernel/cpu/shmobile/cpuidle.c | 3 +-- 3 files changed, 1 insertion(+), 8 deletions(-) (limited to 'arch') diff --git a/arch/sh/include/asm/hwblk.h b/arch/sh/include/asm/hwblk.h index e29461bbe84..75d50d9bf0a 100644 --- a/arch/sh/include/asm/hwblk.h +++ b/arch/sh/include/asm/hwblk.h @@ -49,7 +49,6 @@ struct hwblk_info { !defined(CONFIG_CPU_SUBTYPE_SH7724) /* Should be defined by processor-specific code */ int arch_hwblk_init(void); -int arch_hwblk_sleep_mode(void); int hwblk_register(struct hwblk_info *info); int hwblk_init(void); diff --git a/arch/sh/kernel/cpu/hwblk.c b/arch/sh/kernel/cpu/hwblk.c index 3e985aae5d9..00bab455a01 100644 --- a/arch/sh/kernel/cpu/hwblk.c +++ b/arch/sh/kernel/cpu/hwblk.c @@ -106,11 +106,6 @@ int __init __weak arch_hwblk_init(void) return 0; } -int __weak arch_hwblk_sleep_mode(void) -{ - return SUSP_SH_SLEEP; -} - int __init hwblk_init(void) { return arch_hwblk_init(); diff --git a/arch/sh/kernel/cpu/shmobile/cpuidle.c b/arch/sh/kernel/cpu/shmobile/cpuidle.c index 1cc257c9b1e..6d62eb40e75 100644 --- a/arch/sh/kernel/cpu/shmobile/cpuidle.c +++ b/arch/sh/kernel/cpu/shmobile/cpuidle.c @@ -17,7 +17,6 @@ #include #include #include -#include static unsigned long cpuidle_mode[] = { SUSP_SH_SLEEP, /* regular sleep mode */ @@ -29,7 +28,7 @@ static int cpuidle_sleep_enter(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index) { - unsigned long allowed_mode = arch_hwblk_sleep_mode(); + unsigned long allowed_mode = SUSP_SH_SLEEP; ktime_t before, after; int requested_state = index; int allowed_state; -- cgit v1.2.3 From ec20a81562772f43610490a48814f9edbebc3431 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Fri, 18 Nov 2011 16:24:08 +0900 Subject: sh: hwblk: Kill off hwblk_id from pdev archdata. Now that nothing is using this anymore, kill off the assignments across the board. Signed-off-by: Paul Mundt --- arch/sh/boards/mach-ap325rxa/setup.c | 12 ------- arch/sh/boards/mach-ecovec24/setup.c | 36 -------------------- arch/sh/boards/mach-kfr2r09/setup.c | 12 ------- arch/sh/boards/mach-migor/setup.c | 12 ------- arch/sh/boards/mach-se/7722/setup.c | 3 -- arch/sh/boards/mach-se/7724/setup.c | 30 ----------------- arch/sh/include/asm/device.h | 1 - arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 36 -------------------- arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 39 ---------------------- arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 60 ---------------------------------- 10 files changed, 241 deletions(-) (limited to 'arch') diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c index 7030f4c8cf1..74d49c01783 100644 --- a/arch/sh/boards/mach-ap325rxa/setup.c +++ b/arch/sh/boards/mach-ap325rxa/setup.c @@ -249,9 +249,6 @@ static struct platform_device lcdc_device = { .dev = { .platform_data = &lcdc_info, }, - .archdata = { - .hwblk_id = HWBLK_LCDC, - }, }; static void camera_power(int val) @@ -424,9 +421,6 @@ static struct platform_device ceu_device = { .dev = { .platform_data = &sh_mobile_ceu_info, }, - .archdata = { - .hwblk_id = HWBLK_CEU, - }, }; static struct resource sdhi0_cn3_resources[] = { @@ -454,9 +448,6 @@ static struct platform_device sdhi0_cn3_device = { .dev = { .platform_data = &sdhi0_cn3_data, }, - .archdata = { - .hwblk_id = HWBLK_SDHI0, - }, }; static struct resource sdhi1_cn7_resources[] = { @@ -484,9 +475,6 @@ static struct platform_device sdhi1_cn7_device = { .dev = { .platform_data = &sdhi1_cn7_data, }, - .archdata = { - .hwblk_id = HWBLK_SDHI1, - }, }; static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 92ddce4b345..9a19fb07276 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c @@ -156,9 +156,6 @@ static struct platform_device sh_eth_device = { }, .num_resources = ARRAY_SIZE(sh_eth_resources), .resource = sh_eth_resources, - .archdata = { - .hwblk_id = HWBLK_ETHER, - }, }; /* USB0 host */ @@ -278,9 +275,6 @@ static struct platform_device usbhs_device = { }, .num_resources = ARRAY_SIZE(usbhs_resources), .resource = usbhs_resources, - .archdata = { - .hwblk_id = HWBLK_USB1, - }, }; /* LCDC */ @@ -366,9 +360,6 @@ static struct platform_device lcdc_device = { .dev = { .platform_data = &lcdc_info, }, - .archdata = { - .hwblk_id = HWBLK_LCDC, - }, }; /* CEU0 */ @@ -400,9 +391,6 @@ static struct platform_device ceu0_device = { .dev = { .platform_data = &sh_mobile_ceu0_info, }, - .archdata = { - .hwblk_id = HWBLK_CEU0, - }, }; /* CEU1 */ @@ -434,9 +422,6 @@ static struct platform_device ceu1_device = { .dev = { .platform_data = &sh_mobile_ceu1_info, }, - .archdata = { - .hwblk_id = HWBLK_CEU1, - }, }; /* I2C device */ @@ -491,9 +476,6 @@ static struct platform_device keysc_device = { .dev = { .platform_data = &keysc_info, }, - .archdata = { - .hwblk_id = HWBLK_KEYSC, - }, }; /* TouchScreen */ @@ -568,9 +550,6 @@ static struct platform_device sdhi0_device = { .dev = { .platform_data = &sdhi0_info, }, - .archdata = { - .hwblk_id = HWBLK_SDHI0, - }, }; #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) @@ -608,9 +587,6 @@ static struct platform_device sdhi1_device = { .dev = { .platform_data = &sdhi1_info, }, - .archdata = { - .hwblk_id = HWBLK_SDHI1, - }, }; #endif /* CONFIG_MMC_SH_MMCIF */ @@ -676,9 +652,6 @@ static struct platform_device msiof0_device = { }, .num_resources = ARRAY_SIZE(msiof0_resources), .resource = msiof0_resources, - .archdata = { - .hwblk_id = HWBLK_MSIOF0, - }, }; #endif @@ -818,9 +791,6 @@ static struct platform_device fsi_device = { .dev = { .platform_data = &fsi_info, }, - .archdata = { - .hwblk_id = HWBLK_SPU, /* FSI needs SPU hwblk */ - }, }; /* IrDA */ @@ -882,9 +852,6 @@ static struct platform_device vou_device = { .dev = { .platform_data = &sh_vou_pdata, }, - .archdata = { - .hwblk_id = HWBLK_VOU, - }, }; #if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE) @@ -936,9 +903,6 @@ static struct platform_device sh_mmcif_device = { }, .num_resources = ARRAY_SIZE(sh_mmcif_resources), .resource = sh_mmcif_resources, - .archdata = { - .hwblk_id = HWBLK_MMC, - }, }; #endif diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c index f65271a8d07..5c3c7136684 100644 --- a/arch/sh/boards/mach-kfr2r09/setup.c +++ b/arch/sh/boards/mach-kfr2r09/setup.c @@ -122,9 +122,6 @@ static struct platform_device kfr2r09_sh_keysc_device = { .dev = { .platform_data = &kfr2r09_sh_keysc_info, }, - .archdata = { - .hwblk_id = HWBLK_KEYSC, - }, }; static const struct fb_videomode kfr2r09_lcdc_modes[] = { @@ -191,9 +188,6 @@ static struct platform_device kfr2r09_sh_lcdc_device = { .dev = { .platform_data = &kfr2r09_sh_lcdc_info, }, - .archdata = { - .hwblk_id = HWBLK_LCDC, - }, }; static struct r8a66597_platdata kfr2r09_usb0_gadget_data = { @@ -254,9 +248,6 @@ static struct platform_device kfr2r09_ceu_device = { .dev = { .platform_data = &sh_mobile_ceu_info, }, - .archdata = { - .hwblk_id = HWBLK_CEU0, - }, }; static struct i2c_board_info kfr2r09_i2c_camera = { @@ -377,9 +368,6 @@ static struct platform_device kfr2r09_sh_sdhi0_device = { .dev = { .platform_data = &sh7724_sdhi0_data, }, - .archdata = { - .hwblk_id = HWBLK_SDHI0, - }, }; static struct platform_device *kfr2r09_devices[] __initdata = { diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c index e4c81195929..f8f9377d568 100644 --- a/arch/sh/boards/mach-migor/setup.c +++ b/arch/sh/boards/mach-migor/setup.c @@ -99,9 +99,6 @@ static struct platform_device sh_keysc_device = { .dev = { .platform_data = &sh_keysc_info, }, - .archdata = { - .hwblk_id = HWBLK_KEYSC, - }, }; static struct mtd_partition migor_nor_flash_partitions[] = @@ -300,9 +297,6 @@ static struct platform_device migor_lcdc_device = { .dev = { .platform_data = &sh_mobile_lcdc_info, }, - .archdata = { - .hwblk_id = HWBLK_LCDC, - }, }; static struct clk *camera_clk; @@ -390,9 +384,6 @@ static struct platform_device migor_ceu_device = { .dev = { .platform_data = &sh_mobile_ceu_info, }, - .archdata = { - .hwblk_id = HWBLK_CEU, - }, }; static struct resource sdhi_cn9_resources[] = { @@ -421,9 +412,6 @@ static struct platform_device sdhi_cn9_device = { .dev = { .platform_data = &sh7724_sdhi_data, }, - .archdata = { - .hwblk_id = HWBLK_SDHI, - }, }; static struct i2c_board_info migor_i2c_devices[] = { diff --git a/arch/sh/boards/mach-se/7722/setup.c b/arch/sh/boards/mach-se/7722/setup.c index 80a4e571b31..e1963fecd76 100644 --- a/arch/sh/boards/mach-se/7722/setup.c +++ b/arch/sh/boards/mach-se/7722/setup.c @@ -127,9 +127,6 @@ static struct platform_device sh_keysc_device = { .dev = { .platform_data = &sh_keysc_info, }, - .archdata = { - .hwblk_id = HWBLK_KEYSC, - }, }; static struct platform_device *se7722_devices[] __initdata = { diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c index b747c0ab926..affde85ff63 100644 --- a/arch/sh/boards/mach-se/7724/setup.c +++ b/arch/sh/boards/mach-se/7724/setup.c @@ -210,9 +210,6 @@ static struct platform_device lcdc_device = { .dev = { .platform_data = &lcdc_info, }, - .archdata = { - .hwblk_id = HWBLK_LCDC, - }, }; /* CEU0 */ @@ -244,9 +241,6 @@ static struct platform_device ceu0_device = { .dev = { .platform_data = &sh_mobile_ceu0_info, }, - .archdata = { - .hwblk_id = HWBLK_CEU0, - }, }; /* CEU1 */ @@ -278,9 +272,6 @@ static struct platform_device ceu1_device = { .dev = { .platform_data = &sh_mobile_ceu1_info, }, - .archdata = { - .hwblk_id = HWBLK_CEU1, - }, }; /* FSI */ @@ -310,9 +301,6 @@ static struct platform_device fsi_device = { .dev = { .platform_data = &fsi_info, }, - .archdata = { - .hwblk_id = HWBLK_SPU, /* FSI needs SPU hwblk */ - }, }; static struct platform_device fsi_ak4642_device = { @@ -355,9 +343,6 @@ static struct platform_device keysc_device = { .dev = { .platform_data = &keysc_info, }, - .archdata = { - .hwblk_id = HWBLK_KEYSC, - }, }; /* SH Eth */ @@ -386,9 +371,6 @@ static struct platform_device sh_eth_device = { }, .num_resources = ARRAY_SIZE(sh_eth_resources), .resource = sh_eth_resources, - .archdata = { - .hwblk_id = HWBLK_ETHER, - }, }; static struct r8a66597_platdata sh7724_usb0_host_data = { @@ -418,9 +400,6 @@ static struct platform_device sh7724_usb0_host_device = { }, .num_resources = ARRAY_SIZE(sh7724_usb0_host_resources), .resource = sh7724_usb0_host_resources, - .archdata = { - .hwblk_id = HWBLK_USB0, - }, }; static struct r8a66597_platdata sh7724_usb1_gadget_data = { @@ -479,9 +458,6 @@ static struct platform_device sdhi0_cn7_device = { .dev = { .platform_data = &sh7724_sdhi0_data, }, - .archdata = { - .hwblk_id = HWBLK_SDHI0, - }, }; static struct resource sdhi1_cn8_resources[] = { @@ -511,9 +487,6 @@ static struct platform_device sdhi1_cn8_device = { .dev = { .platform_data = &sh7724_sdhi1_data, }, - .archdata = { - .hwblk_id = HWBLK_SDHI1, - }, }; /* IrDA */ @@ -576,9 +549,6 @@ static struct platform_device vou_device = { .dev = { .platform_data = &sh_vou_pdata, }, - .archdata = { - .hwblk_id = HWBLK_VOU, - }, }; static struct platform_device *ms7724se_devices[] __initdata = { diff --git a/arch/sh/include/asm/device.h b/arch/sh/include/asm/device.h index 783ecdc64e2..a1c9c0daec1 100644 --- a/arch/sh/include/asm/device.h +++ b/arch/sh/include/asm/device.h @@ -15,5 +15,4 @@ int platform_resource_setup_memory(struct platform_device *pdev, void plat_early_device_setup(void); struct pdev_archdata { - int hwblk_id; }; diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c index 278a0e57215..65246ab8f97 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c @@ -173,9 +173,6 @@ struct platform_device dma_device = { .dev = { .platform_data = &dma_platform_data, }, - .archdata = { - .hwblk_id = HWBLK_DMAC, - }, }; /* Serial */ @@ -264,9 +261,6 @@ static struct platform_device rtc_device = { .id = -1, .num_resources = ARRAY_SIZE(rtc_resources), .resource = rtc_resources, - .archdata = { - .hwblk_id = HWBLK_RTC, - }, }; static struct m66592_platdata usbf_platdata = { @@ -297,9 +291,6 @@ static struct platform_device usbf_device = { }, .num_resources = ARRAY_SIZE(usbf_resources), .resource = usbf_resources, - .archdata = { - .hwblk_id = HWBLK_USBF, - }, }; static struct resource iic_resources[] = { @@ -321,9 +312,6 @@ static struct platform_device iic_device = { .id = 0, /* "i2c0" clock */ .num_resources = ARRAY_SIZE(iic_resources), .resource = iic_resources, - .archdata = { - .hwblk_id = HWBLK_IIC, - }, }; static struct uio_info vpu_platform_data = { @@ -352,9 +340,6 @@ static struct platform_device vpu_device = { }, .resource = vpu_resources, .num_resources = ARRAY_SIZE(vpu_resources), - .archdata = { - .hwblk_id = HWBLK_VPU, - }, }; static struct uio_info veu_platform_data = { @@ -383,9 +368,6 @@ static struct platform_device veu_device = { }, .resource = veu_resources, .num_resources = ARRAY_SIZE(veu_resources), - .archdata = { - .hwblk_id = HWBLK_VEU, - }, }; static struct uio_info jpu_platform_data = { @@ -414,9 +396,6 @@ static struct platform_device jpu_device = { }, .resource = jpu_resources, .num_resources = ARRAY_SIZE(jpu_resources), - .archdata = { - .hwblk_id = HWBLK_JPU, - }, }; static struct sh_timer_config cmt_platform_data = { @@ -446,9 +425,6 @@ static struct platform_device cmt_device = { }, .resource = cmt_resources, .num_resources = ARRAY_SIZE(cmt_resources), - .archdata = { - .hwblk_id = HWBLK_CMT, - }, }; static struct sh_timer_config tmu0_platform_data = { @@ -477,9 +453,6 @@ static struct platform_device tmu0_device = { }, .resource = tmu0_resources, .num_resources = ARRAY_SIZE(tmu0_resources), - .archdata = { - .hwblk_id = HWBLK_TMU, - }, }; static struct sh_timer_config tmu1_platform_data = { @@ -508,9 +481,6 @@ static struct platform_device tmu1_device = { }, .resource = tmu1_resources, .num_resources = ARRAY_SIZE(tmu1_resources), - .archdata = { - .hwblk_id = HWBLK_TMU, - }, }; static struct sh_timer_config tmu2_platform_data = { @@ -538,9 +508,6 @@ static struct platform_device tmu2_device = { }, .resource = tmu2_resources, .num_resources = ARRAY_SIZE(tmu2_resources), - .archdata = { - .hwblk_id = HWBLK_TMU, - }, }; static struct siu_platform siu_platform_data = { @@ -571,9 +538,6 @@ static struct platform_device siu_device = { }, .resource = siu_resources, .num_resources = ARRAY_SIZE(siu_resources), - .archdata = { - .hwblk_id = HWBLK_SIU, - }, }; static struct platform_device *sh7722_devices[] __initdata = { diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c index 3c2810d8f72..a188c9ea439 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c @@ -158,9 +158,6 @@ static struct platform_device vpu_device = { }, .resource = vpu_resources, .num_resources = ARRAY_SIZE(vpu_resources), - .archdata = { - .hwblk_id = HWBLK_VPU, - }, }; static struct uio_info veu0_platform_data = { @@ -189,9 +186,6 @@ static struct platform_device veu0_device = { }, .resource = veu0_resources, .num_resources = ARRAY_SIZE(veu0_resources), - .archdata = { - .hwblk_id = HWBLK_VEU2H0, - }, }; static struct uio_info veu1_platform_data = { @@ -220,9 +214,6 @@ static struct platform_device veu1_device = { }, .resource = veu1_resources, .num_resources = ARRAY_SIZE(veu1_resources), - .archdata = { - .hwblk_id = HWBLK_VEU2H1, - }, }; static struct sh_timer_config cmt_platform_data = { @@ -252,9 +243,6 @@ static struct platform_device cmt_device = { }, .resource = cmt_resources, .num_resources = ARRAY_SIZE(cmt_resources), - .archdata = { - .hwblk_id = HWBLK_CMT, - }, }; static struct sh_timer_config tmu0_platform_data = { @@ -283,9 +271,6 @@ static struct platform_device tmu0_device = { }, .resource = tmu0_resources, .num_resources = ARRAY_SIZE(tmu0_resources), - .archdata = { - .hwblk_id = HWBLK_TMU0, - }, }; static struct sh_timer_config tmu1_platform_data = { @@ -314,9 +299,6 @@ static struct platform_device tmu1_device = { }, .resource = tmu1_resources, .num_resources = ARRAY_SIZE(tmu1_resources), - .archdata = { - .hwblk_id = HWBLK_TMU0, - }, }; static struct sh_timer_config tmu2_platform_data = { @@ -344,9 +326,6 @@ static struct platform_device tmu2_device = { }, .resource = tmu2_resources, .num_resources = ARRAY_SIZE(tmu2_resources), - .archdata = { - .hwblk_id = HWBLK_TMU0, - }, }; static struct sh_timer_config tmu3_platform_data = { @@ -374,9 +353,6 @@ static struct platform_device tmu3_device = { }, .resource = tmu3_resources, .num_resources = ARRAY_SIZE(tmu3_resources), - .archdata = { - .hwblk_id = HWBLK_TMU1, - }, }; static struct sh_timer_config tmu4_platform_data = { @@ -404,9 +380,6 @@ static struct platform_device tmu4_device = { }, .resource = tmu4_resources, .num_resources = ARRAY_SIZE(tmu4_resources), - .archdata = { - .hwblk_id = HWBLK_TMU1, - }, }; static struct sh_timer_config tmu5_platform_data = { @@ -434,9 +407,6 @@ static struct platform_device tmu5_device = { }, .resource = tmu5_resources, .num_resources = ARRAY_SIZE(tmu5_resources), - .archdata = { - .hwblk_id = HWBLK_TMU1, - }, }; static struct resource rtc_resources[] = { @@ -467,9 +437,6 @@ static struct platform_device rtc_device = { .id = -1, .num_resources = ARRAY_SIZE(rtc_resources), .resource = rtc_resources, - .archdata = { - .hwblk_id = HWBLK_RTC, - }, }; static struct r8a66597_platdata r8a66597_data = { @@ -499,9 +466,6 @@ static struct platform_device sh7723_usb_host_device = { }, .num_resources = ARRAY_SIZE(sh7723_usb_host_resources), .resource = sh7723_usb_host_resources, - .archdata = { - .hwblk_id = HWBLK_USB, - }, }; static struct resource iic_resources[] = { @@ -523,9 +487,6 @@ static struct platform_device iic_device = { .id = 0, /* "i2c0" clock */ .num_resources = ARRAY_SIZE(iic_resources), .resource = iic_resources, - .archdata = { - .hwblk_id = HWBLK_IIC, - }, }; static struct platform_device *sh7723_devices[] __initdata = { diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c index a37dd72c367..7370aa94b9a 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c @@ -275,9 +275,6 @@ static struct platform_device dma0_device = { .dev = { .platform_data = &dma_platform_data, }, - .archdata = { - .hwblk_id = HWBLK_DMAC0, - }, }; static struct platform_device dma1_device = { @@ -288,9 +285,6 @@ static struct platform_device dma1_device = { .dev = { .platform_data = &dma_platform_data, }, - .archdata = { - .hwblk_id = HWBLK_DMAC1, - }, }; /* Serial */ @@ -434,9 +428,6 @@ static struct platform_device rtc_device = { .id = -1, .num_resources = ARRAY_SIZE(rtc_resources), .resource = rtc_resources, - .archdata = { - .hwblk_id = HWBLK_RTC, - }, }; /* I2C0 */ @@ -459,9 +450,6 @@ static struct platform_device iic0_device = { .id = 0, /* "i2c0" clock */ .num_resources = ARRAY_SIZE(iic0_resources), .resource = iic0_resources, - .archdata = { - .hwblk_id = HWBLK_IIC0, - }, }; /* I2C1 */ @@ -484,9 +472,6 @@ static struct platform_device iic1_device = { .id = 1, /* "i2c1" clock */ .num_resources = ARRAY_SIZE(iic1_resources), .resource = iic1_resources, - .archdata = { - .hwblk_id = HWBLK_IIC1, - }, }; /* VPU */ @@ -516,9 +501,6 @@ static struct platform_device vpu_device = { }, .resource = vpu_resources, .num_resources = ARRAY_SIZE(vpu_resources), - .archdata = { - .hwblk_id = HWBLK_VPU, - }, }; /* VEU0 */ @@ -548,9 +530,6 @@ static struct platform_device veu0_device = { }, .resource = veu0_resources, .num_resources = ARRAY_SIZE(veu0_resources), - .archdata = { - .hwblk_id = HWBLK_VEU0, - }, }; /* VEU1 */ @@ -580,9 +559,6 @@ static struct platform_device veu1_device = { }, .resource = veu1_resources, .num_resources = ARRAY_SIZE(veu1_resources), - .archdata = { - .hwblk_id = HWBLK_VEU1, - }, }; /* BEU0 */ @@ -612,9 +588,6 @@ static struct platform_device beu0_device = { }, .resource = beu0_resources, .num_resources = ARRAY_SIZE(beu0_resources), - .archdata = { - .hwblk_id = HWBLK_BEU0, - }, }; /* BEU1 */ @@ -644,9 +617,6 @@ static struct platform_device beu1_device = { }, .resource = beu1_resources, .num_resources = ARRAY_SIZE(beu1_resources), - .archdata = { - .hwblk_id = HWBLK_BEU1, - }, }; static struct sh_timer_config cmt_platform_data = { @@ -676,9 +646,6 @@ static struct platform_device cmt_device = { }, .resource = cmt_resources, .num_resources = ARRAY_SIZE(cmt_resources), - .archdata = { - .hwblk_id = HWBLK_CMT, - }, }; static struct sh_timer_config tmu0_platform_data = { @@ -707,9 +674,6 @@ static struct platform_device tmu0_device = { }, .resource = tmu0_resources, .num_resources = ARRAY_SIZE(tmu0_resources), - .archdata = { - .hwblk_id = HWBLK_TMU0, - }, }; static struct sh_timer_config tmu1_platform_data = { @@ -738,9 +702,6 @@ static struct platform_device tmu1_device = { }, .resource = tmu1_resources, .num_resources = ARRAY_SIZE(tmu1_resources), - .archdata = { - .hwblk_id = HWBLK_TMU0, - }, }; static struct sh_timer_config tmu2_platform_data = { @@ -768,9 +729,6 @@ static struct platform_device tmu2_device = { }, .resource = tmu2_resources, .num_resources = ARRAY_SIZE(tmu2_resources), - .archdata = { - .hwblk_id = HWBLK_TMU0, - }, }; @@ -799,9 +757,6 @@ static struct platform_device tmu3_device = { }, .resource = tmu3_resources, .num_resources = ARRAY_SIZE(tmu3_resources), - .archdata = { - .hwblk_id = HWBLK_TMU1, - }, }; static struct sh_timer_config tmu4_platform_data = { @@ -829,9 +784,6 @@ static struct platform_device tmu4_device = { }, .resource = tmu4_resources, .num_resources = ARRAY_SIZE(tmu4_resources), - .archdata = { - .hwblk_id = HWBLK_TMU1, - }, }; static struct sh_timer_config tmu5_platform_data = { @@ -859,9 +811,6 @@ static struct platform_device tmu5_device = { }, .resource = tmu5_resources, .num_resources = ARRAY_SIZE(tmu5_resources), - .archdata = { - .hwblk_id = HWBLK_TMU1, - }, }; /* JPU */ @@ -891,9 +840,6 @@ static struct platform_device jpu_device = { }, .resource = jpu_resources, .num_resources = ARRAY_SIZE(jpu_resources), - .archdata = { - .hwblk_id = HWBLK_JPU, - }, }; /* SPU2DSP0 */ @@ -923,9 +869,6 @@ static struct platform_device spu0_device = { }, .resource = spu0_resources, .num_resources = ARRAY_SIZE(spu0_resources), - .archdata = { - .hwblk_id = HWBLK_SPU, - }, }; /* SPU2DSP1 */ @@ -955,9 +898,6 @@ static struct platform_device spu1_device = { }, .resource = spu1_resources, .num_resources = ARRAY_SIZE(spu1_resources), - .archdata = { - .hwblk_id = HWBLK_SPU, - }, }; static struct platform_device *sh7724_devices[] __initdata = { -- cgit v1.2.3 From cfc806a7ee38e68a9363584dd2b00421fda6dfed Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Fri, 18 Nov 2011 16:26:00 +0900 Subject: sh: hwblk: Kill off remaining bits of hwblk API. Now that everything has been migrated, kill off the remaining infrastructure bits. Signed-off-by: Paul Mundt --- arch/sh/include/asm/hwblk.h | 74 --------------------- arch/sh/kernel/cpu/Makefile | 3 - arch/sh/kernel/cpu/hwblk.c | 154 -------------------------------------------- arch/sh/kernel/time.c | 2 - 4 files changed, 233 deletions(-) delete mode 100644 arch/sh/include/asm/hwblk.h delete mode 100644 arch/sh/kernel/cpu/hwblk.c (limited to 'arch') diff --git a/arch/sh/include/asm/hwblk.h b/arch/sh/include/asm/hwblk.h deleted file mode 100644 index 75d50d9bf0a..00000000000 --- a/arch/sh/include/asm/hwblk.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef __ASM_SH_HWBLK_H -#define __ASM_SH_HWBLK_H - -#include -#include - -#define HWBLK_CNT_USAGE 0 -#define HWBLK_CNT_IDLE 1 -#define HWBLK_CNT_DEVICES 2 -#define HWBLK_CNT_NR 3 - -#define HWBLK_AREA_FLAG_PARENT (1 << 0) /* valid parent */ - -#define HWBLK_AREA(_flags, _parent) \ -{ \ - .flags = _flags, \ - .parent = _parent, \ -} - -struct hwblk_area { - int cnt[HWBLK_CNT_NR]; - unsigned char parent; - unsigned char flags; -}; - -#define HWBLK(_mstp, _bit, _area) \ -{ \ - .mstp = (void __iomem *)_mstp, \ - .bit = _bit, \ - .area = _area, \ -} - -struct hwblk { - void __iomem *mstp; - unsigned char bit; - unsigned char area; - int cnt[HWBLK_CNT_NR]; -}; - -struct hwblk_info { - struct hwblk_area *areas; - int nr_areas; - struct hwblk *hwblks; - int nr_hwblks; -}; - -#if !defined(CONFIG_CPU_SUBTYPE_SH7722) && \ - !defined(CONFIG_CPU_SUBTYPE_SH7723) && \ - !defined(CONFIG_CPU_SUBTYPE_SH7724) -/* Should be defined by processor-specific code */ -int arch_hwblk_init(void); - -int hwblk_register(struct hwblk_info *info); -int hwblk_init(void); - -void hwblk_enable(struct hwblk_info *info, int hwblk); -void hwblk_disable(struct hwblk_info *info, int hwblk); - -void hwblk_cnt_inc(struct hwblk_info *info, int hwblk, int cnt); -void hwblk_cnt_dec(struct hwblk_info *info, int hwblk, int cnt); - -/* allow clocks to enable and disable hardware blocks */ -#define SH_HWBLK_CLK(_hwblk, _parent, _flags) \ -[_hwblk] = { \ - .parent = _parent, \ - .arch_flags = _hwblk, \ - .flags = _flags, \ -} - -int sh_hwblk_clk_register(struct clk *clks, int nr); -#else -#define hwblk_init() 0 -#endif -#endif /* __ASM_SH_HWBLK_H */ diff --git a/arch/sh/kernel/cpu/Makefile b/arch/sh/kernel/cpu/Makefile index 5366fdf8c56..fa58bfd30d8 100644 --- a/arch/sh/kernel/cpu/Makefile +++ b/arch/sh/kernel/cpu/Makefile @@ -19,6 +19,3 @@ obj-$(CONFIG_SH_ADC) += adc.o obj-$(CONFIG_SH_CLK_CPG_LEGACY) += clock-cpg.o obj-y += irq/ init.o clock.o fpu.o proc.o -ifneq ($(CONFIG_CPU_SUBTYPE_SH7722)$(CONFIG_CPU_SUBTYPE_SH7723)$(CONFIG_CPU_SUBTYPE_SH7724),y) -obj-y += hwblk.o -endif diff --git a/arch/sh/kernel/cpu/hwblk.c b/arch/sh/kernel/cpu/hwblk.c deleted file mode 100644 index 00bab455a01..00000000000 --- a/arch/sh/kernel/cpu/hwblk.c +++ /dev/null @@ -1,154 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -static DEFINE_SPINLOCK(hwblk_lock); - -static void hwblk_area_mod_cnt(struct hwblk_info *info, - int area, int counter, int value, int goal) -{ - struct hwblk_area *hap = info->areas + area; - - hap->cnt[counter] += value; - - if (hap->cnt[counter] != goal) - return; - - if (hap->flags & HWBLK_AREA_FLAG_PARENT) - hwblk_area_mod_cnt(info, hap->parent, counter, value, goal); -} - - -static int __hwblk_mod_cnt(struct hwblk_info *info, int hwblk, - int counter, int value, int goal) -{ - struct hwblk *hp = info->hwblks + hwblk; - - hp->cnt[counter] += value; - if (hp->cnt[counter] == goal) - hwblk_area_mod_cnt(info, hp->area, counter, value, goal); - - return hp->cnt[counter]; -} - -static void hwblk_mod_cnt(struct hwblk_info *info, int hwblk, - int counter, int value, int goal) -{ - unsigned long flags; - - spin_lock_irqsave(&hwblk_lock, flags); - __hwblk_mod_cnt(info, hwblk, counter, value, goal); - spin_unlock_irqrestore(&hwblk_lock, flags); -} - -void hwblk_cnt_inc(struct hwblk_info *info, int hwblk, int counter) -{ - hwblk_mod_cnt(info, hwblk, counter, 1, 1); -} - -void hwblk_cnt_dec(struct hwblk_info *info, int hwblk, int counter) -{ - hwblk_mod_cnt(info, hwblk, counter, -1, 0); -} - -void hwblk_enable(struct hwblk_info *info, int hwblk) -{ - struct hwblk *hp = info->hwblks + hwblk; - unsigned long tmp; - unsigned long flags; - int ret; - - spin_lock_irqsave(&hwblk_lock, flags); - - ret = __hwblk_mod_cnt(info, hwblk, HWBLK_CNT_USAGE, 1, 1); - if (ret == 1) { - tmp = __raw_readl(hp->mstp); - tmp &= ~(1 << hp->bit); - __raw_writel(tmp, hp->mstp); - } - - spin_unlock_irqrestore(&hwblk_lock, flags); -} - -void hwblk_disable(struct hwblk_info *info, int hwblk) -{ - struct hwblk *hp = info->hwblks + hwblk; - unsigned long tmp; - unsigned long flags; - int ret; - - spin_lock_irqsave(&hwblk_lock, flags); - - ret = __hwblk_mod_cnt(info, hwblk, HWBLK_CNT_USAGE, -1, 0); - if (ret == 0) { - tmp = __raw_readl(hp->mstp); - tmp |= 1 << hp->bit; - __raw_writel(tmp, hp->mstp); - } - - spin_unlock_irqrestore(&hwblk_lock, flags); -} - -struct hwblk_info *hwblk_info; - -int __init hwblk_register(struct hwblk_info *info) -{ - hwblk_info = info; - return 0; -} - -int __init __weak arch_hwblk_init(void) -{ - return 0; -} - -int __init hwblk_init(void) -{ - return arch_hwblk_init(); -} - -/* allow clocks to enable and disable hardware blocks */ -static int sh_hwblk_clk_enable(struct clk *clk) -{ - if (!hwblk_info) - return -ENOENT; - - hwblk_enable(hwblk_info, clk->arch_flags); - return 0; -} - -static void sh_hwblk_clk_disable(struct clk *clk) -{ - if (hwblk_info) - hwblk_disable(hwblk_info, clk->arch_flags); -} - -static struct clk_ops sh_hwblk_clk_ops = { - .enable = sh_hwblk_clk_enable, - .disable = sh_hwblk_clk_disable, - .recalc = followparent_recalc, -}; - -int __init sh_hwblk_clk_register(struct clk *clks, int nr) -{ - struct clk *clkp; - int ret = 0; - int k; - - for (k = 0; !ret && (k < nr); k++) { - clkp = clks + k; - - /* skip over clocks using hwblk 0 (HWBLK_UNKNOWN) */ - if (!clkp->arch_flags) - continue; - - clkp->ops = &sh_hwblk_clk_ops; - ret |= clk_register(clkp); - } - - return ret; -} diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index 8a0072de2bc..552c8fcf941 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c @@ -21,7 +21,6 @@ #include #include #include -#include #include /* Dummy RTC ops */ @@ -110,7 +109,6 @@ void __init time_init(void) if (board_time_init) board_time_init(); - hwblk_init(); clk_init(); late_time_init = sh_late_time_init; -- cgit v1.2.3 From 615c36f53581b9bd19354947f50a4b416d003f35 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 21 Nov 2011 18:59:54 -0800 Subject: sh: sh7724.h: bugfix: remove unused clock index Current sh clocks are using pm_runtime frame work instead of old hwblk. So, HWBLK_UNKNOWN and HWBLK_DBG are not needed for now. Now mstp32 clocks are registered by sh_clk_mstp32_register(), but the clock which isn't defined by SH_CLK_MSTP32() macro will be crash. because it doesn't have enable_reg. Signed-off-by: Kuninori Morimoto Signed-off-by: Paul Mundt --- arch/sh/include/cpu-sh4/cpu/sh7724.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/sh/include/cpu-sh4/cpu/sh7724.h b/arch/sh/include/cpu-sh4/cpu/sh7724.h index cbc47e6bcab..ea9ada37b50 100644 --- a/arch/sh/include/cpu-sh4/cpu/sh7724.h +++ b/arch/sh/include/cpu-sh4/cpu/sh7724.h @@ -268,10 +268,9 @@ enum { }; enum { - HWBLK_UNKNOWN = 0, HWBLK_TLB, HWBLK_IC, HWBLK_OC, HWBLK_RSMEM, HWBLK_ILMEM, HWBLK_L2C, HWBLK_FPU, HWBLK_INTC, HWBLK_DMAC0, HWBLK_SHYWAY, - HWBLK_HUDI, HWBLK_DBG, HWBLK_UBC, + HWBLK_HUDI, HWBLK_UBC, HWBLK_TMU0, HWBLK_CMT, HWBLK_RWDT, HWBLK_DMAC1, HWBLK_TMU1, HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2, HWBLK_SCIF3, HWBLK_SCIF4, HWBLK_SCIF5, HWBLK_MSIOF0, HWBLK_MSIOF1, -- cgit v1.2.3 From 544089a9f654832125ee4602e48636139a17aa00 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 21 Nov 2011 19:00:04 -0800 Subject: sh: sh7723.h: bugfix: remove unused clock index Current sh clocks are using pm_runtime frame work instead of old hwblk. So, HWBLK_UNKNOWN, HWBLK_DBG and HWBLK_SUBC are not needed for now. Now mstp32 clocks are registered by sh_clk_mstp32_register(), but the clock which isn't defined by SH_CLK_MSTP32() macro will be crash. because it doesn't have enable_reg. Signed-off-by: Kuninori Morimoto Signed-off-by: Paul Mundt --- arch/sh/include/cpu-sh4/cpu/sh7723.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/sh/include/cpu-sh4/cpu/sh7723.h b/arch/sh/include/cpu-sh4/cpu/sh7723.h index 9b36fae7232..6fae50cb1e9 100644 --- a/arch/sh/include/cpu-sh4/cpu/sh7723.h +++ b/arch/sh/include/cpu-sh4/cpu/sh7723.h @@ -266,10 +266,9 @@ enum { }; enum { - HWBLK_UNKNOWN = 0, HWBLK_TLB, HWBLK_IC, HWBLK_OC, HWBLK_L2C, HWBLK_ILMEM, HWBLK_FPU, HWBLK_INTC, HWBLK_DMAC0, HWBLK_SHYWAY, - HWBLK_HUDI, HWBLK_DBG, HWBLK_UBC, HWBLK_SUBC, + HWBLK_HUDI, HWBLK_UBC, HWBLK_TMU0, HWBLK_CMT, HWBLK_RWDT, HWBLK_DMAC1, HWBLK_TMU1, HWBLK_FLCTL, HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2, -- cgit v1.2.3 From a319add1e24c43d285b781332cfa532405466650 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Wed, 23 Nov 2011 22:53:46 +0100 Subject: sh: sh7722: fix Oops: remove empty clock entries Unused indices produce empty entries in the clock array, which then lead to Oopses at boot-time. Reported-by: Kuninori Morimoto Signed-off-by: Guennadi Liakhovetski Signed-off-by: Paul Mundt --- arch/sh/include/cpu-sh4/cpu/sh7722.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'arch') diff --git a/arch/sh/include/cpu-sh4/cpu/sh7722.h b/arch/sh/include/cpu-sh4/cpu/sh7722.h index bd0622788d6..3bb74e534d0 100644 --- a/arch/sh/include/cpu-sh4/cpu/sh7722.h +++ b/arch/sh/include/cpu-sh4/cpu/sh7722.h @@ -222,14 +222,11 @@ enum { }; enum { - HWBLK_UNKNOWN = 0, - HWBLK_TLB, HWBLK_IC, HWBLK_OC, HWBLK_URAM, HWBLK_XYMEM, - HWBLK_INTC, HWBLK_DMAC, HWBLK_SHYWAY, HWBLK_HUDI, - HWBLK_UBC, HWBLK_TMU, HWBLK_CMT, HWBLK_RWDT, HWBLK_FLCTL, - HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2, HWBLK_SIO, - HWBLK_SIOF0, HWBLK_SIOF1, HWBLK_IIC, HWBLK_RTC, - HWBLK_TPU, HWBLK_IRDA, HWBLK_SDHI, HWBLK_SIM, HWBLK_KEYSC, - HWBLK_TSIF, HWBLK_USBF, HWBLK_2DG, HWBLK_SIU, HWBLK_VOU, + HWBLK_URAM, HWBLK_XYMEM, + HWBLK_TMU, HWBLK_CMT, HWBLK_RWDT, HWBLK_FLCTL, + HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2, HWBLK_IIC, HWBLK_RTC, + HWBLK_SDHI, HWBLK_KEYSC, + HWBLK_USBF, HWBLK_2DG, HWBLK_SIU, HWBLK_VOU, HWBLK_JPU, HWBLK_BEU, HWBLK_CEU, HWBLK_VEU, HWBLK_VPU, HWBLK_LCDC, HWBLK_NR, -- cgit v1.2.3