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

Commit 4177a7c5 authored by Olof Johansson's avatar Olof Johansson
Browse files

Merge tag 'renesas-boards2-for-v3.9' of...

Merge tag 'renesas-boards2-for-v3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/boards

From Simon Horman:
Second round of Renesas ARM-based SoC board changes for v3.9

* Fix to correct timer initialisation on the armadillo 800 eva board
  from Hideki EIRAKU

* The remaining of the changes relate to updating boards to
  make use of gpio_request_one(). These changes are from  Laurent Pinchart.

* tag 'renesas-boards2-for-v3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas

:
  ARM: shmobile: armadillo800eva: set clock rates before timer init
  ARM: shmobile: mackerel: Use gpio_request_one()
  ARM: shmobile: kzm9g: Use gpio_request_one()
  ARM: shmobile: bonito: Use gpio_request_one()
  ARM: shmobile: kota2: Use gpio_request_one()
  ARM: shmobile: armadillo800eva: Use gpio_set_value() to set GPIO value
  ARM: shmobile: armadillo800eva: Use gpio_request_one()
  ARM: shmobile: ap4evb: Use gpio_request_one()
  ARM: shmobile: ag5evm: Use gpio_request_one()

Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parents 72e510e8 2f27c406
Loading
Loading
Loading
Loading
+8 −14
Original line number Diff line number Diff line
@@ -479,11 +479,10 @@ static void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state)
	static int power_gpio = -EINVAL;

	if (power_gpio < 0) {
		int ret = gpio_request(GPIO_PORT114, "sdhi1_power");
		if (!ret) {
		int ret = gpio_request_one(GPIO_PORT114, GPIOF_OUT_INIT_LOW,
					   "sdhi1_power");
		if (!ret)
			power_gpio = GPIO_PORT114;
			gpio_direction_output(power_gpio, 0);
		}
	}

	/*
@@ -604,14 +603,11 @@ static void __init ag5evm_init(void)
	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);
	gpio_request_one(GPIO_PORT208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */

	/* enable SMSC911X */
	gpio_request(GPIO_PORT144, NULL); /* PINTA2 */
	gpio_direction_input(GPIO_PORT144);
	gpio_request(GPIO_PORT145, NULL); /* RESET */
	gpio_direction_output(GPIO_PORT145, 1);
	gpio_request_one(GPIO_PORT144, GPIOF_IN, NULL); /* PINTA2 */
	gpio_request_one(GPIO_PORT145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */

	/* FSI A */
	gpio_request(GPIO_FN_FSIACK, NULL);
@@ -626,15 +622,13 @@ static void __init ag5evm_init(void)
	gpio_request(GPIO_FN_PORT243_IRDA_FIRSEL, NULL);

	/* LCD panel */
	gpio_request(GPIO_PORT217, NULL); /* RESET */
	gpio_direction_output(GPIO_PORT217, 0);
	gpio_request_one(GPIO_PORT217, GPIOF_OUT_INIT_LOW, NULL); /* RESET */
	mdelay(1);
	gpio_set_value(GPIO_PORT217, 1);
	mdelay(100);

	/* LCD backlight controller */
	gpio_request(GPIO_PORT235, NULL); /* RESET */
	gpio_direction_output(GPIO_PORT235, 0);
	gpio_request_one(GPIO_PORT235, GPIOF_OUT_INIT_LOW, NULL); /* RESET */
	lcd_backlight_set_brightness(0);

	/* enable SDHI0 on CN15 [SD I/F] */
+9 −24
Original line number Diff line number Diff line
@@ -1046,9 +1046,7 @@ static int ts_get_pendown_state(void)

	gpio_free(GPIO_TSC_IRQ);

	gpio_request(GPIO_TSC_PORT, NULL);

	gpio_direction_input(GPIO_TSC_PORT);
	gpio_request_one(GPIO_TSC_PORT, GPIOF_IN, NULL);

	val = gpio_get_value(GPIO_TSC_PORT);

@@ -1129,18 +1127,10 @@ static void __init ap4evb_init(void)
	gpio_request(GPIO_FN_IRQ6_39,	NULL);

	/* enable Debug switch (S6) */
	gpio_request(GPIO_PORT32, NULL);
	gpio_request(GPIO_PORT33, NULL);
	gpio_request(GPIO_PORT34, NULL);
	gpio_request(GPIO_PORT35, NULL);
	gpio_direction_input(GPIO_PORT32);
	gpio_direction_input(GPIO_PORT33);
	gpio_direction_input(GPIO_PORT34);
	gpio_direction_input(GPIO_PORT35);
	gpio_export(GPIO_PORT32, 0);
	gpio_export(GPIO_PORT33, 0);
	gpio_export(GPIO_PORT34, 0);
	gpio_export(GPIO_PORT35, 0);
	gpio_request_one(GPIO_PORT32, GPIOF_IN | GPIOF_EXPORT, NULL);
	gpio_request_one(GPIO_PORT33, GPIOF_IN | GPIOF_EXPORT, NULL);
	gpio_request_one(GPIO_PORT34, GPIOF_IN | GPIOF_EXPORT, NULL);
	gpio_request_one(GPIO_PORT35, GPIOF_IN | GPIOF_EXPORT, NULL);

	/* SDHI0 */
	gpio_request(GPIO_FN_SDHICD0, NULL);
@@ -1188,8 +1178,7 @@ static void __init ap4evb_init(void)
	gpio_request(GPIO_FN_FSIAILR,	NULL);
	gpio_request(GPIO_FN_FSIAISLD,	NULL);
	gpio_request(GPIO_FN_FSIAOSLD,	NULL);
	gpio_request(GPIO_PORT161,	NULL);
	gpio_direction_output(GPIO_PORT161, 0); /* slave */
	gpio_request_one(GPIO_PORT161, GPIOF_OUT_INIT_LOW, NULL); /* slave */

	gpio_request(GPIO_PORT9, NULL);
	gpio_request(GPIO_PORT10, NULL);
@@ -1197,8 +1186,7 @@ static void __init ap4evb_init(void)
	gpio_direction_none(GPIO_PORT10CR); /* FSIAOLR needs no direction */

	/* card detect pin for MMC slot (CN7) */
	gpio_request(GPIO_PORT41, NULL);
	gpio_direction_input(GPIO_PORT41);
	gpio_request_one(GPIO_PORT41, GPIOF_IN, NULL);

	/* setup FSI2 port B (HDMI) */
	gpio_request(GPIO_FN_FSIBCK, NULL);
@@ -1286,11 +1274,8 @@ static void __init ap4evb_init(void)
	gpio_request(GPIO_FN_LCDDISP,  NULL);
	gpio_request(GPIO_FN_LCDDCK,   NULL);

	gpio_request(GPIO_PORT189, NULL); /* backlight */
	gpio_direction_output(GPIO_PORT189, 1);

	gpio_request(GPIO_PORT151, NULL); /* LCDDON */
	gpio_direction_output(GPIO_PORT151, 1);
	gpio_request_one(GPIO_PORT189, GPIOF_OUT_INIT_HIGH, NULL); /* backlight */
	gpio_request_one(GPIO_PORT151, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */

	lcdc_info.clock_source			= LCDC_CLK_BUS;
	lcdc_info.ch[0].interface_type		= RGB18;
+22 −35
Original line number Diff line number Diff line
@@ -708,9 +708,9 @@ static int mt9t111_power(struct device *dev, int mode)
		/* video1 (= CON1 camera) expect 24MHz */
		clk_set_rate(mclk, clk_round_rate(mclk, 24000000));
		clk_enable(mclk);
		gpio_direction_output(GPIO_PORT158, 1);
		gpio_set_value(GPIO_PORT158, 1);
	} else {
		gpio_direction_output(GPIO_PORT158, 0);
		gpio_set_value(GPIO_PORT158, 0);
		clk_disable(mclk);
	}

@@ -1000,16 +1000,12 @@ static void __init eva_init(void)
	gpio_request(GPIO_FN_LCD0_DISP,		NULL);
	gpio_request(GPIO_FN_LCD0_LCLK_PORT165,	NULL);

	gpio_request(GPIO_PORT61, NULL); /* LCDDON */
	gpio_direction_output(GPIO_PORT61, 1);

	gpio_request(GPIO_PORT202, NULL); /* LCD0_LED_CONT */
	gpio_direction_output(GPIO_PORT202, 0);
	gpio_request_one(GPIO_PORT61, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
	gpio_request_one(GPIO_PORT202, GPIOF_OUT_INIT_LOW, NULL); /* LCD0_LED_CONT */

	/* Touchscreen */
	gpio_request(GPIO_FN_IRQ10,	NULL); /* TP_INT */
	gpio_request(GPIO_PORT166,	NULL); /* TP_RST_B */
	gpio_direction_output(GPIO_PORT166, 1);
	gpio_request_one(GPIO_PORT166, GPIOF_OUT_INIT_HIGH, NULL); /* TP_RST_B */

	/* GETHER */
	gpio_request(GPIO_FN_ET_CRS,		NULL);
@@ -1032,12 +1028,10 @@ static void __init eva_init(void)
	gpio_request(GPIO_FN_ET_RX_DV,		NULL);
	gpio_request(GPIO_FN_ET_RX_CLK,		NULL);

	gpio_request(GPIO_PORT18, NULL); /* PHY_RST */
	gpio_direction_output(GPIO_PORT18, 1);
	gpio_request_one(GPIO_PORT18, GPIOF_OUT_INIT_HIGH, NULL); /* PHY_RST */

	/* USB */
	gpio_request(GPIO_PORT159, NULL); /* USB_DEVICE_MODE */
	gpio_direction_input(GPIO_PORT159);
	gpio_request_one(GPIO_PORT159, GPIOF_IN, NULL); /* USB_DEVICE_MODE */

	if (gpio_get_value(GPIO_PORT159)) {
		/* USB Host */
@@ -1051,8 +1045,7 @@ static void __init eva_init(void)
		 * and select GPIO_PORT209 here
		 */
		gpio_request(GPIO_FN_IRQ7_PORT209, NULL);
		gpio_request(GPIO_PORT209, NULL);
		gpio_direction_input(GPIO_PORT209);
		gpio_request_one(GPIO_PORT209, GPIOF_IN, NULL);

		platform_device_register(&usbhsf_device);
		usb = &usbhsf_device;
@@ -1067,12 +1060,9 @@ static void __init eva_init(void)
	gpio_request(GPIO_FN_SDHI0_D3, NULL);
	gpio_request(GPIO_FN_SDHI0_WP, NULL);

	gpio_request(GPIO_PORT17, NULL);	/* SDHI0_18/33_B */
	gpio_request(GPIO_PORT74, NULL);	/* SDHI0_PON */
	gpio_request(GPIO_PORT75, NULL);	/* SDSLOT1_PON */
	gpio_direction_output(GPIO_PORT17, 0);
	gpio_direction_output(GPIO_PORT74, 1);
	gpio_direction_output(GPIO_PORT75, 1);
	gpio_request_one(GPIO_PORT17, GPIOF_OUT_INIT_LOW, NULL);  /* SDHI0_18/33_B */
	gpio_request_one(GPIO_PORT74, GPIOF_OUT_INIT_HIGH, NULL); /* SDHI0_PON */
	gpio_request_one(GPIO_PORT75, GPIOF_OUT_INIT_HIGH, NULL); /* SDSLOT1_PON */

	/* we can use GPIO_FN_IRQ31_PORT167 here for SDHI0 CD irq */

@@ -1109,12 +1099,10 @@ static void __init eva_init(void)
	gpio_request(GPIO_FN_VIO_CKO,		NULL);

	/* CON1/CON15 Camera */
	gpio_request(GPIO_PORT173, NULL); /* STANDBY */
	gpio_request(GPIO_PORT172, NULL); /* RST */
	gpio_request(GPIO_PORT158, NULL); /* CAM_PON */
	gpio_direction_output(GPIO_PORT173, 0);
	gpio_direction_output(GPIO_PORT172, 1);
	gpio_direction_output(GPIO_PORT158, 0); /* see mt9t111_power() */
	gpio_request_one(GPIO_PORT173, GPIOF_OUT_INIT_LOW, NULL);  /* STANDBY */
	gpio_request_one(GPIO_PORT172, GPIOF_OUT_INIT_HIGH, NULL); /* RST */
	/* see mt9t111_power() */
	gpio_request_one(GPIO_PORT158, GPIOF_OUT_INIT_LOW, NULL);  /* CAM_PON */

	/* FSI-WM8978 */
	gpio_request(GPIO_FN_FSIAIBT,		NULL);
@@ -1141,15 +1129,13 @@ static void __init eva_init(void)
	 * DBGMD/LCDC0/FSIA MUX
	 * DBGMD_SELECT_B should be set after setting PFC Function.
	 */
	gpio_request(GPIO_PORT176, NULL);
	gpio_direction_output(GPIO_PORT176, 1);
	gpio_request_one(GPIO_PORT176, GPIOF_OUT_INIT_HIGH, NULL);

	/*
	 * We can switch CON8/CON14 by SW1.5,
	 * but it needs after DBGMD_SELECT_B
	 */
	gpio_request(GPIO_PORT6, NULL);
	gpio_direction_input(GPIO_PORT6);
	gpio_request_one(GPIO_PORT6, GPIOF_IN, NULL);
	if (gpio_get_value(GPIO_PORT6)) {
		/* CON14 enable */
	} else {
@@ -1163,8 +1149,8 @@ static void __init eva_init(void)
		gpio_request(GPIO_FN_SDHI1_CD,	NULL);
		gpio_request(GPIO_FN_SDHI1_WP,	NULL);

		gpio_request(GPIO_PORT16, NULL); /* SDSLOT2_PON */
		gpio_direction_output(GPIO_PORT16, 1);
		/* SDSLOT2_PON */
		gpio_request_one(GPIO_PORT16, GPIOF_OUT_INIT_HIGH, NULL);

		platform_device_register(&sdhi1_device);
	}
@@ -1183,8 +1169,6 @@ static void __init eva_init(void)
	platform_add_devices(eva_devices,
			     ARRAY_SIZE(eva_devices));

	eva_clock_init();

	rmobile_add_device_to_domain("A4LC", &lcdc0_device);
	rmobile_add_device_to_domain("A4LC", &hdmi_lcdc_device);
	if (usb)
@@ -1195,6 +1179,9 @@ static void __init eva_earlytimer_init(void)
{
	r8a7740_clock_init(MD_CK0 | MD_CK2);
	shmobile_earlytimer_init();

	/* the rate of extal1 clock must be set before late_time_init */
	eva_clock_init();
}

static void __init eva_add_early_devices(void)
+3 −4
Original line number Diff line number Diff line
@@ -392,8 +392,7 @@ static void __init bonito_init(void)
	/*
	 * base board settings
	 */
	gpio_request(GPIO_PORT176, NULL);
	gpio_direction_input(GPIO_PORT176);
	gpio_request_one(GPIO_PORT176, GPIOF_IN, NULL);
	if (!gpio_get_value(GPIO_PORT176)) {
		u16 bsw2;
		u16 bsw3;
@@ -462,8 +461,8 @@ static void __init bonito_init(void)
			gpio_request(GPIO_FN_LCD0_DISP,		NULL);
			gpio_request(GPIO_FN_LCD0_LCLK_PORT165,	NULL);

			gpio_request(GPIO_PORT61, NULL); /* LCDDON */
			gpio_direction_output(GPIO_PORT61, 1);
			gpio_request_one(GPIO_PORT61, GPIOF_OUT_INIT_HIGH,
					 NULL); /* LCDDON */

			/* backlight on */
			bonito_fpga_write(LCDCR, 1);
+3 −6
Original line number Diff line number Diff line
@@ -474,10 +474,8 @@ static void __init kota2_init(void)
	gpio_request(GPIO_FN_D15_NAF15, NULL);
	gpio_request(GPIO_FN_CS5A_, NULL);
	gpio_request(GPIO_FN_WE0__FWE, NULL);
	gpio_request(GPIO_PORT144, NULL); /* PINTA2 */
	gpio_direction_input(GPIO_PORT144);
	gpio_request(GPIO_PORT145, NULL); /* RESET */
	gpio_direction_output(GPIO_PORT145, 1);
	gpio_request_one(GPIO_PORT144, GPIOF_IN, NULL); /* PINTA2 */
	gpio_request_one(GPIO_PORT145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */

	/* KEYSC */
	gpio_request(GPIO_FN_KEYIN0_PU, NULL);
@@ -509,8 +507,7 @@ static void __init kota2_init(void)
	gpio_request(GPIO_FN_MMCD0_6, NULL);
	gpio_request(GPIO_FN_MMCD0_7, NULL);
	gpio_request(GPIO_FN_MMCCMD0, NULL);
	gpio_request(GPIO_PORT208, NULL); /* Reset */
	gpio_direction_output(GPIO_PORT208, 1);
	gpio_request_one(GPIO_PORT208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */

	/* SDHI0 (microSD) */
	gpio_request(GPIO_FN_SDHICD0_PU, NULL);
Loading