arch/arm/mach-omap2/pdata-quirks.c

Source file repositories/reference/linux-study-clean/arch/arm/mach-omap2/pdata-quirks.c

File Facts

System
Linux kernel
Corpus path
arch/arm/mach-omap2/pdata-quirks.c
Extension
.c
Size
16030 bytes
Lines
577
Domain
Architecture Layer
Bucket
arch/arm
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

struct pdata_init {
	const char *compatible;
	void (*fn)(void);
};

static struct of_dev_auxdata omap_auxdata_lookup[];

#ifdef CONFIG_MACH_NOKIA_N8X0
static void __init omap2420_n8x0_legacy_init(void)
{
	omap_auxdata_lookup[0].platform_data = n8x0_legacy_init();
}
#else
#define omap2420_n8x0_legacy_init	NULL
#endif

#ifdef CONFIG_ARCH_OMAP3
/*
 * Configures GPIOs 126, 127 and 129 to 1.8V mode instead of 3.0V
 * mode for MMC1 in case bootloader did not configure things.
 * Note that if the pins are used for MMC1, pbias-regulator
 * manages the IO voltage.
 */
static void __init omap3_gpio126_127_129(void)
{
	u32 reg;

	reg = omap_ctrl_readl(OMAP343X_CONTROL_PBIAS_LITE);
	reg &= ~OMAP343X_PBIASLITEVMODE1;
	reg |= OMAP343X_PBIASLITEPWRDNZ1;
	omap_ctrl_writel(reg, OMAP343X_CONTROL_PBIAS_LITE);
	if (cpu_is_omap3630()) {
		reg = omap_ctrl_readl(OMAP34XX_CONTROL_WKUP_CTRL);
		reg |= OMAP36XX_GPIO_IO_PWRDNZ;
		omap_ctrl_writel(reg, OMAP34XX_CONTROL_WKUP_CTRL);
	}
}

static void __init hsmmc2_internal_input_clk(void)
{
	u32 reg;

	reg = omap_ctrl_readl(OMAP343X_CONTROL_DEVCONF1);
	reg |= OMAP2_MMCSDIO2ADPCLKISEL;
	omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
}

#ifdef CONFIG_OMAP_HWMOD
static struct iommu_platform_data omap3_iommu_pdata = {
	.reset_name = "mmu",
	.assert_reset = omap_device_assert_hardreset,
	.deassert_reset = omap_device_deassert_hardreset,
	.device_enable = omap_device_enable,
	.device_idle = omap_device_idle,
};

static struct iommu_platform_data omap3_iommu_isp_pdata = {
	.device_enable = omap_device_enable,
	.device_idle = omap_device_idle,
};
#endif

static void __init omap3_sbc_t3x_usb_hub_init(char *hub_name, int idx)
{
	struct gpio_desc *d;

	/* This asserts the RESET line (reverse polarity) */
	d = gpiod_get_index(NULL, "reset", idx, GPIOD_OUT_HIGH);
	if (IS_ERR(d)) {
		pr_err("Unable to get T3x USB reset GPIO descriptor\n");
		return;
	}
	gpiod_set_consumer_name(d, hub_name);
	gpiod_export(d, 0);
	udelay(10);
	/* De-assert RESET */
	gpiod_set_value(d, 0);
	msleep(1);
}

static struct gpiod_lookup_table omap3_sbc_t3x_usb_gpio_table = {
	.dev_id = NULL,
	.table = {
		GPIO_LOOKUP_IDX("gpio-160-175", 7, "reset", 0,
				GPIO_ACTIVE_LOW),
		{ }
	},
};

static void __init omap3_sbc_t3730_legacy_init(void)

Annotation

Implementation Notes