1. 13 Dec, 2020 1 commit
    • Simon Glass's avatar
      dm: treewide: Rename auto_alloc_size members to be shorter · 41575d8e
      Simon Glass authored
      
      
      This construct is quite long-winded. In earlier days it made some sense
      since auto-allocation was a strange concept. But with driver model now
      used pretty universally, we can shorten this to 'auto'. This reduces
      verbosity and makes it easier to read.
      
      Coincidentally it also ensures that every declaration is on one line,
      thus making dtoc's job easier.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      41575d8e
  2. 25 Jul, 2020 1 commit
    • Masahiro Yamada's avatar
      treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr() · 8613c8d8
      Masahiro Yamada authored and Simon Glass's avatar Simon Glass committed
      
      
      Use the _ptr suffixed variant instead of casting. Also, convert it to
      dev_read_addr_ptr(), which is safe to CONFIG_OF_LIVE.
      
      One curious part is an error check like follows in
      drivers/watchdog/omap_wdt.c:
      
          priv->regs = (struct wd_timer *)devfdt_get_addr(dev);
          if (!priv->regs)
                  return -EINVAL;
      
      devfdt_get_addr() returns FDT_ADDR_T_NONE (i.e. -1) on error.
      So, this code does not catch any error in DT parsing.
      
      dev_read_addr_ptr() returns NULL on error, so this error check
      will work.
      
      I generated this commit by the following command:
      
       $ find . -name .git -prune -o -name '*.[ch]' -type f -print | \
         xargs sed -i -e 's/([^*)]*\*)devfdt_get_addr(/dev_read_addr_ptr(/'
      
      I manually fixed drivers/usb/host/ehci-mx6.c
      Signed-off-by: Masahiro Yamada's avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      8613c8d8
  3. 24 Jul, 2020 1 commit
  4. 20 Jul, 2020 1 commit
    • Masahiro Yamada's avatar
      treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr() · 3c12c62b
      Masahiro Yamada authored and Simon Glass's avatar Simon Glass committed
      
      
      Use the _ptr suffixed variant instead of casting. Also, convert it to
      dev_read_addr_ptr(), which is safe to CONFIG_OF_LIVE.
      
      One curious part is an error check like follows in
      drivers/watchdog/omap_wdt.c:
      
          priv->regs = (struct wd_timer *)devfdt_get_addr(dev);
          if (!priv->regs)
                  return -EINVAL;
      
      devfdt_get_addr() returns FDT_ADDR_T_NONE (i.e. -1) on error.
      So, this code does not catch any error in DT parsing.
      
      dev_read_addr_ptr() returns NULL on error, so this error check
      will work.
      
      I generated this commit by the following command:
      
       $ find . -name .git -prune -o -name '*.[ch]' -type f -print | \
         xargs sed -i -e 's/([^*)]*\*)devfdt_get_addr(/dev_read_addr_ptr(/'
      
      I manually fixed drivers/usb/host/ehci-mx6.c
      Signed-off-by: Masahiro Yamada's avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      3c12c62b
  5. 19 May, 2020 2 commits
  6. 07 May, 2018 1 commit
    • Tom Rini's avatar
      SPDX: Convert all of our single license tags to Linux Kernel style · 83d290c5
      Tom Rini authored
      
      
      When U-Boot started using SPDX tags we were among the early adopters and
      there weren't a lot of other examples to borrow from.  So we picked the
      area of the file that usually had a full license text and replaced it
      with an appropriate SPDX-License-Identifier: entry.  Since then, the
      Linux Kernel has adopted SPDX tags and they place it as the very first
      line in a file (except where shebangs are used, then it's second line)
      and with slightly different comment styles than us.
      
      In part due to community overlap, in part due to better tag visibility
      and in part for other minor reasons, switch over to that style.
      
      This commit changes all instances where we have a single declared
      license in the tag as both the before and after are identical in tag
      contents.  There's also a few places where I found we did not have a tag
      and have introduced one.
      Signed-off-by: Tom Rini's avatarTom Rini <trini@konsulko.com>
      83d290c5
  7. 27 Apr, 2018 1 commit
  8. 01 Jun, 2017 2 commits
    • Simon Glass's avatar
      cros_ec: Update the cros_ec keyboard driver to livetree · 8327d41b
      Simon Glass authored
      
      
      Update this driver and key_matrix to support a live device tree.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      8327d41b
    • Simon Glass's avatar
      dm: Rename dev_addr..() functions · a821c4af
      Simon Glass authored
      
      
      These support the flat device tree. We want to use the dev_read_..()
      prefix for functions that support both flat tree and live tree. So rename
      the existing functions to avoid confusion.
      
      In the end we will have:
      
         1. dev_read_addr...()    - works on devices, supports flat/live tree
         2. devfdt_get_addr...()  - current functions, flat tree only
         3. of_get_address() etc. - new functions, live tree only
      
      All drivers will be written to use 1. That function will in turn call
      either 2 or 3 depending on whether the flat or live tree is in use.
      
      Note this involves changing some dead code - the imx_lpi2c.c file.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      a821c4af
  9. 08 Feb, 2017 1 commit
    • Simon Glass's avatar
      dm: core: Replace of_offset with accessor · e160f7d4
      Simon Glass authored
      
      
      At present devices use a simple integer offset to record the device tree
      node associated with the device. In preparation for supporting a live
      device tree, which uses a node pointer instead, refactor existing code to
      access this field through an inline function.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      e160f7d4
  10. 16 Feb, 2016 1 commit
  11. 20 Nov, 2015 3 commits
  12. 05 Nov, 2015 1 commit
  13. 18 Aug, 2015 1 commit
  14. 25 Oct, 2014 1 commit
  15. 23 Jul, 2014 1 commit
    • Simon Glass's avatar
      stdio: Pass device pointer to stdio methods · 709ea543
      Simon Glass authored
      
      
      At present stdio device functions do not get any clue as to which stdio
      device is being acted on. Some implementations go to great lengths to work
      around this, such as defining a whole separate set of functions for each
      possible device.
      
      For driver model we need to associate a stdio_dev with a device. It doesn't
      seem possible to continue with this work-around approach.
      
      Instead, add a stdio_dev pointer to each of the stdio member functions.
      
      Note: The serial drivers have the same problem, but it is not strictly
      necessary to fix that to get driver model running. Also, if we convert
      serial over to driver model the problem will go away.
      
      Code size increases by 244 bytes for Thumb2 and 428 for PowerPC.
      
      22: stdio: Pass device pointer to stdio methods
             arm: (for 2/2 boards)  all +244.0  bss -4.0  text +248.0
         powerpc: (for 1/1 boards)  all +428.0  text +428.0
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Acked-by: Marek Vasut's avatarMarek Vasut <marex@denx.de>
      Reviewed-by: Marek Vasut's avatarMarek Vasut <marex@denx.de>
      709ea543
  16. 24 Jul, 2013 1 commit
  17. 19 Nov, 2012 1 commit
  18. 15 Oct, 2012 3 commits
  19. 15 May, 2012 1 commit
    • Rakesh Iyer's avatar
      tegra: Add tegra keyboard driver · 6642a681
      Rakesh Iyer authored
      
      
      Add support for internal matrix keyboard controller for Nvidia Tegra
      platforms. This driver uses the fdt decode function to obtain its key
      codes.
      
      Support for the Ctrl modifier is provided. The left and right ctrl keys are
      dealt with in the same way.
      
      This uses the new keyboard input library (drivers/input/input.c) to decode
      keys and handle most of the common input logic. The new key matrix library
      is also used to decode (row, column) key positions into key codes.
      
      The intent is to make this driver purely about dealing with the hardware.
      
      Key detection before the driver is loaded is supported. This key will be
      picked up when the keyboard driver is initialized.
      
      Modified by Bernie Thompson <bhthompson@chromium.org> and
      Simon Glass <sjg@chromium.org> for device tree, input layer, key matrix
      and various other things.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Signed-off-by: Tom Warren's avatarTom Warren <twarren@nvidia.com>
      6642a681