Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
reform-boundary-uboot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jack Humbert
reform-boundary-uboot
Commits
a1f77b69
Commit
a1f77b69
authored
13 years ago
by
Mike Frysinger
Browse files
Options
Downloads
Patches
Plain Diff
sf: eeprom_m95xxx: fix up style
Signed-off-by:
Mike Frysinger
<
vapier@gentoo.org
>
parent
9cbfee6d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/mtd/spi/eeprom_m95xxx.c
+12
-12
12 additions, 12 deletions
drivers/mtd/spi/eeprom_m95xxx.c
with
12 additions
and
12 deletions
drivers/mtd/spi/eeprom_m95xxx.c
+
12
−
12
View file @
a1f77b69
...
...
@@ -37,33 +37,33 @@
#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
#endif
ssize_t
spi_read
(
uchar
*
addr
,
int
alen
,
uchar
*
buffer
,
int
len
)
ssize_t
spi_read
(
uchar
*
addr
,
int
alen
,
uchar
*
buffer
,
int
len
)
{
struct
spi_slave
*
slave
;
u8
cmd
=
SPI_EEPROM_READ
;
slave
=
spi_setup_slave
(
CONFIG_DEFAULT_SPI_BUS
,
1
,
1000000
,
CONFIG_DEFAULT_SPI_MODE
);
if
(
!
slave
)
if
(
!
slave
)
return
0
;
spi_claim_bus
(
slave
);
/* command */
if
(
spi_xfer
(
slave
,
8
,
&
cmd
,
NULL
,
SPI_XFER_BEGIN
))
if
(
spi_xfer
(
slave
,
8
,
&
cmd
,
NULL
,
SPI_XFER_BEGIN
))
return
-
1
;
/*
* if alen == 3, addr[0] is the block number, we never use it here.
All we
* need are the lower 16 bits
* if alen == 3, addr[0] is the block number, we never use it here.
*
All we
need are the lower 16 bits
.
*/
if
(
alen
==
3
)
addr
++
;
/* address, and data */
if
(
spi_xfer
(
slave
,
16
,
addr
,
NULL
,
0
))
if
(
spi_xfer
(
slave
,
16
,
addr
,
NULL
,
0
))
return
-
1
;
if
(
spi_xfer
(
slave
,
8
*
len
,
NULL
,
buffer
,
SPI_XFER_END
))
if
(
spi_xfer
(
slave
,
8
*
len
,
NULL
,
buffer
,
SPI_XFER_END
))
return
-
1
;
spi_release_bus
(
slave
);
...
...
@@ -71,7 +71,7 @@ ssize_t spi_read (uchar *addr, int alen, uchar *buffer, int len)
return
len
;
}
ssize_t
spi_write
(
uchar
*
addr
,
int
alen
,
uchar
*
buffer
,
int
len
)
ssize_t
spi_write
(
uchar
*
addr
,
int
alen
,
uchar
*
buffer
,
int
len
)
{
struct
spi_slave
*
slave
;
char
buf
[
3
];
...
...
@@ -85,7 +85,7 @@ ssize_t spi_write (uchar *addr, int alen, uchar *buffer, int len)
spi_claim_bus
(
slave
);
buf
[
0
]
=
SPI_EEPROM_WREN
;
if
(
spi_xfer
(
slave
,
8
,
buf
,
NULL
,
SPI_XFER_BEGIN
|
SPI_XFER_END
))
if
(
spi_xfer
(
slave
,
8
,
buf
,
NULL
,
SPI_XFER_BEGIN
|
SPI_XFER_END
))
return
-
1
;
buf
[
0
]
=
SPI_EEPROM_WRITE
;
...
...
@@ -98,9 +98,9 @@ ssize_t spi_write (uchar *addr, int alen, uchar *buffer, int len)
memcpy
(
buf
+
1
,
addr
,
alen
);
/* command + addr, then data */
if
(
spi_xfer
(
slave
,
24
,
buf
,
NULL
,
SPI_XFER_BEGIN
))
if
(
spi_xfer
(
slave
,
24
,
buf
,
NULL
,
SPI_XFER_BEGIN
))
return
-
1
;
if
(
spi_xfer
(
slave
,
len
*
8
,
buffer
,
NULL
,
SPI_XFER_END
))
if
(
spi_xfer
(
slave
,
len
*
8
,
buffer
,
NULL
,
SPI_XFER_END
))
return
-
1
;
start
=
get_timer
(
0
);
...
...
@@ -115,7 +115,7 @@ ssize_t spi_write (uchar *addr, int alen, uchar *buffer, int len)
}
while
(
get_timer
(
start
)
<
CONFIG_SYS_SPI_WRITE_TOUT
);
if
(
buf
[
1
]
&
1
)
printf
(
"*** spi_write: Time
out while writing!
\n
"
);
printf
(
"*** spi_write: Timeout while writing!
\n
"
);
spi_release_bus
(
slave
);
spi_free_slave
(
slave
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment