diff options
author | Christopher Kenna <cjk@cs.unc.edu> | 2012-09-28 13:46:28 -0400 |
---|---|---|
committer | Christopher Kenna <cjk@cs.unc.edu> | 2012-09-28 14:50:15 -0400 |
commit | daa22703f14c007e93b464c45fa60019a36f546d (patch) | |
tree | a1a130b6e128dc9d57c35c026977e1b4953105e1 /drivers/mmc/core/bus.c | |
parent | 5aa287dcf1b5879aa0150b0511833c52885f5b4c (diff) |
Apply k4412 kernel from HardKernel for ODROID-X.
Diffstat (limited to 'drivers/mmc/core/bus.c')
-rw-r--r-- | drivers/mmc/core/bus.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 393d817ed04..eb7a4c8086b 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c | |||
@@ -120,18 +120,19 @@ static int mmc_bus_remove(struct device *dev) | |||
120 | return 0; | 120 | return 0; |
121 | } | 121 | } |
122 | 122 | ||
123 | static int mmc_bus_suspend(struct device *dev, pm_message_t state) | 123 | static int mmc_bus_pm_suspend(struct device *dev) |
124 | { | 124 | { |
125 | struct mmc_driver *drv = to_mmc_driver(dev->driver); | 125 | struct mmc_driver *drv = to_mmc_driver(dev->driver); |
126 | struct mmc_card *card = mmc_dev_to_card(dev); | 126 | struct mmc_card *card = mmc_dev_to_card(dev); |
127 | int ret = 0; | 127 | int ret = 0; |
128 | pm_message_t state = { PM_EVENT_SUSPEND }; | ||
128 | 129 | ||
129 | if (dev->driver && drv->suspend) | 130 | if (dev->driver && drv->suspend) |
130 | ret = drv->suspend(card, state); | 131 | ret = drv->suspend(card, state); |
131 | return ret; | 132 | return ret; |
132 | } | 133 | } |
133 | 134 | ||
134 | static int mmc_bus_resume(struct device *dev) | 135 | static int mmc_bus_pm_resume(struct device *dev) |
135 | { | 136 | { |
136 | struct mmc_driver *drv = to_mmc_driver(dev->driver); | 137 | struct mmc_driver *drv = to_mmc_driver(dev->driver); |
137 | struct mmc_card *card = mmc_dev_to_card(dev); | 138 | struct mmc_card *card = mmc_dev_to_card(dev); |
@@ -143,7 +144,6 @@ static int mmc_bus_resume(struct device *dev) | |||
143 | } | 144 | } |
144 | 145 | ||
145 | #ifdef CONFIG_PM_RUNTIME | 146 | #ifdef CONFIG_PM_RUNTIME |
146 | |||
147 | static int mmc_runtime_suspend(struct device *dev) | 147 | static int mmc_runtime_suspend(struct device *dev) |
148 | { | 148 | { |
149 | struct mmc_card *card = mmc_dev_to_card(dev); | 149 | struct mmc_card *card = mmc_dev_to_card(dev); |
@@ -162,21 +162,13 @@ static int mmc_runtime_idle(struct device *dev) | |||
162 | { | 162 | { |
163 | return pm_runtime_suspend(dev); | 163 | return pm_runtime_suspend(dev); |
164 | } | 164 | } |
165 | #endif /* CONFIG_PM_RUNTIME */ | ||
165 | 166 | ||
166 | static const struct dev_pm_ops mmc_bus_pm_ops = { | 167 | static const struct dev_pm_ops mmc_bus_pm_ops = { |
167 | .runtime_suspend = mmc_runtime_suspend, | 168 | SET_SYSTEM_SLEEP_PM_OPS(mmc_bus_pm_suspend, mmc_bus_pm_resume) |
168 | .runtime_resume = mmc_runtime_resume, | 169 | SET_RUNTIME_PM_OPS(mmc_runtime_suspend, mmc_runtime_resume, mmc_runtime_idle) |
169 | .runtime_idle = mmc_runtime_idle, | ||
170 | }; | 170 | }; |
171 | 171 | ||
172 | #define MMC_PM_OPS_PTR (&mmc_bus_pm_ops) | ||
173 | |||
174 | #else /* !CONFIG_PM_RUNTIME */ | ||
175 | |||
176 | #define MMC_PM_OPS_PTR NULL | ||
177 | |||
178 | #endif /* !CONFIG_PM_RUNTIME */ | ||
179 | |||
180 | static struct bus_type mmc_bus_type = { | 172 | static struct bus_type mmc_bus_type = { |
181 | .name = "mmc", | 173 | .name = "mmc", |
182 | .dev_attrs = mmc_dev_attrs, | 174 | .dev_attrs = mmc_dev_attrs, |
@@ -184,9 +176,7 @@ static struct bus_type mmc_bus_type = { | |||
184 | .uevent = mmc_bus_uevent, | 176 | .uevent = mmc_bus_uevent, |
185 | .probe = mmc_bus_probe, | 177 | .probe = mmc_bus_probe, |
186 | .remove = mmc_bus_remove, | 178 | .remove = mmc_bus_remove, |
187 | .suspend = mmc_bus_suspend, | 179 | .pm = &mmc_bus_pm_ops, |
188 | .resume = mmc_bus_resume, | ||
189 | .pm = MMC_PM_OPS_PTR, | ||
190 | }; | 180 | }; |
191 | 181 | ||
192 | int mmc_register_bus(void) | 182 | int mmc_register_bus(void) |
@@ -301,10 +291,11 @@ int mmc_add_card(struct mmc_card *card) | |||
301 | mmc_card_ddr_mode(card) ? "DDR " : "", | 291 | mmc_card_ddr_mode(card) ? "DDR " : "", |
302 | type); | 292 | type); |
303 | } else { | 293 | } else { |
304 | printk(KERN_INFO "%s: new %s%s%s card at address %04x\n", | 294 | pr_info("%s: new %s%s%s%s card at address %04x\n", |
305 | mmc_hostname(card->host), | 295 | mmc_hostname(card->host), |
306 | mmc_sd_card_uhs(card) ? "ultra high speed " : | 296 | mmc_card_uhs(card) ? "ultra high speed " : |
307 | (mmc_card_highspeed(card) ? "high speed " : ""), | 297 | (mmc_card_highspeed(card) ? "high speed " : ""), |
298 | (mmc_card_hs200(card) ? "HS200 " : ""), | ||
308 | mmc_card_ddr_mode(card) ? "DDR " : "", | 299 | mmc_card_ddr_mode(card) ? "DDR " : "", |
309 | type, card->rca); | 300 | type, card->rca); |
310 | } | 301 | } |