From patchwork Sat Dec 8 18:19:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Schmitt X-Patchwork-Id: 10719731 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 E2DC3109C for ; Sat, 8 Dec 2018 18:19:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D07872B2E4 for ; Sat, 8 Dec 2018 18:19:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C47A62B317; Sat, 8 Dec 2018 18:19:16 +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,FREEMAIL_FROM,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 5B6A72B2E4 for ; Sat, 8 Dec 2018 18:19:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726174AbeLHSTP (ORCPT ); Sat, 8 Dec 2018 13:19:15 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:34148 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726142AbeLHSTP (ORCPT ); Sat, 8 Dec 2018 13:19:15 -0500 Received: by mail-qt1-f193.google.com with SMTP id r14so8195617qtp.1; Sat, 08 Dec 2018 10:19:13 -0800 (PST) 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=3ASDzKMtiVT4Z0JiMG3IHch+aSbW5ahwV29P1VwMv1M=; b=NGVxMjvMPhTdPXKhRNXnzEC1k1jEHdiTpqaGaG51OO49x8CTxhEzNinyK5/rWO5DkS 8Czcv1ERyWFnKxzBXG6Di+jc/i3bnhdL8XwuW2VZrA5tZ35eLyRbqXizKkbAxZoiu99t GOlYa5VFoBSugRij/qulliCWrtW9JNeZX1KL9q8AdNobzWvkgMeSN435hqQ9l91Q1v7w PBEkQFlVe3aIiFmXrJOaEAxkbbwZG1JkwEyzIk1cpE2x8VqVWeUkBkx2YTMhIMXMSN6W t3oEuenLyx+ltEKUU/hiSslqor3Zr9iZ2/rsmPhiQmggW2zz2JVIaqMuX5eFAqsqVrFG 2cMA== 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=3ASDzKMtiVT4Z0JiMG3IHch+aSbW5ahwV29P1VwMv1M=; b=DUbu9bzHq4qLUXxWY+3CH5pQDsh2hUWLk01ELscloDPnlS5WqZHzUrpcrF3fWWtk9B PqMX3SrrwfEGuN8M8I6E4Jqt386XVimflnaga5ruIS7CVHLmlaxwA8rLGFzGSfMK8Lyg BmD3o7TNi6+wo988B2KMbgf3UL9zV2eAa+twBUR6d1mRT+G9Pc7lqhce9S4p/rEuCK9u QE8qxCTyJbESUAqZs9tmG9/T7CxA3EefzwKKbkTUrs/vNefIetCvbQwFfS/2XOQ6qu16 I9FvuMjUKVO3kBESmvzbKxEG+kVH4lJyYW7vD23Ln6vjQshVXR8ld9cs0veZci8Hs4nV ojwA== X-Gm-Message-State: AA+aEWY5CjeN/gkLQ7v40llMkxma9JbSovk1BXc3PueaoYMRRyKqYRlQ 6nHeSxaJ6ytMGjTG5/Q9q8Y= X-Google-Smtp-Source: AFSGD/UCAwcSfqZKLoUQaabpkM4czTHL4vixp65mBLZA/ZGQRwGXnCWIiya4q/JbK+efcEvWjb1sOw== X-Received: by 2002:ac8:24e7:: with SMTP id t36mr6462301qtt.43.1544293153423; Sat, 08 Dec 2018 10:19:13 -0800 (PST) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id v2sm3358198qte.75.2018.12.08.10.19.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 08 Dec 2018 10:19:13 -0800 (PST) Date: Sat, 8 Dec 2018 16:19:08 -0200 From: Marcelo Schmitt To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, stefan.popa@analog.com, alexandru.Ardelean@analog.com Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com Subject: [PATCH 1/3] staging: iio: ad5933: change regulator binging for vref Message-ID: <06caedbbe394a76feedbc77edb0df2c6109217bd.1544292845.git.marcelo.schmitt1@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 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 Set a single voltage regulator for all voltage references. Remove voltage reference value from default platafrom data struct. Signed-off-by: Marcelo Schmitt Signed-off-by: Gabriel Capella Co-Developed-by: Gabriel Capella --- drivers/staging/iio/impedance-analyzer/ad5933.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c index 9e52384f5370..730bc397a26b 100644 --- a/drivers/staging/iio/impedance-analyzer/ad5933.c +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c @@ -91,7 +91,6 @@ struct ad5933_platform_data { unsigned long ext_clk_hz; - unsigned short vref_mv; }; struct ad5933_state { @@ -113,7 +112,6 @@ struct ad5933_state { }; static struct ad5933_platform_data ad5933_default_pdata = { - .vref_mv = 3300, }; #define AD5933_CHANNEL(_type, _extend_name, _info_mask_separate, _address, \ @@ -691,7 +689,7 @@ static void ad5933_work(struct work_struct *work) static int ad5933_probe(struct i2c_client *client, const struct i2c_device_id *id) { - int ret, voltage_uv = 0; + int ret; struct ad5933_platform_data *pdata = dev_get_platdata(&client->dev); struct ad5933_state *st; struct iio_dev *indio_dev; @@ -718,12 +716,12 @@ static int ad5933_probe(struct i2c_client *client, dev_err(&client->dev, "Failed to enable specified VDD supply\n"); return ret; } - voltage_uv = regulator_get_voltage(st->reg); + ret = regulator_get_voltage(st->reg); + + if (ret < 0) + goto error_disable_reg; - if (voltage_uv) - st->vref_mv = voltage_uv / 1000; - else - st->vref_mv = pdata->vref_mv; + st->vref_mv = ret / 1000; if (pdata->ext_clk_hz) { st->mclk_hz = pdata->ext_clk_hz; From patchwork Sat Dec 8 18:19:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Schmitt X-Patchwork-Id: 10719733 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 BF85714E2 for ; Sat, 8 Dec 2018 18:19:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACDFE2B2E4 for ; Sat, 8 Dec 2018 18:19:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E86B2B317; Sat, 8 Dec 2018 18:19:46 +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,FREEMAIL_FROM,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 290502B2E4 for ; Sat, 8 Dec 2018 18:19:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726177AbeLHSTp (ORCPT ); Sat, 8 Dec 2018 13:19:45 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:38853 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726142AbeLHSTp (ORCPT ); Sat, 8 Dec 2018 13:19:45 -0500 Received: by mail-qt1-f193.google.com with SMTP id p17so8160739qtl.5; Sat, 08 Dec 2018 10:19:44 -0800 (PST) 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=g4OFN6eemQMqhRIJQa2XiEjm3UXDOntNSgSULrBno2I=; b=YOX+hnXiYx7gdUnlIxaxaQHe+dn83E3qufUQsU0WcpoxN3CdCs96lAuG6MX34/jtDa mNHeG6e/YJH8oqRYYLSkOGiZR8iniAqrkstocyzJJZHAr6nREYM7aMQtGlfQ4sDCzdWv IvPHjc0q5Xohn2Y6/hWvPtDCSLmsBqIvsaf/O6+PGTwBNk/x/bd0OK3OvkXAToEA0Z/w 4Na5BFZ9dJEFqzlxNcPvRKoXAcOoKWQt8q2mzjN651+M70Y3G6cdAG3Dr4KY1S00N+Ed NPDNWUNOBWSK9LjL7+LN2YxTyNj0z29WU/PEwJVLYKeL5Dm2Udqr6Ba+LTWRsuRkc8OA Xc1Q== 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=g4OFN6eemQMqhRIJQa2XiEjm3UXDOntNSgSULrBno2I=; b=WAOtwSbT5IBJarONX2NEC0VUJzJBeuw4awHMkC4wGPXyeXIeUAo3RsEoNGKI6W57vH A0I6EWOkcprMfhajyl+8yEY9mwZOguJbdI1blvZFy1aIUBsoFdQ9lt6Dfg9YfG+0e37T hUGjkHaLzyv8+rJAkyhGDXj0OCckZuLNa0JcQASfxO1I1Y7JUugv+orPTYcGs5FIGacG O3AQnxuLfTcxJiSYq0HFt02eM4rKyKcKvB93IRqBYHN6uk8s9xdFfgkaxUBbChd1y18f eHBJ6kOTPugDcDUpsNE5UcLVlnrt3stTFUfV7X56hpAzbQJ1O09RRJd7+L9Dt7VNNF7a Y9/Q== X-Gm-Message-State: AA+aEWa5hJH2BzjfO1ZsLwX9nb2ieI/Ajp7H++Cq5GSIFU1SSg6grZQO 6GfaE/6fRRQyYGxbBQQT8aw= X-Google-Smtp-Source: AFSGD/WZiuk50zuzRkK4cGxfdItnaZioz1C64N9W8eTKA1obuJ2yvHdoLQKKYJAh4M5uvW3HGactjA== X-Received: by 2002:ac8:280f:: with SMTP id 15mr6671364qtq.31.1544293184010; Sat, 08 Dec 2018 10:19:44 -0800 (PST) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id v186sm3705967qkd.13.2018.12.08.10.19.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 08 Dec 2018 10:19:43 -0800 (PST) Date: Sat, 8 Dec 2018 16:19:38 -0200 From: Marcelo Schmitt To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, stefan.popa@analog.com, alexandru.Ardelean@analog.com Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com Subject: [PATCH 2/3] staging: iio: ad5933: use clock framework for clock reference Message-ID: <2e60aac1f824d421b355e0df8b4a564fb422202b.1544292845.git.marcelo.schmitt1@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 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 the option to specify the external clock (MCLK) using the clock framework. Also remove the old platform data structure. Signed-off-by: Marcelo Schmitt Signed-off-by: Gabriel Capella Co-Developed-by: Gabriel Capella --- .../staging/iio/impedance-analyzer/ad5933.c | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c index 730bc397a26b..3134295f014f 100644 --- a/drivers/staging/iio/impedance-analyzer/ad5933.c +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -82,20 +83,10 @@ #define AD5933_POLL_TIME_ms 10 #define AD5933_INIT_EXCITATION_TIME_ms 100 -/** - * struct ad5933_platform_data - platform specific data - * @ext_clk_hz: the external clock frequency in Hz, if not set - * the driver uses the internal clock (16.776 MHz) - * @vref_mv: the external reference voltage in millivolt - */ - -struct ad5933_platform_data { - unsigned long ext_clk_hz; -}; - struct ad5933_state { struct i2c_client *client; struct regulator *reg; + struct clk *mclk; struct delayed_work work; struct mutex lock; /* Protect sensor state */ unsigned long mclk_hz; @@ -111,9 +102,6 @@ struct ad5933_state { unsigned int poll_time_jiffies; }; -static struct ad5933_platform_data ad5933_default_pdata = { -}; - #define AD5933_CHANNEL(_type, _extend_name, _info_mask_separate, _address, \ _scan_index, _realbits) { \ .type = (_type), \ @@ -690,9 +678,9 @@ static int ad5933_probe(struct i2c_client *client, const struct i2c_device_id *id) { int ret; - struct ad5933_platform_data *pdata = dev_get_platdata(&client->dev); struct ad5933_state *st; struct iio_dev *indio_dev; + unsigned long ext_clk_hz = 0; indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*st)); if (!indio_dev) @@ -704,9 +692,6 @@ static int ad5933_probe(struct i2c_client *client, mutex_init(&st->lock); - if (!pdata) - pdata = &ad5933_default_pdata; - st->reg = devm_regulator_get(&client->dev, "vdd"); if (IS_ERR(st->reg)) return PTR_ERR(st->reg); @@ -723,8 +708,21 @@ static int ad5933_probe(struct i2c_client *client, st->vref_mv = ret / 1000; - if (pdata->ext_clk_hz) { - st->mclk_hz = pdata->ext_clk_hz; + st->mclk = devm_clk_get(&client->dev, "mclk"); + if (IS_ERR(st->mclk) && PTR_ERR(st->mclk) != -ENOENT) { + ret = PTR_ERR(st->mclk); + goto error_disable_reg; + } + + if (!IS_ERR(st->mclk)) { + ret = clk_prepare_enable(st->mclk); + if (ret < 0) + goto error_disable_reg; + ext_clk_hz = clk_get_rate(st->mclk); + } + + if (ext_clk_hz) { + st->mclk_hz = ext_clk_hz; st->ctrl_lb = AD5933_CTRL_EXT_SYSCLK; } else { st->mclk_hz = AD5933_INT_OSC_FREQ_Hz; @@ -744,7 +742,7 @@ static int ad5933_probe(struct i2c_client *client, ret = ad5933_register_ring_funcs_and_init(indio_dev); if (ret) - goto error_disable_reg; + goto error_disable_mclk; ret = ad5933_setup(st); if (ret) @@ -758,6 +756,8 @@ static int ad5933_probe(struct i2c_client *client, error_unreg_ring: iio_kfifo_free(indio_dev->buffer); +error_disable_mclk: + clk_disable_unprepare(st->mclk); error_disable_reg: regulator_disable(st->reg); @@ -772,6 +772,7 @@ static int ad5933_remove(struct i2c_client *client) iio_device_unregister(indio_dev); iio_kfifo_free(indio_dev->buffer); regulator_disable(st->reg); + clk_disable_unprepare(st->mclk); return 0; } From patchwork Sat Dec 8 18:19:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Schmitt X-Patchwork-Id: 10719735 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 7822314E2 for ; Sat, 8 Dec 2018 18:20:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64D612B331 for ; Sat, 8 Dec 2018 18:20:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57B182B335; Sat, 8 Dec 2018 18:20: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,FREEMAIL_FROM,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 006922B331 for ; Sat, 8 Dec 2018 18:20:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726176AbeLHSUG (ORCPT ); Sat, 8 Dec 2018 13:20:06 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:41978 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726142AbeLHSUG (ORCPT ); Sat, 8 Dec 2018 13:20:06 -0500 Received: by mail-qk1-f193.google.com with SMTP id 189so4360368qkj.8; Sat, 08 Dec 2018 10:20:05 -0800 (PST) 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=pb5uQWFFFhTWBdj4Lj9guEHC24NQvxxLHMGux6Q4I9s=; b=k0FH03X4EXowAQYU06J0y7ZyFON1ONhKLSxX6hYOa+5Be/s0LLOw91JBSdexkj0sXB MpIpm9zN9Juu1wtPfX7+q0uHI8Uz55PC53sSsoTJJ5YpLOSQRoAklTteA5d3J4XyqIHO 35ovCWJjw5T2PuZn62gPQcPkNwRUCGhPRR+WR3vTF4lFE7D12eKvAMZi9wvPWxXsTh96 O4VNgovIOI52lEcttl3xmjQ8yWmN6Cg3BI/PVXwCkoRMkvgsqJ7QFAM+LHzlkYZd7i/2 lK+GpQJbLHRtgp20UcInXY2Uv7hXrpsYfWjAcA5ZZsZ1ahNiguqdCMx2rDCKtZfCddrt 5Ulg== 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=pb5uQWFFFhTWBdj4Lj9guEHC24NQvxxLHMGux6Q4I9s=; b=YzxulJwnDnQfyHsiNp0p7IoCgwVoMKx628IS/24TAolL115pehCXzTsoBfH4/JdMWg mvlTwyPdx1Y3GjydbOm79jmtva8QaUhabgQZPLQYZAWBCS7zHF+ccAZMQNe95Yo0CCGP knLi29GuP++qnM4mmu44HKPrP4Wqxqbnts4CvhNf2GsOeUQJ6xBxNMHjwwms6UBbfNRu YOuXwZDX6NRve4aUHN9W5ksTOqT7zwabXVVYf1LHu3S5z5Cl/YEcLSN0ELi+6g2boiO/ RjtkWxSV/UJ8Zy4J40v//aWHp5jkRGsxP1RheHf7g7KSW33k7YlBhY/ikNF+F27eQW/R fyCA== X-Gm-Message-State: AA+aEWbGJToSrgjL6nxCXsa20GVUhvlnSIC+x1sjltBPo8ozS35gNQag 55UyOyohYPnN/qw7619Owfk= X-Google-Smtp-Source: AFSGD/Uw3SEy3npugnk2LJbL37gtMEDcU58aRR+7Nr0V0PQKn2Rz1k2Plj9gxCaU+kVU6sIRJHggHA== X-Received: by 2002:ae9:de44:: with SMTP id s65mr6093040qkf.55.1544293204824; Sat, 08 Dec 2018 10:20:04 -0800 (PST) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id l13sm4777120qkh.45.2018.12.08.10.20.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 08 Dec 2018 10:20:04 -0800 (PST) Date: Sat, 8 Dec 2018 16:19:59 -0200 From: Marcelo Schmitt To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, stefan.popa@analog.com, alexandru.Ardelean@analog.com Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com Subject: [PATCH 3/3] staging: iio: ad5933: add binding doc for ad5933 Message-ID: <348cbe2abbe256b66ed830bd1abb9fc50bf4d10e.1544292845.git.marcelo.schmitt1@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 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 a devicetree documentation for the ad5933 and ad5934 impedance converter, network analyzer. Signed-off-by: Marcelo Schmitt Signed-off-by: Gabriel Capella Co-Developed-by: Gabriel Capella --- .../iio/impedance-analyzer/ad5933.txt | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt diff --git a/Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt b/Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt new file mode 100644 index 000000000000..5ff38728ff91 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt @@ -0,0 +1,26 @@ +Analog Devices AD5933/AD5934 Impedance Converter, Network Analyzer + +https://www.analog.com/media/en/technical-documentation/data-sheets/AD5933.pdf +https://www.analog.com/media/en/technical-documentation/data-sheets/AD5934.pdf + +Required properties: + - compatible : should be one of + "adi,ad5933" + "adi,ad5934" + - reg : the I2C address. + - vdd-supply : The regulator supply for DVDD, AVDD1 and AVDD2 when they + are connected together. + +Optional properties: +- clocks : external clock reference. +- clock-names : must be "mclk" if clocks is set. + +Example for a I2C device node: + + impedance-analyzer@0d { + compatible = "adi,adxl345"; + reg = <0x0d>; + vdd-supply = <&vdd_supply>; + clocks = <&ref_clk>; + clock-names = "mclk"; + };