Commit Graph

361004 Commits

Author SHA1 Message Date
Jonathan Cameron 40dd676d8f iio:adc:ad7298 move to info_mask_(shared_by_type/separate)
The original info_mask is going away in favour of the broken out versions.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17 19:49:28 +00:00
Jonathan Cameron 3234ac7e6a iio:adc:ad7266 move to info_mask_(shared_by_type/separate)
The original info_mask is going away in favour of the broken out versions.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17 19:49:28 +00:00
Jonathan Cameron ea0c680063 iio:adc:ad_sigma_delta move to info_mask_(shared_by_type/separate)
The original info_mask is going away in favour of the broken out versions.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17 19:49:24 +00:00
Jonathan Cameron 5ea864940e iio:st_sensors move to info_mask_(shared_by_type/separate)
The original info_mask is going away in favour of the broken out versions.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
2013-03-17 19:49:23 +00:00
Jonathan Cameron 2f6bb53480 iio:accel:kxsd9 move to info_mask_(shared_by_type/separate)
The original info_mask is going away in favour of the broken out versions.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-17 19:49:21 +00:00
Jonathan Cameron ecbe18f2c3 iio:hid_sensors move to info_mask_(shared_by_type/separate)
The original info_mask is going away in favour of the broken out versions.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-17 19:49:18 +00:00
Jonathan Cameron fa357a6a48 staging:iio:dummy move to info_mask_(shared_by_type/separate)
The original info_mask is going away in favour of the broken out versions.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17 19:49:15 +00:00
Jonathan Cameron f6e52e59c8 iio:adc:max1363 move to info_mask_(shared_by_type/separate)
The original info_mask is going away in favour of the broken out versions.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-17 19:49:13 +00:00
Jonathan Cameron 8655cc490e iio: Add broken out info_mask fields for shared_by_type and separate
This simplifies the code, removes an extensive layer of 'helper' macros
and gives us twice as much room to play with in these masks before we
have any need to be clever.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17 19:49:09 +00:00
Naveen Krishna Chatradhi 10f5b14811 iio: adc: add exynos adc driver under iio framwork
This patch adds New driver to support:
1. Supports ADC IF found on EXYNOS4412/EXYNOS5250
   and future SoCs from Samsung
2. Add ADC driver under iio/adc framework
3. Also adds the Documentation for device tree bindings

Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-16 10:18:15 +00:00
Denis Ciocca 43bb786ad2 iio:common: Use spi_sync_transfer() in STMicroelectronics common library
Use the new spi_sync_transfer() helper function instead of open-coding it.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-16 10:18:10 +00:00
Christophe Leroy 0eac259db2 IIO ADC support for AD7923
This patch adds support for Analog Devices AD7923 ADC in the IIO Subsystem.

Signed-off-by: Patrick Vasseur <patrick.vasseur@c-s.fr>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-16 10:18:05 +00:00
Guenter Roeck 17d82b47a2 iio: Add OF support
Provide bindings and parse OF data during initialization.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-16 10:17:59 +00:00
Lars-Peter Clausen cddc1424f3 staging:iio: Remove adt7410 driver
The adt7410 hwmon driver is feature wise more or less on par with the IIO
driver. So we can finally remove the IIO driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-16 10:17:57 +00:00
Ian Abbott a145928960 staging: comedi: ni_labpc: fix common detach
`labpc_common_detach()` calls `comedi_pci_disable()` unconditionally.
That's okay for PCI devices and harmless for ISA devices (as the
`hw_dev` member will be NULL so `comedi_to_pci_dev()` will return NULL
and `comedi_pci_disable()` checks for that), but it is disastrous for
PCMCIA devices.  Those are managed by the "ni_labpc_cs" module but it
calls this `labpc_common_detach()` and the `hw_dev` member will be
pointing to the `struct device` embedded in a `struct pcmcia_device` in
that case.  That's enough to confuse `comedi_pci_disable()` into
thinking it's a valid PCI device to be disabled.

