Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp898537rwb; Wed, 7 Dec 2022 06:23:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf4p4B4QBu0xnd/FS0fEzdKD1LjnCK8IuA16OyNFtGJljiyKW7qH4wojAJ8pqo81Yakwln0L X-Received: by 2002:aa7:dd4d:0:b0:45c:98a9:7bbf with SMTP id o13-20020aa7dd4d000000b0045c98a97bbfmr66044974edw.372.1670423016277; Wed, 07 Dec 2022 06:23:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670423016; cv=none; d=google.com; s=arc-20160816; b=k3DiW4HrAK8suDSmT0ygKWk+Qdb/8wUDYbXQhEjhFtE2lBTbvMo2YAKvOZQ1AGIzSI lPDdgQbv2dI9s/g2nGDMCIfAre3Nx05yL+2k+xu/eQtHPiPdc/MmX8WcuY7Hf5CzIrpu OY4LHKnzBnki4+p2wp9KUAitUZHERBTUNnRQXQnFscq7fGxPwwo+f+vlCar1EZcn3Uen y1Zu1asQNnb+EW+5viQuJqLJDSFOdVM7fPLmxNqcYb26DuJma+HFdr6yl5tLXCVbzxVX G15QRCtPqmbz8aszFOfxPww5RjJqrh2Vj36s/23+CLZWFF1U0XG5blCEQ4F9+tD3il2z S1UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YwDK3y8/2CA9L4Z+ruLM0VBm7H5Gax9zmhRB4AegQQ0=; b=DlAyaExvgkzU0D51QWU8uGF+CD5ACQMyevFFjp6jZm5yukB/i/Vnf0SzKv46KzKdD+ tq9oMlmD/p7ZES/m7MGOkt1K2AGXOQ2sH3PinR3RujkEs0yFRjr9TtPzPwLouDBq/i1f J1s+UYWWmCFRayrU1ZxpaupNmttMNjcfKDxsz978tHp2TKyPyK1aEYEu2z4O4whyC5IB GhFwYpl0q+wH41X8nDo0lMUd0FXRY6cwcLgpknGASieJkR8woIhku0X3T+KBOWf8olGG 05DToXhndj2RHb2y+TCdJFv3uqVvcTmmizP6rlF+CPpCJOZKXecuiReKvqPas0V/paOF YNOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Q/gizT6k"; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g20-20020a1709065d1400b007c11b897491si2186159ejt.833.2022.12.07.06.23.18; Wed, 07 Dec 2022 06:23: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=@linaro.org header.s=google header.b="Q/gizT6k"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbiLGNsX (ORCPT + 75 others); Wed, 7 Dec 2022 08:48:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230095AbiLGNsK (ORCPT ); Wed, 7 Dec 2022 08:48:10 -0500 Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25020252A5 for ; Wed, 7 Dec 2022 05:48:05 -0800 (PST) Received: by mail-yb1-xb34.google.com with SMTP id s11so8196837ybe.2 for ; Wed, 07 Dec 2022 05:48:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=YwDK3y8/2CA9L4Z+ruLM0VBm7H5Gax9zmhRB4AegQQ0=; b=Q/gizT6k0+5wnly/A/yFJJKteqGSOy8SwSzM9J6mJb/zZqf+lcu7W7xwMF7a20XUJV FWQrnvFT3vEG564AdlbjU7cfH/7Ph87Lut+ordkFVhAef0Q/T3rGVue7dYZMOA5Draax j5AhOOOZM+rwGsON5CpiCpQYPkWHNsdQex/4Iqg4Wgr0OR+0c2BbAoaio4PjFbUc+imz UquYJpB3/gkKsZXpAzUXc2fj7TzV/lMwf+sPmg/K4ck9km8N6vM22qyY/ko0EspKr6os xf0H0qaqcPyJ2BuNCyOPGpNaedVMCRtQyOOqaR0HNu77YU06PXr/oZ4NGjQXtDNR11j6 R1kQ== 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=YwDK3y8/2CA9L4Z+ruLM0VBm7H5Gax9zmhRB4AegQQ0=; b=dKlZtQ3TRAaTBaK8Fj2fbZRgH6QN+IMdLiVw37R7B42WsJKLmtR40Y2IZz919wXrxB zGAOEIxWbV67SenB3qqi9dtQgELjk8qE2refaDK7C2crm9c5X+9vyzuDv1qdmZvi44Ei dSXfI1bje+/8uRtbkkFTwWEul1ZQzL5nfJPgtyvqDEhL1GcexZYP+cgUSOnwoRCxoFZw /dF344cs32bpqe+0cCbW55Siy27aNLc9tsCRxrOhc5RGJD4kbJ2D3k8WQTrIeMDM11Yb eV9lBmzQ0gCNvTCtLmkln6MkIVMBJyfjWFmV/Yy+zoezlRGFr4hkD/wyh1VvOTej5TdM +uTg== X-Gm-Message-State: ANoB5pnEu3ZAjkcoIPyU3VTV52OqihNFdtzCCJfUri8ZDAPXt86TJupw BFFp0juRKmOga3Aan6Lr6ajXnAoUzf1+E5HT3quRBg== X-Received: by 2002:a25:3dc3:0:b0:6f0:d54a:8f2d with SMTP id k186-20020a253dc3000000b006f0d54a8f2dmr59191839yba.66.1670420884372; Wed, 07 Dec 2022 05:48:04 -0800 (PST) MIME-Version: 1.0 References: <20221130155519.20362-1-andriy.shevchenko@linux.intel.com> <20221130155519.20362-2-andriy.shevchenko@linux.intel.com> In-Reply-To: From: Linus Walleij Date: Wed, 7 Dec 2022 14:49:20 +0100 Message-ID: Subject: Re: [PATCH v1 2/3] Documentation: gpio: Add a section on what to return in ->get() callback To: Andy Shevchenko Cc: Kent Gibson , Marc Zyngier , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , Jonathan Corbet , Hans de Goede Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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, Dec 7, 2022 at 10:56 AM Andy Shevchenko wrote: > On Wed, Dec 07, 2022 at 01:06:46AM +0100, Linus Walleij wrote: > > On Mon, Dec 5, 2022 at 2:43 AM Kent Gibson wrote: > > > > > My preference would be for the driver API to be extended with a new > > > callback for the output buffer, say get_output(), and have the existing > > > get() always return the input buffer. > > > > This has a certain elegance to it, as it cuts to the bone of the > > problem and partition it in two halves, reflecting the two pieces > > of hardware: input and output buffer. Also follows Rusty Russells > > API hierarchy. > > The (one of) problem is that not all hardware may support input and output > be enabled at the same time. What would that new API return in that case > and how it would be better with get() returning the value depending on > direction? I imagine we would leave the .get_output() unassigned and the core would just rely on whatever behaviour it has now, so in *that* case, the implementation of .get() will need to be more elaborate. Yours, Linus Walleij