Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
i2c-bcm2708: BCM2708 I2C driver
Signed-off-by: Chris Boot <bootc@bootc.net>
  • Loading branch information
bootc committed May 19, 2012
1 parent 6f4c17a commit 8002705
Show file tree
Hide file tree
Showing 5 changed files with 433 additions and 0 deletions.
47 changes: 47 additions & 0 deletions arch/arm/mach-bcm2708/bcm2708.c
Expand Up @@ -226,6 +226,12 @@ static struct clk_lookup lookups[] = {
}, { /* SPI */
.dev_id = "bcm2708_spi.0",
.clk = &sdhost_clk,
}, { /* BSC0 */
.dev_id = "bcm2708_i2c.0",
.clk = &sdhost_clk,
}, { /* BSC1 */
.dev_id = "bcm2708_i2c.1",
.clk = &sdhost_clk,
}
};

Expand Down Expand Up @@ -503,6 +509,45 @@ static struct spi_board_info bcm2708_spi_devices[] = {
}
};

static struct resource bcm2708_bsc0_resources[] = {
{
.start = BSC0_BASE,
.end = BSC0_BASE + SZ_256 - 1,
.flags = IORESOURCE_MEM,
}, {
.start = INTERRUPT_I2C,
.end = INTERRUPT_I2C,
.flags = IORESOURCE_IRQ,
}
};

static struct platform_device bcm2708_bsc0_device = {
.name = "bcm2708_i2c",
.id = 0,
.num_resources = ARRAY_SIZE(bcm2708_bsc0_resources),
.resource = bcm2708_bsc0_resources,
};


static struct resource bcm2708_bsc1_resources[] = {
{
.start = BSC0_BASE,
.end = BSC0_BASE + SZ_256 - 1,
.flags = IORESOURCE_MEM,
}, {
.start = INTERRUPT_I2C,
.end = INTERRUPT_I2C,
.flags = IORESOURCE_IRQ,
}
};

static struct platform_device bcm2708_bsc1_device = {
.name = "bcm2708_i2c",
.id = 1,
.num_resources = ARRAY_SIZE(bcm2708_bsc1_resources),
.resource = bcm2708_bsc1_resources,
};

int __init bcm_register_device(struct platform_device *pdev)
{
int ret;
Expand Down Expand Up @@ -543,6 +588,8 @@ void __init bcm2708_init(void)
bcm_register_device(&bcm2708_alsa_devices[i]);

bcm_register_device(&bcm2708_spi_device);
bcm_register_device(&bcm2708_bsc0_device);
/*bcm_register_device(&bcm2708_bsc1_device);*/

#ifdef CONFIG_BCM2708_VCMEM
{
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-bcm2708/include/mach/platform.h
Expand Up @@ -64,9 +64,11 @@
#define UART0_BASE (BCM2708_PERI_BASE + 0x201000) /* Uart 0 */
#define MMCI0_BASE (BCM2708_PERI_BASE + 0x202000) /* MMC interface */
#define SPI0_BASE (BCM2708_PERI_BASE + 0x204000) /* SPI0 */
#define BSC0_BASE (BCM2708_PERI_BASE + 0x205000) /* BSC0 I2C/TWI */
#define UART1_BASE (BCM2708_PERI_BASE + 0x215000) /* Uart 1 */
#define EMMC_BASE (BCM2708_PERI_BASE + 0x300000) /* eMMC interface */
#define SMI_BASE (BCM2708_PERI_BASE + 0x600000) /* SMI */
#define BSC1_BASE (BCM2708_PERI_BASE + 0x804000) /* BSC1 I2C/TWI */
#define USB_BASE (BCM2708_PERI_BASE + 0x980000) /* DTC_OTG USB controller */
#define MCORE_BASE (BCM2708_PERI_BASE + 0x0000) /* Fake frame buffer device (actually the multicore sync block*/

Expand Down
8 changes: 8 additions & 0 deletions drivers/i2c/busses/Kconfig
Expand Up @@ -308,6 +308,14 @@ config I2C_AU1550
This driver can also be built as a module. If so, the module
will be called i2c-au1550.

config I2C_BCM2708
tristate "BCM2708 BSC"
depends on MACH_BCM2708
help
Enabling this option will add BSC (Broadcom Serial Controller)
support for the BCM2708. BSC is a Broadcom proprietary bus compatible
with I2C/TWI/SMBus.

config I2C_BLACKFIN_TWI
tristate "Blackfin TWI I2C support"
depends on BLACKFIN
Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/busses/Makefile
Expand Up @@ -30,6 +30,7 @@ obj-$(CONFIG_I2C_POWERMAC) += i2c-powermac.o
# Embedded system I2C/SMBus host controller drivers
obj-$(CONFIG_I2C_AT91) += i2c-at91.o
obj-$(CONFIG_I2C_AU1550) += i2c-au1550.o
obj-$(CONFIG_I2C_BCM2708) += i2c-bcm2708.o
obj-$(CONFIG_I2C_BLACKFIN_TWI) += i2c-bfin-twi.o
obj-$(CONFIG_I2C_CPM) += i2c-cpm.o
obj-$(CONFIG_I2C_DAVINCI) += i2c-davinci.o
Expand Down

0 comments on commit 8002705

Please sign in to comment.