Commit Graph

300277 Commits (7a7913f11ddf932e20d2bde72bec57f2f7a9b49e)

Author SHA1 Message Date
Lars-Peter Clausen 7a7913f11d iio: Add dev_to_iio_dev() helper function
This patch adds a helper function for retriving a iio_dev struct from a device
struct. Currently we open-code this in two different ways. One is using
dev_get_drvdata on the device and the other is using container_of. The new
helper function uses the container_of solution as it creates slightly smaller
code and also will eventually free up the drvdata pointer for usage by invidual
drivers.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:34:31 -07:00
Justin P. Mattock 7086e6e5ba staging: "rts5139" Fix typos.
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:31:09 -07:00
Larry Finger 1d73fad833 staging: r8712u: Remove needless test for NULL
In commit ee6aeff, a swatch warning was fixed by moving some code inside
an if block that is executed only when the pointer padapter is not NULL.
In fact, padapter can never be NULL and the corect fix should have been
the removal of the test of padapter.

Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:27:24 -07:00
Lars-Peter Clausen 5d4172cd63 staging:iio:dummy: Remove outdated comment
iio_device_free has to be called regardless of whether the device has been
registered or not when freeing it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:26:44 -07:00
Maxime Ripard 7cb2e629a2 ARM: AT91: Add ADC driver to the at91sam9g20 dtsi
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:25:34 -07:00
Maxime Ripard d029f371b1 ARM: AT91: Add ADC driver to the at91sam9x5 dtsi
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:25:33 -07:00
Maxime Ripard 93b298bad5 ARM: AT91: Add ADC driver to the at91sam9g45 dtsi
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:25:33 -07:00
Maxime Ripard e364185f3e IIO: AT91: Add DT support to at91_adc driver
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:25:33 -07:00
Maxime Ripard 5d449e4b2f ARM: AT91: Add the ADC clock to the sam9x5 SoC file
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:25:33 -07:00
Maxime Ripard 4a5920e848 ARM: AT91: ADC: Add support for the AT91SAM9M10G45-EK board
This patch adds platform data for the AT91 ADC driver support for
the AT91SAM9M10G45-EK board.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:25:33 -07:00
Maxime Ripard 67b5d7b3e2 ARM: AT91: Add the ADC to the sam9g20ek board
This patch adds platform data for the AT91 ADC driver support for
the AT91SAM9G20-EK board.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:25:33 -07:00
Maxime Ripard 0e589d5fb3 ARM: AT91: IIO: Add AT91 ADC driver.
Add the ADC driver for Atmel's AT91SAM9G20-EK, AT91SAM9M10G45-EK
and AT91SAM9X5 family boards.

It has support for both software and hardware triggers.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:24:09 -07:00
Maxime Ripard aaeb6dfff0 ARM: AT91: Add platform data for the AT91 ADCs
The AT91 SoCs often embeds an ADC. This patch adds the needed
platform data to specify the informations required by the driver
to work properly.

For now, we only need the reference voltage and which channels
are available on the board.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:17:49 -07:00
Michael Hennerich e71d42e03c iio: amplifiers: New driver for AD8366 Dual-Digital Variable Gain Amplifier
Changes since V1:

Apply review feedback:
	Introduce and use IIO_CHAN_INFO_HARDWAREGAIN
	Introduce and use Use IIO_VAL_INT_PLUS_MICRO_DB

Modify out of staging include paths.
Convert to new iio core API naming.

Changes since V2:

more sanity checking in write_raw

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:15:39 -07:00
Michael Hennerich b65d62122f iio: core: introduce IIO_CHAN_INFO_HARDWAREGAIN
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:15:39 -07:00
Michael Hennerich 67eedba39e iio: core: introduce dB scle: IIO_VAL_INT_PLUS_MICRO_DB
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:15:38 -07:00
Dan Magenheimer 49b81a3c74 ramster: switch over to zsmalloc and crypto interface
RAMster does many zcache-like things.  In order to avoid major
merge conflicts at 3.4, ramster used lzo1x directly for compression
and retained a local copy of xvmalloc, while zcache moved to the
new zsmalloc allocator and the crypto API.

This patch moves ramster forward to use zsmalloc and crypto.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:02:49 -07:00
Johannes Thumshirn c15974ef1f staging: line6/config.h: Remove CHECKPOINT macro
Kill unused debugging macro CHECKPOINT

Signed-off-by: Johannes Thumshirn <morbidrsa@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:01:44 -07:00
H Hartley Sweeten fb60367d5d staging: comedi: register sysfs device attributes with driver core
Currently the sysfs device attributes are created by the comedi
core after each comedi device is created. This can lead to a race
condition where userspace gets an add event before the files are
created.

Register the device attributes with the comedi class so that the
driver core handles creating them and we avoid the race.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:00:55 -07:00
Anton Vorontsov d3b4876951 staging: android: persistent_ram: Introduce persistent_ram_free()
A corresponding function to persistent_ram_new().

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 08:56:05 -07:00
Anton Vorontsov 24c3d2f342 staging: android: persistent_ram: Make it possible to use memory outside of bootmem
This includes devices' memory (e.g. framebuffers or memory mapped
EEPROMs on a local bus), as well as the normal RAM that we don't use
for the main memory.

For the normal (but unused) ram we could use kmaps, but this assumes
highmem support, so we don't bother and just use the memory via
ioremap.

As a side effect, the following hack is possible: when used together
with pstore_ram (new ramoops) module, we can limit the normal RAM region
with mem= and then point ramoops to use the rest of the memory, e.g.

	mem=128M ramoops.mem_address=0x8000000

Sure, we could just reserve the region with memblock_reserve() early in
the arch/ code, and then register a pstore_ram platform device pointing
to the reserved region. It's still a viable option if platform wants
to do so.

Also, we might want to use IO accessors in case of a real device,
but for now we don't bother (the old ramoops wasn't using it either, so
at least we don't make things worse).

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 08:56:05 -07:00
Anton Vorontsov 2b1321e471 staging: android: persistent_ram: Introduce persistent_ram_vmap()
Factor out vmap logic out of persistent_ram_buffer_map(), this will
make the code a bit more understandable when we'll add support for
non-bootmem memory.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 08:56:05 -07:00
Anton Vorontsov 8cf5aff89e staging: android: persistent_ram: Introduce persistent_ram_new()
The routine just creates a persistent ram zone at a specified address.

For persistent_ram_init_ringbuffer() we'd need to add a
'struct persistent_ram' to the global list, and associate it with a
device. We don't need all this complexity in pstore_ram, so we introduce
the simple function.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 08:56:05 -07:00
Anton Vorontsov bb4206f204 staging: android: persistent_ram: Introduce persistent_ram_post_init()
Factor post init logic out of __persistent_ram_init(), we'll need
it for the new persistent_ram_new() routine.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 08:56:04 -07:00
Anton Vorontsov 484dd30e01 persistent_ram: Fix buffer size clamping during writes
This is a longstanding bug, almost unnoticeable when calling
persistent_ram_write() for small buffers.

But when called for large data buffers, the write routine behaves
incorrectly, as the size may never update: instead of clamping
the size to the maximum buffer size, buffer_size_add_clamp() returns
an error (which is never checked by the write routine, btw).

To fix this, we now use buffer_size_add() that actually clamps the
size to the max value.

Also remove buffer_size_add_clamp(), it is no longer needed.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Colin Cross <ccross@android.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 08:54:23 -07:00
Anton Vorontsov 06f3d3bdee persistent_ram: Remove prz->node
The 'node' struct member is unused, so remove it.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 08:54:23 -07:00
Tim Bird e7f3eb0c91 staging: android: logger: Fix some sparse and whitespace issues
Fix a few sparse warnings, and improve whitespace.

Cc: Brian Swetland <swetland@google.com>
Signed-off-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 15:47:01 -07:00
Tim Bird 10b241991f staging: android: logger: Allocate logs dynamically at boot (v3)
This changes the log initialization to be dynamic, but still
at boot time.  These changes are a predecessor to implementing
runtime allocation and freeing of logs, to make the Android logger
less hard-coded.

