From patchwork Sat Feb 25 13:54:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13152208 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81315C64EC7 for ; Sat, 25 Feb 2023 13:54:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229452AbjBYNyp (ORCPT ); Sat, 25 Feb 2023 08:54:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjBYNyo (ORCPT ); Sat, 25 Feb 2023 08:54:44 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60D1A11E8F; Sat, 25 Feb 2023 05:54:43 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id n2so2690541lfb.12; Sat, 25 Feb 2023 05:54:43 -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=u5emfiLHxgmmwemoqG2Pz0dKjpg41tSMm4c0JzP2LPE=; b=QhqWi/uq/SnrJoht6jHiqQNqr5oHwuLksWqn+LPZMFjPk4cqRt1F0sgXTtN45VIf6j eyRcZTTuzsvrVmJz8uzb0FHjjRaVeX0KZgTB90ETO5QxK96ldwf4gZ0XFn1Rv9T8I2qE RwdDbLr6agTONPHGSCh7tHToM5ViMI02C+PpQK6G2/zDH2ii5qT3bovOGrq6/XODLyxD JHei6tUnBfyRbkZpK9UgO+zKnzEfEsnF26X/pk1HyKuwra0EdgU7o81C6EWJmA+P51DI jfR79V+Xz/Pbpv6IhkbQnL/+//12a7LkkXqvg4incAthiWFbXGVq3PMFWGogZLTyugCh IwOQ== 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=u5emfiLHxgmmwemoqG2Pz0dKjpg41tSMm4c0JzP2LPE=; b=ts+WY2j3jv69vNEQtvmP67BiQsUr9WqW31gxMYXJPqG6cqV7rGlUVMyNerEinF8GrN jw0FqssGhP+qBQ/rNXS+jxjKL3JHoYussK/suImAvUvrmA1+n+5cR1NhkGEkJ1e61ucE 6ifgHTUYjnNA9vZGY1MlisyDu9MYt6fAL73TPrP8bawYhYrm7OQ7YbysLlb675dBuKVc vBFKmp4bmZztXTeBVGuh7GXEL0m8p+x2bLS066nOah3MyvDbDRzgagFo74r80MYUajkh CR3PnXDftoGCifKtu+YqgDtigApOe7tt4RZqC8Ztm9Ccijd1lT0UVVb18eOqj0KvsMwj m3GA== X-Gm-Message-State: AO0yUKU7BEyt9vAwELh1XLvIRsRKATChEDSbHGCG4toxl1sgMzeuiokc W1xxKD9stnnTr746FaqbNSA= X-Google-Smtp-Source: AK7set+UkaaG4y3X5zccWr3ssYAOVIgiNqiQsfsxGTYmXbH6hdnE/DM+zLYH8kOpUHXoIh1oK8ho0w== X-Received: by 2002:ac2:5fd2:0:b0:4dd:ad88:ba5c with SMTP id q18-20020ac25fd2000000b004ddad88ba5cmr1547051lfg.4.1677333281627; Sat, 25 Feb 2023 05:54:41 -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 q20-20020ac24a74000000b004d8540b947asm218701lfp.56.2023.02.25.05.54.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Feb 2023 05:54:40 -0800 (PST) Date: Sat, 25 Feb 2023 15:54:30 +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 1/3] iio: Add some kerneldoc for channel types Message-ID: <987b37ea10ace60f0e67a19f76c4b84dea3050c8.1677331779.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org For occasional contributor like me navigating the IIO channel types and modifiers may be a daunting task. One may have hard time finding out what type of channel should be used for device data and what units the data should be converted. There is a great documentation for the sysfs interfaces though. What is missing is mapping of the channel types and modifiers to the sysfs documentation (and entries in documentation). Give a hand to a driver writer by providing some documentation and by pointing to the sysfs document from the kernel doc of respective enums. Signed-off-by: Matti Vaittinen --- Changelog RFCv1 => v2: - add missing channel type docs provided by Jonathan - add @in front of member names and fix typos pointed by Andy - drop TODOs as Jonathan clarified the units Initial discussion about these docs can be found from: https://lore.kernel.org/all/0e0d45b7-e582-82b2-9bac-1f70f9dad9f7@gmail.com/ --- include/uapi/linux/iio/types.h | 134 +++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) diff --git a/include/uapi/linux/iio/types.h b/include/uapi/linux/iio/types.h index c79f2f046a0b..78f4cfdc5e45 100644 --- a/include/uapi/linux/iio/types.h +++ b/include/uapi/linux/iio/types.h @@ -11,6 +11,124 @@ #ifndef _UAPI_IIO_TYPES_H_ #define _UAPI_IIO_TYPES_H_ +/** + * iio_chan_type - Type of data transferred via IIO channel. + * + * The 'main' type of data transferred via channel. Please note that most + * devices also need to specify a more accurate 'sub category'. See the + * enum iio_modifier for this. (For example, IIO_ACCEL channel often needs to + * specify the direction. IIO_CONCENTRATION specifies the type of substance + * it measures etc). + * + * These reflect the units of the measurement via processed or unit after + * application of scale and offset. See the enum iio_chan_info_enum for + * scale and offset. + * + * Please find the detailed documentation for reported values from the + * Documentation/ABI/testing/sysfs-bus-iio. + * + * @IIO_ACCEL: Acceleration, m/s^2 + * Doc keyword: in_accel_x_raw + * + * @IIO_ACTIVITY: Activity state. For example a pedometer signaling + * jogging, walking or staying still. + * Doc keyword: in_activity_still_thresh_rising_en + * + * @IIO_ALTVOLTAGE: Peak to peak voltage, millivolts + * + * @IIO_ANGL: Angle of rotation, radians. + * Doc keyword: in_angl_raw + * + * @IIO_ANGL_VEL: Angular velocity, rad/s + * Doc keyword: in_anglvel_x_raw + * + * @IIO_CAPACITANCE: Capacitance, nanofarads. + * Doc keyword: in_capacitanceY_raw + * + * @IIO_CCT: Correlated color temperature, Kelvins + * + * @IIO_CURRENT: Current, milliamps + * Doc keyword: in_currentY_raw + * + * @IIO_CONCENTRATION: Reading of a substance, percents. Used for example by + * devices measuring amount of CO2, O2, ethanol... + * Doc keyword: in_concentration_raw + * + * @IIO_COUNT: Deprecated, please use counter subsystem. + * + * @IIO_DISTANCE: Distance in meters. Typically used to report measured + * distance to an object or the distance covered by the + * user + * Doc keyword: in_distance_input + * + * @IIO_ELECTRICALCONDUCTIVITY: electric conductivity, siemens per meter + * Doc keyword: in_electricalconductivity_raw + * + * @IIO_ENERGY: Energy in Joules. Typically reported by a device + * measuring energy burnt by the user. + * Doc keyword: in_energy_input + * + * @IIO_GRAVITY: Gravity, m/s^2 + * Doc keyword: in_gravity_x_raw + * + * @IIO_HUMIDITYRELATIVE: Relative humidity, percents + * Doc keyword: in_humidityrelative_raw + * + * @IIO_INCLI: Inclination, degrees + * Doc keyword: in_incli_x_raw + * + * @IIO_INDEX: Deprecated, please use Counter subsystem + * + * @IIO_INTENSITY: Unitless intensity. + * Doc keyword: in_intensityY_raw + * + * @IIO_LIGHT: Visible light intensity, lux + * Doc keyword: in_illuminance_raw + * + * @IIO_MAGN: Magnetic field, Gauss. + * Doc keyword: in_magn_x_raw + * + * @IIO_MASSCONCENTRATION: Mass concentration, ug / m3 + * Doc keyword: in_massconcentration_pm1_input + * + * @IIO_PH: pH reading, negative base-10 logarithm of hydrodium + * ions in a litre of water + * Doc keyword: in_ph_raw + * + * @IIO_PHASE: Phase difference, radians + * Doc keyword: in_phaseY_raw + * + * @IIO_POSITIONRELATIVE: Relative position. + * Doc keyword: in_positionrelative_x_raw + * + * @IIO_POWER: Power, milliwatts + * Doc keyword: in_powerY_raw + * + * @IIO_PRESSURE: Pressure, kilopascal + * Doc keyword: in_pressureY_raw + * + * @IIO_RESISTANCE: Resistance, ohms + * Doc keyword: in_resistance_raw + * + * @IIO_ROT: Euler angles, deg + * Doc keyword: in_rot_yaw_raw + * + * @IIO_STEPS: Steps taken by the user + * Doc keyword: in_steps_input + * + * @IIO_TEMP: Temperature, milli degrees Celsius + * Doc keyword: in_temp_raw + * + * @IIO_UVINDEX: UV light intensity index + * Doc keyword: in_uvindex_input + * + * @IIO_VELOCITY: Current speed (norm or magnitude of the velocity + * vector), m/s + * Doc keyword: in_velocity_sqrt(x^2+y^2+z^2)_input + * + * @IIO_VOLTAGE: Voltage, millivolts + * Doc keyword: in_voltageY_raw + */ enum iio_chan_type { IIO_VOLTAGE, IIO_CURRENT, @@ -49,6 +167,22 @@ enum iio_chan_type { IIO_MASSCONCENTRATION, }; +/** + * iio_modifier - accurate class for channel data + * + * @IIO_MOD_: Value represents -axis data. + * Typically used by channels of type: + * IIO_ACCEL, IIO_TEMP, IIO_GRAVITY, IIO_POSITIONRELATIVE, + * IIO_ANGL_VEL, IIO_INCLI, IIO_MAGN + * @IIO_MOD_LIGHT_BOTH: Value contains visible and infrared light components + * @IIO_MOD_LIGHT_IR: Value represents infrared radiation + * @IIO_MOD_LIGHT_: + * Value represents visible light + * @IIO_MOD_LIGHT_CLEAR: Value represents all visible light frequencies + * + * Please find the detailed documentation for reported values from the + * Documentation/ABI/testing/sysfs-bus-iio. + */ enum iio_modifier { IIO_NO_MOD, IIO_MOD_X, 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: 13152209 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55C74C6FA8E for ; Sat, 25 Feb 2023 13:55:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229529AbjBYNzi (ORCPT ); Sat, 25 Feb 2023 08:55:38 -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-Google-Smtp-Source: AK7set8gOnS2wuV7hFzVXM7nPVB46pv8aRfQKrkHlNZla99hRsSAruySiYdpDmxOx4Y2vYE0J8rocA== 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: Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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, From patchwork Sat Feb 25 13:56:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13152210 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF1B7C64EC7 for ; Sat, 25 Feb 2023 13:56:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229470AbjBYN4b (ORCPT ); Sat, 25 Feb 2023 08:56:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjBYN4a (ORCPT ); Sat, 25 Feb 2023 08:56:30 -0500 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFDAE13DFB; Sat, 25 Feb 2023 05:56:28 -0800 (PST) Received: by mail-lj1-x233.google.com with SMTP id t14so1890935ljd.5; Sat, 25 Feb 2023 05:56:28 -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=q5fi3vMtgShoH3fTT5V+ZWG+/EL8tE3fQZCBLYT0iXQ=; b=KK6mQrLFErLtfpWOVIfKT+MonHolhZkfKMJpKMAitJXdyqK2RkaV5BokmMP45g3am9 I5aIFjuXC44Pecf1/q+WzbhhLYCZWuIXHqc3RANHAi3xor/7xzE546pgp2IulKrG+SLW 3zyhZLML13+TGSITRSB5qs4bLJJyqP7NvlxGd3DCJjxGTSH32DYhaKt07EHwlJ5cX10R c9G1250G/ac9i/G4ayB3Un8cYEPi8pDZeiZsQtoX7zDceQ38r7IB59fDWM66xxTnihl5 teSLhtyTzls8o8vhQNoLzdoVmJgtQ5+J5PkduhsZRxV6WLzoUR7zP1cw4SP94nUmoIy8 0ixA== 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=q5fi3vMtgShoH3fTT5V+ZWG+/EL8tE3fQZCBLYT0iXQ=; b=oPqsre4SF2nGnlxxsWOexEVPYOz9/NNNlD2rOCRujom/hj5zoR62KZ5PHFjbd/z0yw WK6QHPF5Bd0RTemog7Ik8BNtzbewjwtlppquutgT9I6T3UBTXtnq4wejeuKfcNyMVb+D 26UWChq3nyn9q5f17DVy0i3YTzCb7cBUTKwJZPNXKf6MKlfNRKn1VqBh6PMjmXMEBfJJ QulxYwi2xp/PbfoA9Jglb1Or7tU0vhiZqjThOTsp7/gBIhY9oiPLuzRAR6MQrkXGveqR JJOpBo3dqzwfBFyE8jft9ol9lA/R8czHmcUYnXBzl9Ni0H+KrTalBSr9OJ7KC+SibDPM iqpw== X-Gm-Message-State: AO0yUKUQZQnBCt23TMG0G6hVVLWbPEJiNLPoYciFZbqbxVb37bXvMqNQ 954wnVIfVCSA2UuJ9POyrsiAw4yPgus= X-Google-Smtp-Source: AK7set/xqliacutc76cH3yk/k9WVc5FkgNhq5cmI12K16wEuE0IX0hJTLh5Qyabz7kttgR38X2qKLw== X-Received: by 2002:a2e:888c:0:b0:295:8f08:118b with SMTP id k12-20020a2e888c000000b002958f08118bmr5576580lji.18.1677333387126; Sat, 25 Feb 2023 05:56:27 -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 s6-20020a05651c200600b002934b8d115csm173208ljo.51.2023.02.25.05.56.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Feb 2023 05:56:26 -0800 (PST) Date: Sat, 25 Feb 2023 15:56:16 +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 3/3] doc: Make sysfs-bus-iio doc more exact Message-ID: <41eafb0caa510cddf650cf5ff940639a184f3005.1677331779.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org A few IIC channel descriptions explained used units as: data is in foo "that can be processed into an" [unit] value. The "can be processed into" is quite broad statement as it does not really explain what this processing means. This makes units pretty much useless. After discussion with Jonathan, it seems the units for these channels should also be well-defined as for all other channels. The processing means the standard scale and offset application that is used throughout the IIO. Let's make it more obvious by stating that the units are [unit] after scale ane offset are applied. Signed-off-by: Matti Vaittinen --- Documentation/ABI/testing/sysfs-bus-iio | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index 6ba34c0d9789..b435c6f065ae 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio @@ -1807,8 +1807,8 @@ What: /sys/bus/iio/devices/iio:deviceX/out_resistanceX_raw KernelVersion: 4.3 Contact: linux-iio@vger.kernel.org Description: - Raw (unscaled no offset etc.) resistance reading that can be processed - into an ohm value. + Raw (unscaled no offset etc.) resistance reading. + Units after application of scale and offset are ohms. What: /sys/bus/iio/devices/iio:deviceX/heater_enable KernelVersion: 4.1.0 @@ -1894,8 +1894,9 @@ What: /sys/bus/iio/devices/iio:deviceX/in_electricalconductivity_raw KernelVersion: 4.8 Contact: linux-iio@vger.kernel.org Description: - Raw (unscaled no offset etc.) electric conductivity reading that - can be processed to siemens per meter. + Raw (unscaled no offset etc.) electric conductivity reading. + Units after application of scale and offset are siemens per + meter. What: /sys/bus/iio/devices/iio:deviceX/in_countY_raw KernelVersion: 4.10 @@ -1952,7 +1953,7 @@ KernelVersion: 4.18 Contact: linux-iio@vger.kernel.org Description: Raw (unscaled) phase difference reading from channel Y - that can be processed to radians. + Units after application of scale and offset are radians. What: /sys/bus/iio/devices/iio:deviceX/in_massconcentration_pm1_input What: /sys/bus/iio/devices/iio:deviceX/in_massconcentrationY_pm1_input