From patchwork Wed Dec 11 09:59:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis, Tomislav AVL DiTEST" X-Patchwork-Id: 11284677 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F1C2715AB for ; Wed, 11 Dec 2019 10:12:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BBAAE21D7D for ; Wed, 11 Dec 2019 10:12:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=avl.com header.i=@avl.com header.b="jsJXpVFr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728696AbfLKKMv (ORCPT ); Wed, 11 Dec 2019 05:12:51 -0500 Received: from mx07-002cda01.pphosted.com ([185.132.180.122]:17496 "EHLO mx07-002cda01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728480AbfLKKMv (ORCPT ); Wed, 11 Dec 2019 05:12:51 -0500 Received: from pps.filterd (m0135535.ppops.net [127.0.0.1]) by mx07-002cda01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBB9oqDe021478; Wed, 11 Dec 2019 09:59:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avl.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=08102019; bh=+QNnm6Bi0x5PwakXJ9uy98hXa+Q7XMDpEDbcnZIYQyg=; b=jsJXpVFruKA7mc8N2HyCv2OXqP9a7uZ8SSxctwpZZwydgs6gWT+ayZXwYuKQ3iA4PcQz q1+OBB9HW74Tp5UgU9SimYFZiS7gcRyZxRd1KF8UkLqmrIbjQfTMwFtSGBuhAdRPkShL gA5iK7CyEEqZ9UHC2g5k46wSuV8cPXg29nIN7WqL6RZ4WOXKoir0lLqn9m+dVNmKzXQM 1YZrN9pBu83x27tMGeqgKXpYlyE86cPJtRD5q8dJCQGcpJpqwTk2nKCXInPc1bWIvCNv gzppssm2SkDMQgKLhCrKGMZaNNa/TvKQ1rSzSplO9x827/cy7M5+C9eQn1HX6uWfHdqh fA== Received: from atgrzso8133.avl01.avlcorp.lan ([192.102.17.76]) by mx07-002cda01.pphosted.com with ESMTP id 2wr59gpu5k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2019 09:59:48 +0000 Received: from pps.filterd (atgrzso8133.avl01.avlcorp.lan [127.0.0.1]) by atgrzso8133.avl01.avlcorp.lan (8.16.0.27/8.16.0.27) with SMTP id xBB7mf7w026664; Wed, 11 Dec 2019 10:59:47 +0100 Received: from atgrzsw1695.avl01.avlcorp.lan ([10.13.100.86]) by atgrzso8133.avl01.avlcorp.lan with ESMTP id 2wr3hmsyve-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2019 10:59:47 +0100 Received: from atgrzsw3272.avl01.avlcorp.lan (10.12.65.158) by atgrzsw1695.avl01.avlcorp.lan (10.12.64.163) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 11 Dec 2019 10:59:47 +0100 Received: from ATGRZSW1694.avl01.avlcorp.lan (10.12.64.115) by atgrzsw3272.avl01.avlcorp.lan (10.12.65.158) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 11 Dec 2019 10:59:47 +0100 Received: from ATGRZWN210214.avl01.avlcorp.lan (10.12.100.12) by ATGRZSW1694.avl01.avlcorp.lan (10.12.64.115) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 11 Dec 2019 10:59:47 +0100 From: To: CC: , , Subject: [PATCH v4 1/3] iio: pressure: Add driver for DLH pressure sensors Date: Wed, 11 Dec 2019 10:59:44 +0100 Message-ID: <20191211095946.7904-2-tomislav.denis@avl.com> X-Mailer: git-send-email 2.10.1.windows.1 In-Reply-To: <20191211095946.7904-1-tomislav.denis@avl.com> References: <20191211095946.7904-1-tomislav.denis@avl.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: f9e74532-fb7d-4806-8539-2b9574eafa9a X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-12-11_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1912110062 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-11_02:2019-12-11,2019-12-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 mlxscore=0 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 suspectscore=1 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912110086 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Tomislav Denis All Sensors DLH is series of low voltage digital pressure sensors. Additionally to pressure value sensors deliver a temperature value. Sensors can be accessed over I2C and SPI, this driver supports only I2C access. Signed-off-by: Tomislav Denis --- MAINTAINERS | 7 + drivers/iio/pressure/Kconfig | 12 ++ drivers/iio/pressure/Makefile | 1 + drivers/iio/pressure/dlh.c | 375 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 395 insertions(+) create mode 100644 drivers/iio/pressure/dlh.c diff --git a/MAINTAINERS b/MAINTAINERS index d5ea4e4..0fa24df 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -668,6 +668,13 @@ S: Maintained F: Documentation/i2c/busses/i2c-ali1563.rst F: drivers/i2c/busses/i2c-ali1563.c +ALL SENSORS DLH SERIES PRESSURE SENSORS DRIVER +M: Tomislav Denis +W: http://www.allsensors.com/ +S: Maintained +L: linux-iio@vger.kernel.org +F: drivers/iio/pressure/dlh.c + ALLEGRO DVT VIDEO IP CORE DRIVER M: Michael Tretter R: Pengutronix Kernel Team diff --git a/drivers/iio/pressure/Kconfig b/drivers/iio/pressure/Kconfig index ba420e4..3d383d8 100644 --- a/drivers/iio/pressure/Kconfig +++ b/drivers/iio/pressure/Kconfig @@ -53,6 +53,18 @@ config IIO_CROS_EC_BARO To compile this driver as a module, choose M here: the module will be called cros_ec_baro. +config DLH + tristate "All Sensors DLH series low voltage digital pressure sensors" + depends on I2C + select IIO_BUFFER + select IIO_TRIGGERED_BUFFER + help + Say yes here to build support for the All Sensors DLH series + pressure sensors driver. + + To compile this driver as a module, choose M here: the module + will be called dlh. + config DPS310 tristate "Infineon DPS310 pressure and temperature sensor" depends on I2C diff --git a/drivers/iio/pressure/Makefile b/drivers/iio/pressure/Makefile index d8f5ace..c609ad4 100644 --- a/drivers/iio/pressure/Makefile +++ b/drivers/iio/pressure/Makefile @@ -9,6 +9,7 @@ obj-$(CONFIG_BMP280) += bmp280.o bmp280-objs := bmp280-core.o bmp280-regmap.o obj-$(CONFIG_BMP280_I2C) += bmp280-i2c.o obj-$(CONFIG_BMP280_SPI) += bmp280-spi.o +obj-$(CONFIG_DLH) += dlh.o obj-$(CONFIG_DPS310) += dps310.o obj-$(CONFIG_IIO_CROS_EC_BARO) += cros_ec_baro.o obj-$(CONFIG_HID_SENSOR_PRESS) += hid-sensor-press.o diff --git a/drivers/iio/pressure/dlh.c b/drivers/iio/pressure/dlh.c new file mode 100644 index 0000000..18fc4e1 --- /dev/null +++ b/drivers/iio/pressure/dlh.c @@ -0,0 +1,375 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * All Sensors DLH series low voltage digital pressure sensors + * + * Copyright (c) 2019 AVL DiTEST GmbH + * Tomislav Denis + * + * Datasheet: http://www.allsensors.com/cad/DS-0355_Rev_B.PDF + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/* Commands */ +#define DLH_START_SINGLE 0xAA + +/* Status bits */ +#define DLH_STATUS_OK 0x40 + +/* DLH data format */ +#define DLH_NUM_READ_BYTES 7 +#define DLH_NUM_DATA_BYTES 3 +#define DLH_NUM_PR_BITS 24 +#define DLH_NUM_TEMP_BITS 24 + +/* DLH timings */ +#define DLH_SINGLE_DUT_MS 5 + +enum dhl_ids { + dlhl60d, + dlhl60g, +}; + +struct dlh_info { + u8 osdig; /* digital offset factor */ + unsigned int fss; /* full scale span (inch H2O) */ +}; + +struct dlh_state { + struct i2c_client *client; + struct dlh_info info; + bool use_interrupt; + struct completion completion; + u8 rx_buf[DLH_NUM_READ_BYTES] ____cacheline_aligned; +}; + +static struct dlh_info dlh_info_tbl[] = { + [dlhl60d] = { + .osdig = 2, + .fss = 120, + }, + [dlhl60g] = { + .osdig = 10, + .fss = 60, + }, +}; + + +static int dlh_cmd_start_single(struct dlh_state *st) +{ + int ret; + + ret = i2c_smbus_write_byte(st->client, DLH_START_SINGLE); + if (ret) + dev_err(&st->client->dev, + "%s: I2C write byte failed\n", __func__); + + return ret; +} + +static int dlh_cmd_read_data(struct dlh_state *st) +{ + int ret; + + ret = i2c_master_recv(st->client, st->rx_buf, DLH_NUM_READ_BYTES); + if (ret < 0) { + dev_err(&st->client->dev, + "%s: I2C read block failed\n", __func__); + return ret; + } + + if (st->rx_buf[0] != DLH_STATUS_OK) { + dev_err(&st->client->dev, + "%s: invalid status 0x%02x\n", __func__, st->rx_buf[0]); + return -EBUSY; + } + + return 0; +} + +static int dlh_start_capture_and_read(struct dlh_state *st) +{ + int ret; + + if (st->use_interrupt) + reinit_completion(&st->completion); + + ret = dlh_cmd_start_single(st); + if (ret) + return ret; + + if (st->use_interrupt) { + ret = wait_for_completion_timeout(&st->completion, + msecs_to_jiffies(DLH_SINGLE_DUT_MS)); + if (!ret) { + dev_err(&st->client->dev, + "%s: conversion timed out\n", __func__); + return -ETIMEDOUT; + } + } else { + mdelay(DLH_SINGLE_DUT_MS); + } + + return dlh_cmd_read_data(st); +} + +static int dlh_read_direct(struct dlh_state *st, + unsigned int *pressure, unsigned int *temperature) +{ + int ret; + + ret = dlh_start_capture_and_read(st); + if (ret) + return ret; + + *pressure = get_unaligned_be32(&st->rx_buf[1]) >> 8; + *temperature = get_unaligned_be32(&st->rx_buf[3]) & + GENMASK(DLH_NUM_TEMP_BITS - 1, 0); + + return 0; +} + +static int dlh_read_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *channel, int *value, + int *value2, long mask) +{ + struct dlh_state *st = iio_priv(indio_dev); + unsigned int pressure, temperature; + int ret; + s64 tmp; + s32 rem; + + switch (mask) { + case IIO_CHAN_INFO_RAW: + ret = iio_device_claim_direct_mode(indio_dev); + if (ret) + return ret; + + ret = dlh_read_direct(st, &pressure, &temperature); + iio_device_release_direct_mode(indio_dev); + if (ret) + return ret; + + switch (channel->type) { + case IIO_PRESSURE: + *value = pressure; + return IIO_VAL_INT; + + case IIO_TEMP: + *value = temperature; + return IIO_VAL_INT; + + default: + return -EINVAL; + } + case IIO_CHAN_INFO_SCALE: + switch (channel->type) { + case IIO_PRESSURE: + tmp = div_s64(125LL * st->info.fss * 24909 * 100, + 1 << DLH_NUM_PR_BITS); + tmp = div_s64_rem(tmp, 1000000000LL, &rem); + *value = tmp; + *value2 = rem; + return IIO_VAL_INT_PLUS_NANO; + + case IIO_TEMP: + *value = 125 * 1000; + *value2 = DLH_NUM_TEMP_BITS; + return IIO_VAL_FRACTIONAL_LOG2; + + default: + return -EINVAL; + } + case IIO_CHAN_INFO_OFFSET: + switch (channel->type) { + case IIO_PRESSURE: + *value = -125 * st->info.fss * 24909; + *value2 = 100 * st->info.osdig * 100000; + return IIO_VAL_FRACTIONAL; + + case IIO_TEMP: + *value = -40 * 1000; + return IIO_VAL_INT; + + default: + return -EINVAL; + } + } + + return -EINVAL; +} + +static const struct iio_info dlh_info = { + .read_raw = dlh_read_raw, +}; + +static const struct iio_chan_spec dlh_channels[] = { + { + .type = IIO_PRESSURE, + .indexed = 1, + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), + .info_mask_shared_by_type = + BIT(IIO_CHAN_INFO_SCALE) | + BIT(IIO_CHAN_INFO_OFFSET), + .scan_index = 0, + .scan_type = { + .sign = 'u', + .realbits = DLH_NUM_PR_BITS, + .storagebits = 32, + .shift = 8, + .endianness = IIO_BE, + }, + }, { + .type = IIO_TEMP, + .indexed = 1, + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), + .info_mask_shared_by_type = + BIT(IIO_CHAN_INFO_SCALE) | + BIT(IIO_CHAN_INFO_OFFSET), + .scan_index = 1, + .scan_type = { + .sign = 'u', + .realbits = DLH_NUM_TEMP_BITS, + .storagebits = 32, + .shift = 8, + .endianness = IIO_BE, + }, + } +}; + +static irqreturn_t dlh_trigger_handler(int irq, void *private) +{ + struct iio_poll_func *pf = private; + struct iio_dev *indio_dev = pf->indio_dev; + struct dlh_state *st = iio_priv(indio_dev); + int ret; + unsigned int chn, i = 0; + __be32 tmp_buf[2]; + + ret = dlh_start_capture_and_read(st); + if (ret) + goto out; + + for_each_set_bit(chn, indio_dev->active_scan_mask, + indio_dev->masklength) { + memcpy(tmp_buf + i, + &st->rx_buf[1] + chn * DLH_NUM_DATA_BYTES, + DLH_NUM_DATA_BYTES); + i++; + } + + iio_push_to_buffers(indio_dev, tmp_buf); + +out: + iio_trigger_notify_done(indio_dev->trig); + + return IRQ_HANDLED; +} + +static irqreturn_t dlh_interrupt(int irq, void *private) +{ + struct iio_dev *indio_dev = private; + struct dlh_state *st = iio_priv(indio_dev); + + complete(&st->completion); + + return IRQ_HANDLED; +}; + +static int dlh_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct dlh_state *st; + struct iio_dev *indio_dev; + int ret; + + if (!i2c_check_functionality(client->adapter, + I2C_FUNC_I2C | I2C_FUNC_SMBUS_WRITE_BYTE)) { + dev_err(&client->dev, + "adapter doesn't support required i2c functionality\n"); + return -EOPNOTSUPP; + } + + indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*st)); + if (!indio_dev) { + dev_err(&client->dev, "failed to allocate iio device\n"); + return -ENOMEM; + } + + i2c_set_clientdata(client, indio_dev); + + st = iio_priv(indio_dev); + st->info = dlh_info_tbl[id->driver_data]; + st->client = client; + st->use_interrupt = false; + + indio_dev->name = id->name; + indio_dev->dev.parent = &client->dev; + indio_dev->dev.of_node = client->dev.of_node; + indio_dev->info = &dlh_info; + indio_dev->modes = INDIO_DIRECT_MODE; + indio_dev->channels = dlh_channels; + indio_dev->num_channels = ARRAY_SIZE(dlh_channels); + + if (client->irq > 0) { + ret = devm_request_threaded_irq(&client->dev, client->irq, + dlh_interrupt, NULL, + IRQF_TRIGGER_RISING | IRQF_ONESHOT, + id->name, indio_dev); + if (ret) { + dev_err(&client->dev, "failed to allocate threaded irq"); + return ret; + } + + st->use_interrupt = true; + init_completion(&st->completion); + } + + ret = devm_iio_triggered_buffer_setup(&client->dev, indio_dev, + NULL, &dlh_trigger_handler, NULL); + if (ret) { + dev_err(&client->dev, "failed to setup iio buffer\n"); + return ret; + } + + ret = devm_iio_device_register(&client->dev, indio_dev); + if (ret) + dev_err(&client->dev, "failed to register iio device\n"); + + return ret; +} + +static const struct of_device_id dlh_of_match[] = { + { .compatible = "asc,dlhl60d" }, + { .compatible = "asc,dlhl60g" }, + {} +}; +MODULE_DEVICE_TABLE(of, dlh_of_match); + +static const struct i2c_device_id dlh_id[] = { + { "dlhl60d", dlhl60d }, + { "dlhl60g", dlhl60g }, + {} +}; +MODULE_DEVICE_TABLE(i2c, dlh_id); + +static struct i2c_driver dlh_driver = { + .driver = { + .name = "dlh", + .of_match_table = dlh_of_match, + }, + .probe = dlh_probe, + .id_table = dlh_id, +}; +module_i2c_driver(dlh_driver); + +MODULE_AUTHOR("Tomislav Denis "); +MODULE_DESCRIPTION("Driver for All Sensors DLH series pressure sensors"); +MODULE_LICENSE("GPL v2"); From patchwork Wed Dec 11 09:59:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis, Tomislav AVL DiTEST" X-Patchwork-Id: 11284693 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2A978109A for ; Wed, 11 Dec 2019 10:36:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 07C41222C4 for ; Wed, 11 Dec 2019 10:36:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=avl.com header.i=@avl.com header.b="A8aPDB0d" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728656AbfLKKgF (ORCPT ); Wed, 11 Dec 2019 05:36:05 -0500 Received: from mx07-002cda01.pphosted.com ([185.132.180.122]:5266 "EHLO mx07-002cda01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728030AbfLKKgF (ORCPT ); Wed, 11 Dec 2019 05:36:05 -0500 Received: from pps.filterd (m0135534.ppops.net [127.0.0.1]) by mx07-002cda01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBB9uHgr010037; Wed, 11 Dec 2019 09:59:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avl.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=08102019; bh=sKv1Q+W8G0/Kap939kV8/J8YKysqithOUtf1evnTyms=; b=A8aPDB0dgDBcZfrbueiabNKcLXWC1wI26881c1ccjlMACpqNFBFAHClUo/jOMpQpfYai h6Vw7O/CP35cZWHqFMTiuJzT0XbouK1t9ZLEfxVXAzX1cUSU/Iibznzq1IDRoZjRdSd7 kbx+L+JFh8RLPm12SLnOCSAzg3uFrF3lrUVpJ92/oTzj8sAoXyQZht2Q0Q8Fyv7RNoEx 7rDUwWinxErsuTYkC58R1VW05vy3+bCWBRhJM6zXwM2vSHD/+hzMI+l4VX6xf+nhM7FR 5aerJjhZOJCGyGmvPn68GlynnpU+xIUQvGFn27BpgIGtr1M5eZ8pSDXvWKFQjcXZSiDf tQ== Received: from atgrzso2901.avl01.avlcorp.lan ([192.102.17.76]) by mx07-002cda01.pphosted.com with ESMTP id 2wr2ac70bf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2019 09:59:48 +0000 Received: from pps.filterd (atgrzso2901.avl01.avlcorp.lan [127.0.0.1]) by atgrzso2901.avl01.avlcorp.lan (8.16.0.27/8.16.0.27) with SMTP id xBB7mM9v014344; Wed, 11 Dec 2019 10:59:48 +0100 Received: from atgrzsw3758.avl01.avlcorp.lan ([10.13.100.86]) by atgrzso2901.avl01.avlcorp.lan with ESMTP id 2wr4nq1wkg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2019 10:59:47 +0100 Received: from atgrzsw3271.avl01.avlcorp.lan (10.12.65.157) by atgrzsw3758.avl01.avlcorp.lan (10.37.149.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_DHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1779.2; Wed, 11 Dec 2019 10:59:47 +0100 Received: from ATGRZSW1694.avl01.avlcorp.lan (10.12.64.115) by atgrzsw3271.avl01.avlcorp.lan (10.12.65.157) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 11 Dec 2019 10:59:47 +0100 Received: from ATGRZWN210214.avl01.avlcorp.lan (10.12.100.12) by ATGRZSW1694.avl01.avlcorp.lan (10.12.64.115) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 11 Dec 2019 10:59:47 +0100 From: To: CC: , , Subject: [PATCH v4 2/3] dt-bindings: Add asc vendor Date: Wed, 11 Dec 2019 10:59:45 +0100 Message-ID: <20191211095946.7904-3-tomislav.denis@avl.com> X-Mailer: git-send-email 2.10.1.windows.1 In-Reply-To: <20191211095946.7904-1-tomislav.denis@avl.com> References: <20191211095946.7904-1-tomislav.denis@avl.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: f9e74532-fb7d-4806-8539-2b9574eafa9a X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-12-11_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1912110062 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-11_02:2019-12-11,2019-12-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 impostorscore=0 bulkscore=0 malwarescore=0 adultscore=0 mlxscore=0 suspectscore=1 clxscore=1015 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912110086 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Tomislav Denis All Sensors Corporation is a manufacturer of MEMS piezoresitive ultra low pressure sensors and pressure transducers. Signed-off-by: Tomislav Denis Acked-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 967e78c..88247b3 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -109,6 +109,8 @@ patternProperties: description: Artesyn Embedded Technologies Inc. "^asahi-kasei,.*": description: Asahi Kasei Corp. + "^asc,.*": + description: All Sensors Corporation "^aspeed,.*": description: ASPEED Technology Inc. "^asus,.*": From patchwork Wed Dec 11 09:59:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis, Tomislav AVL DiTEST" X-Patchwork-Id: 11284675 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E8B214B7 for ; Wed, 11 Dec 2019 10:12:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48945214D8 for ; Wed, 11 Dec 2019 10:12:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=avl.com header.i=@avl.com header.b="cM365pSa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728529AbfLKKMv (ORCPT ); Wed, 11 Dec 2019 05:12:51 -0500 Received: from mx07-002cda01.pphosted.com ([185.132.180.122]:59536 "EHLO mx07-002cda01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727829AbfLKKMu (ORCPT ); Wed, 11 Dec 2019 05:12:50 -0500 Received: from pps.filterd (m0135535.ppops.net [127.0.0.1]) by mx07-002cda01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBB9opf7021472; Wed, 11 Dec 2019 09:59:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avl.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=08102019; bh=hBpav1OEI9tDoMnlQPjNCargclo6mCzP2t1pNLr4U8k=; b=cM365pSawBJoD1Ja8tC7Jd1TXIZRM4FAX2wE4yy7onY9oEJKcg3e1PnmIAOo8r+XF+2R 3BOKg34YyuQTyDTpvCQUToQvX1TsZfUMAl8wEv67/0LheOWC2c7nLlD7+gu/XicVJGGM 6GhqZqLQpJICv4k4LXyWAGwdQ/pUAmInH691Pga+NaXooMzLVksJLe0bS+zbtUAaAXOM QUGSJ2DTMPFaaoEe4SpddZnV67pCzGMsZ8uICfXjm12pNtuq5wmmPML8SQum+eHzR9QR x3l0QsLNo5AsNIa8ojJmMb+B6eVHO7XawLIjEL3F8hLaAumjs/09jjQI8h6f7A0hC/aA xw== Received: from atgrzso2833.avl01.avlcorp.lan ([192.102.17.76]) by mx07-002cda01.pphosted.com with ESMTP id 2wr59gpu5m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2019 09:59:48 +0000 Received: from pps.filterd (atgrzso2833.avl01.avlcorp.lan [127.0.0.1]) by atgrzso2833.avl01.avlcorp.lan (8.16.0.27/8.16.0.27) with SMTP id xBB7n3iC018073; Wed, 11 Dec 2019 10:59:48 +0100 Received: from atgrzsw1692.avl01.avlcorp.lan ([10.13.100.86]) by atgrzso2833.avl01.avlcorp.lan with ESMTP id 2wr4nrhvu3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2019 10:59:47 +0100 Received: from ATGRZSW1694.avl01.avlcorp.lan (10.12.64.115) by ATGRZSW1692.avl01.avlcorp.lan (10.12.64.113) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 11 Dec 2019 10:59:47 +0100 Received: from ATGRZWN210214.avl01.avlcorp.lan (10.12.100.12) by ATGRZSW1694.avl01.avlcorp.lan (10.12.64.115) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 11 Dec 2019 10:59:47 +0100 From: To: CC: , , Subject: [PATCH v4 3/3] bindings: iio: pressure: Add documentation for dlh driver Date: Wed, 11 Dec 2019 10:59:46 +0100 Message-ID: <20191211095946.7904-4-tomislav.denis@avl.com> X-Mailer: git-send-email 2.10.1.windows.1 In-Reply-To: <20191211095946.7904-1-tomislav.denis@avl.com> References: <20191211095946.7904-1-tomislav.denis@avl.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: f9e74532-fb7d-4806-8539-2b9574eafa9a X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-12-11_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=762 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1912110062 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-11_02:2019-12-11,2019-12-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 mlxscore=0 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 suspectscore=1 lowpriorityscore=0 malwarescore=0 mlxlogscore=818 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912110086 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Tomislav Denis Add a device tree binding documentation for DLH series pressure sensors. Signed-off-by: Tomislav Denis --- .../devicetree/bindings/iio/pressure/asc,dlh.yaml | 51 ++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 52 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/pressure/asc,dlh.yaml diff --git a/Documentation/devicetree/bindings/iio/pressure/asc,dlh.yaml b/Documentation/devicetree/bindings/iio/pressure/asc,dlh.yaml new file mode 100644 index 0000000..c2c1817 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/pressure/asc,dlh.yaml @@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/pressure/dlh.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: All Sensors DLH series low voltage digital pressure sensors + +maintainers: + - Tomislav Denis + +description: | + Bindings for the All Sensors DLH series pressure sensors. + + Specifications about the sensors can be found at: + http://www.allsensors.com/cad/DS-0355_Rev_B.PDF + +properties: + compatible: + enum: + - asc,dlhl60d + - asc,dlhl60g + + reg: + description: I2C device address + maxItems: 1 + + interrupts: + description: interrupt mapping for EOC(data ready) pin + maxItems: 1 + +required: + - compatible + - reg + +examples: + - | + #include + + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + + pressure@29 { + compatible = "asc,dlhl60d"; + reg = <0x29>; + interrupt-parent = <&gpio0>; + interrupts = <10 IRQ_TYPE_EDGE_RISING>; + }; + }; +... diff --git a/MAINTAINERS b/MAINTAINERS index 0fa24df..7e181b9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -674,6 +674,7 @@ W: http://www.allsensors.com/ S: Maintained L: linux-iio@vger.kernel.org F: drivers/iio/pressure/dlh.c +F: Documentation/devicetree/bindings/iio/pressure/asc,dlh.yaml ALLEGRO DVT VIDEO IP CORE DRIVER M: Michael Tretter