Skip to content

Commit 7f80850

Browse files
committed
Merge branch 'rmobile-fixes-for-linus' of git://github.com/pmundt/linux-sh
* 'rmobile-fixes-for-linus' of git://github.com/pmundt/linux-sh: ARM: mach-shmobile: cpuidle single/global and last_state fixes ARM: mach-shmobile: move helper macro PORTCR to sh_pfc.h ARM: mach-shmobile: move helper macro PORT_xx to sh_pfc.h ARM: mach-shmobile: move helper macro PORT_DATA_xx to sh_pfc.h ARM: mach-shmobile: ap4evb: remove white space from end of line ARM: mach-shmobile: clock-sh7372: remove un-necessary index ARM: mach-shmobile: kota2: add comment out separator ARM: mach-shmobile: sh73a0: add MMC data pin pull-up
2 parents b93cd6a + b73b5c4 commit 7f80850

13 files changed

Lines changed: 400 additions & 523 deletions

File tree

‎arch/arm/mach-shmobile/board-ag5evm.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -515,14 +515,14 @@ static void __init ag5evm_init(void)
515515
/* enable MMCIF */
516516
gpio_request(GPIO_FN_MMCCLK0, NULL);
517517
gpio_request(GPIO_FN_MMCCMD0_PU, NULL);
518-
gpio_request(GPIO_FN_MMCD0_0, NULL);
519-
gpio_request(GPIO_FN_MMCD0_1, NULL);
520-
gpio_request(GPIO_FN_MMCD0_2, NULL);
521-
gpio_request(GPIO_FN_MMCD0_3, NULL);
522-
gpio_request(GPIO_FN_MMCD0_4, NULL);
523-
gpio_request(GPIO_FN_MMCD0_5, NULL);
524-
gpio_request(GPIO_FN_MMCD0_6, NULL);
525-
gpio_request(GPIO_FN_MMCD0_7, NULL);
518+
gpio_request(GPIO_FN_MMCD0_0_PU, NULL);
519+
gpio_request(GPIO_FN_MMCD0_1_PU, NULL);
520+
gpio_request(GPIO_FN_MMCD0_2_PU, NULL);
521+
gpio_request(GPIO_FN_MMCD0_3_PU, NULL);
522+
gpio_request(GPIO_FN_MMCD0_4_PU, NULL);
523+
gpio_request(GPIO_FN_MMCD0_5_PU, NULL);
524+
gpio_request(GPIO_FN_MMCD0_6_PU, NULL);
525+
gpio_request(GPIO_FN_MMCD0_7_PU, NULL);
526526
gpio_request(GPIO_PORT208, NULL); /* Reset */
527527
gpio_direction_output(GPIO_PORT208, 1);
528528

