Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2736974rwb; Wed, 30 Nov 2022 10:09:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf4RAVLg3r8ht+MUL0ymxsSLM4nwjGcsbE5zilvGczoH6MxN36YQF8HViTqM7MGcWyanmTy2 X-Received: by 2002:a17:907:d006:b0:7bc:ad2d:879d with SMTP id va6-20020a170907d00600b007bcad2d879dmr22184980ejc.603.1669831786940; Wed, 30 Nov 2022 10:09:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669831786; cv=none; d=google.com; s=arc-20160816; b=bYrnvfUFWN0k5cXfE164EkEX4mXP53FyN/ac/b7m0iMJz6ClLpQbGFXoOEvSw3SHTM qYXC/sdS90EFGihrQWdU5J9rF8NKr7HsRAjG1gdYGC11/iyvtOe/WPHiqwpmbpmGucnq zxKzoLJ/MmB5YHGExZEkrhD/wUMgQ9oE4O9odVRv0/2Zj2BizVvIOFCy3I0UETVkQCPy JlVXjcHyM6UldPAxkzpDpi6iFJLBYBK0jj3Hp/Z8K+e6icUfsuUO+OB8N+I3aFSqAqj7 9hxfxQnp0+tUdbeKceyNOnsr/wj4JY7wt4yibW3bhc8nMPy6TpQEIyAwwPzOPg5RAroE xcrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=5ffC9qgjzIWVWfW8YTvsUCAhB3ulCvS1XaFwlgzXOD4=; b=KcmdMJtmYth2kF6DWf0FZmByRCmCCE48+hxyGP7fR5bq2dkAmnMkUr0BjbqZAEwxj8 N8Xl/XXbwGkHwF8tzG7T/GwmMpUUHMQBRELV6vLmAi6pbHKXoNkCrCKhWgM8k/8abmHo u91VWZWX3m3t6+7iIyDZ5NWU20E4jk74JSytnzXXn2XIVLMVw4zNBVW6KBP3QbdNDG8v COfDnRD1sh83snZqS4ynsZsCnX+BokystHFYyjDhmrkQOzEmA+m2vDHQsv5jQfLn84uT LWpRzsNfl5dN8ZV3bmnAfAkOxcYNB02N4ImsJGWBQzyW1StXqywXAe7aZW3oMUqopBW1 zKQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nIN6e4zv; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c15-20020a05640227cf00b0046b4ea89826si2080465ede.616.2022.11.30.10.09.27; Wed, 30 Nov 2022 10:09:46 -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=@intel.com header.s=Intel header.b=nIN6e4zv; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230157AbiK3QXO (ORCPT + 83 others); Wed, 30 Nov 2022 11:23:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbiK3QXM (ORCPT ); Wed, 30 Nov 2022 11:23:12 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3831F43AE2; Wed, 30 Nov 2022 08:23:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669825392; x=1701361392; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=hf3CqjgbQVSqURsLVEcOjIfYwu6rzu6lTTAG6MwSyW8=; b=nIN6e4zvGwSPBEtnTMGqLlYVHC+GvQuesS1WZBqFIsX+c6+7MqFHZuMG FGWNsG586Y7Pz9ddn3FjU8gEBEHm4WcdXiIcOLVBmp5NmlGUohkYiLFuo GRlcaui1XE/Fk+WvVS52KfnNgDJpdJPiDUIqVw9+gG5xVq+7zl/yx9CKU l+CwRXyg9ekgfjuxzJUGX0L2j8oXHiPS9Ll1c1VE5yoPl3M/A3sAMXxBE qV64WeU07003wGqivK2s7h3DW3xCU3sMNzoMTeWD5s0ZoWo6QwbTbfbUk 8jeLa+QF6tp7QFqziYHj78cR01rPygY8zXJcyCxjGcIo5ed3cUmRExa8H A==; X-IronPort-AV: E=McAfee;i="6500,9779,10547"; a="401714824" X-IronPort-AV: E=Sophos;i="5.96,206,1665471600"; d="scan'208";a="401714824" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2022 08:22:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10547"; a="707705570" X-IronPort-AV: E=Sophos;i="5.96,206,1665471600"; d="scan'208";a="707705570" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga008.fm.intel.com with ESMTP; 30 Nov 2022 08:22:44 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1p0Pr8-002Lcb-2k; Wed, 30 Nov 2022 18:22:42 +0200 Date: Wed, 30 Nov 2022 18:22:42 +0200 From: Andy Shevchenko To: Hans de Goede Cc: Marc Zyngier , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij , Bartosz Golaszewski , Jonathan Corbet Subject: Re: [PATCH v1 2/3] Documentation: gpio: Add a section on what to return in ->get() callback Message-ID: References: <20221130155519.20362-1-andriy.shevchenko@linux.intel.com> <20221130155519.20362-2-andriy.shevchenko@linux.intel.com> <8a53e88b-1e74-bf34-62a1-780a1b29bcbc@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 On Wed, Nov 30, 2022 at 05:14:38PM +0100, Hans de Goede wrote: > On 11/30/22 17:12, Hans de Goede wrote: > > On 11/30/22 16:55, Andy Shevchenko wrote: ... > > IHMO the rules for get() should simply be: > > > > 1. Device has an input buffer: > > Return input-buffer value for the pin. > > > > 2. Devices does not have an input buffer: > > Return last set output-buffer value > > Quick correction device should be pin here, because it > if there is an input buffer or not can differ per pin. > So IHMO the rules for get() should simply be: > > 1. pin has an input buffer: > return input-buffer value for the pin. > > 2. pin does not have an input buffer: > return the value last set for the pin's output-buffer "pin" misleads here. The "pin" can be in native function which may have not be even connected to GPIO buffers. There are different hardware topologies. So, no, not a "pin". -- With Best Regards, Andy Shevchenko