Use the private board information (`thisboard`) to make sure it is a PCI
device before calling `comedi_pci_disable()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:17:21 -07:00
Ian Abbott 84b44d0899 staging: comedi: remove unneeded settings of `dev->iobase`
Some PCI drivers use the "spare" `iobase` member of `struct
comedi_device` as a flag to indicate that the call to
`comedi_pci_enable()` was successful.  This is no longer necessary now
that `comedi_pci_enable()` and `comedi_pci_disable()` use the
`ioenabled` member of `struct comedi_device` themselves to keep track of
what needs to be done.

Remove the unnecessary assignments to the `iobase` member in the
relevant drivers.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:16:31 -07:00
Ian Abbott 00ca688418 staging: comedi: add 'ioenabled' flag to device
Add 1-bit bit-field member `ioenabled` of type `bool` to `struct
comedi_device`.  Use this to keep track of whether a PCI device and its
BARs have been successfully enabled by `comedi_pci_enable()`.  This
avoids overloading the meaning of the `iobase` member which is used by
several drivers to hold the base port I/O address of a board's "main"
registers.  Other drivers using MMIO use `iobase` as a flag to indicate
that the preceding call to `comedi_pci_enable()` was successful.  They
no longer need to do that.

The name `ioenabled` is intended to be PCI-agnostic so it can be used
for similar purposes by non-PCI drivers.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:16:31 -07:00
Ian Abbott 13f12b5aea staging: comedi: make 'in_request_module' a bool bit-field
Change the `in_request_module` member of `struct comedi_device` to a
1-bit bit-field of type `bool` and move it into a suitable hole in the
data type to save a few bytes.  Change the assigned values to `true` and
`false`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:16:31 -07:00
Ian Abbott a7401cddcd staging: comedi: make 'dev->attached' a bool bit-field
Change the `attached` member of `struct comedi_device` to a 1-bit
bit-field of type `bool`.  Change assigned values to `true` and `false`
and replace or remove comparison operations with simple boolean tests.

We'll put some extra bit-fields in the gap later to save space.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:16:31 -07:00
Ian Abbott 8bdfefb784 staging: comedi: ni_660x: support NI PXI-6624
Florent Boudet reports success using a NI PXI-6624 board with a
trivially modified version of the "ni_660x" driver (addition to the PCI
device ID table and comedi board table).  He did this with the
out-of-tree Comedi drivers at www.comedi.org, but it applies equally to
the in-tree "staging" drivers.

He reports the PXI-6624 is basically the same as the PXI-6602, but with
isolated channels and external voltage source.

Add support for NI PXI-6224 to the "ni_660x" driver.

(Maybe the driver should be renamed to "ni_66xx"?)

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: Florent Boudet <flboudet@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:12:25 -07:00
Ian Abbott 71d92face4 staging: comedi: ni_660x: reformat driver description comment
Convert to preferred block comment style.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:12:25 -07:00
Ian Abbott 87f6991ba8 staging: comedi: adv_pci_dio: restore PCI-1753E support
Back in the old days (before "staging") when Comedi only supported
manual configuration of devices, the "adv_pci_dio" driver supported both
PCI-1753 ("pci1753") and PCI-1753E ("pci1753e").  In actual fact,
"pci1753e" is just a PCI-1753 connected by a ribbon cable to a PCI-1753E
expansion card, which is plugged into a PCI slot but is not a PCI device
itself.  Now that the "adv_pci_dio" driver only supports automatic
configuration of devices and the main "comedi" module no longer allows
auto-configuration to be disabled, a PCI-1753 with a PCI-1753E expansion
card is always treated as an unexpanded PCI-1753 ("pci1753") and there
is no way to override it.  (Recently, an undefined macro
`USE_PCI1753E_BOARDINFO` was used to make the driver switch to
supporting "pci1753e" instead of "pci1753", but this is less than
ideal.)

Advantech has their own Linux (non-Comedi) driver for the PCI-1753 which
detects whether the PCI-1753E expansion card is connected to the
PCI-1753 by fiddling with a register at offset 53 from the main
registers base.

Use Advantech's test in our "adv_pci_dio" driver.  If the board appears
to be a PCI-1753 ("pci1753"), check if the expansion card appears to be
present, and if so, treat the device as a PCI-1753 plus PCI-1753E
expansion card ("pci1753e").

Also, get rid of `enum dio_boardid` (`BOARD_...` enum values) which was
added recently and just use the older `TYPE_...` enum values from `enum
hw_cards_id` instead as the mapping is now 1-to-1.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:12:25 -07:00
H Hartley Sweeten 615c902fb8 staging: comedi: ni_atmio: fix build error due to missing '; '
Fix a build error due to a missing ';' at the end of a line.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reported-by: Geert Uytterhoeven <geert.uytterhoeven@gmail.com>
Cc: Kumar Amit Mehta <gmate.amit@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:05:36 -07:00
Dan Carpenter 673f98ccac Staging: dwc2: remove a kfree(NULL)
dwc2_hcd_release() calls dwc2_hcd_free() which frees ->core_params
and sets it to NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:05:36 -07:00
Wei Yongjun 13b47d5f79 staging: sep: fix possible memory leak in sep_prepare_input_dma_table()
'lli_array_ptr' etc. are malloced in sep_prepare_input_dma_table() and should
be freed before leaving from the error handling case, otherwise it will cause
memory leak.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:05:36 -07:00
Eduardo Valentin e72b7bbd17 staging: omap-thermal: add documentation for omap_bandgap_validate
Document the helper to validate a struct omap_bandgap and a sensor id.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:25 -07:00
Eduardo Valentin ff4a44ce32 staging: omap-thermal: remove TODO entry for exposed APIs
Not all APIs exposed today are used. However all unused APIs
will be required once the thermal layer allows IRQ based
policies.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:25 -07:00
Eduardo Valentin 0205b15fa4 staging: omap-thermal: remove TODO entry suggesting regmap usage
It is hard to use regmap because benefit of using regmap cache
may not be applicable as there is a specific sequence to
restore the bandgap context.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:24 -07:00
Eduardo Valentin ebf0bd52e6 staging: omap-thermal: switch mutex to spinlock inside omap-bandgap
Because there is a need to lock inside IRQ handler, this patch
changes the locking mechanism inside the omap-bandgap.[c,h] to
spinlocks. Now this lock is used to protect omap_bandgap struct
during APIs exposed (possibly used in sysfs handling functions)
and inside the ALERT IRQ handler.

Because there are registers shared among the sensors, this lock
is global, not per sensor.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:24 -07:00
Eduardo Valentin 1b46f2a239 staging: omap-thermal: Add a MAINTAINERS entry for TI bandgap and thermal driver
Add myself as maintainer of the TI bandgap and thermal driver.

CC: Santosh Shilimkar <santosh.shilimkar@ti.com>
CC: Zhang Rui <rui.zhang@intel.com>

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:24 -07:00
Eduardo Valentin 494bbdd8b1 staging: omap-thermal: change Kconfig dependency method
Now arch code has to specify CONFIG_ARCH_HAS_BANDGAP. So, this driver
will be selectable only if the platform reports itself as having a
bandgap device.

Any OMAP variant or any other OMAP version needs to
	select ARCH_HAS_BANDGAP
so that the driver will be applicable. A part from that it is
required to device the data structures that maps the registers
and their bitfields. The DT compatible list must also be updated.

CC: Santosh Shilimkar <santosh.shilimkar@ti.com>
CC: Vaibhav Bedia <vaibhav.bedia@ti.com>

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:24 -07:00
Eduardo Valentin e9b6f8c4da staging: omap-thermal: document omap_bandgap_build function
Document function to build omap_bandgap structure

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:24 -07:00
Eduardo Valentin 094b8aca16 staging: omap-thermal: document omap_bandgap_alert_init function
Document function that sets talert handling up.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:24 -07:00
Eduardo Valentin d3790b3ddc staging: omap-thermal: document omap_bandgap_tshut_init function
Add documentation for the function to setup TSHUT handling

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:24 -07:00
Eduardo Valentin 7a681a50ed staging: omap-thermal: document _omap_bandgap_read_threshold function
Add documentation of the function for reading alert thresholds

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:24 -07:00
Eduardo Valentin 9efa93b0e6 staging: omap-thermal: document _omap_bandgap_write_threshold function
Document function to update alert thresholds.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:23 -07:00
Eduardo Valentin 38d99e807b staging: omap-thermal: document omap_bandgap_update_alert_threshold function
Document function to program alert thresholds

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:23 -07:00
Eduardo Valentin 31102a7202 staging: omap-thermal: document omap_bandgap_force_single_read
Document function to initialize the conversion state machine.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:23 -07:00
Eduardo Valentin a84b6f4552 staging: omap-thermal: update omap_bandgap_set_continous_mode documentation
Simple update on function documentation.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:23 -07:00
Eduardo Valentin 37bf871dd0 staging: omap-thermal: rename enable_continuous_mode
This patch names 'enable_continuous_mode' accordingly to the file
standard naming.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:23 -07:00
Eduardo Valentin f91ddfedfd staging: omap-thermal: section of device driver callbacks
Section with platform device callbacks

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:23 -07:00
Eduardo Valentin e195aba425 staging: omap-thermal: device initialization section
Section of helper functions to initilize the bandgap device

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:23 -07:00
Eduardo Valentin 56f132f78e staging: omap-thermal: refactor APIs handling threshold values
This patch improves the code that handles threshold values
by creating single functions that are usable for tcold and
thot. This way we won't have duplicated functionality just
because it is handling different bitfields. Now
the added functions are reused in several places where
it is needed to update any threshold.

This patch also removes macros that are used only inside
the _validate helper function.

In this patch there is also an addition of an extra function
section for Exposed APIs, used outside the omap-bandgap.c,
but inside the omap-thermal driver.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:23 -07:00
Eduardo Valentin f47f6d3164 staging: omap-thermal: update omap_bandgap_unmask_interrupts documentation
Proper document the function to configure the IRQ event masks.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:22 -07:00
Eduardo Valentin 910216890a staging: omap-thermal: refactor temp_sensor_unmask_interrupts
This change improves temp_sensor_unmask_interrupts by:
. renaming it to omap_bandgap_unmask_interrupts
. making it a void function, as there is nothing really to report an error.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:22 -07:00
Eduardo Valentin f8ccce20bf staging: omap-thermal: threshold manipulation section
Section of functions manipulating thresholds for Alert and Shutdown.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:22 -07:00
Eduardo Valentin 8a1cefe857 staging: omap-thermal: document omap_bandgap_add_hyst function
Document function to handle hysteresis.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:22 -07:00
Eduardo Valentin 0f0ed7dee2 staging: omap-thermal: rename add_hyst to omap_bandgap_add_hyst
This patch improves the add_hyst function by:
. Renaming it to omap_bandgap_add_hyst
. Moving it to the ADC conversion functions section
. Changing its signature to follow the driver standard

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:22 -07:00
Eduardo Valentin e7f60b5360 staging: omap-thermal: add documentation for omap_bandgap_mcelsius_to_adc
Document the conversion function.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:22 -07:00
Eduardo Valentin 26a70ed987 staging: omap-thermal: move conv table limits out of sensor data
As we have one conv table per bandgap device and not per sensor,
this patch changes the data structures so that the conv table
min and max values are now part of bandgap_data and not sensor_data.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15 09:02:15 -07:00