1
0
Fork 0
Commit Graph

57 Commits (30c0aa394321b5ce9b3bc08ce4882a05fefcf094)

Author SHA1 Message Date
Greg Kroah-Hartman ec3c13e4ac Third set of IIO new device support, features and cleanups for the 4.6 cycle.
Good to see several new contributors in this set - and more generally a
 number of new 'faces' over this whole cycle.
 
 Staging movements
 * hmc5843
   - out of staging.
 * periodic RTC trigger
   - driver dropped.  This is an ancient driver (brings back some memories ;)
   that was always somewhat of a bodge. Originally there was a driver that
   never went into mainline that supported large numbers of periodict timers
   on the PXA270 via this route. Discussions to have a generic periodic
   timer subsystem never went anywhere.  At the time RTC periodic
   interrupts were real - now they are emulated using high resolution
   timers so with the HRT driver this has become pointless.
 
 New device support
 * mpu6050 driver
   - Add support for the mpu6500.
 * TI tpl0102 potentiometer
   - new driver.
 * Vybrid SoC DAC
   - new driver.  The ADC on this SoC has been supported for a while, this
     adds a separate driver for the DAC.
 
 New Features
 * hmc5844
   - Attributes to configure the bias current (typically part of a self test)
     This could be done before via a somewhat obscure custom interface.
     This at least makes it easy to tell what is going on.
   - Document all custom attributes.
 * mpu6050
   - Add support for calibration offset control and readback.
 * ms5611
   - power regulator support.  This is always one that gets added the
     first time someone has a board that needs it.  Here it was needed,
     hence it was added.
 
 Cleanups / minor fixes
 * tree wide
   - clean up all the myriad different return values in response to a
     failure of i2c_check_functionality.  After discussions everyone seemed
     happy wiht -EOPNOTSUPP which seems to describe the situation well.
     I encouraged a tree wide cleanup to set a good example in future for
     this.
 * core
   - Typos in the iio_event_spec documentation in iio.h
 * afe4403
   - select REGMAP_SPI to avoid dependency issues
   - mark suspend/resume as __maybe_unused to avoid warnings
 * afe4404
   - mark suspend/resume as __maybe_unused to avoid warnings
 * atlas-ph-sensor
   - switch the regmap cache type from linear to rbtree to gain reading of
     registers on initial startup.  It's not immediately obvious, but
     regmap flat is meant for high performances cases so doesn't read these
     registers.
   - use regmap_bulk_read in one case where it was using
     i2c_smbus_read_i2c_block_data directly (unlike everything else that was
     through regmap).
 * ina2xx
   - stype cleanups (lots of them!)
 * isl29018
   - Get the struct device back from regmap rather than storing another
     copy of it in the private data.  This cleanup makes sense in a number
     of other drivers so patches may well follow.
 * mpu6050
   - style cleanups (lots of them!)
   - improved return value handling
   - use usleep_range to avoid the usual issues with very short msleeps.
   - add some missing documentation.
 * ms5611
   - use the probed device name for the device rather than the driver name.
   - select IIO_BUFFER to avoid dependency issues
 * palmas
   - drop IRQF_EARLY_RESUME as no longer needed after genirq changes.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJW0ygBAAoJEFSFNJnE9BaIJDQP/RpVwCxgxgUi0QyuLFAfQ0Ab
 FJFZznvmK6aGtGBAt/uKwBD5K/JcX9zGgm82j10+rVCtnLxFmusNXB180jUjvknu
 ZAEzJ58IWX+FqEsbVUZsx8qpef+yCCLP/HHvyctqXhtVTrlVlyoGSfn6+xzP3766
 PxkXpdWSd3IEdITYZrZo7BsZ6h6Tjz9c4i40f3RdnEce48nNnzM5IKMNbvU2puRs
 NxGDXflKKkA5N4uIW2n6pLxIyyW/LdwChmHkR+U7dxxj3/wUK9BC46qvhyqtgC3I
 U6uYCI+p2up22bfQsZ+p/CKRRhhrOtBs9//wSMapK96CVbI3HGcJLZP1yJENwfW8
 5sWEypaZNlpZVnjtREQpk5oz2hOsunxI+7FHSqUjLe+wwON79WXVFZz2qx3NcIle
 YPZFIQiYZTVauE/PsPy22I2vBoHxpgsD+A8M1d4+nQAH8SkRqvnnu5WVgd3ftm/u
 kXUjj+s+M1Pn84EIWYlEaIypAnhaNgIDW8M269rRdC0hH6yAxjJ9PXm45TGcRxr/
 qmkUKfD5wfPgE3FwYoyH8da22dc7dRSgLdizxtSS7rInmFH1HJ3xb566VszXsPVH
 tJjM2KtIC16czGUh5V+MmCpdSfOT1wR0wFPdUhGoJGm7sGkTsuoQRkQzgHwJM/aF
 ITuCZWLR/2YXw0bx4MKM
 =rDIQ
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-4.6c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Third set of IIO new device support, features and cleanups for the 4.6 cycle.

