Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112498
b: refs/heads/master
c: d395e6a
h: refs/heads/master
v: v3
  • Loading branch information
Komal Shah authored and Kevin Hilman committed Sep 17, 2008
1 parent 2f99dd7 commit c19bacc
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 4 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: dce1115bc32d66237102a4c925e1e0a5e82b9945
refs/heads/master: d395e6ad98912b52a299999ab667de9a1f393c91
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-davinci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# Common objects
obj-y := time.o irq.o clock.o serial.o io.o id.o psc.o \
gpio.o mux.o
gpio.o mux.o devices.o

# Board specific
obj-$(CONFIG_MACH_DAVINCI_EVM) += board-evm.o
48 changes: 48 additions & 0 deletions trunk/arch/arm/mach-davinci/devices.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* mach-davinci/devices.c
*
* DaVinci platform device setup/initialization
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <linux/io.h>

#include <asm/mach/map.h>

#include <mach/hardware.h>
#include <mach/i2c.h>

static struct resource i2c_resources[] = {
{
.start = DAVINCI_I2C_BASE,
.end = DAVINCI_I2C_BASE + 0x40,
.flags = IORESOURCE_MEM,
},
{
.start = IRQ_I2C,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device davinci_i2c_device = {
.name = "i2c_davinci",
.id = 1,
.num_resources = ARRAY_SIZE(i2c_resources),
.resource = i2c_resources,
};

void __init davinci_init_i2c(struct davinci_i2c_platform_data *pdata)
{
davinci_i2c_device.dev.platform_data = pdata;
(void) platform_device_register(&davinci_i2c_device);
}

7 changes: 5 additions & 2 deletions trunk/arch/arm/mach-davinci/include/mach/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@

/* All frequencies are expressed in kHz */
struct davinci_i2c_platform_data {
unsigned int bus_freq; /* standard bus frequency */
unsigned int bus_delay; /* transaction delay */
unsigned int bus_freq; /* standard bus frequency (kHz) */
unsigned int bus_delay; /* post-transaction delay (usec) */
};

/* for board setup code */
void davinci_init_i2c(struct davinci_i2c_platform_data *);

#endif /* __ASM_ARCH_I2C_H */

0 comments on commit c19bacc

Please sign in to comment.