Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp513774oof; Tue, 25 Sep 2018 00:36:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV61HdJQESaAHDjFDZb04gxWJy3LZs2wWpB+EyYKyOn755+UFbup3TnIdtAjortgmZ0iyerYU X-Received: by 2002:a65:5286:: with SMTP id y6-v6mr2067314pgp.65.1537861017837; Tue, 25 Sep 2018 00:36:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537861017; cv=none; d=google.com; s=arc-20160816; b=P3SJdhAm9BRZ6FWKHh+vViSNGjlkhHKGCiHiynwPVZqEDGkEr0OToTWiPSsJSkqzdH scTCFNEGmex2Ecb3zkp4yHRq+CV3yfDuE0U3hjT4oTkqpNYTDygAcPh94DMz0IjLd/su EboHXI+RwPKooMb/0+wmtdt5M2XEEPXwIBFKVhrGJyQaD+CaelFvF5fuoeSZKuSzKAf6 0Z/kZmb2i45FMWHGKwFtv/Blk1ZKAftJXf9r0JokQoNWHhfhlAs4PiMmMuRrmPuzp3NP M0v581gAqu/vcDwyAinvRLo20fTiqNQ2t58Wu/Y4prdUbSuNpMv5VIyKVqsCoeBZHvyg 25MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JCm7BeXOUDEkTOHXuzWK1bry9Ki+594JELty5nhAsys=; b=BOkr8YX1XHlM9JmzSWYn0aBJeBDFIKe8JjK7P/mUcWL0scJ+UJv9bwS9AzVnIxgfIT 47g3qjk1EBOsbz1LWfmH24kj8RgN8zmCoyyrc37PReldTBRCCkhSw+JR1vywXjrG8of0 FI5lKlmrhdSSwXa76oCXBhuRZzsZNJ0hCUROU90MZCKU/Lw74I4tta+8ok7CmoUvZi2u sYO2Kwt7Js5iB2oSdiC7R+9N4BknPpqrYMTxHVjhctmGjv1zHJKBBh2KZ5x86WITNn5f +xzw70tECsRhVXpKTHG2euhkTJZKB+UEl7b+g7Btu35Ogt4nu7B0XFKxTQYffBdpDXr8 2YmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L+3HjSln; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4-v6si1662447pln.462.2018.09.25.00.36.42; Tue, 25 Sep 2018 00:36:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L+3HjSln; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728967AbeIYNmm (ORCPT + 99 others); Tue, 25 Sep 2018 09:42:42 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:39693 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728674AbeIYNmm (ORCPT ); Tue, 25 Sep 2018 09:42:42 -0400 Received: by mail-io1-f67.google.com with SMTP id l7-v6so19698678iok.6 for ; Tue, 25 Sep 2018 00:36:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JCm7BeXOUDEkTOHXuzWK1bry9Ki+594JELty5nhAsys=; b=L+3HjSln+0GJwWymYlInU5nsR5Mh9PhhEk6F3FjawCqrkJYDM7AE+Oavp4NPue3Ua7 QGwf/Kit2/IbdDDos9LiWnamHk8cNgOGJrFNowCtPLNlCRbItBUfWUOkonlqvhFEAoru go28r4tlKFedp0WI39na2vOFUxD4PKP7ekFRs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JCm7BeXOUDEkTOHXuzWK1bry9Ki+594JELty5nhAsys=; b=aA82XykvFT8pu+jVKJvdUeIiHAHoQf6iYupkuS/vcFx14GNa6GJEsKlgeg0MhxAHGM 62GTALP1tiWWwOKd498jkm9xFJM1YyCiEtlwfQn+Ye7QexTjp8nrChrtXJGO1Lx1U8xZ QzL2Aq7wIB405IK/N3IrU70QFzuJOlLSCVIkbmKBl89T5BE0x3aju+9XoEML6741rf28 MLe1NHdvRIbCYvqrxVuGBYv6Nseno27N5WMrR55D+xJBa4l44ZdBlJFIxB3euoscVOxK uPEfNZwz8hdyqjHjoo397lrTc7YF+ByYaA1pPhGBuQoxXLPk2wgPofG4f9fFtFAQOOnz Dr1Q== X-Gm-Message-State: ABuFfogTGn45sawvUF9flzbp3dxkRDvsYovlRKUJQEIN/G6oxntQhM/A SL2YXStWo/+NKvKIZDlY/bQ774TQb/yave5rJu4iEFE9 X-Received: by 2002:a6b:c3c4:: with SMTP id t187-v6mr1950772iof.304.1537860987416; Tue, 25 Sep 2018 00:36:27 -0700 (PDT) MIME-Version: 1.0 References: <20180921103604.13361-1-ricardo.ribalda@gmail.com> In-Reply-To: <20180921103604.13361-1-ricardo.ribalda@gmail.com> From: Linus Walleij Date: Tue, 25 Sep 2018 09:36:14 +0200 Message-ID: Subject: Re: [PATCH] gpiolib: Fix gpio_direction_* for single direction GPIOs To: Ricardo Ribalda Delgado , Bartosz Golaszewski Cc: Timur Tabi , Stephen Boyd , "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ricardo, thanks for the patch and sorry for taking time before responding. On Fri, Sep 21, 2018 at 12:36 PM Ricardo Ribalda Delgado wrote: > GPIOs with no programmable direction are not required to implement > direction_output nor direction_input. > > If we try to set an output direction on an output-only GPIO or input > direction on an input-only GPIO simply return 0. > > This allows this single direction GPIO to be used by libgpiod. > > Signed-off-by: Ricardo Ribalda Delgado It makes perfect sense, patch applied. I'll go in and add some comments to the code so I understand it right as well in the future. Yours, Linus Walleij