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

Commit 7f80850d authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
parents b93cd6a0 b73b5c49
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -515,14 +515,14 @@ static void __init ag5evm_init(void)
	/* enable MMCIF */
	gpio_request(GPIO_FN_MMCCLK0, NULL);
	gpio_request(GPIO_FN_MMCCMD0_PU, NULL);
	gpio_request(GPIO_FN_MMCD0_0, NULL);
	gpio_request(GPIO_FN_MMCD0_1, NULL);
	gpio_request(GPIO_FN_MMCD0_2, NULL);
	gpio_request(GPIO_FN_MMCD0_3, NULL);
	gpio_request(GPIO_FN_MMCD0_4, NULL);
	gpio_request(GPIO_FN_MMCD0_5, NULL);
	gpio_request(GPIO_FN_MMCD0_6, NULL);
	gpio_request(GPIO_FN_MMCD0_7, NULL);
	gpio_request(GPIO_FN_MMCD0_0_PU, NULL);
	gpio_request(GPIO_FN_MMCD0_1_PU, NULL);
	gpio_request(GPIO_FN_MMCD0_2_PU, NULL);
	gpio_request(GPIO_FN_MMCD0_3_PU, NULL);
	gpio_request(GPIO_FN_MMCD0_4_PU, NULL);
	gpio_request(GPIO_FN_MMCD0_5_PU, NULL);
	gpio_request(GPIO_FN_MMCD0_6_PU, NULL);
	gpio_request(GPIO_FN_MMCD0_7_PU, NULL);
	gpio_request(GPIO_PORT208, NULL); /* Reset */
	gpio_direction_output(GPIO_PORT208, 1);

+7 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@
#include <asm/hardware/cache-l2x0.h>
#include <asm/traps.h>

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

/* KEYSC */
static struct sh_keysc_info keysc_platdata = {
	.mode		= SH_KEYSC_MODE_6,
	.scan_timing	= 3,
@@ -120,6 +122,7 @@ static struct platform_device keysc_device = {
	},
};

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

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

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

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

/* MMCIF */
static struct resource mmcif_resources[] = {
	[0] = {
		.name   = "MMCIF",
@@ -207,6 +212,7 @@ static struct platform_device mmcif_device = {
	.resource       = mmcif_resources,
};

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

/* SDHI1 */
static struct sh_mobile_sdhi_info sdhi1_info = {
	.tmio_caps      = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
	.tmio_flags     = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
+4 −4
Original line number Diff line number Diff line
@@ -476,7 +476,7 @@ static struct clk_ops fsidiv_clk_ops = {
	.disable	= fsidiv_disable,
};

static struct clk_mapping sh7372_fsidiva_clk_mapping = {
static struct clk_mapping fsidiva_clk_mapping = {
	.phys	= FSIDIVA,
	.len	= 8,
};
@@ -484,10 +484,10 @@ static struct clk_mapping sh7372_fsidiva_clk_mapping = {
struct clk sh7372_fsidiva_clk = {
	.ops		= &fsidiv_clk_ops,
	.parent		= &div6_reparent_clks[DIV6_FSIA], /* late install */
	.mapping	= &sh7372_fsidiva_clk_mapping,
	.mapping	= &fsidiva_clk_mapping,
};

static struct clk_mapping sh7372_fsidivb_clk_mapping = {
static struct clk_mapping fsidivb_clk_mapping = {
	.phys	= FSIDIVB,
	.len	= 8,
};
@@ -495,7 +495,7 @@ static struct clk_mapping sh7372_fsidivb_clk_mapping = {
struct clk sh7372_fsidivb_clk = {
	.ops		= &fsidiv_clk_ops,
	.parent		= &div6_reparent_clks[DIV6_FSIB],  /* late install */
	.mapping	= &sh7372_fsidivb_clk_mapping,
	.mapping	= &fsidivb_clk_mapping,
};

static struct clk *late_main_clks[] = {
+23 −29
Original line number Diff line number Diff line
@@ -26,65 +26,59 @@ void (*shmobile_cpuidle_modes[CPUIDLE_STATE_MAX])(void) = {
};

static int shmobile_cpuidle_enter(struct cpuidle_device *dev,
				  struct cpuidle_state *state)
				  struct cpuidle_driver *drv,
				  int index)
{
	ktime_t before, after;
	int requested_state = state - &dev->states[0];

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

	local_irq_disable();
	local_fiq_disable();

	shmobile_cpuidle_modes[requested_state]();
	shmobile_cpuidle_modes[index]();

	local_irq_enable();
	local_fiq_enable();

	after = ktime_get();
	return ktime_to_ns(ktime_sub(after, before)) >> 10;
	dev->last_residency = ktime_to_ns(ktime_sub(after, before)) >> 10;

	return index;
}

static struct cpuidle_device shmobile_cpuidle_dev;
static struct cpuidle_driver shmobile_cpuidle_driver = {
	.name =		"shmobile_cpuidle",
	.owner =	THIS_MODULE,
	.states[0] = {
		.name = "C1",
		.desc = "WFI",
		.exit_latency = 1,
		.target_residency = 1 * 2,
		.flags = CPUIDLE_FLAG_TIME_VALID,
	},
	.safe_state_index = 0, /* C1 */
	.state_count = 1,
};

void (*shmobile_cpuidle_setup)(struct cpuidle_device *dev);
void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv);

static int shmobile_cpuidle_init(void)
{
	struct cpuidle_device *dev = &shmobile_cpuidle_dev;
	struct cpuidle_state *state;
	struct cpuidle_driver *drv = &shmobile_cpuidle_driver;
	int i;

	cpuidle_register_driver(&shmobile_cpuidle_driver);

	for (i = 0; i < CPUIDLE_STATE_MAX; i++) {
		dev->states[i].name[0] = '\0';
		dev->states[i].desc[0] = '\0';
		dev->states[i].enter = shmobile_cpuidle_enter;
	}

	i = CPUIDLE_DRIVER_STATE_START;

	state = &dev->states[i++];
	snprintf(state->name, CPUIDLE_NAME_LEN, "C1");
	strncpy(state->desc, "WFI", CPUIDLE_DESC_LEN);
	state->exit_latency = 1;
	state->target_residency = 1 * 2;
	state->power_usage = 3;
	state->flags = 0;
	state->flags |= CPUIDLE_FLAG_TIME_VALID;

	dev->safe_state = state;
	dev->state_count = i;
	for (i = 0; i < CPUIDLE_STATE_MAX; i++)
		drv->states[i].enter = shmobile_cpuidle_enter;

	if (shmobile_cpuidle_setup)
		shmobile_cpuidle_setup(dev);
		shmobile_cpuidle_setup(drv);

	cpuidle_register_driver(drv);

	dev->state_count = drv->state_count;
	cpuidle_register_device(dev);

	return 0;
+2 −2
Original line number Diff line number Diff line
@@ -9,9 +9,9 @@ extern int clk_init(void);
extern void shmobile_handle_irq_intc(struct pt_regs *);
extern void shmobile_handle_irq_gic(struct pt_regs *);
extern struct platform_suspend_ops shmobile_suspend_ops;
struct cpuidle_device;
struct cpuidle_driver;
extern void (*shmobile_cpuidle_modes[])(void);
extern void (*shmobile_cpuidle_setup)(struct cpuidle_device *dev);
extern void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv);

extern void sh7367_init_irq(void);
extern void sh7367_add_early_devices(void);
Loading