Re: [PATCH 3/3] iio: cros_ec_activity: add ChromeOS EC Activity Sensors
Hi Gwendal, [auto build test ERROR on iio/togreg] [also build test ERROR on next-20161216] [cannot apply to v4.9] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Thierry-Escande/mfd-cros_ec-Add-activity-motion-sense-definitions/20161206-002239 base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg config: um-allmodconfig (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=um All errors (new ones prefixed by >>): ERROR: "devm_gpiod_get_optional" [net/rfkill/rfkill-gpio.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/regulator/tps62360-regulator.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/regulator/pwm-regulator.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/regulator/max8973-regulator.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/regulator/max8952.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/regulator/lp872x.ko] undefined! ERROR: "devm_gpio_request" [drivers/pps/clients/pps-gpio.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/power/supply/sbs-battery.ko] undefined! ERROR: "devm_gpio_request" [drivers/power/supply/max8903_charger.ko] undefined! ERROR: "devm_gpiod_get_index" [drivers/power/supply/bq25890_charger.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/power/supply/bq24735-charger.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/power/supply/bq24257_charger.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/nfc/st21nfca/st21nfca_i2c.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/nfc/st-nci/st-nci_i2c.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/nfc/nxp-nci/nxp-nci_i2c.ko] undefined! ERROR: "devm_gpio_free" [drivers/nfc/nfcmrvl/nfcmrvl.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/nfc/nfcmrvl/nfcmrvl.ko] undefined! ERROR: "devm_gpiod_get" [drivers/nfc/fdp/fdp_i2c.ko] undefined! ERROR: "devm_gpio_request" [drivers/net/phy/mdio-gpio.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/net/phy/at803x.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/net/dsa/mv88e6xxx/mv88e6xxx.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/leds/leds-lt3593.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/leds/leds-lp8860.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/leds/leds-lp55xx-common.ko] undefined! ERROR: "devm_gpiod_get" [drivers/leds/leds-ktd2692.ko] undefined! ERROR: "devm_get_gpiod_from_child" [drivers/leds/leds-gpio.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/leds/leds-gpio.ko] undefined! ERROR: "devm_gpiod_get_index" [drivers/iio/proximity/sx9500.ko] undefined! ERROR: "devm_gpiod_get_index" [drivers/iio/pressure/hp03.ko] undefined! ERROR: "devm_gpiod_get" [drivers/iio/pressure/bmp280.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/iio/magnetometer/ak8975.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/iio/dac/ad5592r-base.ko] undefined! >> ERROR: "cros_ec_cmd_xfer_status" >> [drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.ko] undefined! ERROR: "devm_gpiod_get_index" [drivers/iio/accel/mma9551.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/i2c/muxes/i2c-mux-pca954x.ko] undefined! ERROR: "devm_gpiod_get" [drivers/extcon/extcon-usb-gpio.ko] undefined! ERROR: "devm_gpiod_get" [drivers/extcon/extcon-max3355.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/extcon/extcon-gpio.ko] undefined! ERROR: "devm_gpiod_get" [drivers/bluetooth/hci_uart.ko] undefined! ERROR: "devm_ioremap_resource" [drivers/auxdisplay/img-ascii-lcd.ko] undefined! --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: [PATCH 3/3] iio: cros_ec_activity: add ChromeOS EC Activity Sensors
Hi Gwendal, [auto build test ERROR on iio/togreg] [also build test ERROR on next-20161216] [cannot apply to v4.9] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Thierry-Escande/mfd-cros_ec-Add-activity-motion-sense-definitions/20161206-002239 base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg config: um-allmodconfig (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=um All errors (new ones prefixed by >>): ERROR: "devm_gpiod_get_optional" [net/rfkill/rfkill-gpio.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/regulator/tps62360-regulator.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/regulator/pwm-regulator.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/regulator/max8973-regulator.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/regulator/max8952.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/regulator/lp872x.ko] undefined! ERROR: "devm_gpio_request" [drivers/pps/clients/pps-gpio.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/power/supply/sbs-battery.ko] undefined! ERROR: "devm_gpio_request" [drivers/power/supply/max8903_charger.ko] undefined! ERROR: "devm_gpiod_get_index" [drivers/power/supply/bq25890_charger.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/power/supply/bq24735-charger.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/power/supply/bq24257_charger.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/nfc/st21nfca/st21nfca_i2c.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/nfc/st-nci/st-nci_i2c.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/nfc/nxp-nci/nxp-nci_i2c.ko] undefined! ERROR: "devm_gpio_free" [drivers/nfc/nfcmrvl/nfcmrvl.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/nfc/nfcmrvl/nfcmrvl.ko] undefined! ERROR: "devm_gpiod_get" [drivers/nfc/fdp/fdp_i2c.ko] undefined! ERROR: "devm_gpio_request" [drivers/net/phy/mdio-gpio.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/net/phy/at803x.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/net/dsa/mv88e6xxx/mv88e6xxx.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/leds/leds-lt3593.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/leds/leds-lp8860.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/leds/leds-lp55xx-common.ko] undefined! ERROR: "devm_gpiod_get" [drivers/leds/leds-ktd2692.ko] undefined! ERROR: "devm_get_gpiod_from_child" [drivers/leds/leds-gpio.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/leds/leds-gpio.ko] undefined! ERROR: "devm_gpiod_get_index" [drivers/iio/proximity/sx9500.ko] undefined! ERROR: "devm_gpiod_get_index" [drivers/iio/pressure/hp03.ko] undefined! ERROR: "devm_gpiod_get" [drivers/iio/pressure/bmp280.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/iio/magnetometer/ak8975.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/iio/dac/ad5592r-base.ko] undefined! >> ERROR: "cros_ec_cmd_xfer_status" >> [drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.ko] undefined! ERROR: "devm_gpiod_get_index" [drivers/iio/accel/mma9551.ko] undefined! ERROR: "devm_gpiod_get_optional" [drivers/i2c/muxes/i2c-mux-pca954x.ko] undefined! ERROR: "devm_gpiod_get" [drivers/extcon/extcon-usb-gpio.ko] undefined! ERROR: "devm_gpiod_get" [drivers/extcon/extcon-max3355.ko] undefined! ERROR: "devm_gpio_request_one" [drivers/extcon/extcon-gpio.ko] undefined! ERROR: "devm_gpiod_get" [drivers/bluetooth/hci_uart.ko] undefined! ERROR: "devm_ioremap_resource" [drivers/auxdisplay/img-ascii-lcd.ko] undefined! --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: [PATCH 3/3] iio: cros_ec_activity: add ChromeOS EC Activity Sensors
Hi Gwendal, [auto build test WARNING on iio/togreg] [also build test WARNING on next-20161206] [cannot apply to v4.9-rc8] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Thierry-Escande/mfd-cros_ec-Add-activity-motion-sense-definitions/20161206-002239 base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg config: um-allyesconfig (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=um All warnings (new ones prefixed by >>): warning: (IIO_CROS_EC_ACTIVITY) selects IIO_CROS_EC_SENSORS_CORE which has unmet direct dependencies (IIO && SYSFS && MFD_CROS_EC) --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: [PATCH 3/3] iio: cros_ec_activity: add ChromeOS EC Activity Sensors
Hi Gwendal, [auto build test WARNING on iio/togreg] [also build test WARNING on next-20161206] [cannot apply to v4.9-rc8] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Thierry-Escande/mfd-cros_ec-Add-activity-motion-sense-definitions/20161206-002239 base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg config: um-allyesconfig (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=um All warnings (new ones prefixed by >>): warning: (IIO_CROS_EC_ACTIVITY) selects IIO_CROS_EC_SENSORS_CORE which has unmet direct dependencies (IIO && SYSFS && MFD_CROS_EC) --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
[PATCH 3/3] iio: cros_ec_activity: add ChromeOS EC Activity Sensors
From: Gwendal GrignouThis patch adds a driver for handling activity/gesture recognition coming from the EC. Only significant motion is currently supported. It is an incomplete driver: activity can be set, but ring buffer must be used to receive interruption. Signed-off-by: Gwendal Grignou Signed-off-by: Thierry Escande --- drivers/iio/common/cros_ec_sensors/Kconfig | 10 + drivers/iio/common/cros_ec_sensors/Makefile| 1 + .../iio/common/cros_ec_sensors/cros_ec_activity.c | 300 + .../common/cros_ec_sensors/cros_ec_sensors_core.c | 24 ++ .../common/cros_ec_sensors/cros_ec_sensors_core.h | 1 + 5 files changed, 336 insertions(+) create mode 100644 drivers/iio/common/cros_ec_sensors/cros_ec_activity.c diff --git a/drivers/iio/common/cros_ec_sensors/Kconfig b/drivers/iio/common/cros_ec_sensors/Kconfig index 3349c9d..0a64928 100644 --- a/drivers/iio/common/cros_ec_sensors/Kconfig +++ b/drivers/iio/common/cros_ec_sensors/Kconfig @@ -21,3 +21,13 @@ config IIO_CROS_EC_SENSORS Accelerometers, Gyroscope and Magnetometer that are presented by the ChromeOS EC Sensor hub. Creates an IIO device for each functions. + +config IIO_CROS_EC_ACTIVITY + tristate "ChromeOS EC Activity Sensors" + select IIO_CROS_EC_SENSORS_CORE + help + Module to handle activity events detections presented by the ChromeOS + EC Sensor hub. + Activities can be simple (low/no motion) or more complex (riding train). + They are being reported by physical devices or the EC itself. + Creates an IIO device to manage all activities. diff --git a/drivers/iio/common/cros_ec_sensors/Makefile b/drivers/iio/common/cros_ec_sensors/Makefile index ec716ff..a4a2d6c 100644 --- a/drivers/iio/common/cros_ec_sensors/Makefile +++ b/drivers/iio/common/cros_ec_sensors/Makefile @@ -4,3 +4,4 @@ obj-$(CONFIG_IIO_CROS_EC_SENSORS_CORE) += cros_ec_sensors_core.o obj-$(CONFIG_IIO_CROS_EC_SENSORS) += cros_ec_sensors.o +obj-$(CONFIG_IIO_CROS_EC_ACTIVITY) += cros_ec_activity.o diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_activity.c b/drivers/iio/common/cros_ec_sensors/cros_ec_activity.c new file mode 100644 index 000..f14c3d3 --- /dev/null +++ b/drivers/iio/common/cros_ec_sensors/cros_ec_activity.c @@ -0,0 +1,300 @@ +/* + * cros_ec_sensors_activity - Driver for activities/gesture recognition. + * + * Copyright (C) 2015 Google, Inc + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This driver uses the cros-ec interface to communicate with the Chrome OS + * EC about accelerometer data. Accelerometer access is presented through + * iio sysfs. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cros_ec_sensors_core.h" + +#define DRV_NAME "cros-ec-activity" + +/* st data for ec_sensors iio driver. */ +struct cros_ec_sensors_state { + /* Shared by all sensors */ + struct cros_ec_sensors_core_state core; + + struct iio_chan_spec *channels; + unsigned int nb_activities; +}; + +static const struct iio_event_spec cros_ec_activity_single_shot[] = { + { + .type = IIO_EV_TYPE_CHANGE, + /* significant motion trigger when we get out of still. */ + .dir = IIO_EV_DIR_FALLING, + .mask_separate = BIT(IIO_EV_INFO_ENABLE), +}, +}; + +static int ec_sensors_read(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, + int *val, int *val2, long mask) +{ + dev_warn(_dev->dev, "%s: Not Expected: %d\n", __func__, +chan->channel2); + + return -EPERM; +} + +static int ec_sensors_write(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, + int val, int val2, long mask) +{ + dev_warn(_dev->dev, "%s: Not Expected: %d\n", __func__, +chan->channel2); + + return -EPERM; +} + +static int cros_ec_read_event_config(struct iio_dev *indio_dev, +const struct iio_chan_spec *chan, +enum iio_event_type type, +enum iio_event_direction dir) +{ + struct cros_ec_sensors_state *st = iio_priv(indio_dev); + int ret; + + if (chan->type != IIO_ACTIVITY) + return -EINVAL; + + mutex_lock(>core.cmd_lock); +
[PATCH 3/3] iio: cros_ec_activity: add ChromeOS EC Activity Sensors
From: Gwendal Grignou This patch adds a driver for handling activity/gesture recognition coming from the EC. Only significant motion is currently supported. It is an incomplete driver: activity can be set, but ring buffer must be used to receive interruption. Signed-off-by: Gwendal Grignou Signed-off-by: Thierry Escande --- drivers/iio/common/cros_ec_sensors/Kconfig | 10 + drivers/iio/common/cros_ec_sensors/Makefile| 1 + .../iio/common/cros_ec_sensors/cros_ec_activity.c | 300 + .../common/cros_ec_sensors/cros_ec_sensors_core.c | 24 ++ .../common/cros_ec_sensors/cros_ec_sensors_core.h | 1 + 5 files changed, 336 insertions(+) create mode 100644 drivers/iio/common/cros_ec_sensors/cros_ec_activity.c diff --git a/drivers/iio/common/cros_ec_sensors/Kconfig b/drivers/iio/common/cros_ec_sensors/Kconfig index 3349c9d..0a64928 100644 --- a/drivers/iio/common/cros_ec_sensors/Kconfig +++ b/drivers/iio/common/cros_ec_sensors/Kconfig @@ -21,3 +21,13 @@ config IIO_CROS_EC_SENSORS Accelerometers, Gyroscope and Magnetometer that are presented by the ChromeOS EC Sensor hub. Creates an IIO device for each functions. + +config IIO_CROS_EC_ACTIVITY + tristate "ChromeOS EC Activity Sensors" + select IIO_CROS_EC_SENSORS_CORE + help + Module to handle activity events detections presented by the ChromeOS + EC Sensor hub. + Activities can be simple (low/no motion) or more complex (riding train). + They are being reported by physical devices or the EC itself. + Creates an IIO device to manage all activities. diff --git a/drivers/iio/common/cros_ec_sensors/Makefile b/drivers/iio/common/cros_ec_sensors/Makefile index ec716ff..a4a2d6c 100644 --- a/drivers/iio/common/cros_ec_sensors/Makefile +++ b/drivers/iio/common/cros_ec_sensors/Makefile @@ -4,3 +4,4 @@ obj-$(CONFIG_IIO_CROS_EC_SENSORS_CORE) += cros_ec_sensors_core.o obj-$(CONFIG_IIO_CROS_EC_SENSORS) += cros_ec_sensors.o +obj-$(CONFIG_IIO_CROS_EC_ACTIVITY) += cros_ec_activity.o diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_activity.c b/drivers/iio/common/cros_ec_sensors/cros_ec_activity.c new file mode 100644 index 000..f14c3d3 --- /dev/null +++ b/drivers/iio/common/cros_ec_sensors/cros_ec_activity.c @@ -0,0 +1,300 @@ +/* + * cros_ec_sensors_activity - Driver for activities/gesture recognition. + * + * Copyright (C) 2015 Google, Inc + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This driver uses the cros-ec interface to communicate with the Chrome OS + * EC about accelerometer data. Accelerometer access is presented through + * iio sysfs. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cros_ec_sensors_core.h" + +#define DRV_NAME "cros-ec-activity" + +/* st data for ec_sensors iio driver. */ +struct cros_ec_sensors_state { + /* Shared by all sensors */ + struct cros_ec_sensors_core_state core; + + struct iio_chan_spec *channels; + unsigned int nb_activities; +}; + +static const struct iio_event_spec cros_ec_activity_single_shot[] = { + { + .type = IIO_EV_TYPE_CHANGE, + /* significant motion trigger when we get out of still. */ + .dir = IIO_EV_DIR_FALLING, + .mask_separate = BIT(IIO_EV_INFO_ENABLE), +}, +}; + +static int ec_sensors_read(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, + int *val, int *val2, long mask) +{ + dev_warn(_dev->dev, "%s: Not Expected: %d\n", __func__, +chan->channel2); + + return -EPERM; +} + +static int ec_sensors_write(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, + int val, int val2, long mask) +{ + dev_warn(_dev->dev, "%s: Not Expected: %d\n", __func__, +chan->channel2); + + return -EPERM; +} + +static int cros_ec_read_event_config(struct iio_dev *indio_dev, +const struct iio_chan_spec *chan, +enum iio_event_type type, +enum iio_event_direction dir) +{ + struct cros_ec_sensors_state *st = iio_priv(indio_dev); + int ret; + + if (chan->type != IIO_ACTIVITY) + return -EINVAL; + + mutex_lock(>core.cmd_lock); + + st->core.param.cmd = MOTIONSENSE_CMD_LIST_ACTIVITIES; + + if