-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marek Szyprowski
authored and
Ben Dooks
committed
May 20, 2010
1 parent
2045938
commit 25276c1
Showing
13 changed files
with
166 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 5b696a67c327f21fc67b60a1518f65e4e7f2749f | ||
refs/heads/master: c8d833bf5830f141c4680dae8f617d0d0a33605d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* linux/arch/arm/mach-s5pv210/setup-i2c1.c | ||
* | ||
* Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. | ||
* http://www.samsung.com/ | ||
* | ||
* I2C1 GPIO configuration. | ||
* | ||
* Based on plat-s3c64xx/setup-i2c1.c | ||
* | ||
* 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/kernel.h> | ||
#include <linux/types.h> | ||
|
||
struct platform_device; /* don't need the contents */ | ||
|
||
#include <mach/gpio.h> | ||
#include <plat/iic.h> | ||
#include <plat/gpio-cfg.h> | ||
|
||
void s3c_i2c1_cfg_gpio(struct platform_device *dev) | ||
{ | ||
s3c_gpio_cfgpin(S5PV210_GPD1(2), S3C_GPIO_SFN(2)); | ||
s3c_gpio_setpull(S5PV210_GPD1(2), S3C_GPIO_PULL_UP); | ||
s3c_gpio_cfgpin(S5PV210_GPD1(3), S3C_GPIO_SFN(2)); | ||
s3c_gpio_setpull(S5PV210_GPD1(3), S3C_GPIO_PULL_UP); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* linux/arch/arm/mach-s5pv210/setup-i2c2.c | ||
* | ||
* Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. | ||
* http://www.samsung.com/ | ||
* | ||
* I2C2 GPIO configuration. | ||
* | ||
* Based on plat-s3c64xx/setup-i2c0.c | ||
* | ||
* 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/kernel.h> | ||
#include <linux/types.h> | ||
|
||
struct platform_device; /* don't need the contents */ | ||
|
||
#include <mach/gpio.h> | ||
#include <plat/iic.h> | ||
#include <plat/gpio-cfg.h> | ||
|
||
void s3c_i2c2_cfg_gpio(struct platform_device *dev) | ||
{ | ||
s3c_gpio_cfgpin(S5PV210_GPD1(4), S3C_GPIO_SFN(2)); | ||
s3c_gpio_setpull(S5PV210_GPD1(4), S3C_GPIO_PULL_UP); | ||
s3c_gpio_cfgpin(S5PV210_GPD1(5), S3C_GPIO_SFN(2)); | ||
s3c_gpio_setpull(S5PV210_GPD1(5), S3C_GPIO_PULL_UP); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* linux/arch/arm/plat-s3c/dev-i2c2.c | ||
* | ||
* Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
* http://www.samsung.com/ | ||
* | ||
* S3C series device definition for i2c device 2 | ||
* | ||
* Based on plat-samsung/dev-i2c0.c | ||
* | ||
* 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/gfp.h> | ||
#include <linux/kernel.h> | ||
#include <linux/string.h> | ||
#include <linux/platform_device.h> | ||
|
||
#include <mach/irqs.h> | ||
#include <mach/map.h> | ||
|
||
#include <plat/regs-iic.h> | ||
#include <plat/iic.h> | ||
#include <plat/devs.h> | ||
#include <plat/cpu.h> | ||
|
||
static struct resource s3c_i2c_resource[] = { | ||
[0] = { | ||
.start = S3C_PA_IIC2, | ||
.end = S3C_PA_IIC2 + SZ_4K - 1, | ||
.flags = IORESOURCE_MEM, | ||
}, | ||
[1] = { | ||
.start = IRQ_CAN0, | ||
.end = IRQ_CAN0, | ||
.flags = IORESOURCE_IRQ, | ||
}, | ||
}; | ||
|
||
struct platform_device s3c_device_i2c2 = { | ||
.name = "s3c2410-i2c", | ||
.id = 2, | ||
.num_resources = ARRAY_SIZE(s3c_i2c_resource), | ||
.resource = s3c_i2c_resource, | ||
}; | ||
|
||
static struct s3c2410_platform_i2c default_i2c_data2 __initdata = { | ||
.flags = 0, | ||
.bus_num = 2, | ||
.slave_addr = 0x10, | ||
.frequency = 100*1000, | ||
.sda_delay = 100, | ||
}; | ||
|
||
void __init s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *pd) | ||
{ | ||
struct s3c2410_platform_i2c *npd; | ||
|
||
if (!pd) | ||
pd = &default_i2c_data2; | ||
|
||
npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL); | ||
if (!npd) | ||
printk(KERN_ERR "%s: no memory for platform data\n", __func__); | ||
else if (!npd->cfg_gpio) | ||
npd->cfg_gpio = s3c_i2c2_cfg_gpio; | ||
|
||
s3c_device_i2c2.dev.platform_data = npd; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters