From patchwork Sun Mar 18 13:34:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Veenstra X-Patchwork-Id: 10291159 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6276660385 for ; Sun, 18 Mar 2018 13:34:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51AE7288EA for ; Sun, 18 Mar 2018 13:34:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 455B82900F; Sun, 18 Mar 2018 13:34:58 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 D67C5288EA for ; Sun, 18 Mar 2018 13:34:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753955AbeCRNe5 (ORCPT ); Sun, 18 Mar 2018 09:34:57 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:37456 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752372AbeCRNe4 (ORCPT ); Sun, 18 Mar 2018 09:34:56 -0400 Received: by mail-wm0-f68.google.com with SMTP id 139so10833585wmn.2 for ; Sun, 18 Mar 2018 06:34:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KeZXrBmmTQpuwo5+ieppd9Ip7O/FKrUKYvDFvlJiehY=; b=Ee3DFqQM8c62zc2TBb3WZfqL/vU9ITeRrFZ0xEVaiIEFG1g9jD4p9PhzpRLBxSJEnI SlToM7Nb/wCAxLIIJE3ftm5n152o/eZio8jsssj2r5sTYRnzjbGmYesmV343XYlEw/SP J18nyGVHLqy/YV95HK9gG8b7+Ua9EnldjQlmrPt2wqXOJGTcf5DACJT511XHLloU5DwG 4HRvgmVrNX85CgUyuEAKWeo2wV5nwv+7sHZ+0x9F7IGBzg8z66C5uLlaP8M4bFc8pTQi T5WxoEw+Dwm7MgYuv4VzGPxibyLe8KmQ2g8aUEs4k5MoJFyrA9QcgfzHD5GD721fSoH/ zr+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=KeZXrBmmTQpuwo5+ieppd9Ip7O/FKrUKYvDFvlJiehY=; b=VPV1aSdwx3fnNO16ZP0W1KtwGIELfHaeUNMetDnI/tfEgSFj/jM+hM76ud41hbMFBN 9ep0Viz1oEqb3qRAfkGNOvl/KL/tsYKDugWTFdGq9p7eWOU6g8xcQ0uITiS+UetAWoBk nFf/9fsa/LDVE7ivTN6zL2n4w23yPFitl7TdEwz6pYrfctLydZiLKCxQy9kzVmFlJaeC KAYnoqzlUEoYF1MIfg6j5tjYUTQbAEbuke0xKDAM6GBfePUTiQOz8yXu5hqtxFqKoPRV GL1OndR1dwDOtVExwlQZZ3I79mal3EphQGvc10F6IOj+q9BYGU7gl3SsCiXlWwfrWPfe FL6Q== X-Gm-Message-State: AElRT7HCPcQLa70Jl/YGPcIFdwox2M7cBfwEvW4swwXVgEzesFvPVdq/ 8LHYo/Kd70TlBmzB20I5zIw= X-Google-Smtp-Source: AG47ELsS5/thnsNTlEBMUsC0TcSzuXHlHuj3V+ejLQXi2BuygHnb2USuoLzKMw2gSi2oQFu5ZJAlTg== X-Received: by 10.80.158.76 with SMTP id z70mr9927441ede.89.1521380095808; Sun, 18 Mar 2018 06:34:55 -0700 (PDT) Received: from zenbook-arch (s559434a1.adsl.online.nl. [85.148.52.161]) by smtp.gmail.com with ESMTPSA id c9sm7157373edl.23.2018.03.18.06.34.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 18 Mar 2018 06:34:54 -0700 (PDT) Date: Sun, 18 Mar 2018 14:34:53 +0100 From: David Veenstra To: lars@metafoo.de, jic23@kernel.org Cc: Michael.Hennerich@analog.com, knaack.h@gmx.de, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH 03/11] staging: iio: ad2s1200: Add blank lines Message-ID: <4f80f1c8873861180a51e3daaf9da9e01c1502f1.1521379685.git.davidjulianveenstra@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) 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 blank lines to improve readability. Signed-off-by: David Veenstra --- drivers/staging/iio/resolver/ad2s1200.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers/staging/iio/resolver/ad2s1200.c index 94d0a66532fd..20df16b7852b 100644 --- a/drivers/staging/iio/resolver/ad2s1200.c +++ b/drivers/staging/iio/resolver/ad2s1200.c @@ -9,6 +9,7 @@ * published by the Free Software Foundation. * */ + #include #include #include @@ -53,10 +54,12 @@ static int ad2s1200_read_raw(struct iio_dev *indio_dev, mutex_lock(&st->lock); gpio_set_value(st->sample, 0); + /* delay (6 * AD2S1200_TSCLK + 20) nano seconds */ udelay(1); gpio_set_value(st->sample, 1); gpio_set_value(st->rdvel, !!(chan->type == IIO_ANGL)); + ret = spi_read(st->sdev, st->rx, 2); if (ret < 0) { mutex_unlock(&st->lock); @@ -76,9 +79,11 @@ static int ad2s1200_read_raw(struct iio_dev *indio_dev, mutex_unlock(&st->lock); return -EINVAL; } + /* delay (2 * AD2S1200_TSCLK + 20) ns for sample pulse */ udelay(1); mutex_unlock(&st->lock); + return IIO_VAL_INT; } @@ -116,9 +121,11 @@ static int ad2s1200_probe(struct spi_device *spi) return ret; } } + indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); if (!indio_dev) return -ENOMEM; + spi_set_drvdata(spi, indio_dev); st = iio_priv(indio_dev); mutex_init(&st->lock);