]> Pileus Git - ~andy/linux/commitdiff
Merge branch 'topic/asoc' into for-linus
authorTakashi Iwai <tiwai@suse.de>
Wed, 16 Mar 2011 16:38:41 +0000 (17:38 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 16 Mar 2011 16:38:41 +0000 (17:38 +0100)
1  2 
arch/arm/mach-shmobile/board-ag5evm.c
arch/arm/mach-shmobile/board-ap4evb.c
arch/arm/mach-shmobile/board-mackerel.c
arch/sh/boards/mach-ecovec24/setup.c

index 4303a86e6e3848624a9ac1f6261a037c7021c6d9,343362d02075cdd1f5fcc87561bd393b39c94b0b..3e6f0aab460bd2382552a5723c738a739fbc4610
  #include <linux/input/sh_keysc.h>
  #include <linux/mmc/host.h>
  #include <linux/mmc/sh_mmcif.h>
 -
 +#include <linux/sh_clk.h>
 +#include <video/sh_mobile_lcdc.h>
 +#include <video/sh_mipi_dsi.h>
  #include <sound/sh_fsi.h>
 -
  #include <mach/hardware.h>
  #include <mach/sh73a0.h>
  #include <mach/common.h>
@@@ -119,13 -118,6 +119,6 @@@ static struct platform_device keysc_dev
  };
  
  /* FSI A */
