From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76CDCC43143 for ; Tue, 2 Oct 2018 12:26:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 35A762064E for ; Tue, 2 Oct 2018 12:26:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="QnOqPQbM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35A762064E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727765AbeJBTJy (ORCPT ); Tue, 2 Oct 2018 15:09:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:54434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727629AbeJBTJy (ORCPT ); Tue, 2 Oct 2018 15:09:54 -0400 Received: from [192.168.1.75] (cpe-24-28-70-126.austin.res.rr.com [24.28.70.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 254972064E; Tue, 2 Oct 2018 12:26:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1538483208; bh=DPyJ5hfP17nbOqx7v6oCLONH/bQ/7PyL1E43dSVuaMo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=QnOqPQbMO+ogQ1K37YryQKl1q8ddD7oCi2scqoRdGZf5xow36T/nuS6mCyoQQZj6H Nc0Qd/+E8V0q0tV1seDS4qGW+2Rc8kGEL46RWCET7cWbvIT+u0uDbZ/pzCekf5xA7B ka1GDjVwI6p2HCVUY9KAmAshkTiXHCigeeS9ZZR4= Subject: Re: [PATCH v2] gpiolib: Show correct direction from the beginning To: Linus Walleij , Ricardo Ribalda Delgado Cc: jhugo@codeaurora.org, Stephen Boyd , "linux-kernel@vger.kernel.org" , "open list:GPIO SUBSYSTEM" References: <20180921103604.13361-1-ricardo.ribalda@gmail.com> <20180921103604.13361-2-ricardo.ribalda@gmail.com> <153803107307.119890.10052910965015646333@swboyd.mtv.corp.google.com> <3e07cab8-0f3e-7474-8f6d-e6bb16e8f998@codeaurora.org> <5aea282d-6fc9-cd70-cec4-10f28aa819b9@codeaurora.org> From: Timur Tabi Message-ID: Date: Tue, 2 Oct 2018 07:26:47 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/2/18 2:38 AM, Linus Walleij wrote: >> But as today the only driver that seems to be using valid_mask is msm, >> so perhaps a hack is something better and then when we have a second >> driver that requires it we figure out the real requirements. But it is >> definately your decision;) Please note that MSM is supposed to be the *first* driver, not the only, driver that needs valid_mask. So let's not make any code changes that limit this feature to the MSM driver. > I would just add some exported function to gpiolib to do what you > need so you can set up the valid_mask before calling > gpiochip_add*. I think that should be okay. Drivers should know pretty early whether they need valid_mask or not.