mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-29 16:10:24 +09:00
dm: tegra: gpio: Convert to support livetree
Update the GPIO driver to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1 Tested-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
parent
e93812e81c
commit
56f5c40ad9
@ -337,11 +337,13 @@ static int gpio_tegra_bind(struct udevice *parent)
|
|||||||
* This driver does not make use of interrupts, other than to figure
|
* This driver does not make use of interrupts, other than to figure
|
||||||
* out the number of GPIO banks
|
* out the number of GPIO banks
|
||||||
*/
|
*/
|
||||||
if (!fdt_getprop(gd->fdt_blob, dev_of_offset(parent), "interrupts",
|
len = dev_read_size(parent, "interrupts");
|
||||||
&len))
|
if (len < 0)
|
||||||
return -EINVAL;
|
return len;
|
||||||
bank_count = len / 3 / sizeof(u32);
|
bank_count = len / 3 / sizeof(u32);
|
||||||
ctlr = (struct gpio_ctlr *)devfdt_get_addr(parent);
|
ctlr = (struct gpio_ctlr *)dev_read_addr(parent);
|
||||||
|
if ((ulong)ctlr == FDT_ADDR_T_NONE)
|
||||||
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
for (bank = 0; bank < bank_count; bank++) {
|
for (bank = 0; bank < bank_count; bank++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user