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

Commit 6348e6b5 authored by Uwe Kleine-König's avatar Uwe Kleine-König
Browse files

ARM: imx: dynamically register imx-i2c devices (imx1)

parent 99a754d8
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@ config MACH_MXLADS
config ARCH_MX1ADS
config ARCH_MX1ADS
	bool "MX1ADS platform"
	bool "MX1ADS platform"
	select MACH_MXLADS
	select MACH_MXLADS
	select IMX_HAVE_PLATFORM_IMX_I2C
	help
	help
	  Say Y here if you are using Motorola MX1ADS/MXLADS boards
	  Say Y here if you are using Motorola MX1ADS/MXLADS boards


+13 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2010 Pengutronix
 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
 *
 * 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 <mach/mx1.h>
#include <mach/devices-common.h>

#define imx1_add_i2c_imx(pdata)		\
	imx_add_imx_i2c(0, MX1_I2C_BASE_ADDR, SZ_4K, MX1_INT_I2C, pdata)
+0 −19
Original line number Original line Diff line number Diff line
@@ -70,25 +70,6 @@ struct platform_device imx1_camera_device = {
	.num_resources  = ARRAY_SIZE(imx1_camera_resources),
	.num_resources  = ARRAY_SIZE(imx1_camera_resources),
};
};


static struct resource imx_i2c_resources[] = {
	{
		.start  = 0x00217000,
		.end    = 0x00217010,
		.flags  = IORESOURCE_MEM,
	}, {
		.start  = MX1_I2C_INT,
		.end    = MX1_I2C_INT,
		.flags  = IORESOURCE_IRQ,
	},
};

struct platform_device imx_i2c_device0 = {
	.name           = "imx-i2c",
	.id             = 0,
	.resource       = imx_i2c_resources,
	.num_resources  = ARRAY_SIZE(imx_i2c_resources),
};

#define DEFINE_IMX1_UART_DEVICE(n, baseaddr, irqrx, irqtx, irqrts)	\
#define DEFINE_IMX1_UART_DEVICE(n, baseaddr, irqrx, irqtx, irqrts)	\
	static struct resource imx1_uart_resources ## n[] = {		\
	static struct resource imx1_uart_resources ## n[] = {		\
		{							\
		{							\
+0 −1
Original line number Original line Diff line number Diff line
#ifdef CONFIG_ARCH_MX1
#ifdef CONFIG_ARCH_MX1
extern struct platform_device imx1_camera_device;
extern struct platform_device imx1_camera_device;
extern struct platform_device imx_i2c_device0;
extern struct platform_device imx1_uart_device0;
extern struct platform_device imx1_uart_device0;
extern struct platform_device imx1_uart_device1;
extern struct platform_device imx1_uart_device1;
extern struct platform_device imx_rtc_device;
extern struct platform_device imx_rtc_device;
+3 −2
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@
#include <mach/iomux-mx1.h>
#include <mach/iomux-mx1.h>
#include <mach/irqs.h>
#include <mach/irqs.h>


#include "devices-imx1.h"
#include "devices.h"
#include "devices.h"


static int mx1ads_pins[] = {
static int mx1ads_pins[] = {
@@ -98,7 +99,7 @@ static struct pcf857x_platform_data pcf857x_data[] = {
	}
	}
};
};


static struct imxi2c_platform_data mx1ads_i2c_data = {
static const struct imxi2c_platform_data mx1ads_i2c_data __initconst = {
	.bitrate = 100000,
	.bitrate = 100000,
};
};


@@ -131,7 +132,7 @@ static void __init mx1ads_init(void)
	i2c_register_board_info(0, mx1ads_i2c_devices,
	i2c_register_board_info(0, mx1ads_i2c_devices,
				ARRAY_SIZE(mx1ads_i2c_devices));
				ARRAY_SIZE(mx1ads_i2c_devices));


	mxc_register_device(&imx_i2c_device0, &mx1ads_i2c_data);
	imx1_add_i2c_imx(&mx1ads_i2c_data);
}
}


static void __init mx1ads_timer_init(void)
static void __init mx1ads_timer_init(void)
Loading