From patchwork Sat Feb 25 13:55:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 61518 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1496929wrd; Sat, 25 Feb 2023 06:02:37 -0800 (PST) X-Google-Smtp-Source: AK7set9OS8mlQpJLTMkodrk7h4h/JPEU/WxuGyKFympukSNBshkXDFJxkwCheiIreNBZ+BUqeFar X-Received: by 2002:a17:90b:380c:b0:230:ac12:a5ca with SMTP id mq12-20020a17090b380c00b00230ac12a5camr3218946pjb.3.1677333756634; Sat, 25 Feb 2023 06:02:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677333756; cv=none; d=google.com; s=arc-20160816; b=Mx6wBtrEScx1bysSmQ43y1PHQBDrg4mD8O2yUb8py/8zeFCrzgiDZT71MAjn7zqW5N sogYzPQu8kUCI6t1UsE+j8RnNhQELTGXOJlH2vZqB/jDnjdTxDXJ0T9iwZbaclDLCDCU mkDyKEn2D/T+FEJ1UwquRrsI4mawEBgB5J/lmSitXoOeYnf+SZ/FxvYbjnTz94KAHq8I yXvJW/mjr/XtpoBQsXXkcgDSGhug+3HpPiCogl5iG1XcgxwRYwuf6LYzH+N714dK8zwT af1/i9wHhhx+gBBXemDkak4Cd/UEwMrIoobOV9agBYdmrT3XHKsYCokrl+h7iTf1kbNP XQ4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=y6Birj6zr+Up2uvBNon1E/yYgyj0gYX0UZuZ31HsG4w=; b=KApZD01kExxfPdgYlyy7pvUxFDsqAyqEsQcG1HiKt7kYVw/TbxMm9M7w1pdT1+6dIq sljGxJm+qPu0d2vMeP28GiulTKInnFq+fh+rvGZ0Kxq+IB+BwnGaxMp0oWglscYODRSa v66uuldVppRprSQ0+JZF14rBkAdJdmwvHgmT1VeyVMLQfGaKk3Zp4w+I+Sc5styaOWzO yxBbih6529cGVnvkKc8gGF1q9+3+BSd8T1xi0SS+SEBZL+kb7FEL7SnsgVuZVRby8WrS WFdPGgsqn94T0wWO3b9zmqaQOiAiftmOA+pTu1/dQlb/H90T/ewsp7aZfsPDYyLNh/3w 6TAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=J50YtJj6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p10-20020a17090a748a00b002366a535553si4918958pjk.107.2023.02.25.06.02.03; Sat, 25 Feb 2023 06:02:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=J50YtJj6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229632AbjBYNzj (ORCPT + 99 others); Sat, 25 Feb 2023 08:55:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjBYNzh (ORCPT ); Sat, 25 Feb 2023 08:55:37 -0500 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FAED11EAF; Sat, 25 Feb 2023 05:55:36 -0800 (PST) Received: by mail-lj1-x22f.google.com with SMTP id b13so1888217ljf.6; Sat, 25 Feb 2023 05:55:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=y6Birj6zr+Up2uvBNon1E/yYgyj0gYX0UZuZ31HsG4w=; b=J50YtJj6+YLugYSEmEDy188Y1EAxh/LYAgT1+nlTQXsKrGEZT3rgbFRf6eG6hi8DZ1 U8QSc+Y6f8T8UXlTKuVP4LbKUrNIsEPIQGwOgwjqiMBfNMgyUIauxAovBcPZHk4XfUPP kMkCBpgkbHTVcwMxT93QWsNLH1kFZtagcGKebGDZ13PllVYYCy+OpK5ivhh/t9nAWwuL JeRHxGXKEryV7EJnkrCoBCwgIWuh0wH7xw40IuPqsS5WORxlOuOvlKtpkpX0NTa1sUQu Alk1b/J2U3Tm6KM/BeTTeNDAanuvIy/UkRnEnKLmDH3L9JbeeT22JA5G2oGyqUPV3zh+ 92cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=y6Birj6zr+Up2uvBNon1E/yYgyj0gYX0UZuZ31HsG4w=; b=sP+gceC6gwmNCq9kEC9y/PRAsewRF3mlgehlFX8W0jfp+oDZGM9jzQHA22St44854w NZosxLVE6Uy9ui4Js1XlHhVSych9e1eZmBWjfvFTCR4qO6+YucT+wcPUEyanEbMRW1K6 /sP/tZsbqVRMPF10Gh8zx4z6GKjnHnT3LaVsJ6P5EOxVzqAhiv4wTRNFbpA7Z6sKJBkO EDeKvNe1cB903x3aBVR6qFanpudHyvGZQ/3n1z8dFNf6cAbizFuFGxXncrmfbSCIb95m eI00PNfLpHsCPvi4LSEQvy2t4KXNm+XXAbuKpgH9khX4o+XJ+vJ5NaqOhzARBGkMNluH bZ8A== X-Gm-Message-State: AO0yUKU5l96DoJgWiQswvDdN5mfNv8wQcTUBP0end85eDY3dDg5IKlIj 7tg56vDNFLzD92GLnbngnI8= X-Received: by 2002:a2e:54d:0:b0:294:6d2d:c18c with SMTP id 74-20020a2e054d000000b002946d2dc18cmr6929433ljf.36.1677333334321; Sat, 25 Feb 2023 05:55:34 -0800 (PST) Received: from dc75zzyyyyyyyyyyyyyyt-3.rev.dnainternet.fi (dc75zzyyyyyyyyyyyyyyt-3.rev.dnainternet.fi. [2001:14ba:16f3:4a00::1]) by smtp.gmail.com with ESMTPSA id be40-20020a05651c172800b002959b1162f0sm172466ljb.96.2023.02.25.05.55.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Feb 2023 05:55:33 -0800 (PST) Date: Sat, 25 Feb 2023 15:55:25 +0200 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , Lars-Peter Clausen , Andrea Merello , Andy Shevchenko , Matti Vaittinen , Jagath Jog J , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] iio: add documentation for iio_chan_info_enum Message-ID: <884c8f386541ac572939b8993df7aea6ad99613b.1677331779.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758811921444458208?= X-GMAIL-MSGID: =?utf-8?q?1758811921444458208?= Values in the iio_chan_info_enum are crucial for understanding the characteristics of an IIO channel and the data delivered via IIO channel. Give a hand to developers who do their first set of IIO drivers. Add some documentation to these channel specifiers. Signed-off-by: Matti Vaittinen --- Please note that I did only add documentation for entries I am familiar with. I did still add doc placeholders for all of the enum entries to ease seeing which entries could still be documented. Hopefully this encourages people to add missing pieces of documentation. --- include/linux/iio/types.h | 46 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 82faa98c719a..c8e3288ca24b 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h @@ -35,7 +35,51 @@ enum iio_available_type { IIO_AVAIL_LIST, IIO_AVAIL_RANGE, }; - +/** + * enum iio_chan_info_enum - Information related to a IIO channel + * + * Many IIO channels have extra properties. Typically these properties can be + * read / written by user using the read_raw or write_raw callbacks in the + * struct iio_info. + * + * @IIO_CHAN_INFO_RAW: Raw channel data as provided by device. Scale + * and offset are often required to convert these + * values to meaningful units. + * @IIO_CHAN_INFO_PROCESSED: Processed data. Typically driver performs + * computations to convert device data to more + * meaningfull processed values. + * @IIO_CHAN_INFO_SCALE: Scale to be applied to data in order to convert + * it to units mandated by the channel type. + * @IIO_CHAN_INFO_OFFSET: Offset to be applied to data in order to convert + * it to units mandated by the channel type. + * @IIO_CHAN_INFO_CALIBSCALE: + * @IIO_CHAN_INFO_CALIBBIAS: + * @IIO_CHAN_INFO_PEAK: Peak value (TODO: Since measurement start?) + * @IIO_CHAN_INFO_PEAK_SCALE: Scale to be applied to the peak value in order + * to convert it to units mandated by the channel + * type. + * @IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW: + * @IIO_CHAN_INFO_AVERAGE_RAW: Average of raw values (TODO: Since measurement + * start or just for some undefined time?) + * @IIO_CHAN_INFO_SAMP_FREQ: Sampling frequency for device. + * @IIO_CHAN_INFO_FREQUENCY: + * @IIO_CHAN_INFO_PHASE: + * @IIO_CHAN_INFO_HARDWAREGAIN: Amplification applied by the hardware. + * @IIO_CHAN_INFO_HYSTERESIS: + * @IIO_CHAN_INFO_HYSTERESIS_RELATIVE: + * @IIO_CHAN_INFO_INT_TIME: Integration time. Time during which the data is + * accumulated by the device. + * @IIO_CHAN_INFO_ENABLE: + * @IIO_CHAN_INFO_CALIBHEIGHT: + * @IIO_CHAN_INFO_CALIBWEIGHT: + * @IIO_CHAN_INFO_DEBOUNCE_COUNT: + * @IIO_CHAN_INFO_DEBOUNCE_TIME: + * @IIO_CHAN_INFO_CALIBEMISSIVITY: + * @IIO_CHAN_INFO_OVERSAMPLING_RATIO: + * @IIO_CHAN_INFO_THERMOCOUPLE_TYPE: + * @IIO_CHAN_INFO_CALIBAMBIENT: + * @IIO_CHAN_INFO_ZEROPOINT: + */ enum iio_chan_info_enum { IIO_CHAN_INFO_RAW = 0, IIO_CHAN_INFO_PROCESSED,