‎arch/arm/mach-shmobile/board-ap4evb.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static struct physmap_flash_data nor_flash_data = {
201201
static struct resource nor_flash_resources[] = {
202202
[0] = {
203203
.start = 0x20000000, /* CS0 shadow instead of regular CS0 */
204-
.end = 0x28000000 - 1, /* needed by USB MASK ROM boot */
204+
.end = 0x28000000 - 1, /* needed by USB MASK ROM boot */
205205
.flags = IORESOURCE_MEM,
206206
}
207207
};

‎arch/arm/mach-shmobile/board-kota2.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#include <asm/hardware/cache-l2x0.h>
4949
#include <asm/traps.h>
5050

51+
/* SMSC 9220 */
5152
static struct resource smsc9220_resources[] = {
5253
[0] = {
5354
.start = 0x14000000, /* CS5A */
@@ -77,6 +78,7 @@ static struct platform_device eth_device = {
7778
.num_resources = ARRAY_SIZE(smsc9220_resources),
7879
};
7980

81+
/* KEYSC */
8082
static struct sh_keysc_info keysc_platdata = {
8183
.mode = SH_KEYSC_MODE_6,
8284
.scan_timing = 3,
@@ -120,6 +122,7 @@ static struct platform_device keysc_device = {
120122
},
121123
};
122124

125+
/* GPIO KEY */
123126
#define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
124127

125128
static struct gpio_keys_button gpio_buttons[] = {
@@ -150,6 +153,7 @@ static struct platform_device gpio_keys_device = {
150153
},
151154
};
152155

156+
/* GPIO LED */
153157
#define GPIO_LED(n, g) { .name = n, .gpio = g }
154158

155159
static struct gpio_led gpio_leds[] = {
@@ -175,6 +179,7 @@ static struct platform_device gpio_leds_device = {
175179
},
176180
};
177181

182+
/* MMCIF */
178183
static struct resource mmcif_resources[] = {
179184
[0] = {
180185
.name = "MMCIF",
@@ -207,6 +212,7 @@ static struct platform_device mmcif_device = {
207212
.resource = mmcif_resources,
208213
};
209214

215+
/* SDHI0 */
210216
static struct sh_mobile_sdhi_info sdhi0_info = {
211217
.tmio_caps = MMC_CAP_SD_HIGHSPEED,
212218
.tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
@@ -243,6 +249,7 @@ static struct platform_device sdhi0_device = {
243249
},
244250
};
245251

252+
/* SDHI1 */
246253
static struct sh_mobile_sdhi_info sdhi1_info = {
247254
.tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
248255
.tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,

‎arch/arm/mach-shmobile/clock-sh7372.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,26 +476,26 @@ static struct clk_ops fsidiv_clk_ops = {
476476
.disable = fsidiv_disable,
477477
};
478478

479-
static struct clk_mapping sh7372_fsidiva_clk_mapping = {
479+
static struct clk_mapping fsidiva_clk_mapping = {
480480
.phys = FSIDIVA,
481481
.len = 8,
482482
};
483483

484484
struct clk sh7372_fsidiva_clk = {
485485
.ops = &fsidiv_clk_ops,
486486
.parent = &div6_reparent_clks[DIV6_FSIA], /* late install */
487-
.mapping = &sh7372_fsidiva_clk_mapping,
487+
.mapping = &fsidiva_clk_mapping,
488488
};
489489

490-
static struct clk_mapping sh7372_fsidivb_clk_mapping = {
490+
static struct clk_mapping fsidivb_clk_mapping = {
491491
.phys = FSIDIVB,
492492
.len = 8,
493493
};
494494

495495
struct clk sh7372_fsidivb_clk = {
496496
.ops = &fsidiv_clk_ops,
497497
.parent = &div6_reparent_clks[DIV6_FSIB], /* late install */
498-
.mapping = &sh7372_fsidivb_clk_mapping,
498+
.mapping = &fsidivb_clk_mapping,
499499
};
500500

501501
static struct clk *late_main_clks[] = {

‎arch/arm/mach-shmobile/cpuidle.c‎

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -26,65 +26,59 @@ void (*shmobile_cpuidle_modes[CPUIDLE_STATE_MAX])(void) = {
2626
};
2727

2828
static int shmobile_cpuidle_enter(struct cpuidle_device *dev,
29-
struct cpuidle_state *state)
29+
struct cpuidle_driver *drv,
30+
int index)
3031
{
3132
ktime_t before, after;
32-
int requested_state = state - &dev->states[0];
3333

34-
dev->last_state = &dev->states[requested_state];
3534
before = ktime_get();
3635

3736
local_irq_disable();
3837
local_fiq_disable();
3938

40-
shmobile_cpuidle_modes[requested_state]();
39+
shmobile_cpuidle_modes[index]();
4140

4241
local_irq_enable();
4342
local_fiq_enable();
4443

4544
after = ktime_get();
46-
return ktime_to_ns(ktime_sub(after, before)) >> 10;
45+
dev->last_residency = ktime_to_ns(ktime_sub(after, before)) >> 10;
46+
47+
return index;
4748
}
4849

4950
static struct cpuidle_device shmobile_cpuidle_dev;
5051
static struct cpuidle_driver shmobile_cpuidle_driver = {
5152
.name = "shmobile_cpuidle",
5253
.owner = THIS_MODULE,
54+
.states[0] = {
55+
.name = "C1",
56+
.desc = "WFI",
57+
.exit_latency = 1,
58+
.target_residency = 1 * 2,
59+
.flags = CPUIDLE_FLAG_TIME_VALID,
60+
},
61+
.safe_state_index = 0, /* C1 */
62+
.state_count = 1,
5363
};
5464

55-
void (*shmobile_cpuidle_setup)(struct cpuidle_device *dev);
65+
void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv);
5666

5767
static int shmobile_cpuidle_init(void)
5868
{
5969
struct cpuidle_device *dev = &shmobile_cpuidle_dev;
60-
struct cpuidle_state *state;
70+
struct cpuidle_driver *drv = &shmobile_cpuidle_driver;
6171
int i;
6272

63-
cpuidle_register_driver(&shmobile_cpuidle_driver);
64-
65-
for (i = 0; i < CPUIDLE_STATE_MAX; i++) {
66-
dev->states[i].name[0] = '\0';
67-
dev->states[i].desc[0] = '\0';
68-
dev->states[i].enter = shmobile_cpuidle_enter;
69-
}
70-
71-
i = CPUIDLE_DRIVER_STATE_START;
72-
73-
state = &dev->states[i++];
74-
snprintf(state->name, CPUIDLE_NAME_LEN, "C1");
75-
strncpy(state->desc, "WFI", CPUIDLE_DESC_LEN);
76-
state->exit_latency = 1;
77-
state->target_residency = 1 * 2;
78-
state->power_usage = 3;
79-
state->flags = 0;
80-
state->flags |= CPUIDLE_FLAG_TIME_VALID;
81-
82-
dev->safe_state = state;
83-
dev->state_count = i;
73+
for (i = 0; i < CPUIDLE_STATE_MAX; i++)
74+
drv->states[i].enter = shmobile_cpuidle_enter;
8475

8576
if (shmobile_cpuidle_setup)
86-
shmobile_cpuidle_setup(dev);
77+
shmobile_cpuidle_setup(drv);
78+
79+
cpuidle_register_driver(drv);
8780

81+
dev->state_count = drv->state_count;
8882
cpuidle_register_device(dev);
8983

9084
return 0;

‎arch/arm/mach-shmobile/include/mach/common.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ extern int clk_init(void);
99
extern void shmobile_handle_irq_intc(struct pt_regs *);
1010
extern void shmobile_handle_irq_gic(struct pt_regs *);
1111
extern struct platform_suspend_ops shmobile_suspend_ops;
12-
struct cpuidle_device;
12+
struct cpuidle_driver;
1313
extern void (*shmobile_cpuidle_modes[])(void);
14-
extern void (*shmobile_cpuidle_setup)(struct cpuidle_device *dev);
14+
extern void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv);
1515

1616
extern void sh7367_init_irq(void);
1717
extern void sh7367_add_early_devices(void);

‎arch/arm/mach-shmobile/include/mach/sh73a0.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,14 @@ enum {
470470
GPIO_FN_SDHICMD2_PU,
471471
GPIO_FN_MMCCMD0_PU,
472472
GPIO_FN_MMCCMD1_PU,
473+
GPIO_FN_MMCD0_0_PU,
474+
GPIO_FN_MMCD0_1_PU,
475+
GPIO_FN_MMCD0_2_PU,
476+
GPIO_FN_MMCD0_3_PU,
477+
GPIO_FN_MMCD0_4_PU,
478+
GPIO_FN_MMCD0_5_PU,
479+
GPIO_FN_MMCD0_6_PU,
480+
GPIO_FN_MMCD0_7_PU,
473481
GPIO_FN_FSIACK_PU,
474482
GPIO_FN_FSIAILR_PU,
475483
GPIO_FN_FSIAIBT_PU,

0 commit comments

Comments
 (0)