Change from a fixed set of static log structures, to allocation
at init time into a list.  Return proper error numbers on log
allocation failure.

Cc: Brian Swetland <swetland@google.com>
Signed-off-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 15:40:56 -07:00
Paul Gortmaker 9a0fbbb52a staging: delete all duplicated endian crap from rtl8712 driver
This driver had headers like big_endian.h, little_endian.h, swab.h
and yet we can throw them all in the trash can and the thing
still builds on x86-64 and ppc, just by deleting the references
to the deleted files.

Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2012-05-10 13:10:03 -04:00
Paul Gortmaker 2046782524 staging: wean rtl8712 off of its ancient duplicate of ip.h
This driver should not be carrying around ancient copies of
headers like <linux/ip.h> for its own use.  Mapping it onto
the mainline one uncovers no build issues.

Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2012-05-10 13:09:57 -04:00
Paul Gortmaker be9a12040f staging: wean rtl8712 off of its ancient duplicate of if_ether.h
This driver should not be carrying around ancient copies of
headers like <linux/if_ether.h> for its own use.  Mapping it
onto the mainline one uncovers no build issues.

Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2012-05-10 13:09:35 -04:00
Oleksij Rempel 0e545f6d16 staging: rts5139: remove unused variable option.ww_enable
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:21 -07:00
Oleksij Rempel 39d65739be staging: rts5139: remove unused variable in rts51x_chip.h
the SENSE_TYPE_FORMAT_IN_PROGRESS was checked by rts51x_scsi.c
but never set.

Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:21 -07:00
Oleksij Rempel c76dde55f1 staging: rts5139: remove unused variable in rts51x.h
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:21 -07:00
Oleksij Rempel 0ed226100a staging: rts5139: remove unused TUNE_SD18_*
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:20 -07:00
Oleksij Rempel 19434aa179 staging: rts5139: remove unused polling_time variable
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:20 -07:00
Oleksij Rempel 711c273c07 staging: rts5139: remove unused rcc_bug_fix_en
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:20 -07:00
Oleksij Rempel 205fefe32e staging: rts5139: remove unused rcc_fail_flag variable
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:20 -07:00
Oleksij Rempel a61a85b11b staging: rts5139: remove unused option->needs_remote_wakeup
module parametr needs_remote_wakeup sets
option->needs_remote_wakeup and
rts51x->pusb_intf->needs_remote_wakeup

the second may be used, the first one is never used

Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:19 -07:00
Oleksij Rempel ecfbe1dc96 staging: rts5139: remove unused led_blink_speed variable
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:19 -07:00
Oleksij Rempel 9002ebc2e8 staging: rts5139: remove disabled code in rts51x_card.c
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:19 -07:00
Oleksij Rempel 8ce9002e0b staging: rts5139: make some functions static in ms.c and ms_mg.c
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:19 -07:00
Oleksij Rempel 29b1169876 staging: rts5139: remove unused xd_check_err_code in xd.c
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:18 -07:00
Oleksij Rempel 1db67664dc staging: rts5139: make some functions static in xd.c
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:18 -07:00
Oleksij Rempel b9914e7d86 staging: rts5139: make some functions static in sd_cprm.c
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:18 -07:00
Oleksij Rempel 6b75717994 staging: rts5139: make some functions static in sd.*
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:18 -07:00
Oleksij Rempel 2ff4ff54a1 staging: rts5139: remove soft_reset_sd_card in sd_cprm.c
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:17 -07:00
Oleksij Rempel 231a1a25eb staging: rts5139: remove unused rts51x_reset_pipe in rts51x_transport.*
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:17 -07:00
Oleksij Rempel 5085d12749 staging: rts5139: make some functions static in rts51x_transport.*
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:17 -07:00
Oleksij Rempel 12ed793e35 staging: rts5139: remove unsued *host_info in rts51x_scsi.c
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10 09:57:16 -07:00