Good to see several new contributors in this set - and more generally a
number of new 'faces' over this whole cycle.

Staging movements
* hmc5843
  - out of staging.
* periodic RTC trigger
  - driver dropped.  This is an ancient driver (brings back some memories ;)
  that was always somewhat of a bodge. Originally there was a driver that
  never went into mainline that supported large numbers of periodict timers
  on the PXA270 via this route. Discussions to have a generic periodic
  timer subsystem never went anywhere.  At the time RTC periodic
  interrupts were real - now they are emulated using high resolution
  timers so with the HRT driver this has become pointless.

New device support
* mpu6050 driver
  - Add support for the mpu6500.
* TI tpl0102 potentiometer
  - new driver.
* Vybrid SoC DAC
  - new driver.  The ADC on this SoC has been supported for a while, this
    adds a separate driver for the DAC.

New Features
* hmc5844
  - Attributes to configure the bias current (typically part of a self test)
    This could be done before via a somewhat obscure custom interface.
    This at least makes it easy to tell what is going on.
  - Document all custom attributes.
* mpu6050
  - Add support for calibration offset control and readback.
* ms5611
  - power regulator support.  This is always one that gets added the
    first time someone has a board that needs it.  Here it was needed,
    hence it was added.

Cleanups / minor fixes
* tree wide
  - clean up all the myriad different return values in response to a
    failure of i2c_check_functionality.  After discussions everyone seemed
    happy wiht -EOPNOTSUPP which seems to describe the situation well.
    I encouraged a tree wide cleanup to set a good example in future for
    this.
* core
  - Typos in the iio_event_spec documentation in iio.h
* afe4403
  - select REGMAP_SPI to avoid dependency issues
  - mark suspend/resume as __maybe_unused to avoid warnings
* afe4404
  - mark suspend/resume as __maybe_unused to avoid warnings
* atlas-ph-sensor
  - switch the regmap cache type from linear to rbtree to gain reading of
    registers on initial startup.  It's not immediately obvious, but
    regmap flat is meant for high performances cases so doesn't read these
    registers.
  - use regmap_bulk_read in one case where it was using
    i2c_smbus_read_i2c_block_data directly (unlike everything else that was
    through regmap).
* ina2xx
  - stype cleanups (lots of them!)
* isl29018
  - Get the struct device back from regmap rather than storing another
    copy of it in the private data.  This cleanup makes sense in a number
    of other drivers so patches may well follow.
* mpu6050
  - style cleanups (lots of them!)
  - improved return value handling
  - use usleep_range to avoid the usual issues with very short msleeps.
  - add some missing documentation.
* ms5611
  - use the probed device name for the device rather than the driver name.
  - select IIO_BUFFER to avoid dependency issues
* palmas
  - drop IRQF_EARLY_RESUME as no longer needed after genirq changes.
2016-03-01 16:31:55 -08:00
Alison Schofield 646708693e staging: iio: isl29018: use regmap to retrieve struct device
Remove struct device from drivers global data and use regmap
API to retrieve device info instead.

This replacement can be done for drivers that include regmap
in their global data.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-24 21:15:24 +00:00
Eva Rachel Retuya 7f3829a354 staging: iio: light: fix block comments according to kernel coding style
Add the trailing */ accordingly to suit the preferred way of placing
block comments.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:45:56 -08:00
Eva Rachel Retuya 79783b31d5 staging: iio: light: omit space after a cast
Remove the unneeded space as pointed out by checkpatch:
CHECK: No space is necessary after a cast

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:45:56 -08:00
Eva Rachel Retuya ca52c88cac staging: iio: light: indent to match open parenthesis
Indent the parameters to match open parenthesis as suggested by checkpatch.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:45:56 -08:00
Bhumika Goyal 6d9b10c866 Staging: iio: light: remove exceptional & on function name
In this file,function names are otherwise used as pointers without &.
Found using coccinelle.
// <smpl>
@r@
identifier f;
@@

f(...) { ... }
@@
identifier r.f;
@@

- &f
+ f
// </smpl>

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:44:06 -08:00
Cristina Moraru 1c58f0eb9c staging: iio: Remove unused variable
Remove variable that is initialized but not used.

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 14:49:09 +09:00
Cristina Moraru d59b7b6834 staging: iio: light: Remove explicit comparisons
Remove comparisons to 0 or NULL

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:32:09 -07:00
Krzysztof Kozlowski 071667a0fa staging: iio: Drop owner assignment from i2c_driver
i2c_driver does not need to set an owner because i2c_register_driver()
will set it.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-07-11 18:47:05 +01:00
Jonathan Cameron b91617ea62 staging:iio:light: Add some missing brackets to make sure code works as intended.
Note this is not a bug due to the fact the region cannot be reached without the sanity check passing. The autobuilder reported it as missaligned code which is kind of true as well.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: Roberta Dobrescu <roberta.dobrescu@gmail.com>
2015-05-07 10:42:17 +01:00
Roberta Dobrescu 6920ccf65d staging: iio: light: isl29018: Use standard sysfs attributes for scale and integration time
This patch refactors the isl29018 driver code in order to use standard
sysfs attributes for scale and integration time.

ISL29018 light sensor uses four ranges and four ADC's resolutions
which influence the calculated lux. Adc resolution is strongly
connected to integration time and range should be controlled by scale.

This patch introduces the usage of integration time and scale instead
of adc resolution and range.

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-04-30 21:55:35 +01:00
Roberta Dobrescu 809a591b16 staging: iio: light: isl29018: Rename lux_scale to calibscale
This patch renames lux_scale to calibscale and lux_uscale to
ucalibscale.

This is done in order to avoid confusion since these parameters are
used for hardware applied calibration.

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-04-26 20:46:18 +01:00
Roberta Dobrescu e98ceca076 staging: iio: light: isl29018: Remove non-standard sysfs attributes
This patch removes non-standard sysfs attributes range, range_available,
adc_resolution and adc_resolution_available. It also removes the
corresponding show and store functions.

This is in preparation for using standard IIO attributes in order to move
the code out of staging.

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-04-26 20:45:38 +01:00
Roberta Dobrescu ad3e646c5b staging: iio: light: Fix quoted string split across lines
This fixes the following checkpatch.pl warning:
WARNING: quoted string split across lines

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 22:20:30 -04:00
Vaishali Thakkar 890d228fd9 Staging: iio: light: Use usleep_range instead of msleep
This patch fixes following checkpatch.pl warning:

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 13:31:36 -07:00
Laurentiu Palcu dc4ecaf21c staging: iio: light: isl29018: add ACPI support
Add support for enumerating the device through ACPI.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-09-13 17:55:54 +01:00
Laurentiu Palcu 609acefa46 staging: iio: light: isl29018: add support for isl29023 and isl29035
Intersil chips ISL29018, ISL29023 and ISL29035 are very similar. They're
all ambience light sensors. The ISL29018, however, is also a proximity
sensor. The registers are similar too:

-------------+----------+----------
AVAILABLE IN | ADDR REG | NAME
   290xx     |          |
-------------+----------+----------
     18/23/35|       00h| COMMANDI
     18/23/35|       01h| COMMANDII (B4-7 are used only in 29018 for proximity)
     18/23/35|       02h| DATALSB
     18/23/35|       03h| DATAMSB
     18/23/35|       04h| INT_LT_LSB
     18/23/35|       05h| INT_LT_MSB
     18/23/35|       06h| INT_HT_LSB
     18/23/35|       07h| INT_HT_MSB
        18/23|       08h| TEST
           35|       0Fh| ID
-------------+----------+-----------

So, this patch will add support for ISL29023 and ISL29035 to the
existing isl29018 driver. Since these 2 chips don't have proximity
detection, the proximity sysfs attribute is not needed.

Also, for ISL29035, since it has an ID register, make use of it in order
to properly detect the chip and clear the brownout bit.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-08-30 11:12:36 +01:00
Laurentiu Palcu 5b4b5b9c68 staging: iio: light: isl29018: fix typo
isl29108 was used, instead of isl29018.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-08-30 11:02:36 +01:00
Teodora Baluta 18210923ab staging: iio: isl29018: fix sparse warning regarding incorrect type (different signedness)
Fix the following sparse warning:

drivers/staging/iio/light/isl29018.c:508:50: warning: incorrect type in
argument 3 (different signedness)
drivers/staging/iio/light/isl29018.c:508:50:    expected unsigned int
*conf_adc_bit
drivers/staging/iio/light/isl29018.c:508:50:    got int *<noident>

Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-08-02 17:35:23 +01:00
Sachin Kamat 8664ed09aa staging: iio: isl29018: Use devm_iio_device_register
devm_iio_device_register simplifies the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-24 21:07:22 +00:00
Greg Kroah-Hartman e2aad1d571 Merge 3.12-rc2 into staging-next.
This resolves the merge problem with two iio drivers that Stephen
Rothwell pointed out.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25 08:59:04 -07:00
Derek Basehore 5e64897638 iio: isl29018: Fix uninitialized value
The lux_uscale value is not initialized at probe. The value will be
uninitialized unless a value is written to it through the iio channel interface.
This fixes that.

Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/65998
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-18 19:43:25 +01:00
Jingoo Han e5e26dd5bb staging: iio: replace strict_strto*() with kstrto*()
The usage of strict_strto*() is not preferred, because
strict_strto*() is obsolete. Thus, kstrto*() should be
used.

Previously, there were only strict_strtol(), strict_strtoul(),
strict_strtoull(), and strict_strtoll(). Thus, when converting
to the variables, only long, unsigned long, unsigned long long,
and long long can be used.

However, kstrto*() provides various functions handling all types
of variables. Therefore, the types of variables can be changed
properly.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-08 15:16:07 +01:00
Sachin Kamat e434dcf391 staging: iio: light: isl29018: Use devm_iio_device_alloc
Using devm_iio_device_alloc makes code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03 18:41:08 +01:00
Jonathan Cameron f7bd0978b1 staging:iio:light:isl29018 move to info_mask_(shared_by_type/separate)
The original info_mask is going away in favour of the broken out versions.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Rhyland Klein <rklein@nvidia.com>
2013-03-17 19:49:40 +00:00
Bill Pemberton e543acf07d staging: iio: remove use of __devexit_p
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 15:02:23 -08:00
Bill Pemberton 447d4f29ee staging: iio: remove use of __devexit
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 14:59:37 -08:00
Bill Pemberton 4ae1c61ff2 staging: iio: remove use of __devinit
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 14:31:41 -08:00
Wei Yongjun 6dc973d4fd iio: isl29018: fix to return error or 0 in isl29018_write_raw()
We had assigned the return value to 'ret' but ignored it when
return from isl29018_write_raw(), it's better to return 'ret'
instead of 0.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19 22:22:04 +00:00
Bryan Freed 1e45cf3c49 iio: isl29018: Support suspend and resume.
The driver leaves the device in power-down state anyway,
so there is nothing to do on suspend.
On resume, we just have to make sure the range and ADC
values are updated in the device since it may have been
powered down in suspend.

Signed-off-by: Bryan Freed <bfreed@chromium.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-02 09:50:59 +00:00
Bryan Freed 932323b74e iio: isl29018: Support fractional ALS scaling.
The Industrial IO framework supports scaling ADC values by fractions,
but most drivers default to using whole numbers.
This change turns on fractional scaling in the isl29018 driver.

