linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Jarkko Nikula <jarkko.nikula@linux.intel.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	linux-i2c@vger.kernel.org, Wolfram Sang <wsa@the-dreams.de>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 4/4] i2c: designware: Read counters from ACPI for PCI driver
Date: Thu,  7 May 2020 16:51:40 +0300	[thread overview]
Message-ID: <20200507135140.14635-4-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20200507135140.14635-1-andriy.shevchenko@linux.intel.com>

PCI devices may have been backed with ACPI handle which supplies
an additional information to the drivers, such as counters.

Call for ACPI configuration from PCI driver in order to utilize counters
provided by ACPI.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/i2c/busses/i2c-designware-pcidrv.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
index c762e5a11e44e..96191925f71ec 100644
--- a/drivers/i2c/busses/i2c-designware-pcidrv.c
+++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
@@ -251,6 +251,15 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
 		}
 	}
 
+	if (has_acpi_companion(&pdev->dev))
+		i2c_dw_acpi_configure(&pdev->dev);
+
+	r = i2c_dw_validate_speed(dev);
+	if (r) {
+		pci_free_irq_vectors(pdev);
+		return r;
+	}
+
 	i2c_dw_configure(dev);
 
 	if (controller->scl_sda_cfg) {
-- 
2.26.2


  parent reply	other threads:[~2020-05-07 13:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 13:51 [PATCH v1 1/4] i2c: designware: Split out i2c_dw_validate_speed() helper Andy Shevchenko
2020-05-07 13:51 ` [PATCH v1 2/4] i2c: designware: Split out OF parts into separate module Andy Shevchenko
2020-05-07 13:51 ` [PATCH v1 3/4] i2c: designware: Split out ACPI " Andy Shevchenko
2020-05-11 13:31   ` Jarkko Nikula
2020-05-11 14:05     ` Andy Shevchenko
2020-05-07 13:51 ` Andy Shevchenko [this message]
2020-05-11 13:11 ` [PATCH v1 1/4] i2c: designware: Split out i2c_dw_validate_speed() helper Jarkko Nikula
2020-05-11 13:42   ` Andy Shevchenko
2020-05-12 15:12     ` Jarkko Nikula
2020-05-19 12:33       ` Andy Shevchenko

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=20200507135140.14635-4-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --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).