17 Jul, 2017

1 commit


15 Dec, 2016

2 commits


24 Nov, 2016

1 commit

  • If the driver is built as a module, autoload won't work because the module
    alias information is not filled. So user-space can't match the registered
    device with the corresponding module.

    Export the module alias information using the MODULE_DEVICE_TABLE() macro.

    Before this patch:

    $ modinfo drivers/spi/spi-ath79.ko | grep alias
    alias: platform:ath79-spi

    After this patch:

    $ modinfo drivers/spi/spi-ath79.ko | grep alias
    alias: platform:ath79-spi
    alias: of:N*T*Cqca,ar7100-spiC*
    alias: of:N*T*Cqca,ar7100-spi

    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Mark Brown

    Javier Martinez Canillas
     

01 Oct, 2015

1 commit


27 Apr, 2015

3 commits


20 Oct, 2014

1 commit


15 Apr, 2014

1 commit


30 Mar, 2014

1 commit


03 Mar, 2014

1 commit

  • The 'ath79_spi_setup_cs' function initializes the chip
    select line of a given SPI device in order to make sure
    that the device is inactive.

    If the SPI_CS_HIGH bit is set for a given device, it
    means that the CS line of that device is active HIGH
    so it must be set to LOW initially. In case of GPIO
    CS lines, the 'ath79_spi_setup_cs' function does the
    opposite of that due to the wrong GPIO flags.

    Fix the code to use the correct GPIO flags.

    Reported-by: Ronald Wahl
    Signed-off-by: Gabor Juhos
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Gabor Juhos
     

03 Feb, 2014

1 commit


18 Dec, 2013

1 commit


17 Sep, 2013

1 commit

  • Many drivers that use bitbang library have a leak on probe error paths.
    This is because once a spi_master_get() call succeeds, we need an additional
    spi_master_put() call to free the memory.

    Fix this issue by moving the code taking a reference to master to
    spi_bitbang_start(), so spi_bitbang_start() will take a reference to master on
    success. With this change, the caller is responsible for calling
    spi_bitbang_stop() to decrement the reference and spi_master_put() as
    counterpart of spi_alloc_master() to prevent a memory leak.

    So now we have below patten for drivers using bitbang library:

    probe:
    spi_alloc_master -> Init reference count to 1
    spi_bitbang_start -> Increment reference count
    remove:
    spi_bitbang_stop -> Decrement reference count
    spi_master_put -> Decrement reference count (reference count reaches 0)

    Fixup all users accordingly.

    Signed-off-by: Axel Lin
    Suggested-by: Uwe Kleine-Koenig
    Acked-by: Uwe Kleine-Koenig
    Signed-off-by: Mark Brown

    Axel Lin
     

29 Aug, 2013

1 commit


26 Jun, 2013

1 commit


30 May, 2013

1 commit


13 May, 2013

1 commit

  • The driver core clears the driver data to NULL after device_release
    or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
    (device-core: Ensure drvdata = NULL when no driver is bound).
    Thus, it is not needed to manually clear the device driver data to NULL.

    Signed-off-by: Jingoo Han
    Acked-by: Grant Likely
    Signed-off-by: Mark Brown

    Jingoo Han
     

06 Feb, 2013

1 commit

  • The SPI controller of the AR7xxx/AR9xxx SoCs
    have a special mode which allows the SoC to
    directly read data from SPI flash chips. In
    this mode, the content of the SPI flash chip
    can be accessed via a memory mapped region.

    During early init time, the kernel expects
    that the flash chip is accessible through
    that memory region because it reads board
    specific values (e.g. MAC address, WiFi
    calibration data) from the flash on various
    boards.

    This is working if the kernel is loaded
    directly by the bootloader because that
    leaves the SPI controller in the special
    mode. However it is not working in a kexec'd
    kernel because the SPI driver does not restore
    the special mode during shutdown.

    The patch adds a shutdown handler to fix this
    issue.

    Signed-off-by: Gabor Juhos
    Signed-off-by: Grant Likely

    Gabor Juhos
     

05 Feb, 2013

