Commit graph

7 commits

Author SHA1 Message Date
Uwe Kleine-König
76e4a118c8 iio: accel: mxc6255: Convert to i2c's .probe_new()
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221023132302.911644-20-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-11-23 19:44:02 +00:00
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
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
6c5bffa80e iio:accel: 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:22:40 +01:00
Hans de Goede
1696566f99 iio: accel: mxc6255: Fix chip-id check
The initial commit adding support for the mxc6225 assumed the
mxc6225 has a chip-id of 0xe5 based on testing on a single Allwinner
A23 tablet with a mxc6225. Testing on a bunch of other Allwinner
tablets have shown that the chip-id for the mxc6225 is not constant.

A datasheet for the MXC6255 which I've found online says that bits
7 and 6 of the chip-id register are undefined (for the mxc6255), testing
on 5 different tablets with a mxc6225 has found the following ids:
0x25, 0x45, 0x65, 0x85, 0xe5. So it seems that for the mxc6225 bits
7, 6 and 5 of the chip-id register are undefined.

This commit adjusts the chip-id check so that the mxc6255 driver
properly recognizes the mxc6225 in all these tablets.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-09-12 20:19:16 +01:00
Hans de Goede
06777c562a iio: accel: mxc6255 add support for the mxc6225
The mxc6225 is fully compatible with the existing mxc6255 driver,
add support for it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-09-05 21:18:16 +01:00
Teodora Baluta
75b6548f17 iio: accel: add support for Memsic MXC6255XC sensor
This patch adds a minimal implementation for the Memsic MXC6255XC
orientation sensing accelerometer. The supported operations are reading
raw acceleration values for X/Y axis that can be scaled using the
exposed scale.

Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-10-25 11:49:54 +00:00