Received: by 10.223.185.116 with SMTP id b49csp2012808wrg; Thu, 22 Feb 2018 06:54:19 -0800 (PST) X-Google-Smtp-Source: AH8x226sxX85viXnDZooCXBu04nVaYm8rcK90xbD1uqIRhAO3ziBBpHY4cgGIzlhN/ciqRZuyOyR X-Received: by 10.99.182.76 with SMTP id v12mr5785056pgt.158.1519311258961; Thu, 22 Feb 2018 06:54:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519311258; cv=none; d=google.com; s=arc-20160816; b=J0M7PxJ89xSO95GdKCdJ9PMbY8+c6YUXBmjQOcq62KpiJLPHR2WQDO9man+0sANs/s 0ws/6jSutpsgQRFZcVF1D845DuWt8anlgGX558ffsR27Q4laH1kNm2UgAiq9r9MrB0H8 IzrX7o9djAyj4vuprfUMFpn0mosmTaFwyC+EzmGkFCLDxq0bNe1cxSw1yl/2Kdz8ozcH ahzuyv65SMi/TgqYcgK9pTdMsDJjh4/IXrj2DLdWGiNoqrAUsCmaDEvKBClmwKh5W9Ti dtvwkhBRqgWneJWd0dnMMABd1tuhdkF9hzBuUOktOhgNxOqYOFADLgWkxhMHdhDBzSzQ hRfg== 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=FCQEWal93eHa8lVgY+FqOqyoudCvX4Nduy4/0ACuq4Y=; b=jvtD6G7ggfOAnJzXfBGjPIZ4hh/M2QPtem7oME+kTQMvXQ2yJ53/N++oOvVAItV6au pVymBn1JOAaYkP0PjOy7RKBR9QX2wLY5zfbz60wQP5PWZ3j1EHrTkaW0omvfSBsc3Img TaVZU5AQ1WrA6je+dAFq1ISHEKx3XP6hwG7XlH/F8PNKvOgmVKDiLLTdCy1kuFCk9MYC s0bVdw6yR8LaoOakwn0RhH3SJWBTF9/B4KYYsRDTO//1Pc9L1OoLjbSgZSAR2E3DzSJZ nEY6yUOMDTyMV/GQyouDBxW5lhz6wN9Eakkr3Rl+ONUNhoTbFSIKeReToZHajd8BDnbW IXWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZJc+DXU/; 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 q67si143618pfj.146.2018.02.22.06.54.04; Thu, 22 Feb 2018 06:54:18 -0800 (PST) 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=ZJc+DXU/; 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 S932665AbeBVOx2 (ORCPT + 99 others); Thu, 22 Feb 2018 09:53:28 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:36596 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753651AbeBVOx0 (ORCPT ); Thu, 22 Feb 2018 09:53:26 -0500 Received: by mail-io0-f194.google.com with SMTP id t22so6283059iob.3 for ; Thu, 22 Feb 2018 06:53:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=FCQEWal93eHa8lVgY+FqOqyoudCvX4Nduy4/0ACuq4Y=; b=ZJc+DXU/jhSTvwON3La8/DMG41gqzoE4dBrfwSHziM7N+yRFeG9eowAntDzugky974 OU2WpDTy27xFyKMa2Kkf1jBuy3VDfH2n1IFxpW42c+5tQXHgEvfoi4mI+9QX9YnwB/s4 WlvMG3cn6fGG0tLhS/BuqL00poM236eBJX73k= 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=FCQEWal93eHa8lVgY+FqOqyoudCvX4Nduy4/0ACuq4Y=; b=pX6/IT8bSIBfVXItWpDE0cmlFtrtnP7haUABKjWlCWyspRZQCQqQk106is5iMMU1kw wOZ7OUllcs6hPbt6HSBsuZ+jzAHt2cwKidC5Qpv3mpF3uTO8DSbDiGmO+GxH6MNiWtYO oVOfBOz3zDBhIMTqB++4es/MZOCD1sEV1nJCS2T+ccYEozknjpLgzazFAwLwFdvtg0l5 8JHOhjGv4f2pj15I2piytLK1Ci3VBew7WvEDDQ8aMkbl+VyL5GnV5b0uRR+EMV7E/hNF /2Ua6E29es7Z+xtZ3puGttEnC5FH3m8Au5XHg/var07g6znq07F4Vd6NcVNfQZpsp07g rSzA== X-Gm-Message-State: APf1xPCCmaMipWwyqnXQa5PNY/nIdLh7PSvrNs72lu3tdYv2iCnkYN95 dqB8Y7HQpCf60nJyCai3xjQHs5eI2KhRhI3kyhiKUA== X-Received: by 10.107.139.77 with SMTP id n74mr9052642iod.109.1519311206063; Thu, 22 Feb 2018 06:53:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.230.25 with HTTP; Thu, 22 Feb 2018 06:53:25 -0800 (PST) In-Reply-To: <20180216191243.129130-1-djkurtz@chromium.org> References: <20180216191243.129130-1-djkurtz@chromium.org> From: Linus Walleij Date: Thu, 22 Feb 2018 15:53:25 +0100 Message-ID: Subject: Re: [PATCH] pinctrl/amd: add get_direction handler To: Daniel Kurtz Cc: "open list:PIN CONTROL SUBSYSTEM" , open list 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 Fri, Feb 16, 2018 at 8:12 PM, Daniel Kurtz wrote: > On boot, gpiochip_add_data() initializes the FLAG_IS_OUT bit in > desc->flags iff its gpio_chip does not have ->direction_input() handler, > else it is initialized to 0, which implies the GPIO is an "input". > > Later, the sysfs "direction" handler will use gpiod_get_direction() to > get the current direction, but if no ->get_direction() handler is > installed, the result will just be the current (initial) value of flags, > which will always be OUT irregardless of the initial register value. > > Add a get_direction() handler to pinctrl-amd to fix this and always > provide the correct value for direction. > > Signed-off-by: Daniel Kurtz Hm, please don't use the sysfs... use the chardev! Anyways, patch is fine and applied. Yours, Linus Walleij