dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

37 Commits

Author SHA1 Message Date
Mark Brown 0848c94fb4 mfd: core: Push irqdomain mapping out into devices
Currently the MFD core supports remapping MFD cell interrupts using an
irqdomain but only if the MFD is being instantiated using device tree
and only if the device tree bindings use the pattern of registering IPs
in the device tree with compatible properties.  This will be actively
harmful for drivers which support non-DT platforms and use this pattern
for their DT bindings as it will mean that the core will silently change
remapping behaviour and it is also limiting for drivers which don't do
DT with this particular pattern.  There is also a potential fragility if
there are interrupts not associated with MFD cells and all the cells are
omitted from the device tree for some reason.

Instead change the code to take an IRQ domain as an optional argument,
allowing drivers to take the decision about the parent domain for their
interrupts.  The one current user of this feature is ab8500-core, it has
the domain lookup pushed out into the driver.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-09-15 23:22:04 +02:00
Linus Torvalds b13bc8dda8 Staging tree patches for 3.6-rc1
Here's the big staging tree merge for the 3.6-rc1 merge window.
 
 There are some patches in here outside of drivers/staging/, notibly the iio
 code (which is still stradeling the staging / not staging boundry), the pstore
 code, and the tracing code.  All of these have gotten ackes from the various
 subsystem maintainers to be included in this tree.  The pstore and tracing
 patches are related, and are coming here as they replace one of the android
 staging drivers.
 
 Otherwise, the normal staging mess.  Lots of cleanups and a few new drivers
 (some iio drivers, and the large csr wireless driver abomination.)
 
 Note, you will get a merge issue with the following files:
 	drivers/staging/comedi/drivers/s626.h
 	drivers/staging/gdm72xx/netlink_k.c
 both of which should be trivial for you to handle.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iEYEABECAAYFAlAQiD8ACgkQMUfUDdst+ykxhgCeMUjvc+1RTtSprzvkzpejgoUU
 6A4AnAleWMnkaCD8vruGnRdGl/Qtz51+
 =mN6M
 -----END PGP SIGNATURE-----

Merge tag 'staging-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging tree patches from Greg Kroah-Hartman:
 "Here's the big staging tree merge for the 3.6-rc1 merge window.

  There are some patches in here outside of drivers/staging/, notibly
  the iio code (which is still stradeling the staging / not staging
  boundry), the pstore code, and the tracing code.  All of these have
  gotten acks from the various subsystem maintainers to be included in
  this tree.  The pstore and tracing patches are related, and are coming
  here as they replace one of the android staging drivers.

  Otherwise, the normal staging mess.  Lots of cleanups and a few new
  drivers (some iio drivers, and the large csr wireless driver
  abomination.)

  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

Fixed up trivial conflicts in drivers/staging/comedi/drivers/s626.h and
drivers/staging/gdm72xx/netlink_k.c

* tag 'staging-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1108 commits)
  staging: csr: delete a bunch of unused library functions
  staging: csr: remove csr_utf16.c
  staging: csr: remove csr_pmem.h
  staging: csr: remove CsrPmemAlloc
  staging: csr: remove CsrPmemFree()
  staging: csr: remove CsrMemAllocDma()
  staging: csr: remove CsrMemCalloc()
  staging: csr: remove CsrMemAlloc()
  staging: csr: remove CsrMemFree() and CsrMemFreeDma()
  staging: csr: remove csr_util.h
  staging: csr: remove CsrOffSetOf()
  stating: csr: remove unneeded #includes in csr_util.c
  staging: csr: make CsrUInt16ToHex static
  staging: csr: remove CsrMemCpy()
  staging: csr: remove CsrStrLen()
  staging: csr: remove CsrVsnprintf()
  staging: csr: remove CsrStrDup
  staging: csr: remove CsrStrChr()
  staging: csr: remove CsrStrNCmp
  staging: csr: remove CsrStrCmp
  ...
