Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 227183
b: refs/heads/master
c: 1a44d72
h: refs/heads/master
i:
  227181: 42dc9fc
  227179: c7540ed
  227175: 2231f70
  227167: ba3ad0f
v: v3
  • Loading branch information
Kuninori Morimoto authored and Paul Mundt committed Dec 1, 2010
1 parent 34f2839 commit 559cb75
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d44deb35c26c74d0f1ebea95a5fc386f72d210f7
refs/heads/master: 1a44d72a4058f870c305a23aa5cbc4cacb6758ea
84 changes: 84 additions & 0 deletions trunk/arch/arm/mach-shmobile/board-mackerel.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,19 @@
#include <linux/gpio.h>
#include <linux/input.h>
#include <linux/io.h>
#include <linux/i2c.h>
#include <linux/leds.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
#include <linux/smsc911x.h>
#include <linux/sh_intc.h>
#include <linux/usb/r8a66597.h>

#include <video/sh_mobile_lcdc.h>

#include <sound/sh_fsi.h>

#include <mach/common.h>
#include <mach/sh7372.h>

Expand Down Expand Up @@ -133,6 +137,21 @@
* CN31 is used as Host in Linux.
*/

/*
* FIXME !!
*
* gpio_no_direction
* are quick_hack.
*
* current gpio frame work doesn't have
* the method to control only pull up/down/free.
* this function should be replaced by correct gpio function
*/
static void __init gpio_no_direction(u32 addr)
{
__raw_writeb(0x00, addr);
}

/* MTD */
static struct mtd_partition nor_flash_partitions[] = {
{
Expand Down Expand Up @@ -347,13 +366,58 @@ static struct platform_device leds_device = {
},
};

/* FSI */
#define IRQ_FSI evt2irq(0x1840)
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),
};

static struct resource fsi_resources[] = {
[0] = {
.name = "FSI",
.start = 0xFE3C0000,
.end = 0xFE3C0400 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_FSI,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device fsi_device = {
.name = "sh_fsi2",
.id = -1,
.num_resources = ARRAY_SIZE(fsi_resources),
.resource = fsi_resources,
.dev = {
.platform_data = &fsi_info,
},
};

static struct platform_device fsi_ak4643_device = {
.name = "sh_fsi2_a_ak4643",
};

static struct platform_device *mackerel_devices[] __initdata = {
&nor_flash_device,
&smc911x_device,
&lcdc_device,
&usb1_host_device,
&leds_device,
&fsi_device,
&fsi_ak4643_device,
};

/* I2C */
static struct i2c_board_info i2c0_devices[] = {
{
I2C_BOARD_INFO("ak4643", 0x13),
},
};

static struct map_desc mackerel_io_desc[] __initdata = {
Expand All @@ -377,6 +441,8 @@ static void __init mackerel_map_io(void)
shmobile_setup_console();
}

#define GPIO_PORT9CR 0xE6051009
#define GPIO_PORT10CR 0xE605100A
static void __init mackerel_init(void)
{
sh7372_pinmux_init();
Expand Down Expand Up @@ -434,6 +500,24 @@ static void __init mackerel_init(void)
/* setup USB phy */
__raw_writew(0x8a0a, 0xE6058130); /* USBCR2 */

/* enable FSI2 port A (ak4643) */
gpio_request(GPIO_FN_FSIAIBT, NULL);
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(GPIO_PORT9, NULL);
gpio_request(GPIO_PORT10, NULL);
gpio_no_direction(GPIO_PORT9CR); /* FSIAOBT needs no direction */
gpio_no_direction(GPIO_PORT10CR); /* FSIAOLR needs no direction */

intc_set_priority(IRQ_FSI, 3); /* irq priority FSI(3) > SMSC911X(2) */


i2c_register_board_info(0, i2c0_devices,
ARRAY_SIZE(i2c0_devices));

sh7372_add_standard_devices();

Expand Down

0 comments on commit 559cb75

Please sign in to comment.