From: Jacek Anaszewski <j.anaszewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
To: linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org
Subject: Re: [PATCH 4/4] iio: lps331ap: Add support for DT
Date: Tue, 02 Jul 2013 17:28:47 +0200 [thread overview]
Message-ID: <51D2F1AF.2040809@samsung.com> (raw)
In-Reply-To: <51D2CE03.2070704-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
On 07/02/2013 02:56 PM, Lars-Peter Clausen wrote:
> On 07/02/2013 02:15 PM, Lukasz Czerwinski wrote:
>> From: Jacek Anaszewski<j.anaszewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>>
>> This patch adds DT support for the lps331ap barometer
>> sensor.
>>
>> Signed-off-by: Jacek Anaszewski<j.anaszewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>> Signed-off-by: Kyungmin Park<kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>> ---
>> .../bindings/iio/pressure/st_pressure.txt | 41 ++++++++++++++++++++
>> drivers/iio/pressure/st_pressure_i2c.c | 9 +++++
>> drivers/iio/pressure/st_pressure_spi.c | 9 +++++
>> 3 files changed, 59 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/iio/pressure/st_pressure.txt
>>
>> diff --git a/Documentation/devicetree/bindings/iio/pressure/st_pressure.txt b/Documentation/devicetree/bindings/iio/pressure/st_pressure.txt
>> new file mode 100644
>> index 0000000..73a4b7d
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/iio/pressure/st_pressure.txt
>> @@ -0,0 +1,41 @@
>> +* STMicroelectronics LPS331AP barometer sensor
>> +
>> +Required properties:
>> +
>> + - compatible : should be "lps331ap"
>
> Needs the vendor prefix.
>
>> + - reg : the I2C address of the barometer
>> +
>> +Optional properties:
>> +
>> + - drdy-int-pin : redirect DRDY on pin INT1 (1) or pin INT2 (2) (u8)
>> + - interrupt-parent : phandle to the interrupt map subnode
>> + - interrupts : interrupt mapping for LPS331AP interrupt sources:
>> + 2 sources: 0 - INT1, 1 - INT2
>> + - irq-map : irq sub-node defining interrupt map
>> + (all properties listed below are required):
>> + - #interrupt-cells : should be 1
>> + - #address-cells : should be 0
>> + - #size-cells : should be 0
>> + - interrupt-map : table of entries consisting of three child elements:
>> + - unit_interrupt_specifier - 0 : INT1, 1 : INT2
>> + - interrupt parent phandle
>> + - parent unit interrupt specifier consisiting of two elements:
>> + - index of the interrupt within the controller
>> + - flags : should be 0
>
> While this works I wonder why you choose such a complicated example for setting
> up the IRQ? Why not just reference the IRQ directly using the interrupts property?
Hi Lars,
I will try to clarify the reasons why the interrupt map was exploited:
1) The device exposes two interrupt pins: INT1 and INT2.
2) Both of them can be configured either to generate data ready
interrupts or event interrupts.
3) drdy-int-pin property conveys the information about the interrupt
pin routed to the CPU and allows the driver to configure
the device to generate data ready interrupts on the connected pin.
4) The lps331ap barometer sensor handles only data ready interrupts
but it depends on the st_sensors library which expects interrupt map
in the device tree node.
5) Because of the support for events added to the library in this
series it should be possible to pass two irq's to the driver. From
what I know it can't be accomplished with interrupts property if
the interrupts originate from different interrupt parents (which is
the case I deal with, where device int sources are routed to the
GPIOs in different banks).
6) I agree that map filled with only one element may confuse the reader
but it is required for the st_common library to successfully parse
the node.
If you know better solution please let me know.
Of course I agree with your remaining remarks.
Thanks,
Jacek
next prev parent reply other threads:[~2013-07-02 15:28 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-02 12:15 [PATCH 0/4]iio: STMicroelectronics DT and event support Lukasz Czerwinski
2013-07-02 12:15 ` Lukasz Czerwinski
2013-07-02 12:15 ` [PATCH 1/4] iio: st_sensors: Add DT bindings for st_accel and st_gyro Lukasz Czerwinski
2013-07-02 12:15 ` Lukasz Czerwinski
2013-07-02 12:15 ` [PATCH 2/4] iio: st_sensors: Add threshold events support Lukasz Czerwinski
2013-07-02 12:15 ` Lukasz Czerwinski
2013-08-04 14:55 ` Jonathan Cameron
2013-08-04 14:55 ` Jonathan Cameron
2013-09-17 9:51 ` Łukasz Czerwiński
2013-09-17 19:36 ` Jonathan Cameron
2013-07-02 12:15 ` [PATCH 3/4] iio: accel: Add event subsystem to st_accel driver Lukasz Czerwinski
2013-07-02 12:15 ` Lukasz Czerwinski
2013-08-04 16:02 ` Jonathan Cameron
2013-08-04 16:02 ` Jonathan Cameron
2013-07-02 12:15 ` [PATCH 4/4] iio: lps331ap: Add support for DT Lukasz Czerwinski
2013-07-02 12:15 ` Lukasz Czerwinski
2013-07-02 12:56 ` Lars-Peter Clausen
2013-07-02 12:56 ` Lars-Peter Clausen
[not found] ` <51D2CE03.2070704-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2013-07-02 15:28 ` Jacek Anaszewski [this message]
2013-07-16 13:22 ` Maxime Ripard
2013-07-16 13:22 ` Maxime Ripard
2013-07-19 13:43 ` Jacek Anaszewski
2013-08-29 15:25 ` [PATCH 0/4]iio: STMicroelectronics DT and event support Denis CIOCCA
2013-08-30 7:06 ` Lee Jones
2013-08-30 8:07 ` Lee Jones
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=51D2F1AF.2040809@samsung.com \
--to=j.anaszewski-sze3o3uu22jbdgjk7y7tuq@public.gmane.org \
--cc=devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org \
--cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.