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 4113AC61DA4 for ; Fri, 24 Feb 2023 14:21:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229671AbjBXOVb (ORCPT ); Fri, 24 Feb 2023 09:21:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbjBXOV3 (ORCPT ); Fri, 24 Feb 2023 09:21:29 -0500 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33E7915175 for ; Fri, 24 Feb 2023 06:21:22 -0800 (PST) Received: by mail-qk1-x736.google.com with SMTP id a65so2325014qkg.13 for ; Fri, 24 Feb 2023 06:21:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tQ99BjbVZZswOOXnaBMj0l/ghda0KputEQaaEq/sw54=; b=m9zthKXLJpzSsiNJHftd9McaS1DR020zQLESybP+SLwDC6DoW8PjEyCGUF17xuf3pb HB1E2rktbXs/HTyNIZRndIrFbgH8iz1AYT/NATYw+xUUXVxxhHRdtU8026pJHNuQADuc 4Dbb3A4a5tmzMF1nyCIab1NltjvgF05MwZ0rgyn8Cdhm8YxkrAlPRkfsxa57pvJZn5CF Ty4AnIHSD33zWe7lBoWhatQZP0PB904LkyZOVM9Gu7PUGMav0n7JLROnPyLA1ZDWsrwz kiR0yYsDTCyZofOZ9Tfd7pWydFxAFkTZ+po0pCWJpxEdUoWmcWgxD99lrTBnFbtpVgx+ LWAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tQ99BjbVZZswOOXnaBMj0l/ghda0KputEQaaEq/sw54=; b=uwzmcrdcCW/0rDVrsfuI1PHyGSwwP4NrZORaR7qK7Wa6EU4NlNylNAezupZLZHj9rM ydrS0xnLUOn4nVk3JLnFWYTUiCkq+q4ZKDbY+LhFIDAnLincImRlKGSuTQza9q1CUbM/ 7HmA/GMt9u3aT5vZVEA8SPYndbd5/nvGmItMuFW4Crma9AA+DlUDsFPRAdKV/k+ZRHeq bAeFKCjpJvFjkw3U3L/UX05O+uwQeR77D2nwRG46NxYknEETADfgddk1A7wHiqp3ZoKG gRCZbMp++UwP2oAH87oENBKQt60X/zKjmAUTtxWvn1/b8WO+fxEw8Bg9Z0lWGu83AWDU tpcQ== X-Gm-Message-State: AO0yUKX8bP+3e3pHCfRjfvjM+cFs8KHg2NbKbx+XckEAu1GvkiKQKnlw CVgQ15OODBYlK4nMxX8k33CGv4DuDZvLrHBLEYE= X-Google-Smtp-Source: AK7set9N1tfWwgQ8Via3X1jcPaPxPe3YgddIgIz6yCTOd5dHkSBFcMFb9ie0+LXWB+4r1Mlj4MDDwEPr2DHXa+OWbss= X-Received: by 2002:a05:620a:13cd:b0:742:7e5a:4cee with SMTP id g13-20020a05620a13cd00b007427e5a4ceemr210470qkl.10.1677248481175; Fri, 24 Feb 2023 06:21:21 -0800 (PST) MIME-Version: 1.0 References: <10a855f9adc1d710150b7f647500c3c6a769f9ca.1677243698.git.mazziesaccount@gmail.com> In-Reply-To: <10a855f9adc1d710150b7f647500c3c6a769f9ca.1677243698.git.mazziesaccount@gmail.com> From: Andy Shevchenko Date: Fri, 24 Feb 2023 16:20:45 +0200 Message-ID: Subject: Re: [RFC PATCH] iio: Add some kerneldoc for channel types To: Matti Vaittinen Cc: Matti Vaittinen , Jonathan Cameron , Andrea Merello , Jagath Jog J , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 24, 2023 at 3:02 PM Matti Vaittinen wrote: > > 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 kerneldocs of respective enums. kernel doc Documentation is always welcome! ... > #ifndef _UAPI_IIO_TYPES_H_ > #define _UAPI_IIO_TYPES_H_ > - Stray change. ... > +/** > + * iio_chan_type - Type of data transferred via IIO channel. > + * > + * The 'main' type of data transferred via channel. Please note that most > + * devices need to specify also a more accurate 'sub category'. See the devices also need to specify a > + * 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). > + * > + * Use of correct units is required but scale and offset that user must apply > + * to channel values can be advertised. > + * > + * 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 Seems you forgot @:s. > + * > + * IIO_ACTIVITY: Activity state. For example a pedometer signaling > + * jogging, walking or staying still. > + * Doc keyword: in_activity_still_thresh_rising_en > + * > + * IIO_ALTVOLTAGE: > + * > + * 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: > + * > + * IIO_CURRENT: Current, milliamps > + * Doc keyword: in_currentY_raw > + * > + * IIO_CONCENTRATION: Reading of a substance, percents. Used for example by > + * deviced measuring amount of CO2, O2, ethanol... devices > + * 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 > + * TODO: What does "can be processed to siemens per meter" > + * mean? Do we have unit requirement? > + * > + * 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 > + * TODO: What does "can be processed to radians" mean? Do > + * we have unit requirement? > + * > + * 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 > + * TODO: What means "can be processed..." Do we have unit > + * requirement? > + * > + * 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 > + */ ... > +/** > + * iio_modifier - accurate class for channel data > + * IIO_MOD_: Value represents -axis data. Missing @:s as well. > + * 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 infra red light components infrared > + * IIO_MOD_LIGHT_IR: Value represents infra-red 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. > + */ -- With Best Regards, Andy Shevchenko