Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp454741imw; Thu, 14 Jul 2022 04:49:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sHUHOXXlOjq2kuwF4Cvzn+aXfONW+8fU8MURovhteZLFTabuE3T30IMrT7xxYtvvCcDohO X-Received: by 2002:a05:6a00:430d:b0:52a:b6fc:3d19 with SMTP id cb13-20020a056a00430d00b0052ab6fc3d19mr7924857pfb.18.1657799369036; Thu, 14 Jul 2022 04:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657799369; cv=none; d=google.com; s=arc-20160816; b=bPu8xc9oP6jniG7cfD5mvZREXo4AflCsCUYKzEbJuZGhoGwm4FhldcwvbjGAmQeU4s pqK0BOsDFHUCgqs/zY4A9li550/GDuKT9/uyKNDSanhvr30bT90JAjYArnLTMnTVvQWl QC5zYrymVz0w4S+QZr9UkA9mx71UpvAnpRKDWVpWnY3HwdAYGLpSK7u5tC1TRaoIVKho bFqMN0s4AhMjSXffRTmEW2gnvv5EOtt7dCqONcUSLbjtjmG9ahtgbEq/IeH0pTQDFxVe tVvvJk6fxj5kqR2h2TkCKLhse6xny1JaXobNsDfSmDTuatDdfA8ZMI9GZApzE3xR5jiG nefw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=iK2zPs+SMEnNmCINcLIm/Vzxema5hdWig8A2KEUdX8w=; b=nU7HsqVZ/2y3W3n29skS6wdwLtT+Ic7AX+DOiHZHv7D2KuDmd2OPNtedNfJHpQWmw+ mSS5X5Unq4kInD4Tiq6i6XM2wFNc1+usGu4lIQeGP+ZgcrbYr3/xnZJBQMEHzH/W47mK /krZJ9MyOKZ9q3ypWizkH85aI1fJtapmIZMzvH+r2Xuov2SE4zUwhJ7+gFRH6lFVxHIE J8Nn2ZmSBibeSiCKfVzA64Bwn2dPf2zDN/xswbAvrfAfOnfFSniSvLLnm6B/nu0Dpb2S biOfJ3lKXnNf6+pjDYOTY8fZOSgmH3M+bHTXP+ADQn9mIhdiH/BwJWpTkkS123XMdGLF F1RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Bee0U2Hy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o28-20020a635d5c000000b0041203feea99si1539296pgm.238.2022.07.14.04.49.16; Thu, 14 Jul 2022 04:49:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Bee0U2Hy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237954AbiGNLfD (ORCPT + 99 others); Thu, 14 Jul 2022 07:35:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238952AbiGNLez (ORCPT ); Thu, 14 Jul 2022 07:34:55 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDEFF599FE; Thu, 14 Jul 2022 04:34:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657798494; x=1689334494; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=UYKVusdjN3uJPbVd5bXgJk3qFGpE1Ln3ZbTd6vEktCY=; b=Bee0U2HyoRZ1PV0jpvSRseIab7mGt1Qg2JJKas6RuoXPiWUqyItZz4/9 drs44hpAfmH7pyfWR8tRuyEiHbw/xcX1XHgt6xkT1WDq++N1n9W8Dvcei /VkecMoHnEjFQHMffPgYzthO4ZwIkRnio6+xKFBBHHQmuCd/rIRFVMrvV 6xoPONRFPv2DISt+zJWK2+59oYtp3lB/HON0v3Hshv+BKQ1OD2yPWCYw9 9xLXBTztUGdgAjiiZ5RhX8ZqY0rxt/EfNQlHTTxGAeB20D5i6NzAmn3yE nctx/+MKijEUwXPjOelbA7hGQIdk5IXAsgRtBnWJVUCxdrqAWzmzeK/Ct g==; X-IronPort-AV: E=McAfee;i="6400,9594,10407"; a="347168181" X-IronPort-AV: E=Sophos;i="5.92,271,1650956400"; d="scan'208";a="347168181" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2022 04:34:42 -0700 X-IronPort-AV: E=Sophos;i="5.92,271,1650956400"; d="scan'208";a="722694140" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2022 04:34:39 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1oBx76-001DCE-2h; Thu, 14 Jul 2022 14:34:36 +0300 Date: Thu, 14 Jul 2022 14:34:36 +0300 From: Andy Shevchenko To: Luca Ellero Cc: dmitry.torokhov@gmail.com, daniel@zonque.org, m.felsch@pengutronix.de, u.kleine-koenig@pengutronix.de, mkl@pengutronix.de, miquel.raynal@bootlin.com, imre.deak@nokia.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ellero Subject: Re: [PATCH 2/3] ads7846: always set last command to PWRDOWN Message-ID: References: <20220714084319.107334-1-luca.ellero@brickedbrain.com> <20220714084319.107334-3-luca.ellero@brickedbrain.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220714084319.107334-3-luca.ellero@brickedbrain.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 14, 2022 at 10:43:18AM +0200, Luca Ellero wrote: > From: Luca Ellero > > This was broken on controllers with 3 commands as ads7845. > READ_Z1 was sent instead. What is "This"? Please, make commit message more understandable by its own. With that fixed, Reviewed-by: Andy Shevchenko > Signed-off-by: Luca Ellero > --- > drivers/input/touchscreen/ads7846.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c > index 24605c40d039..9e15cdf6faa0 100644 > --- a/drivers/input/touchscreen/ads7846.c > +++ b/drivers/input/touchscreen/ads7846.c > @@ -1066,6 +1066,9 @@ static int ads7846_setup_spi_msg(struct ads7846 *ts, > struct ads7846_buf_layout *l = &packet->l[cmd_idx]; > unsigned int max_count; > > + if (cmd_idx == packet->cmds - 1) > + cmd_idx = ADS7846_PWDOWN; > + > if (ads7846_cmd_need_settle(cmd_idx)) > max_count = packet->count + packet->count_skip; > else > @@ -1102,7 +1105,12 @@ static int ads7846_setup_spi_msg(struct ads7846 *ts, > > for (cmd_idx = 0; cmd_idx < packet->cmds; cmd_idx++) { > struct ads7846_buf_layout *l = &packet->l[cmd_idx]; > - u8 cmd = ads7846_get_cmd(cmd_idx, vref); > + u8 cmd; > + > + if (cmd_idx == packet->cmds - 1) > + cmd_idx = ADS7846_PWDOWN; > + > + cmd = ads7846_get_cmd(cmd_idx, vref); > > for (b = 0; b < l->count; b++) > packet->tx[l->offset + b].cmd = cmd; > -- > 2.25.1 > -- With Best Regards, Andy Shevchenko