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
d16f5770
Commit
d16f5770
authored
Aug 31, 2008
by
Pierre Ossman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sdio: high-speed support
Signed-off-by:
Pierre Ossman
<
drzeus@drzeus.cx
>
parent
08846698
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
3 deletions
+49
-3
drivers/mmc/core/sdio.c
drivers/mmc/core/sdio.c
+49
-3
No files found.
drivers/mmc/core/sdio.c
View file @
d16f5770
...
...
@@ -164,6 +164,36 @@ static int sdio_enable_wide(struct mmc_card *card)
return
0
;
}
/*
* Test if the card supports high-speed mode and, if so, switch to it.
*/
static
int
sdio_enable_hs
(
struct
mmc_card
*
card
)
{
int
ret
;
u8
speed
;
if
(
!
(
card
->
host
->
caps
&
MMC_CAP_SD_HIGHSPEED
))
return
0
;
if
(
!
card
->
cccr
.
high_speed
)
return
0
;
ret
=
mmc_io_rw_direct
(
card
,
0
,
0
,
SDIO_CCCR_SPEED
,
0
,
&
speed
);
if
(
ret
)
return
ret
;
speed
|=
SDIO_SPEED_EHS
;
ret
=
mmc_io_rw_direct
(
card
,
1
,
0
,
SDIO_CCCR_SPEED
,
speed
,
NULL
);
if
(
ret
)
return
ret
;
mmc_card_set_highspeed
(
card
);
mmc_set_timing
(
card
->
host
,
MMC_TIMING_SD_HS
);
return
0
;
}
/*
* Host is being removed. Free up the current card.
*/
...
...
@@ -333,10 +363,26 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
goto
remove
;
/*
* No support for high-speed yet, so just set
* the card's maximum speed.
* Switch to high-speed (if supported).
*/
mmc_set_clock
(
host
,
card
->
cis
.
max_dtr
);
err
=
sdio_enable_hs
(
card
);
if
(
err
)
goto
remove
;
/*
* Change to the card's maximum speed.
*/
if
(
mmc_card_highspeed
(
card
))
{
/*
* The SDIO specification doesn't mention how
* the CIS transfer speed register relates to
* high-speed, but it seems that 50 MHz is
* mandatory.
*/
mmc_set_clock
(
host
,
50000000
);
}
else
{
mmc_set_clock
(
host
,
card
->
cis
.
max_dtr
);
}
/*
* Switch to wider bus (if supported).
...
...
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