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.
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>
Remove the unnecessary comment about adding command support to
the analog input subdevice and change the 'maxdata' value to hex
as this is more common in comedi drivers.
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: ni_labpc: fix 8255 dio subdevice init
The subdev_8255_init() function can fail. Check for failure and
return the errno.
Consolidate the mmio/ioport calls to subdev_8255_init(). The callback
function can be added with a simple ? : test and the cast of the iobase
is not necessary.
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: ni_labpc: fix command support with analog input subdevice
An interrupt is required for command support to work with the
analog input subdevice. When used with the ISA driver, enabling
the interrupt is optional. Fix the subdevice init so that command
support is only enabled if the irq is available.
Add some whitespace to the subdevice init. Change the 'maxdata'
value to hex as this is more common in comedi drivers.
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: ni_labpc: remove 'volatile' from private data
As indicated by checkpatch.pl, "WARNING: Use of volatile is usually
wrong: ...". The variables in the private data that are marked
volatile don't need to be. Remove the volatile.
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>
Move the comedi_driver (*attach), (*auto_attach), and (*detach)
functions as well as a couple of the attach helper functions to
remove the need for a number of the forward declarations.
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>
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.