From: Hanna Hawa <hhhawa@amazon.com>
To: <jarkko.nikula@linux.intel.com>,
<andriy.shevchenko@linux.intel.com>,
<mika.westerberg@linux.intel.com>, <jsd@semihalf.com>
Cc: <linux-i2c@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<dwmw@amazon.co.uk>, <benh@amazon.com>, <ronenk@amazon.com>,
<talel@amazon.com>, <jonnyc@amazon.com>, <hanochu@amazon.com>,
<farbere@amazon.com>, <itamark@amazon.com>,
Hanna Hawa <hhhawa@amazon.com>
Subject: [PATCH v2 1/1] i2c: designware: set pinctrl recovery information from device pinctrl
Date: Wed, 14 Dec 2022 14:27:25 +0000 [thread overview]
Message-ID: <20221214142725.23881-1-hhhawa@amazon.com> (raw)
The current implementation of designware recovery mechanism fit for
specific device (Intel / Altera Cyclone V SOC) which have two separated
"wired" GPIOs to the i2c bus via the SOC FPGA for the i2c recovery.
Make pinctrl recovery information to points to the device pinctrl by
setting the rinfo->pinctrl to dev->pins->p.
Change Log v1->v2:
- set the rinfo->pinctrl to dev->pins->p instead calling
devm_pinctrl_get().
Signed-off-by: Hanna Hawa <hhhawa@amazon.com>
---
drivers/i2c/busses/i2c-designware-master.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c
index dc3c5a15a95b..16a4cd68567c 100644
--- a/drivers/i2c/busses/i2c-designware-master.c
+++ b/drivers/i2c/busses/i2c-designware-master.c
@@ -17,6 +17,7 @@
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
+#include <linux/pinctrl/devinfo.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/reset.h>
@@ -832,6 +833,9 @@ static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev)
struct i2c_adapter *adap = &dev->adapter;
struct gpio_desc *gpio;
+ if (dev->dev->pins && dev->dev->pins->p)
+ rinfo->pinctrl = dev->dev->pins->p;
+
gpio = devm_gpiod_get_optional(dev->dev, "scl", GPIOD_OUT_HIGH);
if (IS_ERR_OR_NULL(gpio))
return PTR_ERR_OR_ZERO(gpio);
--
2.38.1
next reply other threads:[~2022-12-14 14:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-14 14:27 Hanna Hawa [this message]
2022-12-14 16:09 ` [PATCH v2 1/1] i2c: designware: set pinctrl recovery information from device pinctrl Andy Shevchenko
2022-12-15 8:15 ` Hawa, Hanna
2022-12-15 10:27 ` Andy Shevchenko
2022-12-15 14:06 ` Linus Walleij
2022-12-15 14:25 ` Hawa, Hanna
2022-12-15 15:22 ` Andy Shevchenko
2022-12-16 13:50 ` Hawa, Hanna
2022-12-16 14:46 ` Andy Shevchenko
2022-12-19 19:35 ` Hawa, Hanna
2022-12-20 10:54 ` Andy Shevchenko
2022-12-14 19:14 ` kernel test robot
2022-12-15 0:17 ` kernel test robot
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=20221214142725.23881-1-hhhawa@amazon.com \
--to=hhhawa@amazon.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=benh@amazon.com \
--cc=dwmw@amazon.co.uk \
--cc=farbere@amazon.com \
--cc=hanochu@amazon.com \
--cc=itamark@amazon.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=jonnyc@amazon.com \
--cc=jsd@semihalf.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=ronenk@amazon.com \
--cc=talel@amazon.com \
/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