History log of /linux-master/drivers/spi/spi-mpc512x-psc.c
Revision Date Author Comments
# a21db739 22-Aug-2023 Yang Yingliang <yangyingliang@huawei.com>

spi: mpc512x-psc: switch to use modern name

Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-8-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# de5e92cb 03-Aug-2023 Li Zetao <lizetao1@huawei.com>

spi: mpc5xxx-psc: Fix unsigned expression compared with zero

There is two warnings reported by coccinelle:

./drivers/spi/spi-mpc512x-psc.c:493:5-13: WARNING:
Unsigned expression compared with zero: mps -> irq < 0
./drivers/spi/spi-mpc52xx-psc.c:332:5-13: WARNING:
Unsigned expression compared with zero: mps -> irq < 0

The commit "208ee586f862"
("spi: mpc5xxx-psc: Return immediately if IRQ resource is unavailable")
was to check whether the IRQ resource is unavailable. When the IRQ
resource is unavailable, an error code is returned, however, the type
of "mps->irq" is "unsigned int", causing the error code to flip. Modify
the type of "mps->irq" to solve this problem.

Fixes: 208ee586f862 ("spi: mpc5xxx-psc: Return immediately if IRQ resource is unavailable")
Signed-off-by: Li Zetao <lizetao1@huawei.com>
Link: https://lore.kernel.org/r/20230803134805.1037251-1-lizetao1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 9e264f3f 10-Mar-2023 Amit Kumar Mahapatra via Alsa-devel <alsa-devel@alsa-project.org>

spi: Replace all spi->chip_select and spi->cs_gpiod references with function call

Supporting multi-cs in spi drivers would require the chip_select & cs_gpiod
members of struct spi_device to be an array. But changing the type of these
members to array would break the spi driver functionality. To make the
transition smoother introduced four new APIs to get/set the
spi->chip_select & spi->cs_gpiod and replaced all spi->chip_select and
spi->cs_gpiod references with get or set API calls.
While adding multi-cs support in further patches the chip_select & cs_gpiod
members of the spi_device structure would be converted to arrays & the
"idx" parameter of the APIs would be used as array index i.e.,
spi->chip_select[idx] & spi->cs_gpiod[idx] respectively.

Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
Acked-by: Heiko Stuebner <heiko@sntech.de> # Rockchip drivers
Reviewed-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org> # Aspeed driver
Reviewed-by: Dhruva Gole <d-gole@ti.com> # SPI Cadence QSPI
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> # spi-stm32-qspi
Acked-by: William Zhang <william.zhang@broadcom.com> # bcm63xx-hsspi driver
Reviewed-by: Serge Semin <fancer.lancer@gmail.com> # DW SSI part
Link: https://lore.kernel.org/r/167847070432.26.15076794204368669839@mailman-core.alsa-project.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 21d19e60 10-Mar-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

spi: mpc5xxx-psc: Remove goto to the unexisted label

The previous cleanup patch had lost one of its parts in a crack,
Finish the cleanup by removing the leftovers.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 9e21720a4958 ("spi: mpc5xxx-psc: use devm_clk_get_enabled() for core clock")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230310111544.57342-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 289c084d 06-Mar-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

spi: mpc5xxx-psc: Propagate firmware node

Propagate firmware node by using a specific API call, i.e. device_set_node().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230306183115.87314-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 9e21720a 06-Mar-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

spi: mpc5xxx-psc: use devm_clk_get_enabled() for core clock

Use devm_clk_get_enabled() to simplify the code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230306183115.87314-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 208ee586 06-Mar-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

spi: mpc5xxx-psc: Return immediately if IRQ resource is unavailable

Return immediately if IRQ resource is unavailable. This will also
propagate the correct error code in such cases.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230306183115.87314-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# ee493fa5 06-Mar-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

spi: mpc5xxx-psc: Correct error check for devm_platform_get_and_ioremap_resource()

devm_platform_get_and_ioremap_resource() may return pointer or error
pointer, never the NULL. Correct error check for it.

Fixes: 60a6c8257f41 ("spi: mpc5xxx-psc: Use platform resources instead of parsing DT properties")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230306183115.87314-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 60a6c825 17-Feb-2023 Rob Herring <robh@kernel.org>

spi: mpc5xxx-psc: Use platform resources instead of parsing DT properties

The mpc52xx-psc and mpc512x-psc drivers use DT property parsing
functions for 'reg' and 'interrupts', but those are available as
platform device resources. Convert probe functions to use them and
simplify probe to a single function. For 'cell-index', also use the
preferred typed property function.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230217-dt-mpc5xxx-spi-v1-3-3be8602fce1e@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 01602336 17-Feb-2023 Rob Herring <robh@kernel.org>

