Commit 7010f0f3 authored by Dmitry Eremin-Solenikov's avatar Dmitry Eremin-Solenikov Committed by Ben Hutchings

mfd: tc6393xb: Fail ohci suspend if full state restore is required

commit 1a5fb99d upstream.

Some boards with TC6393XB chip require full state restore during system
resume thanks to chip's VCC being cut off during suspend (Sharp SL-6000
tosa is one of them). Failing to do so would result in ohci Oops on
resume due to internal memory contentes being changed. Fail ohci suspend
on tc6393xb is full state restore is required.

Recommended workaround is to unbind tmio-ohci driver before suspend and
rebind it after resume.
Signed-off-by: default avatarDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent e9c1f59b
...@@ -263,6 +263,17 @@ static int tc6393xb_ohci_disable(struct platform_device *dev) ...@@ -263,6 +263,17 @@ static int tc6393xb_ohci_disable(struct platform_device *dev)
return 0; return 0;
} }
static int tc6393xb_ohci_suspend(struct platform_device *dev)
{
struct tc6393xb_platform_data *tcpd = dev_get_platdata(dev->dev.parent);
/* We can't properly store/restore OHCI state, so fail here */
if (tcpd->resume_restore)
return -EBUSY;
return tc6393xb_ohci_disable(dev);
}
static int tc6393xb_fb_enable(struct platform_device *dev) static int tc6393xb_fb_enable(struct platform_device *dev)
{ {
struct tc6393xb *tc6393xb = dev_get_drvdata(dev->dev.parent); struct tc6393xb *tc6393xb = dev_get_drvdata(dev->dev.parent);
...@@ -403,7 +414,7 @@ static struct mfd_cell __devinitdata tc6393xb_cells[] = { ...@@ -403,7 +414,7 @@ static struct mfd_cell __devinitdata tc6393xb_cells[] = {
.num_resources = ARRAY_SIZE(tc6393xb_ohci_resources), .num_resources = ARRAY_SIZE(tc6393xb_ohci_resources),
.resources = tc6393xb_ohci_resources, .resources = tc6393xb_ohci_resources,
.enable = tc6393xb_ohci_enable, .enable = tc6393xb_ohci_enable,
.suspend = tc6393xb_ohci_disable, .suspend = tc6393xb_ohci_suspend,
.resume = tc6393xb_ohci_enable, .resume = tc6393xb_ohci_enable,
.disable = tc6393xb_ohci_disable, .disable = tc6393xb_ohci_disable,
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment