summaryrefslogtreecommitdiffstats
path: root/drivers/spi
Commit message (Collapse)AuthorAgeFilesLines
...
| * | omap3_spi: Set the correct CS number for AM33xxTeresa Gámez2013-06-211-2/+10
| | | | | | | | | | | | | | | | | | | | | Changed the number of CS for AM33xx boards to 2. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | omap3_spi: Remove CS check in driverTeresa Gámez2013-06-211-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | Board file or DT has to take care that the correct chip select and bus values are used. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | arm: omap: am33xx: set up SPI devicesJan Luebbe2013-06-181-1/+1
| |/ | | | | | | | | Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / spi: mxs: Use clk supportSascha Hauer2013-06-201-1/+5
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: improve devicetree supportSascha Hauer2013-05-211-2/+13
| | | | | | | | | - zero spi_board_info structure to not accidently pass unitilialized fields - parse spi-max-frequency property from devicetree - parse mode flags from devicetree Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add more drivers to using device_platform_driver()Alexander Shiyan2013-03-141-7/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mxs'Sascha Hauer2013-03-043-0/+295
|\
| * SPI: Add i.MX 23/28 SPI driver supportMichael Grzeschik2013-02-113-0/+295
| | | | | | | | | | Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2013-03-044-31/+4
|\ \
| * | Use new device_platform_driver() macro for driversAlexander Shiyan2013-02-134-31/+4
| |/ | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / imx_spi: fix bus-num setupHubert Feurstein2013-02-211-0/+1
|/ | | | | Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* atmel_spi: fix spi cs gpio request loopJean-Christophe PLAGNIOL-VILLARD2013-01-151-1/+1
| | | | | | it's 0 to num_cs - 1 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* spi: atmel: request cs pin via gpiolibJean-Christophe PLAGNIOL-VILLARD2013-01-021-0/+8
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers/base: fix corrupt device treeSascha Hauer2012-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_add_child is a very unsafe function. If called multiple times it allows setting the same device to different parents thus corrupting the siblings list. This happens regularly since: | commit c2e568d19c5c34a05a1002d25280bf113b72b752 | Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | Date: Sat Nov 3 16:11:05 2012 +0100 | | bus: add bus device | | automatically add it as parent of any bus device if none already specified | | we have now a nice output per bus If for example a FATfs is mounted this nice output per bus often ends with: > `---- fat0 > `---- 0 > `---- 0x86f0000087020031-0x86f000410df27124: /dev/<NULL> > `---- sram00 > `---- 0x00000000-0xffffffffffffffff: /dev/<NULL> > `---- 0x00000000-0xffffffffffffffff: /dev/<NULL> > unable to handle NULL pointer dereference at address 0x0000000c > pc : [<87f08a20>] lr : [<87f08a04>] > sp : 86eff8c0 ip : 87f3fbde fp : ffffffff > r10: ffffffff r9 : 00000000 r8 : 00000003 > r7 : 86f075b8 r6 : 00000002 r5 : ffffffec r4 : 86f07544 > r3 : 00000000 r2 : 43f900b4 r1 : 00000020 r0 : 00000005 > Flags: Nzcv IRQs off FIQs off Mode SVC_32 > [<87f08a20>] (do_devinfo_subtree+0x90/0x130) from [<87f08a90>] (do_devinfo_subtree+0x100/0x130) > > [<87f3e070>] (unwind_backtrace+0x0/0x90) from [<87f28514>] (panic+0x28/0x3c) > [<87f28514>] (panic+0x28/0x3c) from [<87f3e4b8>] (do_exception+0x10/0x14) > [<87f3e4b8>] (do_exception+0x10/0x14) from [<87f3e544>] (do_data_abort+0x2c/0x38) > [<87f3e544>] (do_data_abort+0x2c/0x38) from [<87f3e268>] (data_abort+0x48/0x60) This patch fixes this by adding a device to its parents children list in register_device so that dev_add_child is no longer needed. This function is removed from the tree. Now callers of register_device have to clearly set the parent *before* registering a device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported-by: Jan Lübbe <jlu@pengutronix.de>
* Cleanup Kconfig filesAlexander Shiyan2012-12-081-1/+1
| | | | | | | | | This patch provides a global cleanup barebox Kconfig files. This includes replacing spaces to tabs, formatting in accordance format, removing extraneous lines and spaces. No functional changes. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/spi'Sascha Hauer2012-11-163-77/+209
|\
| * omap3_spi: fix bus numbers according to omap3_add_spi[1-4]Jan Luebbe2012-11-121-7/+7
| | | | | | | | | | Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * atmel_spi: add cs change supportJean-Christophe PLAGNIOL-VILLARD2012-11-121-2/+22
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * atmel_spi: drop setup during transferJean-Christophe PLAGNIOL-VILLARD2012-11-121-5/+0
| | | | | | | | | | | | | | this need to be handle at framework and driver level Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * atmel_spi: fix cs supportJean-Christophe PLAGNIOL-VILLARD2012-11-121-22/+100
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * atmel_spi: add sanity check in setupJean-Christophe PLAGNIOL-VILLARD2012-11-121-0/+14
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * atmel_spi: after setup the cs need to be disableJean-Christophe PLAGNIOL-VILLARD2012-11-121-13/+16
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * atmel_spi: split transfer to atmel_spi_do_xferJean-Christophe PLAGNIOL-VILLARD2012-11-121-40/+49
| | | | | | | | | | | | | | This makes the code mre readable Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * atmel_spi: use device id as bus numJean-Christophe PLAGNIOL-VILLARD2012-11-121-0/+1
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * spi: introduce spi_get_masterJean-Christophe PLAGNIOL-VILLARD2012-11-121-0/+12
| | | | | | | | | | | | | | so we can request a master usefull for the spi command Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | spi: move the depends on SPI to if SPI and keep config alphanum orderedJean-Christophe PLAGNIOL-VILLARD2012-10-301-13/+12
|/ | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/imx-clk'Sascha Hauer2012-10-041-3/+19
|\
| * ARM i.MX: Remove old clock supportSascha Hauer2012-10-041-1/+0
| | | | | | | | | | | | | | The old clock support is now unused. Remove it. The former i.MX clko command is superseeded by generic clock manipulation commands. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * spi i.MX: Switch to clk supportSascha Hauer2012-10-041-2/+19
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | switch all platform_bus device/driver registering to ↵Jean-Christophe PLAGNIOL-VILLARD2012-10-044-4/+4
|/ | | | | | | | platform_driver/device_register now register_driver and register_device are for bus only usage. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'for-next/spi'Sascha Hauer2012-10-034-0/+500
|\
| * drivers/spi: add driver for the Multichannel SPI controller found in TI SoCsJan Luebbe2012-09-064-0/+500
| | | | | | | | | | | | | | Also create devices for OMAP3. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/remove-fsf-address'Sascha Hauer2012-10-034-16/+0
|\ \ | | | | | | | | | | | | | | | Conflicts: drivers/net/miidev.c include/miidev.h
| * | Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-174-16/+0
| |/ | | | | | | | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | spi: switch from printf back to debugJan Luebbe2012-09-271-1/+1
| | | | | | | | | | | | | | | | Commit 5888a3b5c96cf8381431486416ef2667993c85fc accidentally changed this to printf. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | driver: register busJean-Christophe PLAGNIOL-VILLARD2012-09-231-0/+6
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | spi imx: dt supportSascha Hauer2012-09-231-2/+47
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | spi: add oftree supportSascha Hauer2012-09-141-1/+32
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | SPI: Put SPI devices on their own busSascha Hauer2012-09-141-0/+24
|/ | | | | | | | | This patch adds a SPI bus on which the SPI devices and drivers register. This makes it cleaner as SPI devices won't accidently end up probed by a platform_device driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* i.MX35: add cspi1 supportEric Bénard2012-08-292-2/+2
| | | | | | | tested with a m25p128 flash both in nand boot & spi boot. Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* SPI i.MX: Add support for i.MX6Sascha Hauer2012-07-312-4/+4
| | | | | | | | | The i.MX5 does not have a valid function to get the spi clock. This patch introduces a function for i.MX6, and moves the bogus spi clock speed to the speed-imx5*.c. Not nice, but preserves the current status quo for i.MX5 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX SPI: Setup SPI chipselect to inactive state while initializing deviceAlexander Shiyan2012-05-161-0/+4
| | | | | | | | To avoid unnecessary preset initial state chipselect lines for SPI, set it to inactive state when adding devices to the system. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers/spi/spi.c: use DEVICE_ID_DYNAMIC when allocating a struct device_dJan Luebbe2012-05-141-0/+2
| | | | | | | | This causes allocation of a free id and avoids conflicts if multiple identical SPI devices are attached. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'master' into nextSascha Hauer2011-11-291-0/+2
|\ | | | | | | | | | | | | Conflicts: drivers/ata/disk_drive.c Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * atmel_spi: add mesg->actual_length, so devices can use it for read/writeMichael Grzeschik2011-11-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | Without this i.e. the m25p driver is not working properly. Its used to calculate the return value of the read/write function of some devices. If the value is missing, barebox would always miscalculate the next transfer sizes. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | spi/altera_spi: Add cs_change supportFranck Jullien2011-11-251-1/+26
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Linux kernel says (spi.h) : * All SPI transfers start with the relevant chipselect active. Normally * it stays selected until after the last transfer in a message. Drivers * can affect the chipselect signal using cs_change. * * (i) If the transfer isn't the last one in the message, this flag is * used to make the chipselect briefly go inactive in the middle of the * message. Toggling chipselect in this way may be needed to terminate * a chip command, letting a single spi_message perform all of group of * chip transactions together. * * (ii) When the transfer is the last one in the message, the chip may * stay selected until the next transfer. On multi-device SPI busses * with nothing blocking messages going to other devices, this is just * a performance hint; starting a message to another device deselects * this one. But in other cases, this can be used to ensure correctness. * Some devices need protocol transactions to be built from a series of * spi_message submissions, where the content of one message is * determined by the results of previous messages and where the whole * transaction * ends when the chipselect goes intactive. In other words, cs_change changes the default chipselect *behavior*. Support of cs_change is necessary to implement the mci spi driver. This patch also fix few things: Passing the bus number to the brand new master device. Disable chipselect during master->setup. Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: enfore default bits_per_word valuePaul Fertser2011-09-291-1/+1
| | | | | | | | Documentation says it should default to 8 when not specified explicitly by the device data. Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: let master a chance to setup device before registering itPaul Fertser2011-09-291-3/+2
| | | | | | | | | Call setup() before registering the device because registering leads to a probe routine of the slave device and that requires an initialised master. Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce io.hSascha Hauer2011-09-223-3/+3
| | | | | | | To allow for some generic io accessors introduce io.h and use this instead of asm/io.h throughout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx25: imx_spi: support CSPI v0.7 as found on i.MX25Paul Fertser2011-09-212-0/+116
| | | | | | | | | | Based on the Linux driver. Tested with m25p80 with CS in GPIO mode. Clock setting support is ad-hoc as the corresponding mach is not using the generic clock infrastructure. Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>