1. 07 Nov, 2016 9 commits
    • David Kershner's avatar
      staging: unisys: visorbus: bus_destroy add error handling · 30f6c3f5
      David Kershner authored
      Do proper error handling and return error codes instead of just ignoring
      them.
      Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
      Reported-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Reviewed-by: default avatarTim Sell <Timothy.Sell@unisys.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      30f6c3f5
    • David Kershner's avatar
      staging: unisys: visorbus: bus_destroy do not call bus_epilog · 3e0e8db9
      David Kershner authored
      Have bus_destroy call chipset_bus_destroy directly instead of going
      through bus_epilog.
      Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
      Reviewed-by: default avatarTim Sell <Timothy.Sell@unisys.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3e0e8db9
    • David Kershner's avatar
      staging: unisys: visorbus: bus_create no longer calls bus_epilog · 8f334e30
      David Kershner authored
      Have bus_create call chipset_bus_create directly instead of going
      through the function bus_epilog.
      Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
      Reviewed-by: default avatarTim Sell <Timothy.Sell@unisys.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8f334e30
    • David Kershner's avatar
      staging: unisys: visorbus: fix double response · ca1cbf90
      David Kershner authored
      This patch addresses the problem that we were sending double responses
      back to the s-Par Firmware when processing CONTROLVM Messages. Every
      message responds individually and the epilog functions would send a
      response as well.
      
      Since a message could delay the response, it was decided to remove the
      extra response from the epilog function.
      Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
      Reviewed-by: default avatarTim Sell <Timothy.Sell@unisys.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ca1cbf90
    • Sameer Wadgaonkar's avatar
      staging: unisys: visorbus: remove unused initializations · c4fe36cd
      Sameer Wadgaonkar authored
      Removed intializations from visorchipset_open(), visorchipset_init()
      and moved the memset in initialize_controlvm_payload_info() down in
      case of early returns from the function.
      Signed-off-by: default avatarSameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
      Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
      Reported-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c4fe36cd
    • Tim Sell's avatar
      staging: unisys: visorbus: convert client_bus_info sysfs to debugfs · 8217becc
      Tim Sell authored
      Previously, the sysfs entry (assuming traditional sysfs mountpoint):
      
          /sys/bus/visorbus/devices/visorbus<n>/client_bus_info
      
      violated kernel conventions by printing more than one item.  This along
      with the fact that the data emitted was diagnostic data (intended to
      shadow the client driver info provided via s-Par livedumps) made it a
      logical candidate for debugfs.  So this patch moves this sysfs entry to
      debugfs as (assuming traditional debugfs mountpoint):
      
          /sys/kernel/debug/visorbus/visorbus<n>/client_bus_info
      
      Data for this debugfs is emitted using the preferred seq_file interface,
      which allowed a vastly-simplified version of vbuschannel_print_devinfo()
      to format the individual output components.
      
      Functionality was verified as follows:
      
        [root@sparguest visorbus]# mount | grep debug
        debugfs on /sys/kernel/debug type debugfs (rw)
        [root@sparguest visorbus]# pwd
        /sys/kernel/debug/visorbus
        [root@sparguest visorbus]# l visorbus1/
        total 0
        drwxr-xr-x 2 root root 0 Sep 28 16:36 .
        drwxr-xr-x 4 root root 0 Sep 28 16:36 ..
        -r--r----- 1 root root 0 Sep 28 16:36 client_bus_info
        [root@sparguest visorbus]# l visorbus2
        total 0
        drwxr-xr-x 2 root root 0 Sep 28 16:36 .
        drwxr-xr-x 4 root root 0 Sep 28 16:36 ..
        -r--r----- 1 root root 0 Sep 28 16:36 client_bus_info
        [root@sparguest visorbus]# cat visorbus1/client_bus_info
        Client device / client driver info for s-Par Console partition (vbus #1):
           chipset          visorchipset     kernel ver. 4.8.0-rc6-ARCH+
           clientbus        visorbus         kernel ver. 4.8.0-rc6-ARCH+
        [2]keyboard         visorinput       kernel ver. 4.8.0-rc6-ARCH+
        [3]mouse            visorinput       kernel ver. 4.8.0-rc6-ARCH+
        [root@sparguest visorbus]# cat visorbus2/client_bus_info
        Client device / client driver info for s-Par IOVM partition (vbus #2):
           chipset          visorchipset     kernel ver. 4.8.0-rc6-ARCH+
           clientbus        visorbus         kernel ver. 4.8.0-rc6-ARCH+
        [0]ultravnic        visornic         kernel ver. 4.8.0-rc6-ARCH+
        [1]ultravnic        visornic         kernel ver. 4.8.0-rc6-ARCH+
        [2]sparvhba         visorhba         kernel ver. 4.8.0-rc6-ARCH+
      Signed-off-by: default avatarTim Sell <Timothy.Sell@unisys.com>
      Reported-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8217becc
    • Tim Sell's avatar
      staging: unisys: visorbus: move DEVICE_ATTR_RO defs as-per conventions · a25280b3
      Tim Sell authored
      The kernel convention is for DEVICE_ATTR_RO(<attr>) definitions to occur
      immediately after the functions that implement the attribute behaviors.
      DEVICE_ATTR_RO definitions in visorbus_main.c have been moved to comply
      with this convention.
      Signed-off-by: default avatarTim Sell <Timothy.Sell@unisys.com>
      Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a25280b3
    • Shiva Kerdel's avatar
      Staging: speakup: Remove unnecessary space after cast · d290effe
      Shiva Kerdel authored
      The affected files have been modified to remove redundant spaces after
      casts to solve checkpatch.pl checks.
      Signed-off-by: default avatarShiva Kerdel <shiva@exdev.nl>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d290effe
    • Greg Kroah-Hartman's avatar
      Merge tag 'iio-for-4.10b' of... · 7970b9e6
      Greg Kroah-Hartman authored
      Merge tag 'iio-for-4.10b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-testing
      
      Jonathan writes:
      
      Second round of new device support, cleanups and fixes for IIO in the 4.10 cycle
      
      This includes two branch merges for elements that may also go via MFD.
      
      New device support
      * cros_ec
        - new driver to support these Chrome OS contiguous sensors which are behind
          the Chrome OS embedded controller.  Requires a few minor MFD and chrome
          platform changes.  One follow up fix deals with some dependency issues in
          Kconfig.
      * mpu-3050
        - new driver and device tree bindings for this venerable device.
      * st_accel
        - support for the lng2dm an
      
      Driver features
      * ad7192
        - Add DVdd regulator handling
      * ad9832
        - Add DVDD regulator handling
      * at91
        - Suspend and resume support
      * si7020
        - Device tree bindings
      * ti-am335x
        - DMA support - uses dma to accelerate short bursts of read back rather
        than full blown DMA buffer support.  Greatly improved performance.
        Includes an MFD addition to give access to the address needed for DMA.
      * tsl2583
        - Device tree bindings
      
      Cleanups and minor fixes
      * ad7192
        - Fix regulator naming to match datasheet
        - Handle regulator errors correctly (so as to not break deferred probing)
        - Rename reg variable to reflect which regulator it is
      * ad5933
        - Fix regulator naming to match datasheet
        - Handle regulator errors correctly (so as to not break deferred probing)
      * ad7746
        - Fix a missing return value (fallout from previous patch set)
      * ad7780
        - Fix regulator naming to match datasheet
        - Handle regulator errors correctly (so as to not break deferred probing)
      * ad9832
        - Fix regulator naming to match datasheet
        - Handle regulator errors correctly (so as to not break deferred probing)
        - Rename reg regulator to reflect which one it is
      * ad9834
        - Fix regulator naming to match datasheet
        - Handle regulator errors correctly (so as to not break deferred probing)
      * hts221
        - Remove a duplicated include
      * maxim thermocouple
        - Handle a wrong storage side in read function.  Prevent any problems that
        might be introduced by additions to this driver in future.
      * tsl2583 - big set from Brian Masney to drive this towards a staging
        graduation.
        - Convert to iio_chan_spec and read_raw / write_raw (in a couple of steps)
        - Improved error handling in various functions
        - Drop redundant power_state custom sysfs attribute.
        - Use IIO_*_ATTR* macros for remaining attributes.
        - Return an error code to userspace on invalid parameters being writen to
          sysfs files.
        - Add locking to various attribute accesses to remove possible races.
        - Add defines for various magic numbers.
        - Use smbus_read_byte_data instead of a write_byte followed by read_byte.
        - Query only relevant registers in probe.
        - Tidy up ordering of code comments.
        - Remove a pointless power off sequence in taos_chip_on.
        - Don't bother shutting down the chip when updating the lux table.
        The table is held entirely in the driver and doesn't effect the chip at all.
        - Drop a redundant i2c call in taos_als_calibrate where the same register
        is read twice in a row.
      7970b9e6
  2. 06 Nov, 2016 6 commits
    • Brian Masney's avatar
      staging: iio: tsl2583: remove redudant i2c call in taos_als_calibrate() · c2b0d2cf
      Brian Masney authored
      taos_als_calibrate() queries the control register to determine if the
      unit is powered on and has the ADC enabled. It then queries the same
      register a second time to determine if the ADC reading is valid. This
      patch removes the redundant i2c_smbus_read_byte_data() call.
      
      Verified that the driver still functions correctly using a TSL2581
      hooked up to a Raspberry Pi 2.
      Signed-off-by: default avatarBrian Masney <masneyb@onstation.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      c2b0d2cf
    • Brian Masney's avatar
      staging: iio: tsl2583: don't shutdown chip when updating the lux table · 0561155f
      Brian Masney authored
      in_illuminance_lux_table_store() shuts down the chip, updates the
      contents of the lux table, and then turns the chip back on. The values
      in lux table are not used by the chip and are only used internally by
      the driver. It is not necessary to change the power state on the chip.
      This patch removes the calls to taos_chip_off() and taos_chip_on()
      in in_illuminance_lux_table_store().
      Signed-off-by: default avatarBrian Masney <masneyb@onstation.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      0561155f
    • Brian Masney's avatar
      staging: iio: tsl2583: remove redundant power off sequence in taos_chip_on() · babe4447
      Brian Masney authored
      taos_chip_on() explicitly turns the sensor power on and then writes the
      8 registers that are stored in taos_config. The first register in
      taos_config is the CONTROL register and the configuration is set to
      turn the power off. The existing state sequence in taos_chip_on() is:
      
      - Turn device power on
      - Turn device power off (via taos_config)
      - Configure other 7 registers (via taos_config)
      - Turn device power on, enable ADC
      
      This patch changes the code so that the device is not powered off via
      taos_config.
      
      Verified that the driver still functions correctly using a TSL2581
      hooked up to a Raspberry Pi 2.
      Signed-off-by: default avatarBrian Masney <masneyb@onstation.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      babe4447
    • Brian Masney's avatar
      staging: iio: tsl2583: fixed ordering of comments · 4a0f3614
      Brian Masney authored
      in taos_defaults()
      
      The comments in taos_defaults() appear after the line of code
      that they apply to. This patch moves the comments so that they appear
      before the code. Some of the comments were updated to be more
      informative.
      Signed-off-by: default avatarBrian Masney <masneyb@onstation.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      4a0f3614
    • Brian Masney's avatar
      staging: iio: tsl2583: removed unused code from device probing · 6bd0cb2b
      Brian Masney authored
      taos_probe() queries the all of the sensor's registers and loads all of
      the values into a buffer stored on the stack. Only the chip ID register
      was actually used. Change the probe function to just query the chip ID
      register on the device.
      
      Verified that the driver still functions correctly using a TSL2581
      hooked up to a Raspberry Pi 2.
      Signed-off-by: default avatarBrian Masney <masneyb@onstation.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      6bd0cb2b
    • Brian Masney's avatar
      staging: iio: tsl2583: i2c_smbus_write_byte() / i2c_smbus_read_byte() migration · 6ba5dee9
      Brian Masney authored
      There were several places where the driver would first call
      i2c_smbus_write_byte() to select the register on the device, and then
      call i2c_smbus_read_byte() to get the contents of that register. The
      code would look roughly like:
      
      /* Select register */
      i2c_smbus_write_byte(client, REGISTER);
      
      /* Read the the last register that was written to */
      int data = i2c_smbus_read_byte(client);
      
      Rewrite this to use i2c_smbus_read_byte_data() to combine the two
      calls into one:
      
      int data = i2c_smbus_read_byte_data(chip->client, REGISTER);
      
      Verified that the driver still functions correctly using a TSL2581
      hooked up to a Raspberry Pi 2.
      
      This fixes the following warnings that were found by the
      kbuild test robot that were introduced by commit 8ba355cce3c6 ("staging:
      iio: tsl2583: check for error code from i2c_smbus_read_byte()").
      
      drivers/staging/iio/light/tsl2583.c:365:5-12: WARNING: Unsigned
      expression compared with zero: reg_val < 0
      
      drivers/staging/iio/light/tsl2583.c:388:5-12: WARNING: Unsigned
      expression compared with zero: reg_val < 0
      
      This also removes the need for the taos_i2c_read() function since all
      callers were only calling the function with a length of 1.
      Signed-off-by: default avatarBrian Masney <masneyb@onstation.org>
      Cc: Julia Lawall <julia.lawall@lip6.fr>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      6ba5dee9
  3. 05 Nov, 2016 11 commits
  4. 01 Nov, 2016 14 commits