From: Hans de Goede <hdegoede@redhat.com>
To: Jarkko Nikula <jarkko.nikula@linux.intel.com>,
Wolfram Sang <wsa@the-dreams.de>, Len Brown <lenb@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Takashi Iwai <tiwai@suse.de>,
linux-i2c@vger.kernel.org
Subject: [PATCH v3 2/2] i2c: designware: Disable pm for PMIC i2c-bus even if there is no _SEM method
Date: Mon, 13 Mar 2017 23:25:10 +0100 [thread overview]
Message-ID: <20170313222510.466-2-hdegoede@redhat.com> (raw)
In-Reply-To: <20170313222510.466-1-hdegoede@redhat.com>
Cherrytrail devices use the dw i2c-bus with uid 7 to access their PMIC.
Even if the i2c-bus to the PMIC is not shared with the SoC's P-Unit
and i2c-designware-baytrail.c thus does not set the pm_disabled flag,
we still need to disable pm so that ACPI PMIC opregions can access the
PMIC during late-suspend and early-resume.
This fixes errors like these blocking suspend:
i2c_designware 808622C1:06: timeout waiting for bus ready
ACPI Exception: AE_ERROR, Returned by Handler for [UserDefinedRegion]
acpi 80860F14:02: Failed to change power state to D3hot
PM: late suspend of devices failed
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
---
Changes in v2:
-Rebase on v4.11-rc1 to fix conflicts
Changes in v3:
-Rebase on v4.11-rc2 to fix yet more conflicts
---
drivers/i2c/busses/i2c-designware-platdrv.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 0b6f6dc..a597ba32 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -95,7 +95,10 @@ static void dw_i2c_acpi_params(struct platform_device *pdev, char method[],
static int dw_i2c_acpi_configure(struct platform_device *pdev)
{
struct dw_i2c_dev *dev = platform_get_drvdata(pdev);
+ acpi_handle handle = ACPI_HANDLE(&pdev->dev);
const struct acpi_device_id *id;
+ struct acpi_device *adev;
+ const char *uid;
dev->adapter.nr = -1;
dev->tx_fifo_depth = 32;
@@ -115,6 +118,18 @@ static int dw_i2c_acpi_configure(struct platform_device *pdev)
if (id && id->driver_data)
dev->flags |= (u32)id->driver_data;
+ if (acpi_bus_get_device(handle, &adev))
+ return -ENODEV;
+
+ /*
+ * Cherrytrail I2C7 gets used for the PMIC which gets accessed
+ * through ACPI opregions during late suspend / early resume
+ * disable pm for it.
+ */
+ uid = adev->pnp.unique_id;
+ if ((dev->flags & MODEL_CHERRYTRAIL) && !strcmp(uid, "7"))
+ dev->pm_disabled = true;
+
return 0;
}
--
2.9.3
next prev parent reply other threads:[~2017-03-13 22:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-13 22:25 [PATCH v3 1/2] i2c: designware: Never suspend i2c-busses used for accessing the system PMIC Hans de Goede
2017-03-13 22:25 ` Hans de Goede [this message]
2017-03-23 20:07 ` [PATCH v3 2/2] i2c: designware: Disable pm for PMIC i2c-bus even if there is no _SEM method Wolfram Sang
2017-03-23 20:07 ` [PATCH v3 1/2] i2c: designware: Never suspend i2c-busses used for accessing the system PMIC Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170313222510.466-2-hdegoede@redhat.com \
--to=hdegoede@redhat.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=lenb@kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=tiwai@suse.de \
--cc=wsa@the-dreams.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).