spi: mpc5xxx-psc: Convert probe to use devres functions

Convert the mpc52xx-psc and mpc512x-psc drivers to use the managed
devres variants of functions in probe. Also use dev_err_probe() as
appropriate. With this, the error handling can be simplified.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230217-dt-mpc5xxx-spi-v1-2-3be8602fce1e@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 04725901 17-Feb-2023 Rob Herring <robh@kernel.org>

spi: mpc5xxx-psc: Remove unused platform_data

The platform_data for the MPC5xxx PSC SPI controllers is never used, so
remove it and the resulting code which depends on it.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230217-dt-mpc5xxx-spi-v1-1-3be8602fce1e@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 8d37f271 01-Feb-2022 Linus Walleij <linus.walleij@linaro.org>

spi: mpc512x-psc: Fix compile errors

My patch created compilation bugs in the MPC512x-PSC driver.
Fix them up.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: linuxppc-dev@lists.ozlabs.org
Reported-by: kernel test robot <lkp@intel.com>
Fixes: 2818824ced4b (" spi: mpc512x-psc: Convert to use GPIO descriptors")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220201234535.569973-1-linus.walleij@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 2818824c 19-Jan-2022 Linus Walleij <linus.walleij@linaro.org>

spi: mpc512x-psc: Convert to use GPIO descriptors

This driver is already relying on the core to provide
valid GPIO numbers in spi->cs_gpio through
of_spi_get_gpio_numbers(), so we can switch to letting
the core use GPIO descriptors instead.

The driver was assigning a local function to the custom
chipselect callback, but I chose to just open code the
gpiod setting instead, this is easier to read.

The only platform that overrides the cs_control callback
is the mpc832x_rdb.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220120002600.216667-1-linus.walleij@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 722cb2b1 17-May-2021 Zhiqi Song <songzhiqi1@huawei.com>

spi: mpc512x-psc: add parenthesis for sizeof

Fix missing parenthesis of sizeof reported by checkpatch.pl:
WARNING: sizeof *pp should be sizeof(*pp).

The kernel coding style suggests thinking of sizeof as a function
and add parenthesis.

Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
Link: https://lore.kernel.org/r/1621301902-64158-3-git-send-email-songzhiqi1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# e74dc5c7 26-Sep-2019 Alexandru Ardelean <alexandru.ardelean@analog.com>

spi: use new `spi_transfer_delay_exec` helper where straightforward

For many places in the spi drivers, using the new `spi_transfer_delay`
helper is straightforward.
It's just replacing:
```
if (t->delay_usecs)
udelay(t->delay_usecs);
```
with `spi_transfer_delay(t)` which handles both `delay_usecs` and the new
`delay` field.

This change replaces in all places (in the spi drivers) where this change
is simple.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20190926105147.7839-10-alexandru.ardelean@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 2874c5fd 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 3029 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 85c1912d 15-Sep-2015 Jarkko Nikula <jarkko.nikula@linux.intel.com>

spi: mpc512x: Call mpc512x_psc_spi_transfer_setup() unconditionally

SPI core validates both bits_per_word and speed_hz transfer parameters and
thus the if statement here is needless as it will always call the
mpc512x_psc_spi_transfer_setup().

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 1f2112af 21-Jul-2015 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

spi: mpc512x-psc: fix compiler warning about uninitialized variable

This fixes several warnings like:

drivers/spi/spi-mpc512x-psc.c: In function 'mpc512x_psc_spi_prep_xfer_hw':
arch/powerpc/include/asm/io.h:163:2: warning: '__ret' may be used uninitialized in this function [-Wmaybe-uninitialized]

introduced in commit 8bf960985dfc for some build configurations.

Fixes: 8bf960985dfc ("spi: mpc512x-psc: add support for Freescale MPC5125")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 8bf96098 14-Jul-2015 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

spi: mpc512x-psc: add support for Freescale MPC5125

The register layout of the PSC devices differ between MPC5121 and
MPC5125, but the registers are named nearly identical and their purpose
is similar enough ("freescale identical") such that substituting
mpc52xx_psc by mpc5125_psc is nearly enough to make the driver work on
MPC5125. To keep supporting MPC5121 this patch introduces a cpp
macro to select the right struct that defines the register layout.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 09355402 16-Mar-2015 Fabian Frederick <fabf@skynet.be>

spi: constify of_device_id array

of_device_id is always used as const.
(See driver.of_match_table and open firmware functions)

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 14ac00e0 20-Oct-2014 Wolfram Sang <wsa@kernel.org>

spi: drop owner assignment from platform_drivers

A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>


# 0a6d3879 02-Apr-2014 Axel Lin <axel.lin@ingics.com>

spi: Always check complete callback before calling it

