Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp817964rwb; Wed, 16 Nov 2022 08:04:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf5K4tnjNSIEjMuNd7fctzBEoAM8aSMcTE+LP8hy1tDn+u3299m/wMcsXGuDlxP2joSJ3dz6 X-Received: by 2002:a63:f14:0:b0:46e:be03:d9b5 with SMTP id e20-20020a630f14000000b0046ebe03d9b5mr20810521pgl.495.1668614660472; Wed, 16 Nov 2022 08:04:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668614660; cv=none; d=google.com; s=arc-20160816; b=Lc7QYh6LB+jlUvjA48Y0omyxF8SU454zUoYLksE4OrZrc2ugvrCg8t1llNcIgadwIf KwBc8e9i7lQ5gjHgr9RFvYNDx912lLiq9/hdPK5FwCtNv/iODkytfsgVoBkcBIDEvrtU 1HsR2D5ZU1J72qFwgEIv8MqciWHQbb+tfX+FDvaRxsizUpanUoApC3sKV/P2cT2BbCqG IvkUJVx952FTl1HjoThVAW9wdzQ4qyvLnxztk2NpfgrnNKgG2L6/SIGzqcdNQhUdVfjg KqBvN840UXlLNYZq/KR8xkGfbWVQm99yNHq2T4ZyH0YPkxrwBFBFSrEZXmv//A6SSE7g FXyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version :dkim-signature; bh=2F78YjxH2a34CI1gMLFIIT7Y5/nrDbaYWsLpgUPqeDg=; b=nVTkaNrXlLzMrvYFVP+bCid+yEnrwt42RLhBbyjsnjFNPpLoOdfIfmmW12vtMawm6Q iKlWmnzKJlMBtJwW1dChOKS3fc5+Tl8Y/f3eAvFYvJwVhJjE2LJ95IHLbND7c/cpnl74 WojlV1/XQlOrXEu8zB/Ie9zbzezjfOamkFYIs2UDzzWEqqQg08hdVd7R8xrj5ePJP+C1 rJJTsfAIT9UDwEhw9IYiFY/KL2GEIlLuChYIPiGVu/fOhsmoZLpVxlwNrBwV4qNdlDGJ aySbC6f2EiQUmVsKZSo35Nz9G1Eue/RBo5MeP0WiYwLWnIHfURTPoCH6uroFyfc+fi3I nK9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=CbmeF8L4; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n19-20020a634d53000000b0046ef21af712si15416888pgl.256.2022.11.16.08.04.08; Wed, 16 Nov 2022 08:04:20 -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=@walle.cc header.s=mail2022082101 header.b=CbmeF8L4; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232904AbiKPPlt (ORCPT + 91 others); Wed, 16 Nov 2022 10:41:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231629AbiKPPle (ORCPT ); Wed, 16 Nov 2022 10:41:34 -0500 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E33A8B0F; Wed, 16 Nov 2022 07:41:32 -0800 (PST) Received: from 3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id C72D41263; Wed, 16 Nov 2022 16:41:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1668613290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2F78YjxH2a34CI1gMLFIIT7Y5/nrDbaYWsLpgUPqeDg=; b=CbmeF8L4TZOd8wwBTDXuAwc0ozrB2Zv1RGjH4S+Nb7sWe9UqRYtNBiRNJaOhoNcNSQWBOd AutILcol5Zk+ILXlvps10qv4wdwC62G/+ZQaQa/LnucfBUh/VCdX7xc8FoJkNlZZYcX0Bb GAVlaCyFEGm1WPdO9oKHiE1K6cf3lnKm+v8+clHgMl08Exl9VXjV3dz9021qkQSVbO5wKt 26E7idLhRdz3xXQzE4mojcTgOywD5mcJCss3Q/8Caj/7OH6zYhIM+O+pDqd5XwbgzFfQYi PXB9vIUxVim6xdLwjVKSGWEKvZLD2jhlr+nXDUmvLP4UsxieFVIalZ3xRNyYKA== MIME-Version: 1.0 Date: Wed, 16 Nov 2022 16:41:30 +0100 From: Michael Walle To: William Breathitt Gray Cc: Andy Shevchenko , robert.marko@sartura.hr, linus.walleij@linaro.org, brgl@bgdev.pl, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, broonie@kernel.org Subject: Re: [PATCH v2 1/4] gpio: regmap: Always set gpio_chip get_direction In-Reply-To: References: <1805d1ddb5bbce8e86164e66421ddde481cce4f9.1668129763.git.william.gray@linaro.org> User-Agent: Roundcube Webmail/1.4.13 Message-ID: X-Sender: michael@walle.cc Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 Am 2022-11-13 14:21, schrieb William Breathitt Gray: > On Sun, Nov 13, 2022 at 02:40:17PM +0200, Andy Shevchenko wrote: >> On Thu, Nov 10, 2022 at 08:55:50PM -0500, William Breathitt Gray >> wrote: >> > If you only have reg_dat_base set, then it is input-only; if you only >> > have reg_set_base set, then it is output-only. Thus, we can always set >> > gpio_chip get_direction to gpio_regmap_get_direction and return >> > GPIO_LINE_DIRECTION_IN/GPIO_LINE_DIRECTION_OUT given the respective >> > register base addresses configuration. >> >> Seems legit to me. Have you checked if we have any gpio-regmap drivers >> that >> have something like this in their configuration already? In such cases >> we need >> to be sure they behave as expected. >> >> From the code perspective: >> Reviewed-by: Andy Shevchenko > > I see gpio-sl28cpld has two device types SL28CPLD_GPO (output-only) and > SL28CPLD_GPI (input-only); gpio-tn48m similarly has two device types > TN48M_GPO (output-only) and TN48M_GPI (input-only). It doesn't look > like > the change in this patch will cause problems for them, but I'll let > Michael Walle and Robert Marko comment if they see issues here. For the sl28cpld driver this shouldn't be a problem. So for that Acked-by: Michael Walle But back when I wrote gpio-regmap the bgpio served as a blue print. There is the same handling. If you look at gpiolib-sysfs.c there is a comment about the direction property: * MAY BE OMITTED if kernel won't allow direction changes So from a gpiolib/sysfs POV I'm not sure about this change. Does get_direction == NULL means setting the direction isn't possible? OTHO there is a fat "MAY" :) Which brings me to the question of "why this change?". The commit message doesn't mention it. Just out of curiosity. -michael