Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Linux-Kernel
Linux AT91
Commits
d2fc4294
Commit
d2fc4294
authored
Jan 12, 2015
by
Michael Welling
Browse files
Enables the use of slow oscillator mode lower APM sleep power.
Signed-off-by:
Michael Welling
<
mwelling@emacinc.com
>
parent
e806b3ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
drivers/net/phy/micrel.c
View file @
d2fc4294
...
...
@@ -177,16 +177,49 @@ static int ksz8873mll_config_aneg(struct phy_device *phydev)
#ifdef CONFIG_PM
int
kszphy_suspend
(
struct
phy_device
*
phydev
)
{
int
ret
=
genphy_suspend
(
phydev
)
;
int
value
;
/* TODO: disable the PHY oscillator */
return
ret
;
mutex_lock
(
&
phydev
->
lock
);
/* enable power down mode */
value
=
phy_read
(
phydev
,
MII_BMCR
);
phy_write
(
phydev
,
MII_BMCR
,
(
value
|
BMCR_PDOWN
));
/* enable slow oscillator mode */
value
=
phy_read
(
phydev
,
0x11
);
phy_write
(
phydev
,
0x11
,
(
value
|
1
<<
5
));
mutex_unlock
(
&
phydev
->
lock
);
return
0
;
}
int
kszphy_resume
(
struct
phy_device
*
phydev
)
{
/*TODO: enable the PHY oscillator */
return
genphy_resume
(
phydev
);
int
value
;
mutex_lock
(
&
phydev
->
lock
);
/* disable slow oscillator mode */
value
=
phy_read
(
phydev
,
0x11
);
phy_write
(
phydev
,
0x11
,
(
value
&
~
(
1
<<
5
)));
/* disable power down mode */
value
=
phy_read
(
phydev
,
MII_BMCR
);
phy_write
(
phydev
,
MII_BMCR
,
(
value
&
~
BMCR_PDOWN
));
/* reset the PHY */
value
=
phy_read
(
phydev
,
MII_BMCR
);
phy_write
(
phydev
,
MII_BMCR
,
(
value
|
BMCR_RESET
));
/* turn 50Mhz mode back on */
value
=
phy_read
(
phydev
,
MII_KSZPHY_CTRL
);
value
|=
KSZ8051_RMII_50MHZ_CLK
;
phy_write
(
phydev
,
MII_KSZPHY_CTRL
,
value
);
mutex_unlock
(
&
phydev
->
lock
);
return
0
;
}
#endif
...
...
@@ -292,8 +325,10 @@ static struct phy_driver ksphy_driver[] = {
.
read_status
=
genphy_read_status
,
.
ack_interrupt
=
kszphy_ack_interrupt
,
.
config_intr
=
kszphy_config_intr
,
.
suspend
=
genphy_suspend
,
.
resume
=
genphy_resume
,
#ifdef CONFIG_PM
.
suspend
=
kszphy_suspend
,
.
resume
=
kszphy_resume
,
#endif
.
driver
=
{
.
owner
=
THIS_MODULE
,},
},
{
.
phy_id
=
PHY_ID_KSZ8061
,
...
...
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