From patchwork Mon Apr 1 14:37:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Schmitt X-Patchwork-Id: 10880117 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 BA2301800 for ; Mon, 1 Apr 2019 14:37:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A50B928068 for ; Mon, 1 Apr 2019 14:37:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98EEB2876D; Mon, 1 Apr 2019 14:37:21 +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 4830B28068 for ; Mon, 1 Apr 2019 14:37:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728632AbfDAOhQ (ORCPT ); Mon, 1 Apr 2019 10:37:16 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:41207 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728629AbfDAOhQ (ORCPT ); Mon, 1 Apr 2019 10:37:16 -0400 Received: by mail-qt1-f193.google.com with SMTP id w30so10812011qta.8; Mon, 01 Apr 2019 07:37:15 -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:mime-version:content-disposition :user-agent; bh=Zqti8G91y3BMM+COakyXEchnXkd+28NLMRCPgka8P5M=; b=UdlEE5hbg5z7+KGBaBgQCtDyUN8k0vVEmRrQJ3QFymEzMoEHqli9pi7V6hpYMMRHFE jIkf1V2iYO6Eqc2+v5qfkR0X4f3T9xjC7mpRN0Mb+HwMdBUMrHvX00ZlqC9btoYZTFkF HuwtNz0v1e+dq4o/tYXB95nMpXDH+4Wkteo+i5w/xJNI+K29kk40YIKlSVgQTqm5nyV8 2t8yMTvABMULJVKGxnUkQi9NY7EE2MGzgpLJ87UZTxUg4IAENJ2WXoogKhtWhQT7CfHy MTcZyiFg10yddbtEWcFNK0h/TD+x2RKnTArX2/A2ZNVsD02zYn/NkfvFViomfmqEZkTh YoYQ== 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:mime-version :content-disposition:user-agent; bh=Zqti8G91y3BMM+COakyXEchnXkd+28NLMRCPgka8P5M=; b=ixwzW9KCazEOaIbTdR7MIk4H6NySwjri359q93ovSn9FGyzY6iUlsm9ivGMY1aRto+ dHPEZN7Bmn5TddflmETRRWghX/RHh32ga21ZRLTTX9u78vkKVxr6CM25dYjpwU2KvBj5 0TI0Eaq2dEpV9n1qYtY1B2wlC0OvuANZ3YwZ61jHXPTZ9V2v2npjLnF60XSEXOwEVQc0 MTl6r3kJGSbrTKcgbSzTm5CP9ddZQrXw6+EcKsdbYqLFofsrYud9aunQ9pR9x8vhpzyu l2vfwPkoxDRhP+B1bzH7FA0QPCYsePS4+9GZJLYxGYkVv6a38kw9IoBU++CEsMLC1ooc QKow== X-Gm-Message-State: APjAAAVVb9y60yYc58OFD7JCkGCJHuNKf9Nb1l8841jCYE24fCwwF6qT wPCu+sI75toVyK/9mqdzk/4= X-Google-Smtp-Source: APXvYqyrC/0E9fn/v/wbUEyG0zqo/oM1a1szPtbvbe/qzdGlAidVQqyrGScjbzUd2crTiilWx+rnvQ== X-Received: by 2002:a0c:9945:: with SMTP id i5mr42470806qvd.159.1554129435298; Mon, 01 Apr 2019 07:37:15 -0700 (PDT) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id d21sm6754283qtc.91.2019.04.01.07.37.12 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 01 Apr 2019 07:37:15 -0700 (PDT) Date: Mon, 1 Apr 2019 11:37:10 -0300 From: Marcelo Schmitt To: lars@metafoo.de, Michael.Hennerich@analog.com, stefan.popa@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com Subject: [PATCH 1/4] staging: iio: ad9832: organize includes Message-ID: <20190401143710.ruubi2knbjsjzdm7@smtp.gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20180716 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 Organize includes to list them in lexicographic order. Signed-off-by: Marcelo Schmitt --- drivers/staging/iio/frequency/ad9832.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c index a3ce50427724..50a583020072 100644 --- a/drivers/staging/iio/frequency/ad9832.c +++ b/drivers/staging/iio/frequency/ad9832.c @@ -6,22 +6,24 @@ * Licensed under the GPL-2. */ +#include + #include +#include #include +#include +#include #include -#include #include -#include -#include -#include -#include +#include #include #include -#include "dds.h" #include "ad9832.h" +#include "dds.h" + /* Registers */ #define AD9832_FREQ0LL 0x0 From patchwork Mon Apr 1 14:37:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Schmitt X-Patchwork-Id: 10880119 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 0922B1800 for ; Mon, 1 Apr 2019 14:37:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E773028068 for ; Mon, 1 Apr 2019 14:37:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB1432876D; Mon, 1 Apr 2019 14:37:36 +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 A4C7B28068 for ; Mon, 1 Apr 2019 14:37:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728626AbfDAOha (ORCPT ); Mon, 1 Apr 2019 10:37:30 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:39183 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726514AbfDAOha (ORCPT ); Mon, 1 Apr 2019 10:37:30 -0400 Received: by mail-qt1-f195.google.com with SMTP id t28so11062476qte.6; Mon, 01 Apr 2019 07:37:29 -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:mime-version:content-disposition :user-agent; bh=CZbh97nW17oTE1T+Z6+bSMcRH/a33irlHPTZJyWUCNQ=; b=aFd01kK5dBbfKWOnLjf1qPd+vOIHjXSPPLD8zmbQG8MVoQ5CfZI04Eghpjdn2eAt6L 5Z7YWTRK2UnSrAdhHWWQm6a4yh7Ioy4SOlhfpO94rAZf8e6A6jMSsMxOedcMMmBRs6Hq y45v7ONSCw5Yq55up7XMwGM0YVS9bNcO2R+Cjzf3dOtp+u/vQvqYZRIV1t549lMcI9Ce 7a8PIfDLAShy+zYQBd9ikW3bG9hZ0+xQE/LBwIkRUTO4HvIXANedPq5YTLuc/bBUaI+u kZ3pwmU6lutrmPZkuNpWK3A6jnbI5zNtA90l+52TmKJMzoi6XwFQ3xBEnPF92eoM8fGQ +m3A== 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:mime-version :content-disposition:user-agent; bh=CZbh97nW17oTE1T+Z6+bSMcRH/a33irlHPTZJyWUCNQ=; b=rQp8cL07Li6MdQhhumaOvA3UQ2302R3JeP9bmafAXJy2VfYaORZZidx6eQv0gbShYA xZ1uGcM4eIL8zqOi6hwuSvrK4fh+F8+KyApHyqbAUFPJ3WDETTB3eGeBHirMUL8EhXWv CRSnHhsi87BBUwpPpGl9wnamlz6nLKR1pER0fKUUm746yNfm9SUKwRmzGgbvryGffcIf kKr/Ey16pFbPYDfCmN5P5YrQ1E3VTVBOU2s5F5SJ48qmPVv+N1Nys5NbrcxIrI3tweDj dxLuds5Tpkx+e9O95CkCN4YvkNdRY+I22O3892ps9Kxg6qeio6W82LDGBIFwOkqYx84Z 83Yw== X-Gm-Message-State: APjAAAX4wfzbKrjt412XgdepkuGwJ7iTiZLMtzhlUemhMIs2LdrSLcpc kd1E9LY6ldPXj8LSAkLljfI= X-Google-Smtp-Source: APXvYqyEMJ2LpSak2DAdT4MpS6vwbXDoOHFiG8/wtv82gFUXgMFYeO74pHV+3ni3zhQg+SC8a+MxCw== X-Received: by 2002:a0c:98cb:: with SMTP id g11mr37636597qvd.141.1554129448913; Mon, 01 Apr 2019 07:37:28 -0700 (PDT) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id o50sm6493244qtc.23.2019.04.01.07.37.26 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 01 Apr 2019 07:37:28 -0700 (PDT) Date: Mon, 1 Apr 2019 11:37:24 -0300 From: Marcelo Schmitt To: lars@metafoo.de, Michael.Hennerich@analog.com, stefan.popa@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com Subject: [PATCH 2/4] staging: iio: ad9832: add SPDX identifier Message-ID: <20190401143724.mcn73jhdtq3zp3nk@smtp.gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20180716 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 SPDX identifier of GPL-2.0 for the ad9832 driver. Signed-off-by: Marcelo Schmitt Reviewed-by: Mukesh Ojha --- drivers/staging/iio/frequency/ad9832.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c index 50a583020072..d8d4a7936275 100644 --- a/drivers/staging/iio/frequency/ad9832.c +++ b/drivers/staging/iio/frequency/ad9832.c @@ -1,9 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0 /* * AD9832 SPI DDS driver * * Copyright 2011 Analog Devices Inc. - * - * Licensed under the GPL-2. */ #include From patchwork Mon Apr 1 14:37:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Schmitt X-Patchwork-Id: 10880121 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 5DCCA922 for ; Mon, 1 Apr 2019 14:37:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4835828068 for ; Mon, 1 Apr 2019 14:37:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 394892876D; Mon, 1 Apr 2019 14:37:52 +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 B947828068 for ; Mon, 1 Apr 2019 14:37:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726829AbfDAOhv (ORCPT ); Mon, 1 Apr 2019 10:37:51 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:43730 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726514AbfDAOhv (ORCPT ); Mon, 1 Apr 2019 10:37:51 -0400 Received: by mail-qt1-f196.google.com with SMTP id v32so10800269qtc.10; Mon, 01 Apr 2019 07:37:50 -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:mime-version:content-disposition :user-agent; bh=PARVC6Esn0ng0MgzKkk8CbB71tIia3GiyvmWBdVRh18=; b=kkE+/4D0fxOQt6aZzn/NG4ADZZwkz/5C9RQkNgvsQJ6Q2vVJQM4scHDLwQQ2Pr8pnK +X/I1iP8wYWd81SwgkKW+sEfAabcqtwIz1gsuAbU3Go3CAn/OoNLJIYbeOPcdyA/miJe BAq2TkRExyVSY37yjpM3xSGYO76Mf3RBw+Q1DHY+sz6qPcr864Nt8bIOKV1mR9DHDrdI 8FLYVCegNkYpWQ/GrwPRVBm1Z9RY5V0EADJv0osrSfvrGH98FpmaCwraGYzugYqLZ+5B fZ/l2Lf2I3e4oNMh/tpTRm5KVnDBMiwCkM+K99yV9CMiE0Y9r0i5ho8QthLvDdkhc7CX jvAw== 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:mime-version :content-disposition:user-agent; bh=PARVC6Esn0ng0MgzKkk8CbB71tIia3GiyvmWBdVRh18=; b=jZKmXyBYwh6QNBwirqaPiMgnLSSvay982/dch2cVI135+FxkoYYv61BwaBF1kdMv5E wQWbP+1nG/0cANADUTaT8haLUAaGV1OMB01przIsm+DHtm4vpSMoIh1WxYY2XkXpenXy 0HgeWGQTidYqmN8ulIqZkR3zEGj8tQGrndbsBc7pXh5fKHCbSNVppScqcovnu5QCFgv/ RSJ0yQcP0LsvLOWPp3M6CX5WvsgneOfN6MLF8KNxVAaDbbORetP5rLUJDpcm2s/GNuSU s2gWahR88gpQ8etGB6RXsoK5U7uhEfe+an3YpL7T/Aq1eUHHR9LlC8i/9OyQe3IQYFN8 CmLw== X-Gm-Message-State: APjAAAU3Xot5yNq+NO2ucnJ/WWniLklfGoCotmpnh2ipIpP8Ky6SD1SF GjqR+QqWWt6eFPxDCmCqHu9+5tyolgM= X-Google-Smtp-Source: APXvYqwbWsnIV4jyWaJjwrGtAeeJtjVYTRtG5QLsEU1YEj+rjYUSwcU+0dlkyXeIZtv5TnV8vBj5Cw== X-Received: by 2002:a0c:99df:: with SMTP id y31mr49524913qve.171.1554129469907; Mon, 01 Apr 2019 07:37:49 -0700 (PDT) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id 75sm5611136qke.32.2019.04.01.07.37.47 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 01 Apr 2019 07:37:49 -0700 (PDT) Date: Mon, 1 Apr 2019 11:37:45 -0300 From: Marcelo Schmitt To: lars@metafoo.de, Michael.Hennerich@analog.com, stefan.popa@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com Subject: [PATCH 3/4] staging: iio: ad9832: use clock framework for clock reference Message-ID: <20190401143745.ooxttvazrlqe2lcc@smtp.gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20180716 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 Previously external clock were set through platform_data struct. Now device uses clk struct defined in include/linux/clk.h to handle external clock source. It also removes mclk from platform_data struct. Signed-off-by: Marcelo Schmitt --- drivers/staging/iio/frequency/ad9832.c | 37 +++++++++++++++++--------- drivers/staging/iio/frequency/ad9832.h | 1 - 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c index d8d4a7936275..74308a2e72db 100644 --- a/drivers/staging/iio/frequency/ad9832.c +++ b/drivers/staging/iio/frequency/ad9832.c @@ -7,6 +7,7 @@ #include +#include #include #include #include @@ -95,7 +96,7 @@ struct ad9832_state { struct spi_device *spi; struct regulator *avdd; struct regulator *dvdd; - unsigned long mclk; + struct clk *mclk; unsigned short ctrl_fp; unsigned short ctrl_ss; unsigned short ctrl_src; @@ -130,10 +131,10 @@ static int ad9832_write_frequency(struct ad9832_state *st, { unsigned long regval; - if (fout > (st->mclk / 2)) + if (fout > (clk_get_rate(st->mclk) / 2)) return -EINVAL; - regval = ad9832_calc_freqreg(st->mclk, fout); + regval = ad9832_calc_freqreg(clk_get_rate(st->mclk), fout); st->freq_data[0] = cpu_to_be16((AD9832_CMD_FRE8BITSW << CMD_SHIFT) | (addr << ADD_SHIFT) | @@ -334,7 +335,16 @@ static int ad9832_probe(struct spi_device *spi) goto error_disable_avdd; } - st->mclk = pdata->mclk; + st->mclk = devm_clk_get(&spi->dev, "mclk"); + if (IS_ERR(st->mclk)) { + ret = PTR_ERR(st->mclk); + goto error_disable_dvdd; + } + + ret = clk_prepare_enable(st->mclk); + if (ret < 0) + goto error_disable_dvdd; + st->spi = spi; mutex_init(&st->lock); @@ -385,39 +395,41 @@ static int ad9832_probe(struct spi_device *spi) ret = spi_sync(st->spi, &st->msg); if (ret) { dev_err(&spi->dev, "device init failed\n"); - goto error_disable_dvdd; + goto error_unprepare_mclk; } ret = ad9832_write_frequency(st, AD9832_FREQ0HM, pdata->freq0); if (ret) - goto error_disable_dvdd; + goto error_unprepare_mclk; ret = ad9832_write_frequency(st, AD9832_FREQ1HM, pdata->freq1); if (ret) - goto error_disable_dvdd; + goto error_unprepare_mclk; ret = ad9832_write_phase(st, AD9832_PHASE0H, pdata->phase0); if (ret) - goto error_disable_dvdd; + goto error_unprepare_mclk; ret = ad9832_write_phase(st, AD9832_PHASE1H, pdata->phase1); if (ret) - goto error_disable_dvdd; + goto error_unprepare_mclk; ret = ad9832_write_phase(st, AD9832_PHASE2H, pdata->phase2); if (ret) - goto error_disable_dvdd; + goto error_unprepare_mclk; ret = ad9832_write_phase(st, AD9832_PHASE3H, pdata->phase3); if (ret) - goto error_disable_dvdd; + goto error_unprepare_mclk; ret = iio_device_register(indio_dev); if (ret) - goto error_disable_dvdd; + goto error_unprepare_mclk; return 0; +error_unprepare_mclk: + clk_disable_unprepare(st->mclk); error_disable_dvdd: regulator_disable(st->dvdd); error_disable_avdd: @@ -432,6 +444,7 @@ static int ad9832_remove(struct spi_device *spi) struct ad9832_state *st = iio_priv(indio_dev); iio_device_unregister(indio_dev); + clk_disable_unprepare(st->mclk); regulator_disable(st->dvdd); regulator_disable(st->avdd); diff --git a/drivers/staging/iio/frequency/ad9832.h b/drivers/staging/iio/frequency/ad9832.h index 39d326cc1af9..032579a2d539 100644 --- a/drivers/staging/iio/frequency/ad9832.h +++ b/drivers/staging/iio/frequency/ad9832.h @@ -24,7 +24,6 @@ */ struct ad9832_platform_data { - unsigned long mclk; unsigned long freq0; unsigned long freq1; unsigned short phase0; From patchwork Mon Apr 1 14:38:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Schmitt X-Patchwork-Id: 10880125 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 DCE1A1800 for ; Mon, 1 Apr 2019 14:38:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7B7F28068 for ; Mon, 1 Apr 2019 14:38:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB50B2876D; Mon, 1 Apr 2019 14:38:14 +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 5E36D28068 for ; Mon, 1 Apr 2019 14:38:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726617AbfDAOiN (ORCPT ); Mon, 1 Apr 2019 10:38:13 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:41396 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726514AbfDAOiN (ORCPT ); Mon, 1 Apr 2019 10:38:13 -0400 Received: by mail-qt1-f193.google.com with SMTP id w30so10816562qta.8; Mon, 01 Apr 2019 07:38:12 -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:mime-version:content-disposition :user-agent; bh=LB2Pb49enkgEC2sTTtSTqSYnVG/+rCFKbnT65xSw2Ic=; b=n0OPa+98bsbCDqcmJhrL5+C34NEuogMgxtUTeCrLnxndH9UA1GD8uIEV4JNXoSpJJi q1MblY3E3bIDoHwjjHHMgZlMz5RJcta2vknkaEYwhNScKLY75nkrVnwSwOAaFOWDfEJA kVm22ldeBgTVyDA5BoeAW/Pcajbpv22gPpwcT/rNnZDO77OgXa5/Giok03FgFq4+rbHm 8hLKyI8Ky/wI5Rn0ILhz89gQOHRT6NokLYMASeT+S07sV4P7hHkvyDIfdXBJ2TZa0BK9 VmFh5EbYsOSHWRuUimHDyqMzvLlNsAlVSZg4liUH/fFs2BDKKcspY0SO6FZcohzGqcve ujuQ== 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:mime-version :content-disposition:user-agent; bh=LB2Pb49enkgEC2sTTtSTqSYnVG/+rCFKbnT65xSw2Ic=; b=ekm/0bBEmKi/AVfRISkwlHJPbbFlg+SpwnWvRFhWaOrzeTY8gCI8kK6blrS59sdnOA GSA8+74zA3RjWo780HMmFwwqa9pahoJSjV6IYrRWrr25PAjRc2BjCv/tvSYybn0pzGRQ Q3ciRadMEAlEwDVEx99GqxiZs2vqmNSTKTxFVWVLb0UkwJLKPrQ8Z+BQsoP9fU4YHkkJ CG029OS4MUuNafvgHszeKByQlrGOPtMbASu8QhjZ+pn0evkUUmUtAaYzdyiaHfQfZvtN vUHs+UKRlvltT/t+GL5w3YyYuzKACtbcMRXe8IMXJWlj/xOhbDzDn9gY45qb4+rFV7Z7 3/yw== X-Gm-Message-State: APjAAAUD/g83ms9KX4dpn6QfR0A+7mKcN+mQZSqS3qHOPL6Q8TWrP0wp KfmQkur6S6lMJ0GEhAE8X90= X-Google-Smtp-Source: APXvYqxBm/95hgwj/lL/t0G6lUG0Bz7FN26X6tms54NKYdmKy/hpUMHyJnIwCiffdkP3ag8lv/Ap6w== X-Received: by 2002:aed:3ffa:: with SMTP id w55mr51313284qth.142.1554129492488; Mon, 01 Apr 2019 07:38:12 -0700 (PDT) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id t129sm5431244qkc.24.2019.04.01.07.38.09 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 01 Apr 2019 07:38:12 -0700 (PDT) Date: Mon, 1 Apr 2019 11:38:07 -0300 From: Marcelo Schmitt To: lars@metafoo.de, Michael.Hennerich@analog.com, stefan.popa@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com Subject: [PATCH 4/4] staging: iio: ad9832: add devicetree documentation Message-ID: <20190401143807.xlz32drk367ogcxh@smtp.gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20180716 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 ad9832 direct digital synthesizer, waveform generator. Signed-off-by: Marcelo Schmitt --- .../bindings/iio/frequency/ad9832.txt | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/frequency/ad9832.txt diff --git a/Documentation/devicetree/bindings/iio/frequency/ad9832.txt b/Documentation/devicetree/bindings/iio/frequency/ad9832.txt new file mode 100644 index 000000000000..6a35fdff5a48 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/frequency/ad9832.txt @@ -0,0 +1,26 @@ +Analog Devices AD9832 Direct Digital Synthesizer, Waveform Generator + +Data sheet: +https://www.analog.com/media/en/technical-documentation/data-sheets/AD9832.pdf + +Required properties: + - compatible : Must be "adi,ad9832" + - reg : SPI chip select number for the device + - spi-max-frequency = Max SPI frequency to use (< 25000000) + - clocks : The clock reference for the DDS output + - clock-names : Must be "mclk" + +Optional properties: + - avdd-supply: Definition of the regulator used as analog supply + - dvdd-supply : Definition of the regulator used as digital supply + +Example: + adi9832-dds@0 { + compatible = "adi,ad9832"; + reg = <0>; + spi-max-frequency = <25000000>; + clocks = <&ad9832_mclk>; + clock-names = "mclk"; + avdd-suppy = <&avdd>; + dvdd-suppy = <&dvdd>; + };