aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-25 21:42:40 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-25 21:42:40 -0500
commit3ce5ae8d46eed6cdaf38f5c8276f8c66f403d0d6 (patch)
tree91e35051672245d46c20196e4fce7669d91e6f85 /include
parentfa590c222fbaa428edb2ce2194638906cea1400a (diff)
parent794a870e776717ccbd27676a551250613de9c40c (diff)
Merge tag 'iio-for-3.14a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes: First set of new features, drivers and cleanups for IIO in the 3.14 cycle. This mostly consists of patches that didn't quite make the last cycle. Lots of interesting things under review currently. Core: - Add devm_iio_device_register/unregister. I took some convincing on whether there would be many devices that really were simple enough to need no explicit actions on removal. Turns out there are some. - Move some stray docs to above the relevant implemenation. - Drop a redundant repeated check on the fact the trigger has actually changed when there is a userspace attempt change it. Drivers: New drivers - Freescale MPL3115A2 Pressure / temperature sensor New functionality - hid_sensors: add sensitivity support. DT bindings - tsl2563 - hmc5843 Cleanups - Drop unused scan_type from viperboard adc driver. - devm_iio_device_register used in viperboard, ad5421, ad5755, adis16130, adxrs450, vcnl4000, adis16220, ad7816, lpc32xx, adt7316, adis16060, isl29018 and ad2s1200. Note that this was proposed in a number of other drivers and this revealed a number of missorderings in remove functions. Also for now I have blocked this on any device that any hardware suspend suport on the basis that we probably want to power down devices if they have no driver support loaded.
Diffstat (limited to 'include')
-rw-r--r--include/linux/hid-sensor-ids.h8
-rw-r--r--include/linux/iio/iio.h81
2 files changed, 10 insertions, 79 deletions
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h
index 4f945d3ed49f..4cc165887b09 100644
--- a/include/linux/hid-sensor-ids.h
+++ b/include/linux/hid-sensor-ids.h
@@ -23,22 +23,26 @@
23 23
24/* Accel 3D (200073) */ 24/* Accel 3D (200073) */
25#define HID_USAGE_SENSOR_ACCEL_3D 0x200073 25#define HID_USAGE_SENSOR_ACCEL_3D 0x200073
26#define HID_USAGE_SENSOR_DATA_ACCELERATION 0x200452
26#define HID_USAGE_SENSOR_ACCEL_X_AXIS 0x200453 27#define HID_USAGE_SENSOR_ACCEL_X_AXIS 0x200453
27#define HID_USAGE_SENSOR_ACCEL_Y_AXIS 0x200454 28#define HID_USAGE_SENSOR_ACCEL_Y_AXIS 0x200454
28#define HID_USAGE_SENSOR_ACCEL_Z_AXIS 0x200455 29#define HID_USAGE_SENSOR_ACCEL_Z_AXIS 0x200455
29 30
30/* ALS (200041) */ 31/* ALS (200041) */
31#define HID_USAGE_SENSOR_ALS 0x200041 32#define HID_USAGE_SENSOR_ALS 0x200041
33#define HID_USAGE_SENSOR_DATA_LIGHT 0x2004d0
32#define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1 34#define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1
33 35
34/* Gyro 3D: (200076) */ 36/* Gyro 3D: (200076) */
35#define HID_USAGE_SENSOR_GYRO_3D 0x200076 37#define HID_USAGE_SENSOR_GYRO_3D 0x200076
38#define HID_USAGE_SENSOR_DATA_ANGL_VELOCITY 0x200456
36#define HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS 0x200457 39#define HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS 0x200457
37#define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458 40#define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458
38#define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459 41#define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459
39 42
40/* ORIENTATION: Compass 3D: (200083) */ 43/* ORIENTATION: Compass 3D: (200083) */
41#define HID_USAGE_SENSOR_COMPASS_3D 0x200083 44#define HID_USAGE_SENSOR_COMPASS_3D 0x200083
45#define HID_USAGE_SENSOR_DATA_ORIENTATION 0x200470
42#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471 46#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471
43#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472 47#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472
44#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Y 0x200473 48#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Y 0x200473
@@ -117,4 +121,8 @@
117#define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316 121#define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316
118#define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319 122#define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319
119 123
124/* Per data field properties */
125#define HID_USAGE_SENSOR_DATA_MOD_NONE 0x00
126#define HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_ABS 0x1000
127
120#endif 128#endif
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 256a90a1bea6..5b125fd554e4 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -490,32 +490,12 @@ struct iio_dev {
490#endif 490#endif
491}; 491};
492 492
493/**
494 * iio_find_channel_from_si() - get channel from its scan index
495 * @indio_dev: device
496 * @si: scan index to match
497 */
498const struct iio_chan_spec 493const struct iio_chan_spec
499*iio_find_channel_from_si(struct iio_dev *indio_dev, int si); 494*iio_find_channel_from_si(struct iio_dev *indio_dev, int si);
500
501/**
502 * iio_device_register() - register a device with the IIO subsystem
503 * @indio_dev: Device structure filled by the device driver
504 **/
505int iio_device_register(struct iio_dev *indio_dev); 495int iio_device_register(struct iio_dev *indio_dev);
506
507/**
508 * iio_device_unregister() - unregister a device from the IIO subsystem
509 * @indio_dev: Device structure representing the device.
510 **/
511void iio_device_unregister(struct iio_dev *indio_dev); 496void iio_device_unregister(struct iio_dev *indio_dev);
512 497int devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev);
513/** 498void devm_iio_device_unregister(struct device *dev, struct iio_dev *indio_dev);
514 * iio_push_event() - try to add event to the list for userspace reading
515 * @indio_dev: IIO device structure
516 * @ev_code: What event
517 * @timestamp: When the event occurred
518 **/
519int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp); 499int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp);
520 500
521extern struct bus_type iio_bus_type; 501extern struct bus_type iio_bus_type;
@@ -579,10 +559,6 @@ static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev)
579 559
580/* Can we make this smaller? */ 560/* Can we make this smaller? */
581#define IIO_ALIGN L1_CACHE_BYTES 561#define IIO_ALIGN L1_CACHE_BYTES
582/**
583 * iio_device_alloc() - allocate an iio_dev from a driver
584 * @sizeof_priv: Space to allocate for private structure.
585 **/
586struct iio_dev *iio_device_alloc(int sizeof_priv); 562struct iio_dev *iio_device_alloc(int sizeof_priv);
587 563
588static inline void *iio_priv(const struct iio_dev *indio_dev) 564static inline void *iio_priv(const struct iio_dev *indio_dev)
@@ -596,64 +572,11 @@ static inline struct iio_dev *iio_priv_to_dev(void *priv)
596 ALIGN(sizeof(struct iio_dev), IIO_ALIGN)); 572 ALIGN(sizeof(struct iio_dev), IIO_ALIGN));
597} 573}
598 574
599/**
600 * iio_device_free() - free an iio_dev from a driver
601 * @indio_dev: the iio_dev associated with the device
602 **/
603void iio_device_free(struct iio_dev *indio_dev); 575void iio_device_free(struct iio_dev *indio_dev);
604
605/**
606 * devm_iio_device_alloc - Resource-managed iio_device_alloc()
607 * @dev: Device to allocate iio_dev for
608 * @sizeof_priv: Space to allocate for private structure.
609 *
610 * Managed iio_device_alloc. iio_dev allocated with this function is
611 * automatically freed on driver detach.
612 *
613 * If an iio_dev allocated with this function needs to be freed separately,
614 * devm_iio_device_free() must be used.
615 *
616 * RETURNS:
617 * Pointer to allocated iio_dev on success, NULL on failure.
618 */
619struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv); 576struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv);
620
621/**
622 * devm_iio_device_free - Resource-managed iio_device_free()
623 * @dev: Device this iio_dev belongs to
624 * @indio_dev: the iio_dev associated with the device
625 *
626 * Free iio_dev allocated with devm_iio_device_alloc().
627 */
628void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev); 577void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev);
629
630/**
631 * devm_iio_trigger_alloc - Resource-managed iio_trigger_alloc()
632 * @dev: Device to allocate iio_trigger for
633 * @fmt: trigger name format. If it includes format
634 * specifiers, the additional arguments following
635 * format are formatted and inserted in the resulting
636 * string replacing their respective specifiers.
637 *
638 * Managed iio_trigger_alloc. iio_trigger allocated with this function is
639 * automatically freed on driver detach.
640 *
641 * If an iio_trigger allocated with this function needs to be freed separately,
642 * devm_iio_trigger_free() must be used.
643 *
644 * RETURNS:
645 * Pointer to allocated iio_trigger on success, NULL on failure.
646 */
647struct iio_trigger *devm_iio_trigger_alloc(struct device *dev, 578struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,
648 const char *fmt, ...); 579 const char *fmt, ...);
649
650/**
651 * devm_iio_trigger_free - Resource-managed iio_trigger_free()
652 * @dev: Device this iio_dev belongs to
653 * @iio_trig: the iio_trigger associated with the device
654 *
655 * Free iio_trigger allocated with devm_iio_trigger_alloc().
656 */
657void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig); 580void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig);
658 581
659/** 582/**