Javier M. Mellid [Mon, 17 Sep 2012 14:12:47 +0000 (16:12 +0200)]
staging: sm7xxfb: clean fb_fix_screeninfo and fb_var_screeninfo initialization
Part of fb_fix_screeninfo and fb_var_screeninfo initialization happens
in smtc_alloc_fb_info. It duplicates code while hiding the real
functionality of smtc_alloc_fb_info. This patch groups initialization
together.
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Randy Dunlap [Mon, 17 Sep 2012 17:33:18 +0000 (10:33 -0700)]
staging: fix csr printk format warning
Fix printk format warning on i386/X86_32 by using 't' for ptrdiff_t.
Also builds cleanly on x86_64.
drivers/staging/csr/csr_wifi_hip_udi.c: In function 'unifi_print_status':
drivers/staging/csr/csr_wifi_hip_udi.c:151:27: warning: format '%ld' expects type 'long int', but argument 5 has type 'int'
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Merge tag 'iio-for-v3.7d' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
IIO new drivers, features and rework for the 3.7 cycle, 4th set.
Here we have
1) a set cleaning up and moving the ad7476 driver out of staging.
Support for a number of additional parts is also added to that driver.
2) cleanups from various people for the in kernel interface code as that
is getting more an more real use and hence people are picking up on
minor issues that made it through review. Also a related useful set
of utility functions to avoid duplicate code for converting IIO
representations to other forms.
3) a new fractional type for our read_raw / write_raw functions.
This allows avoiding loss of accuracy via the in kernel interfaces in some
cases as well as being rather convenient for a lot of range -> scale
conversions.
4) New AD5755 DAC driver.
5) Some Blackfin timer trigger improvements including hardware pulse control
for device triggering.
Add support for the ad7091r 12 bit ADC to the ad7476 driver. Although the
ad7091r is not really related to any of the other devices supported by this
driver, luckily for us there are not so many ways (which are not totally insane)
how sampling a single channel ADC via SPI can be implemented and support for the
ad7091r can be added to the driver with just a few adjustments.
The ad7091r requires an external "conversion start" pulse to start a sample
conversion. After the conversion has finished the result can be read via SPI. We
depend on a IIO trigger to generate this signal, as a result only sampling in
buffered mode and not in manual mode is available.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
staging:iio:trigger:bfintmr: Only enable timer when necessary
This patch hooks up the set_trigger_state callback for the blackfin timer
trigger driver and only enables the timer when a trigger consumer requests it to
be enabled. There really is no reason to keep the timer running and generate
interrupts if nobody is listening to them.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
If the timer frequency has not been configured yet get_gptimer_period() will
return 0. Handle this case instead of blindly dividing by the returned value.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
staging:iio:hwmon bridge: Use iio_read_channel_processed
Use the iio_read_channel_processed function to read the sample value in the
proper unit instead of using iio_read_channel_raw and iio_read_channel_scale and
doing the unit conversion manually.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
iio:inkern: Add function to read the processed value
Add a function to read a processed value from a channel. The function will first
attempt to read the IIO_CHAN_INFO_PROCESSED attribute. If that fails it will
read the IIO_CHAN_INFO_RAW attribute and convert the result from a raw value to
a processed value.
The patch also introduces a function to convert raw value to a processed value
and exports it, in case a user needs or wants to do the conversion by itself.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
For the iio_read_channel_raw and iio_read_channel_scale the kerneldoc comment
refers to an argument called "channel", while the argument is called "chan" in
the function signature. This leads to the following warnings from kerneldoc:
Warning(include/linux/iio/consumer.h:71): No description found for parameter 'chan'
Warning(include/linux/iio/consumer.h:71): Excess function parameter 'channel' description in 'iio_read_channel_raw'
Warning(include/linux/iio/consumer.h:109): No description found for parameter 'chan'
Warning(include/linux/iio/consumer.h:109): Excess function parameter 'channel' description in 'iio_read_channel_scale'
This patch fixes the warnings by naming them consistently.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch adds support for the AD5755, AD5755-1, AD5757, AD5735, AD5737 16 and
14 bit quad-channel DACs. The AD5757/AD5737 only have current outputs, but
for the AD5755/AD5757 each of the outputs can be configured to either be a
voltage or a current output. We only allow to configure this at device probe
time since usually this needs to match the external circuitry and should not be
changed on the fly.
A few trivial formatting changes on merge.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Kim, Milo [Mon, 17 Sep 2012 08:44:00 +0000 (09:44 +0100)]
iio: inkern: add error case in iio_channel_get()
The datasheet name is defined in the IIO driver.
On the other hand, the adc_channel_label is configured in
the platform side.
If the datasheet name is not matched with any adc_channel_label,
the iio_channel_get() should be returned as error for preventing
invalid channel data access.
This can be handled either way.
(a) checking null data when using it : in the xxx_read_raw()
or
(b) error returns when the channel is requested : this patch
The IIO consumer can't use the channel with invalid channel spec.
Therefore case (b) is more reasonable.
Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Ben Hutchings [Sun, 16 Sep 2012 03:18:50 +0000 (04:18 +0100)]
staging: speakup_soft: Fix reading of init string
softsynth_read() reads a character at a time from the init string;
when it finds the null terminator it sets the initialized flag but
then repeats the last character.
Additionally, if the read() buffer is not big enough for the init
string, the next read() will start reading from the beginning again.
So the caller may never progress to reading anything else.
Replace the simple initialized flag with the current position in
the init string, carried over between calls. Switch to reading
real data once this reaches the null terminator.
(This assumes that the length of the init string can't change, which
seems to be the case. Really, the string and position belong together
in a per-file private struct.)
Tested-by: Samuel Thibault <sthibault@debian.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: silicom: fix a comparing proc_dir_entry pointer against 0
we should be using the NULL macro, not 0 to compare against
a pointer value, and also remove braces around the single
if conditional after the create_proc_entry
Dan Carpenter [Fri, 14 Sep 2012 08:11:35 +0000 (11:11 +0300)]
Staging: silicom: use kstrtoint_from_user()
The main problem with the hand rolled code was that there weren't any
range checks so you could corrupt memory by writing too much data to
the proc file.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:35 +0000 (17:34 +0100)]
staging: comedi: mite: use module_init()/module_exit()
Rename the standard `init_module()` and `cleanup_module()` functions and
make them static. Use `module_init()` and `module_exit()` to mark the
renamed functions as the module init and exit functions.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:34 +0000 (17:34 +0100)]
staging: comedi: mite: remove list of devices
All the drivers that use the "mite" module now allocate a `struct
mite_struct` dynamically instead of searching the `mite_devices` list
populated during initialization of the "mite" module.
Remove the list of devices and the function that prints available NI
devices on the list (`mite_list_devices()`). The list node and `used`
members in `struct mite_struct` are now redundant, so remove them.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This driver's comedi `detach` handler (`ni_670x_detach()`) calls
`free_irq()` but the driver doesn't call `request_irq()` anywhere.
Remove the spurious call.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:25 +0000 (17:34 +0100)]
staging: comedi: mite: add mite_alloc() and mite_free()
Add `mite_alloc()` to allow drivers to allocate and initialize a `struct
mite_struct` dynamically and export it. Add `mite_free()`, which is
currently just an inline wrapper for `kfree()`.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:23 +0000 (17:34 +0100)]
staging: comedi: mite: use ilog2()
The static inline functions `MITE_IODWBSR_1_WSIZE_bits()` and `CR_RL()`
in "mite.h" work out a base-2 logarithm using a `while` loop. Change
them to use `ilog2()`. Also change `CR_RL()` to clamp the maximum value
instead of printing an error.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:20 +0000 (17:34 +0100)]
staging: comedi: ni_pcimio: Use comedi attach_pci callback
Convert this PCI driver to use the comedi `attach_pci` callback instead
of the `attach` callback for PCI auto-configuration. There is no need
to support manual attachment of PCI devices supported by this driver, so
remove the `attach` callback altogether.
Note that this driver still uses the list of PCI "mite" devices created
by the "mite" module. This will be dealt with by a later patch once
dynamic allocation of "mite" structures has been implemented.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:19 +0000 (17:34 +0100)]
staging: comedi: ni_pcimio: Add semicolon to module_comedi_pci_driver()
Add a semi-colon after the macro call
`module_comedi_pci_driver(ni_pcimio_driver, ni_pcimio_pci_driver)`. It
compiles with or without the semicolon but it ought to have it.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:17 +0000 (17:34 +0100)]
staging: comedi: ni_pcidio: use comedi attach_pci callback
Convert this PCI driver to use the comedi `attach_pci` callback instead
of the `attach` callback for PCI auto-configuration. There is no need
to support manual attachment of PCI devices supported by this driver, so
remove the `attach` callback altogether.
Note that this driver still uses the list of PCI "mite" devices created
by the "mite" module. This will be dealt with by a later patch once
dynamic allocation of "mite" structures has been implemented.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:16 +0000 (17:34 +0100)]
staging: comedi: ni_pcidio: use request_firmware()
The PCI-6534 needs three firmware files loading to work with the driver.
That is currently done by passing the firmware data using the
`COMEDI_DEVCONFIG` ioctl that uses the comedi `attach()` hook in the
driver. This doesn't work for auto-configured PCI devices (which also
currently use the `attach()` hook in this driver, but doesn't have the
firmware-loading options set in the `struct comedi_devconfig *`
parameter).
Change the driver to request the firmware files using
`request_firmware()`, ignoring any firmware-loading options set in the
`struct comedi_devconfig`.
The PCI-6534 has a main FPGA which needs to be loaded first, and two
"scarabs". Scarab A is loaded with firmware to support digital input
mode, and scarab B is loaded with firmware to support digital output
mode.
I don't think the order of loading the scarab firmwares matters as long
as they are loaded with the correct firmware files. This update loads
scarab B first, whereas the original code loaded scarab A first. The
firmware files are loaded in the following order:
A) main FPGA: "ni6534a.bin" (FW_PCI_6534_MAIN)
B) scarab B: "niscrb02.bin" (FW_PCI_6534_SCARAB_DO)
C) scarab A: "niscrb01.bin" (FW_PCI_6534_SCARAB_DI)
The required firmware files can be found in the
"comedi-nonfree-firmware" tar-ball at
<http://www.comedi.org/download/comedi-nonfree-firmware-2007.06.22.tar.gz>.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Convert the `printk()` calls in this driver to use the `dev_...()` calls
where possible, or the `pr_...()` calls otherwise. Combine
non-line-terminated prints into single-line prints.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:14 +0000 (17:34 +0100)]
staging: comedi: ni_labpc: use comedi attach_pci callback
Convert this PCI driver to use the comedi `attach_pci` callback instead
of the `attach` callback for PCI auto-configuration. Remove support for
manual attachment of PCI boards supported by this driver. The `attach`
callback is still needed to manually attach ISA boards, but print an
error if an attempt is made to manually attach a PCI board.
Note that this driver still uses the list of PCI "mite" devices created
by the "mite" module. This will be dealt with by a later patch once
dynamic allocation of "mite" structures has been implemented.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:13 +0000 (17:34 +0100)]
staging: comedi: ni_labpc: move labpc_driver and labpc_pci_table
Move the `labpc_driver` and `labpc_pci_table` variables nearer the
module initialization code near the bottom of the module for aesthetic
reasons and to avoid a forward declaration of `labpc_attach()`.
As a consequence, to avoid having to add a forward declaration of the
`labpc_driver` variable, change code that uses
`labpc_driver.driver_name` to use `DRV_NAME` instead, and change code
that uses `labpc_driver.num_names` to use `ARRAY_SIZE(labpc_boards)`
instead.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:12 +0000 (17:34 +0100)]
staging: comedi: ni_labpc: use module_comedi_pci_driver()
Use the macro `module_comedi_pci_driver(comedi_driver, pci_driver)` to
register the module as a Comedi PCI driver if the module supports PCI
devices, otherwise use `module_comedi_driver(comedi_driver)` to register
it as an ordinary Comedi driver. Rename variables and functions that
have prefix `driver_` for consistency. Set the `name` member of the
`struct pci_driver` variable in its initializer instead of initializing
it in the module initialization function.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:11 +0000 (17:34 +0100)]
staging: comedi: ni_labpc: convert printk() to dev_...()
Convert the `printk()` calls in this driver to use the `dev_...()` calls
where possible, or the `pr_...()` calls otherwise. Remove the ifdefed
out code that prints the EEPROM contents.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:10 +0000 (17:34 +0100)]
staging: comedi: ni_670x: use comedi attach_pci callback
Convert this PCI driver to use the comedi `attach_pci` callback instead
of the `attach` callback for PCI auto-configuration. There is no need
to support manual attachment of PCI devices supported by this driver, so
remove the `attach` callback altogether.
Note that this driver still uses the list of PCI "mite" devices created
by the "mite" module. This will be dealt with by a later patch once
dynamic allocation of "mite" structures has been implemented.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:09 +0000 (17:34 +0100)]
staging: comedi: ni_660x: use comedi attach_pci callback
Convert this PCI driver to use the comedi `attach_pci` callback instead
of the `attach` callback for PCI auto-configuration. There is no need
to support manual attachment of PCI devices supported by this driver, so
remove the `attach` callback altogether.
Note that this driver still uses the list of PCI "mite" devices created
by the "mite" module. This will be dealt with by a later patch once
dynamic allocation of "mite" structures has been implemented.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:08 +0000 (17:34 +0100)]
staging: comedi: ni_660x: use module_comedi_pci_driver()
Use the macro `module_comedi_pci_driver(comedi_driver, pci_driver)` to
register the module as a Comedi PCI driver. Rename variables and
functions that have prefix `driver_` for consistency. Set the `name`
member of the `struct pci_driver` variable in its initializer instead of
initializing it in the module initialization function.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:07 +0000 (17:34 +0100)]
staging: comedi: ni_660x: convert printk() to dev_...()
Convert the `printk()` calls in this drivers to use the `dev_...()`
calls instead. Replace some `printk()` calls in the comedi `attach()`
handler (`ni_660x_attach()`) with a single `dev_info()` at the end.
Remove some `printk()` calls before `BUG()` calls.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:06 +0000 (17:34 +0100)]
staging: comedi: ni_65xx: use comedi attach_pci callback
Convert this PCI driver to use the comedi `attach_pci` callback instead
of the `attach` callback for PCI auto-configuration. There is no need
to support manual attachment of PCI devices supported by this driver, so
remove the `attach` callback altogether.
Note that this driver still uses the list of PCI "mite" devices created
by the "mite" module. This will be dealt with by a later patch once
dynamic allocation of "mite" structures has been implemented.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:05 +0000 (17:34 +0100)]
staging: comedi: ni_65xx: move ni_65xx_driver
Move the `struct comedi_driver ni_65xx_driver` variable further down the
function to be closer to the `module_comedi_pci_driver()` module call
and to avoid having to forward declare `ni_65xx_attach()` and
`ni_65xx_detach()`.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:04 +0000 (17:34 +0100)]
staging: comedi: ni_65xx: use module_comedi_pci_driver()
Use the macro `module_comedi_pci_driver(comedi_driver, pci_driver)` to
register the module as a Comedi PCI driver. Rename variables and
functions that have prefix `driver_` for consistency. Set the `name`
member of the `struct pci_driver` variable in its initializer instead of
initializing it in the module initialization function.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:03 +0000 (17:34 +0100)]
staging: comedi: ni_65xx: convert printk() to dev_...()
Convert the `printk()` calls in this drivers to use the `dev_...()`
calls instead. Remove the initial `printk()` call in the comedi
`attach()` handler (`ni_65xx_attach()`) as it's a bit redundant - the
board type and contents of a board ID register are printed later in the
function.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:02 +0000 (17:34 +0100)]
staging: comedi: ni_6527: use comedi attach_pci callback
Convert this PCI driver to use the comedi `attach_pci` callback instead
of the `attach` callback for PCI auto-configuration. There is no need
to support manual attachment of PCI devices supported by this driver, so
remove the `attach` callback altogether.
Note that this driver still uses the list of PCI "mite" devices created
by the "mite" module. This will be dealt with by a later patch once
dynamic allocation of "mite" structures has been implemented.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:01 +0000 (17:34 +0100)]
staging: comedi: ni_6527: move ni6527_driver
Move the `struct comedi_driver ni6527_driver` variable further down the
function to be closer to the `module_comedi_pci_driver()` module call
and to avoid having to forward declare `ni6527_attach()` and
`ni6527_detach()`.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:00 +0000 (17:34 +0100)]
staging: comedi: ni_6527: use module_comedi_pci_driver()
Use the macro `module_comedi_pci_driver(comedi_driver, pci_driver)` to
register the module as a Comedi PCI driver. Rename variables and
functions that have prefix `driver_` for consistency. Set the `name`
member of the `struct pci_driver` variable in its initializer instead of
initializing it in the module initialization function.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:33:59 +0000 (17:33 +0100)]
staging: comedi: ni_6527: change driver name string
Change the driver name string used in data structures, kernel messages,
etc. from "ni6527" to "ni_6527" to match the module name. Use a macro
`DRIVER_NAME` that expands to this string literal.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:33:58 +0000 (17:33 +0100)]
staging: comedi: ni_6527: convert printk() to dev_...()
Convert the `printk()` calls in this drivers to use the `dev_...()`
calls instead. Remove the initial `printk()` call in the comedi
`attach()` handler (`ni6527_attach()`) as it's a bit redundant - the
board type and contents of a board ID register are printed later in the
function.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Merge tag 'mfd-for-linus-3.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Pull mfd fixes from Samuel Ortiz:
"This is the remaining MFD fixes for 3.6, with 5 pending fixes:
- A tps65217 build error fix.
- A lcp_ich regression fix caused by the MFD driver failing to
initialize the watchdog sub device due to ACPI conflicts.
- 2 MAX77693 interrupt handling bug fixes.
- An MFD core fix, adding an IRQ domain argument to the MFD device
addition API in order to prevent silent and potentially harmful
remapping behaviour changes for drivers supporting non-DT
platforms."
* tag 'mfd-for-linus-3.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
mfd: MAX77693: Fix NULL pointer error when initializing irqs
mfd: MAX77693: Fix interrupt handling bug
mfd: core: Push irqdomain mapping out into devices
mfd: lpc_ich: Fix a 3.5 kernel regression for iTCO_wdt driver
mfd: Move tps65217 regulator plat data handling to regulator
Merge tag 'for-3.6-rc6' of git://gitorious.org/linux-pwm/linux-pwm
Pull pwm fixes from Thierry Reding:
"While this comes a bit later than I had wished, both patches are
rather minor and touch only new drivers so I think these are still
safe for merging."
* tag 'for-3.6-rc6' of git://gitorious.org/linux-pwm/linux-pwm:
pwm: pwm-tiehrpwm: Fix conflicting channel period setting
pwm: pwm-tiecap: Disable APWM mode after configure
Pull scsi target fixes from Nicholas Bellinger:
"Here is the current set of target-pending fixes headed for v3.6-final
The main parts of this series include bug-fixes from Paolo Bonzini to
address an use-after-free bug in pSCSI sense exception handling, along
with addressing some long-standing bugs wrt the handling of zero-
length SCSI CDB payloads also specific to pSCSI pass-through device
backends."
* git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
target: go through normal processing for zero-length REQUEST_SENSE
target: support zero allocation length in REQUEST SENSE
target: support zero-size allocation lengths in transport_kmap_data_sg
target: fail REPORT LUNS with less than 16 bytes of payload
target: report too-small parameter lists everywhere
target: go through normal processing for zero-length PSCSI commands
target: fix use-after-free with PSCSI sense data
target: simplify code around transport_get_sense_data
target: move transport_get_sense_data
target: Check idr_get_new return value in iscsi_login_zero_tsih_s1
target: Fix ->data_length re-assignment bug with SCSI overflow
Merge tag 'pm-for-3.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael J. Wysocki:
"Three ACPI device power management fixes related to checking and
setting device power states."
* tag 'pm-for-3.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / PM: Use KERN_DEBUG when no power resources are found
ACPI / PM: Fix resource_lock dead lock in acpi_power_on_device
ACPI / PM: Infer parent power state from child if unknown, v2
Merge tag 'sound-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull more sound fixes from Takashi Iwai:
"Yet more (a bunch of) small fixes that slipped from the previous pull
request. Most of commits are pending ASoC fixes, all of which are
fairly trivial commits."
* tag 'sound-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ASoC: wm8904: correct the index
ALSA: hda - Yet another position_fix quirk for ASUS machines
ASoC: tegra: fix maxburst settings in dmaengine code
ASoC: samsung dma - Don't indicate support for pause/resume.
ASoC: mc13783: Remove mono support
ASoC: arizona: Fix typo in 44.1kHz rates
ASoC: spear: correct the check for NULL dma_buffer pointer
sound: tegra_alc5632: remove HP detect GPIO inversion
ASoC: atmel-ssc: include linux/io.h for raw io
ASoC: dapm: Don't force card bias level to be updated
ASoC: dapm: Make sure we update the bias level for CODECs with no op
ASoC: am3517evm: fix error return code
ASoC: ux500_msp_i2s: better use devm functions and fix error return code
ASoC: imx-sgtl5000: fix error return code
Nikolay Ulyanitsky reported thatthe 3.6-rc5 kernel has a 15-20%
performance drop on PostgreSQL 9.2 on his machine (running "pgbench").
Borislav Petkov was able to reproduce this, and bisected it to this
commit 970e178985ca ("sched: Improve scalability via 'CPU buddies' ...")
apparently because the new single-idle-buddy model simply doesn't find
idle CPU's to reschedule on aggressively enough.
Mike Galbraith suspects that it is likely due to the user-mode spinlocks
in PostgreSQL not reacting well to preemption, but we don't really know
the details - I'll just revert the commit for now.
There are hopefully other approaches to improve scheduler scalability
without it causing these kinds of downsides.
Reported-by: Nikolay Ulyanitsky <lystor@gmail.com> Bisected-by: Borislav Petkov <bp@alien8.de> Acked-by: Mike Galbraith <efault@gmx.de> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Chanwoo Choi [Tue, 21 Aug 2012 06:16:23 +0000 (15:16 +0900)]
mfd: MAX77693: Fix NULL pointer error when initializing irqs
This patch initialize register map of MUIC device because mfd driver
of Maxim MAX77693 use regmap-muic instance of MUIC device when irqs of
Maxim MAX77693 is initialized before call max77693-muic probe() function.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Reported-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Chanwoo Choi [Tue, 21 Aug 2012 06:15:52 +0000 (15:15 +0900)]
mfd: MAX77693: Fix interrupt handling bug
This patch fix bug related to interrupt handling for MAX77693 devices.
- Unmask interrupt masking bit for charger/flash/muic to revolve
that interrupt isn't happened when external connector is attached.
- Fix wrong regmap instance when muic interrupt is happened.
This patch were discussed and confirm discussion about this patch on below url:
http://lkml.org/lkml/2012/7/16/118
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Mark Brown [Tue, 11 Sep 2012 07:16:36 +0000 (15:16 +0800)]
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>
Kim, Milo [Fri, 14 Sep 2012 01:24:00 +0000 (02:24 +0100)]
iio: inkern: allocate zeroed memory
Use kzalloc() rather than kmalloc() for initializing the iio_channel structure.
This patch enables the iio_dev and iio_chan_spec are set to NULL.
This may prevent the page fault problem because the pointer of iio_chan_spec
is initialized as NULL.
The iio_chan_spec is updated only in case that the IIO map has
specific channel label.
When the map has no ADC channel label, then the value of iio_chan_spec
remains as invalid pointer.
To prevent this problem, the pointer should be initialized as NULL.
Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Currently IIO uses a decimal fixed point representations for real type numbers.
This patch introduces a new representation for rational type numbers. The number
will be expressed by specifying a numerator and denominator. For converting a
raw value to a processed value multiply it by the numerator and divide it by the
denominator.
The reasoning for introducing this new type is that for a lot of devices the
scale can be represented easily by a fractional number, but it is not possible
to represent it as fixed point number without rounding. E.g. for a simple DAC
the scale is often the reference voltage divided by the number of possible
values (Usually 2**n_bits - 1). Each driver currently implements the conversion
of this fraction to a fixed point number on its own.
Also when it comes to the in-kernel interface this allows to directly use the
fractional factors to convert a raw value to a processed value. This should on
one hand require less instructions and on the other hand increase the
precision.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit- 314be14bb renamed the _st_ functions to loose the bit
that was meant for staging version but forgot to change
the documentation which still have _st_ sprinkled in some of the
places.
Signed-off-by: anish kumar <anish198519851985@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>