Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
b8b19b0d
Commit
b8b19b0d
authored
Jan 28, 2009
by
Sascha Hauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] mx1ads: add I2C support
Signed-off-by:
Sascha Hauer
<
s.hauer@pengutronix.de
>
parent
a4e9a65a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
0 deletions
+63
-0
arch/arm/mach-mx1/mx1ads.c
arch/arm/mach-mx1/mx1ads.c
+63
-0
No files found.
arch/arm/mach-mx1/mx1ads.c
View file @
b8b19b0d
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
#include <linux/init.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/platform_device.h>
#include <linux/mtd/physmap.h>
#include <linux/mtd/physmap.h>
#include <linux/i2c.h>
#include <linux/i2c/pcf857x.h>
#include <asm/mach-types.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/arch.h>
...
@@ -24,6 +26,10 @@
...
@@ -24,6 +26,10 @@
#include <mach/hardware.h>
#include <mach/hardware.h>
#include <mach/common.h>
#include <mach/common.h>
#include <mach/imx-uart.h>
#include <mach/imx-uart.h>
#include <mach/irqs.h>
#ifdef CONFIG_I2C_IMX
#include <mach/i2c.h>
#endif
#include <mach/iomux.h>
#include <mach/iomux.h>
#include "devices.h"
#include "devices.h"
...
@@ -103,6 +109,55 @@ static struct platform_device flash_device = {
...
@@ -103,6 +109,55 @@ static struct platform_device flash_device = {
.
num_resources
=
1
,
.
num_resources
=
1
,
};
};
/*
* I2C
*/
#ifdef CONFIG_I2C_IMX
static
int
i2c_pins
[]
=
{
PA15_PF_I2C_SDA
,
PA16_PF_I2C_SCL
,
};
static
int
i2c_init
(
struct
device
*
dev
)
{
return
mxc_gpio_setup_multiple_pins
(
i2c_pins
,
ARRAY_SIZE
(
i2c_pins
),
"I2C"
);
}
static
void
i2c_exit
(
struct
device
*
dev
)
{
mxc_gpio_release_multiple_pins
(
i2c_pins
,
ARRAY_SIZE
(
i2c_pins
));
}
static
struct
pcf857x_platform_data
pcf857x_data
[]
=
{
{
.
gpio_base
=
4
*
32
,
},
{
.
gpio_base
=
4
*
32
+
16
,
}
};
static
struct
imxi2c_platform_data
mx1ads_i2c_data
=
{
.
bitrate
=
100000
,
.
init
=
i2c_init
,
.
exit
=
i2c_exit
,
};
static
struct
i2c_board_info
mx1ads_i2c_devices
[]
=
{
{
I2C_BOARD_INFO
(
"pcf857x"
,
0x22
),
.
type
=
"pcf8575"
,
.
platform_data
=
&
pcf857x_data
[
0
],
},
{
I2C_BOARD_INFO
(
"pcf857x"
,
0x24
),
.
type
=
"pcf8575"
,
.
platform_data
=
&
pcf857x_data
[
1
],
},
};
#endif
/*
/*
* Board init
* Board init
*/
*/
...
@@ -114,6 +169,14 @@ static void __init mx1ads_init(void)
...
@@ -114,6 +169,14 @@ static void __init mx1ads_init(void)
/* Physmap flash */
/* Physmap flash */
mxc_register_device
(
&
flash_device
,
&
mx1ads_flash_data
);
mxc_register_device
(
&
flash_device
,
&
mx1ads_flash_data
);
/* I2C */
#ifdef CONFIG_I2C_IMX
i2c_register_board_info
(
0
,
mx1ads_i2c_devices
,
ARRAY_SIZE
(
mx1ads_i2c_devices
));
mxc_register_device
(
&
imx_i2c_device
,
&
mx1ads_i2c_data
);
#endif
}
}
static
void
__init
mx1ads_timer_init
(
void
)
static
void
__init
mx1ads_timer_init
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment