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

Commit e2e9bbee authored by Olof Johansson's avatar Olof Johansson
Browse files

Merge tag 'omap-cleanup-devices-for-v3.5' of...

Merge tag 'omap-cleanup-devices-for-v3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/cleanup2

Changes to split plat-omap/devices.c into mach-omap1 and mach-omap2
except for the RNG driver that will be done later on.

As this depends on omap-devel-hwmod-data-for-v3.5 and causes merge
conflict with omap-fixes-non-critical-for-v3.5, this branch is based
on merge of the two.

By Tony Lindgren (7) and others
via Tony Lindgren (4) and Paul Walmsley (1)
* tag 'omap-cleanup-devices-for-v3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (27 commits)
  ARM: OMAP1: Pass dma request lines in platform data to MMC driver
  ARM: OMAP: Move omap_mmc_add() to mach-omap1
  ARM: OMAP2: Use hwmod to initialize mmc for 2420
  ARM: OMAP2+: Move omap_dsp_reserve_sdram_memblock() to mach-omap2
  ARM: OMAP1: Move omap_init_uwire to mach-omap1
  ARM: OMAP1: Move omap_init_audio() to keep the devices in alphabetical order
  ARM: OMAP2+: WDTIMER integration: fix !PM boot crash, disarm timer after hwmod reset
  ARM: OMAP2/3: hwmod data: Add 32k-sync timer data to hwmod database
  ARM: OMAP4: hwmod_data: Name the common irq for McBSP ports
  ARM: OMAP4: hwmod data: I2C: add flag for context restore
  ARM: OMAP3: hwmod_data: Rename the common irq for McBSP ports
  ARM: OMAP2xxx: hwmod data: add HDQ/1-wire hwmod
  ARM: OMAP3: hwmod data: add HDQ/1-wire hwmod
  ARM: OMAP2+: hwmod data: add HDQ/1-wire hwmod shared data
  ARM: OMAP2+: HDQ1W: add custom reset function
  ARM: OMAP2420: hwmod data: Add MMC hwmod data for 2420
  arm: omap3: clockdomain data: Remove superfluous commas from gfx_sgx_3xxx_wkdeps[]
  ARM: OMAP2+: powerdomain: Get rid off duplicate pwrdm_clkdm_state_switch() API
  ARM: OMAP3: clock data: add clockdomain for HDQ functional clock
  ARM: OMAP3+: dpll: Configure autoidle mode only if it's supported
  ...
parents 5056c073 6c432f72
Loading
Loading
Loading
Loading
+110 −11
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <plat/tc.h>
#include <plat/board.h>
#include <plat/mux.h>
#include <plat/dma.h>
#include <plat/mmc.h>
#include <plat/omap7xx.h>

@@ -31,6 +32,22 @@
#include "common.h"
#include "clock.h"

#if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE)

static struct platform_device omap_pcm = {
	.name	= "omap-pcm-audio",
	.id	= -1,
};

static void omap_init_audio(void)
{
	platform_device_register(&omap_pcm);
}

#else
static inline void omap_init_audio(void) {}
#endif

/*-------------------------------------------------------------------------*/

#if defined(CONFIG_RTC_DRV_OMAP) || defined(CONFIG_RTC_DRV_OMAP_MODULE)
@@ -128,6 +145,56 @@ static inline void omap1_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
	}
}

#define OMAP_MMC_NR_RES		4

/*
 * Register MMC devices.
 */
static int __init omap_mmc_add(const char *name, int id, unsigned long base,
				unsigned long size, unsigned int irq,
				unsigned rx_req, unsigned tx_req,
				struct omap_mmc_platform_data *data)
{
	struct platform_device *pdev;
	struct resource res[OMAP_MMC_NR_RES];
	int ret;

	pdev = platform_device_alloc(name, id);
	if (!pdev)
		return -ENOMEM;

	memset(res, 0, OMAP_MMC_NR_RES * sizeof(struct resource));
	res[0].start = base;
	res[0].end = base + size - 1;
	res[0].flags = IORESOURCE_MEM;
	res[1].start = res[1].end = irq;
	res[1].flags = IORESOURCE_IRQ;
	res[2].start = rx_req;
	res[2].name = "rx";
	res[2].flags = IORESOURCE_DMA;
	res[3].start = tx_req;
	res[3].name = "tx";
	res[3].flags = IORESOURCE_DMA;

	ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res));
	if (ret == 0)
		ret = platform_device_add_data(pdev, data, sizeof(*data));
	if (ret)
		goto fail;

	ret = platform_device_add(pdev);
	if (ret)
		goto fail;

	/* return device handle to board setup code */
	data->dev = &pdev->dev;
	return 0;

fail:
	platform_device_put(pdev);
	return ret;
}

void __init omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
			int nr_controllers)
{
@@ -135,6 +202,7 @@ void __init omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,

	for (i = 0; i < nr_controllers; i++) {
		unsigned long base, size;
		unsigned rx_req, tx_req;
		unsigned int irq = 0;

		if (!mmc_data[i])
@@ -146,19 +214,24 @@ void __init omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
		case 0:
			base = OMAP1_MMC1_BASE;
			irq = INT_MMC;
			rx_req = OMAP_DMA_MMC_RX;
			tx_req = OMAP_DMA_MMC_TX;
			break;
		case 1:
			if (!cpu_is_omap16xx())
				return;
			base = OMAP1_MMC2_BASE;
			irq = INT_1610_MMC2;
			rx_req = OMAP_DMA_MMC2_RX;
			tx_req = OMAP_DMA_MMC2_TX;
			break;
		default:
			continue;
		}
		size = OMAP1_MMC_SIZE;

		omap_mmc_add("mmci-omap", i, base, size, irq, mmc_data[i]);
		omap_mmc_add("mmci-omap", i, base, size, irq,
				rx_req, tx_req, mmc_data[i]);
	};
}

@@ -242,23 +315,48 @@ void __init omap1_camera_init(void *info)

static inline void omap_init_sti(void) {}

#if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE)
/* Numbering for the SPI-capable controllers when used for SPI:
 * spi		= 1
 * uwire	= 2
 * mmc1..2	= 3..4
 * mcbsp1..3	= 5..7
 */

static struct platform_device omap_pcm = {
	.name	= "omap-pcm-audio",
#if defined(CONFIG_SPI_OMAP_UWIRE) || defined(CONFIG_SPI_OMAP_UWIRE_MODULE)

#define	OMAP_UWIRE_BASE		0xfffb3000

static struct resource uwire_resources[] = {
	{
		.start		= OMAP_UWIRE_BASE,
		.end		= OMAP_UWIRE_BASE + 0x20,
		.flags		= IORESOURCE_MEM,
	},
};

static struct platform_device omap_uwire_device = {
	.name	   = "omap_uwire",
	.id	     = -1,
	.num_resources	= ARRAY_SIZE(uwire_resources),
	.resource	= uwire_resources,
};

static void omap_init_audio(void)
static void omap_init_uwire(void)
{
	platform_device_register(&omap_pcm);
}
	/* FIXME define and use a boot tag; not all boards will be hooking
	 * up devices to the microwire controller, and multi-board configs
	 * mean that CONFIG_SPI_OMAP_UWIRE may be configured anyway...
	 */

	/* board-specific code must configure chipselects (only a few
	 * are normally used) and SCLK/SDI/SDO (each has two choices).
	 */
	(void) platform_device_register(&omap_uwire_device);
}
#else
static inline void omap_init_audio(void) {}
static inline void omap_init_uwire(void) {}
#endif

/*-------------------------------------------------------------------------*/

/*
 * This gets called after board-specific INIT_MACHINE, and initializes most
@@ -292,11 +390,12 @@ static int __init omap1_init_devices(void)
	 * in alphabetical order so they're easier to sort through.
	 */

	omap_init_audio();
	omap_init_mbox();
	omap_init_rtc();
	omap_init_spi100k();
	omap_init_sti();
	omap_init_audio();
	omap_init_uwire();

	return 0;
}
+4 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

# Common support
obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer.o pm.o \
	 common.o gpio.o dma.o wd_timer.o display.o i2c.o
	 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o

omap-2-3-common				= irq.o sdrc.o
hwmod-common				= omap_hwmod.o \
@@ -186,6 +186,9 @@ ifneq ($(CONFIG_TIDSPBRIDGE),)
obj-y					+= dsp.o
endif

# OMAP2420 MSDI controller integration support ("MMC")
obj-$(CONFIG_SOC_OMAP2420)		+= msdi.o

# Specific board support
obj-$(CONFIG_MACH_OMAP_GENERIC)		+= board-generic.o
obj-$(CONFIG_MACH_OMAP_H4)		+= board-h4.o
+1 −1
Original line number Diff line number Diff line
@@ -439,7 +439,7 @@ void omap2_clk_disable_unused(struct clk *clk)
		clk->ops->disable(clk);
	}
	if (clk->clkdm != NULL)
		pwrdm_clkdm_state_switch(clk->clkdm);
		pwrdm_state_switch(clk->clkdm->pwrdm.ptr);
}
#endif