5 commits

  • Currently we are initializing the SPI controller in
    the chip select line function, and that function is
    called once for each SPI device on the bus. If a
    board has multiple SPI devices, the controller will
    be initialized multiple times.

    Introduce ath79_spi_{en,dis}able helper functions,
    and call those from probe/response in order to avoid
    the mutliple initialization of the controller.

    Signed-off-by: Gabor Juhos
    Signed-off-by: Grant Likely

    Gabor Juhos
     
  • Use gpio_request_one() instead of multiple gpiolib calls.

    Signed-off-by: Gabor Juhos
    Signed-off-by: Grant Likely

    Gabor Juhos
     
  • The spi_bitbang driver calls the chipselect function
    of the driver from spi_bitbang_setup in order to
    deselect the given SPI chip, so we don't have to
    initialize the CS line here.

    Signed-off-by: Gabor Juhos
    Signed-off-by: Grant Likely

    Gabor Juhos
     
  • The 'ath79_spi_txrx_mode0' function does not
    set the SCK signal to LOW at the end of a word
    transfer. This causes communications errors with
    certain devices (e.g. the PCF2123 RTC chip).

    The patch ensures that the SCK signal will be LOW.

    Signed-off-by: Gabor Juhos
    Signed-off-by: Grant Likely

    Gabor Juhos
     
  • The driver uses the "as fast as it can" approach
    to drive the SCK signal. However this does not
    work with certain low speed SPI chips (e.g. the
    PCF2123 RTC chip).

    The patch adds per-bit slowdowns in order to be
    able to use the driver with such chips as well.

    Signed-off-by: Gabor Juhos
    Signed-off-by: Grant Likely

    Gabor Juhos
     

08 Dec, 2012

1 commit

  • CONFIG_HOTPLUG is going away as an option. As result the __dev*
    markings will be going away.

    Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst,
    and __devexit.

    Bill Pemberton has done most of the legwork on this series. I've used
    his script to purge the attributes from the drivers/gpio tree.

    Reported-by: Bill Pemberton
    Signed-off-by: Grant Likely

    Grant Likely
     

20 May, 2012

1 commit


08 Dec, 2011

1 commit

  • Whithout including 'linux/module.h' spi-ath79 driver fails to compile
    with the these errors:

    drivers/spi/spi-ath79.c:273:12: error: 'THIS_MODULE' undeclared here (not in a function)
    drivers/spi/spi-ath79.c:278:20: error: expected declaration specifiers or '...' before string constant
    drivers/spi/spi-ath79.c:278:1: warning: data definition has no type or storage class
    drivers/spi/spi-ath79.c:278:1: warning: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION'
    drivers/spi/spi-ath79.c:278:20: warning: function declaration isn't a prototype
    drivers/spi/spi-ath79.c:279:15: error: expected declaration specifiers or '...' before string constant
    drivers/spi/spi-ath79.c:279:1: warning: data definition has no type or storage class
    drivers/spi/spi-ath79.c:279:1: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
    drivers/spi/spi-ath79.c:279:15: warning: function declaration isn't a prototype
    drivers/spi/spi-ath79.c:280:16: error: expected declaration specifiers or '...' before string constant
    drivers/spi/spi-ath79.c:280:1: warning: data definition has no type or storage class
    drivers/spi/spi-ath79.c:280:1: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE'
    drivers/spi/spi-ath79.c:280:16: warning: function declaration isn't a prototype
    drivers/spi/spi-ath79.c:281:14: error: expected declaration specifiers or '...' before string constant
    drivers/spi/spi-ath79.c:281:1: warning: data definition has no type or storage class
    drivers/spi/spi-ath79.c:281:1: warning: type defaults to 'int' in declaration of 'MODULE_ALIAS'
    drivers/spi/spi-ath79.c:281:14: warning: function declaration isn't a prototype

    Signed-off-by: Gabor Juhos
    Signed-off-by: Wolfram Sang

    Gabor Juhos
     

25 Oct, 2011

1 commit

  • For simple modules that contain a single platform_driver without any
    additional setup code then ends up being a block of duplicated
    boilerplate. This patch adds a new macro, module_platform_driver(),
    which replaces the module_init()/module_exit() registrations with
    template functions.

    Signed-off-by: Grant Likely
    Acked-by: Greg Kroah-Hartman
    Reviewed-by: Magnus Damm
    Reviewed-by: Mark Brown
    Reviewed-by: Stephen Boyd

    Grant Likely
     

11 Jun, 2011

1 commit


06 Jun, 2011

1 commit

  • Sort the SPI makefile and enforce the naming convention spi_*.c for
    spi drivers.

    This change also rolls the contents of atmel_spi.h into the .c file
    since there is only one user of that particular include file.

    v2: - Use 'spi-' prefix instead of 'spi_' to match what seems to be
    be the predominant pattern for subsystem prefixes.
    - Clean up filenames in Kconfig and header comment blocks

    Signed-off-by: Grant Likely
    Acked-by: Wolfram Sang
    Acked-by: Linus Walleij

    Grant Likely