aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2016-03-28staging: comedi: dt282x: remove redundant comedi_check_trigger_arg_min()H Hartley Sweeten1-4/+0
The 'convert_arg' sets the acquisition timing of the analog input command. The maximum speed (the minimum timing) depends on the board 'ai_speed' which if always >= 4000. Remove the redundant 'min' check, Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: dt282x: refactor dt282x_ns_to_timer()H Hartley Sweeten1-12/+24
Define the pacer clock limits and remove the magic numbers. Refactor the code to use a common path to return the actual 'ns' timing and the timer divisor value. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: update the MODULE_DESCRIPTIONH Hartley Sweeten1-1/+1
Change the generic MODULE_DESCRIPTION text to something more useful. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: refactor GPCT_OFFSETH Hartley Sweeten1-5/+5
This driver supports boards that have 1 or 2 TIO chips with base addresses 0x800 apart. Replace the static const array 'GPCT_OFFSET' with a define and calculate the base address based on the chip index. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: remove spinlock 'dma_cfg_lock'H Hartley Sweeten1-9/+0
This spinlock is only used to protect changes to the private data 'dma_cfg'. Before calling any function that would change the 'dma_cfg' the spinlock 'mite_channel_lock' is also locked. That spinlock is not unlocked until after the 'dma_cfg' change. Remove the redundant spinlock. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: remove ni_gpct_to_660x_register[]H Hartley Sweeten1-233/+74
enum ni_gpct_register and enum ni_660x_register now have a 1:1 relationship for the NITIO_* registers. The static const array is no longer necessary to find the proper NI660X_* register for a given NITIO_*. Remove it and refactor the register read/write functions. Use the NITIO_* values to init the ni_660x_reg_data[] array and remove the unnecessary NI660X_* enum values. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: sort enum ni_660x_registerH Hartley Sweeten1-47/+48
Sort this enum so that it has a 1:1 relationship with the ni_tio.h enum ni_gpct_register. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: remove inline mite_ring()H Hartley Sweeten1-14/+7
This fuction just returns a pointer from the private data. The name might provide some confusion since it appears to be an exported function from the mite driver. Just remove it and get the pointer directly where needed. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: default DIO channels with subdevice initH Hartley Sweeten1-14/+13
For aesthetics, move the initialization of the default routing for the DIO channels so it happens when the subdevice is initialized. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: initialize the counter with the subdevice initH Hartley Sweeten1-3/+2
Remove the extra for loop and just initialize the counter as the subdevices are created. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: allocate counters early in (*auto_attach)H Hartley Sweeten1-10/+10
The ni_gpct_device_construct() could fail allocating the memory for device and its counters. For aesthetics, call the function before initializing the subdevices. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: init TIO chips before subdevice initH Hartley Sweeten1-23/+29
For aesthetics, initialize the TIO chips before the subdevices are allocated and initialized. Refactor the function to initialize all the TIO chips and move it to a better place in the driver. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: disable interrupts when detaching driverH Hartley Sweeten1-1/+3
Make sure the interrupts are disabled before freeing the irq. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: ni_gpct_device_destroy() can handle a NULL pointerH Hartley Sweeten1-2/+1
Remove the unnecessary NULL pointer check. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: tidy up the counter subdevices initH Hartley Sweeten1-27/+32
For aesthetics, add some whitespace to the subdevice init and use a couple local variables to make the code easier to follow. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: tidy up the misc. constantsH Hartley Sweeten1-25/+24
Remove enum ni_660x_constants and just #define the value. Move all the constant #defines so they are in one place and rename them so they are more conesistent. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: fix memory barrier without commentH Hartley Sweeten1-1/+3
Fix the checkpatch.pl issue. Move the memory barrier to a better place. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: add comments for the spinlock_t definitionsH Hartley Sweeten1-7/+9
Fix the checkpatch.pl issues: CHECK: spinlock_t definition without comment For aesthetics, rename the 'soft_reg_copy_lock' to clarify what it's used for. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: refactor ni_gpct_to_660x_register()H Hartley Sweeten1-147/+89
Convert this big switch into an array and refactor ni_660x_gpct_{write,read}() functions to use the array to find the register offset. All the TIO (GPCT) registers are included in the array except for NITIO_G0_ABZ and NITIO_G1_ABZ. These registers only exist on the ni_pcimio m-series boards and this driver will never read/write them. Just in case someone adds a new entry to the enum ni_gpct_register in ni_tio.h, add a dev_warn() for any unhandled registers. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: add a comment about the initial DIO stateH Hartley Sweeten1-0/+5
The (*auto_attach) initializes all the DIO channels to a default state. Add a comment for clarity. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: tidy up ni_660x_set_pfi_routing()H Hartley Sweeten1-38/+27
Use the comedi.h provided constants (enum ni_660x_pfi_routing) instead of defining new ones for the output sources. Use a switch to clarify the channel/source validation. For aesthetics, rename the private data members 'pfi_output_selects' and 'pfi_direction_bits'. Remove the 'min_counter_pfi_chan' and 'max_dio_pfi_chan' from enum ni_660x_constants. The open coded values make the code easier to follow. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: tidy up ni_660x_dio_insn_bits()H Hartley Sweeten1-11/+20
Use some local variables to clarify this function. This (*insn_bits) function is a bit different from most comedi drivers. Add some comments to clarify why the shifts are used. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: tidy up Digital I/O subdevice initH Hartley Sweeten1-8/+60
Add some whitespace to the Digital I/O subdevice init and add a comment about the channels. This driver is a bit goofy, only 32 of the 40 channels can actually be used for Digital I/Os and 32 of them can be routed to the counters for alternate use. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: Prefer kernel type 'u64' over 'uint64_t'H Hartley Sweeten1-3/+3
Fix the checkpatch.pl issues. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: Prefer 'unsigned int' to bare use of 'unsigned'H Hartley Sweeten1-20/+20
Fix the checkpatch.pl issues. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: remove ni_660x_num_counters()H Hartley Sweeten1-11/+5
This inline function is only used by the (*auto_attach). Remove it and just use a local variable for the calculation. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: remove enum ni_660x_subdevicesH Hartley Sweeten1-15/+10
Hard-coding the subdevice order is normally a bad idea. If a new subdevice is added, or removed, it could potentially break pretty badly. Remove the enum and associated NI_660X_GPCT_SUBDEV() helper that hard-code the subdevice order. Fix the (*auto_attach) so it initializes all the subdevices without depending on the hard-coded order. Change the interrupt handler so that all the counter subdevices are handled without depending on the hard-coded order. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: fix block comment issuesH Hartley Sweeten1-6/+11
Fix the checkpatch.pl issues about: WARNING: Block comments use * on subsequent lines WARNING: Block comments use a trailing */ on a separate line Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: remove BUG_ON() in ni_660x_request_mite_channel()H Hartley Sweeten1-1/+0
This BUG_ON() happens if a mite DMA channel is already requested when an ansynchronous command is started for one of the counter subdevices. The comedi core will only call the (*do_cmd) if the subdevice is not busy. In this driver, the (*cancel) for the subdevice will always release any requested mite DMA channel. Remove the BUG_ON() which can never occur. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: tidy up ni_660x_select_pfi_output()H Hartley Sweeten1-30/+24
Tidy up this function to fix the checkpatch.pl issues: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' For aesthetics, remove the static const local variables. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: tidy up ni_gpct_{write, read}_register()H Hartley Sweeten1-9/+7
Rename these functions so they have namespace associated with the driver. Fix the checkpatch.pl issues: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: tidy up ni_660x_read_register()H Hartley Sweeten1-12/+10
Rename this function to help shorten some of the long lines. Remove the inline, let the compiler figure it out. Change the 'unsigned' parameters to 'unsigned int' to fix the checkpatch.pl issues: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: tidy up ni_660x_write_register()H Hartley Sweeten1-22/+20
Rename this function to help shorten some of the long lines. Remove the inline, let the compiler figure it out. Change the 'unsigned' parameters to 'unsigned int' to fix the checkpatch.pl issues: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: cleanup the NI660X_GLOBAL_INT_{STATUS, CFG}H Hartley Sweeten1-17/+10
Remove the enums global_interrupt_{status,config}_register_bits and add defines for the CamelCase values. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: cleanup the NI660X_DMA_CFG register helpersH Hartley Sweeten1-44/+19
The BUG_ON() checks in the helper functions are not necessary. The mite driver quiries the PCI chip to determine the number of DMA channels. This is then used when a DMA channel is requested so the channel will always be in range. Convert the inline functions used to set the bits in the NI600X_DMA_CFG register into macros. Also convert the associated enum dma_selection. This clarifies the association with the register. Rename the associated 'dma_configuration_soft_copies' member of the private data to allow shorting some of the ugly long lines in the driver. This also fixes a number of checkpatch.pl issues about: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: remove enum clock_config_register_bitsH Hartley Sweeten1-6/+3
Remove this enum and add a define for the bit. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: tidy up multi-line commentH Hartley Sweeten1-13/+12
Reformat the multi-line comment in the kernel CodingStyle. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: cleanup the NI660X_IO_CFG register helpersH Hartley Sweeten1-53/+28
Convert the inline functions used to set the bits in the NI600X_IO_CFG registers into macros. Also convert the enum ni_660x_pfi_output_select into defines. This clarifies the association with the register. This also fixes a number of checkpatch.pl issues about: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: rename CamelCase 'NI_660xRegisterData'H Hartley Sweeten1-6/+6
Rename this CamelCase struct and the associated 'registerData' variable. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: remove enum ni_660x_register_directionH Hartley Sweeten1-105/+98
This enum is used to define the, unused, 'direction' of each register in struct NI_660xRegisterData. Remove the unused member, as well as the enum. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: remove enum ni_register_widthH Hartley Sweeten1-123/+103
All the registers are defined struct NI_660xRegisterData and they are either 2 or 4 bytes in size. Remove the enum and just use a char member to define the size as 2 or 4 bytes. Simplify the ni_660x_{write,read}_register() functions and remove the unnecessary BUG() in each. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: remove struct NI_660xRegisterData 'name'H Hartley Sweeten1-99/+98
This member of the struct is not used, and just takes up space. Remove it. Instead, add the enum ni_660x_register indexes to the table to clarify, and document, the entries. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: comedi: ni_660x: change IOConfigReg() into a macroH Hartley Sweeten1-14/+8
The BUG_ON() in this function is unnecessary. The 'pfi_channel' will always be in range of the subdevice 'n_chan' (NUM_PFI_CHANNELS) which will return a valid 'reg'. Convert the inline function into a simple macro. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: wilc1000: removes unused local variableLeo Kim1-18/+0
This patch removes unused local variable. This variable is operation definition that back off from sending packets for some time. However, that has been deleted operation code. That is removes all relative code. Signed-off-by: Leo Kim <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: wilc1000: removes define USE_TX_BACKOFF_DELAY_IF_NO_BUFFERSLeo Kim1-8/+0
This patch removes define USE_TX_BACKOFF_DELAY_IF_NO_BUFFERS and use it's feature codes. Signed-off-by: Leo Kim <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: wilc1000: removes unused defineLeo Kim2-11/+0
This patch removes unused define. Signed-off-by: Leo Kim <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: wilc1000: replaces memcmp with ether_addr_equal_unalignedLeo Kim1-2/+4
This patch replaces memcmp with ether_addr_equal_unaligned. Warning reported by checkpatch.pl - Prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp() Signed-off-by: Leo Kim <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: wilc1000: removes unused debug flagsLeo Kim1-12/+0
This patch removes unused debug flags. Signed-off-by: Leo Kim <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: wilc1000: removes unused dead codesLeo Kim1-8/+0
This patch removes unused dead codes that define custom feature. Signed-off-by: Leo Kim <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-28staging: wilc1000: replaces frame_type with type of struct frame_regLeo Kim3-7/+7
This patch replaces frame_type with type of struct frame_reg. Signed-off-by: Leo Kim <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>