Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1789040ybv; Fri, 14 Feb 2020 06:06:57 -0800 (PST) X-Google-Smtp-Source: APXvYqzaIyyHaUuoXKmeODlKdBNGal6poP43h7glxV5iNrkhrpuGYnXzrE/AzM13oUswwDsA5S/1 X-Received: by 2002:a05:6830:194:: with SMTP id q20mr2515171ota.92.1581689217579; Fri, 14 Feb 2020 06:06:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581689217; cv=none; d=google.com; s=arc-20160816; b=ud7cpksfIFp5bse2aN8izwFRBJtbZ6lIk4EdSqSOa0uo7Vk1kZ24YmNnbMyYzN1qVR YB6PBr3UJsDj/QXF0s1WzA7AdKs9PHcaaNAiI99yASLs074MXxLNv7/+9vy+QmlH9ghh Rw00WXruieFVZT0Flig18g2kixRUNYsNXe8hE0j6HtwotYLW788Dw2whKpIkzLjhM2Dt MfWnDLXJZun1RHdaGlHpJmeTXs/3g83M31LDCUTcUTqx9J77Fr/36WETV1Xga2cVh/ok j50tIgpH+LSSiI+y4hO92aQlHb0hJYHXENSyfU0je5AcEUL4Xk8zqJQHEELmS/aUbj7H Zmsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Zlkf9IaTacecviQ78RCaAnXzhEq8y+mXnTaoU/5lVN0=; b=ZL5VQhrwpGCFv5RMyZSYwHIkDbxhZUCqSuVHpwIvxxIMoSr3hG4uXVlZ+lHvJKmaeP Zuh8OQseXrcfwUNl/EIYEDOZz+0/8jaYtXy6VySPC1H0oFBb92M8aYXSQqKLT8w58GEu nk3CkVUr6mEcj5xQ8BAAvBoO7aFpwpzAvIxETrmQK3EdJRfnQkwleJ+rOj9NZgYeK4YZ vNguJ5sj61gpC2vKcv/mt6UMlgeBz/ypzxn9kQhWKMO71l+6r+5xNRCt4sEld58eI8HA HhNQwG1VyCx+DTRT5+vZNrlK8QdujrxJk+KQ8qBq+LYhK0E2E8wcB7ZjqUIUrx4U+dUq vVDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=G7ddZMcf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2si2836940oic.205.2020.02.14.06.06.35; Fri, 14 Feb 2020 06:06:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=G7ddZMcf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387463AbgBNOGA (ORCPT + 99 others); Fri, 14 Feb 2020 09:06:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:43748 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387434AbgBNOGA (ORCPT ); Fri, 14 Feb 2020 09:06:00 -0500 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2FD6A2187F; Fri, 14 Feb 2020 14:05:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581689160; bh=nqqK+fKvkLZHnclQOXpb/w6rt8Jru29JAuCrVR2XDRI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=G7ddZMcfzyRyHqqR+RoTuh287BHIPCdwiPuXHTHxU2LUbVssmfOXbMHYhoij09cjN ksF9W+fGGAvAF3tb0Xlo8dpcvvqijKuybK5I0IWCsSReullAWAmGyXtctQ4r06Oi4L FYbbJ9tQrah8vHpCrP2PuFjrRf3Q0CHXWI4Vq7vg= Date: Fri, 14 Feb 2020 14:05:55 +0000 From: Jonathan Cameron To: Beniamin Bia Cc: , , , , , , , , , Subject: Re: [PATCH v5 2/5] iio: amplifiers: ad8366: Add write_raw_get_fmt function Message-ID: <20200214140555.3b732ad4@archlinux> In-Reply-To: <20200206151149.32122-2-beniamin.bia@analog.com> References: <20200206151149.32122-1-beniamin.bia@analog.com> <20200206151149.32122-2-beniamin.bia@analog.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 6 Feb 2020 17:11:46 +0200 Beniamin Bia wrote: > This patch add write_raw_get_fmt function to specify conversion for > hardware gain. > > Signed-off-by: Beniamin Bia Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > Changes in v5: > -nothing changed > > drivers/iio/amplifiers/ad8366.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/drivers/iio/amplifiers/ad8366.c b/drivers/iio/amplifiers/ad8366.c > index 0176d3d8cc9c..95972ab60f42 100644 > --- a/drivers/iio/amplifiers/ad8366.c > +++ b/drivers/iio/amplifiers/ad8366.c > @@ -180,9 +180,22 @@ static int ad8366_write_raw(struct iio_dev *indio_dev, > return ret; > } > > +static int ad8366_write_raw_get_fmt(struct iio_dev *indio_dev, > + struct iio_chan_spec const *chan, > + long mask) > +{ > + switch (mask) { > + case IIO_CHAN_INFO_HARDWAREGAIN: > + return IIO_VAL_INT_PLUS_MICRO_DB; > + default: > + return -EINVAL; > + } > +} > + > static const struct iio_info ad8366_info = { > .read_raw = &ad8366_read_raw, > .write_raw = &ad8366_write_raw, > + .write_raw_get_fmt = &ad8366_write_raw_get_fmt, > }; > > #define AD8366_CHAN(_channel) { \