1. 13 Nov, 2017 1 commit
  2. 09 Nov, 2017 2 commits
  3. 08 Nov, 2017 16 commits
  4. 03 Nov, 2017 1 commit
  5. 31 Oct, 2017 10 commits
  6. 30 Oct, 2017 1 commit
    • Linus Walleij's avatar
      gpio-mmio: Use the new .get_multiple() callback · 80057cb4
      Linus Walleij authored
      It is possible to read all lines of a generic MMIO GPIO chip
      with a single register read so support this if we are in
      native endianness.
      
      Add an especially quirky callback to read multiple lines for
      the variants that require you to read values from the
      output registers if and only if the line is set as output.
      We managed to do that with a maximum of two register reads,
      and just one read if the requested lines are all input or all
      output.
      
      Cc: Anton Vorontsov <anton@enomsg.org>
      Cc: Lukas Wunner <lukas@wunner.de>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      80057cb4
  7. 25 Oct, 2017 6 commits
    • Linus Walleij's avatar
      gpio: mmio: Make pin2mask() a private business · 24efd94b
      Linus Walleij authored
      The vtable call pin2mask() was introducing a vtable function call
      in every gpiochip callback for a generic MMIO GPIO chip. This was
      not exactly efficient. (Maybe link-time optimization could get rid of
      it, I don't know.)
      
      After removing all external calls into this API we can make it a
      boolean flag in the struct gpio_chip call and sink the function into
      the gpio-mmio driver yielding encapsulation and potential speedups.
      
      Cc: Anton Vorontsov <anton@enomsg.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      24efd94b
    • Linus Walleij's avatar
      gpio: mpc8xxx: Do not reverse bits using bgpio · b3222f71
      Linus Walleij authored
      The MPC8xxx driver is always instantiating its generic GPIO functions
      with the flag BGPIOF_BIG_ENDIAN. This means "big-endian bit order"
      and means the bits representing the GPIO lines in the registers are
      reversed around 31 bits so line 0 is at bit 31 and so forth down to
      line 31 in bit 0.
      
      Instead of looping into the generic MMIO gpio to do the simple
      calculation of a bitmask, through a vtable call with two parameters
      likely using stack frames etc (unless the compiler optimize it)
      and obscuring the view for the programmer, let's just open-code
      what the call does. This likely executes faster, saves space and
      makes the code easier to read.
      
      Cc: Liu Gang <Gang.Liu@nxp.com>
      Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      b3222f71
    • Linus Walleij's avatar
      gpio: brcmstb: Do not use gc->pin2mask() · d7442368
      Linus Walleij authored
      The pin2mask() accessor only shuffles BIT ORDER in big endian systems,
      i.e. the bitstuffing is swizzled big endian so "bit 0" is bit 7 or
      bit 15 or bit 31 or so.
      
      The brcmstb only uses big endian BYTE ORDER which will be taken car of
      by the ->write_reg() callback.
      
      Just use BIT(offset) to assign the bit.
      Acked-by: default avatarGregory Fong <gregory.0xf0@gmail.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      d7442368
    • Linus Walleij's avatar
      gpio: grgpio: Do not use gc->pin2mask() · 5c7b0c4e
      Linus Walleij authored
      The pin2mask() accessor only shuffles BIT ORDER in big endian systems,
      i.e. the bitstuffing is swizzled big endian so "bit 0" is bit 7 or
      bit 15 or bit 31 or so.
      
      The grgpio only uses big endian BYTE ORDER which will be taken car of
      by the ->write_reg() callback.
      
      Just use BIT(offset) to assign the bit.
      Acked-by: default avatarAndreas Larsson <andreas@gaisler.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      5c7b0c4e
    • Linus Walleij's avatar
      gpio: loongson1: fix bgpio usage · fe29416b
      Linus Walleij authored
      When no flags are given, the native endianness is used to access
      the MMIO registers, and the pin2mask() call can simply be
      converted to a BIT() call, as per the default pin2mask()
      implementation in gpio-mmio.c.
      
      Cc: Kelvin Cheung <keguang.zhang@gmail.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      fe29416b
    • Linus Walleij's avatar
      gpio: dwapb: fix bgpio usage · d97a1b56
      Linus Walleij authored
      The DW APB GPIO driver uses the generic GPIO library gpio-mmio,
      and initialize the flags as "false", which should be 0.
      
      When no flags are given, the native endianness is used to access
      the MMIO registers, and the pin2mask() call can simply be
      converted to a BIT() call, as per the default pin2mask()
      implementation in gpio-mmio.c.
      Acked-by: default avatarAlan Tull <atull@kernel.org>
      Acked-by: default avatarHoan Tran <hotran@apm.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      d97a1b56
  8. 23 Oct, 2017 2 commits
  9. 20 Oct, 2017 1 commit
    • Andrew Jeffery's avatar
      gpio: Fix loose spelling · 2cbfca66
      Andrew Jeffery authored
      Literally.
      
      I expect "lose" was meant here, rather than "loose", though you could feasibly
      use a somewhat uncommon definition of "loose" to mean what would be meant by
      "lose": "Loose the hounds" for instance, as in "Release the hounds".
      Substituting in "value" for "hounds" gives "release the value", and makes some
      sense, but futher substituting back to loose gives "loose the value" which
      overall just seems a bit anachronistic.
      
      Instead, use modern, pragmatic English and save a character.
      
      Cc: Russell Currey <ruscur@russell.cc>
      Signed-off-by: default avatarAndrew Jeffery <andrew@aj.id.au>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      2cbfca66