Since commit 1e25cd4729bd "spi: Do not require a completion", this checking is
required to prevent NULL pointer dereference.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 3d8c8697 15-Feb-2014 Axel Lin <axel.lin@ingics.com>

spi: mpc512x-psc: Remove redundant code to get bus_num from DT

For DT case, spi core will call of_alias_get_id() and set master->bus_num if it
was not set.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 3a44623d 21-Jan-2014 Paul Gortmaker <paul.gortmaker@windriver.com>

spi: delete non-required instances of include <linux/init.h>

None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>. Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# dff148ad 30-Nov-2013 Gerhard Sittig <gsi@denx.de>

spi: mpc512x: adjust to OF based clock lookup

after device tree based clock lookup became available, the peripheral
driver need no longer construct clock names which include the PSC index,
remove the "psc%d_mclk" template and unconditionally use 'mclk'

acquire and release the 'ipg' clock item for register access as well

Cc: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org
Signed-off-by: Gerhard Sittig <gsi@denx.de>
Acked-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Anatolij Gustschin <agust@denx.de>


# e1d0cd47 17-Dec-2013 Jingoo Han <jg1.han@samsung.com>

spi: mpc512x: Use devm_*() functions

Use devm_*() functions to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# a4469a42 15-Nov-2013 Wei Yongjun <yongjun_wei@trendmicro.com.cn>

spi: mpc512x: fix reference leak to master in mpc512x_psc_spi_do_remove()

Once a spi_master_get() call succeeds, we need an additional
spi_master_put() call to free the memory, otherwise we will
leak a reference to master. Fix by removing the unnecessary
spi_master_get() call.

Fixes: eaa24297846b ('spi: mpc512x: use devm_spi_register_master()')
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 16735d02 14-Nov-2013 Wolfram Sang <wsa@kernel.org>

tree-wide: use reinit_completion instead of INIT_COMPLETION

Use this new function to make code more comprehensible, since we are
reinitialzing the completion, not initializing.

[akpm@linux-foundation.org: linux-next resyncs]
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13)
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 5af50730 17-Sep-2013 Rob Herring <rob.herring@calxeda.com>

drivers: clean-up prom.h implicit includes

Powerpc is a mess of implicit includes by prom.h. Add the necessary
explicit includes to drivers in preparation of prom.h cleanup.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Grant Likely <grant.likely@linaro.org>


# eaa24297 23-Sep-2013 Jingoo Han <jg1.han@samsung.com>

spi: mpc512x: use devm_spi_register_master()

Use devm_spi_register_master() to make cleanup paths simpler,
and remove a duplicate put.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# eadf69cf 11-Sep-2013 Wei Yongjun <yongjun_wei@trendmicro.com.cn>

spi: mpc512x: fix error return code in mpc512x_psc_spi_do_probe()

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 8074cf06 30-Jul-2013 Jingoo Han <jg1.han@samsung.com>

spi: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# a81a5094 06-Aug-2013 Gerhard Sittig <gsi@denx.de>

spi: mpc512x: cleanup clock API use

cleanup the MPC512x SoC's SPI master's use of the clock API
- get, prepare, and enable the MCLK during probe; disable, unprepare and
put the MCLK upon remove; hold a reference to the clock over the
period of use
- fetch MCLK rate (reference) once during probe and slightly reword BCLK
(bitrate) determination to reduce redundancy as well as to not exceed
the maximum text line length
- stick with the PPC_CLOCK 'psc%d_mclk' name for clock lookup, only
switch to a fixed string later after device tree based clock lookup
will have become available

Signed-off-by: Gerhard Sittig <gsi@denx.de>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 85085898 03-Jun-2013 Gerhard Sittig <gsi@denx.de>

spi: mpc512x: use the SPI subsystem's message queue

the SPI subsystem recently grew support to queue messages before handing
them to the SPI master, and erroneously emitted deprecation warnings
when the SPI master's driver did not use the common logic (in fact the
master might queue messages, but implement the queue in the master
driver's source)

[ 0.823015] mpc512x-psc-spi 80011400.psc: master is unqueued, this is deprecated
[ 0.854913] mpc512x-psc-spi 80011500.psc: master is unqueued, this is deprecated

this change makes the MPC512x PSC SPI driver use the SPI subsystem's
support to queue SPI messages and removes the master driver's private
code for the queue support

Signed-off-by: Gerhard Sittig <gsi@denx.de>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 5df24ea6 03-Jun-2013 Gerhard Sittig <gsi@denx.de>

spi: mpc512x: improve throughput in the RX/TX func

change the MPC512x SPI controller's transmission routine to increase
throughput: allow the RX byte counter to "lag behind" the TX byte
counter while iterating over the transfer's data, only wait for the
remaining RX bytes at the very end of the transfer

