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

Commit a524626b authored by Tony Lindgren's avatar Tony Lindgren
Browse files

ARM: OMAP: Sync board specific files with linux-omap



This patch syncs omap board specific files with linux-omap tree.

Patch consists mostly of driver updates done in linux-omap
tree for drivers not yet in mainline kernel.

Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent c79ed194
Loading
Loading
Loading
Loading
+35 −24
Original line number Diff line number Diff line
@@ -158,6 +158,10 @@ static struct map_desc ams_delta_io_desc[] __initdata = {
	}
};

static struct omap_lcd_config ams_delta_lcd_config __initdata = {
	.ctrl_name	= "internal",
};

static struct omap_uart_config ams_delta_uart_config __initdata = {
	.enabled_uarts = 1,
};
@@ -169,6 +173,7 @@ static struct omap_usb_config ams_delta_usb_config __initdata = {
};

static struct omap_board_config_kernel ams_delta_config[] = {
	{ OMAP_TAG_LCD,		&ams_delta_lcd_config },
	{ OMAP_TAG_UART,	&ams_delta_uart_config },
	{ OMAP_TAG_USB,		&ams_delta_usb_config },
};
@@ -199,6 +204,11 @@ static struct platform_device ams_delta_kp_device = {
	.resource	= ams_delta_kp_resources,
};

static struct platform_device ams_delta_lcd_device = {
	.name	= "lcd_ams_delta",
	.id	= -1,
};

