From patchwork Sun Apr 2 20:09:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2845 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 73FE53F330 for ; Sun, 2 Apr 2023 22:10:19 +0200 (CEST) Received: by mail-ed1-f70.google.com with SMTP id s30-20020a508d1e000000b005005cf48a93sf37829399eds.8 for ; Sun, 02 Apr 2023 13:10:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680466219; cv=pass; d=google.com; s=arc-20160816; b=fi1UMPRIgIxMeXn7eUfoygx0kD6sm6vmosdDpkX+yLnyfarOMphiDhhagWllUVI3us qiwrJdADL6Hi+viSZa+cfHQxevT5Zyd2qroM+A4prOvsKJlqnhoppO+mrQR1Ysxqfcvd 0JjC85V9QK77Hh1lbp6DiU4sK5WaQLN4W39ERHC3wqdxRSGIPymH+U+/TGAM7cCs+11R 5Ek3DMD557lHARiP6e6jG4jvf0qp+tpZep05+2VaMuirnnYuYBJgCBI543wvDAZUOIzQ JNoZtdO+HBrqvZ3eoNhxn5zG27fnDYK9wjhMiG8xccJS2f/5wjsmIBFGk6906KK3haY+ Koxw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=ydffzM+iKzy5XImLF5EJHrvItyEBVvOJY87phTw09cE=; b=jl68aW0tijU4UujlCdpN4B20SXAdphUjN4/ehDxTJ8FO49pytH6P/0jyTyuAGLj/Oh ZaCJNrO8LJxP5YTZarM2HACvz6uauA1N08ez+ESmZxxiXoQotj8uFMQgJ10OETJkaVmu ieVbSWCYwDpzih/k0s15/52LkTpZK2gZOJ2Eja4mRvNnMYZjw3uvophiiHnALIu8Eiwm TcMXJ8s6TcIV3bm2uMmDhCATk5slYBsJgmm2YuGIseRF9isUsYA0z6Yet194zxZaM1Wl vQYK6srfaaxgtifxHVVcd71Mgdm+F7pYoPhGZzHTwLT+X1LS7B0Vh4ZQomfe7U/56tkx yAbQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=N9sz1W2n; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1680466219; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=ydffzM+iKzy5XImLF5EJHrvItyEBVvOJY87phTw09cE=; b=ar2T3xkVGAj1gwbSF5gA65uBLVYagCIyyJOUftKjC1bkKtCgeErGKBFQ+DGo9KgwCP LvuH+gd0BrMO1LZ0EB0tPCeX/EITqusXbUpV367NJRv8fLpvFPGdjyTQw4aWjsZf/CnR 0hHu7RIh5umcSggbCuaiuRqGtwAnq2Lol+X0M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680466219; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ydffzM+iKzy5XImLF5EJHrvItyEBVvOJY87phTw09cE=; b=0dagbtghCBKxgwdsxLrJ7HysRWNz6FO+6o0dJfv6JFIUIPRyiM5S5BQpWMjo33nNLu jTDNIgHvWrXJMh/zLoi9WrBvURgc0IRfs8QOsh9yHcfYyIlBeichqloNkid9Nx/jsYDQ RVy1VPG8iWQOP7xZYMohlqxkii7edPnupOUMC9YPiDzzSSo1sxOVg4SheU6Pr5rX8dsS MBTjm5O/miSdlAQHUR+ED6stPxSgnCGqPHOyUNJNeMEFbeFD6qHtG9YTzjuk+JVokJWM 5wvlKHX5QoEMvdQugspwOLSFrMCyKKN01AD1Arfe5LCYVNVjI9TD+oc9bIhIlQoiZABp Iw2A== X-Gm-Message-State: AAQBX9cknIIblJNIBXfPPy/7wy4fK5CmW6NeH60mhGpcoRmv3e3C7NoW 2b1IcFv+lTefN4xgEbZzqyORkOX6 X-Google-Smtp-Source: AKy350YAI9UVyuuxx9eyP00AvobgAcu4PmunDTViMzAe8C4BkFmyYMT8UODKaMjojZG2Q77W5vv9/w== X-Received: by 2002:a17:906:c357:b0:932:4255:5908 with SMTP id ci23-20020a170906c35700b0093242555908mr16180167ejb.5.1680466219226; Sun, 02 Apr 2023 13:10:19 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:907:1b02:b0:934:1f7e:b3c0 with SMTP id mp2-20020a1709071b0200b009341f7eb3c0ls4642293ejc.2.-pod-prod-gmail; Sun, 02 Apr 2023 13:10:18 -0700 (PDT) X-Received: by 2002:a17:906:8296:b0:933:868:413a with SMTP id h22-20020a170906829600b009330868413amr32437282ejx.15.1680466217785; Sun, 02 Apr 2023 13:10:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680466217; cv=none; d=google.com; s=arc-20160816; b=LiWH/8CRegBCuvkolS3Hhyx9jKEKbjlcsqQgrRL05Nela7UNkqtjWVOHPoKjptjJTS 1c7udi9Y8J6uJR8Qp7gOzykosPn3wp4BMM5MNVTRbP0jXaInexlXXq4yakAPLsFQcEFZ /DYN8i80u8WeqCkN7nNVP9Rxu0A9ufft7FOCJb4YffoFfSW61mb5ryCAUZoMdAMdcn8K ACsHbn+RNwbEMZwoY1zfzpycMfjEy30JvdaIG+zrg1o2UcbsaOhowvkSoUzMhAsDc6ev KLfyxeEMprXkIhOVEpvWjkrkesvV5iGtOKXmrKA+EJrE+/RQ2lOd3oTic7lbTHY/f4K0 Js1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=/6yCxE8OoG8PeYtqKpR9SG7wxwNS753oO+7UKWNzpVg=; b=zMM2SLPzLFhLbRbAFYB0d6tX2ZnmkgdJkov26dpFjcpUAU224qLgMfnUML+DvhgdVD rSL2IxZwdoLPT5Gls12o3KfY5lQuW6bcXK23pgSpra5sG15uYkyf3OntkXFZRZ5QJPQm 4hPvi/XOqVQR93UNsURchrUt3nIoHCL+GmMvHFCVShL5rA6iodnuN7Phz3N8lIBycC3Z Jd3BmZGr+3oCH6MssfZOkeCG7RM5M3fli96hXHZkmBGvuE4bKH9FltjYncEIs8GyOpTV s7LPuTazXdMFNIE12Uf5p3G52SzOX7XTnhryuafgddg0T99VRqJKD/EODbXq1hrdt4Za p36A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=N9sz1W2n; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id ga8-20020a170906b84800b008f0156091c8sor3435256ejb.45.2023.04.02.13.10.17 for (Google Transport Security); Sun, 02 Apr 2023 13:10:17 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:906:a150:b0:8a0:7158:15dc with SMTP id bu16-20020a170906a15000b008a0715815dcmr33439578ejb.74.1680466217623; Sun, 02 Apr 2023 13:10:17 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-248-31-153.retail.telecomitalia.it. [95.248.31.153]) by smtp.gmail.com with ESMTPSA id gl18-20020a170906e0d200b00924d38bbdc0sm3553127ejb.105.2023.04.02.13.10.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Apr 2023 13:10:17 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: michael@amarulasolutions.com, linux-amarula@amarulasolutions.com, Dario Binacchi , Dmitry Torokhov , Jonathan Cameron , Oliver Graute , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Wolfram Sang , linux-input@vger.kernel.org Subject: [PATCH 4/9] Input: edt-ft5x06 - don't recalculate the CRC Date: Sun, 2 Apr 2023 22:09:46 +0200 Message-Id: <20230402200951.1032513-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230402200951.1032513-1-dario.binacchi@amarulasolutions.com> References: <20230402200951.1032513-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=N9sz1W2n; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , There is no need to recalculate the CRC when the data has not changed. Signed-off-by: Dario Binacchi --- drivers/input/touchscreen/edt-ft5x06.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index c96fe6520578..d4f39724b259 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -319,7 +319,7 @@ static int edt_ft5x06_register_write(struct edt_ft5x06_ts_data *tsdata, static int edt_ft5x06_register_read(struct edt_ft5x06_ts_data *tsdata, u8 addr) { - u8 wrbuf[2], rdbuf[2]; + u8 wrbuf[2], rdbuf[2], crc; int error; switch (tsdata->version) { @@ -333,11 +333,11 @@ static int edt_ft5x06_register_read(struct edt_ft5x06_ts_data *tsdata, if (error) return error; - if ((wrbuf[0] ^ wrbuf[1] ^ rdbuf[0]) != rdbuf[1]) { + crc = wrbuf[0] ^ wrbuf[1] ^ rdbuf[0]; + if (crc != rdbuf[1]) { dev_err(&tsdata->client->dev, "crc error: 0x%02x expected, got 0x%02x\n", - wrbuf[0] ^ wrbuf[1] ^ rdbuf[0], - rdbuf[1]); + crc, rdbuf[1]); return -EIO; } break;