public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Alex Ivy <whu2gh@gmail.com>
Cc: jarkko.nikula@linux.intel.com, mika.westerberg@linux.intel.com,
	wsa@kernel.org, jsd@semihalf.com, p.zabel@pengutronix.de,
	linux-i2c@vger.kernel.org
Subject: Re: [QUESTION] i2c: designware: Why use GPIOD_OUT_HIGH instead of OPEN_DRAIN for recovery?
Date: Mon, 12 Jan 2026 18:57:30 +0200	[thread overview]
Message-ID: <aWUn-m56_SUw9nei@smile.fi.intel.com> (raw)
In-Reply-To: <CAN8T_P09Qe4091eq+YXnqzCtSxLQgxcw=jH2bH7uw20N4_DsbQ@mail.gmail.com>

On Mon, Jan 12, 2026 at 10:10:02PM +0800, Alex Ivy wrote:

> I am currently looking at the bus recovery implementation in
> drivers/i2c/busses/i2c-designware-master.c. I noticed that
> i2c_dw_init_recovery_info() seems to manually reimplement much of the logic
> already present in the I2C core's i2c_gpio_init_generic_recovery().
> 
> However, there are two key differences that caught my attention:
> 
> GPIO Flags: The I2C core uses GPIOD_OUT_HIGH_OPEN_DRAIN, while
> i2c-designware uses GPIOD_OUT_HIGH. Is this specifically intended to
> support SoC GPIO controllers that do not implement the OPEN_DRAIN flag,
> which would otherwise cause devm_gpiod_get() to fail in the core's generic
> helper?
> 
> Initialization Flow: The core's helper performs a pinctrl state toggle
> (GPIO -> Default) during initialization, whereas i2c-designware only looks
> up the states and defers the actual switching to prepare_recovery.

This might affect the workflow. Note, in the past one of such conversion was
presumably done without real testing and brought a regression (I'm talking
about PXA version).

> My question is: Would it be possible (or welcomed) to refactor this to use
> the core's generic helper, or is the current manual initialization required
> to maintain compatibility with specific DesignWare-integrated SoCs (like
> certain Intel or ARM platforms) that have restrictive GPIO/Pinctrl
> requirements?
> 
> I would appreciate your insights on the historical background of these
> choices.

Do you have an access to real HW?

-- 
With Best Regards,
Andy Shevchenko



       reply	other threads:[~2026-01-12 16:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAN8T_P09Qe4091eq+YXnqzCtSxLQgxcw=jH2bH7uw20N4_DsbQ@mail.gmail.com>
2026-01-12 16:57 ` Andy Shevchenko [this message]
2026-01-13  6:57   ` [QUESTION] i2c: designware: Why use GPIOD_OUT_HIGH instead of OPEN_DRAIN for recovery? Alex Ivy
2026-01-13  7:34     ` Alex Ivy

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=aWUn-m56_SUw9nei@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=jsd@semihalf.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=p.zabel@pengutronix.de \
    --cc=whu2gh@gmail.com \
    --cc=wsa@kernel.org \
    /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