summaryrefslogtreecommitdiffstats
path: root/drivers/spi
Commit message (Collapse)AuthorAgeFilesLines
...
| | | * | | spi: dw-mid: constify dw_spi_dma_ops structureJulia Lawall2015-11-302-2/+2
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dw_spi_dma_ops structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * / / spi: dw: Use SPI_TMOD_TR rather than magic const 0 to set tmodeJisheng Zhang2015-12-231-1/+1
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | The TMODE available value is well defined and documented in the header file. Use it and remove the comment. Signed-off-by: Jisheng Zhang <jszhang@marvell.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | |
| | \ \
| | \ \
| | \ \
| | \ \
| | \ \
| *-----. \ \ Merge remote-tracking branches 'spi/topic/bcm63xx', 'spi/topic/butterfly', ↵Mark Brown2016-01-114-35/+25Star
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 'spi/topic/cadence' and 'spi/topic/davinci' into spi-next
| | | | | * | | spi: davinci: use dev_err() for error reportingSekhar Nori2015-12-121-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use dev_err() for reporting errors rather than dev_dbg(). Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | | * | | spi: davinci: fix spurious i/o errorSekhar Nori2015-12-121-1/+2
| | | | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | davinci_spi_bufs() uses wait_for_completion_interruptible() without bothering to handle -ERESTARTSYS. Due to this, sometime, it returns prematurely when a signal is received. Since the return value is never checked, userspace eventually receives a spurious -EIO. To fix this, use un-interruptible wait_for_completion_timeout(). Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | * / / spi: cadence: use to_platform_device()Geliang Tang2016-01-051-4/+2Star
| | | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use to_platform_device() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | | spi: butterfly: use new parport device modelSudip Mukherjee2015-12-021-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify spi-butterfly driver to use the new parallel port device model. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | | spi: butterfly: correct alignmentSudip Mukherjee2015-12-021-6/+5Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | checkpatch complains about the allignment with open parenthesis. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | | spi: butterfly: remove cast to voidSudip Mukherjee2015-12-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | checkpatch was complaining about space after cast. But the cast to void is not required at that place. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | | spi: butterfly: remove multiple blank linesSudip Mukherjee2015-12-021-9/+0Star
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | checkpatch complains about multiple blank lines. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * / / spi/bcm63xx: Move default clock configuration to kill compiler warningGeert Uytterhoeven2015-11-161-4/+3Star
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/spi/spi-bcm63xx.c: In function ‘bcm63xx_spi_setup_transfer’: drivers/spi/spi-bcm63xx.c:207: warning: ‘clk_cfg’ may be used uninitialized in this function While this is a false positive, it can easily be avoided by selecting the default clock configuration first. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | Merge remote-tracking branch 'spi/topic/sunxi' into spi-nextMark Brown2016-01-111-3/+3
| |\ \ \
| | * | | spi: sun4i: Prevent chip-select from being activated twice before a transferMarcus Weseloh2016-01-071-3/+3
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SPI core calls set_cs before a transfer, but the SUN4I_CTL_CS_MANUAL flag is only set in transfer_one. This leads to the following pattern on the chip-select line (with runtime power-management on every transfer, without it only on the first one): activate, deactivate, activate, transfer, deactivate Moving the configuration of the SUN4I_CTL_CS_MANUAL flag from transfer_one to set_cs removes the double activation. Signed-off-by: Marcus Weseloh <mweseloh42@gmail.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | Merge remote-tracking branch 'spi/topic/core' into spi-nextMark Brown2016-01-111-2/+1Star
| |\ \ \
| | * | | spi: use to_spi_deviceGeliang Tang2015-12-231-2/+1Star
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | Use to_spi_device() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | Merge remote-tracking branch 'spi/fix/mtk' into spi-linusMark Brown2016-01-111-10/+18
| |\ \ \
| | * | | spi: mediatek: Prevent overflows in FIFO transfersNicolas Boichat2015-12-301-10/+18
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case where transfer length is not a multiple of 4, KASAN reports 2 out-of-bounds memory accesses: - mtk_spi_interrupt: ioread32_rep writes past the end of trans->rx_buf. - mtk_spi_fifo_transfer: iowrite32_rep reads past the end of xfer->tx_buf. Fix this by using memcpy on the remainder of the bytes. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | / / ACPI / spi: attach GPIO IRQ from ACPI description to SPI deviceChristophe RICARD2016-01-011-0/+3
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | spi->irq was ignoring GpioInt property setting it to -1. acpi_dev_gpio_irq_get returns and configure the slave IRQ according to the ACPI slave node description. It is now inline with devicetree behavior. Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| | |
| \ \
*-. \ \ Merge remote-tracking branches 'spi/fix/dspi' and 'spi/fix/spidev' into ↵Mark Brown2015-12-162-7/+7
|\ \ \ \ | | | | | | | | | | | | | | | spi-linus
| | * | | spi: spidev: Hold spi_lock over all defererences of spi in release()Mark Brown2015-12-161-1/+1
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use the spi_lock spinlock to protect against races between the device being removed and file operations on the spidev. This means that in the removal path all references to the device need to be done under lock as in removal we dropping references to the device. Reported-by: Vegard Nossum <vegard.nossum@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * / / spi-fsl-dspi: Fix CTAR Register accessBhuvanchandra DV2015-12-121-6/+6
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DSPI instances in Vybrid have a different amount of chip selects and CTARs (Clock and transfer Attributes Register). In case of DSPI1 we only have 2 CTAR registers and 4 CS. In present driver implementation CTAR offset is derived from CS instance which will lead to out of bound access if chip select instance is greater than CTAR register instance, hence use single CTAR0 register for all CS instances. Since we write the CTAR register anyway before each access, there is no value in using the additional CTAR registers. Also one should not program a value in CTAS for a CTAR register that is not present, hence configure CTAS to use CTAR0. Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Acked-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | Merge remote-tracking branch 'spi/fix/core' into spi-linusMark Brown2015-12-161-1/+1
|\ \ \
| * | | spi: fix parent-device reference leakJohan Hovold2015-12-161-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix parent-device reference leak due to SPI-core taking an unnecessary reference to the parent when allocating the master structure, a reference that was never released. Note that driver core takes its own reference to the parent when the master device is registered. Fixes: 49dce689ad4e ("spi doesn't need class_device") Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
| | |
| \ \
| \ \
| \ \
| \ \
| \ \
*-----. \ \ Merge remote-tracking branches 'spi/fix/bcm63xx', 'spi/fix/doc', ↵Mark Brown2015-11-304-16/+43
|\ \ \ \ \ \ | | | | |_|/ | | | |/| | | | | | | | 'spi/fix/mediatek' and 'spi/fix/pl022' into spi-linus
| | | | * | spi: pl022: handle EPROBE_DEFER for dmaRabin Vincent2015-11-231-6/+22
| | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handle EPROBE_DEFER explicitly so that we ensure that we get the DMA channel specified in the device tree, instead of depending on the DMA controller getting probed before us. Signed-off-by: Rabin Vincent <rabin.vincent@axis.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * / spi: mediatek: single device does not require cs_gpiosNicolas Boichat2015-11-161-8/+18
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When only one device is present, it is not necessary to specify cs_gpios, as the CS line can be controlled by the hardware module. Without this patch, older device tree bindings used before 37457607 "spi: mediatek: mt8173 spi multiple devices support" would cause a panic on boot. This fixes the crash, and re-introduces backward compatibility. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Acked-by: Leilk Liu <leilk.liu@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * / spi: Add missing kerneldoc description for parameterThierry Reding2015-11-101-0/+1
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit ca5d24854210 ("spi: Add THIS_MODULE to spi_driver in SPI core") adds the new __spi_register_driver() function, but keeps the kerneldoc for the spi_register_driver() function in place and forgets to add the description for the new owner parameter. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * / spi: bcm63xx: use correct format string for printing a resourceArnd Bergmann2015-11-161-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | With a 64-bit resource_size_t, we get a build warning on bcm63xx_spi_probe: drivers/spi/spi-bcm63xx.c:565:16: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t {aka long long unsigned int}' [-Wformat=] As we are printing a resource, we can just use the %pr format specifier that pretty-prints the address and avoids the warning. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* / spi: bugfix: spi_message.transfer_length does not get resetMartin Sperl2015-11-271-0/+1
|/ | | | | | | | | | When submitting an identical spi_message multiple times via spi_sync the spi_message.frame_length does not get reset to 0 in __spi_validate before adding up all spi_transfer.len resulting in frame_length > actual_length on all but the first spi_sync call. Signed-off-by: Martin Sperl <kernel@martin.sperl.org> Signed-off-by: Mark Brown <broonie@kernel.org>
*---. Merge remote-tracking branches 'spi/topic/s3c64xx', 'spi/topic/ti-qspi' and ↵Mark Brown2015-11-043-80/+53Star
|\ \ \ | | | | | | | | | | | | 'spi/topic/txx9' into spi-next
| | | * spi: txx9: Use transfer speed unconditionallyJarkko Nikula2015-09-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SPI core validates the transfer speed and defaults to spi->max_speed_hz in case the transfer speed is not set. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | spi: ti-qspi: improve ->remove() callbackFelipe Balbi2015-10-301-10/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there's no need to call pm_runtime_get_sync() followed by pm_runtime_put(). We should, instead, just call pm_runtime_put_sync() and pm_runtime_disable(). Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | spi: spi-ti-qspi: switch to polling mode for better r/w performanceVignesh R2015-10-161-54/+20Star
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently word completion interrupt is fired for transfer of every word(8bit to 128bit in size). This adds a lot of overhead, and decreases r/w throughput. It hardly takes 3us(@48MHz) for 128bit r/w to complete, hence its better to poll on word complete bit to be set in QSPI_SPI_STATUS_REG instead of using interrupts. This increases the throughput by 30% in both read and write case. So, switch to polling mode instead of interrupts to determine completion of word transfer. Signed-off-by: Vignesh R <vigneshr@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: s3c64xx: Use transfer speed unconditionallyJarkko Nikula2015-09-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | SPI core validates the transfer speed and defaults to spi->max_speed_hz in case the transfer speed is not set. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: s3c64xx: replace clock disabling with runtime PM suspend call in remove ↵Heiner Kallweit2015-09-141-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function Simplify s3c64xx_spi_remove by replacing the clock disabling with calling runtime PM suspend which does the same. Waking up the device if it was suspended wouldn't be strictly needed for this driver but using pm_runtime_get_sync is cleaner and makes s3c64xx_spi_remove more consistent with the runtime PM handling in s3c64xx_spi_setup. pm_runtime_force_suspend does most of the work for us: disabling the clocks, disabling runtime PM and setting it to "suspended" state. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: s3c64xx: simplify suspend / resume handlersHeiner Kallweit2015-09-141-8/+7Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The runtime PM suspend / resume handlers take care of the enabling/ disabling the clocks already. Therefore replace the duplicated clock handling with pm_runtime_force_suspend/resume. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: s3c64xx: extend driver to make full use of runtime PM autosuspendHeiner Kallweit2015-09-141-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the driver to make full use of runtime PM autosuspend. Before only the SPI core was instructed to use autosuspend by setting master->auto_runtime_pm. Nevertheless due to the missing pm_runtime_use_autosuspend call autosuspend wasn't active. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: s3c64xx: clean up runtime PM if driver registration failsHeiner Kallweit2015-09-141-1/+4
| |/ | | | | | | | | | | | | | | Fix missing runtime PM cleanup if driver registration fails. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
| \
| \
| \
| \
| \
| \
*-------. \ Merge remote-tracking branches 'spi/topic/omap-100k', ↵Mark Brown2015-11-048-138/+174
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | 'spi/topic/omap-uwire', 'spi/topic/owner', 'spi/topic/pxa' and 'spi/topic/pxa2xx' into spi-next
| | | | | * | spi: pxa2xx: Rework self-initiated platform data creation for non-ACPIJarkko Nikula2015-10-301-12/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the pxa2xx_spi_acpi_get_pdata() so that it can create platform data also on platforms that do not support ACPI or if CONFIG_ACPI is not set. Now it is expected that "pxa2xx-spi" platform device is either created with explicit platform data or has an ACPI companion device. However there is only little in pxa2xx_spi_acpi_get_pdata() that is really dependent on ACPI companion and it can be reworked to cover also cases where "pxa2xx-spi" device doesn't have ACPI companion and is created without platform data. Do this by renaming the pxa2xx_spi_acpi_get_pdata(), moving it outside of CONFIG_ACPI test and changing a few runtime tests there to support non-ACPI case. Only port/bus ID setting based on ACPI _UID is dependent on ACPI and is moved to own function inside CONFIG_ACPI. Purpose of this to support non-ACPI case for those PCI enumerated compound devices that integrate both LPSS SPI host controller and integrated DMA engine under the same PCI ID and which are registered in MFD layer instead of in spi-pxa2xx-pci.c. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | | * | spi: pxa2xx: Add support for Intel BroxtonJarkko Nikula2015-10-301-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LPSS SPI in Intel Broxton is otherwise the same than in Intel Sunrisepoint but it supports up to four chip selects per port and has different FIFO thresholds. Patch adds support for two Broxton SoC variants. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | | * | spi: pxa2xx: Detect number of enabled Intel LPSS SPI chip select signalsJarkko Nikula2015-10-301-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SPI capabilities register located in private registers space of newer Intel LPSS SPI host controllers tell in register bits 12:9 which chip select signals are enabled. Use that information for detecting the number of chip selects. For simplicity we assume chip selects are enabled one after another without disabled chip selects between. For instance CS0 | CS1 | CS2 but not CS0 | CS1 | CS3. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | | * | spi: pxa2xx: Add output control for multiple Intel LPSS chip selectsJarkko Nikula2015-10-301-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Intel LPSS SPI host controllers in upcoming Intel platforms can have up to 4 chip selects per port. Extend chip select control in lpss_ssp_cs_control() by adding a code that selects the active chip select output prior to changing the state. Detection for number of enabled chip select signals will be added by another patch. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | | * | spi: pxa2xx: Use LPSS prefix for defines that are Intel LPSS specificJarkko Nikula2015-10-301-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename a few defines that are specific to Intel LPSS SPI private registers with LPSS prefix. It makes easier to distinguish them from common defines. Suggested-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | | * | spi: pxa2xx: Align a few definesJarkko Nikula2015-10-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add more indentation to define lines for making them aligned with the longest one. They would look messy after adding more long defines. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | | * | spi: pxa2xx: Save other reg_cs_ctrl bits when configuring chip selectJarkko Nikula2015-10-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upcoming Intel platforms use LPSS SPI_CS_CONTROL register bits 15:12 for configuring the chip select polarities. Touch only chip select SW mode and state bits when enabling the software chip select control in order to not clear any other bits in the register. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | | * | spi: pxa2xx: Convert unique ID string of ACPI device as unsigned integerJarkko Nikula2015-10-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Andy noticed numeric unique device ID is unsigned integer so convert it using kstrtouint(). Actually integer in ACPI 2.0 and later is 64 bits litte-endian unsigned integer but quite certainly having so big value here would mean something extra than just the SPI bus number so it won't hurt to assume only lower 32 bits carry the bus number for now. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | | * | spi: pxa2xx: derive struct chip_data from struct drv_dataAndy Shevchenko2015-10-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we call pxa2xx_ssp_get_clk_div() from pump_transfers() we may derive pointer to struct chip_data from struct drv_data like it's done in the rest of the functions. This will make it less errorprone. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | | * | spi: pxa2xx: move debug messages to pump_transfer()Andy Shevchenko2015-10-231-17/+11Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The speed can be changed from transfer to transfer, that's why the messages do not depict the actual values during ->setup(). Move debug messages from ->setup() to pump_transfers(). Get rid of leftovers as well. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | | * | spi: pxa2xx: choose closest lower speedAndy Shevchenko2015-10-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per discussion [1] the best choice is to set closest speed which is not going over the asked one. Do the same approach for Intel Quark boards. [1] http://www.spinics.net/lists/linux-spi/msg03389.html Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>