static struct platform_device ams_delta_led_device = {
	.name	= "ams-delta-led",
	.id	= -1
@@ -206,6 +216,7 @@ static struct platform_device ams_delta_led_device = {

static struct platform_device *ams_delta_devices[] __initdata = {
	&ams_delta_kp_device,
	&ams_delta_lcd_device,
	&ams_delta_led_device,
};

+79 −0
Original line number Diff line number Diff line
@@ -139,6 +139,66 @@ static struct platform_device h2_nor_device = {
	.resource	= &h2_nor_resource,
};

#if 0	/* REVISIT: Enable when nand_platform_data is applied */

static struct mtd_partition h2_nand_partitions[] = {
#if 0
	/* REVISIT:  enable these partitions if you make NAND BOOT
	 * work on your H2 (rev C or newer); published versions of
	 * x-load only support P2 and H3.
	 */
	{
		.name		= "xloader",
		.offset		= 0,
		.size		= 64 * 1024,
		.mask_flags	= MTD_WRITEABLE,	/* force read-only */
	},
	{
		.name		= "bootloader",
		.offset		= MTDPART_OFS_APPEND,
		.size		= 256 * 1024,
		.mask_flags	= MTD_WRITEABLE,	/* force read-only */
	},
	{
		.name		= "params",
		.offset		= MTDPART_OFS_APPEND,
		.size		= 192 * 1024,
	},
	{
		.name		= "kernel",
		.offset		= MTDPART_OFS_APPEND,
		.size		= 2 * SZ_1M,
	},
#endif
	{
		.name		= "filesystem",
		.size		= MTDPART_SIZ_FULL,
		.offset		= MTDPART_OFS_APPEND,
	},
};

/* dip switches control NAND chip access:  8 bit, 16 bit, or neither */
static struct nand_platform_data h2_nand_data = {
	.options	= NAND_SAMSUNG_LP_OPTIONS,
	.parts		= h2_nand_partitions,
	.nr_parts	= ARRAY_SIZE(h2_nand_partitions),
};

static struct resource h2_nand_resource = {
	.flags		= IORESOURCE_MEM,
};

static struct platform_device h2_nand_device = {
	.name		= "omapnand",
	.id		= 0,
	.dev		= {
		.platform_data	= &h2_nand_data,
	},
	.num_resources	= 1,
	.resource	= &h2_nand_resource,
};
#endif

static struct resource h2_smc91x_resources[] = {
	[0] = {
		.start	= OMAP1610_ETHR_START,		/* Physical */
@@ -218,11 +278,15 @@ static struct resource h2_irda_resources[] = {
		.flags	= IORESOURCE_IRQ,
	},
};

static u64 irda_dmamask = 0xffffffff;

static struct platform_device h2_irda_device = {
	.name		= "omapirda",
	.id		= 0,
	.dev		= {
		.platform_data	= &h2_irda_data,
		.dma_mask	= &irda_dmamask,
	},
	.num_resources	= ARRAY_SIZE(h2_irda_resources),
	.resource	= h2_irda_resources,
@@ -270,6 +334,7 @@ static struct platform_device h2_mcbsp1_device = {

static struct platform_device *h2_devices[] __initdata = {
	&h2_nor_device,
	//&h2_nand_device,
	&h2_smc91x_device,
	&h2_irda_device,
	&h2_kp_device,
@@ -333,6 +398,13 @@ static struct omap_board_config_kernel h2_config[] __initdata = {
	{ OMAP_TAG_LCD,		&h2_lcd_config },
};

#define H2_NAND_RB_GPIO_PIN	62

static int h2_nand_dev_ready(struct nand_platform_data *data)
{
	return omap_get_gpio_datain(H2_NAND_RB_GPIO_PIN);
}

static void __init h2_init(void)
{
	/* Here we assume the NOR boot config:  NOR on CS3 (possibly swapped
@@ -347,6 +419,13 @@ static void __init h2_init(void)
	h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys();
	h2_nor_resource.end += SZ_32M - 1;

#if 0	/* REVISIT: Enable when nand_platform_data is applied */
	h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS;
	h2_nand_resource.end += SZ_4K - 1;
	if (!(omap_request_gpio(H2_NAND_RB_GPIO_PIN)))
		h2_nand_data.dev_ready = h2_nand_dev_ready;
#endif

	omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
	omap_cfg_reg(M8_1610_FLASH_CS2B_WE);

+41 −0
Original line number Diff line number Diff line
@@ -44,6 +44,8 @@
#include <asm/arch/keypad.h>
#include <asm/arch/dma.h>
#include <asm/arch/common.h>
#include <asm/arch/mcbsp.h>
#include <asm/arch/omap-alsa.h>

extern int omap_gpio_init(void);

@@ -351,11 +353,14 @@ static struct resource h3_irda_resources[] = {
	},
};

static u64 irda_dmamask = 0xffffffff;

static struct platform_device h3_irda_device = {
	.name		= "omapirda",
	.id		= 0,
	.dev		= {
		.platform_data	= &h3_irda_data,
		.dma_mask	= &irda_dmamask,
	},
	.num_resources	= ARRAY_SIZE(h3_irda_resources),
	.resource	= h3_irda_resources,
@@ -366,6 +371,41 @@ static struct platform_device h3_lcd_device = {
	.id		= -1,
};

static struct omap_mcbsp_reg_cfg mcbsp_regs = {
	.spcr2 = FREE | FRST | GRST | XRST | XINTM(3),
	.spcr1 = RINTM(3) | RRST,
	.rcr2  = RPHASE | RFRLEN2(OMAP_MCBSP_WORD_8) |
                RWDLEN2(OMAP_MCBSP_WORD_16) | RDATDLY(1),
	.rcr1  = RFRLEN1(OMAP_MCBSP_WORD_8) | RWDLEN1(OMAP_MCBSP_WORD_16),
	.xcr2  = XPHASE | XFRLEN2(OMAP_MCBSP_WORD_8) |
                XWDLEN2(OMAP_MCBSP_WORD_16) | XDATDLY(1) | XFIG,
	.xcr1  = XFRLEN1(OMAP_MCBSP_WORD_8) | XWDLEN1(OMAP_MCBSP_WORD_16),
	.srgr1 = FWID(15),
	.srgr2 = GSYNC | CLKSP | FSGM | FPER(31),

	.pcr0  = CLKRM | SCLKME | FSXP | FSRP | CLKXP | CLKRP,
	//.pcr0 = CLKXP | CLKRP,        /* mcbsp: slave */
};

static struct omap_alsa_codec_config alsa_config = {
	.name                   = "H3 TSC2101",
	.mcbsp_regs_alsa        = &mcbsp_regs,
	.codec_configure_dev    = NULL, // tsc2101_configure,
	.codec_set_samplerate   = NULL, // tsc2101_set_samplerate,
	.codec_clock_setup      = NULL, // tsc2101_clock_setup,
	.codec_clock_on         = NULL, // tsc2101_clock_on,
	.codec_clock_off        = NULL, // tsc2101_clock_off,
	.get_default_samplerate = NULL, // tsc2101_get_default_samplerate,
};

static struct platform_device h3_mcbsp1_device = {
	.name	= "omap_alsa_mcbsp",
	.id	= 1,
	.dev = {
		.platform_data	= &alsa_config,
	},
};

static struct platform_device *devices[] __initdata = {
	&nor_device,
	&nand_device,
@@ -374,6 +414,7 @@ static struct platform_device *devices[] __initdata = {
	&h3_irda_device,
	&h3_kp_device,
	&h3_lcd_device,
	&h3_mcbsp1_device,
};

static struct omap_usb_config h3_usb_config __initdata = {
+44 −9
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@
#include <asm/arch/aic23.h>
#include <asm/arch/gpio.h>

#include "../plat-omap/dsp/dsp_common.h"

static void __init omap_nokia770_init_irq(void)
{
	/* On Nokia 770, the SleepX signal is masked with an
@@ -153,6 +155,7 @@ static struct omap_board_config_kernel nokia770_config[] = {
	{ OMAP_TAG_MMC,		&nokia770_mmc_config },
};

#if	defined(CONFIG_OMAP_DSP)
/*
 * audio power control
 */
@@ -183,7 +186,7 @@ static void nokia770_audio_pwr_up(void)
	clk_enable(dspxor_ck);

	/* Turn on codec */
	tlv320aic23_power_up();
	aic23_power_up();

	if (omap_get_gpio_datain(HEADPHONE_GPIO))
		/* HP not connected, turn on amplifier */
@@ -197,7 +200,7 @@ static void codec_delayed_power_down(struct work_struct *work)
{
	down(&audio_pwr_sem);
	if (audio_pwr_state == -1)
		tlv320aic23_power_down();
		aic23_power_down();
	clk_disable(dspxor_ck);
	up(&audio_pwr_sem);
}
@@ -213,7 +216,8 @@ static void nokia770_audio_pwr_down(void)
	schedule_delayed_work(&codec_power_down_work, HZ / 20);	/* 50ms */
}

void nokia770_audio_pwr_up_request(int stage)
static int
nokia770_audio_pwr_up_request(struct dsp_kfunc_device *kdev, int stage)
{
	down(&audio_pwr_sem);
	if (audio_pwr_state == -1)
@@ -221,9 +225,11 @@ void nokia770_audio_pwr_up_request(int stage)
	/* force audio_pwr_state = 0, even if it was 1. */
	audio_pwr_state = 0;
	up(&audio_pwr_sem);
	return 0;
}

void nokia770_audio_pwr_down_request(int stage)
static int
nokia770_audio_pwr_down_request(struct dsp_kfunc_device *kdev, int stage)
{
	down(&audio_pwr_sem);
	switch (stage) {
@@ -239,7 +245,38 @@ void nokia770_audio_pwr_down_request(int stage)
		break;
	}
	up(&audio_pwr_sem);
	return 0;
}

static struct dsp_kfunc_device nokia770_audio_device = {
	.name	 = "audio",
	.type	 = DSP_KFUNC_DEV_TYPE_AUDIO,
	.enable  = nokia770_audio_pwr_up_request,
	.disable = nokia770_audio_pwr_down_request,
};

static __init int omap_dsp_init(void)
{
	int ret;

	dspxor_ck = clk_get(0, "dspxor_ck");
	if (IS_ERR(dspxor_ck)) {
		printk(KERN_ERR "couldn't acquire dspxor_ck\n");
		return PTR_ERR(dspxor_ck);
	}

	ret = dsp_kfunc_device_register(&nokia770_audio_device);
	if (ret) {
		printk(KERN_ERR
		       "KFUNC device registration faild: %s\n",
		       nokia770_audio_device.name);
		goto out;
	}
	return 0;
 out:
	return ret;
}
#endif	/* CONFIG_OMAP_DSP */

static void __init omap_nokia770_init(void)
{
@@ -251,9 +288,7 @@ static void __init omap_nokia770_init(void)
	omap_board_config = nokia770_config;
	omap_board_config_size = ARRAY_SIZE(nokia770_config);
	omap_serial_init();
	omap_dsp_audio_pwr_up_request = nokia770_audio_pwr_up_request;
	omap_dsp_audio_pwr_down_request = nokia770_audio_pwr_down_request;
	dspxor_ck = clk_get(0, "dspxor_ck");
	omap_dsp_init();
}

static void __init omap_nokia770_map_io(void)
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/interrupt.h>

Loading