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
Kirill Smelkov
linux
Commits
0b364777
Commit
0b364777
authored
Aug 30, 2004
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MMC] MMCI: Maintain offset rather than buffer pointer for PIO
parent
8fe6710a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
drivers/mmc/mmci.c
drivers/mmc/mmci.c
+11
-9
drivers/mmc/mmci.h
drivers/mmc/mmci.h
+1
-1
No files found.
drivers/mmc/mmci.c
View file @
0b364777
...
...
@@ -64,7 +64,6 @@ static void mmci_stop_data(struct mmci_host *host)
writel
(
0
,
host
->
base
+
MMCIDATACTRL
);
writel
(
0
,
host
->
base
+
MMCIMASK1
);
host
->
data
=
NULL
;
host
->
buffer
=
NULL
;
}
static
void
mmci_start_data
(
struct
mmci_host
*
host
,
struct
mmc_data
*
data
)
...
...
@@ -76,7 +75,7 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
1
<<
data
->
blksz_bits
,
data
->
blocks
,
data
->
flags
);
host
->
data
=
data
;
host
->
buffer
=
data
->
req
->
buffer
;
host
->
offset
=
0
;
host
->
size
=
data
->
blocks
<<
data
->
blksz_bits
;
host
->
data_xfered
=
0
;
...
...
@@ -198,6 +197,7 @@ static int mmci_pio_read(struct mmci_host *host, struct request *req, u32 status
do
{
unsigned
int
count
;
char
*
buffer
;
/*
* Check for data available.
...
...
@@ -205,13 +205,13 @@ static int mmci_pio_read(struct mmci_host *host, struct request *req, u32 status
if
(
!
(
status
&
MCI_RXDATAAVLBL
))
break
;
buffer
=
req
->
buffer
;
count
=
host
->
size
-
(
readl
(
base
+
MMCIFIFOCNT
)
<<
2
);
if
(
count
<
0
)
count
=
0
;
if
(
count
&&
host
->
buffer
)
{
if
(
count
>
0
)
{
ret
=
1
;
readsl
(
base
+
MMCIFIFO
,
host
->
buffer
,
count
>>
2
);
host
->
buffer
+=
count
;
readsl
(
base
+
MMCIFIFO
,
buffer
+
host
->
offset
,
count
>>
2
);
host
->
offset
+=
count
;
host
->
size
-=
count
;
}
...
...
@@ -228,6 +228,7 @@ static int mmci_pio_write(struct mmci_host *host, struct request *req, u32 statu
do
{
unsigned
int
count
,
maxcnt
;
char
*
buffer
;
/*
* We only need to test the half-empty flag here - if
...
...
@@ -237,13 +238,14 @@ static int mmci_pio_write(struct mmci_host *host, struct request *req, u32 statu
if
(
!
(
status
&
MCI_TXFIFOHALFEMPTY
))
break
;
buffer
=
req
->
buffer
;
maxcnt
=
status
&
MCI_TXFIFOEMPTY
?
MCI_FIFOSIZE
:
MCI_FIFOHALFSIZE
;
count
=
min
(
host
->
size
,
maxcnt
);
writesl
(
base
+
MMCIFIFO
,
host
->
buffer
,
count
>>
2
);
writesl
(
base
+
MMCIFIFO
,
buffer
+
host
->
offset
,
count
>>
2
);
host
->
buffer
+=
count
;
host
->
offset
+=
count
;
host
->
size
-=
count
;
ret
=
1
;
...
...
drivers/mmc/mmci.h
View file @
0b364777
...
...
@@ -138,6 +138,6 @@ struct mmci_host {
unsigned
int
oldstat
;
/* pio stuff */
void
*
buffer
;
unsigned
int
offset
;
unsigned
int
size
;
};
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