Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp824417imu; Tue, 11 Dec 2018 08:08:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/UwzzOJP5kctI2Hb1PoZ9YLC+edRMTA8mSQfol94629oMKXE/hb8ZLgcQzQHktgxY/nb3YG X-Received: by 2002:a63:d547:: with SMTP id v7mr14854224pgi.339.1544544502133; Tue, 11 Dec 2018 08:08:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544544502; cv=none; d=google.com; s=arc-20160816; b=tjbO/kpOIg9PFxoLm/F/UudUHDRleUrjuxLmxMTmAe3aQ8tMixyDlM1eqm6EaMem4u BzRVDwIJf8+ixn2Tqhji5U/mzXWZqyLzksSkaD/R2blYbXN39Qd4ZUQeqMsW7jC/Rb6X UVwUyS4802nDMOfnToYGz3tF4ZDE3c1zaD1LWc5pYwmY4aqR+Cja2EGrxqlCNx61lvLt o/dPmxTbU5BfSJ+EpuGDN3FczCVuRYr00fBxtiudEC9PLxMKENC10qFEIox2q8ZRiG6N l7ajM2G9mG/229e8rbOVmIg1Q5lazCy59BTEMaO6+wAPMUeaaXP3zdOewoH2xTOqEcF1 kmNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uHPKJqN2mLs+AWhZ7auMVg9GpV8SgoYVrpNb/+8LWoM=; b=g0N1eEnrc1LIpTp0qtqAm/S/3OxW5kEIazf3dcu089oEyXs18vTG3K+JH+w6DVMw1G 5kEZ1fqBpXFA00OZxCnV2Hrx4f5vjsG82dhXnYi8sNg2FMKMKBTSvv9Jg4oikUKkyOWg MmMmYA915S7EyzSzKeA6Mg4M5A76FeT9lCOrPhcC7N6nCS5lqAfn6nuAYQW4ZSvTSE9H 4naV5QUeleiA/N0eIFJRj5jNh9BWYutoOvxZcVMcCEYawbvCwO/nFFSAmNZbytNr7itD GVUuVywiIXnevG1SiTXq8Gaf0WXARDjVOtjHkhrBZuwHzoSucYko/y6PNyWHTcy2KziI VkmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VyRK90Q3; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 19si12111923pgp.186.2018.12.11.08.07.43; Tue, 11 Dec 2018 08:08:22 -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=@kernel.org header.s=default header.b=VyRK90Q3; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730339AbeLKPzP (ORCPT + 99 others); Tue, 11 Dec 2018 10:55:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:43830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730343AbeLKPzM (ORCPT ); Tue, 11 Dec 2018 10:55:12 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2949E20855; Tue, 11 Dec 2018 15:55:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543711; bh=J0xN7xqJMiGQH8sTWFHBfS/NLWRb52eMQK4sEHX66ls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VyRK90Q3AbcJfuPXt29pAlMlRv+71HhxJHFwXQbFyTjksLLn0n1oMq3N5+cys44hE Kr9l8lCWBUEYzs0n/M5JCL6dgBnueJa7GAaTfL4EBlPhhay40ZcSwZ0bCj7Cr4Yna+ Jw/M51ug66dCgzXxAh57LHf8kle88DTZr4rcM7pQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Greg , Robert Jarzmik , Linus Walleij , Sasha Levin Subject: [PATCH 4.19 033/118] gpio: pxa: fix legacy non pinctrl aware builds again Date: Tue, 11 Dec 2018 16:40:52 +0100 Message-Id: <20181211151645.576897156@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151644.216668863@linuxfoundation.org> References: <20181211151644.216668863@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 70cdb6ad6dc342d9643a00c9092e88f0075f2b9a ] As pointed out by Gregor, spitz keyboard matrix is broken, with or without CONFIG_PINCTRL set, quoting : "The gpio matrix keypard on the Zaurus C3x00 (see spitz.c) does not work properly. Noticeable are that rshift+c does nothing where as lshift+c creates C. Opposite it is for rshift+a vs lshift+a, here only rshift works. This affects a few other combinations using the rshift or lshift buttons." As a matter of fact, as for platform_data based builds CONFIG_PINCTRL=n is required for now (as opposed for devicetree builds where it should be set), this means gpio driver should change the direction, which is what was attempted by commit c4e5ffb6f224 ("gpio: pxa: fix legacy non pinctrl aware builds"). Unfortunately, the input case was inverted, and the direction change was never done. This wasn't seen up until now because the initial platform setup (MFP) was setting this direction. Yet in Gregory's case, the matrix-keypad driver changes back and forth the direction dynamically, and this is why he's the first to report it. Fixes: c4e5ffb6f224 ("gpio: pxa: fix legacy non pinctrl aware builds") Tested-by: Greg Signed-off-by: Robert Jarzmik Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/gpio/gpio-pxa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index c18712dabf93..9f3f166f1760 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c @@ -268,8 +268,8 @@ static int pxa_gpio_direction_input(struct gpio_chip *chip, unsigned offset) if (pxa_gpio_has_pinctrl()) { ret = pinctrl_gpio_direction_input(chip->base + offset); - if (!ret) - return 0; + if (ret) + return ret; } spin_lock_irqsave(&gpio_lock, flags); -- 2.19.1