From patchwork Fri Oct 18 15:41:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 176879 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1032307ill; Fri, 18 Oct 2019 08:44:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9aKf8gdS3j8gCcHOqH5Vd7YCO3v5VJo1YBNi2dUEl6L+O33XhVeKjDdEf4nkBYXJd6s1p X-Received: by 2002:a05:6402:751:: with SMTP id p17mr10342071edy.161.1571413468148; Fri, 18 Oct 2019 08:44:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571413468; cv=none; d=google.com; s=arc-20160816; b=vpBO6FC3H//w4nqTDmMoFvNmvdnlc1ptFTVd7CTUStZETsVBdTA0DmbtEVLIE30Nhd cMDAzUvElT73KCj1j9zkQgaOeeXAAdSU4eKdUbT6iyjAcciYT1cLYnwqt5qZNtAxtne1 Px5LoxD4MdEcdH1ht6KUhBI7I7y6anHpAnILo1MyawVTaFWORYoWfsf/tS3uKPAkIe6P qo2NCrIUKjOdoKldQkJhNLj0H5b9d0SLgSZ29Lj1XzexTJL+Pm5d7PvRGw6egcxfahrt 9uOUSLd2C1LSUghzH/RDtV2IBNq+/XGt2IREjmhEf8A9DbbSRmgcqwLKJJYKRY74XnGP BW8w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=E0E/Jo7kWKrGS8TJ58aOYmw7R/6JFH3CjhsgRiKHKIA=; b=m5DV1dXlAU42RyOnAMz1oaCNhK+b7k2OSjXIOXW+vuoAsQBA8ZsbqonBTEJC+l/EQJ K63nrHOiXd3VBsUrhy4uvQQPqMsgZL2al1Lu1yeoMCsbUniwcZiRD60KLSBmP39NWp2I QWNw9hWnURiu72AvFbEkujq3D7dW2/1HM8ujwGoJR/7TNW0CE5OjXH8Raf0R7om9m7sH UnY8/SHrNzN/HfZiBGNv3NJNSqsWpnipzAiUtLK6kMLP7+EF4dGJ4OHwLT/absEb21Am t246yjzqeGsXmnhpX3o3Z4MoGQlJR8LiuevjmBc3/ewJuZvSasytqh5+JUWX3lHXsGxY aSkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-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 j14si3430925ejf.53.2019.10.18.08.44.28 for ; Fri, 18 Oct 2019 08:44:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727991AbfJRPo0 (ORCPT ); Fri, 18 Oct 2019 11:44:26 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:35545 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408928AbfJRPml (ORCPT ); Fri, 18 Oct 2019 11:42:41 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1M7ayR-1iOU0W0GFx-00819k; Fri, 18 Oct 2019 17:42:29 +0200 From: Arnd Bergmann To: Daniel Mack , Haojian Zhuang , Robert Jarzmik Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Linus Walleij , Arnd Bergmann , Dmitry Torokhov , linux-input@vger.kernel.org Subject: [PATCH 27/46] input: touchscreen: mainstone: fix pxa2xx+pxa3xx configuration Date: Fri, 18 Oct 2019 17:41:42 +0200 Message-Id: <20191018154201.1276638-27-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191018154052.1276506-1-arnd@arndb.de> References: <20191018154052.1276506-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:Ng/eyI4thlC2GCBRgdpQcO3nmYU5CsaSTwm+I+PB6/L+XERvTt3 mM+f2NcUCRVt671B1y+gsqqvmpOFOcfe2W3Fv7ZMf6s270ujaqjmTpnZW86HvY4KspXdIL2 7G4rcVEFd985Q2LZzPjf6lQRJx81j9teHbdRhLAh6nUIfYMLSEHldIIZx0GGCx5wdGX6Nkb VF3cjt30YDf01jbjdVmTQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:BwtJjcZ6s0M=:VJNJb6LSwdn18+QEAXftWz Yc6hA5MFJhCeUC92lhyYkd0l2evj94gw1WsMZXrEak4+MVGInJHGH/sqSH/C61E0r52sAJyJs vZnF5oHEkMjf/1t5qtQ55+EMku67tiU8F9Wb30edaMzg3B4SzS/re2gszOcf2AMOchXs87Vss KFIEIh248dVRSDa8cGA522jU8mdhOip0vKeImFDtYJ7KZkrAfQUH1g/XdlbYwtuyKhrLAd0d7 vfIqOnGsvlf/YFxhZMhoufGydFwzrgiTL3twAuH0agB0zsnTvk+N+x2VXYPbpUDgKp8sh8pNs yolVUafZdH5uViVeKrT/VqzG8j6cssqk5s41GNgxhsVOIq5nx8DFtL175fENk3Rne1WtVHru7 iFan/GJQ5E2rmeHbpcQMmlc3+4Yskz6WdqAVe6SqDOL1pYuCCQDcc8OhkgXe5WfBeQXQdEfy8 16wwvFkIudwbnQVtR5A0o8zkRIlyQHUhRkX4ObQe2ImkUMBokBazMuRhrnLU/062g23+5IX92 9+KoucPEL1AZA5nEddpsl2YuE7sxIyCMT23TEcJPfw9k2JIWvQkaaZ0vu/0gPNyIHBDztkkK/ xkP731J42Vex6oKsgi0ufGg0xPDECcwyN0OYOYAPD36VLwOIqpNZFL2JhCm+L+0GPae9SDpKN AeTu9qN2Bs1izyk7/OUCYApw6clVtexNA/L9lO0YovOgKMMYxfvxWDX/awGlh9bYtaQ52z3yJ 0I9oFv+ITx9f83TC6QZ3dIHsjFsq9SNSECoc5u7gS/4lUX/tUiPs0TAWIweAt9wwtykuu7ARC 8wjaly5zkukSgfPFUT2y0P6+i+lyT/cXG7+eJxS5E9I2G+EqH7G9md3PHeliD57FE0viv6nTV XPJYVreGmjEVQN80iRBQ== Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org There are two different ways of flushing the ac97 queue in this driver, selected by a compile time option. Change this to a runtime selection to make it work when both are enabled. Cc: Dmitry Torokhov Cc: linux-input@vger.kernel.org Signed-off-by: Arnd Bergmann Acked-by: Dmitry Torokhov Acked-by: Robert Jarzmik --- drivers/input/touchscreen/mainstone-wm97xx.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) -- 2.20.0 diff --git a/drivers/input/touchscreen/mainstone-wm97xx.c b/drivers/input/touchscreen/mainstone-wm97xx.c index 87655105ef3a..618c80847d9f 100644 --- a/drivers/input/touchscreen/mainstone-wm97xx.c +++ b/drivers/input/touchscreen/mainstone-wm97xx.c @@ -98,25 +98,20 @@ MODULE_PARM_DESC(ac97_touch_slot, "Touch screen data slot AC97 number"); /* flush AC97 slot 5 FIFO on pxa machines */ -#ifdef CONFIG_PXA27x -static void wm97xx_acc_pen_up(struct wm97xx *wm) -{ - schedule_timeout_uninterruptible(1); - - while (MISR & (1 << 2)) - MODR; -} -#else static void wm97xx_acc_pen_up(struct wm97xx *wm) { unsigned int count; schedule_timeout_uninterruptible(1); - for (count = 0; count < 16; count++) - MODR; + if (cpu_is_pxa27x()) { + while (MISR & (1 << 2)) + MODR; + } else if (cpu_is_pxa3xx()) { + for (count = 0; count < 16; count++) + MODR; + } } -#endif static int wm97xx_acc_pen_down(struct wm97xx *wm) {