From patchwork Sat Dec 7 04:53:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Carvalho X-Patchwork-Id: 11277267 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 9B2EF109A for ; Sat, 7 Dec 2019 04:54:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7706124670 for ; Sat, 7 Dec 2019 04:54:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B1z22Lhh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726608AbfLGEyL (ORCPT ); Fri, 6 Dec 2019 23:54:11 -0500 Received: from mail-ua1-f66.google.com ([209.85.222.66]:33817 "EHLO mail-ua1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726400AbfLGEyL (ORCPT ); Fri, 6 Dec 2019 23:54:11 -0500 Received: by mail-ua1-f66.google.com with SMTP id w20so3736622uap.1; Fri, 06 Dec 2019 20:54:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=IiFK9BAduFHna34DQon87G4FreS7gq1kGZB1A1KnXt8=; b=B1z22Lhh9VfS9y96LDb+/zD+DLGmgwCbnKJoVsVQNPEdnKtyDwwaoweZBDk1JO106U lqYp0tK7lfgsLI4kTrC15itURVO5/25IyjlDJ+LRiaWinA67W2nZh8dCXRJfT2f9yQnI evcCeX0jmzi0DWPkaTSaxPUDlCDpwS+O+CIf/pga0RoGEMtP3ruJ2D1J8y+Oo3EKhV+q 1KzeXbdiFSnYzVuqQ5mMUY4ot2Vwvx+DW1Jou+Mulzib8IkoJajb91j2OvR7QVy+z055 KfojXyMGJoPai0FgwkoluJAkr94gYhYK1Tzsc5SqWo17FqrnbaPkWh0PpsqRkWzo+qQ/ vPxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=IiFK9BAduFHna34DQon87G4FreS7gq1kGZB1A1KnXt8=; b=IOc22fzj3dXAOcL5E20njJIOKNSWJJocAG8k3COvKfOFD4wMghdWZV66/MESeySdCQ GmLYHMy9fDc4LUBrGvVO/Oyw1yBt9/dmWtYubEKo4QRAmjdQb6KNDEHSsh7RjAMBjGER fyr9TkjDJckdzzIKDZEWnPa82lPG9ysxg+shFAB0duLZJ14azAbQ2G5osLAXm2w5OuzY JPoR9KIxqLPJadE7RkGJ54/5QCfy7gdNI2cLwd5pyD/FthldtYX/3t8be2U8qMmCMTAj DfXjm0nba9sGi37bwpvncjHNJHFT5vON2H58LoTLMwZ+0nHCcQGgKqj3ShCrhxew817P YCjw== X-Gm-Message-State: APjAAAXHe8cXsG/JGTPqTXNUEsGMEKxFcWN8p8YmHTs4Q9xXefOghnb/ RyZoUhyApBP0Oq0/KrJk00E= X-Google-Smtp-Source: APXvYqzcU+qHwBoWF6V8jXH/kcw3HOHOmuN+vu+g7aB6s7KogEati7PJZ06qZOY8EV/W68ROszZyBQ== X-Received: by 2002:ab0:46c:: with SMTP id 99mr16117574uav.134.1575694449985; Fri, 06 Dec 2019 20:54:09 -0800 (PST) Received: from localhost.localdomain ([177.45.184.74]) by smtp.gmail.com with ESMTPSA id w132sm8156205vkw.46.2019.12.06.20.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 20:54:09 -0800 (PST) From: Rodrigo Carvalho To: Lars-Peter Clausen , Michael Hennerich , Stefan Popa , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, kernel-usp@googlegroups.com, Rodrigo Carvalho Subject: [PATCH v6 1/2] staging: iio: accel: adis16240: enforce SPI mode on probe function Date: Sat, 7 Dec 2019 01:53:38 -0300 Message-Id: <20191207045339.9186-1-rodrigorsdc@gmail.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org According to the datasheet, this driver supports only SPI mode 3, so we should enforce it on probe function. Signed-off-by: Rodrigo Carvalho --- V6: -none drivers/staging/iio/accel/adis16240.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/staging/iio/accel/adis16240.c b/drivers/staging/iio/accel/adis16240.c index 82099db4bf0c..77b6b81767b9 100644 --- a/drivers/staging/iio/accel/adis16240.c +++ b/drivers/staging/iio/accel/adis16240.c @@ -400,6 +400,13 @@ static int adis16240_probe(struct spi_device *spi) indio_dev->num_channels = ARRAY_SIZE(adis16240_channels); indio_dev->modes = INDIO_DIRECT_MODE; + spi->mode = SPI_MODE_3; + ret = spi_setup(spi); + if (ret) { + dev_err(&spi->dev, "spi_setup failed!\n"); + return ret; + } + ret = adis_init(st, indio_dev, spi, &adis16240_data); if (ret) return ret; From patchwork Sat Dec 7 04:53:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Carvalho X-Patchwork-Id: 11277269 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 E620A14BD for ; Sat, 7 Dec 2019 04:54:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C49D32245C for ; Sat, 7 Dec 2019 04:54:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="vKFZXiU8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726511AbfLGEyQ (ORCPT ); Fri, 6 Dec 2019 23:54:16 -0500 Received: from mail-ua1-f51.google.com ([209.85.222.51]:45128 "EHLO mail-ua1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726400AbfLGEyQ (ORCPT ); Fri, 6 Dec 2019 23:54:16 -0500 Received: by mail-ua1-f51.google.com with SMTP id 59so3709126uap.12; Fri, 06 Dec 2019 20:54:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PoAYAtQsECMKBQu3m3UL38cyfBNcCrjyU109EM5/2Kk=; b=vKFZXiU88cdk8U11fBerp2o/L9d60eSFcOf8iuyvdLhzAF+nThRMBGnaPY0Gm5EIO7 fwco54CdXQfPHpYvhDp/m3EsVFrA8TciyqTvJ9DvDSTciLEHNm1xMdpNHsrdltMGQRSm xtv2y6APCIZ1MqVTlB6QAWiJGI/ezpQB/bIdhtivtjotOiONQAqwtXpVRfc2yqmWlbiD vRkWv2u45JfIoQsNVwLZhMnUfq7FIJbR7f8RoUo2lxqi+rH8L5qHNT7dlDPzaTYkoFSr R3h5DB6Kf8hIPGe9YU85vzyjY8YbKZvv9cUWekwvVS1fkbN0PqjgnSv1IXBi67u2+BUN 7D3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PoAYAtQsECMKBQu3m3UL38cyfBNcCrjyU109EM5/2Kk=; b=BzMzn3X+XCr0WH/XL2SfOHvsEv12ipyXIV88eSPVBpC2vTLt4odaII3d+DokjER9Tl RF1lZc8msRFGW6L8Y5f296eNq+3vMaI6pOkVAEjCilJgKmUYtcEH1lTAniEZipa2W7gG wtxvv3QnDcxZASW5Yd8DtTYFtFEuMt7iVIGcqmVSQCbU80JBqAJVUacQXaHkxKlsf2gi +eKgCgyVQawkOQ8P+clGHf25D1CsrWIbWVLHDm7qIdKfb3xFRxWq0b6cOZoHyQFCmSrX jf8yCdXkaD2GbgiR83+cLQnLHoiFEOp4XSjxa2/SaooHRoOpFcULF9IixmYXIc+SPdy2 IK7w== X-Gm-Message-State: APjAAAV4N7wBrLM3WLVSuvruSGF7mum1yB1tp39mNHbu/7tkotvBbJmw kQb6uzu+iW3V7AxB1/YZjCE= X-Google-Smtp-Source: APXvYqz5B4qddztDDlAGY2AqZoYhWgimCOX1uIFxzn4FIBcw/FxrrTMa9ztU/J7UcMFTFBUysGo9Jw== X-Received: by 2002:ab0:30a4:: with SMTP id b4mr10697339uam.85.1575694455208; Fri, 06 Dec 2019 20:54:15 -0800 (PST) Received: from localhost.localdomain ([177.45.184.74]) by smtp.gmail.com with ESMTPSA id w132sm8156205vkw.46.2019.12.06.20.54.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 20:54:14 -0800 (PST) From: Rodrigo Carvalho To: Lars-Peter Clausen , Michael Hennerich , Stefan Popa , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, kernel-usp@googlegroups.com, Rodrigo Carvalho Subject: [PATCH v6 2/2] dt-bindings: iio: accel: add binding documentation for ADIS16240 Date: Sat, 7 Dec 2019 01:53:39 -0300 Message-Id: <20191207045339.9186-2-rodrigorsdc@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191207045339.9186-1-rodrigorsdc@gmail.com> References: <20191207045339.9186-1-rodrigorsdc@gmail.com> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org This patch add device tree binding documentation for ADIS16240. Signed-off-by: Rodrigo Carvalho --- V6: - Update SPDX license identifier .../bindings/iio/accel/adi,adis16240.yaml | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml new file mode 100644 index 000000000000..4147f02b5e3c --- /dev/null +++ b/Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/accel/adi,adis16240.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ADIS16240 Programmable Impact Sensor and Recorder driver + +maintainers: + - Alexandru Ardelean + +description: | + ADIS16240 Programmable Impact Sensor and Recorder driver that supports + SPI interface. + https://www.analog.com/en/products/adis16240.html + +properties: + compatible: + enum: + - adi,adis16240 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + +examples: + - | + #include + #include + spi0 { + #address-cells = <1>; + #size-cells = <0>; + + /* Example for a SPI device node */ + accelerometer@0 { + compatible = "adi,adis16240"; + reg = <0>; + spi-max-frequency = <2500000>; + interrupt-parent = <&gpio0>; + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; + }; + };