+7 −18
Original line number Diff line number Diff line
/*
 * OMAP3 clock data
 *
 * Copyright (C) 2007-2010 Texas Instruments, Inc.
 * Copyright (C) 2007-2010, 2012 Texas Instruments, Inc.
 * Copyright (C) 2007-2011 Nokia Corporation
 *
 * Written by Paul Walmsley
@@ -1640,6 +1640,7 @@ static struct clk hdq_fck = {
	.name		= "hdq_fck",
	.ops		= &clkops_omap2_dflt_wait,
	.parent		= &core_12m_fck,
	.clkdm_name	= "core_l4_clkdm",
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_HDQ_SHIFT,
	.recalc		= &followparent_recalc,
@@ -3294,8 +3295,8 @@ static struct omap_clk omap3xxx_clks[] = {
	CLK(NULL,	"gfx_l3_ick",	&gfx_l3_ick,	CK_3430ES1),
	CLK(NULL,	"gfx_cg1_ck",	&gfx_cg1_ck,	CK_3430ES1),
	CLK(NULL,	"gfx_cg2_ck",	&gfx_cg2_ck,	CK_3430ES1),
	CLK(NULL,	"sgx_fck",	&sgx_fck,	CK_3430ES2PLUS | CK_3517 | CK_36XX),
	CLK(NULL,	"sgx_ick",	&sgx_ick,	CK_3430ES2PLUS | CK_3517 | CK_36XX),
	CLK(NULL,	"sgx_fck",	&sgx_fck,	CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
	CLK(NULL,	"sgx_ick",	&sgx_ick,	CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
	CLK(NULL,	"d2d_26m_fck",	&d2d_26m_fck,	CK_3430ES1),
	CLK(NULL,	"modem_fck",	&modem_fck,	CK_34XX | CK_36XX),
	CLK(NULL,	"sad2d_ick",	&sad2d_ick,	CK_34XX | CK_36XX),
@@ -3419,7 +3420,7 @@ static struct omap_clk omap3xxx_clks[] = {
	CLK(NULL,	"per_48m_fck",	&per_48m_fck,	CK_3XXX),
	CLK(NULL,	"uart3_fck",	&uart3_fck,	CK_3XXX),
	CLK(NULL,	"uart4_fck",	&uart4_fck,	CK_36XX),
	CLK(NULL,	"uart4_fck",	&uart4_fck_am35xx, CK_3505 | CK_3517),
	CLK(NULL,	"uart4_fck",	&uart4_fck_am35xx, CK_AM35XX),
	CLK(NULL,	"gpt2_fck",	&gpt2_fck,	CK_3XXX),
	CLK(NULL,	"gpt3_fck",	&gpt3_fck,	CK_3XXX),
	CLK(NULL,	"gpt4_fck",	&gpt4_fck,	CK_3XXX),
@@ -3513,21 +3514,9 @@ int __init omap3xxx_clk_init(void)
	struct omap_clk *c;
	u32 cpu_clkflg = 0;

	/*
	 * 3505 must be tested before 3517, since 3517 returns true
	 * for both AM3517 chips and AM3517 family chips, which
	 * includes 3505.  Unfortunately there's no obvious family
	 * test for 3517/3505 :-(
	 */
	if (cpu_is_omap3505()) {
		cpu_mask = RATE_IN_34XX;
		cpu_clkflg = CK_3505;
	} else if (cpu_is_omap3517()) {
		cpu_mask = RATE_IN_34XX;
		cpu_clkflg = CK_3517;
	} else if (cpu_is_omap3505()) {
	if (cpu_is_omap3517()) {
		cpu_mask = RATE_IN_34XX;
		cpu_clkflg = CK_3505;
		cpu_clkflg = CK_AM35XX;
	} else if (cpu_is_omap3630()) {
		cpu_mask = (RATE_IN_34XX | RATE_IN_36XX);
		cpu_clkflg = CK_36XX;
+0 −11
Original line number Diff line number Diff line
@@ -3355,17 +3355,6 @@ static struct omap_clk omap44xx_clks[] = {
	CLK(NULL,	"auxclk5_ck",			&auxclk5_ck,	CK_443X),
	CLK(NULL,	"auxclkreq5_ck",		&auxclkreq5_ck,	CK_443X),
	CLK(NULL,	"gpmc_ck",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt1_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt2_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt3_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt4_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt5_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt6_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt7_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt8_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt9_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt10_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt11_ick",			&dummy_ck,	CK_443X),
	CLK("omap_i2c.1",	"ick",				&dummy_ck,	CK_443X),
	CLK("omap_i2c.2",	"ick",				&dummy_ck,	CK_443X),
	CLK("omap_i2c.3",	"ick",				&dummy_ck,	CK_443X),
Loading