Hi Geert,

> Please try without that step, or do "echo none > /sys/power/pm_test".

Did this now with a q'n'd hacked gpio driver (see below). Worked like a
charm. So, the sata_rcar patch under discussion here seems to be fine.
We only need the GPIO resume on specific boards. This is a seperate
task. D'accord?

Thanks,

   Wolfram

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 023a32cfac42..17ab27ca0187 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -914,6 +914,7 @@ static int pca953x_probe(struct i2c_client *client,
                        dev_warn(&client->dev, "setup failed, %d\n", ret);
        }
 
+       dev_set_drvdata(&client->dev, chip);
        i2c_set_clientdata(client, chip);
        return 0;
 
@@ -986,11 +987,27 @@ static const struct of_device_id pca953x_dt_ids[] = {
 
 MODULE_DEVICE_TABLE(of, pca953x_dt_ids);
 
+static int pca953x_resume(struct device *dev)
+{
+       struct pca953x_chip *chip = dev_get_drvdata(dev);
+
+       pca953x_write_regs(chip, chip->regs->output, chip->reg_output);
+
+       pca953x_write_regs(chip, chip->regs->direction,
+                               chip->reg_direction);
+       return 0;
+}
+
+static const struct dev_pm_ops pca953x_dev_pm_ops = {
+       .resume = pca953x_resume,
+};
+
 static struct i2c_driver pca953x_driver = {
        .driver = {
                .name   = "pca953x",
                .of_match_table = pca953x_dt_ids,
                .acpi_match_table = ACPI_PTR(pca953x_acpi_ids),
+               .pm     = &pca953x_dev_pm_ops,
        },
        .probe          = pca953x_probe,
        .remove         = pca953x_remove,

Attachment: signature.asc
Description: PGP signature

Reply via email to