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/kernel/cpu/hwblk.c | 5 ----- arch/sh/kernel/cpu/shmobile/cpuidle.c | 3 +-- 2 files changed, 1 insertion(+), 7 deletions(-) (limited to 'arch/sh/kernel') diff --git a/arch/sh/kernel/cpu/hwblk.c b/arch/sh/kernel/cpu/hwblk.c index 3e985aa..00bab45 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 1cc257c..6d62eb4 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.1 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/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 ---------------------------------- 3 files changed, 135 deletions(-) (limited to 'arch/sh/kernel') diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c index 278a0e5..65246ab8 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 3c2810d..a188c9e 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 a37dd72..7370aa94 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.1 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/kernel/cpu/Makefile | 3 - arch/sh/kernel/cpu/hwblk.c | 154 -------------------------------------------- arch/sh/kernel/time.c | 2 - 3 files changed, 159 deletions(-) delete mode 100644 arch/sh/kernel/cpu/hwblk.c (limited to 'arch/sh/kernel') diff --git a/arch/sh/kernel/cpu/Makefile b/arch/sh/kernel/cpu/Makefile index 5366fdf..fa58bfd 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 00bab45..0000000 --- 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 8a0072d..552c8fc 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.1