Exemplo n.º 1
0
void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata)
{
	struct platform_device *pdev;

	switch (id) {
	case 0:
		/* Valid for DA830/OMAP-L137 or DA850/OMAP-L138 */
		pdev = &da850_mcasp_device;
		break;
	case 1:
		/* Valid for DA830/OMAP-L137 only */
		if (!cpu_is_davinci_da830())
			return;
		pdev = &da830_mcasp1_device;
		break;
	case 2:
		/* Valid for DA830/OMAP-L137 only */
		if (!cpu_is_davinci_da830())
			return;
		pdev = &da830_mcasp2_device;
		break;
	default:
		return;
	}

	pdev->dev.platform_data = pdata;
	platform_device_register(pdev);
}
Exemplo n.º 2
0
void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata)
{
	/* DA830/OMAP-L137 has 3 instances of McASP */
	if (cpu_is_davinci_da830() && id == 1) {
		da830_mcasp1_device.dev.platform_data = pdata;
		platform_device_register(&da830_mcasp1_device);
	} else if (cpu_is_davinci_da850()) {
		da850_mcasp_device.dev.platform_data = pdata;
		platform_device_register(&da850_mcasp_device);
	}
}
Exemplo n.º 3
0
int __init da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata)
{
#if !defined(CONFIG_FB_DA8XX) && !defined(CONFIG_FB_DA8XX_MODULE)
	if (cpu_is_davinci_da830())
		da8xx_evm_clcd_pdata.version = CONFIG_SPACE_0;

	da8xx_lcdc_device.dev.platform_data = &da8xx_evm_clcd_pdata;
#else
	da8xx_lcdc_device.dev.platform_data = pdata;
#endif
	return platform_device_register(&da8xx_lcdc_device);
}
Exemplo n.º 4
0
int __init da8xx_register_edma(void)
{
	struct platform_device *pdev;

	if (cpu_is_davinci_da830())
		pdev = &da830_edma_device;
	else if (cpu_is_davinci_da850())
		pdev = &da850_edma_device;
	else
		return -ENODEV;

	return platform_device_register(pdev);
}
int __init davinci_serial_init(struct davinci_uart_config *info)
{
	int i;
	char name[16];
	struct clk *uart_clk;
	struct davinci_soc_info *soc_info = &davinci_soc_info;
	struct device *dev = &soc_info->serial_dev->dev;
	struct plat_serial8250_port *p = dev->platform_data;

	/*
	 * Make sure the serial ports are muxed on at this point.
	 * You have to mux them off in device drivers later on if not needed.
	 */
	for (i = 0; p->flags; i++, p++) {
		if (!(info->enabled_uarts & (1 << i)))
			continue;

		sprintf(name, "uart%d", i);
		uart_clk = clk_get(dev, name);
		if (IS_ERR(uart_clk)) {
			printk(KERN_ERR "%s:%d: failed to get UART%d clock\n",
					__func__, __LINE__, i);
			continue;
		}

		clk_enable(uart_clk);
		p->uartclk = clk_get_rate(uart_clk);
		p->clk = uart_clk;

		if (!p->membase && p->mapbase) {
			p->membase = ioremap(p->mapbase, SZ_4K);

			if (p->membase)
				p->flags &= ~UPF_IOREMAP;
			else
				pr_err("uart regs ioremap failed\n");
		}

		if (p->membase && ((p->type != PORT_AR7) ||
					cpu_is_davinci_da850() ||
					cpu_is_davinci_da830()))
			davinci_serial_reset(p);
	}

	return platform_device_register(soc_info->serial_dev);
}