2012-07-26 11:14:49 -07:00
Marc Dietrich ac56268057 staging: nvec: rename led driver to board specific paz00 driver
The led driver used OEM commands which are not part of the nvec protocol
definition. Therefore it is renamed to nvec_paz00 to reflect that it only
applies to PAZ00 board based devices.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-25 10:55:38 -07:00
Marc Dietrich ebefae28ce staging: nvec: cleanup powermanagement callbacks
Simplify powermanagement initialization by using pm_ops macro.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-25 10:55:37 -07:00
Marc Dietrich 9891b1ce62 staging: nvec: cleanup driver registration
This patch simplifies code by using the module_platform_driver
macro.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-25 10:55:37 -07:00
Marc Dietrich 50d4656a23 staging: nvec: use dev_warn instead of printk
Replace a printk in nvec core driver with dev_warn.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-25 10:55:37 -07:00
Marc Dietrich f5e3352e51 staging: nvec: convert to devm_ functions
This patch cleanups the nvec and its childs by replacing calls to
resource allocations by their devm_* equivalents.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-25 10:55:37 -07:00
Prashant Gaikwad 61c3b1971a staging: nvec: add clk_prepare/clk_unprepare
Use clk_prepare/clk_unprepare as required by the generic clk framework.

Cc: gregkh@linuxfoundation.org
Cc: ac100@lists.launchpad.net
Cc: devel@driverdev.osuosl.org
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Marc Dietrich <marvin24@gmx.de>
2012-06-12 10:32:55 -06:00
Julian Andres Klode aed92bbcf4 staging: nvec: Use gpio_request_one() instead of gpio_request()
This saves us some calls and thus makes the code shorter
and nicer.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-31 10:27:59 -08:00
Julian Andres Klode d3f862aec4 staging: nvec: Fix typo s/I2C_SL_NEWL/I2C_SL_NEWSL/
The constant I2C_SL_NEWL meant "new slave", but the
S was missing.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-31 10:27:59 -08:00
Marc Dietrich 7990b0d7ec staging: nvec: add device tree support
This adds device tree support to the nvec driver. By using this method
it is no longer necessary to specify platform data through a board
file.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Acked-by: Stephen Warren <swarren@nvidia.com>
Cc: Julian Andres Klode <jak@jak-linux.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:17:14 -08:00
Marc Dietrich 3b769edd58 staging/nvec: fix compilation error in nvec.c
This fixes a compilation error in nvec.c due to the missing module.h include.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Cc: Julian Andres Klode <jak@jak-linux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-17 15:24:11 -07:00
Marc Dietrich 9feeb0147f staging: nvec: send suspend messages synchronously
The suspend commands need to be sent using the
synchronous method, otherwise the power gets
disabled before the messages are transferred.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
[jak@jak-linux.org: Rewrote commit message]
Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:40 -07:00
Julian Andres Klode de839b8f06 staging: nvec: Add a udelay(100) to nvec_interrupt
As the comment indicates, adding that udelay seems to
improve the stability of the communication, although
it is not known why this is the case.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:39 -07:00
Julian Andres Klode 12b5a55d72 staging: nvec: Add missing includes and reorder them
Add the includes that are currently missing in nvec.h
and nvec.c and reorder them alphabetically.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:39 -07:00
Julian Andres Klode d6bdcf2e10 staging: nvec: Add battery quirk to ignore incomplete responses
The nvec_power system polls nvec for battery information. In some
cases, that part seems to be overloaded and unable to respond
fast in which case it sends an incomplete response. We need to
mark the transfer as completed, though, in order to prevent
endless retries which can kill nvec.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:38 -07:00
Julian Andres Klode 210ceb4f68 staging: nvec: Reject incomplete messages
Reject incomplete messages, causing the request to be
transmitted again. This should fix various problems
out there.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:37 -07:00
Julian Andres Klode 8da7986343 staging: nvec: Handle filled up RX buffers
If no RX buffer is available in state 1, jump to state
0 again. This will produce an incredible amount of
warnings, but it is not supposed to happen anyway.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:37 -07:00
Julian Andres Klode bb0590e272 staging: nvec: Allow TX buffers only in the upper 75% of the pool
Allow TX buffers to be allocated only in the upper 75% of the pool
to avoid a completely filled buffer preventing the driver from
processing responses. This also improves performance, as RX
allocations do not require checking buffers allocated for TX
unless there are more than 16 incoming messages -- which is
highly unlikely.

