Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
8a16ff45
Commit
8a16ff45
authored
Mar 05, 2009
by
Kevin Hilman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
davinci: eeprom: use new memory accessor interface
Signed-off-by:
Kevin Hilman
<
khilman@deeprootsystems.com
>
parent
be9ffcc4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
16 deletions
+17
-16
arch/arm/mach-davinci/board-dm644x-evm.c
arch/arm/mach-davinci/board-dm644x-evm.c
+9
-8
arch/arm/mach-davinci/board-dm646x-evm.c
arch/arm/mach-davinci/board-dm646x-evm.c
+8
-8
No files found.
arch/arm/mach-davinci/board-dm644x-evm.c
View file @
8a16ff45
...
...
@@ -15,6 +15,7 @@
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <linux/leds.h>
#include <linux/memory.h>
#include <linux/i2c.h>
#include <linux/i2c/pcf857x.h>
...
...
@@ -412,17 +413,17 @@ static struct pcf857x_platform_data pcf_data_u35 = {
* - 0x0039, 1 byte NTSC vs PAL (bit 0x80 == PAL)
* - ... newer boards may have more
*/
static
struct
at24_iface
*
at24_if
;
static
struct
memory_accessor
*
at24_mem_acc
;
static
int
at24_setup
(
struct
at24_iface
*
iface
,
void
*
context
)
static
int
at24_setup
(
struct
memory_accessor
*
mem_acc
,
void
*
context
)
{
DECLARE_MAC_BUF
(
mac_str
);
char
mac_addr
[
6
];
at24_
if
=
iface
;
at24_
mem_acc
=
mem_acc
;
/* Read MAC addr from EEPROM */
if
(
at24_
if
->
read
(
at24_if
,
mac_addr
,
0x7f00
,
6
)
==
6
)
{
if
(
at24_
mem_acc
->
read
(
at24_mem_acc
,
mac_addr
,
0x7f00
,
6
)
==
6
)
{
printk
(
KERN_INFO
"Read MAC addr from EEPROM: %s
\n
"
,
print_mac
(
mac_str
,
mac_addr
));
...
...
@@ -441,16 +442,16 @@ static struct at24_platform_data eeprom_info = {
int
dm6446evm_eeprom_read
(
void
*
buf
,
off_t
off
,
size_t
count
)
{
if
(
at24_
if
)
return
at24_
if
->
read
(
at24_if
,
buf
,
off
,
count
);
if
(
at24_
mem_acc
)
return
at24_
mem_acc
->
read
(
at24_mem_acc
,
buf
,
off
,
count
);
return
-
ENODEV
;
}
EXPORT_SYMBOL
(
dm6446evm_eeprom_read
);
int
dm6446evm_eeprom_write
(
void
*
buf
,
off_t
off
,
size_t
count
)
{
if
(
at24_
if
)
return
at24_
if
->
write
(
at24_if
,
buf
,
off
,
count
);
if
(
at24_
mem_acc
)
return
at24_
mem_acc
->
write
(
at24_mem_acc
,
buf
,
off
,
count
);
return
-
ENODEV
;
}
EXPORT_SYMBOL
(
dm6446evm_eeprom_write
);
...
...
arch/arm/mach-davinci/board-dm646x-evm.c
View file @
8a16ff45
...
...
@@ -62,17 +62,17 @@ static struct davinci_uart_config uart_config __initdata = {
* - 0x7f00, 6 bytes Ethernet Address
* - ... newer boards may have more
*/
static
struct
at24_iface
*
at24_if
;
static
struct
memory_accessor
*
at24_mem_acc
;
static
int
at24_setup
(
struct
at24_iface
*
iface
,
void
*
context
)
static
int
at24_setup
(
struct
memory_accessor
*
mem_acc
,
void
*
context
)
{
DECLARE_MAC_BUF
(
mac_str
);
char
mac_addr
[
6
];
at24_
if
=
iface
;
at24_
mem_acc
=
mem_acc
;
/* Read MAC addr from EEPROM */
if
(
at24_
if
->
read
(
at24_if
,
mac_addr
,
0x7f00
,
6
)
==
6
)
{
if
(
at24_
mem_acc
->
read
(
at24_mem_acc
,
mac_addr
,
0x7f00
,
6
)
==
6
)
{
printk
(
KERN_INFO
"Read MAC addr from EEPROM: %s
\n
"
,
print_mac
(
mac_str
,
mac_addr
));
...
...
@@ -89,16 +89,16 @@ static struct at24_platform_data eeprom_info = {
int
dm646xevm_eeprom_read
(
void
*
buf
,
off_t
off
,
size_t
count
)
{
if
(
at24_
if
)
return
at24_
if
->
read
(
at24_if
,
buf
,
off
,
count
);
if
(
at24_
mem_acc
)
return
at24_
mem_acc
->
read
(
at24_mem_acc
,
buf
,
off
,
count
);
return
-
ENODEV
;
}
EXPORT_SYMBOL
(
dm646xevm_eeprom_read
);
int
dm646xevm_eeprom_write
(
void
*
buf
,
off_t
off
,
size_t
count
)
{
if
(
at24_
if
)
return
at24_
if
->
write
(
at24_if
,
buf
,
off
,
count
);
if
(
at24_
mem_acc
)
return
at24_
mem_acc
->
write
(
at24_mem_acc
,
buf
,
off
,
count
);
return
-
ENODEV
;
}
EXPORT_SYMBOL
(
dm646xevm_eeprom_write
);
...
...
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