From: Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Linus Walleij
<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Timur Tabi <timur-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Bjorn Andersson
<bjorn.andersson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Grant Likely
<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 2/3] gpiolib-of: Support 'reserved-gpio-ranges' property
Date: Fri, 26 Jan 2018 11:35:45 +0200 [thread overview]
Message-ID: <1516959345.7000.1281.camel@linux.intel.com> (raw)
In-Reply-To: <20180126011400.2191-3-sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
On Thu, 2018-01-25 at 17:13 -0800, Stephen Boyd wrote:
> Some qcom platforms make some GPIOs or pins unavailable for use
> by non-secure operating systems, and thus reading or writing the
> registers for those pins will cause access control issues. Add
> support for a DT property to describe the set of GPIOs that are
> available for use so that higher level OSes are able to know what
> pins to avoid reading/writing.
>
> For now, we plumb this into the gpiochip irq APIs so that
> GPIO/pinctrl drivers can use the gpiochip_irqchip_irq_valid() to
> test validity of GPIOs.
> +static void of_gpiochip_init_irq_valid_mask(struct gpio_chip *chip)
> +{
> + int len, i;
> + u32 start, count;
> + struct device_node *np = chip->of_node;
Perhaps reversed tree style? (In the following function as well)
> + len = of_property_count_u32_elems(np, "reserved-gpio-
> ranges");
>
> + for (i = 0; i < len; i += 2) {
> + of_property_read_u32_index(np, "reserved-gpio-
> ranges",
> + i, &start);
> + of_property_read_u32_index(np, "reserved-gpio-
> ranges",
> + i + 1, &count);
of_find_property() + of_prop_next_u32() ?
> + if (size > 0 && size % 2 == 0)
> + gpiochip->irq.need_valid_mask = true;
ffs(size) >= 2 ?
--
Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Intel Finland Oy
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: andriy.shevchenko@linux.intel.com (Andy Shevchenko)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/3] gpiolib-of: Support 'reserved-gpio-ranges' property
Date: Fri, 26 Jan 2018 11:35:45 +0200 [thread overview]
Message-ID: <1516959345.7000.1281.camel@linux.intel.com> (raw)
In-Reply-To: <20180126011400.2191-3-sboyd@codeaurora.org>
On Thu, 2018-01-25 at 17:13 -0800, Stephen Boyd wrote:
> Some qcom platforms make some GPIOs or pins unavailable for use
> by non-secure operating systems, and thus reading or writing the
> registers for those pins will cause access control issues. Add
> support for a DT property to describe the set of GPIOs that are
> available for use so that higher level OSes are able to know what
> pins to avoid reading/writing.
>
> For now, we plumb this into the gpiochip irq APIs so that
> GPIO/pinctrl drivers can use the gpiochip_irqchip_irq_valid() to
> test validity of GPIOs.
> +static void of_gpiochip_init_irq_valid_mask(struct gpio_chip *chip)
> +{
> + int len, i;
> + u32 start, count;
> + struct device_node *np = chip->of_node;
Perhaps reversed tree style? (In the following function as well)
> + len = of_property_count_u32_elems(np, "reserved-gpio-
> ranges");
>
> + for (i = 0; i < len; i += 2) {
> + of_property_read_u32_index(np, "reserved-gpio-
> ranges",
> + i, &start);
> + of_property_read_u32_index(np, "reserved-gpio-
> ranges",
> + i + 1, &count);
of_find_property() + of_prop_next_u32() ?
> + if (size > 0 && size % 2 == 0)
> + gpiochip->irq.need_valid_mask = true;
ffs(size) >= 2 ?
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
next prev parent reply other threads:[~2018-01-26 9:35 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-26 1:13 [PATCH v2 0/3] Support qcom pinctrl protected pins Stephen Boyd
2018-01-26 1:13 ` Stephen Boyd
2018-01-26 1:13 ` [PATCH v2 1/3] dt-bindings: pinctrl: Add a reserved-gpio-ranges property Stephen Boyd
2018-01-26 1:13 ` Stephen Boyd
[not found] ` <20180126011400.2191-2-sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-01-26 9:20 ` Andy Shevchenko
2018-01-26 9:20 ` Andy Shevchenko
2018-02-23 16:37 ` Bjorn Andersson
2018-02-23 16:37 ` Bjorn Andersson
2018-03-20 3:36 ` Linus Walleij
2018-03-20 3:36 ` Linus Walleij
2018-03-20 3:40 ` Timur Tabi
2018-03-20 3:40 ` Timur Tabi
2018-03-20 21:35 ` Stephen Boyd
2018-03-20 21:35 ` Stephen Boyd
[not found] ` <20180126011400.2191-1-sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-01-26 1:13 ` [PATCH v2 2/3] gpiolib-of: Support 'reserved-gpio-ranges' property Stephen Boyd
2018-01-26 1:13 ` Stephen Boyd
[not found] ` <20180126011400.2191-3-sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-01-26 9:35 ` Andy Shevchenko [this message]
2018-01-26 9:35 ` Andy Shevchenko
2018-02-07 13:34 ` Linus Walleij
2018-02-07 13:34 ` Linus Walleij
2018-03-01 21:49 ` Stephen Boyd
2018-03-01 21:49 ` Stephen Boyd
2018-01-26 1:14 ` [PATCH v2 3/3] pinctrl: qcom: Don't allow protected pins to be requested Stephen Boyd
2018-01-26 1:14 ` Stephen Boyd
2018-02-20 16:45 ` [PATCH v2 0/3] Support qcom pinctrl protected pins Timur Tabi
2018-02-20 16:45 ` Timur Tabi
2018-02-23 14:22 ` Linus Walleij
2018-02-23 14:22 ` Linus Walleij
2018-02-23 16:54 ` Bjorn Andersson
2018-02-23 16:54 ` Bjorn Andersson
2018-02-26 21:18 ` Timur Tabi
2018-02-26 21:18 ` Timur Tabi
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=1516959345.7000.1281.camel@linux.intel.com \
--to=andriy.shevchenko-vuqaysv1563yd54fqh9/ca@public.gmane.org \
--cc=bjorn.andersson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=timur-sgV2jX0FEOL9JmXXK+q4OQ@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.