Merge tag 'iio-for-3.10b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Second round of IIO cleanups for the 3.10 cycle
1) A nice little removal of the unwanted private pointer from
struct iio_trigger.
2) Some clean up of the ad799x driver.
3) Couple of cleanups for the exynos_adc driver and some documentation.
4) Move the mxs-lradc initialization a little earlier in the driver to avoid
wiping out the configuration just after setting it.
iio: mxs-lradc: Do hardware initialization earlier
We need to initialize hardware before registering the touchscreen. Else,
we end up setting registers in mxs_lradc_ts_open(), getting called just
after registering the touchscreen with input_register_device() and by
the end of mxs_lradc_probe(), we reset the LRADC block hence losing the
correct configuration.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Cc: Fabio Estevam <fabio.estevam@freescale.com>
Avoid allocating and freeing the sample buffer for each transfer. Instead
allocate it once when we start sampling. Also pre-compute the number of bytes we
need to transfer in the same way.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The driver has support for reporting a channels scale, but none of the channels
set the IIO_CHAN_INFO_SCALE mask. Add the IIO_CHAN_INFO_SCALE to all channels to
indicate that the drivers supports reporting the scale.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add a local variable to make this function a bit cleaner and
remove the unnecessary comments.
The comedi core expects this function to return the number of
data parameters used. Change the return from '1' to 'insn->n'
to make this more apparent.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: s626: remove the uint16_t casts of the bit values
There are a number of uint16_t casts used in the #define's of the
constant bit field values as well as the calls to DEBIreplace().
These cause a number of sparse warnings of the type:
warning: cast truncates bits from constant value (ffff1cff becomes 1cff)
Remove all of the casts and change the types of the parameters to
DEBIreplace from uin16_t to unsigned int. This fixes all the warnings.
Mask the addr that is or'ed with DEBI_CMD_RDWORD then written to the
P_DEBICMD register as well as the val written to the P_DEBIAD register
with 0xffff. The addr and val are only 16-bits but the registers are
32-bits.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This macro relies on a local variable having a specific name its
also just a wrapper around a readl() call. Remove the macro and
just call readl() directly.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: s626: remove WR7146 and SETVECT macros
The WR7146 macro relies on a local variable having a specific name.
This macro is a wrapper around a writel() call. Remove the macro and
just call writel() directly.
The SETVEC macro uses the WR7146 macro so remove it as well and just
do the writel() directly.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aaro Koskinen [Wed, 27 Mar 2013 21:53:07 +0000 (23:53 +0200)]
staging: xgifb: eliminate IF_DEF_LVDS checks from vb_init
Inside vb_init, IF_DEF_LVDS tells only if the vbios was succesfully read
on XG21. Rearrange the code so that we don't need to set or care about
this flag.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Joerg Roedel [Wed, 27 Mar 2013 00:43:14 +0000 (01:43 +0100)]
staging: zsmalloc: Fix link error on ARM
Testing the arm chromebook config against the upstream
kernel produces a linker error for the zsmalloc module from
staging. The symbol flush_tlb_kernel_range is not available
there. Fix this by removing the reimplementation of
unmap_kernel_range in the zsmalloc module and using the
function directly. The unmap_kernel_range function is not
usable by modules, so also disallow building the driver as a
module for now.
Andrew Morton [Tue, 26 Mar 2013 21:58:14 +0000 (14:58 -0700)]
drivers/staging/zcache/zcache-main.c: fix build
flush_dcache_page() takes a page*, not a void*. It breaks ia64.
Remove this and another unused function. Warnings remain:
drivers/staging/zcache/zcache-main.c: In function '__check_disable_cleancache':
drivers/staging/zcache/zcache-main.c:1837: warning: return from incompatible pointer type
drivers/staging/zcache/zcache-main.c: In function '__check_disable_frontswap':
drivers/staging/zcache/zcache-main.c:1838: warning: return from incompatible pointer type
drivers/staging/zcache/zcache-main.c: In function '__check_disable_frontswap_ignore_nonactive':
drivers/staging/zcache/zcache-main.c:1842: warning: return from incompatible pointer type
Cc: Dan Magenheimer <dan.magenheimer@oracle.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The comedi core expects the (*insn_write) operations to write insn->n
values and return the number of values actually wrote.
Make this function work like the core expects.
As Ian Abbott pointed out for the eeprom writes, we really only need
to write the last value to the caldac. The preceding data would be
overwritten anyway.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Paul Zimmerman [Tue, 26 Mar 2013 00:03:36 +0000 (17:03 -0700)]
staging: dwc2: fix wrong setting of DMA masks
We were setting the DMA masks in dwc2_driver_probe(), but that is
before the driver parameters have been set to their default values.
That meant the DMA masks could be set wrong. Fix it by moving the
DMA mask setting into dwc2_hcd_init(), after the driver parameters
have been set.
Paul Zimmerman [Tue, 26 Mar 2013 00:03:35 +0000 (17:03 -0700)]
staging: dwc2: remove unneeded arguments from two functions
Remove the unneeded struct device *dev argument from dwc2_hcd_init()
and dwc2_hcd_remove(), and pass in the value through the hsotg->dev
member instead
Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dwc2: always release host channel after dequeueing
Previously, when an active urb was dequeued, its host channel would
not always be released. There is some special handling for this in
dwc2_hc_chhltd_intr_dma, but when it was the last urb/qtd in its qh, a
safeguard in dwc2_hc_n_intr would short-circuit and prevent the regular
interrupt handlers from running, without releasing the channel.
This is easily triggered when using a 3G modem using the option driver.
Opening and closing any ttyUSBx device will eat up a host channel that
is forever unusable from that point on.
Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
[paulz@synopsys.com: fixed comment style and added a couple of NULL checks] Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: vt6656: Fix stuck in scanning with variable uScanChannel.
When pMgmt->uScanChannel > pDevice->byMaxChannel scanning ends
but no SIOCGIWSCAN(scan done) message is sent. This section of code is
duplicate of that in WLAN_CMD_SCAN_END which sends scan done.
So remove it and jump eCommandState to WLAN_CMD_SCAN_END.
Increment uScanChannel on !ChannelValid.
At WLAN_CMD_SCAN_END reset uScanChannel to 0 when done.
Introduce iio_tigger_{set,get}_drvdata which allows to attach driver specific
data to a trigger. The functions wrap access to the triggers private_data field
and all current users are updated to use iio_tigger_{set,get}_drvdata instead of
directly accessing the private_data field. This is the first step towards
removing the private_data field from the iio_trigger struct.
The following coccinelle script has been used to update the drivers:
<smpl>
@@
struct iio_trigger *trigger;
expression priv;
@@
-trigger->private_data = priv
+iio_trigger_set_drv_data(trigger, priv)
staging: comedi: s626: cleanup "subdevice" and "cmd" in s626_irq_handler()
The comedi_subdevice in this function is actually the dev->read_subdev
that was initialized during the attach of the board. Use that instead
of accessing the dev->subdevices array directly.
Also, get the comedi_cmd used in s626_irq_handler() when the function
is first entered.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: s626: simplify dio register access
This driver has three dio subdevices, each with 16 channels. These
subdevices use hardware registers that are spaced 0x10 bytes apart
for each "group" of 16 channels.
Create new macros to get the correct addresses for each register
based on the dio "group". Use the s->private (void *) to hold the
"group" number to use in the subdevice functions.
This allows removing struct dio_private and all its uses. It also
removes the ugly casts used to get the register address.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Introduce labpc_counter_set_mode() which is a wrapper around the
i8254_set_mode() helpers to program the 8254 timers. Use the new
function instead of directly writing to the timer mode register
with a "magic" number.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: ni_labpc: cleanup local var declarations in labpc_ai_cmd()
Determine the scan_mode early and get the proper chanspec so that
the chan, range, and aref can be determined when the variables are
declared.
labpc_ai_chanlist_invalid() checks that all the range and aref values
in the chanlist are the same so, for consistency, use the same chanspec
used to get the chan.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: ni_labpc: remove unnecessary test of dev->irq
The ai subdevice (*do_cmd) pointer is only initialized if the
driver has successfully requested the interrupt. The extra test
in labpc_ai_cmd() is not necessary.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>