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

Commit c8ebcac8 authored by Dong Aisheng's avatar Dong Aisheng Committed by Sascha Hauer
Browse files

ARM: mxs: add saif device



Signed-off-by: default avatarDong Aisheng <b29396@freescale.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: default avatarWolfram Sang <w.sang@pengutronix.de>
parent cf66ea8e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ config MACH_MX28EVK
	select MXS_HAVE_PLATFORM_FLEXCAN
	select MXS_HAVE_PLATFORM_MXS_MMC
	select MXS_HAVE_PLATFORM_MXSFB
	select MXS_HAVE_PLATFORM_MXS_SAIF
	select MXS_OCOTP
	help
	  Include support for MX28EVK platform. This includes specific
+3 −0
Original line number Diff line number Diff line
@@ -45,3 +45,6 @@ extern const struct mxs_mxs_mmc_data mx28_mxs_mmc_data[] __initconst;

struct platform_device *__init mx28_add_mxsfb(
		const struct mxsfb_platform_data *pdata);

extern const struct mxs_saif_data mx28_saif_data[] __initconst;
#define mx28_add_saif(id)              mxs_add_saif(&mx28_saif_data[id])
+3 −0
Original line number Diff line number Diff line
@@ -23,3 +23,6 @@ config MXS_HAVE_PLATFORM_MXS_PWM

config MXS_HAVE_PLATFORM_MXSFB
	bool

config MXS_HAVE_PLATFORM_MXS_SAIF
	bool
+1 −0
Original line number Diff line number Diff line
@@ -8,3 +8,4 @@ obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_MMC) += platform-mxs-mmc.o
obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_PWM) += platform-mxs-pwm.o
obj-y += platform-gpio-mxs.o
obj-$(CONFIG_MXS_HAVE_PLATFORM_MXSFB) += platform-mxsfb.o
obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_SAIF) += platform-mxs-saif.o
+60 −0
Original line number Diff line number Diff line
/*
 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License version 2 as published by the
 * Free Software Foundation.
 */
#include <linux/compiler.h>
#include <linux/err.h>
#include <linux/init.h>

#include <mach/mx23.h>
#include <mach/mx28.h>
#include <mach/devices-common.h>

#define mxs_saif_data_entry_single(soc, _id)				\
	{								\
		.id = _id,						\
		.iobase = soc ## _SAIF ## _id ## _BASE_ADDR,		\
		.irq = soc ## _INT_SAIF ## _id,				\
		.dma = soc ## _DMA_SAIF ## _id,				\
		.dmairq = soc ## _INT_SAIF ## _id ##_DMA,		\
	}

#define mxs_saif_data_entry(soc, _id)					\
	[_id] = mxs_saif_data_entry_single(soc, _id)

#ifdef CONFIG_SOC_IMX28
const struct mxs_saif_data mx28_saif_data[] __initconst = {
	mxs_saif_data_entry(MX28, 0),
	mxs_saif_data_entry(MX28, 1),
};
#endif

struct platform_device *__init mxs_add_saif(const struct mxs_saif_data *data)
{
	struct resource res[] = {
		{
			.start = data->iobase,
			.end = data->iobase + SZ_4K - 1,
			.flags = IORESOURCE_MEM,
		}, {
			.start = data->irq,
			.end = data->irq,
			.flags = IORESOURCE_IRQ,
		}, {
			.start = data->dma,
			.end = data->dma,
			.flags = IORESOURCE_DMA,
		}, {
			.start = data->dmairq,
			.end = data->dmairq,
			.flags = IORESOURCE_IRQ,
		},

	};

	return mxs_add_platform_device("mxs-saif", data->id, res,
					ARRAY_SIZE(res), NULL, 0);
}
Loading