From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: linux-i2c@vger.kernel.org, Andi Shyti <andi.shyti@kernel.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Jan Dabros <jsd@semihalf.com>,
Jiawen Wu <jiawenwu@trustnetic.com>,
Sanket Goswami <Sanket.Goswami@amd.com>,
Basavaraj Natikar <Basavaraj.Natikar@amd.com>,
Ruhl@smile.fi.intel.com, Michael J <michael.j.ruhl@intel.com>
Subject: Re: [PATCH 1/6] i2c: designware: Uniform initialization flow for polling mode
Date: Thu, 1 Feb 2024 13:57:11 +0200 [thread overview]
Message-ID: <ZbuHF31mMv_KN2J4@smile.fi.intel.com> (raw)
In-Reply-To: <20240131141653.2689260-2-jarkko.nikula@linux.intel.com>
On Wed, Jan 31, 2024 at 04:16:47PM +0200, Jarkko Nikula wrote:
> Currently initialization flow in i2c_dw_probe_master() skips a few steps
> and has code duplication for polling mode implementation.
>
> Simplify this by adding a new ACCESS_POLLING flag that is set for those
> two platforms that currently use polling mode and use it to skip
> interrupt handler setup.
...
> #define ACCESS_INTR_MASK BIT(0)
> #define ACCESS_NO_IRQ_SUSPEND BIT(1)
> #define ARBITRATION_SEMAPHORE BIT(2)
> +#define ACCESS_POLLING BIT(3)
For the sake of consistency, you may incorporate internal patch from somebody
else to move to the same prefix (namespace) for ARBITRATION_SEMAPHORE.
...
> + if (!(dev->flags & ACCESS_POLLING)) {
Actually seems to me that is better to have in a separate helper and you
then can do here something like
ret = i2c_dw_request_irq(...);
if (ret)
return ret;
> + ret = devm_request_irq(dev->dev, dev->irq, i2c_dw_isr,
> + irq_flags, dev_name(dev->dev), dev);
> + if (ret) {
> + dev_err(dev->dev, "failure requesting irq %i: %d\n",
> + dev->irq, ret);
> + return ret;
> + }
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2024-02-01 11:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 14:16 [PATCH 0/6] i2c: designware: Generic polling mode code Jarkko Nikula
2024-01-31 14:16 ` [PATCH 1/6] i2c: designware: Uniform initialization flow for polling mode Jarkko Nikula
2024-02-01 11:57 ` Andy Shevchenko [this message]
2024-02-05 0:03 ` Andi Shyti
2024-01-31 14:16 ` [PATCH 2/6] i2c: designware: Do not enable interrupts shortly in " Jarkko Nikula
2024-01-31 14:16 ` [PATCH 3/6] i2c: designware: Use accessors to DW_IC_INTR_MASK register Jarkko Nikula
2024-01-31 14:16 ` [PATCH 4/6] i2c: designware: Move interrupt handling functions before i2c_dw_xfer() Jarkko Nikula
2024-01-31 14:16 ` [PATCH 5/6] i2c: designware: Fix RX FIFO depth define on Wangxun 10Gb NIC Jarkko Nikula
2024-02-01 11:59 ` Andy Shevchenko
2024-02-01 13:19 ` Jarkko Nikula
2024-01-31 14:16 ` [PATCH 5/5] i2c: designware: Implement generic polling mode code for " Jarkko Nikula
2024-02-01 12:06 ` Andy Shevchenko
2024-02-01 13:21 ` Jarkko Nikula
2024-01-31 14:16 ` [PATCH 6/6] " Jarkko Nikula
2024-02-01 12:08 ` [PATCH 0/6] i2c: designware: Generic polling mode code Andy Shevchenko
2024-02-01 13:18 ` Jarkko Nikula
2024-02-04 3:20 ` Jiawen Wu
2024-02-05 7:30 ` Jarkko Nikula
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=ZbuHF31mMv_KN2J4@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=Basavaraj.Natikar@amd.com \
--cc=Ruhl@smile.fi.intel.com \
--cc=Sanket.Goswami@amd.com \
--cc=andi.shyti@kernel.org \
--cc=jarkko.nikula@linux.intel.com \
--cc=jiawenwu@trustnetic.com \
--cc=jsd@semihalf.com \
--cc=linux-i2c@vger.kernel.org \
--cc=michael.j.ruhl@intel.com \
--cc=mika.westerberg@linux.intel.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