]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/arm/mach-shmobile/board-armadillo800eva.c
Merge branch 'heads/soc2' into boards2-base
[karo-tx-linux.git] / arch / arm / mach-shmobile / board-armadillo800eva.c
index c5be60d85e4b95fa1339f64492d28097ac3763dc..8bc8e4c5884767f381c09da79ffcf2b52e2ffdc9 100644 (file)
@@ -31,6 +31,8 @@
 #include <linux/gpio_keys.h>
 #include <linux/regulator/driver.h>
 #include <linux/pinctrl/machine.h>
+#include <linux/platform_data/pwm-renesas-tpu.h>
+#include <linux/pwm_backlight.h>
 #include <linux/regulator/fixed.h>
 #include <linux/regulator/gpio-regulator.h>
 #include <linux/regulator/machine.h>
@@ -358,7 +360,6 @@ static struct platform_device usbhsf_device = {
 static struct sh_eth_plat_data sh_eth_platdata = {
        .phy                    = 0x00, /* LAN8710A */
        .edmac_endian           = EDMAC_LITTLE_ENDIAN,
-       .register_type          = SH_ETH_REG_GIGABIT,
        .phy_interface          = PHY_INTERFACE_MODE_MII,
 };
 
@@ -387,7 +388,50 @@ static struct platform_device sh_eth_device = {
        .num_resources = ARRAY_SIZE(sh_eth_resources),
 };
 
-/* LCDC */
+/* PWM */
+static struct resource pwm_resources[] = {
+       [0] = {
+               .start = 0xe6600000,
+               .end = 0xe66000ff,
+               .flags = IORESOURCE_MEM,
+       },
+};
+
+static struct tpu_pwm_platform_data pwm_device_data = {
+       .channels[2] = {
+               .polarity = PWM_POLARITY_INVERSED,
+       }
+};
+
+static struct platform_device pwm_device = {
+       .name = "renesas-tpu-pwm",
+       .id = -1,
+       .dev = {
+               .platform_data = &pwm_device_data,
+       },
+       .num_resources = ARRAY_SIZE(pwm_resources),
+       .resource = pwm_resources,
+};
+
+static struct pwm_lookup pwm_lookup[] = {
+       PWM_LOOKUP("renesas-tpu-pwm", 2, "pwm-backlight.0", NULL),
+};
+
+/* LCDC and backlight */
+static struct platform_pwm_backlight_data pwm_backlight_data = {
+       .lth_brightness = 50,
+       .max_brightness = 255,
+       .dft_brightness = 255,
+       .pwm_period_ns = 33333, /* 30kHz */
+};
+
+static struct platform_device pwm_backlight_device = {
+       .name = "pwm-backlight",
+       .dev = {
+               .platform_data = &pwm_backlight_data,
+       },
+};
+
 static struct fb_videomode lcdc0_mode = {
        .name           = "AMPIER/AM-800480",
        .xres           = 800,
@@ -679,15 +723,6 @@ static struct platform_device vcc_sdhi1 = {
 };
 
 /* SDHI0 */
-/*
- * FIXME
- *
- * It use polling mode here, since
- * CD (= Card Detect) pin is not connected to SDHI0_CD.
- * We can use IRQ31 as card detect irq,
- * but it needs chattering removal operation
- */
-#define IRQ31  irq_pin(31)
 static struct sh_mobile_sdhi_info sdhi0_info = {
        .dma_slave_tx   = SHDMA_SLAVE_SDHI0_TX,
        .dma_slave_rx   = SHDMA_SLAVE_SDHI0_RX,
@@ -788,6 +823,9 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = {
        .caps           = MMC_CAP_4_BIT_DATA |
                          MMC_CAP_8_BIT_DATA |
                          MMC_CAP_NONREMOVABLE,
+       .ccs_unsupported = true,
+       .slave_id_tx    = SHDMA_SLAVE_MMCIF_TX,
+       .slave_id_rx    = SHDMA_SLAVE_MMCIF_RX,
 };
 
 static struct resource sh_mmcif_resources[] = {
@@ -1030,6 +1068,8 @@ static struct i2c_board_info i2c2_devices[] = {
  */
 static struct platform_device *eva_devices[] __initdata = {
        &lcdc0_device,
+       &pwm_device,
+       &pwm_backlight_device,
        &gpio_keys_device,
        &sh_eth_device,
        &vcc_sdhi0,
@@ -1069,9 +1109,9 @@ static const struct pinctrl_map eva_pinctrl_map[] = {
        PIN_MAP_MUX_GROUP_DEFAULT("asoc-simple-card.1", "pfc-r8a7740",
                                  "fsib_mclk_in", "fsib"),
        /* GETHER */
-       PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7740",
+       PIN_MAP_MUX_GROUP_DEFAULT("r8a7740-gether", "pfc-r8a7740",
                                  "gether_mii", "gether"),
-       PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7740",
+       PIN_MAP_MUX_GROUP_DEFAULT("r8a7740-gether", "pfc-r8a7740",
                                  "gether_int", "gether"),
        /* HDMI */
        PIN_MAP_MUX_GROUP_DEFAULT("sh-mobile-hdmi", "pfc-r8a7740",
@@ -1101,6 +1141,9 @@ static const struct pinctrl_map eva_pinctrl_map[] = {
        /* ST1232 */
        PIN_MAP_MUX_GROUP_DEFAULT("0-0055", "pfc-r8a7740",
                                  "intc_irq10", "intc"),
+       /* TPU0 */
+       PIN_MAP_MUX_GROUP_DEFAULT("renesas-tpu-pwm", "pfc-r8a7740",
+                                 "tpu0_to2_1", "tpu0"),
        /* USBHS */
        PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-r8a7740",
                                  "intc_irq7_1", "intc"),
@@ -1154,13 +1197,13 @@ static void __init eva_init(void)
                                     ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
 
        pinctrl_register_mappings(eva_pinctrl_map, ARRAY_SIZE(eva_pinctrl_map));
+       pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup));
 
        r8a7740_pinmux_init();
        r8a7740_meram_workaround();
 
        /* LCDC0 */
        gpio_request_one(61, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
-       gpio_request_one(202, GPIOF_OUT_INIT_LOW, NULL); /* LCD0_LED_CONT */
 
        /* GETHER */
        gpio_request_one(18, GPIOF_OUT_INIT_HIGH, NULL); /* PHY_RST */
@@ -1271,7 +1314,7 @@ static const char *eva_boards_compat_dt[] __initdata = {
 DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva")
        .map_io         = r8a7740_map_io,
        .init_early     = eva_add_early_devices,
-       .init_irq       = r8a7740_init_irq,
+       .init_irq       = r8a7740_init_irq_of,
        .init_machine   = eva_init,
        .init_late      = shmobile_init_late,
        .init_time      = eva_earlytimer_init,