linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Stephan Gerhold <stephan@gerhold.net>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh+dt@kernel.org>,
	linux-iio <linux-iio@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>, Hans de Goede <hdegoede@redhat.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
	<devicetree@vger.kernel.org>, Hans de Goede <hdegoede@redhat.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>," 
	<~postmarketos/upstreaming@lists.sr.ht>,
	Nikita Travkin <nikita@trvn.ru>
Subject: Re: [PATCH 3/4] iio: accel: bmc150: Make it possible to configure INT2 instead of INT1
Date: Mon, 19 Jul 2021 16:07:23 +0200	[thread overview]
Message-ID: <CACRpkdYNqi0EDrtC3j=cu5cp17sEJ6_nf2KRn-hxCxgbTGhgXw@mail.gmail.com> (raw)
In-Reply-To: <20210719112156.27087-4-stephan@gerhold.net>

On Mon, Jul 19, 2021 at 1:26 PM Stephan Gerhold <stephan@gerhold.net> wrote:

> Some Bosch accelerometers have two interrupt pins (INT1 and INT2).
> At the moment, the driver uses only the first one, which is fine for
> most situations. However, some boards might only have INT2 connected
> for some reason.
>
> Add the necessary bits and configuration to set up INT2. Then try
> to detect this situation at least for device tree setups by checking
> if the first interrupt (the one picked by the I2C/SPI core) is actually
> named "INT2" using the interrupt-names property.
>
> of_irq_get_byname() returns either 0 or some error code in case
> the driver probed without device tree, so in all other cases we fall
> back to configuring INT1 as before.
>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>

>  #include <linux/acpi.h>
> +#include <linux/of_irq.h>
(...)
> +       irq_info = bmc150_accel_interrupts_int1;
> +       if (irq == of_irq_get_byname(dev->of_node, "INT2"))
> +               irq_info = bmc150_accel_interrupts_int2;

This looks a bit DT-specific, but I don't see that ACPI has
named IRQs so I don't know what to do about it either.
What does platform_get_irq_byname() do on ACPI systems?

If there is no obvious fix I would leave it like this until the
first ACPI used needing this comes along, but I think maybe
Andy has suggestions.

Yours,
Linus Walleij

  reply	other threads:[~2021-07-19 14:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 11:21 [PATCH 0/4] iio: accel: bmc150: Add support for INT2 and BMC156 Stephan Gerhold
2021-07-19 11:21 ` [PATCH 1/4] dt-bindings: iio: accel: bma255: Add interrupt-names Stephan Gerhold
2021-07-19 13:57   ` Linus Walleij
2021-07-24 16:00   ` Jonathan Cameron
2021-07-19 11:21 ` [PATCH 2/4] dt-bindings: iio: accel: bma255: Add bosch,bmc156_accel Stephan Gerhold
2021-07-19 13:58   ` Linus Walleij
2021-07-24 16:03   ` Jonathan Cameron
2021-07-29 19:10     ` Rob Herring
2021-07-29 19:10   ` Rob Herring
2021-07-19 11:21 ` [PATCH 3/4] iio: accel: bmc150: Make it possible to configure INT2 instead of INT1 Stephan Gerhold
2021-07-19 14:07   ` Linus Walleij [this message]
2021-07-19 15:01     ` Andy Shevchenko
2021-07-19 15:10       ` Stephan Gerhold
2021-07-19 16:19         ` Andy Shevchenko
2021-07-19 17:26           ` Stephan Gerhold
2021-07-19 18:05             ` Andy Shevchenko
2021-07-19 18:36               ` Stephan Gerhold
2021-07-20 15:04                 ` Andy Shevchenko
2021-07-24 16:19                   ` Jonathan Cameron
2021-07-24 18:06               ` Jonathan Cameron
2021-07-19 11:21 ` [PATCH 4/4] iio: accel: bmc150: Add support for BMC156 Stephan Gerhold
2021-07-19 14:08   ` Linus Walleij
2021-07-24 16:12   ` Jonathan Cameron
2021-07-27 18:32     ` Stephan Gerhold
2021-07-31 18:04       ` Jonathan Cameron
2021-07-19 12:34 ` [PATCH 0/4] iio: accel: bmc150: Add support for INT2 and BMC156 Andy Shevchenko
2021-07-19 12:42   ` Stephan Gerhold

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='CACRpkdYNqi0EDrtC3j=cu5cp17sEJ6_nf2KRn-hxCxgbTGhgXw@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=nikita@trvn.ru \
    --cc=robh+dt@kernel.org \
    --cc=stephan@gerhold.net \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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).