From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Tsz Shan Chan <tsz.chan.dev@gmail.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
"Tsz Shan Chan" <tchan@jacques.com.au>
Subject: Re: [PATCH v3 5/5] iio: light: vcnl4000: add shared IRQ support
Date: Thu, 3 Sep 2026 11:07:43 +0300 [thread overview]
Message-ID: <apkqz3LJcfSy9Ak2@ashevche-desk.local> (raw)
In-Reply-To: <20260903-vcnl4000-v3-5-5e69c2e715a8@jacques.com.au>
On Thu, Sep 03, 2026 at 02:53:50PM +1000, Tsz Shan Chan wrote:
> Change the interrupt trigger to IRQF_TRIGGER_LOW and add IRQF_SHARED to
> allow the sensor to share an interrupt line.
>
> Return IRQ_NONE from the irq handler when read fails or when none of the
> interrupt source bits handled by the driver are set. This prevents
> claiming interrupts from other devices on a shared line.
>
> The datasheets confirm that the INT pin is open drain active low, and
> the interrupts are latched:
> - vcnl4010/4020: The INT pin is open drain. It is pulled low
> while a status bit is 1, and it stays low until the driver writes
> a 1 to clear it.
> - vcnl4040/4200: The INT pin is pulled low when a flag triggers. It
> resets to high only after the driver reads the INT_Flag register.
...
> ret = devm_request_threaded_irq(dev, client->irq, NULL,
> data->chip_spec->irq_thread,
> - IRQF_TRIGGER_FALLING |
> - IRQF_ONESHOT,
> + IRQF_TRIGGER_LOW |
> + IRQF_ONESHOT | IRQF_SHARED,
> "vcnl4000_irq",
> indio_dev);
This will require to have other drivers be in the same settings to share this
interrupt line. Which means that the cases when we have active-high setting
in one device in DT and 'fake' one in another (assuming a NOT gate is added
on the PCB), this won't work. In another driver this was split to issue a warning
and use default trigger if and only if it's not provided by the firmware.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-09-03 8:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 4:53 [PATCH v3 0/5] iio: light: vcnl4000: support shared IRQs Tsz Shan Chan
2026-09-03 4:53 ` [PATCH v3 1/5] iio: light: vcnl4000: use correct channel array size Tsz Shan Chan
2026-09-03 7:55 ` Andy Shevchenko
2026-09-03 4:53 ` [PATCH v3 2/5] iio: light: vcnl4000: clear DRDY interrupt when buffer disabled Tsz Shan Chan
2026-09-03 7:55 ` Andy Shevchenko
2026-09-03 4:53 ` [PATCH v3 3/5] iio: light: vcnl4000: refactor interrupt config functions Tsz Shan Chan
2026-09-03 4:53 ` [PATCH v3 4/5] iio: light: vcnl4000: Add IRQ disable callback on cleanup Tsz Shan Chan
2026-09-03 8:03 ` Andy Shevchenko
2026-09-03 4:53 ` [PATCH v3 5/5] iio: light: vcnl4000: add shared IRQ support Tsz Shan Chan
2026-09-03 8:07 ` Andy Shevchenko [this message]
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=apkqz3LJcfSy9Ak2@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=tchan@jacques.com.au \
--cc=tsz.chan.dev@gmail.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
all inboxes | Powered by JetHome®