Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 166120
b: refs/heads/master
c: 6be2a0c
h: refs/heads/master
v: v3
  • Loading branch information
Linus Walleij authored and Russell King committed Aug 15, 2009
1 parent fbdc5b9 commit 5a894bb
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c7c8c78fdf6e9bd65d8ee879115dc2cd5d9fd0dc
refs/heads/master: 6be2a0cacc1ed6899a53172e2e9b7a3587be0bea
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-u300/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ obj-$(CONFIG_ARCH_U300) += u300.o
obj-$(CONFIG_MMC) += mmc.o
obj-$(CONFIG_SPI_PL022) += spi.o
obj-$(CONFIG_MACH_U300_SPIDUMMY) += dummyspichip.o
obj-$(CONFIG_I2C_STU300) += i2c.o
8 changes: 6 additions & 2 deletions trunk/arch/arm/mach-u300/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "clock.h"
#include "mmc.h"
#include "spi.h"
#include "i2c.h"

/*
* Static I/O mappings that are needed for booting the U300 platforms. The
Expand Down Expand Up @@ -379,14 +380,14 @@ static struct platform_device wdog_device = {
};

static struct platform_device i2c0_device = {
.name = "stddci2c",
.name = "stu300",
.id = 0,
.num_resources = ARRAY_SIZE(i2c0_resources),
.resource = i2c0_resources,
};

static struct platform_device i2c1_device = {
.name = "stddci2c",
.name = "stu300",
.id = 1,
.num_resources = ARRAY_SIZE(i2c1_resources),
.resource = i2c1_resources,
Expand Down Expand Up @@ -625,6 +626,9 @@ void __init u300_init_devices(void)

u300_assign_physmem();

/* Register subdevices on the I2C buses */
u300_i2c_register_board_devices();

/* Register subdevices on the SPI bus */
u300_spi_register_board_devices();

Expand Down
43 changes: 43 additions & 0 deletions trunk/arch/arm/mach-u300/i2c.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* arch/arm/mach-u300/i2c.c
*
* Copyright (C) 2009 ST-Ericsson AB
* License terms: GNU General Public License (GPL) version 2
*
* Register board i2c devices
* Author: Linus Walleij <linus.walleij@stericsson.com>
*/
#include <linux/kernel.h>
#include <linux/i2c.h>
#include <mach/irqs.h>

static struct i2c_board_info __initdata bus0_i2c_board_info[] = {
{
.type = "ab3100",
.addr = 0x48,
.irq = IRQ_U300_IRQ0_EXT,
},
};

static struct i2c_board_info __initdata bus1_i2c_board_info[] = {
#ifdef CONFIG_MACH_U300_BS335
{
.type = "fwcam",
.addr = 0x10,
},
{
.type = "fwcam",
.addr = 0x5d,
},
#else
{ },
#endif
};

void __init u300_i2c_register_board_devices(void)
{
i2c_register_board_info(0, bus0_i2c_board_info,
ARRAY_SIZE(bus0_i2c_board_info));
i2c_register_board_info(1, bus1_i2c_board_info,
ARRAY_SIZE(bus1_i2c_board_info));
}
23 changes: 23 additions & 0 deletions trunk/arch/arm/mach-u300/i2c.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* arch/arm/mach-u300/i2c.h
*
* Copyright (C) 2009 ST-Ericsson AB
* License terms: GNU General Public License (GPL) version 2
*
* Register board i2c devices
* Author: Linus Walleij <linus.walleij@stericsson.com>
*/

#ifndef MACH_U300_I2C_H
#define MACH_U300_I2C_H

#ifdef CONFIG_I2C_STU300
void __init u300_i2c_register_board_devices(void);
#else
/* Compile out this stuff if no I2C adapter is available */
static inline void __init u300_i2c_register_board_devices(void)
{
}
#endif

#endif

0 comments on commit 5a894bb

Please sign in to comment.