Commit graph

8 commits

Author SHA1 Message Date
Alexandru Ardelean d3be83244c iio: remove explicit IIO device parent assignment
This patch applies the semantic patch:
@@
expression I, P, SP;
@@
   I = devm_iio_device_alloc(P, SP);
   ...
-  I->dev.parent = P;

It updates 302 files and does 307 deletions.
This semantic patch also removes some comments like
'/* Establish that the iio_dev is a child of the i2c device */'

But this is is only done in case where the block is left empty.

The patch does not seem to cover all cases. It looks like in some cases a
different variable is used in some cases to assign the parent, but it
points to the same reference.
In other cases, the block covered by ... may be just too big to be covered
by the semantic patch.

However, this looks pretty good as well, as it does cover a big bulk of the
drivers that should remove the parent assignment.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-06-14 11:49:59 +01:00
David Heidelberg 9c088c020d iio: light: al3320a allow module autoload and polish
- allow autoloading when build as module and defined inside DT

Signed-off-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-03-08 17:28:35 +00:00
David Heidelberg 3a271275fa iio: light: al3320a implement devm_add_action_or_reset
Use devm_add_action_or_reset to automatically disable the device
and allow you to get rid of the remove function entirely.

Signed-off-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-03-08 17:28:35 +00:00
David Heidelberg c39a05e352 iio: light: al3320a implement suspend support
AL3320a is fairly simple chip, so for suspend is enough to disable and
later enable it again.

Signed-off-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-03-08 17:28:34 +00:00
David Heidelberg 58d22a911d iio: light: al3320a slightly improve code formatting
- modified to be in part with al3010 driver
- cleanup using bitfield, no functionality change intended

Signed-off-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-03-08 17:28:34 +00:00
Thomas Gleixner 36edc93958 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 330
Based on 1 normalized pattern(s):

  this file is subject to the terms and conditions of version 2 of the
  gnu general public license see the file copying in the main
  directory of this archive for more details

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 55 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190530000436.108941081@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-05 17:37:06 +02:00
Jonathan Cameron 4166b47c2b iio:light: drop assign iio_info.driver_module and iio_trigger_ops.owner
The equivalent of both of these are now done via macro magic when
the relevant register calls are made.  The actual structure
elements will shortly go away.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2017-08-22 21:31:57 +01:00
Daniel Baluta f007d7f143 iio: Add Dyna-Image AL3320A ambient light sensor driver
Minimal implementation. This driver provides raw illuminance readings.

This is based on drivers/hwmon/al3320.c (*) driver from msm tree written
by Tsechih Lin <Tsechih_Lin@asus.com>

* https://android.googlesource.com/kernel/msm.git

Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-09-10 20:25:56 +01:00