Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp282028rdb; Sun, 14 Jan 2024 17:31:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGltYjVc7exSjj1CUzBqOb1PJt2SiJSM05PuVFgbhGt5K8eMDmaje9ewg/ehgeeIBqwGeRP X-Received: by 2002:a92:d6cc:0:b0:360:6472:fddd with SMTP id z12-20020a92d6cc000000b003606472fdddmr4291498ilp.31.1705282293658; Sun, 14 Jan 2024 17:31:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705282293; cv=none; d=google.com; s=arc-20160816; b=Mcx3pXs80JvT0bNef3eOr4e9IY/npH6hnvuyBYKKwCVOv0zHs9gTf+AeVMWKCe+xIs ppsX5vhtyp65rgzNtlhMcBlp3zlglh1l227MPTKpzcVDTSZX9Ye/sCWRrHJ7AhSCwkv3 wbRd63cD/Yw+mHLn70ZkRkJgrXQNOxG4/fd42JvSLGQpMa+II6APecpH+gts6rlLLyIh 7o5liLivCNyiYOH0XrMW7haR6ac14CwaYTx/w6eGKNRg7uimoer1kR3uZYWw4abez5Y4 vudfPd/Ll5dxsYwjhu7ejhL6/sPSAg2GOBlGTPfC7YbfUYBBELo951BumNgnkz2UjY0j knJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1SMr9r1P9ntLQdKlqfO558DPhNCAuaDs7tWm9gTvsU4=; fh=NRtSHQ9G19NdF7X5CB+SZhNuMCIeuHW6Eqp2F9svWn4=; b=WIXUZMZtAtG/60Pxw8oqqiyASI5gumfO5uRkhwk+X5753r2+vLNteCFbckiGWs9V6t rFsY2rYmBbl9WdvCycdBSAXiKvX+u9MZ+r9aPHEPrRyMF+/ZDIIZb8UgYMTEekbCxYuv jDfpotM4z6XPcKXrYTCCkQABHNMm9z1vWhEbAjEIht02bzxckUKuGlGPDdkvdrBzMorI sqwADhmEiZCArkUFb0Pz1bVBHgriqL60M3igKQQqOvyoU4nzNhjk2XBqmkeThCH7ZD3k ipe+aKY0DKCAM0PP2sT+HCi48bfpVvXQaoPalXq+u74llQT1isXvAvnZEOTGu6SQjsgY llvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nV7CMGsR; spf=pass (google.com: domain of linux-kernel+bounces-25582-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25582-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id bs10-20020a63280a000000b005ce08c4bfeesi7674365pgb.753.2024.01.14.17.31.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jan 2024 17:31:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25582-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nV7CMGsR; spf=pass (google.com: domain of linux-kernel+bounces-25582-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25582-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E0D672815FE for ; Mon, 15 Jan 2024 01:31:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E2782909; Mon, 15 Jan 2024 01:30:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nV7CMGsR" Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6ADFC2566; Mon, 15 Jan 2024 01:30:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6daf9d5f111so6658048b3a.0; Sun, 14 Jan 2024 17:30:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705282256; x=1705887056; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=1SMr9r1P9ntLQdKlqfO558DPhNCAuaDs7tWm9gTvsU4=; b=nV7CMGsRHiLsiRasqE5EcNC64Jmv1LjGXyrAuIezN+CWh3YJI9dYW+oHvgw/FFcG63 OVgcf5xyY97EQwegiyQiG4+qgnIUaoS6aSTI4gLwdtT9dTxws99JbPakItlD1OCTaOqT VuEzx6BxUwTLHxQ2MDCsFTA6j9V46UA3XK0vTK6s0XggD28ntDem7hyknhhFsFYwYbLg FQVMZgJMXfAlbF1JhR/5qSSIaieXrb1W7/qWJAMvXYiC63uXkrv7s378Sre7tBC0VvBb GfjrRukKObFD7vIgy8KVqiiwtyor3jQ8dz+MdqNDHbVQtzNNqRrmgldPB5Hwnxg8BB/+ SUQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705282256; x=1705887056; h=in-reply-to:content-transfer-encoding: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=1SMr9r1P9ntLQdKlqfO558DPhNCAuaDs7tWm9gTvsU4=; b=f/aT19EwaUUnta292h7foqsedqe9vYob5Yk7F62EH/RwVdgQKVZV0eK+o7MlfBzjqt 0H5NfWCgamw35bJy6cI6WH9Zyp4iqHGpDcy6slHRZRSvFCNf2LmhVpnuMartTRaQFxwl qZJ3ZkDfCTn3vQEIcDaEfIvI5ao//pUpeqbKin449Io8ldDf6bkomE14T1gv2cMOShFk aJr0GIsE4gKeLuVruzpEg8d3NZQLAzyVnMOuPzktt8PPBxxGMAlZ9+iEXZDpoPI+sk9T Sy0e05bKz4EkqVfTHoyDo4QLNyu2c0uk7/e6m2BXo3/tCBjEyiiHvx+8s5NtvKlruJP8 o5JA== X-Gm-Message-State: AOJu0YzoShXgPl1p9UIixOb0ftX5TocUZb92uMrMcXEYSGdQGwUW/4Ml QsaXexf3eIuKY7r2fNiA1XM= X-Received: by 2002:a62:ce8d:0:b0:6da:e557:8132 with SMTP id y135-20020a62ce8d000000b006dae5578132mr4842403pfg.14.1705282256606; Sun, 14 Jan 2024 17:30:56 -0800 (PST) Received: from rigel (60-241-235-125.tpgi.com.au. [60.241.235.125]) by smtp.gmail.com with ESMTPSA id k30-20020a63ba1e000000b005ac384b71cbsm6122379pgf.60.2024.01.14.17.30.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jan 2024 17:30:56 -0800 (PST) Date: Mon, 15 Jan 2024 09:30:51 +0800 From: Kent Gibson To: Andy Shevchenko Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, brgl@bgdev.pl, linus.walleij@linaro.org, andy@kernel.org, corbet@lwn.net Subject: Re: [PATCH v2 1/9] Documentation: gpio: add chardev userspace API documentation Message-ID: <20240115013051.GA27189@rigel> References: <20240115004847.22369-1-warthog618@gmail.com> <20240115004847.22369-2-warthog618@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Mon, Jan 15, 2024 at 03:11:07AM +0200, Andy Shevchenko wrote: > On Mon, Jan 15, 2024 at 2:49 AM Kent Gibson wrote: > > > > Add documentation for the GPIO character device userspace API. > > > > Added to the userspace-api book, but also provide a link from the > > admin-guide book, as historically the GPIO documentation has been > > there. > > ... > > > +.. note:: > > + Do NOT abuse userspace APIs to control hardware that has proper kernel > > + drivers. There may already be a driver for your use case, and an existing > > + kernel driver is sure to provide a superior solution to bitbashing > > + from userspace. > > + > > + Read Documentation/driver-api/gpio/drivers-on-gpio.rst to avoid reinventing > > + kernel wheels in userspace. > > + > > + Similarly, for multi-function lines there may be other subsystems, such as > > + Documentation/spi/index.rst, Documentation/i2c/index.rst, > > + Documentation/driver-api/pwm.rst, Documentation/w1/index.rst etc, that > > + provide suitable drivers and APIs for your hardware. > > Very good note and would be nice to convince users to follow it: > https://stackoverflow.com/q/77683532/2511795 > (OOH you might be proud it's Rust, OTOH as described above) > Not familiar with that sensor. And wasn't sure what they were up to or why, so didn't comment. You do a good job reminding people in the forums, though, as above, not sure how many listen. I'm language agnostic, so choose the language that suits your use case. You can still do stupid things in any language, though the language may constrain the set of stupid things you have to play with, or throw in some bonus ones you didn't realise you were getting (I'm looking at you C++). Cheers, Kent.