Atsushi Nemoto
dbf763a2f1
SPI: spi_txx9: Fix bit rate calculation
...
TXx9 SPI bit rate is calculated by:
fBR = (spi-baseclk) / (n + 1)
Fix calculation of min_speed_hz, max_speed_hz and n.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp >
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2009-12-02 23:58:32 +00:00
Roel Kluin
b6b24c73d5
spi: error status should be negative
...
Return a negative error value instead of a positive
Signed-off-by: Roel Kluin <roel.kluin@gmail.com >
Cc: David Brownell <dbrownell@users.sourceforge.net >
Cc: dmitry pervushin <dpervushin@embeddedalley.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-11-17 17:40:32 -08:00
Srinidhi Kasagar
e89e04fcdc
ARM: 5741/1: pl022: fix peripheral id for ST vendor
...
This fixes the wrong peripheral id being
used in pl022 driver for ST derivative.
Signed-off-by: srinidhi kasagar <srinidhi.kasagar@stericsson.com >
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk >
2009-10-05 17:55:55 +01:00
Uwe Kleine-König
e6a0a8bfef
spi-imx: strip down chipselect function to only drive the chipselect
...
spi_imx_chipselect() made things that should be (and mostly are) done by
spi_imx_setupxfer. Only setting the tx and rx functions was missing.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Acked-by: Sascha Hauer <s.hauer@pengutronix.de >
Cc: David Brownell <dbrownell@users.sourceforge.net >
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-10-01 16:11:17 -07:00
Uwe Kleine-König
d1c627b59c
spi-imx: initialize complete config struct
...
Otherwise the config function uses random data from the stack. This
didn't stick out because config is called once more in the chipselect
function with correct parameters.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Acked-by: Sascha Hauer <s.hauer@pengutronix.de >
Cc: David Brownell <dbrownell@users.sourceforge.net >
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-10-01 16:11:17 -07:00
Uwe Kleine-König
4388eb1135
spi-imx: no need to assert bits_per_word being initialized
...
spi_imx_setup() is only called by spi_setup(). The latter does the
initialization already.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Acked-by: Sascha Hauer <s.hauer@pengutronix.de >
Cc: David Brownell <dbrownell@users.sourceforge.net >
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-10-01 16:11:16 -07:00
Sascha Hauer
3910f2cff9
spi-imx: setup mode_bits we can handle
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de >
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Cc: David Brownell <dbrownell@users.sourceforge.net >
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-10-01 16:11:16 -07:00
Sascha Hauer
6c23e5d433
spi-imx: fix initial chipselect settings
...
We can only setup the gpio pins in spi_setup time when we know the
SPI_CS_HIGH setting.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de >
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Cc: David Brownell <dbrownell@users.sourceforge.net >
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-10-01 16:11:16 -07:00
Sascha Hauer
462d26b5d2
spi-imx: update state correctly
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de >
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Cc: David Brownell <dbrownell@users.sourceforge.net >
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-10-01 16:11:16 -07:00
Uwe Kleine-König
6cdeb00218
spi-imx: rename source file to spi_imx.c
...
This makes the filename match the Kconfig symbol and the driver name.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Cc: Sascha Hauer <s.hauer@pengutronix.de >
Cc: David Brownell <dbrownell@users.sourceforge.net >
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-10-01 16:11:16 -07:00
Alexey Dobriyan
828c09509b
const: constify remaining file_operations
...
[akpm@linux-foundation.org: fix KVM]
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01 16:11:11 -07:00
Russell King
baea7b946f
Merge branch 'origin' into for-linus
...
Conflicts:
MAINTAINERS
2009-09-24 21:22:33 +01:00
David Brownell
568d0697f4
spi: handle TX-only/RX-only
...
Support two new half-duplex SPI implementation restrictions, for links
that talk to TX-only or RX-only devices. (Existing half-duplex flavors
support both transfer directions, just not at the same time.)
Move spi_async() into the spi.c core, and stop inlining it. Then make
that function perform error checks and reject messages that demand more
than the underlying controller can support.
Based on a patch from Marek Szyprowski which did this only for the
bitbanged GPIO driver.
Cc: Marek Szyprowski <m.szyprowski@samsung.com >
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:44 -07:00
Syed Rafiuddin
7869c0b9ed
spi: McSPI support for OMAP4
...
tAdd adds McSPI support for OMAP4430 SDP platform. All the base addresses
are changed between OMAP1/2/3 and OMAP4. The fields of the resource
structures are filled at runtime to have McSPI support on OMAP4.
Signed-off-by: Syed Rafiuddin <rafiuddin.syed@ti.com >
Acked-by: Kevin Hilman <khilman@deeprootsystems.com >
Acked-by: Tony Lindgren <tony@atomide.com >
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com >
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:44 -07:00
Tero Kristo
89c05372d0
spi: McSPI saves CHCONFx too
...
Previous restore was lazy and only restored CHxCONF when it was needed by
a specific chip select. This could cause occasional errors on an SPI bus
where multiple chip selects are in use.
Signed-off-by: Tero Kristo <tero.kristo@nokia.com >
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com >
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:44 -07:00
Hemanth V
a41ae1ad90
spi: McSPI off-mode support
...
Add context save/restore feature to McSPI driver.
Signed-off-by: Hemanth V <hemanthv@ti.com >
Reviewed-by: Aaro Koskinen <Aaro.Koskinen@nokia.com >
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com >
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:44 -07:00
dmitry pervushin
0644c48672
spi: Freescale STMP driver
...
Add SPI driver for Freescale STMP 3xxx-based boards
[dbrownell@users.sourceforge.net: cleanup sequence, spi_unregister_master]
Signed-off-by: dmitry pervushin <dpervushin@embeddedalley.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Kumar Gala <galak@gate.crashing.org>
Cc: Timur Tabi <timur@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23 07:39:44 -07:00
Ben Dooks
570327d9f4
spi_s3c24xx: cache device setup data
...
With the update to the spi_bitbang driver, the transfer setup code is
being called more often, and thus is often re-doing calculations that have
been done before. The SPI layer allows our driver to add its own data to
each device so add a result cache to each device.
This should also remove the problem where we where directly setting up
registers in the setup call which meant we might overwrite the state of an
extant transfer.,
Signed-off-by: Ben Dooks <ben@simtec.co.uk >
Cc: David Brownell <david-b@pacbell.net >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:44 -07:00
Ben Dooks
6d61320707
spi_s3c24xx: use dev_pm_ops
...
Change the spi_s3c24xx driver to use dev_pm_ops to avoid the following
warning during probe:
Platform driver 's3c2410-spi' needs updating - please use dev_pm_ops
Signed-off-by: Ben Dooks <ben@simtec.co.uk >
Cc: David Brownell <david-b@pacbell.net >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:44 -07:00
Ben Dooks
b5e3afb5e3
spi_s3c24xx: use resource_size() to get resource size
...
Change the use of (res->end - res->start) to use resource_size() to
get the size of the resource.
Signed-off-by; Ben Dooks <ben@simtec.co.uk >
Cc: David Brownell <david-b@pacbell.net >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:44 -07:00
Ben Dooks
1a0c220f79
spi_s3c24xx: fix header includes
...
The driver includes <asm/io.h> where it should be including <linux/io.h>
and also includes <mach/hardware.h> and <asm/dma.h> without using anything
from these.
Signed-off-by: Ben Dooks <ben@simtec.co.uk >
Cc: David Brownell <david-b@pacbell.net >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:44 -07:00
Antonio Ospite
5b61a749e8
pxa2xx_spi: register earlier
...
Register pxa2xx_spi earlier so it can be used with cpufreq
Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com >
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com >
Cc: David Brownell <dbrownell@users.sourceforge.net >
Cc: Eric Miao <eric.y.miao@gmail.com >
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com >
Cc: Daniel Ribeiro <drwyrm@gmail.com >
Cc: Samuel Ortiz <sameo@linux.intel.com >
Cc: Liam Girdwood <lrg@slimlogic.co.uk >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:43 -07:00
Anton Vorontsov
e0626e3844
spi: prefix modalias with "spi:"
...
This makes it consistent with other buses (platform, i2c, vio, ...). I'm
not sure why we use the prefixes, but there must be a reason.
This was easy enough to do it, and I did it.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com >
Cc: David Brownell <dbrownell@users.sourceforge.net >
Cc: David Woodhouse <dwmw2@infradead.org >
Cc: Grant Likely <grant.likely@secretlab.ca >
Cc: Jean Delvare <khali@linux-fr.org >
Cc: Ben Dooks <ben-linux@fluff.org >
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org >
Cc: Dmitry Torokhov <dtor@mail.ru >
Cc: Samuel Ortiz <sameo@openedhand.com >
Cc: "John W. Linville" <linville@tuxdriver.com >
Acked-by: Mike Frysinger <vapier.adi@gmail.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:43 -07:00
Anton Vorontsov
75368bf6c2
spi: add support for device table matching
...
With this patch spi drivers can use standard spi_driver.id_table and
MODULE_DEVICE_TABLE() mechanisms to bind against the devices. Just like
we do with I2C drivers.
This is useful when a single driver supports several variants of devices
but it is not possible to detect them in run-time (like non-JEDEC chips
probing in drivers/mtd/devices/m25p80.c), and when platform_data usage is
overkill.
This patch also makes life a lot easier on OpenFirmware platforms, since
with OF we extensively use proper device IDs in modaliases.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com >
Cc: David Brownell <dbrownell@users.sourceforge.net >
Cc: David Woodhouse <dwmw2@infradead.org >
Cc: Grant Likely <grant.likely@secretlab.ca >
Cc: Jean Delvare <khali@linux-fr.org >
Cc: Ben Dooks <ben-linux@fluff.org >
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:43 -07:00
Sascha Hauer
b5f3294f0b
spi: add SPI driver for most known i.MX SoCs
...
This driver has been tested on i.MX1/i.MX27/i.MX35 with an AT25 type
EEPROM and on i.MX27/i.MX31 with a Freescale MC13783 PMIC.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de >
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de >
Acked-by: David Brownell <david-b@pacbell.net >
Cc: Andrea Paterniani <a.paterniani@swapp-eng.it >
Cc: Russell King <rmk@arm.linux.org.uk >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:43 -07:00