An earlier version used the lower 75% for TX messages, but
that was considered to be not that effective due to the
overlaps of RX and TX buffers mentioned above.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:36 -07:00
Julian Andres Klode 198dd26714 staging: nvec: Export nvec_msg_free() to clients
Client code wishing to make use of nvec_write_sync() must
have a way to free the returned pointer, otherwise we run
out of poool memory fairly soon.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:36 -07:00
Julian Andres Klode 391d2fa95c staging: nvec: Move implementation-only macros out of the header
Those macros are needed only for implementation purposes and
do not have any use for other code wishing to use nvec.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:36 -07:00
Julian Andres Klode bdf034d986 staging: nvec: Document public and private API
Add kernel-doc comments describing the functions
and structs we currently have.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:35 -07:00
Julian Andres Klode 1b9bf629ea staging: nvec: Have nvec_write_async() return -ENOMEM on OOM
Change nvec_write_async() to return an integer, 0 by default,
a negative error on failure. Change nvec_write_sync() to
check the return value and abort if it is negative.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:35 -07:00
Julian Andres Klode 791c4a6427 staging: nvec: Add myself to copyright and authors list
Forgotten in the last commit(s) which contained the copyrightable
material, so let's add it now. I believe that only my nvec.c
contributions are copyrightable, nvec.h is just interface naming,
so does not deserve that yet.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:34 -07:00
Julian Andres Klode 7b77065793 staging: nvec: Do not print free message for tx_scratch
The scratch area is not part of the pool and thus gets
no allocation message. Printing a free message would
be confusing, and the pointer subtraction would be
undefined behavior.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:33 -07:00
Julian Andres Klode 0cab4cb852 staging: nvec: Rewrite the interrupt handler
Rewrite the interrupt handler to use a state machine similar to
that found in the various kernels for the Advent Vega. This also
changes the code to use the new functions introduced in the
previous commits.

This also merges the rewrite sent in August 2011 by Marc
Dietrich, and thus also includes code by him. His original
patch can be found on the mailing list.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:33 -07:00
Julian Andres Klode 8517e879e0 staging: nvec: Add is_event() and size() functions for nvec_msg
Add functions nvec_msg_is_event() and nvec_msg_size() which
do just what the say: tell whether the message is an event,
and getting the size of the message.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:33 -07:00
Julian Andres Klode e7c40851fd staging: nvec: Introduce nvec_gpio_set_value()
Introduce nvec_gpio_set_value(), which works like
gpio_set_value(), but also creates a debugging
message, if that's enabled.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:32 -07:00
Julian Andres Klode 0b1076c4b2 staging: nvec: Introduce new internal API for msg alloc/free
Introduce two new functions nvec_msg_alloc() and nvec_msg_free()
that allocate and free message buffers from the internal pool
of messages.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:40:40 -07:00
Ilya Petrov 97cc26576f staging: nvec: add LED support
This patch adds support for LEDs connect to a nvec. A single brightness
property is exported to sysfs. LEDs are selected via bitfields in the
brightness value. Also the blinking behavior is selected through this
method. Vendors may use different values for different HW designs.

Signed-off-by: Ilya Petrov <ilya.muromec@gmail.com>
Signed-off-by: Marc Dietrich <marvin24@gmx.de>
[jak@jak-linux.org: Fixed checkpatch warnings]
Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:40:38 -07:00
Marc Dietrich 6dca320c8f staging: nvec: fix unmute of speakers
The ec command used was for muting, not unmuting.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:40:38 -07:00
Marc Dietrich ac8107599e staging: nvec: rework the nvec slave init
Rework the tegra slave controller init to look more like in
tegra-i2c.c. This makes the nvec init reliable. Also add de-init of
the slave to be used during suspend.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:40:38 -07:00
Marc Dietrich a3a9aa1a41 staging: nvec: Use print_hex_dump() where appropriate
Split of the previous patch and the next by Marc, as that
patch is not strictly a coding style fix only.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:40:37 -07:00
Marc Dietrich 162c7d8c4b staging: nvec: coding style fixes / add copyright notice
This patch fixes coding style and adds copyright notices.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
[jak@jak-linux.org: Merge later cleanup into that patch]
Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:40:37 -07:00
Marc Dietrich f686e9affb staging: nvec: convert to use platform register and mfdcells
This patch converts the nvec to use mfd cells and improves the
registration of the platform driver. The child drivers are also
converted to use mfd cells and platform registration.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-24 14:25:30 -07:00
Vitaliy Ivanov e44ba033c5 treewide: remove duplicate includes
Many stupid corrections of duplicated includes based on the output of
scripts/checkincludes.pl.

Signed-off-by: Vitaliy Ivanov <vitalivanov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-20 16:08:19 +02:00
Marc Dietrich 32890b9830 Staging: initial version of the nvec driver
This is an implementation of a NVidia compliant embedded controller
protocol driver. It is used on some ARM-Tegra boards for device
communication.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 15:36:10 -07:00