Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4199444imm; Mon, 30 Jul 2018 10:17:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfKELF7HECywiyUhzyiv3LyHdAUiCrPp4GGdExl0KLl/bjHzVOA9GCgeIbZoRIKjWIs+aXQ X-Received: by 2002:a17:902:5582:: with SMTP id g2-v6mr17469749pli.328.1532971026959; Mon, 30 Jul 2018 10:17:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532971026; cv=none; d=google.com; s=arc-20160816; b=lg3B36bfEbBH7Ki9lFplS1ovrOWaU6otnrKo/EGp4Jhg5VfqJ9HIIJV6uHEMqOHVF4 CRkB2De+qTiDc1G7WUJwB2tpQ7shbZ3HPrd40BasUPV205zqDioX2wTt6fyThNOISuBK ycMcSxv3Utk6WHWT/TLnXluj04Xvlxivk0BMHlYe0ghkeAJ9elOFRA35TPYqopoXFBno pvasGL2Hv5BX6Te38qJSnMg9GCaM9+bV/9vn0M5GN0xeonSjC9azDUUN15yPTWNs6XPG E7Ik8HLIqG6y3xe2YCXCCueHk5nnJCep8qtEGjqtmWtbSa9eEJ+ki7abh6mgZOM8QSHz KJRg== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=7GC9s5VIT8ydoro0UBQO8EA2Ao+qMvL3sBRIiBrZ3m8=; b=IUn8V5sYMrdCbQb8HjcMxp9X+RIIX1ofERCTd98rY8gJSnO0M9ZxjDnghcokG7ysMJ 679xDNCZ+3JOihUw4OIqqC4XUFNBQ9mRZ31puECRTnrbpUO7atbDW+yVkUkaq8NKyzEm he8kAk4jkeqy8ca4uyREpzbvyr56x9HBM4k9V6xabshYXYzDsmS0NgJ1sZYqIfE74zk6 adx9tuagQMsRRc9bcuVDbgg1XG9N+GFqhyUUSiv2KjVNwJVOjo/01+ETwx1fzKv9yQ+4 y0+CAfo3a2X/nij2ERQggb1rRs7CbS5BDhlYOFQswIe6KG+EScIBoCSIyRIwlS6UG/t2 vcIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rbi9AbDU; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l30-v6si11270939plg.12.2018.07.30.10.16.52; Mon, 30 Jul 2018 10:17:06 -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=@gmail.com header.s=20161025 header.b=rbi9AbDU; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728907AbeG3Su5 (ORCPT + 99 others); Mon, 30 Jul 2018 14:50:57 -0400 Received: from mail-ua0-f194.google.com ([209.85.217.194]:46653 "EHLO mail-ua0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726782AbeG3Su5 (ORCPT ); Mon, 30 Jul 2018 14:50:57 -0400 Received: by mail-ua0-f194.google.com with SMTP id u11-v6so3631916uan.13; Mon, 30 Jul 2018 10:14:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7GC9s5VIT8ydoro0UBQO8EA2Ao+qMvL3sBRIiBrZ3m8=; b=rbi9AbDUOyYAGmEadQMizzfrY4t5uEJThJoCouFHT8wkm8mZtyv5KEYjnbZk5GRqMY YC4xT1nTOtDvgDz4B43KB/Gp2xDxlfpIRMidNNF4Ytzj/HHfcwYU2wyfEXuvbpI5ysd4 9wiVDDELNc/Ry1t20KDigKrW3GCE3dcCPYCctbzuAVwDHUqQ77G7+ZhG19o5fWgMhMyH KmEgribvzgM0jzl79/GHY0Z4yjzaOf0UUhS4QLwfcvysZ6FuaDSZWX7NZ5lyN4BkcS+q QdPeYdebv7L1VU88qXerbL2NL0pbIvw8RYHlZv9gtGNY9PGG6db9sRAdp2Lj8iLbrMXk /7lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=7GC9s5VIT8ydoro0UBQO8EA2Ao+qMvL3sBRIiBrZ3m8=; b=WRSdh5lR80rGf9k6dCPIg2NDuEXAAyVw08k5RWay998AsoP1BEIQ/rMnAqNHQEvKn7 uwmHKydWgL/thtjXVIHU/0Foy8T/v9nir9YSdQzkor+N+uDRqrFMjXp4g1VMcRYQHTw0 vh7OJnY5E4GUksuDhTEpfOsVkxU/bqbp3tbtHdG9Rnh52vy5QFdgtTU+5tsRln0s3SME ibx7yCdweC8vddztgpCiWTLHt8g4B6BzzCiEjI0Nc76DScmJx5UEASfHOGYpzNAbjo18 vmJsyTF1BxOyVtorcCUDq2EjDlaSVltGX5YM2/hWf6r4kn2KfobEBzxeGvGT3aUs9p5i UPHg== X-Gm-Message-State: AOUpUlEWwkd2wD//+SRe9Df1QpFjTfiO0IkBRvP7SnY62Kh1FQQgsPm+ klkq85uqfDJ2VNfkZCpmSxl0pwqrGJ/1Brh+TDBFBH7x X-Received: by 2002:ab0:4c24:: with SMTP id l36-v6mr12614497uaf.199.1532970899486; Mon, 30 Jul 2018 10:14:59 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:2149:0:0:0:0:0 with HTTP; Mon, 30 Jul 2018 10:14:58 -0700 (PDT) In-Reply-To: <20180730093418.124648-2-tmaimon77@gmail.com> References: <20180730093418.124648-1-tmaimon77@gmail.com> <20180730093418.124648-2-tmaimon77@gmail.com> From: Andy Shevchenko Date: Mon, 30 Jul 2018 20:14:58 +0300 Message-ID: Subject: Re: [PATCH v1 1/1] gpio: mmio: add inverted direction get_set io support To: Tomer Maimon Cc: Linus Walleij , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" 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 On Mon, Jul 30, 2018 at 12:34 PM, Tomer Maimon wrote: > Add get_set_inv_dir and get_set_multiple_inv_dir I/O functions > to call the data register when the dirction is input and > set register when the direction is output. > the functions will linked to the I/O get functions if the user set > BGPIOF_INVERTED_REG_DIR flag in the bgpio initialization. > + /* Make sure we first clear any bits that are zero when we read the register */ > + *bits &= ~*mask; Theoretically it's possible to get mask and bits longer than one long, and bitmap API has to be used. Though, it seems entire driver has been written in an assumption that it's never happen. > + gc->get_multiple = > + bgpio_get_set_multiple_inv_dir; I think you may keep it on one line. -- With Best Regards, Andy Shevchenko