Path: blob/master/arch/arm/mach-mxs/devices/platform-auart.c
10819 views
/*1* Copyright (C) 2010 Pengutronix2* Sascha Hauer <[email protected]>3*4* This program is free software; you can redistribute it and/or modify it under5* the terms of the GNU General Public License version 2 as published by the6* Free Software Foundation.7*/8#include <asm/sizes.h>9#include <mach/mx23.h>10#include <mach/mx28.h>11#include <mach/devices-common.h>1213#define mxs_auart_data_entry_single(soc, _id, hwid) \14{ \15.id = _id, \16.iobase = soc ## _AUART ## hwid ## _BASE_ADDR, \17.irq = soc ## _INT_AUART ## hwid, \18}1920#define mxs_auart_data_entry(soc, _id, hwid) \21[_id] = mxs_auart_data_entry_single(soc, _id, hwid)2223#ifdef CONFIG_SOC_IMX2324const struct mxs_auart_data mx23_auart_data[] __initconst = {25#define mx23_auart_data_entry(_id, hwid) \26mxs_auart_data_entry(MX23, _id, hwid)27mx23_auart_data_entry(0, 1),28mx23_auart_data_entry(1, 2),29};30#endif3132#ifdef CONFIG_SOC_IMX2833const struct mxs_auart_data mx28_auart_data[] __initconst = {34#define mx28_auart_data_entry(_id) \35mxs_auart_data_entry(MX28, _id, _id)36mx28_auart_data_entry(0),37mx28_auart_data_entry(1),38mx28_auart_data_entry(2),39mx28_auart_data_entry(3),40mx28_auart_data_entry(4),41};42#endif4344struct platform_device *__init mxs_add_auart(45const struct mxs_auart_data *data)46{47struct resource res[] = {48{49.start = data->iobase,50.end = data->iobase + SZ_8K - 1,51.flags = IORESOURCE_MEM,52}, {53.start = data->irq,54.end = data->irq,55.flags = IORESOURCE_IRQ,56},57};5859return mxs_add_platform_device_dmamask("mxs-auart", data->id,60res, ARRAY_SIZE(res), NULL, 0,61DMA_BIT_MASK(32));62}63646566