From patchwork Sun Apr 2 20:09:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2842 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 286D940CCE for ; Sun, 2 Apr 2023 22:10:15 +0200 (CEST) Received: by mail-ed1-f70.google.com with SMTP id r19-20020a50aad3000000b005002e950cd3sf38559134edc.11 for ; Sun, 02 Apr 2023 13:10:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680466215; cv=pass; d=google.com; s=arc-20160816; b=RMCPsqKi2/BgUzCrIoXtBbaNpa7hWY/dMeMua2ASk33FTmIwYcCyD7lrmun8tM88DF aRqX9athvPOgvkRJQy2MCnidtBbsqNQ30Kdx+5CtceQX8bqzKrnEnk+wEjXEzyBYs2v7 semO6Qf/fgHCfGoL0zfK3sSaMDpzKGPg2fmT7KLm5TskxeDfxOG1qMHvHxUgfQ49ZYjg RV/ESSV6DcLUC59/O5detEHjsaNgTqfvm0PklULDeWkxxnYq/wk2BRXq43+OPmhMY1U8 sVUyUpau/+q+KKsE/8lP2xA2MnsSxkAjRZiT/84N+Mz9KTyNGsrtqo3+ep5bX9jIpKZJ LXpg== 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=XnUUy7xDS4FicRA5MY58qSMwP6GQ+LTiZ2DK5AL1tqg=; b=yzSteaJgaA5albJc+ujwsz/MbCa5Ct5I1BWjpL9Kdzm31Zoq0ltZkfGWGHuCcqrK/T Nv0ez9/0kwjJZhVGU2o0o0+Zyy+OCQqsnmYy3T5P3HBKXX07zxUb1v12QF3kmRec6Mu/ UwqD6wynSfAfKAAR5brMVdVLteTkc3NmvcJ2WuOks6PfpSjjfWOlY7+gc2jLYeLpRNaX EFOsXuE+/pFWmDXfxcKXPHO+oCqW7JlRPJX/rE7+DOxm1/4/d7UYfNo/FkaI6Rm/4uft 35HgssTQ+YjJKtr0ImeJo4rx1T+vsxGdQpued2Ps7SvJ/q664RChMm4mydJBPBnr+jlW 4knQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HXrO6Iv+; 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=1680466215; 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=XnUUy7xDS4FicRA5MY58qSMwP6GQ+LTiZ2DK5AL1tqg=; b=hV6Or4bjJ/cH7tqd/lkHsw7tpLcmE0EisIGslRHm0fMrDeTBB3lhklR5vn0emoPTah eMJjAHLZC8Xm9tix2kb7LnehQpA0gb6NxRj/dSOFV4SuYDDXnEp9W9yWvMXuamEDo89f c9El9u3G5/6tSyydVeU3BpvqM5nin7Mfo8rUk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680466215; 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=XnUUy7xDS4FicRA5MY58qSMwP6GQ+LTiZ2DK5AL1tqg=; b=rrtK/PhNaF9YB9txmYbxOGLqDAmuVvtMLcpMGZW93IScVZ99rtiGCf8oe2Z6fXhYd3 FuEw90pkjxv6uv9ApYwRmo0PAjvHbUDqgAX/XNCOjjcEOmXW9ZqN0V6A/HO0kvJAMoSh PrCoMMraMfIabr3gQKXXx6TSCQFBT4oduYGVO/5CZvcShdXatO5zldlTy/6NkvBc1ksH WLxY4D40OOB3d7n8DNRad9zzwju5YUMqwK35/DJbgamQxbQ9QiuSXXKi3jEV/zNXiCSd 8YFWFbdNGW2sFl7XDgrKMRhZGFLjOr9KCeTWRO/DBepNEsxdqRl4Juge/ZDyxTv/0c+8 Qy5A== X-Gm-Message-State: AAQBX9ds5yYG9r9Y/oghOp0wWtEDRXs0RUmomYTmAytRAFHzxH/W8I6U HqQBO12dd/vCYTBl56soz5dIDfkV X-Google-Smtp-Source: AKy350YfKVPm7aEoKoA8nLIAiOM9fqOPg2tVJfn/pi3HxOe24hLaiQNXvFlWufGX7DynpYeeqaUzTA== X-Received: by 2002:a50:ab5a:0:b0:4bb:e549:a2ad with SMTP id t26-20020a50ab5a000000b004bbe549a2admr16769622edc.4.1680466214920; Sun, 02 Apr 2023 13:10:14 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:907:7ea0:b0:92e:e74d:23d3 with SMTP id qb32-20020a1709077ea000b0092ee74d23d3ls4646074ejc.6.-pod-prod-gmail; Sun, 02 Apr 2023 13:10:13 -0700 (PDT) X-Received: by 2002:a17:906:3c53:b0:932:c56a:c19b with SMTP id i19-20020a1709063c5300b00932c56ac19bmr33362014ejg.22.1680466213510; Sun, 02 Apr 2023 13:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680466213; cv=none; d=google.com; s=arc-20160816; b=gz4y3altot4g+EGb4a190IW6VFO1sEpHqlV4PUmf1Ekkkb6h35fbTxFJpvfx5ykyw3 S43EMVcHuU1VqdKJgRLClUqOMkk8m19eUppc/n7UM9FTkItM4WWp9D6cBzL5j6XGN6Dy mr9CcX52gk7H/1LXsMzOWb40GE4vvK4XoIsI3MzGWvt5Wv3R5KrnQp2KKOVGRRftS0Vc eJzTQ2ukoZeeWZZGBIxsyLVGMsPHC9UoH8tEHJ6hwIxLh82F9ICbgi1zb1jVLl1dJEHH wtaEMlt0WcKz4SBVh8m1kR+2dJTb4xIMzWd1pCcQPU9n0/jezpEX13T9oU8inMl/ftMR 5Mhw== 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=EnxQcOPVYR7k4CaWywjABG48rhsOcDbUEyAkzN67jW8=; b=q9MH1HSeNenBy3aIcl70ff9TxuOZr/xkKfht3y5Y6h0DxdaROhxRnfO8fUn8WhlOZS 9DvysSk0icrYBWaCA+B+YjllrT4I576wrM1c4Rz6JV1WZS6q0UguXdrUPrABMKjzQghh WualH3qctI59HL9UfpaVHlbQp69IWkePeiin5enSMFWOrmfeeaMMriPl8Ya+QwiYrbKD hzE7qW8Rv03ibwnqIz7xsaJsmkyb4CviWxr8pQC2p/i6k0HqO3FwNxZb8Gl7Qss8IGcf ptVddCFWuN3zc+iIaWlR+8/wY1t6YypuV/T9/YAgjvUHsz4OUV9voBIc/n8gnunBYSyi mVLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HXrO6Iv+; 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 ds4-20020a170907724400b0094762fa551esor4263013ejc.95.2023.04.02.13.10.13 for (Google Transport Security); Sun, 02 Apr 2023 13:10:13 -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:907:3e1a:b0:932:853c:c958 with SMTP id hp26-20020a1709073e1a00b00932853cc958mr41589723ejc.25.1680466213180; Sun, 02 Apr 2023 13:10:13 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Apr 2023 13:10:12 -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 1/9] Input: edt-ft5x06 - fix indentation Date: Sun, 2 Apr 2023 22:09:43 +0200 Message-Id: <20230402200951.1032513-2-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=HXrO6Iv+; 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: , Matches the alignment to the open parenthesis as suggested by checkpatch. Signed-off-by: Dario Binacchi --- drivers/input/touchscreen/edt-ft5x06.c | 36 ++++++++++++++------------ 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index 2746649561c7..daba6472fc65 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -241,11 +241,11 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id) /* M09/M12 does not send header or CRC */ if (tsdata->version == EDT_M06) { if (rdbuf[0] != 0xaa || rdbuf[1] != 0xaa || - rdbuf[2] != datalen) { + rdbuf[2] != datalen) { tsdata->header_errors++; dev_err_ratelimited(dev, - "Unexpected header: %02x%02x%02x!\n", - rdbuf[0], rdbuf[1], rdbuf[2]); + "Unexpected header: %02x%02x%02x!\n", + rdbuf[0], rdbuf[1], rdbuf[2]); goto out; } @@ -618,7 +618,7 @@ static void edt_ft5x06_restore_reg_parameters(struct edt_ft5x06_ts_data *tsdata) tsdata->offset_y); if (reg_addr->reg_report_rate != NO_REGISTER) edt_ft5x06_register_write(tsdata, reg_addr->reg_report_rate, - tsdata->report_rate); + tsdata->report_rate); } @@ -757,7 +757,8 @@ DEFINE_SIMPLE_ATTRIBUTE(debugfs_mode_fops, edt_ft5x06_debugfs_mode_get, edt_ft5x06_debugfs_mode_set, "%llu\n"); static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file, - char __user *buf, size_t count, loff_t *off) + char __user *buf, size_t count, + loff_t *off) { struct edt_ft5x06_ts_data *tsdata = file->private_data; struct i2c_client *client = tsdata->client; @@ -965,12 +966,12 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client, case 0x70: /* EDT EP0700M09 */ tsdata->version = EDT_M09; snprintf(model_name, EDT_NAME_LEN, "EP0%i%i0M09", - rdbuf[0] >> 4, rdbuf[0] & 0x0F); + rdbuf[0] >> 4, rdbuf[0] & 0x0F); break; case 0xa1: /* EDT EP1010ML00 */ tsdata->version = EDT_M09; snprintf(model_name, EDT_NAME_LEN, "EP%i%i0ML00", - rdbuf[0] >> 4, rdbuf[0] & 0x0F); + rdbuf[0] >> 4, rdbuf[0] & 0x0F); break; case 0x5a: /* Solomon Goldentek Display */ snprintf(model_name, EDT_NAME_LEN, "GKTW50SCED1R0"); @@ -1051,14 +1052,17 @@ static void edt_ft5x06_ts_get_parameters(struct edt_ft5x06_ts_data *tsdata) tsdata->offset = edt_ft5x06_register_read(tsdata, reg_addr->reg_offset); if (reg_addr->reg_offset_x != NO_REGISTER) - tsdata->offset_x = edt_ft5x06_register_read(tsdata, - reg_addr->reg_offset_x); + tsdata->offset_x = + edt_ft5x06_register_read(tsdata, + reg_addr->reg_offset_x); if (reg_addr->reg_offset_y != NO_REGISTER) - tsdata->offset_y = edt_ft5x06_register_read(tsdata, - reg_addr->reg_offset_y); + tsdata->offset_y = + edt_ft5x06_register_read(tsdata, + reg_addr->reg_offset_y); if (reg_addr->reg_report_rate != NO_REGISTER) - tsdata->report_rate = edt_ft5x06_register_read(tsdata, - reg_addr->reg_report_rate); + tsdata->report_rate = + edt_ft5x06_register_read(tsdata, + reg_addr->reg_report_rate); tsdata->num_x = EDT_DEFAULT_NUM_X; if (reg_addr->reg_num_x != NO_REGISTER) tsdata->num_x = edt_ft5x06_register_read(tsdata, @@ -1306,7 +1310,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client) touchscreen_parse_properties(input, true, &tsdata->prop); error = input_mt_init_slots(input, tsdata->max_support_points, - INPUT_MT_DIRECT); + INPUT_MT_DIRECT); if (error) { dev_err(&client->dev, "Unable to init MT slots.\n"); return error; @@ -1320,8 +1324,8 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client) irq_flags |= IRQF_ONESHOT; error = devm_request_threaded_irq(&client->dev, client->irq, - NULL, edt_ft5x06_ts_isr, irq_flags, - client->name, tsdata); + NULL, edt_ft5x06_ts_isr, irq_flags, + client->name, tsdata); if (error) { dev_err(&client->dev, "Unable to request touchscreen IRQ.\n"); return error; From patchwork Sun Apr 2 20:09:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2843 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 B9E723F330 for ; Sun, 2 Apr 2023 22:10:16 +0200 (CEST) Received: by mail-ed1-f70.google.com with SMTP id s30-20020a508d1e000000b005005cf48a93sf37829322eds.8 for ; Sun, 02 Apr 2023 13:10:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680466216; cv=pass; d=google.com; s=arc-20160816; b=x94Ppegw/OOhDUEM6P5UySeE/kvPuONXA7gavptuLkbTLMF2ojm86Lbru3k4Vvfess 4A6o8j9XGi6SOtQZdyQuhda0/gLz7VJJUXMMRveNMsepUS/VlkfoZo74IyMhdrXcPaVy eaSoX0Ulu4tQf+v3RFH1zmrhdUzfEpJ7L6TBQJM6a/lfbyRuXdMeuhDmqf9uhe1znH4Y ibcCmO2lKOI7ezs1pKDRRt46MpYPaHVV6FShVxx6LYjSq0MggDn4dmLLHAKkNtP0CqNk lPoa/Qzeh1aIxZSqK+H2+FtNvYgGRtj32wyW5dvfxOwhIiJ6v+kRvy91/wYwmV1zddsz M+hQ== 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=Nf7cSMzxkaEUSkN4as155ZOuuI4Pq2EhKOCEmIiz74c=; b=XhV2Dwn0ngXyejEXaJ5JFITIt2tAI13SmzD/tDcFQi0+mMYmLg4NProylswwsLJefj dPHAqdHQJAWoLlTqre13JI14ZglHWH1ItcUtNp+GhW4FjIHiDlPBhqeMcG0F30LNG+cN 1OAluNH6jCmm6fHfojfhIXuUWLjfUJb824ZXIuYZIDioBOVhR/oTq+YiE38Be5tWraR7 KYwfOswE0W5ahsVE9oyMLbUtqPWpc/sLWrQo+m/TsYwY5i58QeVAjun+orsFludRiD7a UoXbw+ecEp0B86z4Yj+v3tFeHqOVpi/1iXXXbNaIa7vMxyfYT8wntECitUt3IJ/r1bwi 6bXg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IWyNDbBW; 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=1680466216; 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=Nf7cSMzxkaEUSkN4as155ZOuuI4Pq2EhKOCEmIiz74c=; b=id8VYK1HQHBj0Keu03008pZcEp9nYmEYmoJE3kXd6C2ryU2Jr1Gz5migRWZs/8RjH9 m/wJp8m2ynBgvfWoGlqPkV/rw/7Cns6W8NmAvs7H365dvWGPow8eNJBulXfo0H6hxx7O xiPmuGVbCvcaeUm2M3GoADHGkhRlBDA9kx7f8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680466216; 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=Nf7cSMzxkaEUSkN4as155ZOuuI4Pq2EhKOCEmIiz74c=; b=iLNDS7OsQt45oEB9x70cWyb5zyqqIGbhiv2QJdEIjCzn7JQS3emcYixpVo8Kizo9Rg YZubkn79TElYvbFiyhJr5KXgwf68TPySzACyM9SOz9jGy+W4bMoXQYARUIDF845obl7j GyRru1WRP6RZFK7Jjf7jaba/+NPzpPApPimXGt/ftFrZSrWb0/tfkbY1+1YNzPyL48C5 tFAn+pGOwKxwbiVSknUKErNzR86yKBddTl81RfEoaGqF8bo1LFp+3IQju99VdJ4xQJ4N aLVdu2QKjWh2hOop5tGFz0hKnb0WHGjiKRFT7+QSAu9CwN8y+ATXRh/7plAp+bpo8y6H wNug== X-Gm-Message-State: AAQBX9etW0VwctracFCCLbOPRWULIqqKGx6gp5oRB/HPpNaKBG2iD1z8 n2uP2ol0fBbPi1pIKOXst1ESOZEh X-Google-Smtp-Source: AKy350bZcq3rZaXiqI5KgvV6EzGpmQU63QGfzAiLrei0GG3Bel0+GRpAEKYBtgEsFb42ym0RyVZgCQ== X-Received: by 2002:a50:a6d1:0:b0:4fa:794a:c0cc with SMTP id f17-20020a50a6d1000000b004fa794ac0ccmr17297319edc.2.1680466216345; Sun, 02 Apr 2023 13:10:16 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:907:c5c7:b0:93c:2338:ccdf with SMTP id ts7-20020a170907c5c700b0093c2338ccdfls4636189ejc.10.-pod-prod-gmail; Sun, 02 Apr 2023 13:10:15 -0700 (PDT) X-Received: by 2002:a17:906:4805:b0:92b:3c78:91fa with SMTP id w5-20020a170906480500b0092b3c7891famr30984229ejq.28.1680466214895; Sun, 02 Apr 2023 13:10:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680466214; cv=none; d=google.com; s=arc-20160816; b=sD2hjH+HJKE8dAsNs7eVIFKiwTgyLB4DEo0JCrR34hJI4C8AlU44LjAsxxyuQ7IA+5 2u1D9fhc8RNUpJhcORkDVYpMNuXBWEOQQ6GKbxKqq61Qu9gN+Qa0/mX0R40P0D/JcPBs 1lg0vLY8fSnBGwAQgQo0zTsikL6sQMvXkaZAK4OH7HGuvchadcJUbit9BvaTGVmNMK97 JiUxKJbfGT7BSsuKiy4+TIox/Uat6qNvMjYL0JpmuB/3JjViIzubForA8Bapp7AbNE2V IKZkfu2saVxKHjJ5nKTlmY0FQ/m1MJ2J3CL3keuHLkeIBwr+vxqvxU97uCmIoP96Fvh7 mMjQ== 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=OecrPdtGTbWbu5zwStTncNRELXl4OL8K+L0SCeXpYlI=; b=uHJORfr/69XsQhyr0u05GHNp40u8XfP+hR9hkFfSyJYkNCjP3KYVZWk1y8/Crlf/1M Wyy7KBHbGjc5NeEIqBIuYdyDywoOpv4DIXPusBOO4h8YmiHg250BGZsM2EQn+zAOH4ug XdFtYH9tZw8eTB3hwJSCdV9ptwCSa2omuGKv1/RTPTYmZF9nlRanYRN0/sC5znW9Vb0f E8j9gAXxvXSAIf3JfuHwbon5gHnylBMGz1sPUVtn8rwWDtHgpOq18zktPjON7SAAth/P SnPFRtSjaZuOaPB5bF+E7vCUMvY0VuxIam0SNKaF7WoKmiclrJQ1vGh6O+frp7vV/mT+ pe+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IWyNDbBW; 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 r3-20020a170906a20300b009453c5875f6sor3768586ejy.25.2023.04.02.13.10.14 for (Google Transport Security); Sun, 02 Apr 2023 13:10:14 -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:ac1:b0:92d:9767:8e0a with SMTP id z1-20020a1709060ac100b0092d97678e0amr29588752ejf.13.1680466214662; Sun, 02 Apr 2023 13:10:14 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Apr 2023 13:10:14 -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 2/9] Input: edt-ft5x06 - remove unnecessary blank lines Date: Sun, 2 Apr 2023 22:09:44 +0200 Message-Id: <20230402200951.1032513-3-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=IWyNDbBW; 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: , It removes unnecessary blank lines so that checkpatch doesn't complain anymore. Signed-off-by: Dario Binacchi --- drivers/input/touchscreen/edt-ft5x06.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index daba6472fc65..c0ad3e4b6662 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -619,7 +619,6 @@ static void edt_ft5x06_restore_reg_parameters(struct edt_ft5x06_ts_data *tsdata) if (reg_addr->reg_report_rate != NO_REGISTER) edt_ft5x06_register_write(tsdata, reg_addr->reg_report_rate, tsdata->report_rate); - } #ifdef CONFIG_DEBUG_FS @@ -1459,7 +1458,6 @@ static int edt_ft5x06_ts_resume(struct device *dev) gpiod_set_value_cansleep(wake_gpio, 1); } - return ret; } From patchwork Sun Apr 2 20:09:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2844 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 59AFA3F330 for ; Sun, 2 Apr 2023 22:10:18 +0200 (CEST) Received: by mail-ed1-f72.google.com with SMTP id k14-20020a508ace000000b005024a8cef5csf27156171edk.22 for ; Sun, 02 Apr 2023 13:10:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680466218; cv=pass; d=google.com; s=arc-20160816; b=lumRY5JoLa9O1lN5zmnrQmBMrhVWr7LC4gHrHjIdoKhs7/CwmfjsN+pigZjVXXwRtA GpB2ks8MCO9ukgmSxSvjW+XgLGZ81qfH1DaZy7RiUBJZJ1sh7DxA+8xEYsu3Ve2g3UbT IMkQ7PdFSXJIvI4OyuITs7OBYKzgLQU85GuslyhalULZsRvHpP4sBN1N2rfvQ9qrZBGB 4HvC2cWPZJq5OaW2LSjaKfdojJkGLKoP9GXBsH5CNr7OD4vjtNM0TMqIrLv86pGZhy0a 1ULigYUxFb99O3f19VxEqXbYez6GS9CBeR6mxSLTp5mZYGDw049+tgPNsyOTeNrLbee1 GL4A== 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=mhxNIk0gaLHfotZ2jdrRQqdcmUd4thjZ2D0fT5EMYs0=; b=f1OVhO05KFDuhI6bNXZ1KEba3u1MczQRkM6mItpeo+Lii0EXe0CX+Z8VgY9jM0ML2o B1DKHSZoda0Y2j4fIuSIgKF75Cw5fXsJiu/S+jlQZurDQc0noJ51wxcqzKO/E6glsK+x ZHAgQ7pYSL9Vk0gqCoMDCzyIQBWoTQPd6NvKqnaPgH8pixrcT0Fd9Zo2tF0erLDfrjH0 v4Q+dyZMwKO9+ORfGrKmM4xWibhNgI5jP0771VYFUuoqhOvIzMocH3kKjcMQuFD4VamC A1fOnZR+LDkzWIVvtbyAZ4RXIAQBOuRpdoTTsg5gAbHKfEmmUatntoSGyp5I4dyHTJxX ySRA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Q7TzE39D; 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=1680466218; 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=mhxNIk0gaLHfotZ2jdrRQqdcmUd4thjZ2D0fT5EMYs0=; b=SlyI3sQWROrdF3tRsrHC4qNY7g8bd8Wy8MoEUJLC3R11L84DzMoefspIbQSEpxdWqp GJ7bzWjead/i822toZzaX1ma7hPmo4BnWfuvetWfX1NLZ78YPilFgXytBSppW0lpY5oS 6vC+xTrOg2OmWANmpQxyz2NpspLtLMl9lRG80= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680466218; 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=mhxNIk0gaLHfotZ2jdrRQqdcmUd4thjZ2D0fT5EMYs0=; b=IhGxJAEfPusi/bwQdj57WwtEVVafdsmcaBa6JgAnPhzrRE/NQqW2SO6Kvqwi1B+cJP zBr/Ll1Y6UAuJ0AXLMhUOhMhUa4kmrfFSUuSDTAn2D4gDT0K34+TuJhfj9Y4TXSD8tvY JhRZJxXym5P6q8/8Pgsd7qRjlYD84FxKj7Lm3ILkYlM6g6fbTOMfXfzewBE25IDMibCI 8ltc0JWLKAoNpFk+eAGV79zICKgnyCEXPEQ2lR2w2XfglLGiwqhWU8V/4i+nMdwAMqaR t6uV8xEPJKU/jxnDkn9uiwLIAC5sN7J7r9EL0/taxFSY+HKjri31FFpG/W/BOT9/LKNv JBBg== X-Gm-Message-State: AAQBX9crCvgXNu9raV1BDrvt75eqdU8IdIXSKXfQS++5g9j5S+jSEzmu uhRTOMqP9fY6AbrdaukLjn0VYi2p X-Google-Smtp-Source: AKy350YdA9LxIGUzsVkBpsOz2QMpQwXFmJ+rBIbwK/j3HnIVzyQzqfiKi1Ivad3PH0eGSfCdv0YV5Q== X-Received: by 2002:a17:906:3746:b0:8b1:cd2e:177a with SMTP id e6-20020a170906374600b008b1cd2e177amr16627817ejc.6.1680466217855; Sun, 02 Apr 2023 13:10:17 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:906:9f2a:b0:92a:da3e:a6b2 with SMTP id fy42-20020a1709069f2a00b0092ada3ea6b2ls4642858ejc.4.-pod-prod-gmail; Sun, 02 Apr 2023 13:10:16 -0700 (PDT) X-Received: by 2002:a17:907:16a6:b0:947:f4e2:aa2c with SMTP id hc38-20020a17090716a600b00947f4e2aa2cmr7227595ejc.29.1680466216477; Sun, 02 Apr 2023 13:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680466216; cv=none; d=google.com; s=arc-20160816; b=Eh1epgy3oGojZVweHY/QtkVrb7Ao4faTqV93veb1MLhJFe+rYYDQi4X7D8U7dQ+Y75 o34obw7uz7nUySKTN0oiiMQ8yz31E6Au0EFSEKDwtyHrgI4IEHazEocMnMsBjl4xzCar R9WwKMfKWuO+hMXnPiwLnVMKQUYRheZHMZFtLC0v5SOi+3j6QsiRKoWcIf2V4uxgZ4fH jBtFdxtQguUKxf65VL70o3+I03I5NSvpFvsIANhD4o+KSBsyabkXqQKwfUFz0ChvJbIS uCB5XJeUjzbr/MO2juc4m2hHcaRNbctYtnP/1lsGuXGSFdFFwNsVe96p4pBiXxwrkAu4 cdMg== 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=QYEoj3HNykDYYL4XbvupGelYH0ebBXdpkyODlCn0pFQ=; b=GXyDe057uljR+wPn4W5vOzccfb/TKkEEzB4obvdHwhQFrd1Ut0sKhVyCQpaE9Nhxbs DIjKszsSCD2GyjVx2goeYzVoJCvZItxCSfwc0cFI6L1lLATpunPeYGfKNkLDpSsWRB+T Zz1z/e+P5G/OWcUcfUbEAnqDsl9TO3Dts87wYyKAYNZVmAjBWsRawGep2A3MVf2NOnnq frvfb3ufsxAulb9xbCQEjGa85caWXgb5qJzQ+gOFEX/JsomKvrzN7EkMBUCtCQ9ToWrL j6rwOgj6eAYhssz+qNzgAkq4zSmokKTN7vanXoRisDBF0Gcg278HXEpxD0ZWO47ML9fx gusg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Q7TzE39D; 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 gx17-20020a170906f1d100b00931db712769sor3769581ejb.17.2023.04.02.13.10.16 for (Google Transport Security); Sun, 02 Apr 2023 13:10:16 -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:f754:b0:92e:fcc9:aa22 with SMTP id jp20-20020a170906f75400b0092efcc9aa22mr16072121ejb.37.1680466216192; Sun, 02 Apr 2023 13:10:16 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Apr 2023 13:10:15 -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 3/9] Input: edt-ft5x06 - add spaces to ensure format specification Date: Sun, 2 Apr 2023 22:09:45 +0200 Message-Id: <20230402200951.1032513-4-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=Q7TzE39D; 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: , It adds spaces around '-' as recommended by the Linux coding style. Signed-off-by: Dario Binacchi --- drivers/input/touchscreen/edt-ft5x06.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index c0ad3e4b6662..c96fe6520578 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -183,11 +183,11 @@ static bool edt_ft5x06_ts_check_crc(struct edt_ft5x06_ts_data *tsdata, for (i = 0; i < buflen - 1; i++) crc ^= buf[i]; - if (crc != buf[buflen-1]) { + if (crc != buf[buflen - 1]) { tsdata->crc_errors++; dev_err_ratelimited(&tsdata->client->dev, "crc error: 0x%02x expected, got 0x%02x\n", - crc, buf[buflen-1]); + crc, buf[buflen - 1]); return false; } 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; From patchwork Sun Apr 2 20:09:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2846 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 2B3193F330 for ; Sun, 2 Apr 2023 22:10:21 +0200 (CEST) Received: by mail-ed1-f70.google.com with SMTP id i42-20020a0564020f2a00b004fd23c238besf38021409eda.0 for ; Sun, 02 Apr 2023 13:10:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680466221; cv=pass; d=google.com; s=arc-20160816; b=I8bQMmX33ikLLMIFDsF4VlX+tSNIn5RY0VQQ7/Dsl+1mSM3x1CTraxKpVfsxbh9nUM mwEbBU4Mt01YPmDYW1I2wy1HOQ2IneA5CXOGTNReclxGy+YBPdU9NI+brQG3OVtOtsZJ xp8iK4aH9IFLSYyab5DTJd8ewMbd/MS9Hzsh2H3beRY4a0LX23J0OA8yTJPuAqxADFo+ 8Vvvw5VwBl92YsH9KDWwqEKQvHqQOM3rU5+CaB9/toTqlmEcWdV1tPE/ElPCGaQvlh9/ QcuYRVFlxhNi10lO3DKMLQUYS+decdMMhrawbnNHpkjuayDORS2fdbrll6m00f9djAXp oHVQ== 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=ISih8zdsGyxpopTYxP3z9LBrXfeNIL0/oKcuRUQMSKI=; b=OCddRT6fvjU02AGWj9XdOiHOWdtyzWHH63wL4KKuQAu7Pgage/zvQs6QJdsQCoaSbR qfe/XGpPhvfC4BKxufOHE64nRMzYLPDlz3lYCgF2Dinbr2faRXZ+8EeNbC8SBLUL7EZM EsqMSJsGh+3E3fKduREe7eSxM+IkElWnrbytUK29Eif5IbSaDd68VDC6+iAcY6mrf+02 GbdRxlBVA0yDb4OX675S5ueHK70Mjnlwe6YrxETa8phEt7gmQy+85bnVIpk8GkBTJOIr nte8mj5ofcX7owcNpj7z3kDmoqii7L6HJYDTdYyOHjrZJExmX0Ig/6FHSs2mS9f01jOU 0L+A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BTA0a7k7; 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=1680466221; 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=ISih8zdsGyxpopTYxP3z9LBrXfeNIL0/oKcuRUQMSKI=; b=GDIOFjww219RZuyEl34ikflmwYClu56knT3j56zuUsW+SfuuauU+Ifa0YNZ8sq6LcW SkGH2rd0QksmNAah6RkdnN7vCnNWwhIVMYx6YHPkGVrkGH32xR4VNvsSJZiSjnLNqWfU /ZXYmm1OqH/YIiMx5vP94E/IyrwFEXSRRHyzs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680466221; 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=ISih8zdsGyxpopTYxP3z9LBrXfeNIL0/oKcuRUQMSKI=; b=s/gUJDxV//GwPAOlQH8oaZ62sa6qxTYQM2RpSQlG8wqDI2ecBfAlC9K7kdCN8AhD7L nvLO2FNQsWDIbaFjNoPx1XPW+chmNQTbBO4PYDLXJqUM7qQ/8I4295aDRjm7yiDJLdL3 80jHqFtaQqARj0aFqYZ1xakOy8D2ra4Fuk28Y/orNS/6FC5ZmOGMwDKDg/AR4H6CvYHC Uvl3LEeTXieVagWnTnPOHJtVxDVQjiIx4JROATrlWegri0aZr+NHI2Klaqol2hz3GwZd K49bcIQB8gXUDvduxsYi5IUsLINeAx1olAw0qU/3zdeIyvfUDqqwTLp/EvRBilq/o0Hd ewfA== X-Gm-Message-State: AAQBX9clZ+xQO7mPg6xXewQJTqFqU+M6nMHPoypOtbmyLaKEhIVEgILH JaeZOL2cXKPCWX0fxT6tsWPmz1hk X-Google-Smtp-Source: AKy350YrCUVGxlMaCb7c1QGX0+oeWQD3giR5rae//AnCBVlcHiPUSu91/dRdyav09PPGu5GFxLvokg== X-Received: by 2002:a17:907:72d4:b0:930:310:abef with SMTP id du20-20020a17090772d400b009300310abefmr10078711ejc.3.1680466220927; Sun, 02 Apr 2023 13:10:20 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:3203:b0:502:26b1:64e0 with SMTP id g3-20020a056402320300b0050226b164e0ls6805047eda.1.-pod-prod-gmail; Sun, 02 Apr 2023 13:10:19 -0700 (PDT) X-Received: by 2002:a05:6402:2039:b0:502:61d8:233b with SMTP id ay25-20020a056402203900b0050261d8233bmr13878359edb.19.1680466219349; Sun, 02 Apr 2023 13:10:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680466219; cv=none; d=google.com; s=arc-20160816; b=kr1v5Wf1B69bJojejJ1kM6yH2qFREIHLX5PnNlBm4Wb9n9nHkfEGCyQB0fxoPyYC4Z L3cjWu7nOiKAwB2exvGohjlryr04PeR7PY0upMSH5rPHFxHmNXOLf8exTkaDcpfnywrs bUSY8XZA3aVhiSMAiCthDMpBAD/L+FomtXx+nt9Sn1CN5rZiLW5OS3vlCRONbjnSXZS8 25xJlJ7r5Xw4cIFeIVQYSBiCOw+LTlQU8W44s0cNixJv4WnUlVS0rO/L/wv5u+8biRgM ApiZvzLrZhJWGEshQ2MAHafG42R9Hwql+n5szxT+ZTpsbjFl+Huy7zp1Lq6asaceVfOo qqHA== 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=kMHERFML/oNzDxt2xRgB06w0p+QqR9zI3HtwO5KrpJg=; b=YoAnhSaeQpLJHUdplaGvzwNMRMZUjM+e/WW+B3opMeIJ631KlzpX8wmGAgqYiuCtMT W+0X4NQYRJbS6n5+F2T9VUc2XT1EixMcTiyrNXrUE/zaHTHxqcC3U5OccmbiPNVll3FQ P8uEuGmXQY47Ao4LDReU1SCl/am5ATZnT8EGgkRbgLRJbjgADzciJdhB0+cVb2wXpQ7O Cvn3iTVOHJFoCei0OKSrNZGJgxxy3NWWikb5mu2lllySlZlW6Wu9JxV1rnFlBuJRHbS9 38vaSPg9qkSEd8P2U78qtFVAf6NeQ9jQ9eaJRFloSbJlivVRzhGn8NWxW3S/ROQUXMTq qDqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BTA0a7k7; 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 lu20-20020a170906fad400b00947abb6b7c9sor3420703ejb.131.2023.04.02.13.10.19 for (Google Transport Security); Sun, 02 Apr 2023 13:10:19 -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:b049:b0:937:9a24:370b with SMTP id bj9-20020a170906b04900b009379a24370bmr34522323ejb.67.1680466219066; Sun, 02 Apr 2023 13:10:19 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Apr 2023 13:10:18 -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 5/9] Input: edt-ft5x06 - remove code duplication Date: Sun, 2 Apr 2023 22:09:47 +0200 Message-Id: <20230402200951.1032513-6-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=BTA0a7k7; 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: , The use of the macros M06_REG_ADDR and M06_REG_CMD avoids code duplication without impacting the application load, and reduces the chances of errors or mistakes. Signed-off-by: Dario Binacchi --- drivers/input/touchscreen/edt-ft5x06.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index d4f39724b259..7d82f412ab15 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -75,6 +75,9 @@ #define EDT_DEFAULT_NUM_X 1024 #define EDT_DEFAULT_NUM_Y 1024 +#define M06_REG_CMD(factory) ((factory) ? 0xf3 : 0xfc) +#define M06_REG_ADDR(factory, addr) ((factory) ? (addr) & 0x7f : (addr) & 0x3f) + enum edt_pmode { EDT_PMODE_NOT_SUPPORTED, EDT_PMODE_HIBERNATE, @@ -294,8 +297,8 @@ static int edt_ft5x06_register_write(struct edt_ft5x06_ts_data *tsdata, switch (tsdata->version) { case EDT_M06: - wrbuf[0] = tsdata->factory_mode ? 0xf3 : 0xfc; - wrbuf[1] = tsdata->factory_mode ? addr & 0x7f : addr & 0x3f; + wrbuf[0] = M06_REG_CMD(tsdata->factory_mode); + wrbuf[1] = M06_REG_ADDR(tsdata->factory_mode, addr); wrbuf[2] = value; wrbuf[3] = wrbuf[0] ^ wrbuf[1] ^ wrbuf[2]; return edt_ft5x06_ts_readwrite(tsdata->client, 4, @@ -324,8 +327,8 @@ static int edt_ft5x06_register_read(struct edt_ft5x06_ts_data *tsdata, switch (tsdata->version) { case EDT_M06: - wrbuf[0] = tsdata->factory_mode ? 0xf3 : 0xfc; - wrbuf[1] = tsdata->factory_mode ? addr & 0x7f : addr & 0x3f; + wrbuf[0] = M06_REG_CMD(tsdata->factory_mode); + wrbuf[1] = M06_REG_ADDR(tsdata->factory_mode, addr); wrbuf[1] |= tsdata->factory_mode ? 0x80 : 0x40; error = edt_ft5x06_ts_readwrite(tsdata->client, 2, wrbuf, 2, From patchwork Sun Apr 2 20:09:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2847 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 6F4DA3F330 for ; Sun, 2 Apr 2023 22:10:22 +0200 (CEST) Received: by mail-ed1-f72.google.com with SMTP id k14-20020a508ace000000b005024a8cef5csf27156291edk.22 for ; Sun, 02 Apr 2023 13:10:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680466222; cv=pass; d=google.com; s=arc-20160816; b=Q3XDY2KF3ZKyRtc3qgb5sO0lVcPPe1Sy87AsyeYLRHCZWSakelD3zjPBZeSxHHmdvh vqXRTDD6dz+/Uj8zkxKnpOLu4mtK2cEB6ctOxMDA9t6h+aViUYDHjAmK5SLxEQ6Zk70l 0oNzX6bRvQ8tbNyCXMMxQ0qpK0BW+AjijkAMqMbBY/hn9l7rAHaOFMtUjaJCdOcbx0jJ q2QT5cs2Ww0mO4Y+KmEIAOgWTg2Hxh9oa0uFDlpbyZ1JVjJ4sP1UHSpLy051g/4dJ9Oi 4ch4nwQRkSUmmL8U7JRGnXVgPftm04qcbZHoQ4r2y/hXMBFizsd/59fLkOmYvbu/64zL gqdw== 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=TypkBXEpN/Qi0dPDOjifdURsqyo87ormhD0UIWazweo=; b=M3vrovs6jB0BRXde3M2UPK5PjHvkUTNv2P4npJvj7Fa7C/I4ttejs2x3iurT85EmJL Meiy5GDUqr/k1ktdkNifLU5SHUggQ/VOVHjDn5rrLzmnLE3/EsyimhygkKpp171RLA0p U18Xo4b+Rg1ii65cnnhct2DVnkd27zSyyW4vHf09RmQVkaFc3v56+RF44VE15edAN7P2 hQV8EjPbiR9Ohhkm+SxtzqReYAdm0rPYqtOQxUVWrZX4rkF7w1Z0Fh/D2Dz0TafUtfwG EReJ303xScFV0Hmw+ZCPNAVY8rkQwQS6XHmD7xoAKyx2t5QXLMkMLR+upYYAB+6cEyw7 Jq1g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=O3nYWp+w; 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=1680466222; 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=TypkBXEpN/Qi0dPDOjifdURsqyo87ormhD0UIWazweo=; b=RyjjL4A54XKxsoPwU+lQW1QVrjbq4vVI9g3Cq6G05u/xxyH6w2BghVdGVYyLZDsjdG LUwCzerumtkVrgLRhm8IBsroMdjCpmKY1E5GpKDnLGgOFakgpeo7g+OovJOlkMCBnbex wTh31VYHTGWMgMm7BsIGLrBIk/kxNZLrW8Gak= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680466222; 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=TypkBXEpN/Qi0dPDOjifdURsqyo87ormhD0UIWazweo=; b=nV54TMpVoRCbpaSVowoBAB0zOV8K75WPzwsFV4pVOekLi3uiNeAMERTsUhmS4+dsy2 RWI855P4uZnei1WuTDlUOXkTNMyw9OnYiM59ix74SzY5i9abH6fRZRHa4ywt0bNkBCA0 vwJU+ZS5KY0EmOmGdb9gUpUgbEkRKEnBN3NhnEMbW1poL9Jpofh89o8eCr6cbImVVsVr IROeQJukzOClD2TvYAgvb/85ipFsmVILaDJg+jhTGQJ6EiXcANnOuEvoHLdlwRUvPN7o +EM2DUhuFVl5mkCRVqYe3tw8LZ/ZVEgJ5VeZZ0QMbvmw2EucwVzk7sFREF8bfENVHFgi ypBQ== X-Gm-Message-State: AAQBX9esLxW7xno/JzR+4nE8FtwS8o48xy3KCPqsyzPEX4WgUesev3vj txU000yoCGvdspdH6wTdCUb7L8+4 X-Google-Smtp-Source: AKy350YJNFpHvRgtf1ZpmQgBSDO4ktFYnGcIB5FQBWGnKryVcvKII3qLzCSLPkntVuI3mIIbfjctFw== X-Received: by 2002:a50:f692:0:b0:4fc:fc86:5f76 with SMTP id d18-20020a50f692000000b004fcfc865f76mr16921898edn.6.1680466222284; Sun, 02 Apr 2023 13:10:22 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:36e:b0:502:9d37:a300 with SMTP id s14-20020a056402036e00b005029d37a300ls1107808edw.0.-pod-prod-gmail; Sun, 02 Apr 2023 13:10:21 -0700 (PDT) X-Received: by 2002:a05:6402:1641:b0:4fb:953d:c3d0 with SMTP id s1-20020a056402164100b004fb953dc3d0mr30613991edx.20.1680466220787; Sun, 02 Apr 2023 13:10:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680466220; cv=none; d=google.com; s=arc-20160816; b=SDLGwoRFBV0s67oX0qDPvPdjnCvOH8ke8pEYqf0tnRfsSFRU7ya6746XtYkAzszX07 eWTX/MEX8MCzy1vf7iScWvs0tgHBcNFGcxanRTO9ZhfHffzH6yovhrZSCjU0SqDM+uKY wcyLpaU32KWLVirRzqwjZfp6p7mu06svIdXwwSpFKHZgZDQcx3WfvXSBrPei+Y4TncHk 12+eUWvjzR0s0G4PbRnNbn2ZWXcbZDFlW92lECwEwukBOh4Vaz9vZDfXH7V7s+KcrGF8 i/oJ9fVv8Hg6Dh0BUBrnF7Is8QRRZKsHhdSCgP6Mq6rF+3i/iFFWY4y6EwPA4ku8Vmrs o4iQ== 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=AFjm9UZOr4B7pRsXgqjvbVyzqWT97tUm8W06JvPbgKQ=; b=Ky1NSmaU57tIl5e2svVUcgRH8CvhH9C0LBSPboZA7ywz5o19PLzy7Jo/c+q1k9j9E1 B12oQ17RN3fosUvHSY0rvP0cy2nHb1Fs9x7GpBmW70nk0oKXQSLpaEkYxN/RBdpj0xV+ sgKkAGYG+T8IP8DxxcnJhpI3daKPh+ouJV2sX74pyiaR91FctEIPAqzk/P/vmBcJ/Ymd pTgmX9b64wjmYU39/fZeC3Clan/NLhhIHjAmRH1/zbTDxLbovf2jTiFzS7TBP5HrqLSI ccmS+b+bwe9XLyBXuOao5lZcwF5wNtYSTjrACS3ckcBR4QNos+Ajcm8I/jHzSP1A6rPO iedA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=O3nYWp+w; 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 k20-20020a1709061c1400b0093994122ec9sor4117394ejg.132.2023.04.02.13.10.20 for (Google Transport Security); Sun, 02 Apr 2023 13:10:20 -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:907:84a:b0:947:87a2:31d7 with SMTP id ww10-20020a170907084a00b0094787a231d7mr13489859ejb.33.1680466220561; Sun, 02 Apr 2023 13:10:20 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Apr 2023 13:10:20 -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 6/9] Input: edt-ft5x06 - don't print error messages with dev_dbg() Date: Sun, 2 Apr 2023 22:09:48 +0200 Message-Id: <20230402200951.1032513-7-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=O3nYWp+w; 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: , In some parts of the code, error messages were improperly printed with dev_dbg() calls. In those cases, dev_dbg() has been replaced with dev_err(). Signed-off-by: Dario Binacchi --- drivers/input/touchscreen/edt-ft5x06.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index 7d82f412ab15..89958881fca1 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -783,7 +783,7 @@ static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file, error = edt_ft5x06_register_write(tsdata, 0x08, 0x01); if (error) { - dev_dbg(&client->dev, + dev_err(&client->dev, "failed to write 0x08 register, error %d\n", error); goto out; } @@ -797,13 +797,13 @@ static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file, if (val < 0) { error = val; - dev_dbg(&client->dev, + dev_err(&client->dev, "failed to read 0x08 register, error %d\n", error); goto out; } if (retries == 0) { - dev_dbg(&client->dev, + dev_err(&client->dev, "timed out waiting for register to settle\n"); error = -ETIMEDOUT; goto out; From patchwork Sun Apr 2 20:09:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2848 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 5DCA73F330 for ; Sun, 2 Apr 2023 22:10:24 +0200 (CEST) Received: by mail-ed1-f70.google.com with SMTP id s30-20020a508d1e000000b005005cf48a93sf37829543eds.8 for ; Sun, 02 Apr 2023 13:10:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680466224; cv=pass; d=google.com; s=arc-20160816; b=Bps75QYNnIZMx7Ek750Ykfy3OpTvKEOkhRM0mlRU1KzVZRnvn+qPo9NxPXBO8oEo2L W8MNZT179KgCtKIMZ19dTVAnBSoxnn1LTYmBA/B3t7/TLaFXZ+6nC4swR9W6q355ruu0 lIkZXurRRW7rlCGcXVYVPRVYIc9fBBVlmi1rlddtIy8hTLeP1K0i/6340vIJBmYjY49v QI3EGJLbgkyNKUYn06JqBGmMyPZFXtxDwORtVbRTEkvlcXrMVMLQTqtTlaWMUkfVOBoJ lYUI+dK1WCSVi0aWwK5PFFk3wsf0+T2tQnBqfXYauZsS8It3asLPpObEJBd+VmlwtuWn NWUw== 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:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vrOO2e46RrP0H13booeVfhmm5etP8xOicMD2/Ut/fqk=; b=hfpLkNrlbpQbn0FbUMdIIORIsMgwEG9iokZLbHLirtgWLode0cE9jLxbwq6Kva4R6f BY6sGvDIJ5UzC87SyhXoxxw2Z8xRqLRmSl3WkB4mqniTJP7JqKvC0TMoiXfW6HgHxBsV +LS5A4EIQvaB/l4dCHOzFhsyfUNny1+ujAMvuYwg7Knv16/Ja13F7s8XbSo0/K+Xcz3W SzcsRhRBmRQS4F5k2cbJscMfGKM8zqQouHDMCoH/ZWd33KaOZMoU3DOpCmUS/adOpJWy 0fK2ZDz5+UcmWW0hpeyNYdhv1GEKgzOh1N0NYrwD2qSCIhF4S2LhF8sjDUfSyK58UtSL jeHQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=g9Tvx9lk; 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=1680466224; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=vrOO2e46RrP0H13booeVfhmm5etP8xOicMD2/Ut/fqk=; b=ga4Any9f4otXHONrdSEdJ0vKRM9Q7o7eSWrWb1oXB8lPDv+svT2ZymlXVjD8xd0emw 5ea95E0N3RlWwqlvKWKys1ANEoRedEf6vZoz6E0RG21rdrHMMdE16lY77rQuuz1gM9je i8PYOJ9GUxwEmRzHpNTNeDh9F+K1noLUOql2A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680466224; 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 :content-transfer-encoding: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=vrOO2e46RrP0H13booeVfhmm5etP8xOicMD2/Ut/fqk=; b=cf/b4d1CYTbSrR7SWb5k7kElINsCV2/uGvEBjwqq70+28tv+7EFQHIAdUwaSIQ30P+ FVeNcuL+oQErGCMer3WTUZ1tnP/S0y/yG7+WHzC1VXxY/oBY+plK7Om+QmQrZ1XcW9C2 nEdxODgnxzw1gHEH0LMyBx3/KjjW91hRLXD+jjZ6V/n7MPLj6n2G8y93aushC75PN5gn UhQy99EXoo0LxqleNEIhdJqECBsYIPVjEDxeDRTJ7AFSWLu+tjuraTpcqUYu2o8MKdgs 16IHZNCBQz7l4h/zsoLAxnevFOLuv6BkG0fWAkxpvEky31UwWCvUg74gzGGXvGVUuhle MLkQ== X-Gm-Message-State: AAQBX9fHToIczGGe+Y53oylLqb5AkoCl67sijRKzWN6/uREdhEb1I9gH 9HwtEryW899lmJdifMaXsRIjMvDR X-Google-Smtp-Source: AKy350YnEf41mEbem1kFE12FPXFH3iao6Z664zrUU4ghTvoTDG3z0pVyFIirsKwKj/SGqxenynDLzg== X-Received: by 2002:a17:906:8454:b0:931:6a82:ff26 with SMTP id e20-20020a170906845400b009316a82ff26mr17830396ejy.7.1680466223901; Sun, 02 Apr 2023 13:10:23 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:3203:b0:502:26b1:64e0 with SMTP id g3-20020a056402320300b0050226b164e0ls6805092eda.1.-pod-prod-gmail; Sun, 02 Apr 2023 13:10:22 -0700 (PDT) X-Received: by 2002:aa7:db4c:0:b0:502:9a5b:d2c with SMTP id n12-20020aa7db4c000000b005029a5b0d2cmr2367313edt.36.1680466222417; Sun, 02 Apr 2023 13:10:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680466222; cv=none; d=google.com; s=arc-20160816; b=q+w8TFc3P98FWbGOOos4+hIefFwDo+Yl5/EvSj7zt8Uaj5QFeCilooyIYOq1AiH4X7 IfNcqW2zwZ8t9oveaNFeubYO+V4aKmLBXb+ToirNlNbZozZyC7GPBFLlFl7xwg0aePoq njTlSSvGfFur1y6K6xNBoPTckH7xW3wQQs7+6cgWmxaLgCGSRSblmcUJZw4C0hvOTTvk /6iTR0Kb+cPHGEvgnaeW5bcp6/4/gmfXIjiwiwzqWOYkDV2gPSzoLimaiLiNPgZufanR FbdbVJzHW0gVyQOhwctQihnjD6BieHQHYByOuE8GOEbhAO3uEeD+q8BzYlhufXWtzB8q eVnw== 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=JemIGhtdjG/TbtBcp8w+D7hK3pU2u0hM7wK5kdSBVec=; b=UlWSrtS2uIB8znHVZ1WIyjG5v1r0ZHD9fwPfraZNeqBT2+jadWkvsejnefkUXXaHiE a1RN7Ij75FgmShBnfKE5il2yVuSHVO5hkUZ0dl+HQfmJ6io9VGq6Vw1HT8gubAicTWEx 7L/3knhGtUIg35O3+gpq7KhuDbXoMqhUyb/19WXQpw0ULyTa9joMw0Gj8EYqPwV9lzOS kRGKMCo5Ao0HKCsFxsd6qggiiiWC+xw1klFwTn/8SGHlBLysZxbKdYdxXN9dMcZLkzV7 TAJUsy6wvLfIzFXJ9/cJwkkxMnX+EDLS+jwXCRjqO3R6WTroBAjt0hUdVuz98ZsSvYAh +T/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=g9Tvx9lk; 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 h5-20020a50c385000000b005021ac54ceasor3380451edf.6.2023.04.02.13.10.22 for (Google Transport Security); Sun, 02 Apr 2023 13:10:22 -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:a05:6402:450:b0:4fa:e8f3:9685 with SMTP id p16-20020a056402045000b004fae8f39685mr31991889edw.28.1680466222111; Sun, 02 Apr 2023 13:10:22 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Apr 2023 13:10:21 -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 7/9] Input: edt-ft5x06 - convert to use regmap API Date: Sun, 2 Apr 2023 22:09:49 +0200 Message-Id: <20230402200951.1032513-8-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 Content-Type: text/plain; charset="UTF-8" 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=g9Tvx9lk; 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 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: , It replaces custom read/write functions with regmap API, making the driver code more generic. Signed-off-by: Dario Binacchi --- drivers/input/touchscreen/edt-ft5x06.c | 424 +++++++++++++------------ 1 file changed, 214 insertions(+), 210 deletions(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index 89958881fca1..8aae4c1e6b73 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -3,6 +3,7 @@ * Copyright (C) 2012 Simon Budig, * Daniel Wagener (M09 firmware support) * Lothar Waßmann (DT support) + * Dario Binacchi (regmap support) */ /* @@ -26,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -115,6 +117,8 @@ struct edt_ft5x06_ts_data { struct gpio_desc *reset_gpio; struct gpio_desc *wake_gpio; + struct regmap *regmap; + #if defined(CONFIG_DEBUG_FS) struct dentry *debug_dir; u8 *raw_buffer; @@ -145,37 +149,10 @@ struct edt_i2c_chip_data { int max_support_points; }; -static int edt_ft5x06_ts_readwrite(struct i2c_client *client, - u16 wr_len, u8 *wr_buf, - u16 rd_len, u8 *rd_buf) -{ - struct i2c_msg wrmsg[2]; - int i = 0; - int ret; - - if (wr_len) { - wrmsg[i].addr = client->addr; - wrmsg[i].flags = 0; - wrmsg[i].len = wr_len; - wrmsg[i].buf = wr_buf; - i++; - } - if (rd_len) { - wrmsg[i].addr = client->addr; - wrmsg[i].flags = I2C_M_RD; - wrmsg[i].len = rd_len; - wrmsg[i].buf = rd_buf; - i++; - } - - ret = i2c_transfer(client->adapter, wrmsg, i); - if (ret < 0) - return ret; - if (ret != i) - return -EIO; - - return 0; -} +static const struct regmap_config edt_ft5x06_i2c_regmap_config = { + .reg_bits = 8, + .val_bits = 8, +}; static bool edt_ft5x06_ts_check_crc(struct edt_ft5x06_ts_data *tsdata, u8 *buf, int buflen) @@ -197,6 +174,127 @@ static bool edt_ft5x06_ts_check_crc(struct edt_ft5x06_ts_data *tsdata, return true; } +static int edt_M06_i2c_read(void *context, const void *reg_buf, size_t reg_size, + void *val_buf, size_t val_size) +{ + struct device *dev = context; + struct i2c_client *i2c = to_i2c_client(dev); + struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(i2c); + struct i2c_msg xfer[2]; + bool reg_read = false; + u8 addr; + u8 wlen; + u8 wbuf[4], rbuf[3]; + int ret; + + addr = *((u8 *)reg_buf); + wbuf[0] = addr; + switch (addr) { + case 0xf5: + wlen = 3; + wbuf[0] = 0xf5; + wbuf[1] = 0xe; + wbuf[2] = *((u8 *)val_buf); + break; + case 0xf9: + wlen = 1; + break; + default: + wlen = 2; + reg_read = true; + wbuf[0] = M06_REG_CMD(tsdata->factory_mode); + wbuf[1] = M06_REG_ADDR(tsdata->factory_mode, addr); + wbuf[1] |= tsdata->factory_mode ? 0x80 : 0x40; + } + + xfer[0].addr = i2c->addr; + xfer[0].flags = 0; + xfer[0].len = wlen; + xfer[0].buf = wbuf; + + xfer[1].addr = i2c->addr; + xfer[1].flags = I2C_M_RD; + xfer[1].len = reg_read ? 2 : val_size; + xfer[1].buf = reg_read ? rbuf : val_buf; + + ret = i2c_transfer(i2c->adapter, xfer, 2); + if (ret != 2) { + if (ret < 0) + return ret; + + return -EIO; + } + + if (addr == 0xf9) { + u8 *buf = (u8 *)val_buf; + + if (buf[0] != 0xaa || buf[1] != 0xaa || + buf[2] != val_size) { + tsdata->header_errors++; + dev_err_ratelimited(dev, + "Unexpected header: %02x%02x%02x\n", + buf[0], buf[1], buf[2]); + return -EIO; + } + + if (!edt_ft5x06_ts_check_crc(tsdata, val_buf, val_size)) + return -EIO; + } else if (reg_read) { + u8 crc = wbuf[0] ^ wbuf[1] ^ rbuf[0]; + + if (crc != rbuf[1]) { + dev_err(dev, "crc error: 0x%02x expected, got 0x%02x\n", + crc, rbuf[1]); + return -EIO; + } + + *((u8 *)val_buf) = rbuf[0]; + } + + return 0; +} + +static int edt_M06_i2c_write(void *context, const void *data, size_t count) +{ + struct device *dev = context; + struct i2c_client *i2c = to_i2c_client(dev); + struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(i2c); + u8 addr, val; + u8 wbuf[4]; + struct i2c_msg xfer; + int ret; + + addr = *((u8 *)data); + val = *((u8 *)data + 1); + + wbuf[0] = M06_REG_CMD(tsdata->factory_mode); + wbuf[1] = M06_REG_ADDR(tsdata->factory_mode, addr); + wbuf[2] = val; + wbuf[3] = wbuf[0] ^ wbuf[1] ^ wbuf[2]; + + xfer.addr = i2c->addr; + xfer.flags = 0; + xfer.len = 4; + xfer.buf = wbuf; + + ret = i2c_transfer(i2c->adapter, &xfer, 1); + if (ret != 1) { + if (ret < 0) + return ret; + + return -EIO; + } + + return 0; +} + +static const struct regmap_config edt_M06_i2c_regmap_config = { + .reg_bits = 8, + .val_bits = 8, + .read = edt_M06_i2c_read, + .write = edt_M06_i2c_write, +}; + static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id) { struct edt_ft5x06_ts_data *tsdata = dev_id; @@ -232,30 +330,13 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id) memset(rdbuf, 0, sizeof(rdbuf)); datalen = tplen * tsdata->max_support_points + offset + crclen; - error = edt_ft5x06_ts_readwrite(tsdata->client, - sizeof(cmd), &cmd, - datalen, rdbuf); + error = regmap_bulk_read(tsdata->regmap, cmd, rdbuf, datalen); if (error) { dev_err_ratelimited(dev, "Unable to fetch data, error: %d\n", error); goto out; } - /* M09/M12 does not send header or CRC */ - if (tsdata->version == EDT_M06) { - if (rdbuf[0] != 0xaa || rdbuf[1] != 0xaa || - rdbuf[2] != datalen) { - tsdata->header_errors++; - dev_err_ratelimited(dev, - "Unexpected header: %02x%02x%02x!\n", - rdbuf[0], rdbuf[1], rdbuf[2]); - goto out; - } - - if (!edt_ft5x06_ts_check_crc(tsdata, rdbuf, datalen)) - goto out; - } - for (i = 0; i < tsdata->max_support_points; i++) { u8 *buf = &rdbuf[i * tplen + offset]; @@ -290,79 +371,6 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id) return IRQ_HANDLED; } -static int edt_ft5x06_register_write(struct edt_ft5x06_ts_data *tsdata, - u8 addr, u8 value) -{ - u8 wrbuf[4]; - - switch (tsdata->version) { - case EDT_M06: - wrbuf[0] = M06_REG_CMD(tsdata->factory_mode); - wrbuf[1] = M06_REG_ADDR(tsdata->factory_mode, addr); - wrbuf[2] = value; - wrbuf[3] = wrbuf[0] ^ wrbuf[1] ^ wrbuf[2]; - return edt_ft5x06_ts_readwrite(tsdata->client, 4, - wrbuf, 0, NULL); - - case EDT_M09: - case EDT_M12: - case EV_FT: - case GENERIC_FT: - wrbuf[0] = addr; - wrbuf[1] = value; - - return edt_ft5x06_ts_readwrite(tsdata->client, 2, - wrbuf, 0, NULL); - - default: - return -EINVAL; - } -} - -static int edt_ft5x06_register_read(struct edt_ft5x06_ts_data *tsdata, - u8 addr) -{ - u8 wrbuf[2], rdbuf[2], crc; - int error; - - switch (tsdata->version) { - case EDT_M06: - wrbuf[0] = M06_REG_CMD(tsdata->factory_mode); - wrbuf[1] = M06_REG_ADDR(tsdata->factory_mode, addr); - wrbuf[1] |= tsdata->factory_mode ? 0x80 : 0x40; - - error = edt_ft5x06_ts_readwrite(tsdata->client, 2, wrbuf, 2, - rdbuf); - if (error) - return error; - - 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", - crc, rdbuf[1]); - return -EIO; - } - break; - - case EDT_M09: - case EDT_M12: - case EV_FT: - case GENERIC_FT: - wrbuf[0] = addr; - error = edt_ft5x06_ts_readwrite(tsdata->client, 1, - wrbuf, 1, rdbuf); - if (error) - return error; - break; - - default: - return -EINVAL; - } - - return rdbuf[0]; -} - struct edt_ft5x06_attribute { struct device_attribute dattr; size_t field_offset; @@ -396,7 +404,7 @@ static ssize_t edt_ft5x06_setting_show(struct device *dev, struct edt_ft5x06_attribute *attr = container_of(dattr, struct edt_ft5x06_attribute, dattr); u8 *field = (u8 *)tsdata + attr->field_offset; - int val; + unsigned int val; size_t count = 0; int error = 0; u8 addr; @@ -429,9 +437,8 @@ static ssize_t edt_ft5x06_setting_show(struct device *dev, } if (addr != NO_REGISTER) { - val = edt_ft5x06_register_read(tsdata, addr); - if (val < 0) { - error = val; + error = regmap_read(tsdata->regmap, addr, &val); + if (error) { dev_err(&tsdata->client->dev, "Failed to fetch attribute %s, error %d\n", dattr->attr.name, error); @@ -504,7 +511,7 @@ static ssize_t edt_ft5x06_setting_store(struct device *dev, } if (addr != NO_REGISTER) { - error = edt_ft5x06_register_write(tsdata, addr, val); + error = regmap_write(tsdata->regmap, addr, val); if (error) { dev_err(&tsdata->client->dev, "Failed to update attribute %s, error: %d\n", @@ -605,23 +612,19 @@ static const struct attribute_group edt_ft5x06_attr_group = { static void edt_ft5x06_restore_reg_parameters(struct edt_ft5x06_ts_data *tsdata) { struct edt_reg_addr *reg_addr = &tsdata->reg_addr; + struct regmap *regmap = tsdata->regmap; - edt_ft5x06_register_write(tsdata, reg_addr->reg_threshold, - tsdata->threshold); - edt_ft5x06_register_write(tsdata, reg_addr->reg_gain, - tsdata->gain); + regmap_write(regmap, reg_addr->reg_threshold, tsdata->threshold); + regmap_write(regmap, reg_addr->reg_gain, tsdata->gain); if (reg_addr->reg_offset != NO_REGISTER) - edt_ft5x06_register_write(tsdata, reg_addr->reg_offset, - tsdata->offset); + regmap_write(regmap, reg_addr->reg_offset, tsdata->offset); if (reg_addr->reg_offset_x != NO_REGISTER) - edt_ft5x06_register_write(tsdata, reg_addr->reg_offset_x, - tsdata->offset_x); + regmap_write(regmap, reg_addr->reg_offset_x, tsdata->offset_x); if (reg_addr->reg_offset_y != NO_REGISTER) - edt_ft5x06_register_write(tsdata, reg_addr->reg_offset_y, - tsdata->offset_y); + regmap_write(regmap, reg_addr->reg_offset_y, tsdata->offset_y); if (reg_addr->reg_report_rate != NO_REGISTER) - edt_ft5x06_register_write(tsdata, reg_addr->reg_report_rate, - tsdata->report_rate); + regmap_write(regmap, reg_addr->reg_report_rate, + tsdata->report_rate); } #ifdef CONFIG_DEBUG_FS @@ -629,7 +632,7 @@ static int edt_ft5x06_factory_mode(struct edt_ft5x06_ts_data *tsdata) { struct i2c_client *client = tsdata->client; int retries = EDT_SWITCH_MODE_RETRIES; - int ret; + unsigned int val; int error; if (tsdata->version != EDT_M06) { @@ -651,7 +654,7 @@ static int edt_ft5x06_factory_mode(struct edt_ft5x06_ts_data *tsdata) } /* mode register is 0x3c when in the work mode */ - error = edt_ft5x06_register_write(tsdata, WORK_REGISTER_OPMODE, 0x03); + error = regmap_write(tsdata->regmap, WORK_REGISTER_OPMODE, 0x03); if (error) { dev_err(&client->dev, "failed to switch to factory mode, error %d\n", error); @@ -662,8 +665,9 @@ static int edt_ft5x06_factory_mode(struct edt_ft5x06_ts_data *tsdata) do { mdelay(EDT_SWITCH_MODE_DELAY); /* mode register is 0x01 when in factory mode */ - ret = edt_ft5x06_register_read(tsdata, FACTORY_REGISTER_OPMODE); - if (ret == 0x03) + error = regmap_read(tsdata->regmap, FACTORY_REGISTER_OPMODE, + &val); + if (!error && val == 0x03) break; } while (--retries > 0); @@ -689,11 +693,11 @@ static int edt_ft5x06_work_mode(struct edt_ft5x06_ts_data *tsdata) { struct i2c_client *client = tsdata->client; int retries = EDT_SWITCH_MODE_RETRIES; - int ret; + unsigned int val; int error; /* mode register is 0x01 when in the factory mode */ - error = edt_ft5x06_register_write(tsdata, FACTORY_REGISTER_OPMODE, 0x1); + error = regmap_write(tsdata->regmap, FACTORY_REGISTER_OPMODE, 0x1); if (error) { dev_err(&client->dev, "failed to switch to work mode, error: %d\n", error); @@ -705,8 +709,8 @@ static int edt_ft5x06_work_mode(struct edt_ft5x06_ts_data *tsdata) do { mdelay(EDT_SWITCH_MODE_DELAY); /* mode register is 0x01 when in factory mode */ - ret = edt_ft5x06_register_read(tsdata, WORK_REGISTER_OPMODE); - if (ret == 0x01) + error = regmap_read(tsdata->regmap, WORK_REGISTER_OPMODE, &val); + if (!error && val == 0x01) break; } while (--retries > 0); @@ -765,10 +769,10 @@ static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file, struct edt_ft5x06_ts_data *tsdata = file->private_data; struct i2c_client *client = tsdata->client; int retries = EDT_RAW_DATA_RETRIES; - int val, i, error; + unsigned int val; + int i, error; size_t read = 0; int colbytes; - char wrbuf[3]; u8 *rdbuf; if (*off < 0 || *off >= tsdata->raw_bufsize) @@ -781,7 +785,7 @@ static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file, goto out; } - error = edt_ft5x06_register_write(tsdata, 0x08, 0x01); + error = regmap_write(tsdata->regmap, 0x08, 0x01); if (error) { dev_err(&client->dev, "failed to write 0x08 register, error %d\n", error); @@ -790,18 +794,18 @@ static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file, do { usleep_range(EDT_RAW_DATA_DELAY, EDT_RAW_DATA_DELAY + 100); - val = edt_ft5x06_register_read(tsdata, 0x08); - if (val < 1) + error = regmap_read(tsdata->regmap, 0x08, &val); + if (error) { + dev_err(&client->dev, + "failed to read 0x08 register, error %d\n", + error); + goto out; + } + + if (val == 1) break; } while (--retries > 0); - if (val < 0) { - error = val; - dev_err(&client->dev, - "failed to read 0x08 register, error %d\n", error); - goto out; - } - if (retries == 0) { dev_err(&client->dev, "timed out waiting for register to settle\n"); @@ -812,13 +816,9 @@ static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file, rdbuf = tsdata->raw_buffer; colbytes = tsdata->num_y * sizeof(u16); - wrbuf[0] = 0xf5; - wrbuf[1] = 0x0e; for (i = 0; i < tsdata->num_x; i++) { - wrbuf[2] = i; /* column index */ - error = edt_ft5x06_ts_readwrite(tsdata->client, - sizeof(wrbuf), wrbuf, - colbytes, rdbuf); + rdbuf[0] = i; /* column index */ + error = regmap_bulk_read(tsdata->regmap, 0xf5, rdbuf, colbytes); if (error) goto out; @@ -894,8 +894,7 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client, * to have garbage in there */ memset(rdbuf, 0, sizeof(rdbuf)); - error = edt_ft5x06_ts_readwrite(client, 1, "\xBB", - EDT_NAME_LEN - 1, rdbuf); + error = regmap_bulk_read(tsdata->regmap, 0xBB, rdbuf, EDT_NAME_LEN - 1); if (error) return error; @@ -917,6 +916,14 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client, *p++ = '\0'; strscpy(model_name, rdbuf + 1, EDT_NAME_LEN); strscpy(fw_version, p ? p : "", EDT_NAME_LEN); + + regmap_exit(tsdata->regmap); + tsdata->regmap = regmap_init_i2c(client, + &edt_M06_i2c_regmap_config); + if (IS_ERR(tsdata->regmap)) { + dev_err(&client->dev, "regmap allocation failed\n"); + return PTR_ERR(tsdata->regmap); + } } else if (!strncasecmp(rdbuf, "EP0", 3)) { tsdata->version = EDT_M12; @@ -943,15 +950,13 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client, */ tsdata->version = GENERIC_FT; - error = edt_ft5x06_ts_readwrite(client, 1, "\xA6", - 2, rdbuf); + error = regmap_bulk_read(tsdata->regmap, 0xA6, rdbuf, 2); if (error) return error; strscpy(fw_version, rdbuf, 2); - error = edt_ft5x06_ts_readwrite(client, 1, "\xA8", - 1, rdbuf); + error = regmap_bulk_read(tsdata->regmap, 0xA8, rdbuf, 1); if (error) return error; @@ -980,8 +985,7 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client, break; case 0x59: /* Evervision Display with FT5xx6 TS */ tsdata->version = EV_FT; - error = edt_ft5x06_ts_readwrite(client, 1, "\x53", - 1, rdbuf); + error = regmap_bulk_read(tsdata->regmap, 0x53, rdbuf, 1); if (error) return error; strscpy(fw_version, rdbuf, 1); @@ -1003,42 +1007,40 @@ static void edt_ft5x06_ts_get_defaults(struct device *dev, struct edt_ft5x06_ts_data *tsdata) { struct edt_reg_addr *reg_addr = &tsdata->reg_addr; + struct regmap *regmap = tsdata->regmap; u32 val; int error; error = device_property_read_u32(dev, "threshold", &val); if (!error) { - edt_ft5x06_register_write(tsdata, reg_addr->reg_threshold, val); + regmap_write(regmap, reg_addr->reg_threshold, val); tsdata->threshold = val; } error = device_property_read_u32(dev, "gain", &val); if (!error) { - edt_ft5x06_register_write(tsdata, reg_addr->reg_gain, val); + regmap_write(regmap, reg_addr->reg_gain, val); tsdata->gain = val; } error = device_property_read_u32(dev, "offset", &val); if (!error) { if (reg_addr->reg_offset != NO_REGISTER) - edt_ft5x06_register_write(tsdata, - reg_addr->reg_offset, val); + regmap_write(regmap, reg_addr->reg_offset, val); tsdata->offset = val; } error = device_property_read_u32(dev, "offset-x", &val); if (!error) { if (reg_addr->reg_offset_x != NO_REGISTER) - edt_ft5x06_register_write(tsdata, - reg_addr->reg_offset_x, val); + regmap_write(regmap, reg_addr->reg_offset_x, val); tsdata->offset_x = val; } error = device_property_read_u32(dev, "offset-y", &val); if (!error) { if (reg_addr->reg_offset_y != NO_REGISTER) - edt_ft5x06_register_write(tsdata, - reg_addr->reg_offset_y, val); + regmap_write(regmap, reg_addr->reg_offset_y, val); tsdata->offset_y = val; } } @@ -1046,33 +1048,30 @@ static void edt_ft5x06_ts_get_defaults(struct device *dev, static void edt_ft5x06_ts_get_parameters(struct edt_ft5x06_ts_data *tsdata) { struct edt_reg_addr *reg_addr = &tsdata->reg_addr; + struct regmap *regmap = tsdata->regmap; + unsigned int val; - tsdata->threshold = edt_ft5x06_register_read(tsdata, - reg_addr->reg_threshold); - tsdata->gain = edt_ft5x06_register_read(tsdata, reg_addr->reg_gain); + regmap_read(regmap, reg_addr->reg_threshold, &tsdata->threshold); + regmap_read(regmap, reg_addr->reg_gain, &tsdata->gain); if (reg_addr->reg_offset != NO_REGISTER) - tsdata->offset = - edt_ft5x06_register_read(tsdata, reg_addr->reg_offset); + regmap_read(regmap, reg_addr->reg_offset, &tsdata->offset); if (reg_addr->reg_offset_x != NO_REGISTER) - tsdata->offset_x = - edt_ft5x06_register_read(tsdata, - reg_addr->reg_offset_x); + regmap_read(regmap, reg_addr->reg_offset_x, &tsdata->offset_x); if (reg_addr->reg_offset_y != NO_REGISTER) - tsdata->offset_y = - edt_ft5x06_register_read(tsdata, - reg_addr->reg_offset_y); + regmap_read(regmap, reg_addr->reg_offset_y, &tsdata->offset_y); if (reg_addr->reg_report_rate != NO_REGISTER) - tsdata->report_rate = - edt_ft5x06_register_read(tsdata, - reg_addr->reg_report_rate); + regmap_read(regmap, reg_addr->reg_report_rate, + &tsdata->report_rate); tsdata->num_x = EDT_DEFAULT_NUM_X; - if (reg_addr->reg_num_x != NO_REGISTER) - tsdata->num_x = edt_ft5x06_register_read(tsdata, - reg_addr->reg_num_x); + if (reg_addr->reg_num_x != NO_REGISTER) { + if (!regmap_read(regmap, reg_addr->reg_num_x, &val)) + tsdata->num_x = val; + } tsdata->num_y = EDT_DEFAULT_NUM_Y; - if (reg_addr->reg_num_y != NO_REGISTER) - tsdata->num_y = edt_ft5x06_register_read(tsdata, - reg_addr->reg_num_y); + if (reg_addr->reg_num_y != NO_REGISTER) { + if (!regmap_read(regmap, reg_addr->reg_num_y, &val)) + tsdata->num_y = val; + } } static void edt_ft5x06_ts_set_regs(struct edt_ft5x06_ts_data *tsdata) @@ -1142,7 +1141,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client) const struct i2c_device_id *id = i2c_client_get_device_id(client); const struct edt_i2c_chip_data *chip_data; struct edt_ft5x06_ts_data *tsdata; - u8 buf[2] = { 0xfc, 0x00 }; + unsigned int val; struct input_dev *input; unsigned long irq_flags; int error; @@ -1156,6 +1155,12 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client) return -ENOMEM; } + tsdata->regmap = regmap_init_i2c(client, &edt_ft5x06_i2c_regmap_config); + if (IS_ERR(tsdata->regmap)) { + dev_err(&client->dev, "regmap allocation failed\n"); + return PTR_ERR(tsdata->regmap); + } + chip_data = device_get_match_data(&client->dev); if (!chip_data) chip_data = (const struct edt_i2c_chip_data *)id->driver_data; @@ -1258,6 +1263,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client) tsdata->client = client; tsdata->input = input; tsdata->factory_mode = false; + i2c_set_clientdata(client, tsdata); error = edt_ft5x06_ts_identify(client, tsdata); if (error) { @@ -1269,7 +1275,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client) * Dummy read access. EP0700MLP1 returns bogus data on the first * register read access and ignores writes. */ - edt_ft5x06_ts_readwrite(tsdata->client, 2, buf, 2, buf); + regmap_read(tsdata->regmap, 0x00, &val); edt_ft5x06_ts_set_regs(tsdata); edt_ft5x06_ts_get_defaults(&client->dev, tsdata); @@ -1291,9 +1297,8 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client) if (tsdata->version == EDT_M06) tsdata->report_rate /= 10; - edt_ft5x06_register_write(tsdata, - tsdata->reg_addr.reg_report_rate, - tsdata->report_rate); + regmap_write(tsdata->regmap, tsdata->reg_addr.reg_report_rate, + tsdata->report_rate); } dev_dbg(&client->dev, @@ -1318,8 +1323,6 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client) return error; } - i2c_set_clientdata(client, tsdata); - irq_flags = irq_get_trigger_type(client->irq); if (irq_flags == IRQF_TRIGGER_NONE) irq_flags = IRQF_TRIGGER_FALLING; @@ -1357,6 +1360,7 @@ static void edt_ft5x06_ts_remove(struct i2c_client *client) struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); edt_ft5x06_ts_teardown_debugfs(tsdata); + regmap_exit(tsdata->regmap); } static int edt_ft5x06_ts_suspend(struct device *dev) @@ -1373,8 +1377,8 @@ static int edt_ft5x06_ts_suspend(struct device *dev) return 0; /* Enter hibernate mode. */ - ret = edt_ft5x06_register_write(tsdata, PMOD_REGISTER_OPMODE, - PMOD_REGISTER_HIBERNATE); + ret = regmap_write(tsdata->regmap, PMOD_REGISTER_OPMODE, + PMOD_REGISTER_HIBERNATE); if (ret) dev_warn(dev, "Failed to set hibernate mode\n"); From patchwork Sun Apr 2 20:09:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2849 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 772703F330 for ; Sun, 2 Apr 2023 22:10:25 +0200 (CEST) Received: by mail-ed1-f72.google.com with SMTP id t26-20020a50d71a000000b005003c5087casf37756105edi.1 for ; Sun, 02 Apr 2023 13:10:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680466225; cv=pass; d=google.com; s=arc-20160816; b=Rde3PbLPqFuErVq8cw8mivI+Dr2iikJGod8XHF8n1Ai9WJU+DZRIeLPnwBmKw3Eh/z c7Dre6guv9eVeGsTKgsnDVUSHs+mlEpImN4r4nBU3XgOZef7Z2NZpT57d11UNnTT+fcn 5Tkzibv9yaw8msJzcUmtEyWjvVJQmABSW1qbsVXalh+InQDQVfXUe+9nBBJHJsnGXlRa pq4wGgxLv4EAKPXi+hdmT9gC3z/h0+Bc+ERY0BrMn+CAMp0YKCvktkyf+Ra8tct9gaqS 2WyodOLTGl9qFxsLdzO9/eyehPASBH+N5i9d0Cpukt2DfJGtSRvI55TyAdx4ZMwDMEjF IKxg== 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=fNnmqD/LdCjSHcCGEp+0wqpp1Whr3zvyBWeediEnCUY=; b=Ux7tD/zFjalFsQMhgD+lYKeMDqMSGxKyDl7hUDHUDgBo6PXlVtRnOOlGBxnwqa87uS 6YRBeCEoHAVRyXhSTiRUlLro+O5+5mcXnkKfzq2x0V99y11pCNJzfXN/db9bwwEAVx3V L8TR5aNQ8kvJrK6L8llcekPe7jLBnMxPAMpPST7GIr1zK4UwgPqODYplbTLJYYKN0de+ u0Jl9zI5pxfXWQIS/hOs1Wkvp3G7YWwtSVArMdA3KUaaTrNMXfK8CVMonWsI6Z9JeWwg IDeIvUFVsxOa2mAEsBQ12PWxiRycgFogNqLo7Xtbh4c55Z4Kerldsw4/k79h98vVzPlV f+Rw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="ZX/RqwIv"; 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=1680466225; 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=fNnmqD/LdCjSHcCGEp+0wqpp1Whr3zvyBWeediEnCUY=; b=rnpzeiOVQVBSccwv0B5zpMQvbOYkG3YEnN60WUqYhf9mINjyoC94hdBcCLwNw1061u SaoPl03UPbUPOxdTUc82h//ip4en2ndJ09+Svkz+aiVnGGeHx2RuGKohKzw+LJ6O1iZW xxJ0mN/KL1/KBmke22jxXW2xdD9y5hixHhDdo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680466225; 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=fNnmqD/LdCjSHcCGEp+0wqpp1Whr3zvyBWeediEnCUY=; b=uZ8Z76mo4XFwXwbpCp5QcBm/d8p4Czqy0jokKzZYab5OHouUg/L9kUc+2TnKyqHide RtDLBZhMTb0pRP48UrYfyIfroTkrpzVzytH6nTwp5hEYGA/vYG5XtADCKjRfMhMAZj2P WRtdNEx8A2t+DeGD57R19iW9QqJfOzuHcJxXbYSHPUpMRtX3ovL0aOHuF0JlbMb6ptSr dPDLGCp9ONX7X3MMXO3S8qbRlyagvt7LzjCFhIwpMyLEbML+rnX4SgPEjpyVw2bt7WBO ovJHtCm+DdvwLMgz+OLM6dR/330i6dKSqnNhkDsO5G7mdmjKQv7iem0m3xpthkTvac5q UeJw== X-Gm-Message-State: AAQBX9cXcbI2pY4KbjeEX0ZKYZvlCNsJJys/aZYGeHvu0xGFXC+z0tJB 0NIEo85wqlxh7G7T8lkjJsT7hNik X-Google-Smtp-Source: AKy350ZgA7pGjqJL2FSDWfJjsxB52RpQUULp08z3+jpzpEMh/BSRM4X50hQLBSUsx/cN7ZwNHGEb4Q== X-Received: by 2002:a17:906:4887:b0:931:dd22:4486 with SMTP id v7-20020a170906488700b00931dd224486mr17933357ejq.8.1680466225149; Sun, 02 Apr 2023 13:10:25 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:907:c5c7:b0:93c:2338:ccdf with SMTP id ts7-20020a170907c5c700b0093c2338ccdfls4636260ejc.10.-pod-prod-gmail; Sun, 02 Apr 2023 13:10:24 -0700 (PDT) X-Received: by 2002:a17:907:a04:b0:947:bf71:a548 with SMTP id bb4-20020a1709070a0400b00947bf71a548mr8370411ejc.4.1680466223737; Sun, 02 Apr 2023 13:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680466223; cv=none; d=google.com; s=arc-20160816; b=tXaQKWybTWfqAkNk3CGoKvyWxbju4NOwlZjarekonkGEDlddD3G+zhfPXjTMfM5F5d H53sH57RLfiqbZID3LKZG3TlAY4FSWNdzSQzYR9qxKukm1PeN+t+T9CUmoDNcVSwPxqN KALT0CY6UNx7bORP9BozZ+/1Y5veftrgk2MKdH50zyV5gEVl88FSKH1rkTDjrLQbFFlx zoGcEopnjETZAihQKv/CQrKiaIHVngglgnhILSky/LSO0X8uFHL1W7qSQBSBboqU1eK5 Ck3PeENj/clxpX8w5ohPyWagvN+d9GobgCZfthSjcCBjo/UXFcGDAsJ1IEyz1hSmdr6+ nzaw== 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=vKHTsVqE1aT1cdcOBW/aMh8k9NVa86bMl3ifc5Yx2Wk=; b=qHxH0CQy0+Wbmd/VKkA0v+1+64z928CooMh7mUsxyVVjUmZ2h58g7MIQu6xKUOaKLz il+swoOdlPiBdV1zG988SAVTItFdjWCcSt5IWFIcBuh96wWPWurIrKm3FiIy4FOo9cUT Gx1OJ6slzSHtG42hL4BtghIfl0mkVuoPI3ZbCYkzxdeTnFaWsBnekFEmvJQbtzb/wy+r 9Dd8Pdgj2Vx+DV7CpsIn1ZvyF14z5D9lUq3C8plCrhpo72b3tzEWQ0KYxhnai+OT62Ms 5VtueBZ9T5YW0+K/hgbhbkolAlQIZjOciEMKnxl0nzAXU/zU6gXDYIOdzBuTTUUZ74B4 C8Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="ZX/RqwIv"; 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 og42-20020a1709071dea00b008e9d29ca1e9sor3981401ejc.31.2023.04.02.13.10.23 for (Google Transport Security); Sun, 02 Apr 2023 13:10:23 -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:4a4e:b0:889:1eb1:7517 with SMTP id a14-20020a1709064a4e00b008891eb17517mr35894731ejv.30.1680466223564; Sun, 02 Apr 2023 13:10:23 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Apr 2023 13:10:23 -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 8/9] Input: edt-ft5x06 - unify the crc check Date: Sun, 2 Apr 2023 22:09:50 +0200 Message-Id: <20230402200951.1032513-9-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="ZX/RqwIv"; 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: , With this patch, the CRC is always verified by the same function, even in the case of accessing registers where the number of bytes is minimal. Signed-off-by: Dario Binacchi --- drivers/input/touchscreen/edt-ft5x06.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index 8aae4c1e6b73..fdb32e3591be 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -240,13 +240,10 @@ static int edt_M06_i2c_read(void *context, const void *reg_buf, size_t reg_size, if (!edt_ft5x06_ts_check_crc(tsdata, val_buf, val_size)) return -EIO; } else if (reg_read) { - u8 crc = wbuf[0] ^ wbuf[1] ^ rbuf[0]; - - if (crc != rbuf[1]) { - dev_err(dev, "crc error: 0x%02x expected, got 0x%02x\n", - crc, rbuf[1]); + wbuf[2] = rbuf[0]; + wbuf[3] = rbuf[1]; + if (!edt_ft5x06_ts_check_crc(tsdata, wbuf, 4)) return -EIO; - } *((u8 *)val_buf) = rbuf[0]; } From patchwork Sun Apr 2 20:09:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2850 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 3AB4A3F330 for ; Sun, 2 Apr 2023 22:10:27 +0200 (CEST) Received: by mail-ed1-f72.google.com with SMTP id k14-20020a508ace000000b005024a8cef5csf27156427edk.22 for ; Sun, 02 Apr 2023 13:10:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680466227; cv=pass; d=google.com; s=arc-20160816; b=itsMcNLV3fcTqRv3t4wzVSCqa/+/Hxi14DdqdnGmo4/se0oYw4bd7VY5OCgbeSw9QR l/EqGrvKig5yhtTrIgTV8wqnTTztpGGvww2EnMRvbl3H7zxtvZ7zzSAetl2N7y/dvTaA IAeojWId6Zs1c3/s4gbfARMY9OaVfViE5yK7XE9fBs6/5gNCS+aoAvjB4Tt7Ae3sJ7ld YpeQKzNrH8iwC7hClYiWBnWySWoUezTlZ5wgv2tGL8dEZqyTGN7F9kw5Y6SFBLffy9zH GF8cD5znHazsLk9b4ASuBDK+zH5EQZwkzhQ79WPq1ssyruBipeRCkMo4ot0oXnVs+WiT 9PqA== 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=ZdIN97FOGaeK9g7TRdA4p2V5boMt7VyLB2a5XDPpxy0=; b=nqosn+CUWHlrV63ziwSTssz083nGSpRBJr7G+paqadaIFEWHLOkTFs3IBzTpKm3zxN O7RLVjHdUsMrY1wuJbeU/ttyJpY/8yi68Fu0JKiVxDCBBF78cucsVW6JZU/YEXkZzpZV QnYkwQruvJ4DDJfFyn8N/hTVPBGOHDyZQzbAH75Fb90sq5E9Hxuv/GSCY6M0xYiFtdWY IlKpi1QiaaStmn+RmlR5sON5XWXh9U3pYregHK7iHA9lSOS5aTMBbhvYloMEDazSlUI1 j11B3oMbeT5agOYTAYyDAseAJrENqMEr7mQyTe/JOu9fGcNWOiHdTauAfC9cAsuMC7C2 MnmA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=KemN7IfE; 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=1680466227; 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=ZdIN97FOGaeK9g7TRdA4p2V5boMt7VyLB2a5XDPpxy0=; b=OAPZlBg0llUN9KfxuQdR9m/XxPnkWua6XTchjenQ9HZriq+4PcQwynFEcCgq1F56pd 999MLZKJlKVIlhrNlheHzl6WWRBzLXPvn8BHzHmAG7DgyYrvkkMkiaHdtYDA0fQBdcdX 3bsWLOabZPHmbbPOBJieO+EO0mjI8PO4WXCyM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680466227; 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=ZdIN97FOGaeK9g7TRdA4p2V5boMt7VyLB2a5XDPpxy0=; b=A6Wl5MCzgX3TWTYzrkIkcWZoE+RPh/u8N/ielhJdSfxblGuKLQzBHrnL+EfXwwz6kP zh1wKbmWQVsXXZ7jJjSpS7BkdesYhcdXZ8WDwI/w0AY2knkVCXIir56DcKlSs3nJYqEJ i28+Ksyf/HigRL6qSZU/AB3Lj6W/ybjtcpInT2QAqLh2fZ/SqcA41/jJm+2IB2GrUSl6 vKxGyWdoyLuzY/TFQfzZCmNzXbjO5ZCaBdqrRnSpf8uUrAXPQF6O9tEzrI4Btm95gjUi ngFzHUV9NIKrBtb51LM4br5vZgtq3r63rWnY6LlOiDqEZxVtVhlYus5/d9CJIlYjrSB9 gv3Q== X-Gm-Message-State: AAQBX9fDVhQYqU2SRWeK/FOZMfoDvXSiMKNQT6ZWse8vzKDOKUyhn7V7 zKGppt53bDyrDg4+vKUwuQzA0sUe X-Google-Smtp-Source: AKy350Z8Wn2ue9nxfK8VQvCKV+QXduoe+HS6iqkiNnPv6vu7jxEAT7PWaNct+r7cW21n7yQqHitPwg== X-Received: by 2002:a17:906:da81:b0:93f:82cb:fe44 with SMTP id xh1-20020a170906da8100b0093f82cbfe44mr15867729ejb.11.1680466227120; Sun, 02 Apr 2023 13:10:27 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:907:1b02:b0:934:1f7e:b3c0 with SMTP id mp2-20020a1709071b0200b009341f7eb3c0ls4642356ejc.2.-pod-prod-gmail; Sun, 02 Apr 2023 13:10:26 -0700 (PDT) X-Received: by 2002:a17:907:9d1a:b0:8a5:8620:575 with SMTP id kt26-20020a1709079d1a00b008a586200575mr33230165ejc.3.1680466225300; Sun, 02 Apr 2023 13:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680466225; cv=none; d=google.com; s=arc-20160816; b=P39Iz18WE3/P7CT9Gu4sbIYN8NV2ZIlDw2SlnmTZlpq4uhZTAewW2m62eHjBnnrrkm Ck52/dDTgWcINguJ4v91X4dq+9LigwLfvqMd7oO0FjtGzwmzRD/POHudvTv3l+XEVmD5 NW5DuuP2khmOV8DGlwdUUAB06qUn1wkTehaAXiTmIYndkIC8GsQBsypilHCbBWxGQq9V DGq9vaO0ic0rjijmzfQlnFK2ZsPmWeC52SLEYspB+xC8DhO4lSt14CLl0AEqrV9/ZeG0 hB6ma8swinPHaBfoC4D4sXlAMt30WtpU+5Dv+4QfVb2UCX0Vd0JF/zb0DGPkAu1+aqOl 8Q9g== 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=YKRIdGHuZOd/fQcotLl6knbHASupHjbM4BeF84H3jy8=; b=aM/YDeUc60uGc3aFUZuVGx+LqUjThGw2RhXzpyXaBEApgxSQbQCd/m+xe8MrGD7G+/ o36PflXVl67whOG0YLlbLO9sm8rGSdFp4Dkb2ERtNgZ+rjWq0jmdCO1a13kDOXdrRku+ uaXd+eqnNLgBCciN4tq+T7D6vzNODGXFI1r/a38fSVJB2um+fqEi4WTthBZEoUEa8zJq S8+0FRu3vqdwd3QA38cgzUYKp0lVcLNcsso3xMhU63ASmIm5XoBG6sbgqz7W8FsJA2o9 6pW2bISn1NesW1XWCx5g2WZEjMjT8OYQOuIMXsnAHNRG0DP0xrR7hQSCfgog14Y+PA6t /jHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=KemN7IfE; 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 hq33-20020a1709073f2100b008b17aa9ce7fsor4047292ejc.99.2023.04.02.13.10.25 for (Google Transport Security); Sun, 02 Apr 2023 13:10:25 -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:4796:b0:93f:3084:d6f with SMTP id cw22-20020a170906479600b0093f30840d6fmr34022998ejc.18.1680466224998; Sun, 02 Apr 2023 13:10:24 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Apr 2023 13:10:24 -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 9/9] Input: edt-ft5x06: Calculate points data length only once Date: Sun, 2 Apr 2023 22:09:51 +0200 Message-Id: <20230402200951.1032513-10-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=KemN7IfE; 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: , It is pointless and expensive to calculate data in the interrupt that depends on the type of touchscreen, which is detected on the driver probe and cannot then be changed. So calculate the size of the data buffer on the driver probe, as well as the data retrieval command, and then use them in the ISR. Signed-off-by: Dario Binacchi --- drivers/input/touchscreen/edt-ft5x06.c | 56 +++++++++++++------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index fdb32e3591be..24ab9e9f5b21 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -135,6 +135,10 @@ struct edt_ft5x06_ts_data { int offset_y; int report_rate; int max_support_points; + int point_len; + u8 tdata_cmd; + int tdata_len; + int tdata_offset; char name[EDT_NAME_LEN]; char fw_version[EDT_NAME_LEN]; @@ -296,38 +300,13 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id) { struct edt_ft5x06_ts_data *tsdata = dev_id; struct device *dev = &tsdata->client->dev; - u8 cmd; u8 rdbuf[63]; int i, type, x, y, id; - int offset, tplen, datalen, crclen; int error; - switch (tsdata->version) { - case EDT_M06: - cmd = 0xf9; /* tell the controller to send touch data */ - offset = 5; /* where the actual touch data starts */ - tplen = 4; /* data comes in so called frames */ - crclen = 1; /* length of the crc data */ - break; - - case EDT_M09: - case EDT_M12: - case EV_FT: - case GENERIC_FT: - cmd = 0x0; - offset = 3; - tplen = 6; - crclen = 0; - break; - - default: - goto out; - } - memset(rdbuf, 0, sizeof(rdbuf)); - datalen = tplen * tsdata->max_support_points + offset + crclen; - - error = regmap_bulk_read(tsdata->regmap, cmd, rdbuf, datalen); + error = regmap_bulk_read(tsdata->regmap, tsdata->tdata_cmd, rdbuf, + tsdata->tdata_len); if (error) { dev_err_ratelimited(dev, "Unable to fetch data, error: %d\n", error); @@ -335,7 +314,7 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id) } for (i = 0; i < tsdata->max_support_points; i++) { - u8 *buf = &rdbuf[i * tplen + offset]; + u8 *buf = &rdbuf[i * tsdata->point_len + tsdata->tdata_offset]; type = buf[0] >> 6; /* ignore Reserved events */ @@ -1071,6 +1050,26 @@ static void edt_ft5x06_ts_get_parameters(struct edt_ft5x06_ts_data *tsdata) } } +static void edt_ft5x06_ts_set_tdata_parameters(struct edt_ft5x06_ts_data *tsdata) +{ + int crclen; + + if (tsdata->version == EDT_M06) { + tsdata->tdata_cmd = 0xf9; + tsdata->tdata_offset = 5; + tsdata->point_len = 4; + crclen = 1; + } else { + tsdata->tdata_cmd = 0x0; + tsdata->tdata_offset = 3; + tsdata->point_len = 6; + crclen = 0; + } + + tsdata->tdata_len = tsdata->point_len * tsdata->max_support_points + + tsdata->tdata_offset + crclen; +} + static void edt_ft5x06_ts_set_regs(struct edt_ft5x06_ts_data *tsdata) { struct edt_reg_addr *reg_addr = &tsdata->reg_addr; @@ -1274,6 +1273,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client) */ regmap_read(tsdata->regmap, 0x00, &val); + edt_ft5x06_ts_set_tdata_parameters(tsdata); edt_ft5x06_ts_set_regs(tsdata); edt_ft5x06_ts_get_defaults(&client->dev, tsdata); edt_ft5x06_ts_get_parameters(tsdata);