Signed-off-by: Bryan Freed <bfreed@chromium.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-08 10:25:10 +01:00
Peter Meerwald 2a1d45ecc8 iio staging: fix spelling of suppression in isl29018
beware, does change the ABI as proximity_on_chip_ambient_infrared_supression
is changed to proximity_on_chip_ambient_infrared_suppression

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:29:29 -07:00
Lars-Peter Clausen 96f691f9bf staging:iio:light: Use dev_to_iio_dev()
Replace open-coded instances of getting a iio_dev struct from a device struct
with dev_to_iio_dev().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:39:21 -07:00
Lars-Peter Clausen 7cbb753701 staging:iio: Streamline API function naming
Currently we use two different naming schemes in the IIO API, iio_verb_object
and iio_object_verb. E.g iio_device_register and iio_allocate_device. This
patches renames instances of the later to the former. The patch also renames allocate to
alloc as this seems to be the preferred form throughout the kernel.

In particular the following renames are performed by the patch:
	iio_put_device -> iio_device_put
	iio_allocate_device -> iio_device_alloc
	iio_free_device -> iio_device_free
	iio_get_trigger -> iio_trigger_get
	iio_put_trigger -> iio_trigger_put
	iio_allocate_trigger -> iio_trigger_alloc
	iio_free_trigger -> iio_trigger_free

The conversion was done with the following coccinelle patch with manual fixes to
comments and documentation.

<smpl>
@@
@@
-iio_put_device
+iio_device_put
@@
@@
-iio_allocate_device
+iio_device_alloc
@@
@@
-iio_free_device
+iio_device_free
@@
@@
-iio_get_trigger
+iio_trigger_get
@@
@@
-iio_put_trigger
+iio_trigger_put
@@
@@
-iio_allocate_trigger
+iio_trigger_alloc
@@
@@
-iio_free_trigger
+iio_trigger_free
</smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-29 21:23:49 -04:00
Jonathan Cameron 06458e277e IIO: Move core headers to include/linux/iio
Step 1 in moving the IIO core out of staging.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-25 11:01:43 -07:00
Laxman Dewangan 057340e3de staging: iio: light: isl29018: use regmap for register access
Using regmap for accessing register through i2c bus. This will
remove the code for caching registers, read-modify-write logics.
Also it will provide the debugfs feature to dump register
through regmap debugfs.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24 11:02:14 -07:00
Laxman Dewangan 610202ddc6 staging: iio: light: of: Fix vendor prefix of isl29018/isl29028
ISL29018/ISL29028 is from Intersil Corporation and making the
vendor prefix for this part as "isil" for OF compatibity.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24 11:02:14 -07:00
Jonathan Cameron 251640a74b staging:iio: drop procesed_val element of chan_spec.
There is no longer any need for this as we have separate
info_mask elements for raw and processed value reads.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18 16:38:21 -07:00
Jonathan Cameron 90354d0038 staging:iio:light Add IIO_CHAN_INFO_RAW/PROCESSED entries to all drivers.
Precursor to making value read / write attribute optional.
Note that minimal change route taken here. The read_raw callbacks
in both drivers could do fewer checks to identify the channel than
they now do.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18 16:38:20 -07:00
Olof Johansson 4ee195241a staging:iio: isl29018: add of_match table for device-tree probing
As simple as can be right now; just one ID and no custom properties to parse.

Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 10:03:51 -08:00
Linus Torvalds 12e5550892 Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
* 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (466 commits)
  net/hyperv: Add support for jumbo frame up to 64KB
  net/hyperv: Add NETVSP protocol version negotiation
  net/hyperv: Remove unnecessary kmap_atomic in netvsc driver
  staging/rtl8192e: Register against lib80211
  staging/rtl8192e: Convert to lib80211_crypt_info
  staging/rtl8192e: Convert to lib80211_crypt_data and lib80211_crypt_ops
  staging/rtl8192e: Add lib80211.h to rtllib.h
  staging/mei: add watchdog device registration wrappers
  drm/omap: GEM, deal with cache
  staging: vt6656: int.c, int.h: Change return of function to void
  staging: usbip: removed unused definitions from header
  staging: usbip: removed dead code from receive function
  staging:iio: Drop {mark,unmark}_in_use callbacks
  staging:iio: Drop buffer mark_param_change callback
  staging:iio: Drop the unused buffer enable() and is_enabled() callbacks
  staging:iio: Drop buffer busy flag
  staging:iio: Make sure a device is only opened once at a time
  staging:iio: Disallow modifying buffer size when buffer is enabled
  staging:iio: Disallow changing scan elements in all buffered modes
  staging:iio: Use iio_buffer_enabled instead of open coding it
  ...

