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
0090fa60
Commit
0090fa60
authored
Mar 05, 2009
by
Kevin Hilman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eeprom: undo at24 interface changes
Signed-off-by:
Kevin Hilman
<
khilman@deeprootsystems.com
>
parent
83b74c75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
45 deletions
+7
-45
drivers/misc/eeprom/at24.c
drivers/misc/eeprom/at24.c
+7
-35
include/linux/i2c/at24.h
include/linux/i2c/at24.h
+0
-10
No files found.
drivers/misc/eeprom/at24.c
View file @
0090fa60
...
...
@@ -53,7 +53,6 @@
struct
at24_data
{
struct
at24_platform_data
chip
;
struct
at24_iface
iface
;
bool
use_smbus
;
/*
...
...
@@ -264,6 +263,13 @@ static ssize_t at24_bin_read(struct kobject *kobj, struct bin_attribute *attr,
}
/*
* REVISIT: export at24_bin{read,write}() to let other kernel code use
* eeprom data. For example, it might hold a board's Ethernet address, or
* board-specific calibration data generated on the manufacturing floor.
*/
/*
* Note that if the hardware write-protect pin is pulled high, the whole
* chip is normally write protected. But there are plenty of product
...
...
@@ -380,30 +386,6 @@ static ssize_t at24_bin_write(struct kobject *kobj, struct bin_attribute *attr,
/*-------------------------------------------------------------------------*/
/*
* This lets other kernel code access the eeprom data. For example, it
* might hold a board's Ethernet address, or board-specific calibration
* data generated on the manufacturing floor.
*/
static
ssize_t
at24_iface_read
(
struct
at24_iface
*
iface
,
char
*
buf
,
off_t
offset
,
size_t
count
)
{
struct
at24_data
*
at24
=
container_of
(
iface
,
struct
at24_data
,
iface
);
return
at24_eeprom_read
(
at24
,
buf
,
offset
,
count
);
}
static
ssize_t
at24_iface_write
(
struct
at24_iface
*
iface
,
char
*
buf
,
off_t
offset
,
size_t
count
)
{
struct
at24_data
*
at24
=
container_of
(
iface
,
struct
at24_data
,
iface
);
return
at24_eeprom_write
(
at24
,
buf
,
offset
,
count
);
}
/*-------------------------------------------------------------------------*/
static
int
at24_probe
(
struct
i2c_client
*
client
,
const
struct
i2c_device_id
*
id
)
{
struct
at24_platform_data
chip
;
...
...
@@ -431,9 +413,6 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
* is recommended anyhow.
*/
chip
.
page_size
=
1
;
chip
.
setup
=
NULL
;
chip
.
context
=
NULL
;
}
if
(
!
is_power_of_2
(
chip
.
byte_len
))
...
...
@@ -470,9 +449,6 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
goto
err_out
;
}
at24
->
iface
.
read
=
at24_iface_read
;
at24
->
iface
.
write
=
at24_iface_write
;
mutex_init
(
&
at24
->
lock
);
at24
->
use_smbus
=
use_smbus
;
at24
->
chip
=
chip
;
...
...
@@ -544,10 +520,6 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
at24
->
write_max
,
use_smbus
?
", use_smbus"
:
""
);
/* export data to kernel code */
if
(
chip
.
setup
)
chip
.
setup
(
&
at24
->
iface
,
chip
.
context
);
return
0
;
err_clients:
...
...
include/linux/i2c/at24.h
View file @
0090fa60
...
...
@@ -15,13 +15,6 @@
* is bigger than what the chip actually supports!
*/
struct
at24_iface
{
ssize_t
(
*
read
)(
struct
at24_iface
*
,
char
*
buf
,
off_t
offset
,
size_t
count
);
ssize_t
(
*
write
)(
struct
at24_iface
*
,
char
*
buf
,
off_t
offset
,
size_t
count
);
};
struct
at24_platform_data
{
u32
byte_len
;
/* size (sum of all addr) */
u16
page_size
;
/* for writes */
...
...
@@ -30,9 +23,6 @@ struct at24_platform_data {
#define AT24_FLAG_READONLY 0x40
/* sysfs-entry will be read-only */
#define AT24_FLAG_IRUGO 0x20
/* sysfs-entry will be world-readable */
#define AT24_FLAG_TAKE8ADDR 0x10
/* take always 8 addresses (24c00) */
int
(
*
setup
)(
struct
at24_iface
*
,
void
*
context
);
void
*
context
;
};
#endif
/* _LINUX_AT24_H */
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