From patchwork Tue Sep 11 15:00:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Afonso Bordado X-Patchwork-Id: 10595775 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B79BF13B8 for ; Tue, 11 Sep 2018 15:00:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6D7729774 for ; Tue, 11 Sep 2018 15:00:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A513C297DD; Tue, 11 Sep 2018 15:00:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE92929774 for ; Tue, 11 Sep 2018 15:00:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727394AbeIKUAa (ORCPT ); Tue, 11 Sep 2018 16:00:30 -0400 Received: from sender-of-o52.zoho.com ([135.84.80.217]:21398 "EHLO sender-of-o52.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726775AbeIKUAa (ORCPT ); Tue, 11 Sep 2018 16:00:30 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1536678019; cv=none; d=zoho.com; s=zohoarc; b=fUVCd5mdxAQRJXaybF7J0gd3cL7x84S79iUyvnc1U1AtvRhb8Z+nb8VZAyFqKJa60eDQnXkroVpsDywY0F61FjyekG0ADwTKqMLuCHtG8hpjHJ/tDBGjOVhFy93aFOLwBHXsZY9jx5ty73ThBC4AOGo7nFftwySaTez1fKlNGKM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1536678019; h=Cc:Date:From:Message-ID:Subject:To:ARC-Authentication-Results; bh=m2cqnhJN/KnQ/51XE/8vTTlK13hH0d6taccOwJxSCnc=; b=O0ePwzS7ogmhFadY5K1xHqr1o3kxn9G/2u7jKqS+ikUmcXkZ+6dQ4X12ThMbBhOoq6v2qFrdVLQRIDlG4/CH4HxPbjPKh84uXj+mr3wc5fvIkjvaxLM3NaZiFVz91fko24MG1sPCbIQJ8cl7QxBorKdjDIfrt/JU04knWNCVnQs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=az8.co; spf=pass smtp.mailfrom=afonsobordado@az8.co; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1536678019; s=dkimmail; d=az8.co; i=afonsobordado@az8.co; h=From:To:Cc:Subject:Date:Message-Id; l=12059; bh=m2cqnhJN/KnQ/51XE/8vTTlK13hH0d6taccOwJxSCnc=; b=DfTZlg3ftNxW3Vd4uJmbnWOdLiwKd1A3PUhcIknsjvY9rNxK2n746/7PkN8cGx7Y it0kfYMtxnv4YiQ6VtKPjj+X5VqWBN3JUrOd38aMtanv1yIOyu9WYirKS9qtAxdQ/xv ABU2HJHGdYWGaqN96YBEtnJF5b6Rr/kDZ9bL2cHM= Received: from localhost (bl9-77-228.dsl.telepac.pt [85.242.77.228]) by mx.zohomail.com with SMTPS id 1536678017552298.85224179325996; Tue, 11 Sep 2018 08:00:17 -0700 (PDT) From: Afonso Bordado To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v4 1/5] iio: gyro: add support for fxas21002c Date: Tue, 11 Sep 2018 16:00:07 +0100 Message-Id: <20180911150011.31964-1-afonsobordado@az8.co> X-Mailer: git-send-email 2.18.0 X-ZohoMailClient: External Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP FXAS21002C is a 3 axis gyroscope with integrated temperature sensor Signed-off-by: Afonso Bordado --- Changes in v4 - Remove CONFIG_OF ifdefs - Remove the use of the of_match_ptr macro - Split bindings into a separate patch - Remove interrupt-parent from binding documentation - Whitespace fixes - Remove scale and sample frequency tables - Place MAINTAINERS block in correct position Changes in v3 - Use unsigned int on regmap functions - Remove the export of the regmap config - Fix undefined behaviour on dev_err call - Minor cleanups Changes in v2 - Use ANSI C Comments - Minor cleanups - More dscriptive devicetree bindings drivers/iio/gyro/Kconfig | 11 + drivers/iio/gyro/Makefile | 1 + drivers/iio/gyro/fxas21002c.c | 378 ++++++++++++++++++++++++++++++++++ 3 files changed, 390 insertions(+) create mode 100644 drivers/iio/gyro/fxas21002c.c diff --git a/drivers/iio/gyro/Kconfig b/drivers/iio/gyro/Kconfig index 3126cf05e6b9..d71e33ea9fa4 100644 --- a/drivers/iio/gyro/Kconfig +++ b/drivers/iio/gyro/Kconfig @@ -73,6 +73,17 @@ config BMG160_SPI tristate select REGMAP_SPI +config FXAS21002C + tristate "Freescale FXAS21002C Gyroscope" + depends on I2C + select REGMAP_I2C + help + Say yes here to build support for the Freescale FXAS21002C Gyroscope + driver connected via I2C. + + This driver can also be built as a module. If so, the module + will be called fxas21002c. + config HID_SENSOR_GYRO_3D depends on HID_SENSOR_HUB select IIO_BUFFER diff --git a/drivers/iio/gyro/Makefile b/drivers/iio/gyro/Makefile index 295ec780c4eb..ec3e2aeae92a 100644 --- a/drivers/iio/gyro/Makefile +++ b/drivers/iio/gyro/Makefile @@ -12,6 +12,7 @@ obj-$(CONFIG_ADXRS450) += adxrs450.o obj-$(CONFIG_BMG160) += bmg160_core.o obj-$(CONFIG_BMG160_I2C) += bmg160_i2c.o obj-$(CONFIG_BMG160_SPI) += bmg160_spi.o +obj-$(CONFIG_FXAS21002C) += fxas21002c.o obj-$(CONFIG_HID_SENSOR_GYRO_3D) += hid-sensor-gyro-3d.o diff --git a/drivers/iio/gyro/fxas21002c.c b/drivers/iio/gyro/fxas21002c.c new file mode 100644 index 000000000000..649316c26f5b --- /dev/null +++ b/drivers/iio/gyro/fxas21002c.c @@ -0,0 +1,378 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * FXAS21002C - Digital Angular Rate Gyroscope driver + * + * Copyright (c) 2018, Afonso Bordado + * + * IIO driver for FXAS21002C (7-bit I2C slave address 0x20 or 0x21). + * Datasheet: https://www.nxp.com/docs/en/data-sheet/FXAS21002.pdf + * TODO: + * ODR / Scale Support + * Devicetree + * Scale Boost Mode + * Power management + * GPIO Reset + * Power supplies + * Mount Matrix + * LowPass/HighPass Filters + * Buffers + * Interrupts + * Alarms + * SPI Support + */ + +#include +#include +#include +#include +#include + +#define FXAS21002C_DRV_NAME "fxas21002c" + +#define FXAS21002C_MAX_TRANSITION_TIME_MS 61 + +#define FXAS21002C_CHIP_ID 0xD7 + +#define FXAS21002C_REG_STATUS 0x00 +#define FXAS21002C_REG_OUT_X_MSB 0x01 +#define FXAS21002C_REG_OUT_X_LSB 0x02 +#define FXAS21002C_REG_OUT_Y_MSB 0x03 +#define FXAS21002C_REG_OUT_Y_LSB 0x04 +#define FXAS21002C_REG_OUT_Z_MSB 0x05 +#define FXAS21002C_REG_OUT_Z_LSB 0x06 +#define FXAS21002C_REG_DR_STATUS 0x07 +#define FXAS21002C_REG_F_STATUS 0x08 +#define FXAS21002C_REG_F_SETUP 0x09 +#define FXAS21002C_REG_F_EVENT 0x0A +#define FXAS21002C_REG_INT_SRC_FLAG 0x0B +#define FXAS21002C_REG_WHO_AM_I 0x0C + +#define FXAS21002C_REG_CTRL_REG0 0x0D +#define FXAS21002C_SCALE_MASK GENMASK(1, 0) + +#define FXAS21002C_REG_RT_CFG 0x0E +#define FXAS21002C_REG_RT_SRC 0x0F +#define FXAS21002C_REG_RT_THS 0x10 +#define FXAS21002C_REG_RT_COUNT 0x11 +#define FXAS21002C_REG_TEMP 0x12 + +#define FXAS21002C_REG_CTRL_REG1 0x13 +#define FXAS21002C_RST_BIT BIT(6) +#define FXAS21002C_ACTIVE_BIT BIT(1) +#define FXAS21002C_READY_BIT BIT(0) + +#define FXAS21002C_ODR_SHIFT 2 +#define FXAS21002C_ODR_MASK GENMASK(4, 2) + +#define FXAS21002C_REG_CTRL_REG2 0x14 +#define FXAS21002C_REG_CTRL_REG3 0x15 + +#define FXAS21002C_DEFAULT_ODR_HZ 800 + +/* 0.0625 deg/s */ +#define FXAS21002C_DEFAULT_SENSITIVITY IIO_DEGREE_TO_RAD(62500) + +#define FXAS21002C_TEMP_SCALE 1000 + +enum { + ID_FXAS21002C, +}; + +enum fxas21002c_operating_mode { + FXAS21002C_OM_BOOT, + FXAS21002C_OM_STANDBY, + FXAS21002C_OM_READY, + FXAS21002C_OM_ACTIVE, +}; + +struct fxas21002c_data { + struct i2c_client *client; + struct regmap *regmap; +}; + +static const struct regmap_range fxas21002c_writable_ranges[] = { + regmap_reg_range(FXAS21002C_REG_F_SETUP, FXAS21002C_REG_F_SETUP), + regmap_reg_range(FXAS21002C_REG_CTRL_REG0, FXAS21002C_REG_RT_CFG), + regmap_reg_range(FXAS21002C_REG_RT_THS, FXAS21002C_REG_RT_COUNT), + regmap_reg_range(FXAS21002C_REG_CTRL_REG1, FXAS21002C_REG_CTRL_REG3), +}; + +static const struct regmap_access_table fxas21002c_writable_table = { + .yes_ranges = fxas21002c_writable_ranges, + .n_yes_ranges = ARRAY_SIZE(fxas21002c_writable_ranges), +}; + +static const struct regmap_range fxas21002c_volatile_ranges[] = { + regmap_reg_range(FXAS21002C_REG_STATUS, FXAS21002C_REG_F_STATUS), + regmap_reg_range(FXAS21002C_REG_F_EVENT, FXAS21002C_REG_INT_SRC_FLAG), + regmap_reg_range(FXAS21002C_REG_RT_COUNT, FXAS21002C_REG_CTRL_REG1), +}; + +static const struct regmap_access_table fxas21002c_volatile_table = { + .yes_ranges = fxas21002c_volatile_ranges, + .n_yes_ranges = ARRAY_SIZE(fxas21002c_volatile_ranges), +}; + +const struct regmap_config fxas21002c_regmap_config = { + .reg_bits = 8, + .val_bits = 8, + + .max_register = FXAS21002C_REG_CTRL_REG3, + /* We don't specify a .rd_table because everything is readable */ + .wr_table = &fxas21002c_writable_table, + .volatile_table = &fxas21002c_volatile_table, +}; + +#define FXAS21002C_GYRO_CHAN(_axis) { \ + .type = IIO_ANGL_VEL, \ + .modified = 1, \ + .channel2 = IIO_MOD_ ## _axis, \ + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) | \ + BIT(IIO_CHAN_INFO_SAMP_FREQ), \ + .address = FXAS21002C_REG_OUT_ ## _axis ## _MSB, \ +} + +static const struct iio_chan_spec fxas21002c_channels[] = { + { + .type = IIO_TEMP, + .address = FXAS21002C_REG_TEMP, + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | + BIT(IIO_CHAN_INFO_SCALE), + }, + FXAS21002C_GYRO_CHAN(X), + FXAS21002C_GYRO_CHAN(Y), + FXAS21002C_GYRO_CHAN(Z), + IIO_CHAN_SOFT_TIMESTAMP(3), +}; + +static int fxas21002c_set_operating_mode(struct fxas21002c_data *data, + enum fxas21002c_operating_mode om) +{ + int ret; + int mask; + + switch (om) { + case FXAS21002C_OM_STANDBY: + mask = 0; + break; + case FXAS21002C_OM_READY: + mask = FXAS21002C_READY_BIT; + break; + case FXAS21002C_OM_ACTIVE: + mask = FXAS21002C_ACTIVE_BIT; + break; + + default: + return -EINVAL; + } + + ret = regmap_write(data->regmap, FXAS21002C_REG_CTRL_REG1, mask); + if (ret) { + dev_err(&data->client->dev, + "could not switch operating mode\n"); + return ret; + } + + msleep(FXAS21002C_MAX_TRANSITION_TIME_MS); + + return 0; +} + +static void fxas21002c_standby(void *_data) +{ + struct fxas21002c_data *data = _data; + + fxas21002c_set_operating_mode(data, FXAS21002C_OM_STANDBY); +} + +static int fxas21002c_reset(struct fxas21002c_data *data) +{ + int ret; + + /* + * On issuing a Software Reset command over an I2C interface, + * the device immediately resets and does not send any + * acknowledgment (ACK) of the written byte to the Master. + * + * This is documented in table 46 on the datasheet. Due to this + * the write will fail with EREMOTEIO. + */ + ret = regmap_write(data->regmap, + FXAS21002C_REG_CTRL_REG1, FXAS21002C_RST_BIT); + + if (ret != -EREMOTEIO) { + dev_err(&data->client->dev, "could not reset device\n"); + return ret; + } + + regcache_mark_dirty(data->regmap); + + /* Wait for device to boot up */ + msleep(FXAS21002C_MAX_TRANSITION_TIME_MS); + + return 0; +} + +static int fxas21002c_verify_chip(struct fxas21002c_data *data) +{ + int ret; + unsigned int chip_id; + + ret = regmap_read(data->regmap, FXAS21002C_REG_WHO_AM_I, &chip_id); + if (ret) { + dev_err(&data->client->dev, "could not read device id\n"); + return ret; + } + + if (chip_id != FXAS21002C_CHIP_ID) { + dev_err(&data->client->dev, + "unsupported chip id %02x\n", chip_id); + return -ENODEV; + } + + return 0; +} + +static int fxas21002c_read_oneshot(struct fxas21002c_data *data, + struct iio_chan_spec const *chan, int *val) +{ + int ret; + __be16 bulk_raw; + unsigned int uval; + + switch (chan->type) { + case IIO_ANGL_VEL: + ret = regmap_bulk_read(data->regmap, chan->address, + &bulk_raw, sizeof(bulk_raw)); + if (ret) + return ret; + + *val = sign_extend32(be16_to_cpu(bulk_raw), 15); + return IIO_VAL_INT; + case IIO_TEMP: + ret = regmap_read(data->regmap, chan->address, &uval); + if (ret) + return ret; + + *val = sign_extend32(uval, 7); + return IIO_VAL_INT; + default: + return -EINVAL; + } +} + +static int fxas21002c_read_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, int *val, + int *val2, long mask) +{ + struct fxas21002c_data *data = iio_priv(indio_dev); + + switch (mask) { + case IIO_CHAN_INFO_RAW: + return fxas21002c_read_oneshot(data, chan, val); + case IIO_CHAN_INFO_SCALE: + switch (chan->type) { + case IIO_ANGL_VEL: + *val = 0; + *val2 = FXAS21002C_DEFAULT_SENSITIVITY; + + return IIO_VAL_INT_PLUS_MICRO; + case IIO_TEMP: + *val = FXAS21002C_TEMP_SCALE; + + return IIO_VAL_INT; + default: + return -EINVAL; + } + case IIO_CHAN_INFO_SAMP_FREQ: + if (chan->type != IIO_ANGL_VEL) + return -EINVAL; + + *val = FXAS21002C_DEFAULT_ODR_HZ; + + return IIO_VAL_INT; + } + + return -EINVAL; +} + +static const struct iio_info fxas21002c_info = { + .read_raw = fxas21002c_read_raw, +}; + +static int fxas21002c_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + int ret; + struct iio_dev *indio_dev; + struct fxas21002c_data *data; + + indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data)); + if (!indio_dev) + return -ENOMEM; + + i2c_set_clientdata(client, indio_dev); + data = iio_priv(indio_dev); + data->client = client; + + data->regmap = devm_regmap_init_i2c(client, &fxas21002c_regmap_config); + if (IS_ERR(data->regmap)) { + ret = PTR_ERR(data->regmap); + dev_err(&client->dev, + "Failed to allocate regmap, err: %d\n", ret); + return ret; + } + + indio_dev->dev.parent = &client->dev; + indio_dev->channels = fxas21002c_channels; + indio_dev->num_channels = ARRAY_SIZE(fxas21002c_channels); + indio_dev->name = id->name; + indio_dev->modes = INDIO_DIRECT_MODE; + indio_dev->info = &fxas21002c_info; + + ret = fxas21002c_verify_chip(data); + if (ret < 0) + return ret; + + ret = fxas21002c_reset(data); + if (ret < 0) + return ret; + + ret = fxas21002c_set_operating_mode(data, FXAS21002C_OM_ACTIVE); + if (ret < 0) + return ret; + + ret = devm_add_action(&client->dev, fxas21002c_standby, data); + if (ret < 0) { + fxas21002c_standby(data); + dev_err(&client->dev, "failed to add standby action\n"); + return ret; + } + + ret = iio_device_register(indio_dev); + if (ret < 0) + dev_err(&client->dev, "failed to register iio device\n"); + + return ret; +} + +static const struct i2c_device_id fxas21002c_id[] = { + {"fxas21002c", ID_FXAS21002C}, + {} +}; +MODULE_DEVICE_TABLE(i2c, fxas21002c_id); + +static struct i2c_driver fxas21002c_driver = { + .driver = { + .name = FXAS21002C_DRV_NAME, + }, + .probe = fxas21002c_probe, + .id_table = fxas21002c_id, +}; + +module_i2c_driver(fxas21002c_driver); + +MODULE_AUTHOR("Afonso Bordado "); +MODULE_DESCRIPTION("FXAS21002C Digital Angular Rate Gyroscope driver"); +MODULE_LICENSE("GPL v2"); From patchwork Tue Sep 11 15:00:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Afonso Bordado X-Patchwork-Id: 10595777 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 187DF13B8 for ; Tue, 11 Sep 2018 15:00:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08386297DD for ; Tue, 11 Sep 2018 15:00:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0613F29809; Tue, 11 Sep 2018 15:00:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD91A297DD for ; Tue, 11 Sep 2018 15:00:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728016AbeIKUAb (ORCPT ); Tue, 11 Sep 2018 16:00:31 -0400 Received: from sender-of-o52.zoho.com ([135.84.80.217]:21431 "EHLO sender-of-o52.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726782AbeIKUAa (ORCPT ); Tue, 11 Sep 2018 16:00:30 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1536678023; cv=none; d=zoho.com; s=zohoarc; b=WU2NGX/Q5uFOOoOejBJfj684GlH3dWGT9WC8+VUGfi7B3su7NZcKeFUYn7yBIbkZKInxr3wLtKIglNqwJQS0H9FfWu9vzEKIjTuZd1LNmOsewgKj8nveL+NMor3RVw8UhGhMj1Llob+gFCwQF7d3cD+xsT5uWYEPHewtnwaouk0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1536678023; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=kwaKAEKkiHDuPbatLtRuiq06oBkvc5vjFR9gREl3xtY=; b=TP/S08Ep5FCkFMSANU2ksFmRd2n91QasUSlgeo7tqt+zHTiUkpSNpeFQtBZ42CVJ6XNhmeCv1SwRejJyzbcisP7w8juxfhjkhtjP35wRvfT2NkZWrpQoIPCpgTOEaT5MwTxeub70VQ/Rz2CefkGoHJAn+ZIlqhjyEqJy0tEfi48= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=az8.co; spf=pass smtp.mailfrom=afonsobordado@az8.co; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1536678023; s=dkimmail; d=az8.co; i=afonsobordado@az8.co; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=1222; bh=kwaKAEKkiHDuPbatLtRuiq06oBkvc5vjFR9gREl3xtY=; b=QySoZ0Tjx98eP73uv5wS7v4lDVEAtEZXGgzWKybkOZmTvzSb4O7vJ7e2R5UB5Y8R o5L7ZzYiA4rBQ9QqMO/n/YS+tnYK6RaCbb9D3bU7FjG83AellL9IMkW4hD+TzWetOJY xH2sA3smQJmE7i6+HM3D8frnBD/2Jp5O9Ri/GLp8= Received: from localhost (bl9-77-228.dsl.telepac.pt [85.242.77.228]) by mx.zohomail.com with SMTPS id 1536678022251349.7712885126558; Tue, 11 Sep 2018 08:00:22 -0700 (PDT) From: Afonso Bordado To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v4 2/5] iio: gyro: add device tree support for fxas21002c Date: Tue, 11 Sep 2018 16:00:08 +0100 Message-Id: <20180911150011.31964-2-afonsobordado@az8.co> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180911150011.31964-1-afonsobordado@az8.co> References: <20180911150011.31964-1-afonsobordado@az8.co> X-ZohoMailClient: External Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds device tree support for the fxas21002c driver. Signed-off-by: Afonso Bordado --- drivers/iio/gyro/fxas21002c.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/iio/gyro/fxas21002c.c b/drivers/iio/gyro/fxas21002c.c index 649316c26f5b..e2ce0622944b 100644 --- a/drivers/iio/gyro/fxas21002c.c +++ b/drivers/iio/gyro/fxas21002c.c @@ -8,7 +8,6 @@ * Datasheet: https://www.nxp.com/docs/en/data-sheet/FXAS21002.pdf * TODO: * ODR / Scale Support - * Devicetree * Scale Boost Mode * Power management * GPIO Reset @@ -357,6 +356,12 @@ static int fxas21002c_probe(struct i2c_client *client, return ret; } +static const struct of_device_id fxas21002c_of_ids[] = { + {.compatible = "fsl,fxas21002c"}, + {} +}; +MODULE_DEVICE_TABLE(of, fxas21002c_of_ids); + static const struct i2c_device_id fxas21002c_id[] = { {"fxas21002c", ID_FXAS21002C}, {} @@ -366,6 +371,7 @@ MODULE_DEVICE_TABLE(i2c, fxas21002c_id); static struct i2c_driver fxas21002c_driver = { .driver = { .name = FXAS21002C_DRV_NAME, + .of_match_table = fxas21002c_of_ids, }, .probe = fxas21002c_probe, .id_table = fxas21002c_id, From patchwork Tue Sep 11 15:00:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Afonso Bordado X-Patchwork-Id: 10595779 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8C34014E0 for ; Tue, 11 Sep 2018 15:01:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CC7F29807 for ; Tue, 11 Sep 2018 15:01:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B4BE29819; Tue, 11 Sep 2018 15:01:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E34329814 for ; Tue, 11 Sep 2018 15:01:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728017AbeIKUAe (ORCPT ); Tue, 11 Sep 2018 16:00:34 -0400 Received: from sender-of-o52.zoho.com ([135.84.80.217]:21401 "EHLO sender-of-o52.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726782AbeIKUAd (ORCPT ); Tue, 11 Sep 2018 16:00:33 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1536678027; cv=none; d=zoho.com; s=zohoarc; b=JIcrrf/2FIewE6C8GK6a5tzX2coryMBmafT7yhNiyIuqss9VwNzpCgjWIdZ5lH2H8Z92h3+XufnghJf/Dn5y7zJh+G+2dSBvIG+hGOOO0pjywaXHc3gYL/l6GqHfB1nzNtMsmZvDWbOTlDmd/RuKPOYfxSLQi6+dJdAW29uhBcE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1536678027; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=9G3x+PNll/uFQgPFi2pIBK2BDE9clu4T1TiRWNUVNNY=; b=kMN1bOsYfrNW9mtOE5W9ZbbjgDNEM6CReVvEcV+wRytsK12Dakekm+c8KA2nedjHMZQnAhdTrrMheFDkx5j/qsjKzx9LLQBwe420d0u7aGRMDlcbRPa3G9Gr7Zyp6ReFWPlAegncaO3bD8F0/2MQarNMyUOsSnC4+7wPPouW/DI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=az8.co; spf=pass smtp.mailfrom=afonsobordado@az8.co; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1536678027; s=dkimmail; d=az8.co; i=afonsobordado@az8.co; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=1649; bh=9G3x+PNll/uFQgPFi2pIBK2BDE9clu4T1TiRWNUVNNY=; b=LKd3wImH1izuDGzdTOGUG/6+Jnzxy0rYlhUHOGixmo/tHnMtyRmmUjzXRjDSEctZ teE2Rq9GVHTCnWLQK92vtXKOJC0WV2N05iC89BAQr9qkkpHEKGsQSD/ujyQ36zZpL41 aCIjU1Y4WrkKTy/Izexw79mXacprxN5Q+0eqotMY= Received: from localhost (bl9-77-228.dsl.telepac.pt [85.242.77.228]) by mx.zohomail.com with SMTPS id 1536678027167132.88179067181272; Tue, 11 Sep 2018 08:00:27 -0700 (PDT) From: Afonso Bordado To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v4 3/5] dt-bindings: fxas21002c: Document the fxas21002c I2C bindings Date: Tue, 11 Sep 2018 16:00:09 +0100 Message-Id: <20180911150011.31964-3-afonsobordado@az8.co> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180911150011.31964-1-afonsobordado@az8.co> References: <20180911150011.31964-1-afonsobordado@az8.co> X-ZohoMailClient: External Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add documentation for the fxas21002c I2C bindings. Signed-off-by: Afonso Bordado --- .../bindings/iio/gyroscope/fsl,fxas21002c.txt | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/gyroscope/fsl,fxas21002c.txt diff --git a/Documentation/devicetree/bindings/iio/gyroscope/fsl,fxas21002c.txt b/Documentation/devicetree/bindings/iio/gyroscope/fsl,fxas21002c.txt new file mode 100644 index 000000000000..9e5cdf0c0b69 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/gyroscope/fsl,fxas21002c.txt @@ -0,0 +1,33 @@ +* Freescale FXAS21002C Digital Angular Rate Gyroscope + +Required properties: + + - compatible: must be "fsl,fxas21002c" + - reg : the I2C address of the sensor + +Optional properties: + + - interrupts : The first interrupt listed must be the one + connected to the INT1 pin, the second interrupt + listed must be the one connected to the INT2 pin. + The interrupts can be triggered on rising or falling + edges alike. + see interrupt-controller/interrupts.txt + - vdd-supply : The main voltage regulator + - iovdd-supply : The IO voltage regulator + see regulator/regulator.txt + - reset-gpios : GPIO used to reset the device. + see gpio/gpio.txt. + - mount-matrix : see iio/mount-matrix.txt + +Example: +gyroscope@20 { + compatible = "fsl,fxas21002c"; + reg = <0x20>; + reset-gpios = <&gpio0 2 0>; + vdd-supply = <&vref>; + iovdd-supply = <&vref2>; + interrupt-parent = <&foo>; + interrupts = <0 IRQ_TYPE_EDGE_RISING>, + <1 (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)>; +}; From patchwork Tue Sep 11 15:00:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Afonso Bordado X-Patchwork-Id: 10595781 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 424EE13B8 for ; Tue, 11 Sep 2018 15:01:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30E932980E for ; Tue, 11 Sep 2018 15:01:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F3E42981C; Tue, 11 Sep 2018 15:01:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93ECF2980E for ; Tue, 11 Sep 2018 15:01:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728072AbeIKUAm (ORCPT ); Tue, 11 Sep 2018 16:00:42 -0400 Received: from sender-of-o52.zoho.com ([135.84.80.217]:21316 "EHLO sender-of-o52.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726782AbeIKUAl (ORCPT ); Tue, 11 Sep 2018 16:00:41 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1536678033; cv=none; d=zoho.com; s=zohoarc; b=dpvts+sukwUxrvx3d0fkInQ7wctKh2QsxRKtUUoVij6FNEPIFQqXm9yEDZqb1F6IQ7QoSv5P8UX9Ve2vCmoZrFJRX+NVO1YuGbEj3kuDKmGSbPwCke9KZG3+j/wPZ6Hnn0OGfidcSHkywqa7aRCq8LNrBWf+GYFBrdhkPpuzb+E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1536678033; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=R0B4xpzYkXhSuVhcj3oQe4W+zIp4KtoFB+Q0bWp/RBs=; b=W/7KRlyebhSvtC2tYR/ft9aMrRLgqZBw37P+6g2tE6pCA1K5bg6+0eofAf+FYxjp3eCnc3JUQLrUpN5m22SZJmFoqwaV/HzEe0ZhtwKIwgFv/ojW5aQMqjqYMbG0UxgXfcH7tknS6JK8IR510lyiTEXYUbaoBS2XGEAG09m85NM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=az8.co; spf=pass smtp.mailfrom=afonsobordado@az8.co; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1536678033; s=dkimmail; d=az8.co; i=afonsobordado@az8.co; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=5471; bh=R0B4xpzYkXhSuVhcj3oQe4W+zIp4KtoFB+Q0bWp/RBs=; b=gKNTNfta1HcllWQmdXUI6Zev7ALjRP38BJ3GvhVzeCWoyc0aJJ+Qi77a2SkG4hoI KjKR8rtUoE4F4tYk5oDEK5QeKuyhkpBENVtaZmfh33gBXeW22js3mXp7dLW/ejnaPKL YWci0yR62/hEGl/ye1JarBbyXkVMO/3KBLPJsME4= Received: from localhost (bl9-77-228.dsl.telepac.pt [85.242.77.228]) by mx.zohomail.com with SMTPS id 1536678031778923.8911422492789; Tue, 11 Sep 2018 08:00:31 -0700 (PDT) From: Afonso Bordado To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v4 4/5] iio: fxas21002c: add ODR/Scale support Date: Tue, 11 Sep 2018 16:00:10 +0100 Message-Id: <20180911150011.31964-4-afonsobordado@az8.co> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180911150011.31964-1-afonsobordado@az8.co> References: <20180911150011.31964-1-afonsobordado@az8.co> X-ZohoMailClient: External Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds support for reading/writing ODR/Scale We don't support the scale boost modes. Signed-off-by: Afonso Bordado --- drivers/iio/gyro/fxas21002c.c | 143 +++++++++++++++++++++++++++++++--- 1 file changed, 131 insertions(+), 12 deletions(-) diff --git a/drivers/iio/gyro/fxas21002c.c b/drivers/iio/gyro/fxas21002c.c index e2ce0622944b..ea9934b91789 100644 --- a/drivers/iio/gyro/fxas21002c.c +++ b/drivers/iio/gyro/fxas21002c.c @@ -7,7 +7,6 @@ * IIO driver for FXAS21002C (7-bit I2C slave address 0x20 or 0x21). * Datasheet: https://www.nxp.com/docs/en/data-sheet/FXAS21002.pdf * TODO: - * ODR / Scale Support * Scale Boost Mode * Power management * GPIO Reset @@ -66,12 +65,14 @@ #define FXAS21002C_REG_CTRL_REG2 0x14 #define FXAS21002C_REG_CTRL_REG3 0x15 -#define FXAS21002C_DEFAULT_ODR_HZ 800 +#define FXAS21002C_TEMP_SCALE 1000 -/* 0.0625 deg/s */ -#define FXAS21002C_DEFAULT_SENSITIVITY IIO_DEGREE_TO_RAD(62500) -#define FXAS21002C_TEMP_SCALE 1000 +#define FXAS21002C_SCALE(scale) (IIO_DEGREE_TO_RAD(62500 >> (scale))) + +#define FXAS21002C_SAMPLE_FREQ(odr) (800 >> (odr)) +#define FXAS21002C_SAMPLE_FREQ_MICRO(odr) ( \ + ((odr) == FXAS21002C_ODR_12_5) ? 500000 : 0) enum { ID_FXAS21002C, @@ -89,6 +90,25 @@ struct fxas21002c_data { struct regmap *regmap; }; +enum fxas21002c_scale { + FXAS21002C_SCALE_62MDPS, + FXAS21002C_SCALE_31MDPS, + FXAS21002C_SCALE_15MDPS, + FXAS21002C_SCALE_7MDPS, + __FXAS21002C_SCALE_MAX, +}; + +enum fxas21002c_odr { + FXAS21002C_ODR_800, + FXAS21002C_ODR_400, + FXAS21002C_ODR_200, + FXAS21002C_ODR_100, + FXAS21002C_ODR_50, + FXAS21002C_ODR_25, + FXAS21002C_ODR_12_5, + __FXAS21002C_ODR_MAX, +}; + static const struct regmap_range fxas21002c_writable_ranges[] = { regmap_reg_range(FXAS21002C_REG_F_SETUP, FXAS21002C_REG_F_SETUP), regmap_reg_range(FXAS21002C_REG_CTRL_REG0, FXAS21002C_REG_RT_CFG), @@ -261,6 +281,49 @@ static int fxas21002c_read_oneshot(struct fxas21002c_data *data, } } +static int fxas21002c_scale_read(struct fxas21002c_data *data, int *val, + int *val2) +{ + int ret; + unsigned int raw; + + ret = regmap_read(data->regmap, FXAS21002C_REG_CTRL_REG0, &raw); + if (ret) + return ret; + + raw &= FXAS21002C_SCALE_MASK; + + *val = 0; + *val2 = FXAS21002C_SCALE(raw); + + return IIO_VAL_INT_PLUS_MICRO; +} + +static int fxas21002c_odr_read(struct fxas21002c_data *data, int *val, + int *val2) +{ + int ret; + unsigned int raw; + + ret = regmap_read(data->regmap, FXAS21002C_REG_CTRL_REG1, &raw); + if (ret) + return ret; + + raw = (raw & FXAS21002C_ODR_MASK) >> FXAS21002C_ODR_SHIFT; + + /* + * We don't use this mode but according to the datasheet its + * also a 12.5Hz + */ + if (raw == 7) + raw = FXAS21002C_ODR_12_5; + + *val = FXAS21002C_SAMPLE_FREQ(raw); + *val2 = FXAS21002C_SAMPLE_FREQ_MICRO(raw); + + return IIO_VAL_INT_PLUS_MICRO; +} + static int fxas21002c_read_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int *val, int *val2, long mask) @@ -273,10 +336,7 @@ static int fxas21002c_read_raw(struct iio_dev *indio_dev, case IIO_CHAN_INFO_SCALE: switch (chan->type) { case IIO_ANGL_VEL: - *val = 0; - *val2 = FXAS21002C_DEFAULT_SENSITIVITY; - - return IIO_VAL_INT_PLUS_MICRO; + return fxas21002c_scale_read(data, val, val2); case IIO_TEMP: *val = FXAS21002C_TEMP_SCALE; @@ -288,16 +348,75 @@ static int fxas21002c_read_raw(struct iio_dev *indio_dev, if (chan->type != IIO_ANGL_VEL) return -EINVAL; - *val = FXAS21002C_DEFAULT_ODR_HZ; - - return IIO_VAL_INT; + return fxas21002c_odr_read(data, val, val2); } return -EINVAL; } + +static int fxas21002c_write_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, int val, + int val2, long mask) +{ + struct fxas21002c_data *data = iio_priv(indio_dev); + int ret = -EINVAL; + int i; + + switch (mask) { + case IIO_CHAN_INFO_SAMP_FREQ: + for (i = 0; i < __FXAS21002C_ODR_MAX; i++) { + if (FXAS21002C_SAMPLE_FREQ(i) == val && + FXAS21002C_SAMPLE_FREQ_MICRO(i) == val2) + break; + } + + if (i == __FXAS21002C_ODR_MAX) + break; + + return regmap_update_bits(data->regmap, + FXAS21002C_REG_CTRL_REG1, + FXAS21002C_ODR_MASK, + i << FXAS21002C_ODR_SHIFT); + case IIO_CHAN_INFO_SCALE: + for (i = 0; i < __FXAS21002C_SCALE_MAX; i++) { + if (val == 0 && FXAS21002C_SCALE(i) == val2) + break; + } + + if (i == __FXAS21002C_SCALE_MAX) + break; + + return regmap_update_bits(data->regmap, + FXAS21002C_REG_CTRL_REG0, + FXAS21002C_SCALE_MASK, i); + } + + return ret; +} + +static IIO_CONST_ATTR(anglevel_scale_available, + "0.001090831 " /* 62.5 mdps */ + "0.000545415 " /* 31.25 mdps */ + "0.000272708 " /* 15.625 mdps */ + "0.000136354"); /* 7.8125 mdps */ + +static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("800 400 200 100 50 25 12.5"); + +static struct attribute *fxas21002c_attributes[] = { + &iio_const_attr_anglevel_scale_available.dev_attr.attr, + &iio_const_attr_sampling_frequency_available.dev_attr.attr, + NULL +}; + +static const struct attribute_group fxas21002c_attribute_group = { + .attrs = fxas21002c_attributes, +}; + static const struct iio_info fxas21002c_info = { .read_raw = fxas21002c_read_raw, + .write_raw = fxas21002c_write_raw, + .attrs = &fxas21002c_attribute_group, }; static int fxas21002c_probe(struct i2c_client *client, From patchwork Tue Sep 11 15:00:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Afonso Bordado X-Patchwork-Id: 10595783 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D505C14E0 for ; Tue, 11 Sep 2018 15:01:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C55B5297BB for ; Tue, 11 Sep 2018 15:01:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C39DD2980F; Tue, 11 Sep 2018 15:01:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 478632980E for ; Tue, 11 Sep 2018 15:01:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728101AbeIKUAr (ORCPT ); Tue, 11 Sep 2018 16:00:47 -0400 Received: from sender-of-o52.zoho.com ([135.84.80.217]:21434 "EHLO sender-of-o52.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726761AbeIKUAq (ORCPT ); Tue, 11 Sep 2018 16:00:46 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1536678038; cv=none; d=zoho.com; s=zohoarc; b=IGjP4dL7D8n70LU3pV51rN6+PB2533GFTzH1GUiFZQegieb/gmiDc2cdJ8h7FSymA/AhIahs7iZfhJDwnEq6jBziTffrOEWFbAECZ0mX4BVNN8kqghXbXtMcpTTYJzqYbRdAp2BCzX/gUJPt9GcllL3E7anchpiKOXb7w6Q9TvY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1536678038; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=dPPZBBSx8zOsrGge9Xb59PHumf0eZhSyqPc/0Jm6Raw=; b=O73wEwndKXYavTvFRdErf2YBdJjE46gwbLAxAA6KuH59OGs9aC2W6mp58bUBb9XjZttq5ru4o1SHA0MLU/FumrHb/hkVlgTwJ8oXLbt5JVktAxn28u8eMXdCViL/xQoMim8Qu4GbEFEVTPNQl3STwQbyhqMgrRMz/usGg1HljN4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=az8.co; spf=pass smtp.mailfrom=afonsobordado@az8.co; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1536678038; s=dkimmail; d=az8.co; i=afonsobordado@az8.co; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=803; bh=dPPZBBSx8zOsrGge9Xb59PHumf0eZhSyqPc/0Jm6Raw=; b=c8EaO4I42oSy/lrmSKFTojcuV8xkqENi5oUluxWEvwuAiFJZ9n9C13aGV9WotM5l EmhvzdJI60Da/nzsTzgBYDmLbyd0790j/umkLQaCsDJ+nyxN+GAehofkg4qJQmMh38v zQ1GqHhU0Di4VEn3YZAMCc99MytDB1Ob3brWYmQ0= Received: from localhost (bl9-77-228.dsl.telepac.pt [85.242.77.228]) by mx.zohomail.com with SMTPS id 1536678037099683.3705023699581; Tue, 11 Sep 2018 08:00:37 -0700 (PDT) From: Afonso Bordado To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v4 5/5] MAINTAINERS: add entry for fxas21002c gyro driver Date: Tue, 11 Sep 2018 16:00:11 +0100 Message-Id: <20180911150011.31964-5-afonsobordado@az8.co> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180911150011.31964-1-afonsobordado@az8.co> References: <20180911150011.31964-1-afonsobordado@az8.co> X-ZohoMailClient: External Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add entry for fxas21002c gyroscope driver and add myself as maintainer of this driver. Signed-off-by: Afonso Bordado --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 2b9a364b043d..9420f0a8140d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5718,6 +5718,13 @@ S: Maintained F: drivers/net/ethernet/freescale/gianfar* F: Documentation/devicetree/bindings/net/fsl-tsec-phy.txt +FREESCALE FXAS21002C +M: Afonso Bordado +L: linux-iio@vger.kernel.org +S: Maintained +F: drivers/iio/gyro/fxas21002.c +F: Documentation/devicetree/bindings/iio/gyroscope/fsl,fxas21002c.txt + FREESCALE GPMI NAND DRIVER M: Han Xu L: linux-mtd@lists.infradead.org