1. 27 5月, 2018 1 次提交
  2. 07 3月, 2018 4 次提交
  3. 03 3月, 2018 1 次提交
  4. 24 2月, 2018 1 次提交
  5. 15 2月, 2018 1 次提交
    • L
      spi: spi-gpio: Rewrite to use GPIO descriptors · 9b00bc7b
      Linus Walleij 提交于
      This converts the bit-banged GPIO SPI driver to looking up and
      using GPIO descriptors to get a handle on GPIO lines for SCK,
      MOSI, MISO and all CS lines.
      
      All existing board files are converted in one go to keep it all
      consistent. With these conversions I rarely find any interrim
      steps that makes any sense.
      
      Device tree probing and GPIO handling should work like before
      also after this patch.
      
      For board files, we stop using controller data to pass the GPIO
      line for chip select, instead we pass this as a GPIO descriptor
      lookup like everything else.
      
      In some s3c24xx machines the names of the SPI devices were set to
      "spi-gpio" rather than "spi_gpio" which can never have worked, I
      fixed it working (I guess) as part of this patch set. Sometimes
      I wonder how this code got upstream in the first place, it
      obviously is not tested.
      
      mach-s3c64xx/mach-smartq.c has the same problem and additionally
      defines the *same* GPIO line for MOSI and MISO which is not going
      to be accepted by gpiolib. As the lines were number 1,2,2 I assumed
      it was a typo and use lines 1,2,3. A comment gives awat that line 0
      is chip select though no actual SPI device is provided for the LCD
      supposed to be on this bit-banged SPI bus. I left it intact instead
      of just deleting the bus though.
      
      Kill off board file code that try to initialize the SPI lines
      to the same values that they will later be set by the spi_gpio
      driver anyways. Given the huge number of weird things in these
      board files I do not think this code is very tested or put in
      with much afterthought anyways.
      
      In order to assert that we do not get performance regressions on
      this crucial bing-banged driver, a ran a script like this dumping the
      Ilitek ILI9322 regmap 10000 times (it has no caching obviously) on
      an otherwise idle system in two iterations before and after the
      patches:
      
       #!/bin/sh
       for run in `seq 10000`
       do
           cat /debug/regmap/spi0.0/registers > /dev/null
       done
      
      Before the patch:
      
      time test.sh
      real    3m 41.03s
      user    0m 29.41s
      sys     3m 7.22s
      
      time test.sh
      real    3m 44.24s
      user    0m 32.31s
      sys     3m 7.60s
      
      After the patch:
      
      time test.sh
      real    3m 41.32s
      user    0m 28.92s
      sys     3m 8.08s
      
      time test.sh
      real    3m 39.92s
      user    0m 30.20s
      sys     3m 5.56s
      
      So any performance differences seems to be in the error margin.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Acked-by: NOlof Johansson <olof@lixom.net>
      Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      9b00bc7b
  6. 22 1月, 2018 1 次提交
  7. 09 1月, 2018 1 次提交
  8. 21 12月, 2017 1 次提交
  9. 08 12月, 2017 1 次提交
    • L
      w1: w1-gpio: Convert to use GPIO descriptors · e0fc62a6
      Linus Walleij 提交于
      The w1 master driver includes a complete open drain emulation
      reimplementation among other things.
      
      This converts the driver and all board files using it to use
      GPIO descriptors associated with the device to look up the
      GPIO wire, as well ass the optional pull-up GPIO line.
      
      When probed from the device tree, the driver will just pick
      descriptors and use them right off. For the two board files
      in the kernel, we add descriptor lookups so we do not need
      to keep any old platform data handling around for the GPIO
      lines.
      
      As the platform data is also a state container for this driver,
      we augment it to contain the GPIO descriptors.
      
      w1_gpio_write_bit_dir() and w1_gpio_write_bit_val() are gone
      since this pair was a reimplementation of open drain emulation
      which is now handled by gpiolib.
      
      The special "linux,open-drain" flag is a bit of mishap here:
      it has the same semantic as the same flags in I2C: it means
      that something in the platform is setting up the line as
      open drain behind our back. We handle this the same way as
      in I2C.
      
      To drive the pull-up, we need to bypass open drain emulation
      in gpiolib for the line, and this is done by driving it high
      using gpiod_set_raw_value() which has been augmented to have
      the semantic of overriding the open drain emulation.
      
      We also augment the documentation to reflect the way to pass
      GPIO descriptors from the machine.
      Acked-by: NEvgeniy Polyakov <zbr@ioremap.net>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      e0fc62a6
  10. 29 11月, 2017 6 次提交
  11. 03 11月, 2017 1 次提交
    • K
      arm: pxa: Convert timers to use timer_setup() · 96d13082
      Kees Cook 提交于
      In preparation for unconditionally passing the struct timer_list pointer to
      all timer callbacks, switch to using the new timer_setup() and from_timer()
      to pass the timer pointer explicitly. Adds a static variable to hold the
      interrupt private data pointer.
      
      Cc: Daniel Mack <daniel@zonque.org>
      Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
      Cc: Robert Jarzmik <robert.jarzmik@free.fr>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: linux-arm-kernel@lists.infradead.org
      Signed-off-by: NKees Cook <keescook@chromium.org>
      96d13082
  12. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  13. 30 10月, 2017 3 次提交
    • L
      i2c: gpio: Augment all boardfiles to use open drain · 4d0ce62c
      Linus Walleij 提交于
      We now handle the open drain mode internally in the I2C GPIO
      driver, but we will get warnings from the gpiolib that we
      override the default mode of the line so it becomes open
      drain.
      
      We can fix all in-kernel users by simply passing the right
      flag along in the descriptor table, and we already touched
      all of these files in the series so let's just tidy it up.
      
      Cc: Steven Miao <realmz6@gmail.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Acked-by: NOlof Johansson <olof@lixom.net>
      Acked-by: NLee Jones <lee.jones@linaro.org>
      Acked-by: NRobert Jarzmik <robert.jarzmik@free.fr>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      Acked-by: NWu, Aaron <Aaron.Wu@analog.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Tested-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      4d0ce62c
    • L
      i2c: gpio: Convert to use descriptors · b2e63555
      Linus Walleij 提交于
      This converts the GPIO-based I2C-driver to using GPIO
      descriptors instead of the old global numberspace-based
      GPIO interface. We:
      
      - Convert the driver to unconditionally grab two GPIOs
        from the device by index 0 (SDA) and 1 (SCL) which
        will work fine with device tree and descriptor tables.
        The existing device trees will continue to work just
        like before, but without any roundtrip through the
        global numberspace.
      
      - Brutally convert all boardfiles still passing global
        GPIOs by registering descriptor tables associated with
        the devices instead so this driver does not need to keep
        supporting passing any GPIO numbers as platform data.
      
      There is no stepwise approach as elegant as this, I
      strongly prefer this big hammer over any antsteps for this
      conversion. This way the old GPIO numbers go away and
      NEVER COME BACK.
      
      Special conversion for the different boards utilizing
      I2C-GPIO:
      
      - EP93xx (arch/arm/mach-ep93xx): pretty straight forward as
        all boards were using the same two GPIO lines, just define
        these two in a lookup table for "i2c-gpio" and register
        these along with the device. None of them define any
        other platform data so just pass NULL as platform data.
        This platform selects GPIOLIB so all should be smooth.
        The pins appear on a gpiochip for bank "G" as pins 1 (SDA)
        and 0 (SCL).
      
      - IXP4 (arch/arm/mach-ixp4): descriptor tables have to
        be registered for each board separately. They all use
        "IXP4XX_GPIO_CHIP" so it is pretty straight forward.
        Most board define no other platform data than SCL/SDA
        so they can drop the #include of <linux/i2c-gpio.h> and
        assign NULL to platform data.
      
        The "goramo_mlr" (Goramo Multilink Router) board is a bit
        worrisome: it implements its own I2C bit-banging in the
        board file, and optionally registers an I2C serial port,
        but claims the same GPIO lines for itself in the board file.
        This is not going to work: there will be competition for the
        GPIO lines, so delete the optional extra I2C bus instead, no
        I2C devices are registered on it anyway, there are just hints
        that it may contain an EEPROM that may be accessed from
        userspace. This needs to be fixed up properly by the serial
        clock using I2C emulation so drop a note in the code.
      
      - KS8695 board acs5k (arch/arm/mach-ks8695/board-acs5.c)
        has some platform data in addition to the pins so it needs to
        be kept around sans GPIO lines. Its GPIO chip is named
        "KS8695" and the arch selects GPIOLIB.
      
      - PXA boards (arch/arm/mach-pxa/*) use some of the platform
        data so it needs to be preserved here. The viper board even
        registers two GPIO I2Cs. The gpiochip is named "gpio-pxa" and
        the arch selects GPIOLIB.
      
      - SA1100 Simpad (arch/arm/mach-sa1100/simpad.c) defines a GPIO
        I2C bus, and the arch selects GPIOLIB.
      
      - Blackfin boards (arch/blackfin/bf533 etc) for these I assume
        their I2C GPIOs refer to the local gpiochip defined in
        arch/blackfin/kernel/bfin_gpio.c names "BFIN-GPIO".
        The arch selects GPIOLIB. The boards get spiked with
        IF_ENABLED(I2C_GPIO) but that is a side effect of it
        being like that already (I would just have Kconfig select
        I2C_GPIO and get rid of them all.) I also delete any
        platform data set to 0 as it will get that value anyway
        from static declartions of platform data.
      
      - The MIPS selects GPIOLIB and the Alchemy machine is using
        two local GPIO chips, one of them has a GPIO I2C. We need
        to adjust the local offset from the global number space here.
        The ATH79 has a proper GPIO driver in drivers/gpio/gpio-ath79.c
        and AFAICT the chip is named "ath79-gpio" and the PB44
        PCF857x expander spawns from this on GPIO 1 and 0. The latter
        board only use the platform data to specify pins so it can be
        cut altogether after this.
      
      - The MFD Silicon Motion SM501 is a special case. It dynamically
        spawns an I2C bus off the MFD using sm501_create_subdev().
        We use an approach to dynamically create a machine descriptor
        table and attach this to the "SM501-LOW" or "SM501-HIGH"
        gpiochip. We use chip-local offsets to grab the right lines.
        We can get rid of two local static inline helpers as part
        of this refactoring.
      
      Cc: Steven Miao <realmz6@gmail.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Magnus Damm <magnus.damm@gmail.com>
      Cc: Ben Dooks <ben.dooks@codethink.co.uk>
      Cc: Heiko Schocher <hs@denx.de>
      Acked-by: NWu, Aaron <Aaron.Wu@analog.com>
      Acked-by: NOlof Johansson <olof@lixom.net>
      Acked-by: NLee Jones <lee.jones@linaro.org>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      Tested-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      b2e63555
    • L
      hwmon: (sht15) Root out platform data · 18673114
      Linus Walleij 提交于
      After finding out there are active users of this sensor I noticed:
      
      - It has a single PXA27x board file using the platform data
      - The platform data is only used to carry two GPIO pins, all other
        fields are unused
      - The driver does not use GPIO descriptors but the legacy GPIO
        API
      
      I saw we can swiftly fix this by:
      
      - Killing off the platform data entirely
      - Define a GPIO descriptor lookup table in the board file
      - Use the standard devm_gpiod_get() to grab the GPIO descriptors
        from either the device tree or the board file table.
      
      This compiles, but needs testing.
      
      Cc: arm@kernel.org
      Cc: Marco Franchi <marco.franchi@nxp.com>
      Cc: Davide Hug <d@videhug.ch>
      Cc: Jonathan Cameron <jic23@cam.ac.uk>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Tested-by: NMarco Franchi <marco.franchi@nxp.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      18673114
  14. 07 10月, 2017 1 次提交
  15. 14 8月, 2017 1 次提交
    • R
      ARM: align .data section · 1abd3502
      Russell King 提交于
      Robert Jarzmik reports that his PXA25x system fails to boot with 4.12,
      failing at __flush_whole_cache in arch/arm/mm/proc-xscale.S:215:
      
         0xc0019e20 <+0>:     ldr     r1, [pc, #788]
         0xc0019e24 <+4>:     ldr     r0, [r1]	<== here
      
      with r1 containing 0xc06f82cd, which is the address of "clean_addr".
      Examination of the System.map shows:
      
      c06f22c8 D user_pmd_table
      c06f22cc d __warned.19178
      c06f22cd d clean_addr
      
      indicating that a .data.unlikely section has appeared just before the
      .data section from proc-xscale.S.  According to objdump -h, it appears
      that our assembly files default their .data alignment to 2**0, which
      is bad news if the preceding .data section size is not power-of-2
      aligned at link time.
      
      Add the appropriate .align directives to all assembly files in arch/arm
      that are missing them where we require an appropriate alignment.
      Reported-by: NRobert Jarzmik <robert.jarzmik@free.fr>
      Tested-by: NRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      1abd3502
  16. 13 8月, 2017 1 次提交
  17. 28 7月, 2017 1 次提交
    • A
      ARM: pxa: select both FB and FB_W100 for eseries · 1d20d8a9
      Arnd Bergmann 提交于
      We get a link error trying to access the w100fb_gpio_read/write
      functions from the platform when the driver is a loadable module
      or not built-in, so the platform already uses 'select' to hard-enable
      the driver.
      
      However, that fails if the framebuffer subsystem is disabled
      altogether.
      
      I've considered various ways to fix this properly, but they
      all seem like too much work or too risky, so this simply
      adds another 'select' to force the subsystem on as well.
      
      Fixes: 82427de2 ("ARM: pxa: PXA_ESERIES depends on FB_W100.")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      1d20d8a9
  18. 27 7月, 2017 1 次提交
  19. 26 7月, 2017 1 次提交
  20. 14 6月, 2017 4 次提交
  21. 23 5月, 2017 2 次提交
  22. 19 4月, 2017 1 次提交
  23. 05 4月, 2017 2 次提交
  24. 04 4月, 2017 1 次提交
  25. 28 2月, 2017 1 次提交