* [U-Boot] [PATCH] DM: omap_gpio: Reduce overhead when used with OF_PLATDATA
@ 2018-08-21 1:27 Adam Ford
2018-08-21 17:32 ` Simon Glass
2018-09-18 21:25 ` [U-Boot] " Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Adam Ford @ 2018-08-21 1:27 UTC (permalink / raw)
To: u-boot
Platforms with limited resources in SPL may enable OF_PLATDATA,
this limits some of the library functions and cannot extract data
from the device tree. This patch adds additional wrappers around
these functions to only allow them when OF_CONTROL is enabled and
OF_PLATDATA is not.
Signed-off-by: Adam Ford <aford173@gmail.com>
diff --git a/drivers/gpio/omap_gpio.c b/drivers/gpio/omap_gpio.c
index 651f6994e4..fcf25fc5a4 100644
--- a/drivers/gpio/omap_gpio.c
+++ b/drivers/gpio/omap_gpio.c
@@ -337,6 +337,7 @@ static int omap_gpio_bind(struct udevice *dev)
}
#endif
+#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
static const struct udevice_id omap_gpio_ids[] = {
{ .compatible = "ti,omap3-gpio" },
{ .compatible = "ti,omap4-gpio" },
@@ -344,7 +345,6 @@ static const struct udevice_id omap_gpio_ids[] = {
{ }
};
-#if CONFIG_IS_ENABLED(OF_CONTROL)
static int omap_gpio_ofdata_to_platdata(struct udevice *dev)
{
struct omap_gpio_platdata *plat = dev_get_platdata(dev);
@@ -363,14 +363,15 @@ U_BOOT_DRIVER(gpio_omap) = {
.name = "gpio_omap",
.id = UCLASS_GPIO,
#if CONFIG_IS_ENABLED(OF_CONTROL)
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
+ .of_match = omap_gpio_ids,
.ofdata_to_platdata = of_match_ptr(omap_gpio_ofdata_to_platdata),
- .bind = dm_scan_fdt_dev,
.platdata_auto_alloc_size = sizeof(struct omap_gpio_platdata),
+#endif
#else
.bind = omap_gpio_bind,
#endif
.ops = &gpio_omap_ops,
- .of_match = omap_gpio_ids,
.probe = omap_gpio_probe,
.priv_auto_alloc_size = sizeof(struct gpio_bank),
.flags = DM_FLAG_PRE_RELOC,
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] DM: omap_gpio: Reduce overhead when used with OF_PLATDATA
2018-08-21 1:27 [U-Boot] [PATCH] DM: omap_gpio: Reduce overhead when used with OF_PLATDATA Adam Ford
@ 2018-08-21 17:32 ` Simon Glass
2018-09-18 21:25 ` [U-Boot] " Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2018-08-21 17:32 UTC (permalink / raw)
To: u-boot
On 20 August 2018 at 19:27, Adam Ford <aford173@gmail.com> wrote:
> Platforms with limited resources in SPL may enable OF_PLATDATA,
> this limits some of the library functions and cannot extract data
> from the device tree. This patch adds additional wrappers around
> these functions to only allow them when OF_CONTROL is enabled and
> OF_PLATDATA is not.
>
> Signed-off-by: Adam Ford <aford173@gmail.com>
>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] DM: omap_gpio: Reduce overhead when used with OF_PLATDATA
2018-08-21 1:27 [U-Boot] [PATCH] DM: omap_gpio: Reduce overhead when used with OF_PLATDATA Adam Ford
2018-08-21 17:32 ` Simon Glass
@ 2018-09-18 21:25 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2018-09-18 21:25 UTC (permalink / raw)
To: u-boot
On Mon, Aug 20, 2018 at 08:27:48PM -0500, Adam Ford wrote:
> Platforms with limited resources in SPL may enable OF_PLATDATA,
> this limits some of the library functions and cannot extract data
> from the device tree. This patch adds additional wrappers around
> these functions to only allow them when OF_CONTROL is enabled and
> OF_PLATDATA is not.
>
> Signed-off-by: Adam Ford <aford173@gmail.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
>
> diff --git a/drivers/gpio/omap_gpio.c b/drivers/gpio/omap_gpio.c
> index 651f6994e4..fcf25fc5a4 100644
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180918/7e21bc43/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-09-18 21:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-21 1:27 [U-Boot] [PATCH] DM: omap_gpio: Reduce overhead when used with OF_PLATDATA Adam Ford
2018-08-21 17:32 ` Simon Glass
2018-09-18 21:25 ` [U-Boot] " Tom Rini
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).