]> git.karo-electronics.de Git - karo-tx-linux.git/blob - arch/arm/plat-mxc/devices/platform-mxc_hdmi.c
1647b8a2f420dedf13b1cb55f9beaec6a4a26328
[karo-tx-linux.git] / arch / arm / plat-mxc / devices / platform-mxc_hdmi.c
1 /*
2  * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3  */
4
5 /*
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20
21 #include <asm/sizes.h>
22 #include <mach/hardware.h>
23 #include <mach/devices-common.h>
24
25 #define imx6_mxc_hdmi_data_entry_single(soc, size)      \
26         {                                                               \
27                 .iobase = soc ## _HDMI_ARB_BASE_ADDR,                   \
28                 .irq = soc ## _INT_HDMI_TX,                             \
29                 .irq_wakeup = soc ## _INT_HDMI_TX_WAKEUP,               \
30                 .iosize = size,                                         \
31         }
32
33 #ifdef CONFIG_SOC_IMX6Q
34 const struct imx_mxc_hdmi_data imx6q_mxc_hdmi_data __initconst =
35                         imx6_mxc_hdmi_data_entry_single(MX6Q, SZ_32K + SZ_4K);
36 #endif
37
38 struct platform_device *__init imx_add_mxc_hdmi(
39                 const struct imx_mxc_hdmi_data *data,
40                 const struct fsl_mxc_lcd_platform_data *pdata)
41 {
42         struct resource res[] = {
43                 {
44                         .start = data->iobase,
45                         .end = data->iobase + data->iosize - 1,
46                         .flags = IORESOURCE_MEM,
47                 },
48                 {
49                         .start = data->irq,
50                         .end = data->irq,
51                         .flags = IORESOURCE_IRQ,
52                 },
53         };
54
55         return imx_add_platform_device_dmamask("mxc_hdmi", -1,
56                 res, ARRAY_SIZE(res), pdata, sizeof(*pdata), DMA_BIT_MASK(32));
57 }
58