iio: light: cm32181: Add support for parsing CPM0 and CPM1 ACPI tables
authorHans de Goede <hdegoede@redhat.com>
Tue, 28 Apr 2020 17:29:22 +0000 (19:29 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 11 May 2020 19:19:19 +0000 (20:19 +0100)
commitd34ca613b93940808ceaae2c405c68313f947f81
tree550e415fdc2e3cb417f1dfe0803bc90d5eb4640c
parent63b1be78774f8c3bdb9efd862ba7dfe8e2c056ff
iio: light: cm32181: Add support for parsing CPM0 and CPM1 ACPI tables

On ACPI based systems the CPLM3218 ACPI device node describing the
CM3218[1] sensor typically will have some extra tables with register
init values for initializing the sensor and calibration info.

This is based on a newer version of cm32181.c, with a copyright of:

 * Copyright (C) 2014 Capella Microsystems Inc.
 * Author: Kevin Tsai <ktsai@capellamicro.com>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2, as published
 * by the Free Software Foundation.

Which is floating around on the net in various places, but the changes
from this newer version never made it upstream.

This was tested on the following models: Acer Switch 10 SW5-012 (CM32181)
Asus T100TA (CM3218), Asus T100CHI (CM3218) and HP X2 10-n000nd (CM32181).

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/cm32181.c