Fix up conflict in drivers/staging/iio/adc/ad799x_core.c (removal of
module_init due to using module_i2c_driver() helper, next to removal of
MODULE_ALIAS due to using MODULE_DEVICE_TABLE instead).
2012-01-09 12:18:17 -08:00
Jonathan Cameron c8a9f8056f staging:iio:treewide only use shared to decide on interfaces
Internally the fact that say scale is shared across channels is
actually of remarkably little interest.  Hence lets not store it.
Numerous devices have weird combinations of channels sharing
scale anyway so it is not as though this was really telling
us much. Note however that we do still use the shared sysfs
attrs thus massively reducing the number of attrs in complex
drivers.

Side effect is that certain drivers that were abusing this
(mostly my work) needed to do a few more checks on what the
channel they are being queried on actually is.

This is also helpful for in kernel interfaces where we
just want to query the scale and don't care whether it
is shared with other channels or not.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:35:04 -08:00
Lars-Peter Clausen 924f8a21dd staging:iio: Do not use bitmasks for channel info addresses
Currently the iio framework uses bitmasks for the address field of channel info
attributes. This is for historical reasons and no longer required since it will
only ever query a single info attribute at once. This patch changes the code to
use the non-shifted iio_chan_info_enum values for the info attribute address.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:35:04 -08:00
Lars-Peter Clausen 6e5af184f8 staging:iio: Use module_i2c_driver to register I2C drivers
Use the newly introduced module_i2c_driver macro for registering I2C drivers.
This allows us to remove a few lines of boilerplate code.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-17 12:15:39 -08:00
Jonathan Cameron d2fffd6c2f staging:iio: fix removal path to allow correct freeing.
Fix a dumb lack of consideration of the effect of combining
the iio_device_unregister and iio_free_device calls into
one.  There is no valid place to free some of the sysfs
array elements.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-17 15:34:53 -07:00
Jonathan Cameron 4a70513074 staging:iio:lisght:isl29018 use IIO_PROCESSED enum value.
No functional change, just a trivial tidy up so all drivers
do the same thing.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-05 13:47:46 -07:00
Jonathan Cameron 25d7315a19 staging:iio:light: V3 fix out of bounds reg_cache[] access
V3 is a straightforward forward port to teh current tree of V2.

Simple fix is to just not cache REG_TEST (offset 8).
Cache doesn't help REG_TEST anyway since we write all 8 bits exactly once
(at resume/init time).

Also fix an "off-by-one" allocation of reg_cache[] array size that
was in the original code before I touched it.

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Grant Grundler <grundler@chromium.org>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-09 13:47:30 -07:00
Jonathan Cameron 9dd1cb303c staging:iio: push "sysfs.h" and linux/irq.h out of iio.h
These are no longer needed.
Requires a few driver updates for places "sysfs.h" should have been
present but wasn't.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:00:28 -07:00
Grant Grundler 176f9f29ce STAGING:iio:light: fix ISL29018 init to handle brownout
After a voltage brownout, sensor will now operate correctly.

Page 10 of ISL29018 data sheet and the Intersil Application Note 1534
describe the required initialization sequence:
1. Write 0x00 to register 0x08 (TEST)
2. Write 0x00 to register 0x00 (CMD1)
3. msleep(1)
4. program remaining registers as before

Signed-off-by: Grant Grundler <grundler@chromium.org>
Reviewed-by: Bryan Freed <bfreed@chromium.org>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 13:39:48 -07:00
Bryan Freed 01e57c5742 staging:iio:light:isl29018: Convert some of the isl29018 driver to the new iio_chan_spec framework.
Remove the driver's get_sensor_data() interfaces and replace them with
iio_chan_spec channels.  This converts 4 files to the new framework.
Driver ABI change: The intensity_infrared_raw file is now intensity_ir_raw.

Signed-off-by: Bryan Freed <bfreed@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08 14:11:49 -07:00