Ian Abbott [Mon, 18 Mar 2013 17:19:09 +0000 (17:19 +0000)]
staging: comedi: amplc_dio200: split into ISA, PCI and common
Split the "amplc_dio200" comedi driver module into separate driver
modules for ISA and PCI boards with a common module for the shared code.
Keep the old name "amplc_dio200" for the ISA board driver as the module
may be modprobed with this name by a script. (If the script uses insmod
it will need modifying to load the "amplc_dio200_common" module first.)
Use the module name "amplc_dio200_pci" for the PCI board driver. On
most systems this will be auto-loaded.
Use the module name "amplc_dio200_common" for the module containing the
shared code. This is normally loaded as a dependency of the other two
modules.
"amplc_dio200_common" exports the following functions:
* `amplc_dio200_common_attach()`: this is basically the old
`dio200_common_attach()` from the combined driver module. It is
called from the driver-specific attach or auto-attach routines.
* `amplc_dio200_common_detach()`: this is most of the old
`dio200_detach()`. It is called from the driver-specific detach
routine.
* `amplc_dio200_set_enhance()`: this is a new function called during
initialization of PCIe cards to enable "enhanced" mode.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor `dio200_handle_read_intr()` to fix checkpatch warning about too
many leading tabs. Factor out the part that puts the scan data into the
asynchronous command data buffer and checks for end of acquisition into
new function `dio200_read_scan_intr()`.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 18 Mar 2013 17:19:07 +0000 (17:19 +0000)]
staging: comedi: amplc_dio200: don't check bus-type in dio200_common_attach()
The "amplc_dio200" driver is going to be split into separate drivers for
ISA and PCI cards with a common module containing most of the code. We
don't want the common module code to depend on whether ISA boards, PCI
boards, or both are supported. Currently, `dio200_common_attach()` and
`dio200_detach()` optimize out the code to support a timer subdevice
when built to support ISA boards only. Remove the `if (DO_PCI)` tests
which optimize out that code. Unfortunately, this will expand the
module's code size for an ISA-only driver a bit.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
`dio200_report_attach()` is called from `dio200_common_attach()` to
report the successful attachment of a supported board. It includes
various information about the board. Replace the function with a simple
acknowledgement that the attachment completed successfully. The
`dio200_attach()` and `dio200_auto_attach()` functions also output an
message during the attachment. Include extra information in those
messages to compensate for the removal of the information output by
`dio200_report_attach()`.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the `DIO200_DRIVER_NAME` macro which expands to the driver name
"amplc_dio200". Use the board name from our `struct dio200_board` when
requesting resources.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 18 Mar 2013 17:19:04 +0000 (17:19 +0000)]
staging: comedi: amplc_dio200: set board_name before common attach
`dio200_common_attach()` is called from `dio200_attach()` for ISA boards
and from `dio200_auto_attach()` for PCI boards. `dio200_auto_attach()`
assigns `dev->board_name` (where `dev` is the `struct comedi_device *`
under consideration) before calling `dio200_common_attach()`. Do the
same in `dio200_attach()` so it can be used there before the call to
`dio200_common_attach()`. This makes the assignment in
`dio200_common_attach()` unnessary, so remove the assignment from there.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change the successful return value of `dio200_common_attach()` from 1 to
0. This is propagated as the return value from the driver's "attach"
(`dio200_attach()`) or "auto_attach" (`dio200_auto_attach()`) handler.
Any non-negative value will do, but 0 is more conventional than 1.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 18 Mar 2013 17:19:01 +0000 (17:19 +0000)]
staging: comedi: amplc_dio200: embed board layout in board structure
The amplc_dio200 driver supports both ISA and PCI boards, some of which
are quite similar. The driver takes advantage of this by defining a
"board layout" structure `struct dio200_layout` along with an array of
this structure `dio200_layouts[]` and an enumerated type for the indices
into this array `enum dio200_layout_idx`. The main board information
structure `struct dio200_board` contains a `layout` member holding an
enumerated index into the array of layouts and the enumerated layout
values are used to designate the indices in the initializer of
`dio200_layouts[]`.
We would like to split the ISA and PCI support into separate driver
modules and having the shared layouts makes this slightly awkward as the
enumerated values are condionally present depending on whether the
driver is configured to support ISA, PCI, or both.
Embed the `struct dio200_layout` into the main board information
structure `struct dio200_board` to make things simpler, discarding
`dio200_layouts[]` and the `enum dio200_layout_idx` in the process.
Only two of the layouts were used by more than one board anyway (each of
which was used by one ISA and one PCI board).
While we're at it, change the `has_int_sce`, `has_clk_gat_sce` and
`has_enhancements` members of `struct dio200_layout` to `bool:1`
bit-fields to save a few bytes.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Set the `driver_data` member of each element (apart from the sentinel)
of our PCI device table `dio200_pci_table[]` to the index of the
corresponding element of our private PCI board details
`dio200_pci_boards[]`. This index appears in the context parameter of
our auto_attach routine `dio200_auto_attach()`. In this function,
nename the parameter to `context_model` and use it to set
`dev->board_ptr` to point to an element of `dio200_pci_boards[] directly
by index instead of calling `dio200_find_pci_board()` to search for the
element whose `devid` member matches the PCI device ID.
Remove `dio200_find_pci_board()` and the `devid` member of `struct
dio200_board`. Also remove the `model` member of `struct dio200_board`
and the `enum dio200_model` type as we can do without them. The only
function that uses the `model` member is `dio200_auto_attach()`, so use
the `context_model` parameter instead.
Define the enumerated value for each PCI board in new type `enum
dio200_pci_model` which replaces `enum dio200_model` minus the
enumerated values for the ISA boards (so the numeric values for the PCI
boards have changed). Use these enumerated values to designate the
initializer for each element of `dio200_pci_boards[]`.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 18 Mar 2013 17:18:59 +0000 (17:18 +0000)]
staging: comedi: amplc_dio200: don't check bus type in attach
Since the legacy attach routine `dio200_attach()` is only called for board
names matching an entry in our array of ISA boards
`dio200_isa_boards[]`, and it is reasonable to expect all elements of
`dio200_isa_boards[]` to have their `bustype` member initialized
correctly to `isa_bustype`, don't bother checking the bus type in
`dio200_attach()`. Add `if (!DO_ISA) return -EINVAL` to optimize out
the remainder of the function if `CONFIG_COMEDI_AMPLC_DIO200_ISA` is not
defined.
Similarly, don't bother checking the bus type in
`dio200_find_pci_board()` as it is reasonable to expect all elements of
`dio200_pci_boards[]` to have their `bustype` member initialized
correctly to `pci_bustype`.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 18 Mar 2013 17:18:58 +0000 (17:18 +0000)]
staging: comedi: amplc_dio200: split dio200_boards[] into ISA & PCI
Split `dio200_boards[]` into `dio200_isa_boards[]` for ISA cards and
`dio200_pci_boards[]` for PCI cards. Only initialize the board-name
look-up members of `struct comedi_driver amplc_dio200_driver` if the ISA
part of the driver is enabled in the kernel config
(`CONFIG_COMEDI_AMPLC_DIO200_ISA`) using the array of ISA boards
(`dio200_isa_boards[]`). The driver doesn't allow manual configuration
of PCI devices, so there is no point having the comedi core match the
names of the PCI boards before it calls our driver's legacy attach
routine (`dio200_attach()`).
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Eduardo Valentin [Tue, 19 Mar 2013 14:54:27 +0000 (10:54 -0400)]
staging: ti-soc-thermal: fix bitfield writing while updating thresholds
Wrong threshold cold values may be written with current implementation.
This patch fixes the threshold update function by simplifying the
bitfield manipulation sequence.
Eduardo Valentin [Tue, 19 Mar 2013 14:54:26 +0000 (10:54 -0400)]
staging: ti-soc-thermal: fix condition to apply hyst
While updating talert thresholds, threshold cold must
always be lower than threshold hot. This patch fixes
the function ti_bandgap_update_alert_threshold to only
change the thresholds by applying a hysteresis when
they violate this condition.
Eduardo Valentin [Tue, 19 Mar 2013 14:54:23 +0000 (10:54 -0400)]
staging: ti-soc-thermal: split writable data from readonly data
This patch changes the data structures of this driver so
that readonly data can reside only in the conf pointer.
Now each register has a struct to hold its configuration info,
to be used base on chip version for instance, and a
struct of values to be written, like register shadow and priv data.
Eduardo Valentin [Tue, 19 Mar 2013 14:54:21 +0000 (10:54 -0400)]
staging: ti-soc-thermal: rename symbols to use better prefix
As this driver has been renamed to cope with the chips it
is supposed to support, this patch also changes the symbol
names to use a proper prefix, so it is not suggestive that
this driver supports only OMAP devices.
Andres More [Tue, 19 Mar 2013 01:33:51 +0000 (20:33 -0500)]
staging: vt6656: remove code placeholders
Removed comments from coding template.
sed -i '/^\/\*---/d' drivers/staging/vt6656/*.[ch]
Signed-off-by: Andres More <more.andres@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Removed struct tagS802_11Header, switching to struct ieee80211_hdr instead.
Checkpatch warnings and errors were not resolved.
Signed-off-by: Andres More <more.andres@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Andres More [Tue, 19 Mar 2013 01:33:49 +0000 (20:33 -0500)]
staging: vt6656: removed usage of custom Ethernet header
Removed struct tagSEthernetHeader, replacing with struct ethhdr.
Not all checkpatch errors and warnings were removed.
Signed-off-by: Andres More <more.andres@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sachin Kamat [Tue, 19 Mar 2013 06:46:32 +0000 (12:16 +0530)]
staging: ste_rmi4: Make synaptics_rmi4_touchpad_config symbol static
'synaptics_rmi4_touchpad_config' is used only in this file.
Make it static. Silences the following sparse warning:
drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c:652:5: warning:
symbol 'synaptics_rmi4_touchpad_config' was not declared. Should it be static?
Mirsal Ennaime [Tue, 12 Mar 2013 10:42:02 +0000 (11:42 +0100)]
drivers: android: binder: Use __func__ in debug messages
Debug messages sent in binder_deferred_release begin with
"binder_release:" which is a bit misleading as binder_release is not
directly part of the call stack. Use __func__ instead for debug messages
in binder_deferred_release.
Mirsal Ennaime [Tue, 12 Mar 2013 10:41:59 +0000 (11:41 +0100)]
drivers: android: binder: Move the node release code to a separate function
The binder_deferred_release() function has many levels of indentation
which makes it difficult to read. This patch moves the code which deals
with disposing of a binder node to a separate binder_node_release()
function, thus removing one level of indentation and allowing the code to
fit in 80 columns.
Merge tag 'iio-for-3.10a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
First set of IIO new drivers and cleanup for the 3.10 cycle.
New stuff
1) Add OF support for specifying mappings between iio devices and their
in kernel consumers.
2) Driver for AD7923 (extra functionality and support for ad7904, ad7914 and
ad7924 added later in series)
3) Driver for Exynos adc (dt suppor for phy added later in series).
4) Make iio_push_event save IRQ context - necessary if it is to be used
within an interrupt handler. Users of this functionality to follow.
5) For iio use the device tree node name to provide the hwmon name attribute
if available.
Removal and moves out of staging
1) Drop the adt7410 driver from IIO now that there is a hmwon driver with
equivalent support. This device is very much targeted at hardware
monitoring so hwmon is a more appropriate host for the driver.
2) Move iio_hwmon driver to drivers/hwmon.
Cleanups
1) Minor cleanup in ST common library.
2) Large set of patches to break the info_mask element which previously used
odd and even bits to specify if a channel attribute was either shared across
similar channels or specific to only one. Now we have two bitmaps, one for
those parameters that are specific to this channel and one for those shared
by all channels with the same type as this one. This has no effect on the
userspace abi. It simplifies the core code and provides more space for new
channel parameters. It has been on the todo list for a long time!
Jonathan Cameron [Wed, 20 Mar 2013 22:21:00 +0000 (22:21 +0000)]
hwmon: Move the IIO client driver for hwmon out of staging
This driver uses channel maps, defined either through device tree
or platform data, to create a hwmon driver which acts as a client
for the underlying IIO device channels. Thus a general purpose
IIO adc driver can be used to provide hardware monitoring using a subset
of its channels.
Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Guenter Roeck <linux@roeck-us.net>
--
The only non move changes here concern the description and changes to the
dependencies to IIO explicit and hwmon implicit.
I'm proposing moving this into hwmon on the basis of placing drivers
based on what they provide rather than what their underlying hardware
is.
Guenter Roeck [Wed, 20 Mar 2013 15:52:00 +0000 (15:52 +0000)]
staging/iio: iio_hwmon: Use device tree node name for hwmon name attribute
So far, all instances of iio_hwmon set their hwmon name attribute
to "iio_hwmon", which is not very descriptive. Set it to the device tree
node name if available, and only revert to iio_hwmon otherwise.
Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Wanpeng Li [Wed, 13 Mar 2013 07:06:16 +0000 (15:06 +0800)]
zram: fix zram_bvec_read duplicate dump failure message and stat accumulation
When zram decompress fails, the code unnecessarily dumps failure messages and
does stat accumulation in function zram_decompress_page(), this work is already
done in function zram_decompress_page, the patch skips the redundant work.
Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>