1. 26 4月, 2017 1 次提交
  2. 14 4月, 2017 1 次提交
  3. 02 4月, 2017 1 次提交
    • S
      iio: light: lm3533-als: constify attribute_group structures · 98b6d2b6
      simran singhal 提交于
      Check for attribute_group structures that are only stored in the
      event_attrs filed of iio_info structure. As the event_attrs field of
      iio_info structures is constant, so these attribute_group structures can
      also be declared constant. Done using coccinelle:
      
      @r1 disable optional_qualifier @
      identifier i;
      position p;
      @@
      static struct attribute_group i@p = {...};
      
      @ok1@
      identifier r1.i;
      position p;
      struct iio_info x;
      @@
      x.event_attrs=&i@p;
      
      @bad@
      position p!={r1.p,ok1.p};
      identifier r1.i;
      @@
      i@p
      
      @depends on !bad disable optional_qualifier@
      identifier r1.i;
      @@
      static
      +const
      struct attribute_group i={...};
      
      @depends on !bad disable optional_qualifier@
      identifier r1.i;
      @@
      +const
      struct attribute_group i;
      
      As the attrs field of iio_info structures is also constant, so these
      attribute_group structures can also be declared constant. Done manually.
      
      File size before:
         text    data     bss     dec     hex filename
         5798    2376       0    8174    1fee drivers/iio/light/lm3533-als.o
      
      File size after:
         text	   data	    bss	    dec	    hex	filename
         5926	   2248	      0	   8174	   1fee	drivers/iio/light/lm3533-als.o
      Signed-off-by: Nsimran singhal <singhalsimran0@gmail.com>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      98b6d2b6
  4. 01 4月, 2017 2 次提交
    • S
      iio: light: apds9960: constify attribute_group structures · 3ca437c0
      simran singhal 提交于
      Check for attribute_group structures that are only stored in the
      attrs filed of iio_info structure. As the attrs field of iio_info
      structures is constant, so these attribute_group structures can also be
      declared constant.
      Done using coccinelle:
      
      @r1 disable optional_qualifier @
      identifier i;
      position p;
      @@
      static struct attribute_group i@p = {...};
      
      @ok1@
      identifier r1.i;
      position p;
      struct iio_info x;
      @@
      x.attrs=&i@p;
      
      @bad@
      position p!={r1.p,ok1.p};
      identifier r1.i;
      @@
      i@p
      
      @depends on !bad disable optional_qualifier@
      identifier r1.i;
      @@
      static
      +const
      struct attribute_group i={...};
      
      @depends on !bad disable optional_qualifier@
      identifier r1.i;
      @@
      +const
      struct attribute_group i;
      
      File size before:
         text	   data	    bss	    dec	    hex	filename
         8503	    488	      0	   8991	   231f	drivers/iio/light/apds9960.o
      
      File size after:
         text	   data	    bss	    dec	    hex	filename
         8567	    424	      0	   8991	   231f	drivers/iio/light/apds9960.o
      Signed-off-by: Nsimran singhal <singhalsimran0@gmail.com>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      3ca437c0
    • S
      iio: light: bh1750: constify attribute_group structures · c2869498
      simran singhal 提交于
      Check for attribute_group structures that are only stored in the
      attrs filed of iio_info structure. As the attrs field of iio_info
      structures is constant, so these attribute_group structures can also be
      declared constant.
      Done using coccinelle:
      
      @r1 disable optional_qualifier @
      identifier i;
      position p;
      @@
      static struct attribute_group i@p = {...};
      
      @ok1@
      identifier r1.i;
      position p;
      struct iio_info x;
      @@
      x.attrs=&i@p;
      
      @bad@
      position p!={r1.p,ok1.p};
      identifier r1.i;
      @@
      i@p
      
      @depends on !bad disable optional_qualifier@
      identifier r1.i;
      @@
      static
      +const
      struct attribute_group i={...};
      
      @depends on !bad disable optional_qualifier@
      identifier r1.i;
      @@
      +const
      struct attribute_group i;
      
      File size before:
         text	   data	    bss	    dec	    hex	filename
         2276	    352	      0	   2628	    a44	drivers/iio/light/bh1750.o
      
      File size after:
         text	   data	    bss	    dec	    hex	filename
         2340	    320	      0	   2660	    a64	drivers/iio/light/bh1750.o
      Signed-off-by: Nsimran singhal <singhalsimran0@gmail.com>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      c2869498
  5. 26 3月, 2017 1 次提交
  6. 19 3月, 2017 3 次提交
  7. 26 2月, 2017 1 次提交
  8. 04 2月, 2017 1 次提交
  9. 22 1月, 2017 1 次提交
  10. 21 1月, 2017 1 次提交
  11. 31 12月, 2016 3 次提交
    • A
      iio: max44000: correct value in illuminance_integration_time_available · b4e8a0eb
      Akinobu Mita 提交于
      According to the datasheet, the shortest available integration time for
      ALS ADC conversion is 1.5625ms but illuminance_integration_time_available
      sysfs file shows wrong value.
      
      Cc: Crestez Dan Leonard <leonard.crestez@intel.com>
      Cc: Jonathan Cameron <jic23@kernel.org>
      Cc: Hartmut Knaack <knaack.h@gmx.de>
      Cc: Lars-Peter Clausen <lars@metafoo.de>
      Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Fixes: d5d8f49b ("max44000: Expose ambient sensor scaling")
      Cc: <Stable@vger.kernel.org>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      b4e8a0eb
    • L
      iio: light: add driver for Capella CM3605 · 8afa505c
      Linus Walleij 提交于
      This adds a driver for the Capella Microsystems CM3605 Ambient
      Light Sensor and proximity sensor. This is a pretty simple entirely
      analog device that is interfaced with the target system using
      the POUT (proximity out) and AOUT (ambient light out) signals.
      
      The POUT signal is a simple high/low signal that indicates whether
      an object is in proximity, most typically used to detect a face
      in front of a mobile device. The signal requires that an infrared
      LED is mounted next to the device, making IR light reflect off
      the object in proximity and triggering the POUT signal. We grab
      a GPIO pin to handle the POUT signal as an interrupt line and
      register this as an event channel for the sensor.
      
      Since the proximity sensor requires an IR LED, we add a LED trigger
      named "cm3605" so that the infrared LED can just associate with
      this trigger to be sure it is always on when the proximity sensor
      needs it.
      
      The AOUT is an analog voltage between 0 and 1550 mV that indicate
      the LUX value in the ambient light: this is orthogonal to the
      proximity sensor functionality. Since this analog voltage needs
      to be converted into a digital value, the driver grabs an IIO
      channel named "aout" associated with the device.
      
      This patch created a combined ALS and proximity sensor driver.
      The former supports raw reads of the LUX value and the latter
      will generate proximity events.
      
      To integrate this properly with Linux we also add a supply
      regulator for the VDD pin (driving both functions) and add device
      tree bindings to define the RSET resistor that in turn configures
      the luminosity range of the ALS sensor.
      
      Since the sensor needs to be on more or less constantly, we
      restrict the power management to system suspend/resume: we
      disable the IR LED and disable the regulator for VDD on suspend
      and take them back up on resume.
      
      Tests:
      cd /sys/bus/iio/devices/iio:device1
      cat in_illuminance_raw
      304
      (hold hand over sensor)
      cat in_illuminance_raw
      17
      iio_event_monitor cm3605
      Found IIO device with name cm3605 with device number 1
      (hold hand over sensor)
      Event: time: 2444842301447, type: proximity, channel: 0,
        evtype: thresh, direction: falling
      (remove hand over sensor)
      Event: time: 2445583440706, type: proximity, channel: 0,
        evtype: thresh, direction: rising
      
      Cc: Capella Microsystems <capellamicro@gmail.com>
      Cc: Kevin Tsai <ktsai@capellamicro.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      8afa505c
    • K
      iio: light: hid-sensor-als: Add duplicate IIO_LIGHT channel · 578f8d77
      Kweh, Hock Leong 提交于
      There is one light sensor type defined in the sensor hub specification,
      which has one Illuminance field. It doesn't distinguish between ambient
      light sensor or color sensor. Currently it is presented as IIO_INTENSITY
      channel. There are some user spaces specifically looking for IIO_LIGHT
      channel.
      To satisfy such user spaces this change also add a duplicate IIO_LIGHT
      channel. The units of measurement of Illuminance field is Lux, so it is
      still compatible to IIO ABI.
      Signed-off-by: NKweh, Hock Leong <hock.leong.kweh@intel.com>
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      578f8d77
  12. 04 12月, 2016 1 次提交
  13. 25 11月, 2016 1 次提交
  14. 13 11月, 2016 1 次提交
  15. 24 10月, 2016 3 次提交
  16. 28 9月, 2016 1 次提交
  17. 19 9月, 2016 1 次提交
  18. 16 8月, 2016 1 次提交
  19. 15 8月, 2016 2 次提交
  20. 10 7月, 2016 4 次提交
  21. 03 7月, 2016 1 次提交
  22. 01 7月, 2016 1 次提交
  23. 12 6月, 2016 4 次提交
  24. 03 6月, 2016 1 次提交
  25. 30 5月, 2016 2 次提交