Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1371525pxv; Fri, 16 Jul 2021 07:56:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsyJduL7LDG1g+8TdcnoaR8jilTb9y6wiZ8xEs27iwk8/1IYlm8hrPQGqu+wa+Xm9EgI7f X-Received: by 2002:a02:818c:: with SMTP id n12mr9326024jag.2.1626447388365; Fri, 16 Jul 2021 07:56:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626447388; cv=none; d=google.com; s=arc-20160816; b=sbFibDuDfjle1KL6xlVxa4LcKNTjNuChbCnD5rYF2be7x6gsShJAZNrBztG7sZJZ46 XNLbvB0tL3a7uc7+0ed4hMsJ2CpcWgDPumXfAn2hmegBn4oTXzQzIhz1Qvb/5GVI8wId dnAYJOnCy2u+kyM0AT+nWjtqLcCwzNaieOAUgmKAZ9i9oe0pG2MR3bv+FnHZ4C2/6NIs GUdc+OcC+ZFT4gDpFpo0X6rjj55NPJxl0bDj4igDD9A+vhecmy/ow6Uym4KF7p/+W3Yg /Xil/IAJQVJiXVo5zRL2aGi0/B5z9rBoyQZHHXZWWP2ZW32D4IbGnQZOVELgI3XsMy88 Yvnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=cDFHDauT3RJ9MLsKNJdQMhfJiWSb2KAxAbOMS927HhU=; b=zjf4zuQxO9qlSEhqHTM55mKcZnZRQzDAlTOD7OYVHbG7ieWwgpdO4RvdjPQU5KhNOF kcEySvQbztthO5tdp16DDOdzebjygUJTC6egpfMiRB5pdCGRBAWZYrZ/i14O6r83uVZo dCRr0c0AHwZNMqCdChlHxjkgeraRCQw0TRqSmkoGcc/X2ge0DiJq6Nl3kT7vO5B5F/ri TA7Xd4Xbv0/xqCdcOmz1TzSm58UHthsrFIrAsgyg8BprocUrdVkxD9bWTaYvfp3moEIX IT1/dYj68rbXsckYL3M6g5Lvz4nByZ9+tFSnlQwdWf/1uPHFRNXlWV5PS5enr4wZW6QO tJVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KpBBrYJ3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z10si92735ioq.37.2021.07.16.07.56.16; Fri, 16 Jul 2021 07:56:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KpBBrYJ3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240735AbhGPO45 (ORCPT + 99 others); Fri, 16 Jul 2021 10:56:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240459AbhGPO44 (ORCPT ); Fri, 16 Jul 2021 10:56:56 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C2E5C06175F; Fri, 16 Jul 2021 07:54:02 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id o4so5577736pgs.6; Fri, 16 Jul 2021 07:54:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cDFHDauT3RJ9MLsKNJdQMhfJiWSb2KAxAbOMS927HhU=; b=KpBBrYJ3ymii565DyMrXFfKsQTCqKhgJ+ot1+aN4qxdxBK1RgZcyUNeEKf5HYAq/gM 7ckGW5Le4rwCAqb9JS/DyU3laIhdKGc8RpRopxtxsEx1QRr3Q60nKFyRmtBKZJzuOsK7 ZZ/EBmSEdAo9YiXW33WGXCJWp83mN/BCwOZsHK9E0ZIwIXTu+XpymmS8+6tkpwmGn3SR /Rk4gCDCHw4hdQdTZCF4KXc9JfzUPEpdH7u5YzGlYocJ3Jmx1B5466LEmMl1UTgLqRWK s3J2Z16zq4PqMAPv5aOjj7cpGfsog+c5BHrZWUihbAk8Ai37KdJ6ZAfysU5AkWCbQCSc 5HVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cDFHDauT3RJ9MLsKNJdQMhfJiWSb2KAxAbOMS927HhU=; b=mxmMu4OyymU4hE0NOaEXh6YqmVBt8+y2hFcqucxBMD6KT4nNrpUGXWpJjYtHlmZ0BP 2j6Lhegrtzr+nP4jAmvPQxVPDUr7d8SzY6rto9NZ/FDPlKLsXM+LtwVJ4e++ju7FLO7d vRCWeIYenQvmjQwG3OUMA/KDwMAU9txIarijXs91/QRKIth9rKwHI6AbwL0xM/SzfwXy /IVwWpNTLf1qC83KhjeNU3oOPMqgLYMw8sUWxyJCUrE+xIb/zJ4tqOcS8ErH9pzwnpJZ yOoMpP6eBVAnOdnt5BevLQTc/IIB5pw+6dHSGM5/nqX0BRfcUJwq7y2sDvSFkXRUjqjF EuNw== X-Gm-Message-State: AOAM530HOpiiV6+0n5wA/OYPysGxsaJVrBuZ8ArrRZPT9YS26OcINrJu sRIqnnuKZ0CWHu4KCQEXBFyJ/fvj/ClIZnFveUo= X-Received: by 2002:a65:434a:: with SMTP id k10mr10456163pgq.4.1626447241433; Fri, 16 Jul 2021 07:54:01 -0700 (PDT) MIME-Version: 1.0 References: <20210716114210.141560-1-antoniu.miclaus@analog.com> In-Reply-To: <20210716114210.141560-1-antoniu.miclaus@analog.com> From: Andy Shevchenko Date: Fri, 16 Jul 2021 17:53:22 +0300 Message-ID: Subject: Re: [PATCH v6 1/2] iio: frequency: adrf6780: add support for ADRF6780 To: Antoniu Miclaus Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, jic23@kernel.org, devicetree@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 16, 2021 at 2:43 PM Antoniu Miclaus wrote: > > The ADRF6780 is a silicon germanium (SiGe) design, wideband, > microwave upconverter optimized for point to point microwave > radio designs operating in the 5.9 GHz to 23.6 GHz frequency > range. > Datasheet: > https://www.analog.com/media/en/technical-documentation/data-sheets/ADRF6780.pdf Is it one line? If not, please put on one line and drop below the blank line so it will go as a tag. > > Signed-off-by: Antoniu Miclaus First question is why not to use the regmap API (I have heard it has gained support of 17 bit)? ... > + depends on COMMON_CLK Is it mandatory for any function inside the device? ... > +static int adrf6780_spi_read(struct adrf6780_dev *dev, unsigned int reg, > + unsigned int *val) > +{ > + int ret; > + struct spi_transfer t = {0}; > + dev->data[0] = 0x80 | (reg << 1); This 0x80 I guess is pretty much standard and regmap SPI supports it. > + dev->data[1] = 0x0; > + dev->data[2] = 0x0; > + > + t.rx_buf = &dev->data[0]; > + t.tx_buf = &dev->data[0]; > + t.len = 3; > + > + ret = spi_sync_transfer(dev->spi, &t, 1); > + if (ret) > + return ret; > + > + *val = (get_unaligned_be24(&dev->data[0]) >> 1) & GENMASK(15, 0); > + > + return ret; > +} ... > + usleep_range(200, 250); Needs a comment. -- With Best Regards, Andy Shevchenko