this approach eliminates delays in the milliseconds range, transfer
times for e.g. 16MB of SPI flash data dropped from 31s to 9s, correct
operation was tested by continuously transferring and comparing data
from an SPI flash (more than 200GB in some 45 hours)

background information on the motivation:

one might assume that all the RX data should have been received when the
TX data was sent, given the fact that we are the SPI master and provide
all of the clock, but in practise there's a difference

the ISR is triggered when the TX FIFO became empty, while transmission
of the last item still occurs (from the TX hold and shift registers),
sampling RX data on the opposite clock edge compared to the TX data adds
another delay (half a bit period), and RX data needs to propagate from
the reception buffer to the RX FIFO depending on the specific SoC
implementation

to cut it short: a difference between TX and RX byte counters during
transmission is not just acceptable but should be considered the regular
case, only the very end of the transfer needs to make sure that all of
the RX data was received before deasserting the chip select and telling
the caller that transmission has completed

Signed-off-by: Gerhard Sittig <gsi@denx.de>
Signed-off-by: Mark Brown <broonie@linaro.org>


# c36e93a0 03-Jun-2013 Gerhard Sittig <gsi@denx.de>

spi: mpc512x: minor prep before feature change

mechanical edits before changing functionality, to reduce diffs
- rename variables to later tell remaining TX and RX apart
- use size_t for the current TX and RX length
(for better compatibility with the min() macro)
- remove unused members from the master data (sysclk, eofbyte)
- silence a checkpatch warning (braces around single statement)

Signed-off-by: Gerhard Sittig <gsi@denx.de>
Signed-off-by: Mark Brown <broonie@linaro.org>


# c3e2aa86 01-Apr-2013 Anatolij Gustschin <agust@denx.de>

spi: spi-mpc512x-psc: let transmiter/receiver enabled when in xfer loop

There is no need to disable transmitter/receiver after each loop
iteration and re-enable it for next loop iteration. Enable the
transmitter/receiver before xfer loop starts and disable it when
the whole transfer is done.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 86e98743 01-Apr-2013 Anatolij Gustschin <agust@denx.de>

spi: spi-mpc512x-psc: add support for gpio chip selects

Currently the driver only uses one internal chip select.
Add support for gpio chip selects configured by cs-gpios
DT binding.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 1ad849ae 13-Mar-2013 Anatolij Gustschin <agust@denx.de>

spi/mpc512x-psc: optionally keep PSC SS asserted across xfer segmensts

Some SPI slave devices require asserted chip select signal across
multiple transfer segments of an SPI message. Currently the driver
always de-asserts the internal SS signal for every single transfer
segment of the message and ignores the 'cs_change' flag of the
transfer description. Disable the internal chip select (SS) only
if this is needed and indicated by the 'cs_change' flag.

Without this change, each partial transfer of a surrounding
multi-part SPI transaction might erroneously change the SS
signal, which might prevent slaves from answering the request
that was sent in a previous transfer segment because the
transaction could be considered aborted (SS was de-asserted
before reading the response).

Reported-by: Gerhard Sittig <gerhard.sittig@ifm.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org


# c88dd349 14-Jan-2013 Anatolij Gustschin <agust@denx.de>

spi/spi-mpc512x-psc: init mode bits supported by the driver

The driver should setup mode bits it supports, otherwise
adding an SPI device might fail even if the driver supports
the requested SPI mode.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 9d15a3ba 10-Jan-2013 Anatolij Gustschin <agust@denx.de>

spi/mpc512x-psc: don't use obsolet cell-index property

Remove deprecated cell-index property and use spi alias to
obtain the SPI PSC number used for SPI bus id.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# fd4a319b 07-Dec-2012 Grant Likely <grant.likely@secretlab.ca>

spi: Remove HOTPLUG section attributes

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 <wfp5p@virginia.edu>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 21879213 18-Aug-2012 Guenter Roeck <linux@roeck-us.net>

spi/mpc512x-psc: Avoid access to freed memory in device remove function

The call to spi_unregister_master() in the device remove function frees device
memory, and with it any device local data. However, device local data is still
accessed after the call to spi_unregister_master().

Acquire a reference to the SPI master device and release it after cleanup is
complete to solve the problem.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 940ab889 05-Oct-2011 Grant Likely <grant.likely@secretlab.ca>

drivercore: Add helper macro for platform_driver boilerplate

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 <grant.likely@secretlab.ca>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Reviewed-by: Magnus Damm <magnus.damm@gmail.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>


# ca632f55 06-Jun-2011 Grant Likely <grant.likely@secretlab.ca>

spi: reorganize drivers

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 <grant.likely@secretlab.ca>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>