- static struct sh_fsi_platform_info fsi_info = {
-       .porta_flags = SH_FSI_OUT_SLAVE_MODE    |
-                      SH_FSI_IN_SLAVE_MODE     |
-                      SH_FSI_OFMT(I2S)         |
-                      SH_FSI_IFMT(I2S),
- };
  static struct resource fsi_resources[] = {
        [0] = {
                .name   = "FSI",
@@@ -144,9 -136,6 +137,6 @@@ static struct platform_device fsi_devic
        .id             = -1,
        .num_resources  = ARRAY_SIZE(fsi_resources),
        .resource       = fsi_resources,
-       .dev    = {
-               .platform_data  = &fsi_info,
-       },
  };
  
  static struct resource sh_mmcif_resources[] = {
@@@ -184,165 -173,11 +174,165 @@@ static struct platform_device mmc_devic
        .resource       = sh_mmcif_resources,
  };
  
 +/* IrDA */
 +static struct resource irda_resources[] = {
 +      [0] = {
 +              .start  = 0xE6D00000,
 +              .end    = 0xE6D01FD4 - 1,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +      [1] = {
 +              .start  = gic_spi(95),
 +              .flags  = IORESOURCE_IRQ,
 +      },
 +};
 +
 +static struct platform_device irda_device = {
 +      .name           = "sh_irda",
 +      .id             = 0,
 +      .resource       = irda_resources,
 +      .num_resources  = ARRAY_SIZE(irda_resources),
 +};
 +
 +static unsigned char lcd_backlight_seq[3][2] = {
 +      { 0x04, 0x07 },
 +      { 0x23, 0x80 },
 +      { 0x03, 0x01 },
 +};
 +
 +static void lcd_backlight_on(void)
 +{
 +      struct i2c_adapter *a;
 +      struct i2c_msg msg;
 +      int k;
 +
 +      a = i2c_get_adapter(1);
 +      for (k = 0; a && k < 3; k++) {
 +              msg.addr = 0x6d;
 +              msg.buf = &lcd_backlight_seq[k][0];
 +              msg.len = 2;
 +              msg.flags = 0;
 +              if (i2c_transfer(a, &msg, 1) != 1)
 +                      break;
 +      }
 +}
 +
 +static void lcd_backlight_reset(void)
 +{
 +      gpio_set_value(GPIO_PORT235, 0);
 +      mdelay(24);
 +      gpio_set_value(GPIO_PORT235, 1);
 +}
 +
 +static void lcd_on(void *board_data, struct fb_info *info)
 +{
 +      lcd_backlight_on();
 +}
 +
 +static void lcd_off(void *board_data)
 +{
 +      lcd_backlight_reset();
 +}
 +
 +/* LCDC0 */
 +static const struct fb_videomode lcdc0_modes[] = {
 +      {
 +              .name           = "R63302(QHD)",
 +              .xres           = 544,
 +              .yres           = 961,
 +              .left_margin    = 72,
 +              .right_margin   = 600,
 +              .hsync_len      = 16,
 +              .upper_margin   = 8,
 +              .lower_margin   = 8,
 +              .vsync_len      = 2,
 +              .sync           = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
 +      },
 +};
 +
 +static struct sh_mobile_lcdc_info lcdc0_info = {
 +      .clock_source = LCDC_CLK_PERIPHERAL,
 +      .ch[0] = {
 +              .chan = LCDC_CHAN_MAINLCD,
 +              .interface_type = RGB24,
 +              .clock_divider = 1,
 +              .flags = LCDC_FLAGS_DWPOL,
 +              .lcd_size_cfg.width = 44,
 +              .lcd_size_cfg.height = 79,
 +              .bpp = 16,
 +              .lcd_cfg = lcdc0_modes,
 +              .num_cfg = ARRAY_SIZE(lcdc0_modes),
 +              .board_cfg = {
 +                      .display_on = lcd_on,
 +                      .display_off = lcd_off,
 +              },
 +      }
 +};
 +
 +static struct resource lcdc0_resources[] = {
 +      [0] = {
 +              .name   = "LCDC0",
 +              .start  = 0xfe940000, /* P4-only space */
 +              .end    = 0xfe943fff,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +      [1] = {
 +              .start  = intcs_evt2irq(0x580),
 +              .flags  = IORESOURCE_IRQ,
 +      },
 +};
 +
 +static struct platform_device lcdc0_device = {
 +      .name           = "sh_mobile_lcdc_fb",
 +      .num_resources  = ARRAY_SIZE(lcdc0_resources),
 +      .resource       = lcdc0_resources,
 +      .id             = 0,
 +      .dev    = {
 +              .platform_data  = &lcdc0_info,
 +              .coherent_dma_mask = ~0,
 +      },
 +};
 +
 +/* MIPI-DSI */
 +static struct resource mipidsi0_resources[] = {
 +      [0] = {
 +              .start  = 0xfeab0000,
 +              .end    = 0xfeab3fff,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +      [1] = {
 +              .start  = 0xfeab4000,
 +              .end    = 0xfeab7fff,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +};
 +
 +static struct sh_mipi_dsi_info mipidsi0_info = {
 +      .data_format    = MIPI_RGB888,
 +      .lcd_chan       = &lcdc0_info.ch[0],
 +      .vsynw_offset   = 20,
 +      .clksrc         = 1,
 +      .flags          = SH_MIPI_DSI_HSABM,
 +};
 +
 +static struct platform_device mipidsi0_device = {
 +      .name           = "sh-mipi-dsi",
 +      .num_resources  = ARRAY_SIZE(mipidsi0_resources),
 +      .resource       = mipidsi0_resources,
 +      .id             = 0,
 +      .dev    = {
 +              .platform_data  = &mipidsi0_info,
 +      },
 +};
 +
  static struct platform_device *ag5evm_devices[] __initdata = {
        &eth_device,
        &keysc_device,
        &fsi_device,
        &mmc_device,
 +      &irda_device,
 +      &lcdc0_device,
 +      &mipidsi0_device,
  };
  
  static struct map_desc ag5evm_io_desc[] __initdata = {
@@@ -379,8 -214,6 +369,8 @@@ void __init ag5evm_init_irq(void
        __raw_writew(__raw_readw(PINTCR0A) | (2<<10), PINTCR0A);
  }
  
 +#define DSI0PHYCR     0xe615006c
 +
  static void __init ag5evm_init(void)
  {
        sh73a0_pinmux_init();
        gpio_request(GPIO_FN_FSIAISLD, NULL);
        gpio_request(GPIO_FN_FSIAOSLD, NULL);
  
 +      /* IrDA */
 +      gpio_request(GPIO_FN_PORT241_IRDA_OUT, NULL);
 +      gpio_request(GPIO_FN_PORT242_IRDA_IN,  NULL);
 +      gpio_request(GPIO_FN_PORT243_IRDA_FIRSEL, NULL);
 +
 +      /* LCD panel */
 +      gpio_request(GPIO_PORT217, NULL); /* RESET */
 +      gpio_direction_output(GPIO_PORT217, 0);
 +      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);
 +      lcd_backlight_reset();
 +
 +      /* MIPI-DSI clock setup */
 +      __raw_writel(0x2a809010, DSI0PHYCR);
 +
  #ifdef CONFIG_CACHE_L2X0
        /* Shared attribute override enable, 64K*8way */
        l2x0_init(__io(0xf0100000), 0x00460000, 0xc2000fff);
index 81d6536552a97c61eec6976fe19c53b47432c20c,17f528a76a1ccbde22fd6598bce29e42e90b8f03..1a8118c929be26ebee043d90bb170b8677fa0157
@@@ -673,16 -673,12 +673,12 @@@ static int fsi_set_rate(struct device *
  }
  
  static struct sh_fsi_platform_info fsi_info = {
-       .porta_flags = SH_FSI_BRS_INV |
-                      SH_FSI_OUT_SLAVE_MODE |
-                      SH_FSI_IN_SLAVE_MODE |
-                      SH_FSI_OFMT(PCM) |
-                      SH_FSI_IFMT(PCM),
+       .porta_flags = SH_FSI_BRS_INV,
  
        .portb_flags = SH_FSI_BRS_INV |
                       SH_FSI_BRM_INV |
                       SH_FSI_LRS_INV |
-                      SH_FSI_OFMT(SPDIF),
+                      SH_FSI_FMT_SPDIF,
        .set_rate = fsi_set_rate,
  };
  
@@@ -783,6 -779,10 +779,10 @@@ static struct platform_device hdmi_devi
        },
  };
  
+ static struct platform_device fsi_hdmi_device = {
+       .name           = "sh_fsi2_b_hdmi",
+ };
  static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq,
                                unsigned long *parent_freq)
  {
@@@ -936,6 -936,7 +936,7 @@@ static struct platform_device *ap4evb_d
        &usb1_host_device,
        &fsi_device,
        &fsi_ak4643_device,
+       &fsi_hdmi_device,
        &sh_mmcif_device,
        &lcdc1_device,
        &lcdc_device,
@@@ -1303,7 -1304,7 +1304,7 @@@ static void __init ap4evb_init(void
  
        lcdc_info.clock_source                  = LCDC_CLK_BUS;
        lcdc_info.ch[0].interface_type          = RGB18;
 -      lcdc_info.ch[0].clock_divider           = 2;
 +      lcdc_info.ch[0].clock_divider           = 3;
        lcdc_info.ch[0].flags                   = 0;
        lcdc_info.ch[0].lcd_size_cfg.width      = 152;
        lcdc_info.ch[0].lcd_size_cfg.height     = 91;
index 1657eac5dde2c1bfee1a3a4bd799e47a884d0c76,73b8c90b5072c98e850d78c76ef046f5e2fc4492..1a63c213e45dfa96957a00cd402fca815327fd5a
   *    SW1     |       SW33
   *            | bit1 | bit2 | bit3 | bit4
   * -------------+------+------+------+-------
 - * MMC0         OFF   |  OFF |  ON  |  ON  |  X
 - * MMC1         ON    |  OFF |  ON  |  X   | ON
 - * SDHI1  OFF |  ON  |   X  |  OFF | ON
 + * MMC0   OFF |  OFF |   X  |  ON  |  X       (Use MMCIF)
 + * SDHI1  OFF |  ON  |   X  |  OFF |  X       (Use MFD_SH_MOBILE_SDHI)
   *
   */
  
@@@ -303,7 -304,7 +303,7 @@@ static struct sh_mobile_lcdc_info lcdc_
                .lcd_cfg = mackerel_lcdc_modes,
                .num_cfg = ARRAY_SIZE(mackerel_lcdc_modes),
                .interface_type         = RGB24,
 -              .clock_divider          = 2,
 +              .clock_divider          = 3,
                .flags                  = 0,
                .lcd_size_cfg.width     = 152,
                .lcd_size_cfg.height    = 91,
@@@ -399,6 -400,10 +399,10 @@@ static struct platform_device hdmi_devi
        },
  };
  
+ static struct platform_device fsi_hdmi_device = {
+       .name           = "sh_fsi2_b_hdmi",
+ };
  static int __init hdmi_init_pm_clock(void)
  {
        struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick");
@@@ -609,16 -614,12 +613,12 @@@ fsi_set_rate_end
  }
  
  static struct sh_fsi_platform_info fsi_info = {
-       .porta_flags =  SH_FSI_BRS_INV          |
-                       SH_FSI_OUT_SLAVE_MODE   |
-                       SH_FSI_IN_SLAVE_MODE    |
-                       SH_FSI_OFMT(PCM)        |
-                       SH_FSI_IFMT(PCM),
+       .porta_flags =  SH_FSI_BRS_INV,
  
        .portb_flags =  SH_FSI_BRS_INV  |
                        SH_FSI_BRM_INV  |
                        SH_FSI_LRS_INV  |
-                       SH_FSI_OFMT(SPDIF),
+                       SH_FSI_FMT_SPDIF,
  
        .set_rate = fsi_set_rate,
  };
@@@ -921,6 -922,7 +921,7 @@@ static struct platform_device *mackerel
        &leds_device,
        &fsi_device,
        &fsi_ak4643_device,
+       &fsi_hdmi_device,
        &sdhi0_device,
  #if !defined(CONFIG_MMC_SH_MMCIF)
        &sdhi1_device,
index 701667acfd89e919f15202ef2161f445e15e0c93,b96b79b970b230dbf57737401de5b26c37247280..7bdb572ddf9382247986a801b72addb650883e81
@@@ -723,11 -723,7 +723,7 @@@ static struct platform_device camera_de
  
  /* FSI */
  static struct sh_fsi_platform_info fsi_info = {
-       .portb_flags = SH_FSI_BRS_INV |
-                      SH_FSI_OUT_SLAVE_MODE |
-                      SH_FSI_IN_SLAVE_MODE |
-                      SH_FSI_OFMT(I2S) |
-                      SH_FSI_IFMT(I2S),
+       .portb_flags = SH_FSI_BRS_INV,
  };
  
  static struct resource fsi_resources[] = {
@@@ -1294,7 -1290,6 +1290,7 @@@ static int __init arch_setup(void
        i2c_register_board_info(1, i2c1_devices,
                                ARRAY_SIZE(i2c1_devices));
  
 +#if defined(CONFIG_VIDEO_SH_VOU) || defined(CONFIG_VIDEO_SH_VOU_MODULE)
        /* VOU */
        gpio_request(GPIO_FN_DV_D15, NULL);
        gpio_request(GPIO_FN_DV_D14, NULL);
  
        /* Remove reset */
        gpio_set_value(GPIO_PTG4, 1);
 +#endif
  
        return platform_add_devices(ecovec_devices,
                                    ARRAY_SIZE(ecovec_devices));